Skip to content

Commit b8028ca

Browse files
1.0.0-beta: Auto stash before merge of "1.0.0-beta" and "31-navtech-max-amount"
hardcoded in some limits for navtech.
1 parent 95ed068 commit b8028ca

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/js/controllers/confirmPrivate.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ angular.module('copayApp.controllers').controller('confirmPrivateController', fu
189189
ongoingProcess.set('Finding NavTech Server', false);
190190
if (!success) {
191191
//@TODO finish this tree
192-
setNoWallet('Could not connect to NavTech servers. Only normal transactions are available right now.');
193-
console.log('Something went wrong, do you want to send a regular transaction?'); return;
192+
setNoWallet('NavTech Error: ' + data.message);
193+
return;
194194
}
195195

196196
$scope.navtechFeePercent = serverInfo.navtechFeePercent;
@@ -223,7 +223,6 @@ angular.module('copayApp.controllers').controller('confirmPrivateController', fu
223223
tx.toAmount = Math.floor($scope.feeNavtech + tx.toAmount);
224224
}
225225

226-
console.log('amountUnsafe', amountUnsafe, $scope.countDecimals(amountUnsafe));
227226
if ($scope.countDecimals(amountUnsafe) > 8) {
228227
$scope.amountStr = $filter('number')(amountUnsafe, 8);
229228
} else {

src/js/services/navTechService.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ NavTechService.prototype._checkNode = function(availableServers, numAddresses, c
7070
minAmount: res.data.min_amount,
7171
navtechFeePercent: res.data.transaction_fee,
7272
}
73+
7374
callback(res.data, self, 0);
7475
} else {
7576
console.log('Bad response from navtech server ' + availableServers[randomIndex], res);
@@ -178,6 +179,17 @@ NavTechService.prototype.findNode = function(amount, address, callback) {
178179
callback(false, { message: 'invalid params' });
179180
return;
180181
}
182+
183+
if (amount < 5 * 1e8) { //@TODO move this to the server response.
184+
callback(false, { message: 'Amount is too small, minimum is 5 NAV' });
185+
return;
186+
}
187+
188+
if(amount > 10000 * 1e8) { //@TODO move this to the server response.
189+
callback(false, { message: 'Amount is too large, maximum is 10,000 NAV' });
190+
return;
191+
}
192+
181193
var self = this;
182194
self.runtime = {};
183195
self.runtime.callback = callback;

0 commit comments

Comments
 (0)