floTokenAPI v1.0.3b

- floGlobals.currency serves as getter and setter for DEFAULT.currency in tokenAPI module
This commit is contained in:
sairajzero 2022-05-25 02:45:50 +05:30
parent 29e20de25b
commit 9435592c8b

View File

@ -1,4 +1,4 @@
(function(EXPORTS) { //floTokenAPI v1.0.3a
(function(EXPORTS) { //floTokenAPI v1.0.3b
/* Token Operator to send/receive tokens via blockchain using API calls*/
'use strict';
const tokenAPI = EXPORTS;
@ -20,6 +20,13 @@
if (floGlobals.currency) tokenAPI.currency = floGlobals.currency;
Object.defineProperties(floGlobals, {
currency: {
get: () => DEFAULT.currency,
set: currency => DEFAULT.currency = currency
}
});
const fetch_api = tokenAPI.fetch = function(apicall) {
return new Promise((resolve, reject) => {
console.log(DEFAULT.apiURL + apicall);