floBlockchainAPI v3.0.1a
- Fixed: readTx and all its dependencies not having txs property when address (floID) doesnt have any tx
This commit is contained in:
parent
5398fcbbbc
commit
e120b657da
@ -1,4 +1,4 @@
|
|||||||
(function (EXPORTS) { //floBlockchainAPI v3.0.1
|
(function (EXPORTS) { //floBlockchainAPI v3.0.1a
|
||||||
/* FLO Blockchain Operator to send/receive data from blockchain using API calls via FLO Blockbook*/
|
/* FLO Blockchain Operator to send/receive data from blockchain using API calls via FLO Blockbook*/
|
||||||
'use strict';
|
'use strict';
|
||||||
const floBlockchainAPI = EXPORTS;
|
const floBlockchainAPI = EXPORTS;
|
||||||
@ -802,9 +802,11 @@
|
|||||||
if (options.confirmed) //Default is false in server, so only add confirmed filter if confirmed has a true value
|
if (options.confirmed) //Default is false in server, so only add confirmed filter if confirmed has a true value
|
||||||
query_params.confirmed = true;
|
query_params.confirmed = true;
|
||||||
|
|
||||||
promisedAPI(`api/address/${addr}`, query_params)
|
promisedAPI(`api/address/${addr}`, query_params).then(response => {
|
||||||
.then(response => resolve(response))
|
if (!Array.isArray(response.txs)) //set empty array if address doesnt have any tx
|
||||||
.catch(error => reject(error))
|
response.txs = [];
|
||||||
|
resolve(response)
|
||||||
|
}).catch(error => reject(error))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user