@exodus/bitcoin-plugin 1.16.5 → 1.17.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-plugin",
3
- "version": "1.16.5",
3
+ "version": "1.17.1",
4
4
  "description": "Exodus bitcoin-plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -22,7 +22,7 @@
22
22
  "@exodus/basic-utils": "^2.1.0",
23
23
  "@exodus/bip32": "^1.1.2",
24
24
  "@exodus/bip44-constants": "^195.0.0",
25
- "@exodus/bitcoin-api": "^2.14.1",
25
+ "@exodus/bitcoin-api": "^2.15.0",
26
26
  "@exodus/bitcoin-lib": "^2.3.0",
27
27
  "@exodus/bitcoin-meta": "^1.0.2",
28
28
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.1",
@@ -30,7 +30,8 @@
30
30
  "@exodus/fetch": "^1.3.0",
31
31
  "@exodus/models": "^11.13.0",
32
32
  "@exodus/text-encoding-utf8": "^1.0.2",
33
- "@exodus/web3-bitcoin-utils": "^1.12.0",
33
+ "@exodus/web3-bitcoin-utils": "^1.12.2",
34
+ "bip32-path": "0.4.2",
34
35
  "coininfo": "5.1.0",
35
36
  "create-hash": "^1.2.0",
36
37
  "lodash": "^4.17.21",
@@ -45,9 +46,14 @@
45
46
  "@exodus/bitcointestnet-meta": "^1.0.0",
46
47
  "@exodus/currency": "^2.3.2",
47
48
  "@exodus/hdkey": "^2.1.0-exodus.0",
49
+ "@exodus/key-identifier": "^1.1.1",
50
+ "@exodus/key-utils": "3.2.1",
51
+ "@exodus/keychain": "^6.4.0",
48
52
  "@exodus/nfts-proxy": "^2.10.1",
53
+ "@exodus/tx-signer": "^2.3.1",
49
54
  "@scure/btc-signer": "^1.1.0",
55
+ "bip39": "^2.6.0",
50
56
  "jest-when": "^3.5.1"
51
57
  },
52
- "gitHead": "2af27ab114d53d02eb1c324150a847e894cdcc20"
58
+ "gitHead": "2e105f8c05f3bd241d8c8a98e52170bbcef282ae"
53
59
  }
@@ -106,6 +106,7 @@ export const createBitcoinAssetFactory =
106
106
  nfts: ordinalsEnabled,
107
107
  customTokens: brc20Enabled,
108
108
  isTestnet,
109
+ signWithSigner: true,
109
110
  }
110
111
 
111
112
  const getFeeEstimator = getFeeEstimatorFactory({
@@ -180,10 +181,18 @@ export const createBitcoinAssetFactory =
180
181
  coinInfo,
181
182
  })
182
183
 
184
+ const getKeyIdentifier = createGetKeyIdentifier({
185
+ bip44,
186
+ allowedPurposes,
187
+ allowedChainIndices: [0, 1, 2],
188
+ assetName: asset.name,
189
+ })
190
+
183
191
  const signTx = signTxFactory({
184
192
  assetName: asset.name,
185
193
  resolvePurpose: address.resolvePurpose,
186
194
  coinInfo,
195
+ getKeyIdentifier,
187
196
  })
188
197
 
189
198
  const signHardware = signHardwareFactory({
@@ -322,19 +331,17 @@ export const createBitcoinAssetFactory =
322
331
  getFeeData: () => feeData,
323
332
  getBalances,
324
333
  getBalanceForAddress,
325
- getKeyIdentifier: createGetKeyIdentifier({
326
- bip44,
327
- allowedPurposes,
328
- allowedChainIndices: [0, 1, 2],
329
- assetName: asset.name,
330
- }),
334
+ getKeyIdentifier,
331
335
  getSupportedPurposes: createGetSupportedPurposes({ omitPurposes: omitSupportedPurposes }),
332
336
  hasFeature: (feature) => !!features[feature], // @deprecated use api.features instead
333
337
  createAccountState: () => accountStateClass,
334
338
  parseUnsignedTx,
335
339
  signUnsignedTx: (unsignedTx, privateKey, opts) => signTx({ unsignedTx, privateKey, ...opts }), // legacy
336
340
  sendTx,
337
- signTx,
341
+ signTx: ({ unsignedTx, hdkeys, privateKeysAddressMap, signer }) =>
342
+ signer
343
+ ? signTx({ unsignedTx, signer })
344
+ : signTx({ unsignedTx, hdkeys, privateKeysAddressMap }),
338
345
  signHardware,
339
346
  signMessage,
340
347
  getFee,
@@ -5,15 +5,16 @@ import assert from 'minimalistic-assert'
5
5
 
6
6
  // This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
7
7
  export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
8
+ assert('asset', '"asset" should be passed.')
8
9
  assert('prepareForSigning', '"prepareForSigning" should be passed')
9
10
 
10
- return function simulateTransaction({ transactionBuffers, unsignedTxs, ...restParameters }) {
11
+ const simulateBitcoinTransactions = createSimulateBitcoinTransactions()
12
+
13
+ return function simulateTransactions({ transactionBuffers, unsignedTxs, ...restParameters }) {
11
14
  if (transactionBuffers && unsignedTxs) {
12
15
  throw new Error('Can not supply both "transactionBuffer" and "unsignedTx".')
13
16
  }
14
17
 
15
- const simulateTransactions = createSimulateBitcoinTransactions()
16
-
17
18
  if (transactionBuffers) {
18
19
  assert(
19
20
  transactionBuffers.length === 1,
@@ -22,7 +23,7 @@ export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
22
23
 
23
24
  const psbtBase64 = Psbt.fromBuffer(transactionBuffers[0]).toBase64()
24
25
 
25
- return simulateTransactions({ transactions: [psbtBase64], ...restParameters })
26
+ return simulateBitcoinTransactions({ transactions: [psbtBase64], ...restParameters })
26
27
  }
27
28
 
28
29
  if (unsignedTxs) {
@@ -48,7 +49,7 @@ export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
48
49
  return acc
49
50
  }, {})
50
51
 
51
- return simulateTransactions({
52
+ return simulateBitcoinTransactions({
52
53
  asset,
53
54
  transactions: [psbtBase64],
54
55
  walletAddresses,
package/src/web3/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createSimulateTransactions } from './createSimulateTransaction'
1
+ import { createSimulateTransactions } from './createSimulateTransactions'
2
2
 
3
3
  export const createWeb3API = (deps) => {
4
4
  return {