@thorwallet/xchain-binance
Advanced tools
Comparing version 0.0.1-alpha.900 to 0.0.1-alpha.902
@@ -1570,2 +1570,15 @@ import { getAddressFromPrivateKey } from '@binance-chain/javascript-sdk/lib/crypto'; | ||
const getTxWithRateLimitHandling = (url) => __awaiter(void 0, void 0, void 0, function* () { | ||
const response = yield axios$1.get(url, { | ||
validateStatus: (status) => { | ||
return (status >= 200 && status < 300) || status === 429; | ||
}, | ||
}); | ||
if (response.status === 429) { | ||
console.log('got 429 for ', url, 'waiting 2 seconds then retrying...'); | ||
yield new Promise((resolve) => setTimeout(resolve, 2000)); | ||
return getTxWithRateLimitHandling(url); | ||
} | ||
return response.data; | ||
}); | ||
/** | ||
@@ -1747,3 +1760,3 @@ * Custom Binance client | ||
} | ||
const txHistory = yield axios$1.get(url.toString()).then((response) => response.data); | ||
const txHistory = yield getTxWithRateLimitHandling(url.toString()); | ||
return { | ||
@@ -1750,0 +1763,0 @@ total: txHistory.total, |
{ | ||
"name": "@thorwallet/xchain-binance", | ||
"version": "0.0.1-alpha.900+d9e80d5", | ||
"version": "0.0.1-alpha.902+3bdda06", | ||
"description": "Custom Binance client and utilities used by XChainJS clients", | ||
@@ -37,5 +37,5 @@ "keywords": [ | ||
"@binance-chain/javascript-sdk": "^4.1.1", | ||
"@thorwallet/xchain-client": "0.0.1-alpha.900+d9e80d5", | ||
"@thorwallet/xchain-crypto": "0.0.1-alpha.900+d9e80d5", | ||
"@thorwallet/xchain-util": "0.0.1-alpha.900+d9e80d5", | ||
"@thorwallet/xchain-client": "0.0.1-alpha.902+3bdda06", | ||
"@thorwallet/xchain-crypto": "0.0.1-alpha.902+3bdda06", | ||
"@thorwallet/xchain-util": "0.0.1-alpha.902+3bdda06", | ||
"@types/big.js": "^4.0.5", | ||
@@ -53,3 +53,3 @@ "bip32": "^2.0.6" | ||
}, | ||
"gitHead": "d9e80d5319b1af862491da0a60d76ebe9954bff0" | ||
"gitHead": "3bdda06011bde84becf35c41a1439f94009fa373" | ||
} |
Sorry, the diff of this file is too big to display
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
164595
4767