@exodus/bitcoin-api 2.21.0 → 2.21.2

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/CHANGELOG.md CHANGED
@@ -3,6 +3,26 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.21.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.21.1...@exodus/bitcoin-api@2.21.2) (2024-07-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **bitcoin:** make asset config function optional on ACI ([#2983](https://github.com/ExodusMovement/assets/issues/2983)) ([0b45695](https://github.com/ExodusMovement/assets/commit/0b4569522c5a65da8109ae70e74ee75ba8111ce9))
12
+ * disable multi address scanning in `multiAddressMode` is false ([#2984](https://github.com/ExodusMovement/assets/issues/2984)) ([37bab79](https://github.com/ExodusMovement/assets/commit/37bab79ec9bcb8e08850402dd5f71df823eddd3b))
13
+
14
+
15
+
16
+ ## [2.21.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.21.0...@exodus/bitcoin-api@2.21.1) (2024-07-24)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * bump @exodus/bip322-js to remove warning ([#2929](https://github.com/ExodusMovement/assets/issues/2929)) ([74c20ad](https://github.com/ExodusMovement/assets/commit/74c20ad32ebed2df4eb0f498d11b7319e80b037a))
22
+ * retrieve `multiAddressMode` from config ([#2944](https://github.com/ExodusMovement/assets/issues/2944)) ([6bd70fb](https://github.com/ExodusMovement/assets/commit/6bd70fbc9e9ce6343ebf6bc8303bf13741cff307))
23
+
24
+
25
+
6
26
  ## [2.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.20.1...@exodus/bitcoin-api@2.21.0) (2024-07-19)
7
27
 
8
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.21.0",
3
+ "version": "2.21.2",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@exodus/asset-lib": "^4.1.0",
23
23
  "@exodus/basic-utils": "^2.1.0",
24
- "@exodus/bip322-js": "^1.1.0-exodus.4",
24
+ "@exodus/bip322-js": "^1.1.0-exodus.6",
25
25
  "@exodus/bip44-constants": "^195.0.0",
26
26
  "@exodus/bitcoin-lib": "^2.4.1",
27
27
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.2",
@@ -66,5 +66,5 @@
66
66
  "type": "git",
67
67
  "url": "git+https://github.com/ExodusMovement/assets.git"
68
68
  },
69
- "gitHead": "ba7439e1b8ae182a2a95ffd0ea09b8bc3330f2f6"
69
+ "gitHead": "139dd9f87ac7299463ce64a4a53f1daa4542fd2c"
70
70
  }
package/src/balances.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import assert from 'minimalistic-assert'
2
+
2
3
  import { getUtxos } from './utxos-utils'
3
4
 
4
5
  // known issue!! fee data is static here!
@@ -1,4 +1,5 @@
1
1
  import ECPairFactory from 'ecpair'
2
+
2
3
  import { ecc } from './ecc'
3
4
 
4
5
  let ECPair
@@ -1,8 +1,8 @@
1
- import bs58check from 'bs58check'
1
+ import * as bitcoinjsOriginal from '@exodus/bitcoinjs-lib'
2
2
  import * as bech32 from 'bech32'
3
- import assert from 'minimalistic-assert'
3
+ import bs58check from 'bs58check'
4
4
  import { identity, pickBy } from 'lodash'
5
- import * as bitcoinjsOriginal from '@exodus/bitcoinjs-lib'
5
+ import assert from 'minimalistic-assert'
6
6
 
7
7
  export const createBtcLikeAddress = ({
8
8
  versions,
@@ -1,13 +1,14 @@
1
- import bs58check from 'bs58check'
2
- import wif from 'wif'
1
+ import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
3
2
  import * as bech32 from 'bech32'
4
- import assert from 'minimalistic-assert'
3
+ import bs58check from 'bs58check'
5
4
  import { identity, pickBy } from 'lodash'
6
- import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
5
+ import assert from 'minimalistic-assert'
7
6
  import secp256k1 from 'secp256k1'
8
- import { hash160 } from './hash-utils'
9
- import { toXOnly } from './bitcoinjs-lib/ecc-utils'
7
+ import wif from 'wif'
8
+
10
9
  import { ecc } from './bitcoinjs-lib/ecc'
10
+ import { toXOnly } from './bitcoinjs-lib/ecc-utils'
11
+ import { hash160 } from './hash-utils'
11
12
 
12
13
  export const publicKeyToHashFactory = (p2pkh) => (publicKey) => {
13
14
  const payload = Buffer.concat([Buffer.from([p2pkh]), hash160(publicKey)])
@@ -1,10 +1,10 @@
1
- import { selectUtxos } from './utxo-selector'
1
+ import { BumpType } from '@exodus/bitcoin-lib'
2
2
  import assert from 'minimalistic-assert'
3
- import { findUnconfirmedSentRbfTxs } from '../tx-utils'
4
- import { getUsableUtxos, getUtxos } from '../utxos-utils'
5
3
 
6
- import { BumpType } from '@exodus/bitcoin-lib'
4
+ import { findUnconfirmedSentRbfTxs } from '../tx-utils'
7
5
  import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
6
+ import { getUsableUtxos, getUtxos } from '../utxos-utils'
7
+ import { selectUtxos } from './utxo-selector'
8
8
 
9
9
  export const ASSET_NAMES = ['bitcoin', 'bitcoinregtest', 'bitcointestnet']
10
10
 
@@ -1,11 +1,10 @@
1
+ import { UtxoCollection } from '@exodus/models'
1
2
  import assert from 'minimalistic-assert'
2
3
  import * as varuint from 'varuint-bitcoin'
3
- import { UtxoCollection } from '@exodus/models'
4
- import { scriptClassify } from '../bitcoinjs-lib'
5
-
6
- import { scriptClassifierFactory } from './script-classifier'
7
4
 
5
+ import { scriptClassify } from '../bitcoinjs-lib'
8
6
  import createDefaultFeeEstimator, { isHex } from './fee-utils'
7
+ import { scriptClassifierFactory } from './script-classifier'
9
8
 
10
9
  const { P2PKH, P2SH, P2WPKH, P2WSH, P2TR } = scriptClassify.types
11
10
 
@@ -1,8 +1,9 @@
1
1
  import { isNumberUnit, UnitType } from '@exodus/currency'
2
- import { resolveExtraFeeOfTx } from '../unconfirmed-ancestor-data'
3
2
  import { UtxoCollection } from '@exodus/models'
4
3
  import assert from 'minimalistic-assert'
5
4
 
5
+ import { resolveExtraFeeOfTx } from '../unconfirmed-ancestor-data'
6
+
6
7
  export const isHex = (s) => typeof s === 'string' && /[\da-f]*/.test(s.toLowerCase())
7
8
 
8
9
  export function getExtraFee({ asset, inputs, feePerKB, unconfirmedTxAncestor }) {
@@ -1,6 +1,7 @@
1
1
  import assert from 'minimalistic-assert'
2
- import { getUtxosData } from './utxo-selector'
2
+
3
3
  import { findUnconfirmedSentRbfTxs } from '../tx-utils'
4
+ import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
4
5
  import {
5
6
  getInscriptionIds,
6
7
  getOrdinalsUtxos,
@@ -9,7 +10,7 @@ import {
9
10
  getUtxos,
10
11
  } from '../utxos-utils'
11
12
  import { canBumpTx } from './can-bump-tx'
12
- import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
13
+ import { getUtxosData } from './utxo-selector'
13
14
 
14
15
  export class GetFeeResolver {
15
16
  #getFeeEstimator
@@ -1,9 +1,9 @@
1
- import { scriptClassify } from '../bitcoinjs-lib'
2
- import createHash from 'create-hash'
3
-
4
1
  import { memoizeLruCache } from '@exodus/asset-lib'
2
+ import createHash from 'create-hash'
5
3
  import assert from 'minimalistic-assert'
6
4
 
5
+ import { scriptClassify } from '../bitcoinjs-lib'
6
+
7
7
  const { P2PKH, P2SH, P2WPKH, P2WSH, P2TR } = scriptClassify.types
8
8
 
9
9
  const cacheSize = 1000
@@ -1,9 +1,10 @@
1
- import { UtxoCollection } from '@exodus/models'
2
1
  import NumberUnit from '@exodus/currency'
2
+ import { UtxoCollection } from '@exodus/models'
3
3
  import { sortBy } from 'lodash'
4
4
  import assert from 'minimalistic-assert'
5
+
6
+ import { getConfirmedOrRfbDisabledUtxos, getConfirmedUtxos } from '../utxos-utils'
5
7
  import { getExtraFee } from './fee-utils'
6
- import { getConfirmedUtxos, getConfirmedOrRfbDisabledUtxos } from '../utxos-utils'
7
8
 
8
9
  const MIN_RELAY_FEE = 1000
9
10
 
@@ -1,9 +1,8 @@
1
- import urlJoin from 'url-join'
2
- import delay from 'delay'
3
- import { isEmpty } from 'lodash'
4
-
5
1
  import { fetch } from '@exodus/fetch'
6
2
  import { retry } from '@exodus/simple-retry'
3
+ import delay from 'delay'
4
+ import { isEmpty } from 'lodash'
5
+ import urlJoin from 'url-join'
7
6
 
8
7
  const getTextFromResponse = async (response) => {
9
8
  try {
@@ -1,5 +1,5 @@
1
- import assert from 'minimalistic-assert'
2
1
  import { groupBy, sortBy } from 'lodash'
2
+ import assert from 'minimalistic-assert'
3
3
 
4
4
  // return first to last (ALSO FILTERS)
5
5
  // we need to do this because Insight often returns the blocktime as time and many
package/src/move-funds.js CHANGED
@@ -1,8 +1,9 @@
1
- import wif from 'wif'
2
- import { UtxoCollection, Address } from '@exodus/models'
3
- import { createInputs, createOutput, getNonWitnessTxs } from './tx-send'
1
+ import { Address, UtxoCollection } from '@exodus/models'
4
2
  import assert from 'minimalistic-assert'
5
3
  import secp256k1 from 'secp256k1'
4
+ import wif from 'wif'
5
+
6
+ import { createInputs, createOutput, getNonWitnessTxs } from './tx-send'
6
7
 
7
8
  const isValidPrivateKey = (privateKey) => {
8
9
  try {
@@ -97,10 +98,14 @@ export const moveFundsFactory = ({
97
98
  throw new MoveFundsError('private-key-invalid', formatProps)
98
99
  }
99
100
 
101
+ const config = await assetClientInterface.getAssetConfig?.({
102
+ assetName,
103
+ walletAccount,
104
+ })
100
105
  const recieveAddressesObjects = await assetClientInterface.getReceiveAddresses({
101
106
  walletAccount,
102
107
  assetName,
103
- multiAddressMode: true,
108
+ multiAddressMode: config?.multiAddressMode ?? true,
104
109
  })
105
110
 
106
111
  const receiveAddresses = recieveAddressesObjects.map(
@@ -1,6 +1,7 @@
1
1
  import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
2
- import { toXOnly } from './bitcoinjs-lib/ecc-utils'
2
+
3
3
  import { ecc as defaultEcc } from './bitcoinjs-lib/ecc'
4
+ import { toXOnly } from './bitcoinjs-lib/ecc-utils'
4
5
 
5
6
  // Key to use when key path spending is disabled https://github.com/bitcoin/bips/blob/master/bip-0341.mediawiki#constructing-and-spending-taproot-outputs
6
7
  const DUMMY_TAPROOT_PUBKEY = Buffer.from(
@@ -1,8 +1,8 @@
1
- import assert from 'minimalistic-assert'
1
+ import { Transaction as BitcoinTransactionClass } from '@exodus/bitcoinjs-lib'
2
2
  import BIPPath from 'bip32-path'
3
3
  import BN from 'bn.js'
4
4
  import lodash from 'lodash'
5
- import { Transaction as BitcoinTransactionClass } from '@exodus/bitcoinjs-lib'
5
+ import assert from 'minimalistic-assert'
6
6
 
7
7
  export const parseUnsignedTxFactory =
8
8
  ({ Transaction = BitcoinTransactionClass } = {}) =>
@@ -1,11 +1,12 @@
1
- import { orderTxs } from '../insight-api-client/util'
2
1
  import { Address, UtxoCollection } from '@exodus/models'
3
2
  import { compact, isEqual, uniq } from 'lodash'
4
- import ms from 'ms'
5
3
  import assert from 'minimalistic-assert'
4
+ import ms from 'ms'
5
+
6
6
  import { isChangeAddress, isReceiveAddress } from '../address-utils'
7
- import { getOrdinalsUtxos, getUtxos, partitionUtxos } from '../utxos-utils'
7
+ import { orderTxs } from '../insight-api-client/util'
8
8
  import { getOrdinalAddress } from '../ordinals-utils'
9
+ import { getOrdinalsUtxos, getUtxos, partitionUtxos } from '../utxos-utils'
9
10
  import { indexOrdinalUnconfirmedTx } from './ordinals-indexer-utils'
10
11
 
11
12
  // Time to check whether to drop a sent tx
@@ -54,12 +55,8 @@ export class BitcoinMonitorScanner {
54
55
  this.#refreshGapLimit = refreshGapLimit
55
56
  }
56
57
 
57
- async #getGapLimit({ walletAccount, assetName, refresh }) {
58
- const assetConfig = await this.#assetClientInterface.getAssetConfig?.({
59
- assetName,
60
- walletAccount,
61
- })
62
- if (typeof assetConfig?.gapLimit === 'number') return assetConfig.gapLimit
58
+ async #getGapLimit({ assetConfig, refresh }) {
59
+ if (typeof assetConfig.gapLimit === 'number') return assetConfig.gapLimit
63
60
  return refresh ? this.#refreshGapLimit : this.#gapLimit
64
61
  }
65
62
 
@@ -74,6 +71,12 @@ export class BitcoinMonitorScanner {
74
71
  const accountState = await assetClientInterface.getAccountState({ assetName, walletAccount })
75
72
  const currency = asset.currency
76
73
  const currentTxs = await assetClientInterface.getTxLog({ assetName, walletAccount })
74
+ const assetConfig = await this.#assetClientInterface.getAssetConfig({
75
+ assetName,
76
+ walletAccount,
77
+ })
78
+ // multiAddressMode may be null, in which case it is enabled.
79
+ const multiAddressMode = assetConfig.multiAddressMode ?? true
77
80
 
78
81
  const storedUtxos = getUtxos({ asset, accountState })
79
82
  const storedOrdinalUtxos = getOrdinalsUtxos({ asset, accountState })
@@ -110,7 +113,7 @@ export class BitcoinMonitorScanner {
110
113
  walletAccount,
111
114
  })
112
115
 
113
- const resolvedGapLimit = await this.#getGapLimit({ walletAccount, assetName, refresh })
116
+ const resolvedGapLimit = await this.#getGapLimit({ assetConfig, refresh })
114
117
  /*
115
118
  * The chain fields/variables are number arrays of size 2
116
119
  *
@@ -136,10 +139,22 @@ export class BitcoinMonitorScanner {
136
139
  * - for bip/purpose 84 and chainIndex 1 (change), 10 is the greatest unused addressIndex
137
140
  */
138
141
 
139
- const chains = purposes.map((purpose) => ({
140
- purpose,
141
- chain: unusedAddressIndexes.find((indexes) => indexes.purpose === purpose)?.chain || [0, 0],
142
- }))
142
+ const chains = purposes.map((purpose) => {
143
+ if (multiAddressMode) {
144
+ return {
145
+ purpose,
146
+ chain: unusedAddressIndexes.find((indexes) => indexes.purpose === purpose)?.chain || [
147
+ 0, 0,
148
+ ],
149
+ }
150
+ }
151
+
152
+ // If not in multi address mode then stick chains to 0
153
+ return {
154
+ purpose,
155
+ chain: [0, 0],
156
+ }
157
+ })
143
158
 
144
159
  // cloning
145
160
  const newChains = chains.map(({ purpose, chain }) => ({ purpose, chain: [...chain] }))
@@ -153,7 +168,11 @@ export class BitcoinMonitorScanner {
153
168
  const promises = []
154
169
  for (const chainObject of chainObjects) {
155
170
  const { purpose, chainIndex, startAddressIndex, endAddressIndex } = chainObject
156
- for (let addressIndex = startAddressIndex; addressIndex < endAddressIndex; addressIndex++) {
171
+ for (
172
+ let addressIndex = startAddressIndex;
173
+ addressIndex <= endAddressIndex;
174
+ addressIndex++
175
+ ) {
157
176
  promises.push(
158
177
  assetClientInterface
159
178
  .getAddress({
@@ -246,14 +265,14 @@ export class BitcoinMonitorScanner {
246
265
  purpose,
247
266
  chain,
248
267
  startAddressIndexes: chain.map(() => 0),
249
- endAddressIndexes: chain.map((addressIndex) =>
250
- refresh ? resolvedGapLimit : addressIndex + resolvedGapLimit
251
- ),
268
+ endAddressIndexes: chain.map((addressIndex) => {
269
+ if (refresh) return resolvedGapLimit
270
+ return addressIndex + resolvedGapLimit
271
+ }),
252
272
  }
253
273
  })
254
274
 
255
275
  let allTxs = []
256
-
257
276
  for (let fetchCount = 0; ; fetchCount++) {
258
277
  const chainObjects = gapSearchParameters.flatMap(
259
278
  ({ purpose, chain, startAddressIndexes, endAddressIndexes }) => {
@@ -303,55 +322,59 @@ export class BitcoinMonitorScanner {
303
322
  allTxs = [...allTxs, ...txs]
304
323
 
305
324
  // Update chains to see if we need to fetch more
306
- txs.forEach((tx) =>
307
- tx.vout.forEach((vout) => {
308
- if (!vout.scriptPubKey) return
309
- // this is an array because legacy multisig has multiple addresses
310
- if (!Array.isArray(vout.scriptPubKey.addresses)) return
311
- if (vout.scriptPubKey.addresses.length === 0) return
312
- if (!addrMap[vout.scriptPubKey.addresses[0]]) return
313
-
314
- const address = addrMap[vout.scriptPubKey.addresses[0]]
315
- // this is a used address, we need to update the chain
316
- const pd = address.meta.path.split('/')
317
- const metaChainIndex = parseInt(pd[1])
318
- const metaAddressIndex = pd[2] ? parseInt(pd[2]) : undefined // compatibility, it could shorter eg. m/0, not m/0/0
319
- const addressString = String(address)
320
- const purposeToUpdate = purposeMap[addressString]
321
-
322
- if (
323
- metaAddressIndex === undefined ||
324
- (metaChainIndex === this.#ordinalChainIndex && this.#ordinalChainIndex > 1)
325
- ) {
326
- return
327
- }
325
+ if (multiAddressMode) {
326
+ txs.forEach((tx) =>
327
+ tx.vout.forEach((vout) => {
328
+ if (!vout.scriptPubKey) return
329
+ // this is an array because legacy multisig has multiple addresses
330
+ if (!Array.isArray(vout.scriptPubKey.addresses)) return
331
+ if (vout.scriptPubKey.addresses.length === 0) return
332
+ if (!addrMap[vout.scriptPubKey.addresses[0]]) return
333
+
334
+ const address = addrMap[vout.scriptPubKey.addresses[0]]
335
+ // this is a used address, we need to update the chain
336
+ const pd = address.meta.path.split('/')
337
+ const metaChainIndex = parseInt(pd[1])
338
+ const metaAddressIndex = pd[2] ? parseInt(pd[2]) : undefined // compatibility, it could shorter eg. m/0, not m/0/0
339
+ const addressString = String(address)
340
+ const purposeToUpdate = purposeMap[addressString]
341
+
342
+ if (
343
+ metaAddressIndex === undefined ||
344
+ (metaChainIndex === this.#ordinalChainIndex && this.#ordinalChainIndex > 1)
345
+ ) {
346
+ return
347
+ }
328
348
 
329
- if (!purposeToUpdate) {
330
- console.warn(`${assetName}: Cannot resolve purpose from address ${addressString}`)
331
- return
332
- }
349
+ if (!purposeToUpdate) {
350
+ console.warn(`${assetName}: Cannot resolve purpose from address ${addressString}`)
351
+ return
352
+ }
333
353
 
334
- const chainToUpgrade = newChains.find((newChain) => newChain.purpose === purposeToUpdate)
335
- if (!chainToUpgrade) {
336
- console.log(
337
- `${assetName}: There is no chain info for purpose ${purposeToUpdate} and address ${addressString}`
354
+ const chainToUpgrade = newChains.find(
355
+ (newChain) => newChain.purpose === purposeToUpdate
338
356
  )
339
- return
340
- }
357
+ if (!chainToUpgrade) {
358
+ console.log(
359
+ `${assetName}: There is no chain info for purpose ${purposeToUpdate} and address ${addressString}`
360
+ )
361
+ return
362
+ }
341
363
 
342
- if (chainToUpgrade.chain[metaChainIndex] === undefined) {
343
- console.log(
344
- `${assetName}: There is no chain info for purpose ${purposeToUpdate}, address ${addressString} and chain index ${metaChainIndex}`
345
- )
346
- return
347
- }
364
+ if (chainToUpgrade.chain[metaChainIndex] === undefined) {
365
+ console.log(
366
+ `${assetName}: There is no chain info for purpose ${purposeToUpdate}, address ${addressString} and chain index ${metaChainIndex}`
367
+ )
368
+ return
369
+ }
348
370
 
349
- chainToUpgrade.chain[metaChainIndex] = Math.max(
350
- metaAddressIndex + 1,
351
- chainToUpgrade.chain[metaChainIndex]
352
- )
353
- })
354
- )
371
+ chainToUpgrade.chain[metaChainIndex] = Math.max(
372
+ metaAddressIndex + 1,
373
+ chainToUpgrade.chain[metaChainIndex]
374
+ )
375
+ })
376
+ )
377
+ }
355
378
 
356
379
  gapSearchParameters.forEach((indexData) => {
357
380
  // eslint-disable-next-line @exodus/mutable/no-param-reassign-prop-only
@@ -1,13 +1,13 @@
1
- import assert from 'minimalistic-assert'
1
+ import { BaseMonitor } from '@exodus/asset-lib'
2
+ import delay from 'delay'
2
3
  import { isEmpty, isEqual, pickBy } from 'lodash'
4
+ import assert from 'minimalistic-assert'
5
+ import ms from 'ms'
3
6
 
4
- import { BaseMonitor } from '@exodus/asset-lib'
7
+ import { normalizeInsightConfig, toWSUrl } from '../insight-api-client/util'
5
8
  import InsightWSClient from '../insight-api-client/ws'
6
9
  import { resolveUnconfirmedAncestorData } from '../unconfirmed-ancestor-data'
7
10
  import { BitcoinMonitorScanner } from './bitcoin-monitor-scanner'
8
- import { normalizeInsightConfig, toWSUrl } from '../insight-api-client/util'
9
- import ms from 'ms'
10
- import delay from 'delay'
11
11
 
12
12
  // NOTE: this is a frankenstein mashup of Exodus desktop
13
13
  // assets-refresh/insight action + Neo monitor
@@ -91,14 +91,14 @@ export class Monitor extends BaseMonitor {
91
91
  Object.fromEntries(
92
92
  await Promise.all(
93
93
  walletAccounts.map(async (walletAccount) => {
94
- const config = await this.aci.getAssetConfig({
94
+ const config = await this.aci.getAssetConfig?.({
95
95
  assetName: this.asset.name,
96
96
  walletAccount,
97
97
  })
98
98
  return [
99
99
  walletAccount,
100
100
  await this.aci.getReceiveAddresses({
101
- multiAddressMode: config.multiAddressMode ?? true,
101
+ multiAddressMode: config?.multiAddressMode ?? true,
102
102
  assetName: this.asset.name,
103
103
  walletAccount,
104
104
  useCache: true,
@@ -1,18 +1,14 @@
1
- import assert from 'minimalistic-assert'
2
- import lodash from 'lodash'
3
-
4
- import { UtxoCollection, Address } from '@exodus/models'
5
- import { retry } from '@exodus/simple-retry'
6
- import { selectUtxos } from '../fee/utxo-selector'
7
1
  import { getTxSequence } from '@exodus/bitcoin-lib'
2
+ import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
3
+ import { Address, UtxoCollection } from '@exodus/models'
4
+ import { retry } from '@exodus/simple-retry'
5
+ import lodash from 'lodash'
6
+ import assert from 'minimalistic-assert'
8
7
 
9
8
  import { parseCurrency } from '../fee/fee-utils'
10
-
11
- import {
12
- createInputs as dogecoinCreateInputs,
13
- createOutput as dogecoinCreateOutput,
14
- } from './dogecoin'
9
+ import { selectUtxos } from '../fee/utxo-selector'
15
10
  import { findUnconfirmedSentRbfTxs } from '../tx-utils'
11
+ import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
16
12
  import {
17
13
  getInscriptionIds,
18
14
  getOrdinalsUtxos,
@@ -20,9 +16,10 @@ import {
20
16
  getUsableUtxos,
21
17
  getUtxos,
22
18
  } from '../utxos-utils'
23
-
24
- import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
25
- import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
19
+ import {
20
+ createInputs as dogecoinCreateInputs,
21
+ createOutput as dogecoinCreateOutput,
22
+ } from './dogecoin'
26
23
 
27
24
  const ASSETS_SUPPORTED_BIP_174 = new Set([
28
25
  'bitcoin',
@@ -635,10 +632,14 @@ export const createAndBroadcastTXFactory =
635
632
  },
636
633
  })
637
634
 
635
+ const config = await assetClientInterface.getAssetConfig?.({
636
+ assetName,
637
+ walletAccount,
638
+ })
638
639
  const walletAddressObjects = await assetClientInterface.getReceiveAddresses({
639
640
  walletAccount,
640
641
  assetName,
641
- multiAddressMode: true,
642
+ multiAddressMode: config?.multiAddressMode ?? true,
642
643
  })
643
644
  // There are two cases of bumping, replacing or chaining a self-send.
644
645
  // If we have a bumpTxId, but we aren't replacing, then it is a self-send.
@@ -1,13 +1,12 @@
1
- import lodash from 'lodash'
2
- import BipPath from 'bip32-path'
3
- import assert from 'minimalistic-assert'
4
1
  import { getOwnProperty } from '@exodus/basic-utils'
5
2
  import KeyIdentifier from '@exodus/key-identifier'
3
+ import BipPath from 'bip32-path'
4
+ import lodash from 'lodash'
5
+ import assert from 'minimalistic-assert'
6
+ import secp256k1 from 'secp256k1'
6
7
 
7
8
  import { getECPair } from '../bitcoinjs-lib'
8
9
 
9
- import secp256k1 from 'secp256k1'
10
-
11
10
  const ECPair = getECPair()
12
11
 
13
12
  export const createGetKeyWithMetadata = ({
@@ -1,9 +1,9 @@
1
- import { Transaction, payments } from '@exodus/bitcoinjs-lib'
1
+ import { payments, Transaction } from '@exodus/bitcoinjs-lib'
2
2
  import * as bip371 from '@exodus/bitcoinjs-lib/src/psbt/bip371'
3
3
 
4
4
  import { toXOnly } from '../bitcoinjs-lib/ecc-utils'
5
5
  import { createGetKeyWithMetadata } from './create-get-key-and-purpose'
6
- import { toAsyncSigner, toAsyncBufferSigner } from './taproot'
6
+ import { toAsyncBufferSigner, toAsyncSigner } from './taproot'
7
7
 
8
8
  export function createSignWithWallet({
9
9
  signer,
@@ -1,8 +1,8 @@
1
1
  import assert from 'minimalistic-assert'
2
2
 
3
- import { createPrepareForSigning } from './default-prepare-for-signing'
4
- import { createSignWithWallet } from './create-sign-with-wallet'
5
3
  import { extractTransaction } from './common'
4
+ import { createSignWithWallet } from './create-sign-with-wallet'
5
+ import { createPrepareForSigning } from './default-prepare-for-signing'
6
6
 
7
7
  export const signTxFactory = ({
8
8
  assetName,
@@ -1,5 +1,5 @@
1
- import assert from 'minimalistic-assert'
2
1
  import { Psbt, Transaction } from '@exodus/bitcoinjs-lib'
2
+ import assert from 'minimalistic-assert'
3
3
 
4
4
  const _MAXIMUM_FEE_RATES = {
5
5
  qtumignition: 25_000,
@@ -1,7 +1,7 @@
1
1
  import assert from 'minimalistic-assert'
2
2
 
3
- import { createPrepareForSigning } from './default-prepare-for-signing'
4
3
  import { extractTransaction } from './common'
4
+ import { createPrepareForSigning } from './default-prepare-for-signing'
5
5
 
6
6
  export const signHardwareFactory = ({ assetName, resolvePurpose, keys, coinInfo }) => {
7
7
  assert(assetName, 'assetName is required')
@@ -1,9 +1,9 @@
1
1
  import { crypto } from '@exodus/bitcoinjs-lib'
2
2
  import assert from 'minimalistic-assert'
3
3
 
4
- import defaultEntropy from './default-entropy.cjs'
5
- import { ecc } from '../bitcoinjs-lib/ecc'
6
4
  import { getECPair } from '../bitcoinjs-lib'
5
+ import { ecc } from '../bitcoinjs-lib/ecc'
6
+ import defaultEntropy from './default-entropy.cjs'
7
7
 
8
8
  const ECPair = getECPair()
9
9
 
@@ -1,8 +1,9 @@
1
1
  // Move to shared utils...
2
2
  import { UtxoCollection } from '@exodus/models'
3
- import { findLargeUnconfirmedTxs } from './tx-utils'
4
3
  import assert from 'minimalistic-assert'
5
4
 
5
+ import { findLargeUnconfirmedTxs } from './tx-utils'
6
+
6
7
  const MAX_ORDINAL_VALUE_POSTAGE = 10_000
7
8
 
8
9
  export const getInscriptionTxId = (inscriptionId) => {