chore: add delay before fetching tx hash
This commit is contained in:
parent
11e3793e6e
commit
c6741bf33f
1 changed files with 5 additions and 3 deletions
|
|
@ -59,10 +59,12 @@ function getTransactionHash (account, cryptoCode, receivingAddress) {
|
||||||
const { apiVersion, authHeader } = client
|
const { apiVersion, authHeader } = client
|
||||||
|
|
||||||
logger.info(`** DEBUG ** getTransactionHash ENDPOINT: https://rest.ciphertrace.com/api/${apiVersion}/${_.toLower(cryptoCode) !== 'btc' ? `${_.toLower(cryptoCode)}_` : ``}address/search?features=tx&address=${receivingAddress}&mempool=true`)
|
logger.info(`** DEBUG ** getTransactionHash ENDPOINT: https://rest.ciphertrace.com/api/${apiVersion}/${_.toLower(cryptoCode) !== 'btc' ? `${_.toLower(cryptoCode)}_` : ``}address/search?features=tx&address=${receivingAddress}&mempool=true`)
|
||||||
|
return new Promise(resolve => {
|
||||||
return axios.get(`https://rest.ciphertrace.com/api/${apiVersion}/${_.toLower(cryptoCode) !== 'btc' ? `${_.toLower(cryptoCode)}_` : ``}address/search?features=tx&address=${receivingAddress}&mempool=true`, {
|
setTimeout(resolve, 5)
|
||||||
headers: authHeader
|
|
||||||
})
|
})
|
||||||
|
.then(axios.get(`https://rest.ciphertrace.com/api/${apiVersion}/${_.toLower(cryptoCode) !== 'btc' ? `${_.toLower(cryptoCode)}_` : ``}address/search?features=tx&address=${receivingAddress}&mempool=true`, {
|
||||||
|
headers: authHeader
|
||||||
|
}))
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const data = res.data
|
const data = res.data
|
||||||
if (_.size(data.txHistory) > 1) {
|
if (_.size(data.txHistory) > 1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue