@thorwallet/xchain-bitcoin
Advanced tools
Comparing version 0.1.1-alpha.967 to 0.1.1-alpha.969
@@ -10,2 +10,5 @@ "use strict"; | ||
const addrCache = {}; | ||
const getCacheKey = ({ network, phrase, index }) => { | ||
return [network, phrase, index].join('-'); | ||
}; | ||
const rootDerivationPaths = { | ||
@@ -31,4 +34,5 @@ mainnet: `84'/0'/0'/0/`, | ||
} | ||
if (addrCache[phrase] && addrCache[phrase][index]) { | ||
return addrCache[phrase][index]; | ||
const cacheKey = getCacheKey({ index, network, phrase }); | ||
if (addrCache[cacheKey]) { | ||
return addrCache[cacheKey]; | ||
} | ||
@@ -44,6 +48,3 @@ const btcNetwork = Utils.btcNetwork(network); | ||
} | ||
if (!addrCache[phrase]) { | ||
addrCache[phrase] = {}; | ||
} | ||
addrCache[phrase][index] = address; | ||
addrCache[cacheKey] = address; | ||
return address; | ||
@@ -50,0 +51,0 @@ }); |
{ | ||
"name": "@thorwallet/xchain-bitcoin", | ||
"version": "0.1.1-alpha.967+6c9977d", | ||
"version": "0.1.1-alpha.969+518776a", | ||
"description": "Custom Bitcoin client and utilities used by XChainJS clients", | ||
@@ -34,5 +34,5 @@ "keywords": [ | ||
"devDependencies": { | ||
"@thorwallet/xchain-client": "0.1.1-alpha.967+6c9977d", | ||
"@thorwallet/xchain-crypto": "0.1.1-alpha.967+6c9977d", | ||
"@thorwallet/xchain-util": "0.1.1-alpha.967+6c9977d", | ||
"@thorwallet/xchain-client": "0.1.1-alpha.969+518776a", | ||
"@thorwallet/xchain-crypto": "0.1.1-alpha.969+518776a", | ||
"@thorwallet/xchain-util": "0.1.1-alpha.969+518776a", | ||
"@types/bitcoinjs-lib": "^5.0.0", | ||
@@ -60,3 +60,3 @@ "@types/wif": "^2.0.2", | ||
}, | ||
"gitHead": "6c9977d0a79875dd6dbc74948d52769ac03bdc55" | ||
"gitHead": "518776affe751a8184a9ede83b339bcf445a1268" | ||
} |
Sorry, the diff of this file is not supported yet
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
100421
1715