@exodus/bitcoin-api 3.2.0 → 4.0.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 +24 -0
- package/package.json +2 -2
- package/src/index.js +0 -10
- package/src/tx-log/bitcoin-monitor-scanner.js +37 -30
- package/src/tx-send/batch-tx.js +2 -1
- package/src/tx-sign/taproot.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@3.3.0...@exodus/bitcoin-api@4.0.0) (2025-08-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* remove old bitcoin-api exports (#6196)
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
* feat!: remove old bitcoin-api exports (#6196)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## [3.3.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@3.2.0...@exodus/bitcoin-api@3.3.0) (2025-07-23)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
* feat: multisiglength monitor (#6141)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [3.2.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@3.1.1...@exodus/bitcoin-api@3.2.0) (2025-07-16)
|
|
7
31
|
|
|
8
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
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": "0610d4663af495d4400b1346a24d988d5779b5e9"
|
|
63
63
|
}
|
package/src/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { ECPair } from '@exodus/bitcoinjs'
|
|
2
|
-
import { tiny_secp256k1_compat as ecc } from '@exodus/crypto/secp256k1'
|
|
3
|
-
|
|
4
1
|
export * from './account-state.js'
|
|
5
2
|
export * from './balances.js'
|
|
6
3
|
export * from './btc-address.js'
|
|
@@ -27,10 +24,3 @@ export * from './ordinals-utils.js'
|
|
|
27
24
|
export { signMessage, signMessageWithSigner } from './sign-message.js'
|
|
28
25
|
export { writePsbtBlockHeight, readPsbtBlockHeight } from './psbt-proprietary-types.js'
|
|
29
26
|
export { getActivityTxs } from './get-activity-txs.js'
|
|
30
|
-
|
|
31
|
-
// TODO: remove these, kept for compat
|
|
32
|
-
export { scriptClassify } from '@exodus/bitcoinjs'
|
|
33
|
-
export { tiny_secp256k1_compat as ecc } from '@exodus/crypto/secp256k1'
|
|
34
|
-
export const eccFactory = () => ecc
|
|
35
|
-
export const getECPair = () => ECPair
|
|
36
|
-
export const toXOnly = (publicKey) => publicKey.slice(1, 33)
|
|
@@ -79,6 +79,9 @@ export class BitcoinMonitorScanner {
|
|
|
79
79
|
assetName,
|
|
80
80
|
walletAccount,
|
|
81
81
|
})
|
|
82
|
+
|
|
83
|
+
const multisigDataLength = assetConfig.multisigDataLength
|
|
84
|
+
|
|
82
85
|
// multiAddressMode may be null, in which case it is enabled.
|
|
83
86
|
const multiAddressMode = assetConfig.multiAddressMode ?? true
|
|
84
87
|
|
|
@@ -178,37 +181,41 @@ export class BitcoinMonitorScanner {
|
|
|
178
181
|
addressIndex <= endAddressIndex;
|
|
179
182
|
addressIndex++
|
|
180
183
|
) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
addressIndex,
|
|
189
|
-
})
|
|
190
|
-
.then((address) => {
|
|
191
|
-
const addressObject = this.#asset.address.toLegacyAddress
|
|
192
|
-
? Address.create(
|
|
193
|
-
this.#asset.address.toLegacyAddress(String(address)),
|
|
194
|
-
address.meta
|
|
195
|
-
)
|
|
196
|
-
: address
|
|
197
|
-
|
|
198
|
-
const addressString = String(addressObject)
|
|
199
|
-
|
|
200
|
-
if (addrMap[addressString]) {
|
|
201
|
-
return null
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
addrMap[addressString] = addressObject
|
|
205
|
-
|
|
206
|
-
return {
|
|
207
|
-
address: addressObject,
|
|
184
|
+
const index = multisigDataLength ?? 1
|
|
185
|
+
for (let i = 0; i < index; i++) {
|
|
186
|
+
promises.push(
|
|
187
|
+
assetClientInterface
|
|
188
|
+
.getAddress({
|
|
189
|
+
assetName,
|
|
190
|
+
walletAccount,
|
|
208
191
|
purpose,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
192
|
+
chainIndex,
|
|
193
|
+
addressIndex,
|
|
194
|
+
...(multisigDataLength ? { multisigDataIndex: i } : Object.create(null)),
|
|
195
|
+
})
|
|
196
|
+
.then((address) => {
|
|
197
|
+
const addressObject = this.#asset.address.toLegacyAddress
|
|
198
|
+
? Address.create(
|
|
199
|
+
this.#asset.address.toLegacyAddress(String(address)),
|
|
200
|
+
address.meta
|
|
201
|
+
)
|
|
202
|
+
: address
|
|
203
|
+
|
|
204
|
+
const addressString = String(addressObject)
|
|
205
|
+
|
|
206
|
+
if (addrMap[addressString]) {
|
|
207
|
+
return null
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
addrMap[addressString] = addressObject
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
address: addressObject,
|
|
214
|
+
purpose,
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
)
|
|
218
|
+
}
|
|
212
219
|
}
|
|
213
220
|
}
|
|
214
221
|
|
package/src/tx-send/batch-tx.js
CHANGED
|
@@ -26,6 +26,7 @@ export const getCreateBatchTransaction = ({
|
|
|
26
26
|
const {
|
|
27
27
|
feeData = await assetClientInterface.getFeeConfig({ assetName }),
|
|
28
28
|
taprootInputWitnessSize,
|
|
29
|
+
isSendAll = false,
|
|
29
30
|
} = options
|
|
30
31
|
|
|
31
32
|
const accountState = await assetClientInterface.getAccountState({ assetName, walletAccount })
|
|
@@ -123,7 +124,7 @@ export const getCreateBatchTransaction = ({
|
|
|
123
124
|
}
|
|
124
125
|
|
|
125
126
|
const change = selectedUtxos.value.sub(amount).sub(fee)
|
|
126
|
-
if (change.gte(asset.currency.baseUnit(DUST_VALUES[changeAddressType]))) {
|
|
127
|
+
if (!isSendAll && change.gte(asset.currency.baseUnit(DUST_VALUES[changeAddressType]))) {
|
|
127
128
|
const changeAddress = await assetClientInterface.getNextChangeAddress({
|
|
128
129
|
assetName,
|
|
129
130
|
walletAccount,
|
package/src/tx-sign/taproot.js
CHANGED
|
@@ -66,7 +66,7 @@ export function toAsyncSigner({ privateKey, publicKey, isTaprootKeySpend }) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// signer: {
|
|
69
|
-
// sign: ({ data,
|
|
69
|
+
// sign: ({ data, enc, purpose, keyId, signatureType, tweak, extraEntropy }: KeychainSignerParams): Promise<any>
|
|
70
70
|
// getPublicKey: ({ keyId }) => Promise<Buffer>
|
|
71
71
|
// }
|
|
72
72
|
//
|