@exodus/bitcoin-plugin 1.17.2 → 1.18.0

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.17.2",
3
+ "version": "1.18.0",
4
4
  "description": "Exodus bitcoin-plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -23,7 +23,7 @@
23
23
  "@exodus/bip32": "^1.1.2",
24
24
  "@exodus/bip44-constants": "^195.0.0",
25
25
  "@exodus/bitcoin-api": "^2.15.0",
26
- "@exodus/bitcoin-lib": "^2.3.0",
26
+ "@exodus/bitcoin-lib": "^2.4.0",
27
27
  "@exodus/bitcoin-meta": "^1.0.2",
28
28
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.1",
29
29
  "@exodus/crypto": "^1.0.0-rc.1",
@@ -55,5 +55,5 @@
55
55
  "bip39": "^2.6.0",
56
56
  "jest-when": "^3.5.1"
57
57
  },
58
- "gitHead": "e46c09c69cc3fc65345a6061c04ef7645a927b59"
58
+ "gitHead": "c63a283be662247dc12c3b94fced4799937e9fb5"
59
59
  }
@@ -6,6 +6,7 @@ export const ordinals86 = 'ordinals86'
6
6
  export const trezor = 'trezor'
7
7
  export const ledger = 'ledger'
8
8
  export const xverse49 = 'xverse49'
9
+ export const xverse49NotMerged = 'xverse49NotMerged'
9
10
 
10
11
  export const getDefaultAddressPath = ({ compatibilityMode } = Object.create(null)) => {
11
12
  if ([ordinals84, ordinals86].includes(compatibilityMode)) {
@@ -40,6 +41,10 @@ export const getSupportedPurposes = ({ compatibilityMode, isMultisig, walletAcco
40
41
  return [49, 84, 86, 44]
41
42
  }
42
43
 
44
+ if (compatibilityMode === xverse49NotMerged) {
45
+ return [49, 86]
46
+ }
47
+
43
48
  return [84, 86, 44]
44
49
  }
45
50
 
@@ -346,10 +346,7 @@ export const createBitcoinAssetFactory =
346
346
  parseUnsignedTx,
347
347
  signUnsignedTx: (unsignedTx, privateKey, opts) => signTx({ unsignedTx, privateKey, ...opts }), // legacy
348
348
  sendTx,
349
- signTx: ({ unsignedTx, hdkeys, privateKeysAddressMap, signer }) =>
350
- signer
351
- ? signTx({ unsignedTx, signer })
352
- : signTx({ unsignedTx, hdkeys, privateKeysAddressMap }),
349
+ signTx,
353
350
  signHardware,
354
351
  signMessage,
355
352
  getFee,
@@ -1,5 +1,6 @@
1
1
  import assert from 'minimalistic-assert'
2
2
  import { getOrdinalsUtxos } from '@exodus/bitcoin-api'
3
+ import { xverse49, xverse49NotMerged } from '../compatibility-modes'
3
4
 
4
5
  export const getInscriptionAddresses = async ({
5
6
  assetClientInterface: aci,
@@ -36,17 +37,22 @@ export const getInscriptionAddresses = async ({
36
37
  addressIndex: 0,
37
38
  })
38
39
 
39
- const specialAddress3 = await aci.getAddress({
40
- // xverse
41
- assetName,
42
- walletAccount,
43
- purpose: 49,
44
- chainIndex: 0,
45
- addressIndex: 0,
46
- })
40
+ const specialAddress3 =
41
+ walletAccountInstance.compatibilityMode === xverse49 ||
42
+ walletAccountInstance.compatibilityMode === xverse49NotMerged
43
+ ? await aci.getAddress({
44
+ // xverse
45
+ assetName,
46
+ walletAccount,
47
+ purpose: 49,
48
+ chainIndex: 0,
49
+ addressIndex: 0,
50
+ })
51
+ : undefined
52
+
53
+ const allAddresses = [specialAddress1, specialAddress2, specialAddress3, ...addresses]
54
+ .filter(Boolean)
55
+ .map((t) => t.address.toString())
47
56
 
48
- const allAddresses = [specialAddress1, specialAddress2, specialAddress3, ...addresses].map((t) =>
49
- t.address.toString()
50
- )
51
57
  return [...new Set(allAddresses)]
52
58
  }
@@ -69,7 +69,7 @@ export const nftsApiFactory = ({ ordinalChainIndex, asset, assetClientInterface:
69
69
  getNftsAddresses: async ({ walletAccount: walletAccountInstance }) => {
70
70
  return getInscriptionAddresses({
71
71
  assetClientInterface: aci,
72
- walletAccount: walletAccountInstance.toString(),
72
+ walletAccount: walletAccountInstance,
73
73
  ordinalChainIndex,
74
74
  asset,
75
75
  })