@exodus/bitcoin-plugin 1.17.0 → 1.17.1
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.17.
|
|
3
|
+
"version": "1.17.1",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@exodus/fetch": "^1.3.0",
|
|
31
31
|
"@exodus/models": "^11.13.0",
|
|
32
32
|
"@exodus/text-encoding-utf8": "^1.0.2",
|
|
33
|
-
"@exodus/web3-bitcoin-utils": "^1.12.
|
|
33
|
+
"@exodus/web3-bitcoin-utils": "^1.12.2",
|
|
34
34
|
"bip32-path": "0.4.2",
|
|
35
35
|
"coininfo": "5.1.0",
|
|
36
36
|
"create-hash": "^1.2.0",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"bip39": "^2.6.0",
|
|
56
56
|
"jest-when": "^3.5.1"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "2e105f8c05f3bd241d8c8a98e52170bbcef282ae"
|
|
59
59
|
}
|
|
@@ -5,15 +5,16 @@ import assert from 'minimalistic-assert'
|
|
|
5
5
|
|
|
6
6
|
// This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
|
|
7
7
|
export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
|
|
8
|
+
assert('asset', '"asset" should be passed.')
|
|
8
9
|
assert('prepareForSigning', '"prepareForSigning" should be passed')
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
const simulateBitcoinTransactions = createSimulateBitcoinTransactions()
|
|
12
|
+
|
|
13
|
+
return function simulateTransactions({ transactionBuffers, unsignedTxs, ...restParameters }) {
|
|
11
14
|
if (transactionBuffers && unsignedTxs) {
|
|
12
15
|
throw new Error('Can not supply both "transactionBuffer" and "unsignedTx".')
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
const simulateTransactions = createSimulateBitcoinTransactions()
|
|
16
|
-
|
|
17
18
|
if (transactionBuffers) {
|
|
18
19
|
assert(
|
|
19
20
|
transactionBuffers.length === 1,
|
|
@@ -22,7 +23,7 @@ export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
|
|
|
22
23
|
|
|
23
24
|
const psbtBase64 = Psbt.fromBuffer(transactionBuffers[0]).toBase64()
|
|
24
25
|
|
|
25
|
-
return
|
|
26
|
+
return simulateBitcoinTransactions({ transactions: [psbtBase64], ...restParameters })
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
if (unsignedTxs) {
|
|
@@ -48,7 +49,7 @@ export const createSimulateTransactions = ({ asset, prepareForSigning }) => {
|
|
|
48
49
|
return acc
|
|
49
50
|
}, {})
|
|
50
51
|
|
|
51
|
-
return
|
|
52
|
+
return simulateBitcoinTransactions({
|
|
52
53
|
asset,
|
|
53
54
|
transactions: [psbtBase64],
|
|
54
55
|
walletAddresses,
|
package/src/web3/index.js
CHANGED