@exodus/bitcoin-plugin 1.21.0 → 1.22.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 +17 -0
- package/package.json +4 -4
- package/src/create-asset.js +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.22.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.21.1...@exodus/bitcoin-plugin@1.22.0) (2024-07-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **BTC:** create batch tx from array of recipients ([#2881](https://github.com/ExodusMovement/assets/issues/2881)) ([440d5d5](https://github.com/ExodusMovement/assets/commit/440d5d5879c902ef10ff7644c92a5092bb868872))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [1.21.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.21.0...@exodus/bitcoin-plugin@1.21.1) (2024-07-15)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @exodus/bitcoin-plugin
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [1.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.20.0...@exodus/bitcoin-plugin@1.21.0) (2024-07-09)
|
|
7
24
|
|
|
8
25
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@exodus/asset-lib": "^4.1.0",
|
|
24
24
|
"@exodus/basic-utils": "^2.1.0",
|
|
25
|
-
"@exodus/bip32": "^
|
|
25
|
+
"@exodus/bip32": "^3.1.0",
|
|
26
26
|
"@exodus/bip44-constants": "^195.0.0",
|
|
27
|
-
"@exodus/bitcoin-api": "^2.
|
|
27
|
+
"@exodus/bitcoin-api": "^2.21.0",
|
|
28
28
|
"@exodus/bitcoin-lib": "^2.4.0",
|
|
29
29
|
"@exodus/bitcoin-meta": "^1.0.2",
|
|
30
30
|
"@exodus/bitcoinjs-lib": "^6.1.5-exodus.2",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "ba7439e1b8ae182a2a95ffd0ea09b8bc3330f2f6"
|
|
68
68
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
createAccountState,
|
|
9
9
|
createAndBroadcastTXFactory,
|
|
10
10
|
createBitcoinMonitor,
|
|
11
|
+
createMagicEdenBitcoinMonitor,
|
|
11
12
|
createBtcLikeAddress,
|
|
12
13
|
createBtcLikeKeys,
|
|
13
14
|
getAddressesFromPrivateKeyFactory,
|
|
@@ -22,8 +23,10 @@ import {
|
|
|
22
23
|
signHardwareFactory,
|
|
23
24
|
signMessage,
|
|
24
25
|
getPrepareSendTransaction,
|
|
26
|
+
getCreateBatchTransaction,
|
|
25
27
|
createEncodeMultisigContract,
|
|
26
28
|
createPrepareForSigning,
|
|
29
|
+
createPsbtToUnsignedTx,
|
|
27
30
|
} from '@exodus/bitcoin-api'
|
|
28
31
|
import { bitcoinFeeDataFactory } from './fee-data'
|
|
29
32
|
import BitcoinFeeMonitor from './fee-monitor'
|
|
@@ -42,6 +45,11 @@ import { createWeb3API } from './web3'
|
|
|
42
45
|
|
|
43
46
|
const DEFAULT_TICKS_BETWEEN_BRC20_FETCHES = 30
|
|
44
47
|
|
|
48
|
+
const MonitorType = {
|
|
49
|
+
DEFAULT: 'default',
|
|
50
|
+
ME: 'meMonitor',
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
export const createBitcoinAssetFactory =
|
|
46
54
|
({ asset, apiUrl: defaultApiUrl, coinInfoNetwork, isTestnet = false }) =>
|
|
47
55
|
(
|
|
@@ -63,6 +71,7 @@ export const createBitcoinAssetFactory =
|
|
|
63
71
|
omitSupportedPurposes = [],
|
|
64
72
|
defaultOutputType = 'P2WSH',
|
|
65
73
|
changeAddressType = 'P2WPKH',
|
|
74
|
+
monitorType = MonitorType.DEFAULT,
|
|
66
75
|
} = Object.create(null),
|
|
67
76
|
} = Object.create(null)
|
|
68
77
|
) => {
|
|
@@ -220,7 +229,12 @@ export const createBitcoinAssetFactory =
|
|
|
220
229
|
}),
|
|
221
230
|
})
|
|
222
231
|
|
|
223
|
-
const accountStateClass = createAccountState({
|
|
232
|
+
const accountStateClass = createAccountState({
|
|
233
|
+
asset,
|
|
234
|
+
ordinalsEnabled,
|
|
235
|
+
brc20Enabled,
|
|
236
|
+
isMagicEdenFungibleBalancesEnabled: monitorType === MonitorType.ME,
|
|
237
|
+
})
|
|
224
238
|
|
|
225
239
|
const nfts = ordinalsEnabled
|
|
226
240
|
? nftsApiFactory({ ordinalChainIndex, asset, assetClientInterface })
|
|
@@ -231,7 +245,9 @@ export const createBitcoinAssetFactory =
|
|
|
231
245
|
: {}
|
|
232
246
|
|
|
233
247
|
const createHistoryMonitor = (args) => {
|
|
234
|
-
const
|
|
248
|
+
const createMonitor =
|
|
249
|
+
monitorType === MonitorType.ME ? createMagicEdenBitcoinMonitor : createBitcoinMonitor
|
|
250
|
+
const monitor = createMonitor({
|
|
235
251
|
insightClient,
|
|
236
252
|
ordinalsEnabled,
|
|
237
253
|
ordinalChainIndex,
|
|
@@ -328,7 +344,13 @@ export const createBitcoinAssetFactory =
|
|
|
328
344
|
.filter(txLogFilter)
|
|
329
345
|
}
|
|
330
346
|
|
|
347
|
+
const createBatchTx = getCreateBatchTransaction({
|
|
348
|
+
getFeeEstimator,
|
|
349
|
+
assetClientInterface,
|
|
350
|
+
changeAddressType,
|
|
351
|
+
})
|
|
331
352
|
const encodeMultisigContract = createEncodeMultisigContract({ network: coinInfo.toBitcoinJS() })
|
|
353
|
+
const psbtToUnsignedTx = createPsbtToUnsignedTx({ assetClientInterface, assetName: asset.name })
|
|
332
354
|
|
|
333
355
|
const api = {
|
|
334
356
|
getActivityTxs,
|
|
@@ -376,7 +398,9 @@ export const createBitcoinAssetFactory =
|
|
|
376
398
|
getSpendableBalance,
|
|
377
399
|
inscriptions: inscriptionsService,
|
|
378
400
|
prepareSendTx: baseGetPrepareSendTx,
|
|
401
|
+
createBatchTx,
|
|
379
402
|
encodeMultisigContract,
|
|
403
|
+
psbtToUnsignedTx,
|
|
380
404
|
}
|
|
381
405
|
return overrideCallback({ asset: fullAsset })
|
|
382
406
|
}
|