This commit is contained in:
sairajzero 2021-06-07 14:25:06 +05:30
parent d0af4cb396
commit a00bdbda99

View File

@ -7433,19 +7433,18 @@ Bitcoin.Util = {
}
}
</script>
<script id="floBlockchainAPI" version="2.0.1b">
<script id="floBlockchainAPI" version="2.0.1e">
/* FLO Blockchain Operator to send/receive data from blockchain using API calls*/
const floBlockchainAPI = {
util: {
serverList: floGlobals.apiURL[floGlobals.blockchain].slice(0),
curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length),
curPos: floCrypto.randInt(0, floGlobals.apiURL[floGlobals.blockchain].length - 1),
fetch_retry: function(apicall, rm_flosight) {
return new Promise((resolve, reject) => {
let i = this.serverList.indexOf(rm_flosight)
if(i != -1)
this.serverList.splice(i, 1);
this.curPos = floCrypto.randInt(0, this.serverList.length)
if (i != -1) this.serverList.splice(i, 1);
this.curPos = floCrypto.randInt(0, this.serverList.length - 1)
this.fetch_api(apicall)
.then(result => resolve(result))
.catch(error => reject(error));
@ -7457,7 +7456,7 @@ Bitcoin.Util = {
reject("No floSight server working")
else {
let flosight = this.serverList[this.curPos];
fetch(flosight + apicall).then(response => {
fetch(flosight + apicall).then(response => {
if (response.ok)
response.json().then(data => resolve(data));
else {
@ -7472,6 +7471,10 @@ Bitcoin.Util = {
})
}
})
},
current: function() {
return this.serverList[this.curPos];
}
},
@ -10094,7 +10097,7 @@ Bitcoin.Util = {
b.netValue = calcNetValue(b.BTC_base, b.startDate, b.minIpa, b.maxPeriod, b.cut, b.amount, b.USD_base)
console.info(b);
const obj = {
href: `https://livenet.flocha.in/tx/${i}`,
href: `${floBlockchainAPI.util.current()}tx/${i}`,
floId: b.floID,
bondStartDate: dateFormat(b.startDate),
amountInvested : {