@exodus/bitcoin-api 4.0.0 → 4.0.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [4.0.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@4.0.0...@exodus/bitcoin-api@4.0.1) (2025-08-28)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exodus/bitcoin-api
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [4.0.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@3.3.0...@exodus/bitcoin-api@4.0.0) (2025-08-03)
|
|
7
15
|
|
|
8
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-api",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
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",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"type": "git",
|
|
60
60
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "c942fdd35a045680780f1dc5b096aebc5ca54c81"
|
|
63
63
|
}
|
package/src/fee/can-bump-tx.js
CHANGED
|
@@ -76,13 +76,16 @@ const _canBumpTx = ({
|
|
|
76
76
|
// Can't bump a non-rbf tx with no change
|
|
77
77
|
if (!bumpTx && changeUtxos.size === 0) return { errorMessage: 'no change' }
|
|
78
78
|
// Can't bump a confirmed tx
|
|
79
|
-
if (!bumpTx && changeUtxos.toArray().every(isUtxoConfirmed))
|
|
79
|
+
if (!bumpTx && changeUtxos.toArray().every(isUtxoConfirmed)) {
|
|
80
80
|
return { errorMessage: 'already confirmed' }
|
|
81
|
+
}
|
|
82
|
+
|
|
81
83
|
// Can't bump an rbf tx if change is already spent
|
|
82
|
-
if (bumpTx && bumpTx.data.changeAddress && changeUtxos.size === 0)
|
|
84
|
+
if (bumpTx && bumpTx.data.changeAddress && changeUtxos.size === 0) {
|
|
83
85
|
return {
|
|
84
86
|
errorMessage: 'already spent',
|
|
85
87
|
}
|
|
88
|
+
}
|
|
86
89
|
|
|
87
90
|
if (bumpTx) {
|
|
88
91
|
const { replaceTx, fee } = selectUtxos({
|
|
@@ -21,12 +21,14 @@ const fetchJson = async (url, fetchOptions, nullWhen404) => {
|
|
|
21
21
|
return null
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
if (!response.ok)
|
|
24
|
+
if (!response.ok) {
|
|
25
25
|
throw new Error(
|
|
26
26
|
`${url} returned ${response.status}: ${
|
|
27
27
|
response.statusText || 'Unknown Status Text'
|
|
28
28
|
}. Body: ${await getTextFromResponse(response)}`
|
|
29
29
|
)
|
|
30
|
+
}
|
|
31
|
+
|
|
30
32
|
return response.json()
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -9,7 +9,7 @@ import InsightWSClient from '../insight-api-client/ws.js'
|
|
|
9
9
|
import { resolveUnconfirmedAncestorData } from '../unconfirmed-ancestor-data.js'
|
|
10
10
|
import { BitcoinMonitorScanner } from './bitcoin-monitor-scanner.js'
|
|
11
11
|
|
|
12
|
-
const { isEmpty, isEqual
|
|
12
|
+
const { isEmpty, isEqual } = lodash
|
|
13
13
|
|
|
14
14
|
// NOTE: this is a frankenstein mashup of Exodus desktop
|
|
15
15
|
// assets-refresh/insight action + Neo monitor
|
|
@@ -171,18 +171,8 @@ export class Monitor extends BaseMonitor {
|
|
|
171
171
|
})
|
|
172
172
|
|
|
173
173
|
const newData = {}
|
|
174
|
-
if (utxos
|
|
175
|
-
|
|
176
|
-
newData,
|
|
177
|
-
pickBy(
|
|
178
|
-
{
|
|
179
|
-
utxos,
|
|
180
|
-
ordinalsUtxos,
|
|
181
|
-
},
|
|
182
|
-
Boolean
|
|
183
|
-
)
|
|
184
|
-
)
|
|
185
|
-
}
|
|
174
|
+
if (utxos) newData.utxos = utxos
|
|
175
|
+
if (ordinalsUtxos) newData.ordinalsUtxos = ordinalsUtxos
|
|
186
176
|
|
|
187
177
|
if (txsToUpdate.length > 0) {
|
|
188
178
|
await this.updateTxLog({ assetName, walletAccount, logItems: txsToUpdate })
|
|
@@ -254,17 +244,8 @@ export class Monitor extends BaseMonitor {
|
|
|
254
244
|
})
|
|
255
245
|
|
|
256
246
|
const newData = {}
|
|
257
|
-
if (utxos
|
|
258
|
-
|
|
259
|
-
newData,
|
|
260
|
-
pickBy(
|
|
261
|
-
{
|
|
262
|
-
utxos,
|
|
263
|
-
ordinalsUtxos,
|
|
264
|
-
},
|
|
265
|
-
Boolean
|
|
266
|
-
)
|
|
267
|
-
)
|
|
247
|
+
if (utxos) newData.utxos = utxos
|
|
248
|
+
if (ordinalsUtxos) newData.ordinalsUtxos = ordinalsUtxos
|
|
268
249
|
|
|
269
250
|
if (!isEmpty(changedUnusedAddressIndexes)) {
|
|
270
251
|
// Only for mobile atm, browser and hydra calculates from the latest txLogs
|
package/src/tx-send/index.js
CHANGED
package/src/utxos-utils.js
CHANGED
|
@@ -252,8 +252,9 @@ export function getUsableUtxos({
|
|
|
252
252
|
(utxo) => !utxo.isCoinbase || utxo.confirmations >= COINBASE_MATURITY_HEIGHT
|
|
253
253
|
)
|
|
254
254
|
|
|
255
|
-
if (!['bitcoin', 'bitcointestnet', 'bitcoinregtest'].includes(asset.name))
|
|
255
|
+
if (!['bitcoin', 'bitcointestnet', 'bitcoinregtest'].includes(asset.name)) {
|
|
256
256
|
return filterDustUtxos({ utxos, feeData })
|
|
257
|
+
}
|
|
257
258
|
|
|
258
259
|
assert(feeData.fastestFee, 'feeData.fastestFee is required')
|
|
259
260
|
assert(
|