@exodus/bitcoin-api 5.2.1 → 5.2.3
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 +18 -0
- package/package.json +2 -2
- package/src/balances.js +4 -8
- package/src/errors.js +5 -0
- package/src/fee/can-bump-tx.js +7 -3
- package/src/fee/fee-utils.js +11 -1
- package/src/fee/utxo-selector.js +13 -22
- package/src/tx-create/create-tx.js +20 -3
- package/src/tx-log/bitcoin-monitor.js +24 -8
- package/src/tx-send/batch-tx.js +12 -1
- package/src/utxos-utils.js +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
## [5.2.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@5.2.2...@exodus/bitcoin-api@5.2.3) (2026-11-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **bitcoin-api:** require ancestor fee data before chaining ([#9453](https://github.com/ExodusMovement/assets/issues/9453)) ([cb00b1e](https://github.com/ExodusMovement/assets/commit/cb00b1e65e07b19817e795aac329afff696a7dca))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [5.2.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@5.2.1...@exodus/bitcoin-api@5.2.2) (2026-11-26)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **bitcoin-api:** include own pending change in spendable balances ([#9450](https://github.com/ExodusMovement/assets/issues/9450)) ([4d55ad2](https://github.com/ExodusMovement/assets/commit/4d55ad2e48c20ba66b6f51f511affc1882808e73))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [5.2.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@5.2.0...@exodus/bitcoin-api@5.2.1) (2026-11-26)
|
|
7
25
|
|
|
8
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-api",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "Bitcoin transaction and fee monitors, RPC with the blockchain node, other networking code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"type": "git",
|
|
61
61
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "de6c00cd6c874087f5998f1ea2970017dbe4c640"
|
|
64
64
|
}
|
package/src/balances.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { getUnconfirmedSentBalance } from '@exodus/asset-lib'
|
|
2
2
|
import assert from 'minimalistic-assert'
|
|
3
3
|
|
|
4
|
+
import { findUnconfirmedSentRbfTxs } from './tx-utils.js'
|
|
4
5
|
import { getUnconfirmedTxAncestorMap } from './unconfirmed-ancestor-data.js'
|
|
5
|
-
import {
|
|
6
|
-
getConfirmedOrRfbDisabledUtxos,
|
|
7
|
-
getUnconfirmedUtxos,
|
|
8
|
-
getUsableUtxos,
|
|
9
|
-
getUtxos,
|
|
10
|
-
} from './utxos-utils.js'
|
|
6
|
+
import { getSpendableUtxos, getUnconfirmedUtxos, getUsableUtxos, getUtxos } from './utxos-utils.js'
|
|
11
7
|
|
|
12
8
|
export const getBalancesFactory = ({
|
|
13
9
|
feeData: defaultFeeData,
|
|
@@ -38,9 +34,9 @@ export const getBalancesFactory = ({
|
|
|
38
34
|
unconfirmedTxAncestor,
|
|
39
35
|
})
|
|
40
36
|
|
|
41
|
-
const spendableUtxos =
|
|
42
|
-
asset,
|
|
37
|
+
const spendableUtxos = getSpendableUtxos({
|
|
43
38
|
utxos: usableUtxos,
|
|
39
|
+
replaceableTxs: findUnconfirmedSentRbfTxs(txLog),
|
|
44
40
|
allowUnconfirmedRbfEnabledUtxos,
|
|
45
41
|
})
|
|
46
42
|
|
package/src/errors.js
CHANGED
|
@@ -110,6 +110,11 @@ export const BTC_ERRORS = createSendErrorTable(3100, {
|
|
|
110
110
|
hint: safeString`The transaction was sent but could not be saved, check your history before sending again`,
|
|
111
111
|
action: 'check-history',
|
|
112
112
|
},
|
|
113
|
+
ANCESTOR_DATA_UNAVAILABLE: {
|
|
114
|
+
code: 'EXOD-3167',
|
|
115
|
+
hint: safeString`Transaction fee data is not ready yet, please try again shortly`,
|
|
116
|
+
action: 'retry-later',
|
|
117
|
+
},
|
|
113
118
|
UNKNOWN_SEND_FAILURE: {
|
|
114
119
|
code: 'EXOD-3199',
|
|
115
120
|
hint: safeString`Transaction failed, try again or contact support`,
|
package/src/fee/can-bump-tx.js
CHANGED
|
@@ -4,6 +4,7 @@ import assert from 'minimalistic-assert'
|
|
|
4
4
|
import { findUnconfirmedSentRbfTxs } from '../tx-utils.js'
|
|
5
5
|
import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data.js'
|
|
6
6
|
import { getUsableUtxos, getUtxos, isUtxoConfirmed } from '../utxos-utils.js'
|
|
7
|
+
import { hasUnconfirmedAncestorData } from './fee-utils.js'
|
|
7
8
|
import { selectUtxos } from './utxo-selector.js'
|
|
8
9
|
|
|
9
10
|
export const ASSET_NAMES = ['bitcoin', 'bitcoinregtest', 'bitcointestnet']
|
|
@@ -126,9 +127,12 @@ const _canBumpTx = ({
|
|
|
126
127
|
isBumpTx: true,
|
|
127
128
|
})
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
if (!selectedUtxos?.size) return { errorMessage: 'insufficient funds' }
|
|
131
|
+
if (!hasUnconfirmedAncestorData({ asset, utxos: selectedUtxos, unconfirmedTxAncestor })) {
|
|
132
|
+
return { errorMessage: 'ancestor data not loaded' }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return { bumpType: BumpType.CPFP, bumpFee: fee }
|
|
132
136
|
}
|
|
133
137
|
|
|
134
138
|
const validateIsNumber = (number, name) => {
|
package/src/fee/fee-utils.js
CHANGED
|
@@ -5,13 +5,23 @@ import assert from 'minimalistic-assert'
|
|
|
5
5
|
import { resolveExtraFeeOfTx } from '../unconfirmed-ancestor-data.js'
|
|
6
6
|
import { isUtxoConfirmed } from '../utxos-utils.js'
|
|
7
7
|
|
|
8
|
+
const ancestorFeeAssets = new Set(['bitcoin', 'bitcointestnet', 'bitcoinregtest'])
|
|
9
|
+
|
|
10
|
+
// The monitor rebuilds this in-memory cache, so data can be missing after a restart or failed fetch.
|
|
11
|
+
export function hasUnconfirmedAncestorData({ asset, utxos, unconfirmedTxAncestor }) {
|
|
12
|
+
return (
|
|
13
|
+
!ancestorFeeAssets.has(asset.name) ||
|
|
14
|
+
utxos.toArray().every((utxo) => isUtxoConfirmed(utxo) || unconfirmedTxAncestor[utxo.txId])
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
export const isHex = (s) => typeof s === 'string' && /^[\da-f]+$/.test(s.toLowerCase())
|
|
9
19
|
|
|
10
20
|
export function getExtraFee({ asset, inputs, feePerKB, unconfirmedTxAncestor }) {
|
|
11
21
|
let extraFee = 0
|
|
12
22
|
// Add extra fee to unconfirmed bitcoin utxos to allow transaction to CPFP ancestors
|
|
13
23
|
if (
|
|
14
|
-
|
|
24
|
+
ancestorFeeAssets.has(asset.name) &&
|
|
15
25
|
(inputs instanceof UtxoCollection || !Array.isArray(inputs))
|
|
16
26
|
) {
|
|
17
27
|
const feeRate = feePerKB.toBaseNumber() / 1000
|
package/src/fee/utxo-selector.js
CHANGED
|
@@ -3,7 +3,7 @@ import lodash from 'lodash'
|
|
|
3
3
|
import assert from 'minimalistic-assert'
|
|
4
4
|
|
|
5
5
|
import { getChangeDustValue } from '../dust.js'
|
|
6
|
-
import {
|
|
6
|
+
import { getConfirmedUtxos, getSpendableUtxos } from '../utxos-utils.js'
|
|
7
7
|
import { getExtraFee } from './fee-utils.js'
|
|
8
8
|
|
|
9
9
|
const { sortBy } = lodash
|
|
@@ -47,6 +47,7 @@ export const selectUtxos = ({
|
|
|
47
47
|
asset,
|
|
48
48
|
utxosDescendingOrder,
|
|
49
49
|
usableUtxos,
|
|
50
|
+
spendableUtxos,
|
|
50
51
|
replaceableTxs,
|
|
51
52
|
amount,
|
|
52
53
|
feeRate,
|
|
@@ -224,25 +225,15 @@ export const selectUtxos = ({
|
|
|
224
225
|
|
|
225
226
|
if (!spendUtxos) spendUtxos = UtxoCollection.createEmpty({ currency })
|
|
226
227
|
|
|
227
|
-
|
|
228
|
-
let ourRbfUtxos = UtxoCollection.createEmpty({ currency })
|
|
229
|
-
if (replaceableTxs) {
|
|
230
|
-
for (const tx of replaceableTxs) {
|
|
231
|
-
if (!tx.data.internalOutputs?.length && !tx.data.changeAddress) continue
|
|
232
|
-
const internalUtxos = usableUtxos.getTxIdUtxos(tx.txId)
|
|
233
|
-
ourRbfUtxos = ourRbfUtxos.union(internalUtxos)
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
const spendableUtxos = getConfirmedOrRfbDisabledUtxos({
|
|
238
|
-
asset,
|
|
228
|
+
spendableUtxos ??= getSpendableUtxos({
|
|
239
229
|
utxos: usableUtxos,
|
|
230
|
+
replaceableTxs,
|
|
240
231
|
allowUnconfirmedRbfEnabledUtxos,
|
|
241
232
|
})
|
|
242
233
|
|
|
243
234
|
const utxosArray = _toPriorityOrderedArray({
|
|
244
235
|
utxosDescendingOrder,
|
|
245
|
-
utxos: spendableUtxos
|
|
236
|
+
utxos: spendableUtxos,
|
|
246
237
|
})
|
|
247
238
|
|
|
248
239
|
if (isSendAll) {
|
|
@@ -267,7 +258,7 @@ export const selectUtxos = ({
|
|
|
267
258
|
)
|
|
268
259
|
const remainingUtxosArray = _toPriorityOrderedArray({
|
|
269
260
|
utxosDescendingOrder,
|
|
270
|
-
utxos: spendableUtxos.
|
|
261
|
+
utxos: spendableUtxos.difference(spendUtxos),
|
|
271
262
|
})
|
|
272
263
|
|
|
273
264
|
while (selectedUtxosValue.lte(amount) && remainingUtxosArray.length > 0) {
|
|
@@ -330,6 +321,11 @@ export const getUtxosData = ({
|
|
|
330
321
|
taprootInputWitnessSize,
|
|
331
322
|
changeAddressType,
|
|
332
323
|
}) => {
|
|
324
|
+
const spendableUtxos = getSpendableUtxos({
|
|
325
|
+
utxos: usableUtxos,
|
|
326
|
+
replaceableTxs,
|
|
327
|
+
allowUnconfirmedRbfEnabledUtxos,
|
|
328
|
+
})
|
|
333
329
|
const {
|
|
334
330
|
selectedUtxos,
|
|
335
331
|
replaceTx,
|
|
@@ -337,6 +333,7 @@ export const getUtxosData = ({
|
|
|
337
333
|
} = selectUtxos({
|
|
338
334
|
asset,
|
|
339
335
|
usableUtxos,
|
|
336
|
+
spendableUtxos,
|
|
340
337
|
replaceableTxs,
|
|
341
338
|
amount,
|
|
342
339
|
feeRate,
|
|
@@ -358,13 +355,7 @@ export const getUtxosData = ({
|
|
|
358
355
|
|
|
359
356
|
const replaceUtxos = replaceTx ? usableUtxos.getTxIdUtxos(replaceTx.txId) : empty
|
|
360
357
|
|
|
361
|
-
const
|
|
362
|
-
asset,
|
|
363
|
-
utxos: usableUtxos,
|
|
364
|
-
allowUnconfirmedRbfEnabledUtxos,
|
|
365
|
-
}).union(replaceUtxos)
|
|
366
|
-
|
|
367
|
-
const spendableBalance = spendableUtxos.value
|
|
358
|
+
const spendableBalance = spendableUtxos.union(replaceUtxos).value
|
|
368
359
|
|
|
369
360
|
const extraFeeCpfp = selectedUtxos?.size
|
|
370
361
|
? asset.currency.baseUnit(
|
|
@@ -5,12 +5,12 @@ import assert from 'minimalistic-assert'
|
|
|
5
5
|
|
|
6
6
|
import { getChangeDustValue } from '../dust.js'
|
|
7
7
|
import { setBtcErrorCode, toBtcSendError } from '../errors.js'
|
|
8
|
-
import { parseCurrency, serializeCurrency } from '../fee/fee-utils.js'
|
|
8
|
+
import { hasUnconfirmedAncestorData, parseCurrency, serializeCurrency } from '../fee/fee-utils.js'
|
|
9
9
|
import { selectUtxos } from '../fee/utxo-selector.js'
|
|
10
10
|
import { createPsbtWithMetadata } from '../psbt-builder.js'
|
|
11
11
|
import { findUnconfirmedSentRbfTxs } from '../tx-utils.js'
|
|
12
12
|
import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data.js'
|
|
13
|
-
import { getUsableUtxos, getUtxos } from '../utxos-utils.js'
|
|
13
|
+
import { getSpendableUtxos, getUsableUtxos, getUtxos } from '../utxos-utils.js'
|
|
14
14
|
import { authenticateReplacement } from './authenticate-replacement.js'
|
|
15
15
|
import { createInputs, createOutput, getBlockHeight, getNonWitnessTxs } from './tx-create-utils.js'
|
|
16
16
|
|
|
@@ -399,8 +399,13 @@ const transferHandler = {
|
|
|
399
399
|
|
|
400
400
|
const { processedAddress, useCashAddress } = processAddress({ asset, toAddress })
|
|
401
401
|
|
|
402
|
-
//
|
|
402
|
+
// Chaining spends existing change; only replacing the parent requires authentication.
|
|
403
403
|
let replaceableTxs = findUnconfirmedSentRbfTxs(context.txSet)
|
|
404
|
+
const spendableUtxos = getSpendableUtxos({
|
|
405
|
+
utxos: context.usableUtxos,
|
|
406
|
+
replaceableTxs,
|
|
407
|
+
allowUnconfirmedRbfEnabledUtxos,
|
|
408
|
+
})
|
|
404
409
|
|
|
405
410
|
if (authenticateReplacementTransactions) {
|
|
406
411
|
const authenticated = []
|
|
@@ -450,6 +455,7 @@ const transferHandler = {
|
|
|
450
455
|
} = selectUtxos({
|
|
451
456
|
asset,
|
|
452
457
|
usableUtxos: context.usableUtxos,
|
|
458
|
+
spendableUtxos,
|
|
453
459
|
replaceableTxs,
|
|
454
460
|
amount: utxoParams.sendAmount,
|
|
455
461
|
feeRate: utxoParams.feeRate,
|
|
@@ -490,6 +496,17 @@ const transferHandler = {
|
|
|
490
496
|
selectedUtxos = selectedUtxos.union(replaceTxInputUtxos)
|
|
491
497
|
}
|
|
492
498
|
|
|
499
|
+
if (
|
|
500
|
+
!replaceTx &&
|
|
501
|
+
!hasUnconfirmedAncestorData({
|
|
502
|
+
asset,
|
|
503
|
+
utxos: selectedUtxos,
|
|
504
|
+
unconfirmedTxAncestor: context.unconfirmedTxAncestor,
|
|
505
|
+
})
|
|
506
|
+
) {
|
|
507
|
+
throw setBtcErrorCode(new Error('Ancestor data not loaded'), 'ANCESTOR_DATA_UNAVAILABLE')
|
|
508
|
+
}
|
|
509
|
+
|
|
493
510
|
const addressPathsMap = selectedUtxos.getAddressPathsMap()
|
|
494
511
|
|
|
495
512
|
// Create inputs
|
|
@@ -4,6 +4,7 @@ import lodash from 'lodash'
|
|
|
4
4
|
import assert from 'minimalistic-assert'
|
|
5
5
|
import ms from 'ms'
|
|
6
6
|
|
|
7
|
+
import { hasUnconfirmedAncestorData } from '../fee/fee-utils.js'
|
|
7
8
|
import MempoolWSClient from '../insight-api-client/mempool-ws-client.js'
|
|
8
9
|
import {
|
|
9
10
|
normalizeInsightConfig,
|
|
@@ -11,7 +12,11 @@ import {
|
|
|
11
12
|
toWSUrl,
|
|
12
13
|
} from '../insight-api-client/util.js'
|
|
13
14
|
import InsightWSClient from '../insight-api-client/ws.js'
|
|
14
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
getUnconfirmedTxAncestorMap,
|
|
17
|
+
resolveUnconfirmedAncestorData,
|
|
18
|
+
} from '../unconfirmed-ancestor-data.js'
|
|
19
|
+
import { getUtxos } from '../utxos-utils.js'
|
|
15
20
|
import { BitcoinMonitorScanner } from './bitcoin-monitor-scanner.js'
|
|
16
21
|
|
|
17
22
|
const { isEmpty, isEqual } = lodash
|
|
@@ -305,13 +310,24 @@ export class Monitor extends BaseMonitor {
|
|
|
305
310
|
})
|
|
306
311
|
}
|
|
307
312
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
if (['bitcoin', 'bitcoinregtest', 'bitcointestnet'].includes(assetName)) {
|
|
314
|
+
const accountState = await aci.getAccountState({ assetName, walletAccount })
|
|
315
|
+
const currentUtxos = utxos || getUtxos({ asset: this.asset, accountState })
|
|
316
|
+
// Retry missing ancestor data even when the scanner reports no UTXO changes.
|
|
317
|
+
if (
|
|
318
|
+
utxos ||
|
|
319
|
+
!hasUnconfirmedAncestorData({
|
|
320
|
+
asset: this.asset,
|
|
321
|
+
utxos: currentUtxos,
|
|
322
|
+
unconfirmedTxAncestor: getUnconfirmedTxAncestorMap({ accountState }),
|
|
323
|
+
})
|
|
324
|
+
) {
|
|
325
|
+
const unconfirmedTxAncestor = await resolveUnconfirmedAncestorData({
|
|
326
|
+
utxos: currentUtxos,
|
|
327
|
+
insightClient: this.#insightClient,
|
|
328
|
+
})
|
|
329
|
+
newData.mem = { unconfirmedTxAncestor }
|
|
330
|
+
}
|
|
315
331
|
}
|
|
316
332
|
|
|
317
333
|
await aci.updateAccountState({
|
package/src/tx-send/batch-tx.js
CHANGED
|
@@ -5,9 +5,11 @@ import lodash from 'lodash' // mockable in tests
|
|
|
5
5
|
import assert from 'minimalistic-assert'
|
|
6
6
|
|
|
7
7
|
import { setBtcErrorCode, toBtcSendError } from '../errors.js'
|
|
8
|
+
import { hasUnconfirmedAncestorData } from '../fee/fee-utils.js'
|
|
8
9
|
import { selectUtxos } from '../fee/utxo-selector.js'
|
|
10
|
+
import { findUnconfirmedSentRbfTxs } from '../tx-utils.js'
|
|
9
11
|
import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data.js'
|
|
10
|
-
import { getUsableUtxos, getUtxos } from '../utxos-utils.js'
|
|
12
|
+
import { getSpendableUtxos, getUsableUtxos, getUtxos } from '../utxos-utils.js'
|
|
11
13
|
|
|
12
14
|
const DUST_VALUES = {
|
|
13
15
|
P2WPKH: 294,
|
|
@@ -48,6 +50,11 @@ export const getCreateBatchTransaction = ({
|
|
|
48
50
|
const { selectedUtxos, fee } = selectUtxos({
|
|
49
51
|
asset,
|
|
50
52
|
usableUtxos,
|
|
53
|
+
spendableUtxos: getSpendableUtxos({
|
|
54
|
+
utxos: usableUtxos,
|
|
55
|
+
replaceableTxs: findUnconfirmedSentRbfTxs(txSet),
|
|
56
|
+
allowUnconfirmedRbfEnabledUtxos,
|
|
57
|
+
}),
|
|
51
58
|
amount,
|
|
52
59
|
feeRate: feeData.feePerKB,
|
|
53
60
|
receiveAddresses,
|
|
@@ -64,6 +71,10 @@ export const getCreateBatchTransaction = ({
|
|
|
64
71
|
throw setBtcErrorCode(new Error('Not enough funds.'), 'INSUFFICIENT_FUNDS')
|
|
65
72
|
}
|
|
66
73
|
|
|
74
|
+
if (!hasUnconfirmedAncestorData({ asset, utxos: selectedUtxos, unconfirmedTxAncestor })) {
|
|
75
|
+
throw setBtcErrorCode(new Error('Ancestor data not loaded'), 'ANCESTOR_DATA_UNAVAILABLE')
|
|
76
|
+
}
|
|
77
|
+
|
|
67
78
|
const addressPathsMap = selectedUtxos.getAddressPathsMap()
|
|
68
79
|
|
|
69
80
|
const psbt = new Psbt({ network: asset.coinInfo.toBitcoinJS() })
|
package/src/utxos-utils.js
CHANGED
|
@@ -225,6 +225,16 @@ export function getConfirmedOrRfbDisabledUtxos({ utxos, allowUnconfirmedRbfEnabl
|
|
|
225
225
|
return utxos.filter((utxo) => utxo.confirmations > 0 || !utxo.rbfEnabled)
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
// Our pending outgoing transactions can still be chained.
|
|
229
|
+
export function getSpendableUtxos({ utxos, replaceableTxs, allowUnconfirmedRbfEnabledUtxos }) {
|
|
230
|
+
let spendableUtxos = getConfirmedOrRfbDisabledUtxos({ utxos, allowUnconfirmedRbfEnabledUtxos })
|
|
231
|
+
for (const tx of replaceableTxs ?? []) {
|
|
232
|
+
if (!tx.data.internalOutputs?.length && !tx.data.changeAddress) continue
|
|
233
|
+
spendableUtxos = spendableUtxos.union(utxos.getTxIdUtxos(tx.txId))
|
|
234
|
+
}
|
|
235
|
+
return spendableUtxos
|
|
236
|
+
}
|
|
237
|
+
|
|
228
238
|
function filterDustUtxos({ utxos, feeData }) {
|
|
229
239
|
if (feeData.utxoDustValue) {
|
|
230
240
|
return utxos.filter((utxo) => utxo.value.toBaseNumber() > feeData.utxoDustValue)
|