diff --git a/docs/index.html b/docs/index.html
index 637e78f..c0086e3 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1694,7 +1694,7 @@
}
}
catch (err) {
- if ((err.data || err) === 'Insufficiant token balance' && asset === 'rupee') {
+ if ((err.data || err) === 'Insufficient token balance' && asset === 'rupee') {
showWalletResult('error', `Failed`, err.data || err, 'open-upi')
} else {
showWalletResult('error', `Failed`, err.data || err)
diff --git a/docs/scripts/floTokenAPI.js b/docs/scripts/floTokenAPI.js
index 3233279..2abcb36 100644
--- a/docs/scripts/floTokenAPI.js
+++ b/docs/scripts/floTokenAPI.js
@@ -1,9 +1,9 @@
'use strict';
/* Token Operator to send/receive tokens from blockchain using API calls*/
-(function(GLOBAL) {
+(function (GLOBAL) {
const floTokenAPI = GLOBAL.floTokenAPI = {
- fetch_api: function(apicall) {
+ fetch_api: function (apicall) {
return new Promise((resolve, reject) => {
console.log(floGlobals.tokenURL + apicall);
fetch(floGlobals.tokenURL + apicall).then(response => {
@@ -14,14 +14,14 @@
}).catch(error => reject(error))
})
},
- getBalance: function(floID, token = floGlobals.currency) {
+ getBalance: function (floID, token = floGlobals.currency) {
return new Promise((resolve, reject) => {
this.fetch_api(`api/v1.0/getFloAddressBalance?token=${token}&floAddress=${floID}`)
.then(result => resolve(result.balance || 0))
.catch(error => reject(error))
})
},
- getTx: function(txID) {
+ getTx: function (txID) {
return new Promise((resolve, reject) => {
this.fetch_api(`api/v1.0/getTransactionDetails/${txID}`).then(res => {
if (res.result === "error")
@@ -35,14 +35,14 @@
}).catch(error => reject(error))
})
},
- sendToken: function(privKey, amount, receiverID, message = "", token = floGlobals.currency) {
+ sendToken: function (privKey, amount, receiverID, message = "", token = floGlobals.currency) {
return new Promise((resolve, reject) => {
let senderID = floCrypto.getFloID(privKey);
if (typeof amount !== "number" || amount <= 0)
return reject("Invalid amount");
this.getBalance(senderID, token).then(bal => {
if (amount > bal)
- return reject("Insufficiant token balance");
+ return reject(`Insufficient ${token} balance`);
floBlockchainAPI.writeData(senderID, `send ${amount} ${token}# ${message}`, privKey, receiverID)
.then(txid => resolve(txid))
.catch(error => reject(error))