@exodus/bitcoin-plugin 1.12.1 → 1.13.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@exodus/basic-utils": "^2.1.0",
|
|
23
23
|
"@exodus/bip32": "^1.1.2",
|
|
24
24
|
"@exodus/bip44-constants": "^195.0.0",
|
|
25
|
-
"@exodus/bitcoin-api": "^2.
|
|
25
|
+
"@exodus/bitcoin-api": "^2.13.0",
|
|
26
26
|
"@exodus/bitcoin-lib": "^2.3.0",
|
|
27
27
|
"@exodus/bitcoin-meta": "^1.0.2",
|
|
28
28
|
"@exodus/bitcoinjs-lib": "^6.1.5-exodus.1",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@scure/btc-signer": "^1.1.0",
|
|
49
49
|
"jest-when": "^3.5.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "9d296fc0875749545bc95b2a976e93739d63553b"
|
|
52
52
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
signHardwareFactory,
|
|
23
23
|
signMessage,
|
|
24
24
|
getPrepareSendTransaction,
|
|
25
|
+
createEncodeMultisigContract,
|
|
25
26
|
} from '@exodus/bitcoin-api'
|
|
26
27
|
import { bitcoinFeeDataFactory } from './fee-data'
|
|
27
28
|
import BitcoinFeeMonitor from './fee-monitor'
|
|
@@ -136,6 +137,7 @@ export const createBitcoinAssetFactory =
|
|
|
136
137
|
allowUnconfirmedRbfEnabledUtxos,
|
|
137
138
|
ordinalsEnabled,
|
|
138
139
|
utxosDescendingOrder,
|
|
140
|
+
assetClientInterface,
|
|
139
141
|
})
|
|
140
142
|
|
|
141
143
|
const baseSendTx = createAndBroadcastTXFactory({
|
|
@@ -143,6 +145,7 @@ export const createBitcoinAssetFactory =
|
|
|
143
145
|
allowUnconfirmedRbfEnabledUtxos,
|
|
144
146
|
ordinalsEnabled,
|
|
145
147
|
utxosDescendingOrder,
|
|
148
|
+
assetClientInterface,
|
|
146
149
|
})
|
|
147
150
|
const inscriptionsService = brc20Enabled
|
|
148
151
|
? inscriptionsServiceFactory({
|
|
@@ -155,6 +158,7 @@ export const createBitcoinAssetFactory =
|
|
|
155
158
|
const { getFee, getBalances, getAvailableBalance, canBumpTx, getSpendableBalance, sendTx } =
|
|
156
159
|
brc20Enabled
|
|
157
160
|
? brc20BalancesAndFeeAdapterFactory({
|
|
161
|
+
assetClientInterface,
|
|
158
162
|
inscriptionsService,
|
|
159
163
|
...baseFeeResolver,
|
|
160
164
|
getBalances: baseGetBalances,
|
|
@@ -294,6 +298,8 @@ export const createBitcoinAssetFactory =
|
|
|
294
298
|
.filter(txLogFilter)
|
|
295
299
|
}
|
|
296
300
|
|
|
301
|
+
const encodeMultisigContract = createEncodeMultisigContract({ network: coinInfo.toBitcoinJS() })
|
|
302
|
+
|
|
297
303
|
const api = {
|
|
298
304
|
getActivityTxs,
|
|
299
305
|
addressHasHistory,
|
|
@@ -345,6 +351,7 @@ export const createBitcoinAssetFactory =
|
|
|
345
351
|
getSpendableBalance,
|
|
346
352
|
inscriptions: inscriptionsService,
|
|
347
353
|
prepareSendTx: baseGetPrepareSendTx,
|
|
354
|
+
encodeMultisigContract,
|
|
348
355
|
}
|
|
349
356
|
return overrideCallback({ asset: fullAsset })
|
|
350
357
|
}
|
|
@@ -4,6 +4,7 @@ import { brc20Utils } from './brc-20-utils'
|
|
|
4
4
|
import { createBrc20Command } from './create-brc-20-command'
|
|
5
5
|
|
|
6
6
|
export const brc20BalancesAndFeeAdapterFactory = ({
|
|
7
|
+
assetClientInterface,
|
|
7
8
|
inscriptionsService,
|
|
8
9
|
getBalances,
|
|
9
10
|
getFee,
|
|
@@ -28,10 +29,7 @@ export const brc20BalancesAndFeeAdapterFactory = ({
|
|
|
28
29
|
return !options.feeOpts.inscriptionIds?.length
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
const sendBrc20 = async (
|
|
32
|
-
{ asset: token, walletAccount, address, amount, options },
|
|
33
|
-
{ assetClientInterface }
|
|
34
|
-
) => {
|
|
32
|
+
const sendBrc20 = async ({ asset: token, walletAccount, address, amount, options }) => {
|
|
35
33
|
const { broadcastInscription, createBrc20Inscription } = inscriptionsService
|
|
36
34
|
|
|
37
35
|
const { customFee, isSendAll } = options
|
|
@@ -80,20 +78,17 @@ export const brc20BalancesAndFeeAdapterFactory = ({
|
|
|
80
78
|
inscriptionIds.push(inscriptionResult.inscriptionId)
|
|
81
79
|
}
|
|
82
80
|
|
|
83
|
-
return sendTx(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
options
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
brc20: { inscriptionIds },
|
|
93
|
-
},
|
|
81
|
+
return sendTx({
|
|
82
|
+
asset: token,
|
|
83
|
+
walletAccount,
|
|
84
|
+
address,
|
|
85
|
+
amount: tokenAmount,
|
|
86
|
+
options: {
|
|
87
|
+
...options,
|
|
88
|
+
isRbfAllowed: false,
|
|
89
|
+
brc20: { inscriptionIds },
|
|
94
90
|
},
|
|
95
|
-
|
|
96
|
-
)
|
|
91
|
+
})
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
const getFeeBrc20 = ({
|
|
@@ -295,16 +295,13 @@ export const inscriptionsServiceFactory = ({ network, ordinalChainIndex }) => {
|
|
|
295
295
|
const minersFee = resolveMinersFee({ inscription, customFee, feeData, asset })
|
|
296
296
|
const commitAmount = minersFee.add(asset.currency.baseUnit(postage))
|
|
297
297
|
|
|
298
|
-
const commitTxResult = await asset.api.sendTx(
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
{ assetClientInterface }
|
|
307
|
-
)
|
|
298
|
+
const commitTxResult = await asset.api.sendTx({
|
|
299
|
+
asset,
|
|
300
|
+
walletAccount,
|
|
301
|
+
address: commitTxData.revealAddress,
|
|
302
|
+
amount: commitAmount,
|
|
303
|
+
options: { isRbfAllowed: false, customFee },
|
|
304
|
+
})
|
|
308
305
|
|
|
309
306
|
const revealTx = await createRevealTx({
|
|
310
307
|
commitTxData,
|