@exodus/bitcoin-plugin 1.33.0 → 1.34.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/CHANGELOG.md +20 -0
- package/package.json +2 -2
- package/src/create-asset.js +22 -24
- package/src/custom-fees.js +10 -7
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
|
+
## [1.34.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.33.1...@exodus/bitcoin-plugin@1.34.0) (2025-05-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: make multipleAddresses support configurable (#5585)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.33.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.33.0...@exodus/bitcoin-plugin@1.33.1) (2025-04-21)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* fix: prevent app crash by adding null checks for toBaseNumber method (#5376)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.33.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.32.2...@exodus/bitcoin-plugin@1.33.0) (2025-04-01)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.34.0",
|
|
4
4
|
"description": "Bitcoin plugin for Exodus SDK powered wallets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"type": "git",
|
|
57
57
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3438066ca08d6403d9ffec68bc52fc7e5a9bbffe"
|
|
60
60
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -40,25 +40,24 @@ import { createWeb3API } from './web3/index.js'
|
|
|
40
40
|
|
|
41
41
|
export const createBitcoinAssetFactory =
|
|
42
42
|
({ asset, apiUrl: defaultApiUrl, coinInfoNetwork, isTestnet = false }) =>
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
) => {
|
|
43
|
+
({
|
|
44
|
+
assetClientInterface,
|
|
45
|
+
overrideCallback = ({ asset }) => asset,
|
|
46
|
+
config: {
|
|
47
|
+
apiUrl: customApiUrl,
|
|
48
|
+
allowUnconfirmedRbfEnabledUtxos = false,
|
|
49
|
+
ordinalChainIndex = DEFAULT_ORDINAL_CHAIN_INDEX,
|
|
50
|
+
ordinalsEnabled = false,
|
|
51
|
+
gapLimit = 10,
|
|
52
|
+
refreshGapLimit = 25,
|
|
53
|
+
feeDataCustomValues,
|
|
54
|
+
utxosDescendingOrder = false,
|
|
55
|
+
omitSupportedPurposes = [],
|
|
56
|
+
defaultOutputType = 'P2WSH',
|
|
57
|
+
changeAddressType = 'P2WPKH',
|
|
58
|
+
multipleAddresses = true,
|
|
59
|
+
} = Object.create(null),
|
|
60
|
+
}) => {
|
|
62
61
|
const apiUrl = customApiUrl || defaultApiUrl
|
|
63
62
|
assert(assetClientInterface, 'assetClientInterface is required')
|
|
64
63
|
assert(asset, 'asset is required')
|
|
@@ -87,14 +86,12 @@ export const createBitcoinAssetFactory =
|
|
|
87
86
|
|
|
88
87
|
const allowedPurposes = [44, 49, 84, 86]
|
|
89
88
|
|
|
90
|
-
const useMultipleAddresses = true
|
|
91
|
-
|
|
92
89
|
const features = {
|
|
93
90
|
accountState: true,
|
|
94
91
|
feeMonitor: true,
|
|
95
92
|
feesApi: true,
|
|
96
93
|
moveFunds: true,
|
|
97
|
-
multipleAddresses
|
|
94
|
+
multipleAddresses,
|
|
98
95
|
nfts: ordinalsEnabled,
|
|
99
96
|
isTestnet,
|
|
100
97
|
signWithSigner: true,
|
|
@@ -287,7 +284,7 @@ export const createBitcoinAssetFactory =
|
|
|
287
284
|
createFeeMonitor: (args) =>
|
|
288
285
|
new BitcoinFeeMonitor({ ...args, insight: () => insightClient, assetName: asset.name }),
|
|
289
286
|
createHistoryMonitor,
|
|
290
|
-
customFees: createCustomFeesApi({ baseAsset: asset }),
|
|
287
|
+
customFees: createCustomFeesApi({ baseAsset: asset, feeData }),
|
|
291
288
|
features,
|
|
292
289
|
getDefaultAddressPath,
|
|
293
290
|
getFeeData: () => feeData,
|
|
@@ -324,7 +321,7 @@ export const createBitcoinAssetFactory =
|
|
|
324
321
|
keys,
|
|
325
322
|
useBip84,
|
|
326
323
|
useBip86,
|
|
327
|
-
useMultipleAddresses,
|
|
324
|
+
useMultipleAddresses: multipleAddresses, // @deprecated use api.features.multipleAddresses instead
|
|
328
325
|
insightClient,
|
|
329
326
|
canBumpTx,
|
|
330
327
|
getAvailableBalance,
|
|
@@ -349,6 +346,7 @@ export const createBitcoinAssetFactory =
|
|
|
349
346
|
omitSupportedPurposes,
|
|
350
347
|
defaultOutputType,
|
|
351
348
|
changeAddressType,
|
|
349
|
+
multipleAddresses,
|
|
352
350
|
},
|
|
353
351
|
insightClient,
|
|
354
352
|
})
|
package/src/custom-fees.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
export const createCustomFeesApi = ({ baseAsset }) => {
|
|
1
|
+
export const createCustomFeesApi = ({ baseAsset, feeData: defaultFeeData }) => {
|
|
2
2
|
return {
|
|
3
|
-
getRecommendedMinMaxFeeUnitPrices: ({ feeData }) => {
|
|
3
|
+
getRecommendedMinMaxFeeUnitPrices: ({ feeData = defaultFeeData }) => {
|
|
4
|
+
const minFee = feeData.minimumFee.toBaseNumber()
|
|
5
|
+
const fastestFee = feeData.fastestFee.toBaseNumber()
|
|
6
|
+
|
|
4
7
|
return {
|
|
5
|
-
recommended:
|
|
6
|
-
min:
|
|
7
|
-
max:
|
|
8
|
+
recommended: fastestFee,
|
|
9
|
+
min: minFee,
|
|
10
|
+
max: fastestFee * 3,
|
|
8
11
|
}
|
|
9
12
|
},
|
|
10
13
|
unit: 'sat/byte',
|
|
11
|
-
feeUnitPriceToNumber: (feeNumberUnit) => feeNumberUnit
|
|
14
|
+
feeUnitPriceToNumber: (feeNumberUnit) => feeNumberUnit?.div(1000).toBaseNumber() || 0,
|
|
12
15
|
numberToFeeUnitPrice: (value) => baseAsset.currency.baseUnit(value * 1000),
|
|
13
|
-
isEnabled: ({ feeData }) => Boolean(feeData.rbfEnabled),
|
|
16
|
+
isEnabled: ({ feeData = defaultFeeData }) => Boolean(feeData.rbfEnabled),
|
|
14
17
|
}
|
|
15
18
|
}
|