@exodus/bitcoin-plugin 1.34.0 → 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 +10 -0
- package/package.json +4 -4
- package/src/create-asset.js +5 -34
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
17
|
|
|
8
18
|
|
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
|
|
|
@@ -55,7 +54,6 @@ export const createBitcoinAssetFactory =
|
|
|
55
54
|
omitSupportedPurposes = [],
|
|
56
55
|
defaultOutputType = 'P2WSH',
|
|
57
56
|
changeAddressType = 'P2WPKH',
|
|
58
|
-
multipleAddresses = true,
|
|
59
57
|
} = Object.create(null),
|
|
60
58
|
}) => {
|
|
61
59
|
const apiUrl = customApiUrl || defaultApiUrl
|
|
@@ -64,6 +62,8 @@ export const createBitcoinAssetFactory =
|
|
|
64
62
|
assert(typeof ordinalChainIndex === 'number', 'ordinalChainIndex must be a number')
|
|
65
63
|
assert(apiUrl, 'apiUrl is required')
|
|
66
64
|
|
|
65
|
+
const multipleAddresses = true // Indicates multiple addresses are supported. This is not configurable as it also affects address derivation.
|
|
66
|
+
|
|
67
67
|
const coinInfo = _coinInfo(coinInfoNetwork || asset.name)
|
|
68
68
|
|
|
69
69
|
const insightClient = new InsightAPIClient(apiUrl)
|
|
@@ -235,37 +235,8 @@ export const createBitcoinAssetFactory =
|
|
|
235
235
|
return !isDroppedBitcoinTx && !isWaitingRbf && !isOrdinalTx(tx)
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
const getActivityTxs = ({ txs, asset }) =>
|
|
239
|
-
|
|
240
|
-
.flatMap((tx) => {
|
|
241
|
-
if (tx.sent && Array.isArray(tx.data.sent) && tx.data.sent.length > 0) {
|
|
242
|
-
const feeAmount = tx.feeAmount.div(tx.data.sent.length)
|
|
243
|
-
return tx.data.sent
|
|
244
|
-
.map((to, i) => {
|
|
245
|
-
// Avoids using tx.update(...) because it uses lodash _.merge
|
|
246
|
-
// which can be pretty slow on mobile.
|
|
247
|
-
const current = tx.toJSON()
|
|
248
|
-
return Tx.fromJSON({
|
|
249
|
-
...current,
|
|
250
|
-
to: to.address,
|
|
251
|
-
data: {
|
|
252
|
-
...current.data,
|
|
253
|
-
sentIndex: i,
|
|
254
|
-
activityIndex: i,
|
|
255
|
-
},
|
|
256
|
-
coinAmount: to.amount
|
|
257
|
-
? parseCurrency(to.amount, asset.currency).negate()
|
|
258
|
-
: asset.currency.ZERO,
|
|
259
|
-
feeAmount,
|
|
260
|
-
})
|
|
261
|
-
})
|
|
262
|
-
.reverse()
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return tx
|
|
266
|
-
})
|
|
267
|
-
.filter(txLogFilter)
|
|
268
|
-
}
|
|
238
|
+
const getActivityTxs = ({ txs, asset }) =>
|
|
239
|
+
getActivityTxsBase({ txs, asset }).filter(txLogFilter)
|
|
269
240
|
|
|
270
241
|
const createBatchTx = getCreateBatchTransaction({
|
|
271
242
|
getFeeEstimator,
|