@exodus/bitcoin-plugin 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/create-asset.js +10 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@exodus/asset-lib": "^3.7.1",
|
|
22
|
-
"@exodus/bitcoin-api": "^2.3.
|
|
23
|
-
"@exodus/bitcoin-lib": "^2.2.
|
|
22
|
+
"@exodus/bitcoin-api": "^2.3.13",
|
|
23
|
+
"@exodus/bitcoin-lib": "^2.2.6",
|
|
24
24
|
"minimalistic-assert": "^1.0.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@exodus/keychain": "^3.0.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "4d882676a056823765b0856f94c5c664351e9f2e"
|
|
30
30
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -102,7 +102,16 @@ export const createBitcoinAssetFactory = ({ base, apiUrl, coinInfoNetwork }) =>
|
|
|
102
102
|
|
|
103
103
|
const getBalances = getBalancesFactory({ feeData, getSpendableBalance })
|
|
104
104
|
|
|
105
|
+
const accountStateClass = createAccountState({ asset })
|
|
106
|
+
|
|
107
|
+
const addressHasHistory = async (address) => {
|
|
108
|
+
assert(typeof address === 'string', 'Address is required')
|
|
109
|
+
const result = await insightClient.fetchTxData([address], { from: 0, to: 1 })
|
|
110
|
+
return !!result?.items.length
|
|
111
|
+
}
|
|
112
|
+
|
|
105
113
|
const api = {
|
|
114
|
+
addressHasHistory,
|
|
106
115
|
defaultAddressPath: 'm/0/0',
|
|
107
116
|
broadcastTx: (...args) => insightClient.broadcastTx(...args),
|
|
108
117
|
createFeeMonitor: (args) =>
|
|
@@ -112,7 +121,7 @@ export const createBitcoinAssetFactory = ({ base, apiUrl, coinInfoNetwork }) =>
|
|
|
112
121
|
getBalances,
|
|
113
122
|
getKeyIdentifier: createGetKeyIdentifier({ bip44 }),
|
|
114
123
|
hasFeature: (feature) => !!features[feature],
|
|
115
|
-
createAccountState: () =>
|
|
124
|
+
createAccountState: () => accountStateClass,
|
|
116
125
|
parseUnsignedTx,
|
|
117
126
|
parseTx: ({ unsignedTx }) => parseUnsignedTx(unsignedTx),
|
|
118
127
|
signUnsignedTx: (unsignedTx, privateKey, opts) => signTx({ unsignedTx, privateKey, ...opts }), // legacy
|