diff --git a/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.html b/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.html index 32e2534cd..5cfd6fd5f 100644 --- a/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.html +++ b/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.html @@ -77,12 +77,12 @@ \ No newline at end of file diff --git a/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.ts b/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.ts index e5e954944..ae43067a5 100644 --- a/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.ts +++ b/src/pages/integrations/shapeshift/shapeshift-confirm/shapeshift-confirm.ts @@ -35,6 +35,7 @@ export class ShapeshiftConfirmPage { private configWallet: any; private bitcore: any; private bitcoreCash: any; + private useSendMax: boolean; public currencyIsoCode: string; public isCordova: boolean; @@ -72,11 +73,13 @@ export class ShapeshiftConfirmPage { private walletProvider: WalletProvider ) { this.configWallet = this.configProvider.get().wallet; - this.currencyIsoCode = this.configWallet.settings.alternativeIsoCode; + this.currencyIsoCode = 'USD'; // Only USD this.isCordova = this.platformProvider.isCordova; this.bitcore = this.bwcProvider.getBitcore(); this.bitcoreCash = this.bwcProvider.getBitcoreCash(); + this.useSendMax = this.navParams.data.useSendMax ? true : false; + this.amount = this.navParams.data.amount / 1e8; this.currency = this.navParams.data.currency; this.fromWalletId = this.navParams.data.walletId; @@ -94,6 +97,9 @@ export class ShapeshiftConfirmPage { this.shapeshiftProvider.getLimit(this.getCoinPair(), (err: any, lim: any) => { let min = Number(lim.min); let max = Number(lim.limit); + + if (this.useSendMax) this.amount = max; + let amountNumber = Number(this.amount); if (amountNumber < min) { diff --git a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts index de3d368d2..0bb770345 100644 --- a/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts +++ b/src/pages/integrations/shapeshift/shapeshift-shift/shapeshift-shift.ts @@ -27,7 +27,7 @@ export class ShapeshiftShiftPage { public fromWallet: any; public toWallet: any; public rate: number; - public limit: number; + public limit: any; public network: string; public fromWalletSelectorTitle: string; public toWalletSelectorTitle: string; @@ -94,7 +94,7 @@ export class ShapeshiftShiftPage { this.shapeshiftProvider.getRate(pair, (err: any, rate: number) => { this.rate = rate; }); - this.shapeshiftProvider.getLimit(pair, (err: any, limit: number) => { + this.shapeshiftProvider.getLimit(pair, (err: any, limit: any) => { this.limit = limit; }); } @@ -115,7 +115,9 @@ export class ShapeshiftShiftPage { coin: this.fromWallet.coin, walletId: this.fromWallet.id, toWalletId: this.toWallet.id, - currency: this.fromWallet.coin.toUpperCase() + currency: this.fromWallet.coin.toUpperCase(), + shiftMax: this.limit.limit + ' ' + this.fromWallet.coin.toUpperCase(), + shiftMin: this.limit.min + ' ' + this.fromWallet.coin.toUpperCase() }); } diff --git a/src/pages/integrations/shapeshift/shapeshift.html b/src/pages/integrations/shapeshift/shapeshift.html index 59771ebe3..ecd35075a 100644 --- a/src/pages/integrations/shapeshift/shapeshift.html +++ b/src/pages/integrations/shapeshift/shapeshift.html @@ -1,6 +1,6 @@ - shapeshift + shapeShift diff --git a/src/pages/send/amount/amount.html b/src/pages/send/amount/amount.html index 0dbd736df..3916405f0 100644 --- a/src/pages/send/amount/amount.html +++ b/src/pages/send/amount/amount.html @@ -44,6 +44,11 @@ Amount +
+
Min: {{shiftMin}}
+
Max: {{shiftMax}}
+
+
{{expression || '0.00'}} {{unit}} diff --git a/src/pages/send/amount/amount.ts b/src/pages/send/amount/amount.ts index 2ecd78ca6..445c044a7 100644 --- a/src/pages/send/amount/amount.ts +++ b/src/pages/send/amount/amount.ts @@ -34,6 +34,9 @@ export class AmountPage { public expression: any; public amount: any; public showExpressionResult: boolean; + public shiftMax: number; + public shiftMin: number; + public showSendMax: boolean; public allowSend: boolean; public recipientType: string; @@ -60,6 +63,7 @@ export class AmountPage { private configProvider: ConfigProvider, private rateProvider: RateProvider, ) { + this.showSendMax = false; this.config = this.configProvider.get(); this.recipientType = this.navParams.data.recipientType; this.showRecipient = true; @@ -84,6 +88,8 @@ export class AmountPage { // Use only with ShapeShift this.toWalletId = this.navParams.data.toWalletId; + this.shiftMax = this.navParams.data.shiftMax; + this.shiftMin = this.navParams.data.shiftMin; let unit = this.navParams.data.currency ? this.navParams.data.currency : this.config.wallet.settings.alternativeIsoCode; this.availableUnits.push(this.coin.toUpperCase()); @@ -142,10 +148,12 @@ export class AmountPage { nextPage = BuyMercadoLibrePage; break; case 'ShapeshiftConfirmPage': + this.showSendMax = true; this.showRecipient = false; nextPage = ShapeshiftConfirmPage; break; default: + this.showSendMax = true; nextPage = ConfirmPage; } return nextPage;