From 9435592c8bb36d85dfd297ab993f45ebb2b65abd Mon Sep 17 00:00:00 2001 From: sairajzero Date: Wed, 25 May 2022 02:45:50 +0530 Subject: [PATCH] floTokenAPI v1.0.3b - floGlobals.currency serves as getter and setter for DEFAULT.currency in tokenAPI module --- floTokenAPI.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/floTokenAPI.js b/floTokenAPI.js index a87876f..7378f43 100644 --- a/floTokenAPI.js +++ b/floTokenAPI.js @@ -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);