Minor fix
- Fix bug in exchange API module
This commit is contained in:
parent
e3f48405c5
commit
cb523b107e
16
index.html
16
index.html
@ -25,7 +25,6 @@
|
|||||||
<script>
|
<script>
|
||||||
function onLoadStartUp() {
|
function onLoadStartUp() {
|
||||||
floExchangeAPI.init().then(result => {
|
floExchangeAPI.init().then(result => {
|
||||||
console.debug(result)
|
|
||||||
compactIDB.initDB(floGlobals.application, {
|
compactIDB.initDB(floGlobals.application, {
|
||||||
bonds: {},
|
bonds: {},
|
||||||
closings: {},
|
closings: {},
|
||||||
@ -2125,7 +2124,19 @@
|
|||||||
async function renderBondClosingData(data){
|
async function renderBondClosingData(data){
|
||||||
for(let i in data){
|
for(let i in data){
|
||||||
let b = blockchainBond.parse.end(data[i]);
|
let b = blockchainBond.parse.end(data[i]);
|
||||||
//TODO render bond closing (should be mapped with bond details that were rendered)
|
/*TODO: UI: render bond closing
|
||||||
|
Note: should be mapped with bond details that were rendered
|
||||||
|
if closed, netVal shoud not be displayed
|
||||||
|
b -> Object {
|
||||||
|
bondID: id of the bond closed (map to var i in renderBondData's loop)
|
||||||
|
BTC_net: BTC value at closing date
|
||||||
|
endDate: closing date
|
||||||
|
amountFinal: amount at closing
|
||||||
|
payment_refRef: if amount if withdrawn by token system, txid of token transfer
|
||||||
|
USD_net: USD value at closing date
|
||||||
|
refSign: user signature for closing (hidden)
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2142,7 +2153,6 @@
|
|||||||
compactIDB.readAllData("bonds").then(result => {
|
compactIDB.readAllData("bonds").then(result => {
|
||||||
renderBondData(result);
|
renderBondData(result);
|
||||||
compactIDB.readAllData('closings').then(result => {
|
compactIDB.readAllData('closings').then(result => {
|
||||||
//TODO:
|
|
||||||
renderBondClosingData(result);
|
renderBondClosingData(result);
|
||||||
showPage('home_page')
|
showPage('home_page')
|
||||||
}).catch(error => console.error(error))
|
}).catch(error => console.error(error))
|
||||||
|
|||||||
@ -473,6 +473,9 @@
|
|||||||
adminID: {
|
adminID: {
|
||||||
get: () => DEFAULT.marketID
|
get: () => DEFAULT.marketID
|
||||||
},
|
},
|
||||||
|
application: {
|
||||||
|
get: () => DEFAULT.marketApp
|
||||||
|
},
|
||||||
nodeList: {
|
nodeList: {
|
||||||
get: () => {
|
get: () => {
|
||||||
if (Array.isArray(nodeList))
|
if (Array.isArray(nodeList))
|
||||||
@ -488,7 +491,7 @@
|
|||||||
let curPos = fetch_api.curPos || 0;
|
let curPos = fetch_api.curPos || 0;
|
||||||
if (curPos >= nodeList.length)
|
if (curPos >= nodeList.length)
|
||||||
return reject(ExchangeError(ExchangeError.NODES_OFFLINE_CODE, 'No Node online! Refresh the page or try again later', errorCode.NODES_OFFLINE));
|
return reject(ExchangeError(ExchangeError.NODES_OFFLINE_CODE, 'No Node online! Refresh the page or try again later', errorCode.NODES_OFFLINE));
|
||||||
let url = "http://" + nodeURL[nodeList[curPos]];
|
let url = "https://" + nodeURL[nodeList[curPos]];
|
||||||
(options ? fetch(url + api, options) : fetch(url + api))
|
(options ? fetch(url + api, options) : fetch(url + api))
|
||||||
.then(result => resolve(result)).catch(error => {
|
.then(result => resolve(result)).catch(error => {
|
||||||
console.warn(nodeList[curPos], 'is offline');
|
console.warn(nodeList[curPos], 'is offline');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user