@exodus/bitcoin-plugin 1.0.12 → 1.0.14
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 +12 -7
- package/src/index.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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.14",
|
|
23
|
+
"@exodus/bitcoin-lib": "^2.2.8",
|
|
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": "5ab75b92c2a84548b0407b278047713df58152c7"
|
|
30
30
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { connectAsset } from '@exodus/assets'
|
|
2
1
|
import _coinInfo from 'coininfo'
|
|
3
2
|
import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
4
3
|
import createGetKeyIdentifier from '@exodus/bitcoin-lib/lib/key-identifier'
|
|
@@ -25,14 +24,14 @@ import { bitcoinFeeDataFactory } from './fee-data'
|
|
|
25
24
|
import BitcoinFeeMonitor from './fee-monitor'
|
|
26
25
|
import assert from 'minimalistic-assert'
|
|
27
26
|
|
|
28
|
-
export const createBitcoinAssetFactory = ({
|
|
27
|
+
export const createBitcoinAssetFactory = ({ asset, apiUrl, coinInfoNetwork }) => ({
|
|
29
28
|
allowUnconfirmedRbfEnabledUtxos = false,
|
|
30
29
|
overrideCallback = ({ asset }) => asset,
|
|
31
30
|
} = {}) => {
|
|
32
|
-
assert(
|
|
31
|
+
assert(asset, 'asset is required')
|
|
33
32
|
assert(apiUrl, 'apiUrl is required')
|
|
34
|
-
|
|
35
|
-
const coinInfo = _coinInfo(coinInfoNetwork ||
|
|
33
|
+
|
|
34
|
+
const coinInfo = _coinInfo(coinInfoNetwork || asset.name)
|
|
36
35
|
|
|
37
36
|
const insightClient = new InsightAPIClient(apiUrl)
|
|
38
37
|
const useBip84 = true
|
|
@@ -52,6 +51,8 @@ export const createBitcoinAssetFactory = ({ base, apiUrl, coinInfoNetwork }) =>
|
|
|
52
51
|
const keys = createBtcLikeKeys({ coinInfo, versions, useBip86, ecc })
|
|
53
52
|
const bip44 = bip44Constants['BTC']
|
|
54
53
|
|
|
54
|
+
const allowedPurposes = [44, 49, 84, 86]
|
|
55
|
+
|
|
55
56
|
const useMultipleAddresses = true
|
|
56
57
|
|
|
57
58
|
const features = {
|
|
@@ -93,7 +94,7 @@ export const createBitcoinAssetFactory = ({ base, apiUrl, coinInfoNetwork }) =>
|
|
|
93
94
|
address,
|
|
94
95
|
signTx,
|
|
95
96
|
getAddressesFromPrivateKey: getAddressesFromPrivateKeyFactory({
|
|
96
|
-
purposes:
|
|
97
|
+
purposes: allowedPurposes,
|
|
97
98
|
keys,
|
|
98
99
|
coinInfo,
|
|
99
100
|
}),
|
|
@@ -119,7 +120,11 @@ export const createBitcoinAssetFactory = ({ base, apiUrl, coinInfoNetwork }) =>
|
|
|
119
120
|
createHistoryMonitor: (args) => createBitcoinMonitor({ insightClient, apiUrl, ...args }),
|
|
120
121
|
getFeeData: () => feeData,
|
|
121
122
|
getBalances,
|
|
122
|
-
getKeyIdentifier: createGetKeyIdentifier({
|
|
123
|
+
getKeyIdentifier: createGetKeyIdentifier({
|
|
124
|
+
bip44,
|
|
125
|
+
allowedPurposes,
|
|
126
|
+
allowedChainIndices: [0, 1, 2],
|
|
127
|
+
}),
|
|
123
128
|
hasFeature: (feature) => !!features[feature],
|
|
124
129
|
createAccountState: () => accountStateClass,
|
|
125
130
|
parseUnsignedTx,
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { asset
|
|
1
|
+
import { asset } from '@exodus/bitcoin-meta'
|
|
2
2
|
import { createBitcoinAssetFactory } from './create-asset'
|
|
3
3
|
export * from './create-asset' // for bitcoinregtest and bitcointestnet
|
|
4
4
|
|
|
5
5
|
const apiUrl = 'https://bitcoin.a.exodus.io/insight/'
|
|
6
|
-
export const createAsset = createBitcoinAssetFactory({
|
|
6
|
+
export const createAsset = createBitcoinAssetFactory({ asset, apiUrl })
|