@exodus/bitcoin-api 2.9.1 → 2.9.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-api",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Exodus bitcoin-api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,34 +13,50 @@
|
|
|
13
13
|
"access": "restricted"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "jest",
|
|
17
|
-
"lint": "eslint ./src",
|
|
16
|
+
"test": "run -T jest",
|
|
17
|
+
"lint": "run -T eslint ./src",
|
|
18
18
|
"lint:fix": "yarn lint --fix"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@exodus/asset-lib": "^
|
|
21
|
+
"@exodus/asset-lib": "^4.0.0",
|
|
22
22
|
"@exodus/basic-utils": "^2.1.0",
|
|
23
23
|
"@exodus/bip-schnorr": "0.6.6-fork-1",
|
|
24
24
|
"@exodus/bip44-constants": "^195.0.0",
|
|
25
|
+
"@exodus/bitcoin-lib": "2.3.0",
|
|
25
26
|
"@exodus/bitcoinjs-lib": "^6.1.5-exodus.0",
|
|
27
|
+
"@exodus/currency": "^2.3.2",
|
|
28
|
+
"@exodus/fetch": "^1.3.0",
|
|
26
29
|
"@exodus/models": "^11.0.0",
|
|
27
30
|
"@exodus/secp256k1": "4.0.2-exodus.0",
|
|
28
31
|
"@exodus/simple-retry": "0.0.6",
|
|
29
32
|
"@exodus/timer": "^1.0.0",
|
|
30
33
|
"@noble/secp256k1": "~1.7.1",
|
|
31
34
|
"bech32": "^1.1.3",
|
|
35
|
+
"bip32-path": "^0.4.2",
|
|
36
|
+
"bn.js": "4.12.0",
|
|
37
|
+
"bs58check": "^2.1.2",
|
|
32
38
|
"coininfo": "5.1.0",
|
|
39
|
+
"create-hash": "^1.2.0",
|
|
33
40
|
"delay": "4.0.1",
|
|
34
41
|
"ecpair": "2.0.1",
|
|
42
|
+
"lodash": "^4.17.21",
|
|
43
|
+
"minimalistic-assert": "^1.0.1",
|
|
44
|
+
"ms": "^2.1.1",
|
|
45
|
+
"secp256k1": "^3.0.1",
|
|
35
46
|
"socket.io-client": "2.1.1",
|
|
36
47
|
"tiny-secp256k1": "1.1.3",
|
|
37
|
-
"url-join": "4.0.0"
|
|
48
|
+
"url-join": "4.0.0",
|
|
49
|
+
"varuint-bitcoin": "^1.1.0",
|
|
50
|
+
"wif": "^2.0.6"
|
|
38
51
|
},
|
|
39
52
|
"devDependencies": {
|
|
53
|
+
"@exodus/assets-testing": "^1.0.0",
|
|
40
54
|
"@exodus/bitcoin-meta": "^1.0.2",
|
|
41
55
|
"@scure/base": "^1.1.3",
|
|
42
56
|
"@scure/btc-signer": "^1.1.0",
|
|
43
|
-
"
|
|
57
|
+
"bigi": "^1.4.2",
|
|
58
|
+
"jest-when": "^3.5.1",
|
|
59
|
+
"safe-buffer": "^5.2.1"
|
|
44
60
|
},
|
|
45
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "b282e5087dda77c80fc63947ccc0020e6aa7db93"
|
|
46
62
|
}
|
package/src/fee/can-bump-tx.js
CHANGED
|
@@ -104,7 +104,7 @@ const _canBumpTx = ({
|
|
|
104
104
|
unconfirmedTxAncestor,
|
|
105
105
|
})
|
|
106
106
|
|
|
107
|
-
return fee ? { bumpType: BumpType.CPFP } : { errorMessage: 'insufficient funds' }
|
|
107
|
+
return fee ? { bumpType: BumpType.CPFP, bumpFee: fee } : { errorMessage: 'insufficient funds' }
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
const validateIsNumber = (number, name) => {
|
|
@@ -90,6 +90,7 @@ export class GetFeeResolver {
|
|
|
90
90
|
}) => {
|
|
91
91
|
assert(asset, 'asset must be provided')
|
|
92
92
|
assert(feeData, 'feeData must be provided')
|
|
93
|
+
assert(customFee || feeData.feePerKB, 'feePerKB must be provided')
|
|
93
94
|
assert(accountState, 'accountState must be provided')
|
|
94
95
|
assert(txSet, 'txSet must be provided')
|
|
95
96
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
/* global fetch */
|
|
2
1
|
import urlJoin from 'url-join'
|
|
3
2
|
import delay from 'delay'
|
|
4
3
|
import { isEmpty } from 'lodash'
|
|
5
4
|
|
|
5
|
+
import { fetch } from '@exodus/fetch'
|
|
6
|
+
|
|
6
7
|
const getTextFromResponse = async (response) => {
|
|
7
8
|
try {
|
|
8
9
|
const responseBody = await response.text()
|
package/src/utxos-utils.js
CHANGED
|
@@ -222,10 +222,15 @@ export function getUsableUtxos({ asset, utxos, feeData, txSet, unconfirmedTxAnce
|
|
|
222
222
|
assert(txSet, 'txSet is required')
|
|
223
223
|
if (!['bitcoin', 'bitcointestnet', 'bitcoinregtest'].includes(asset.name))
|
|
224
224
|
return filterDustUtxos({ utxos, feeData })
|
|
225
|
-
|
|
225
|
+
|
|
226
|
+
assert(feeData.fastestFee, 'feeData.fastestFee is required')
|
|
227
|
+
assert(
|
|
228
|
+
typeof feeData.maxExtraCpfpFee === 'number' && !Number.isNaN(feeData.maxExtraCpfpFee),
|
|
229
|
+
' feeData.maxExtraCpfpFee must be a number'
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
const { fastestFee, maxExtraCpfpFee: maxFee } = feeData
|
|
226
233
|
const feeRate = fastestFee.toBaseNumber()
|
|
227
|
-
const maxFee = feeData.maxExtraCpfpFee
|
|
228
|
-
assert(typeof maxFee === 'number' && !Number.isNaN(maxFee), 'maxFee must be a number')
|
|
229
234
|
|
|
230
235
|
const largeUnconfirmedTxs = findLargeUnconfirmedTxs({
|
|
231
236
|
txSet,
|