From 237e2498b3dc5fc23e689215fecbdef933591b5c Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Fri, 15 Apr 2022 18:15:00 +0530 Subject: [PATCH] Typo fixes --- docs/index.html | 2 +- docs/scripts/floTokenAPI.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) 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))