@exodus/bitcoin-plugin 1.33.1 → 1.35.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 +4 -4
- package/src/create-asset.js +25 -56
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.35.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.34.0...@exodus/bitcoin-plugin@1.35.0) (2025-07-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: use get-activity-txs in bitcoin and litecoin (#6010)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.34.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.33.1...@exodus/bitcoin-plugin@1.34.0) (2025-05-09)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: make multipleAddresses support configurable (#5585)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [1.33.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.33.0...@exodus/bitcoin-plugin@1.33.1) (2025-04-21)
|
|
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.35.0",
|
|
4
4
|
"description": "Bitcoin plugin for Exodus SDK powered wallets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@exodus/asset-lib": "^5.0.0",
|
|
25
25
|
"@exodus/bip44-constants": "^195.0.0",
|
|
26
|
-
"@exodus/bitcoin-api": "^2.
|
|
26
|
+
"@exodus/bitcoin-api": "^2.34.0",
|
|
27
27
|
"@exodus/bitcoin-lib": "^2.4.2",
|
|
28
28
|
"@exodus/bitcoin-meta": "^2.0.1",
|
|
29
29
|
"@exodus/bitcoinjs": "^1.1.0",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@exodus/assets-testing": "^1.0.0",
|
|
40
40
|
"@exodus/bip32": "^3.3.0",
|
|
41
|
+
"@exodus/bip39": "^1.0.1",
|
|
41
42
|
"@exodus/bitcoinregtest-meta": "^2.0.1",
|
|
42
43
|
"@exodus/bitcointestnet-meta": "^2.0.1",
|
|
43
44
|
"@exodus/currency": "^6.0.1",
|
|
@@ -46,7 +47,6 @@
|
|
|
46
47
|
"@exodus/keychain": "^7.3.0",
|
|
47
48
|
"@exodus/tx-signer": "^2.3.1",
|
|
48
49
|
"@scure/btc-signer": "^1.1.0",
|
|
49
|
-
"bip39": "^2.6.0",
|
|
50
50
|
"jest-when": "^3.5.1"
|
|
51
51
|
},
|
|
52
52
|
"bugs": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"type": "git",
|
|
57
57
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "0a00220fa7ea319625757c200f38d52523397e84"
|
|
60
60
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createEncodeMultisigContract,
|
|
9
9
|
createPrepareForSigning,
|
|
10
10
|
createPsbtToUnsignedTx,
|
|
11
|
+
getActivityTxs as getActivityTxsBase,
|
|
11
12
|
getAddressesFromPrivateKeyFactory,
|
|
12
13
|
getBalancesFactory,
|
|
13
14
|
getBtcVersions,
|
|
@@ -23,10 +24,8 @@ import {
|
|
|
23
24
|
signMessageWithSigner,
|
|
24
25
|
signTxFactory,
|
|
25
26
|
} from '@exodus/bitcoin-api'
|
|
26
|
-
import { parseCurrency } from '@exodus/bitcoin-api/src/fee/fee-utils.js'
|
|
27
27
|
import { createGetKeyIdentifier } from '@exodus/bitcoin-lib'
|
|
28
28
|
import * as bitcoinjsLib from '@exodus/bitcoinjs'
|
|
29
|
-
import { Tx } from '@exodus/models'
|
|
30
29
|
import _coinInfo from 'coininfo'
|
|
31
30
|
import assert from 'minimalistic-assert'
|
|
32
31
|
|
|
@@ -40,31 +39,31 @@ import { createWeb3API } from './web3/index.js'
|
|
|
40
39
|
|
|
41
40
|
export const createBitcoinAssetFactory =
|
|
42
41
|
({ asset, apiUrl: defaultApiUrl, coinInfoNetwork, isTestnet = false }) =>
|
|
43
|
-
(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
} = Object.create(null)
|
|
61
|
-
) => {
|
|
42
|
+
({
|
|
43
|
+
assetClientInterface,
|
|
44
|
+
overrideCallback = ({ asset }) => asset,
|
|
45
|
+
config: {
|
|
46
|
+
apiUrl: customApiUrl,
|
|
47
|
+
allowUnconfirmedRbfEnabledUtxos = false,
|
|
48
|
+
ordinalChainIndex = DEFAULT_ORDINAL_CHAIN_INDEX,
|
|
49
|
+
ordinalsEnabled = false,
|
|
50
|
+
gapLimit = 10,
|
|
51
|
+
refreshGapLimit = 25,
|
|
52
|
+
feeDataCustomValues,
|
|
53
|
+
utxosDescendingOrder = false,
|
|
54
|
+
omitSupportedPurposes = [],
|
|
55
|
+
defaultOutputType = 'P2WSH',
|
|
56
|
+
changeAddressType = 'P2WPKH',
|
|
57
|
+
} = Object.create(null),
|
|
58
|
+
}) => {
|
|
62
59
|
const apiUrl = customApiUrl || defaultApiUrl
|
|
63
60
|
assert(assetClientInterface, 'assetClientInterface is required')
|
|
64
61
|
assert(asset, 'asset is required')
|
|
65
62
|
assert(typeof ordinalChainIndex === 'number', 'ordinalChainIndex must be a number')
|
|
66
63
|
assert(apiUrl, 'apiUrl is required')
|
|
67
64
|
|
|
65
|
+
const multipleAddresses = true // Indicates multiple addresses are supported. This is not configurable as it also affects address derivation.
|
|
66
|
+
|
|
68
67
|
const coinInfo = _coinInfo(coinInfoNetwork || asset.name)
|
|
69
68
|
|
|
70
69
|
const insightClient = new InsightAPIClient(apiUrl)
|
|
@@ -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,
|
|
@@ -238,37 +235,8 @@ export const createBitcoinAssetFactory =
|
|
|
238
235
|
return !isDroppedBitcoinTx && !isWaitingRbf && !isOrdinalTx(tx)
|
|
239
236
|
}
|
|
240
237
|
|
|
241
|
-
const getActivityTxs = ({ txs, asset }) =>
|
|
242
|
-
|
|
243
|
-
.flatMap((tx) => {
|
|
244
|
-
if (tx.sent && Array.isArray(tx.data.sent) && tx.data.sent.length > 0) {
|
|
245
|
-
const feeAmount = tx.feeAmount.div(tx.data.sent.length)
|
|
246
|
-
return tx.data.sent
|
|
247
|
-
.map((to, i) => {
|
|
248
|
-
// Avoids using tx.update(...) because it uses lodash _.merge
|
|
249
|
-
// which can be pretty slow on mobile.
|
|
250
|
-
const current = tx.toJSON()
|
|
251
|
-
return Tx.fromJSON({
|
|
252
|
-
...current,
|
|
253
|
-
to: to.address,
|
|
254
|
-
data: {
|
|
255
|
-
...current.data,
|
|
256
|
-
sentIndex: i,
|
|
257
|
-
activityIndex: i,
|
|
258
|
-
},
|
|
259
|
-
coinAmount: to.amount
|
|
260
|
-
? parseCurrency(to.amount, asset.currency).negate()
|
|
261
|
-
: asset.currency.ZERO,
|
|
262
|
-
feeAmount,
|
|
263
|
-
})
|
|
264
|
-
})
|
|
265
|
-
.reverse()
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
return tx
|
|
269
|
-
})
|
|
270
|
-
.filter(txLogFilter)
|
|
271
|
-
}
|
|
238
|
+
const getActivityTxs = ({ txs, asset }) =>
|
|
239
|
+
getActivityTxsBase({ txs, asset }).filter(txLogFilter)
|
|
272
240
|
|
|
273
241
|
const createBatchTx = getCreateBatchTransaction({
|
|
274
242
|
getFeeEstimator,
|
|
@@ -324,7 +292,7 @@ export const createBitcoinAssetFactory =
|
|
|
324
292
|
keys,
|
|
325
293
|
useBip84,
|
|
326
294
|
useBip86,
|
|
327
|
-
useMultipleAddresses,
|
|
295
|
+
useMultipleAddresses: multipleAddresses, // @deprecated use api.features.multipleAddresses instead
|
|
328
296
|
insightClient,
|
|
329
297
|
canBumpTx,
|
|
330
298
|
getAvailableBalance,
|
|
@@ -349,6 +317,7 @@ export const createBitcoinAssetFactory =
|
|
|
349
317
|
omitSupportedPurposes,
|
|
350
318
|
defaultOutputType,
|
|
351
319
|
changeAddressType,
|
|
320
|
+
multipleAddresses,
|
|
352
321
|
},
|
|
353
322
|
insightClient,
|
|
354
323
|
})
|