diff --git a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.html b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.html index ba10c3ceb..b1efbac0e 100644 --- a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.html +++ b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.html @@ -91,7 +91,17 @@ - Limit + Deposit Min + + ... + + {{limit.minimum}} {{fromWallet.coin | uppercase}} + + + + + + Deposit Max ... @@ -101,20 +111,32 @@ - Minimum + Miner fee ... - {{limit.min}} {{fromWallet.coin | uppercase}} + {{limit.minerFee}} {{fromWallet.coin | uppercase}} - +
+ + + +
+

+ I agree to the + Terms + and certify that I am the beneficial owner of the input assets and the destination address. +

+
+
+
- diff --git a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.scss b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.scss index 5d21e9339..c348d1524 100644 --- a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.scss +++ b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.scss @@ -20,4 +20,31 @@ page-shapeshift-shift { display: block; } } + .agree-to-terms { + position: relative; + ion-item { + height: 6rem; + .check { + margin: 9px 15px 9px 4px !important; + } + } + .terms { + display: flex; + align-items: center; + height: 6rem; + position: absolute; + top: 0; + left: 5rem; + padding: 0rem; + margin: 0rem; + p { + padding-right: 1rem; + font-size: 12px; + } + a { + font-weight: bold; + cursor: pointer; + } + } + } } diff --git a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts index 960da8bfc..91d6d5b64 100644 --- a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts +++ b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts @@ -7,6 +7,7 @@ import * as _ from 'lodash'; import { AmountPage } from './../../../send/amount/amount'; // Providers +import { ExternalLinkProvider } from '../../../../providers/external-link/external-link'; import { PopupProvider } from '../../../../providers/popup/popup'; import { ProfileProvider } from '../../../../providers/profile/profile'; import { ShapeshiftProvider } from '../../../../providers/shapeshift/shapeshift'; @@ -29,9 +30,11 @@ export class ShapeshiftShiftPage { public network: string; public fromWalletSelectorTitle: string; public toWalletSelectorTitle: string; + public termsAccepted: boolean; constructor( private events: Events, + private externalLinkProvider: ExternalLinkProvider, private logger: Logger, private navCtrl: NavController, private popupProvider: PopupProvider, @@ -42,6 +45,7 @@ export class ShapeshiftShiftPage { this.walletsBch = []; this.fromWalletSelectorTitle = 'From'; this.toWalletSelectorTitle = 'To'; + this.termsAccepted = false; this.network = this.shapeshiftProvider.getNetwork(); this.walletsBtc = this.profileProvider.getWallets({ @@ -62,8 +66,9 @@ export class ShapeshiftShiftPage { } this.fromWallets = _.filter(this.walletsBtc.concat(this.walletsBch), (w: any) => { - // Available balance and 1-signature wallet - return w.status.balance.availableAmount > 0 && w.credentials.m == 1; + // Available cached funds + let hasCachedFunds = w.cachedBalance.match(/0\.00 /gi) ? false : true; + return hasCachedFunds; }); this.onFromWalletSelect(this.fromWallets[0]); @@ -73,6 +78,11 @@ export class ShapeshiftShiftPage { this.logger.info('ionViewDidLoad ShapeshiftShiftPage'); } + public openTerms() { + let url = "https://info.shapeshift.io/sites/default/files/ShapeShift_Terms_Conditions%20v1.1.pdf"; + this.externalLinkProvider.open(url); + } + private showErrorAndBack(title: string, msg: any): void { title = title ? title : 'Error'; // TODO: gettextCatalog this.logger.error(msg); @@ -90,7 +100,7 @@ export class ShapeshiftShiftPage { this.shapeshiftProvider.getRate(pair, (err: any, rate: number) => { this.rate = rate; }); - this.shapeshiftProvider.getLimit(pair, (err: any, limit: any) => { + this.shapeshiftProvider.getMarketInfo(pair, (err: any, limit: any) => { this.limit = limit; }); } @@ -105,6 +115,9 @@ export class ShapeshiftShiftPage { } public setAmount(): void { + if (!this.termsAccepted) { + return; + } this.navCtrl.push(AmountPage, { nextPage: 'ShapeshiftConfirmPage', fixedUnit: true, @@ -113,7 +126,7 @@ export class ShapeshiftShiftPage { toWalletId: this.toWallet.id, currency: this.fromWallet.coin.toUpperCase(), shiftMax: this.limit.limit + ' ' + this.fromWallet.coin.toUpperCase(), - shiftMin: this.limit.min + ' ' + this.fromWallet.coin.toUpperCase() + shiftMin: this.limit.minimum + ' ' + this.fromWallet.coin.toUpperCase() }); } diff --git a/src/pages/integrations/shapeshift/shapeshift.html b/src/pages/integrations/shapeshift/shapeshift.html index e3a9e4208..3c0df2394 100644 --- a/src/pages/integrations/shapeshift/shapeshift.html +++ b/src/pages/integrations/shapeshift/shapeshift.html @@ -31,7 +31,15 @@
- @@ -58,4 +66,4 @@ - + \ No newline at end of file diff --git a/src/pages/integrations/shapeshift/shapeshift.scss b/src/pages/integrations/shapeshift/shapeshift.scss index cb2aed4ea..7ae2c5f36 100644 --- a/src/pages/integrations/shapeshift/shapeshift.scss +++ b/src/pages/integrations/shapeshift/shapeshift.scss @@ -49,9 +49,17 @@ page-shapeshift { img { width: 30px; } - ion-label { + &-btn .label { display: flex; align-items: center; } + .help .label { + text-align: center; + white-space: normal; + font-size: 12px; + span { + margin-right: 0.6rem; + } + } } } diff --git a/src/pages/send/amount/amount.html b/src/pages/send/amount/amount.html index 0478cea77..b21a8af14 100644 --- a/src/pages/send/amount/amount.html +++ b/src/pages/send/amount/amount.html @@ -41,7 +41,7 @@ Amount -
+
Min: {{shiftMin}}
Max: {{shiftMax}}
@@ -92,4 +92,4 @@
- + \ No newline at end of file diff --git a/src/pages/send/amount/amount.scss b/src/pages/send/amount/amount.scss index c5dbdea37..1cdd237ff 100644 --- a/src/pages/send/amount/amount.scss +++ b/src/pages/send/amount/amount.scss @@ -4,6 +4,9 @@ page-amount { padding: 18px 16px 0; font-size: 18px; } + .shapeshift-values { + padding: 1.7rem; + } .amount-content { display: flex; flex-direction: column; diff --git a/src/providers/on-going-process/on-going-process.ts b/src/providers/on-going-process/on-going-process.ts index 9054930d3..630c718b0 100644 --- a/src/providers/on-going-process/on-going-process.ts +++ b/src/providers/on-going-process/on-going-process.ts @@ -20,6 +20,7 @@ export class OnGoingProcessProvider { 'calculatingFee': 'Calculating fee', 'connectingCoinbase': 'Connecting to Coinbase...', 'connectingGlidera': 'Connecting to Glidera...', + 'connectingShapeshift': 'Connecting to Shapeshift...', 'creatingTx': 'Creating transaction', 'creatingWallet': 'Creating Wallet...', 'deletingWallet': 'Deleting Wallet...', diff --git a/src/providers/shapeshift/shapeshift.ts b/src/providers/shapeshift/shapeshift.ts index 76901732f..9ef392d3b 100644 --- a/src/providers/shapeshift/shapeshift.ts +++ b/src/providers/shapeshift/shapeshift.ts @@ -134,6 +134,16 @@ export class ShapeshiftProvider { }); } + public getMarketInfo(pair: string, cb) { + this.http.get(this.credentials.API_URL + '/marketinfo/' + pair).subscribe((data: any) => { + this.logger.info('Shapeshift MARKET INFO: SUCCESS'); + return cb(null, data); + }, (data: any) => { + this.logger.error('Shapeshift MARKET INFO ERROR', data.error.message); + return cb(data); + }); + } + public getStatus(addr: string, cb) { this.http.get(this.credentials.API_URL + '/txStat/' + addr).subscribe((data: any) => { this.logger.info('Shapeshift STATUS: SUCCESS');