@exodus/bitcoin-plugin 1.22.3 → 1.24.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 +18 -0
- package/package.json +4 -4
- package/src/create-asset.js +23 -13
- package/src/web3/createSimulateTransactions.js +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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.24.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.23.0...@exodus/bitcoin-plugin@1.24.0) (2024-08-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* move ME BTC monitor to the ME codebase ([#3118](https://github.com/ExodusMovement/assets/issues/3118)) ([2610e96](https://github.com/ExodusMovement/assets/commit/2610e966f5d078e6b9d87a08c4d86ad090400583))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [1.23.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.3...@exodus/bitcoin-plugin@1.23.0) (2024-08-08)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **bitcoin-plugin:** bump `@exodus/web3-bitcoin-utils` ([#3037](https://github.com/ExodusMovement/assets/issues/3037)) ([1d565ad](https://github.com/ExodusMovement/assets/commit/1d565adae0551936470b045b0e51c4ce94c0c76d))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [1.22.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.2...@exodus/bitcoin-plugin@1.22.3) (2024-08-05)
|
|
7
25
|
|
|
8
26
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@exodus/basic-utils": "^2.1.0",
|
|
25
25
|
"@exodus/bip32": "^3.1.0",
|
|
26
26
|
"@exodus/bip44-constants": "^195.0.0",
|
|
27
|
-
"@exodus/bitcoin-api": "^2.
|
|
27
|
+
"@exodus/bitcoin-api": "^2.22.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",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@exodus/fetch": "^1.3.0",
|
|
33
33
|
"@exodus/models": "^11.13.0",
|
|
34
34
|
"@exodus/text-encoding-utf8": "^1.0.2",
|
|
35
|
-
"@exodus/web3-bitcoin-utils": "^1.
|
|
35
|
+
"@exodus/web3-bitcoin-utils": "^2.1.0",
|
|
36
36
|
"bip32-path": "^0.4.2",
|
|
37
37
|
"coininfo": "^5.1.0",
|
|
38
38
|
"create-hash": "^1.2.0",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a7d2ce9914ff528043b34b75f3823bf9f777622c"
|
|
68
68
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
createBtcLikeAddress,
|
|
7
7
|
createBtcLikeKeys,
|
|
8
8
|
createEncodeMultisigContract,
|
|
9
|
-
createMagicEdenBitcoinMonitor,
|
|
10
9
|
createPrepareForSigning,
|
|
11
10
|
createPsbtToUnsignedTx,
|
|
12
11
|
getAddressesFromPrivateKeyFactory,
|
|
@@ -45,11 +44,6 @@ import { createWeb3API } from './web3'
|
|
|
45
44
|
|
|
46
45
|
const DEFAULT_TICKS_BETWEEN_BRC20_FETCHES = 30
|
|
47
46
|
|
|
48
|
-
const MonitorType = {
|
|
49
|
-
DEFAULT: 'default',
|
|
50
|
-
ME: 'meMonitor',
|
|
51
|
-
}
|
|
52
|
-
|
|
53
47
|
export const createBitcoinAssetFactory =
|
|
54
48
|
({ asset, apiUrl: defaultApiUrl, coinInfoNetwork, isTestnet = false }) =>
|
|
55
49
|
(
|
|
@@ -71,7 +65,6 @@ export const createBitcoinAssetFactory =
|
|
|
71
65
|
omitSupportedPurposes = [],
|
|
72
66
|
defaultOutputType = 'P2WSH',
|
|
73
67
|
changeAddressType = 'P2WPKH',
|
|
74
|
-
monitorType = MonitorType.DEFAULT,
|
|
75
68
|
} = Object.create(null),
|
|
76
69
|
} = Object.create(null)
|
|
77
70
|
) => {
|
|
@@ -233,7 +226,6 @@ export const createBitcoinAssetFactory =
|
|
|
233
226
|
asset,
|
|
234
227
|
ordinalsEnabled,
|
|
235
228
|
brc20Enabled,
|
|
236
|
-
isMagicEdenFungibleBalancesEnabled: monitorType === MonitorType.ME,
|
|
237
229
|
})
|
|
238
230
|
|
|
239
231
|
const nfts = ordinalsEnabled
|
|
@@ -245,9 +237,7 @@ export const createBitcoinAssetFactory =
|
|
|
245
237
|
: {}
|
|
246
238
|
|
|
247
239
|
const createHistoryMonitor = (args) => {
|
|
248
|
-
const
|
|
249
|
-
monitorType === MonitorType.ME ? createMagicEdenBitcoinMonitor : createBitcoinMonitor
|
|
250
|
-
const monitor = createMonitor({
|
|
240
|
+
const monitor = createBitcoinMonitor({
|
|
251
241
|
insightClient,
|
|
252
242
|
ordinalsEnabled,
|
|
253
243
|
ordinalChainIndex,
|
|
@@ -379,7 +369,7 @@ export const createBitcoinAssetFactory =
|
|
|
379
369
|
createToken,
|
|
380
370
|
getTokens,
|
|
381
371
|
validateAssetId,
|
|
382
|
-
web3: createWeb3API({ asset, prepareForSigning }),
|
|
372
|
+
web3: createWeb3API({ asset, assetClientInterface, prepareForSigning }),
|
|
383
373
|
}
|
|
384
374
|
|
|
385
375
|
const fullAsset = {
|
|
@@ -402,5 +392,25 @@ export const createBitcoinAssetFactory =
|
|
|
402
392
|
encodeMultisigContract,
|
|
403
393
|
psbtToUnsignedTx,
|
|
404
394
|
}
|
|
405
|
-
|
|
395
|
+
|
|
396
|
+
return overrideCallback({
|
|
397
|
+
asset: fullAsset,
|
|
398
|
+
config: {
|
|
399
|
+
apiUrl: customApiUrl || defaultApiUrl,
|
|
400
|
+
allowUnconfirmedRbfEnabledUtxos,
|
|
401
|
+
ordinalChainIndex,
|
|
402
|
+
ordinalsEnabled,
|
|
403
|
+
brc20Enabled,
|
|
404
|
+
brc20Url,
|
|
405
|
+
brc20TickInterval,
|
|
406
|
+
gapLimit,
|
|
407
|
+
refreshGapLimit,
|
|
408
|
+
feeDataCustomValues,
|
|
409
|
+
utxosDescendingOrder,
|
|
410
|
+
omitSupportedPurposes,
|
|
411
|
+
defaultOutputType,
|
|
412
|
+
changeAddressType,
|
|
413
|
+
},
|
|
414
|
+
insightClient,
|
|
415
|
+
})
|
|
406
416
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Psbt } from '@exodus/bitcoinjs-lib'
|
|
2
1
|
import { createSimulateTransactions as createSimulateBitcoinTransactions } from '@exodus/web3-bitcoin-utils'
|
|
3
2
|
import assert from 'minimalistic-assert'
|
|
4
3
|
|
|
5
4
|
// This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
|
|
6
|
-
export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
|
|
5
|
+
export const createSimulateTransactions = ({ asset, assetClientInterface, prepareForSigning }) => {
|
|
7
6
|
assert('asset', '"asset" should be passed.')
|
|
7
|
+
assert('assetClientInterface', '"assetClientInterface" should be passed.')
|
|
8
8
|
assert('prepareForSigning', '"prepareForSigning" should be passed')
|
|
9
9
|
|
|
10
|
-
const simulateBitcoinTransactions = createSimulateBitcoinTransactions(
|
|
10
|
+
const simulateBitcoinTransactions = createSimulateBitcoinTransactions({
|
|
11
|
+
logger: assetClientInterface.createLogger(`${asset.name}:simulation`),
|
|
12
|
+
})
|
|
11
13
|
|
|
12
14
|
return function simulateTransactions({ transactionBuffers, unsignedTxs, ...restParameters }) {
|
|
13
15
|
if (transactionBuffers && unsignedTxs) {
|
|
@@ -20,7 +22,8 @@ export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
|
|
|
20
22
|
'Simulation for multiple transactions is not supported.'
|
|
21
23
|
)
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
// The buffer can be a Uint8Array instance. Casting to a Buffer to ensure that ".toString('base64')" works.
|
|
26
|
+
const psbtBase64 = Buffer.from(transactionBuffers[0]).toString('base64')
|
|
24
27
|
|
|
25
28
|
return simulateBitcoinTransactions({ transactions: [psbtBase64], ...restParameters })
|
|
26
29
|
}
|