@exodus/bitcoin-plugin 1.22.2 → 1.23.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 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.23.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.3...@exodus/bitcoin-plugin@1.23.0) (2024-08-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * **bitcoin-plugin:** bump `@exodus/web3-bitcoin-utils` ([#3037](https://github.com/ExodusMovement/assets/issues/3037)) ([1d565ad](https://github.com/ExodusMovement/assets/commit/1d565adae0551936470b045b0e51c4ce94c0c76d))
12
+
13
+
14
+
15
+ ## [1.22.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.2...@exodus/bitcoin-plugin@1.22.3) (2024-08-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * always add inputs to txLog data ([#3071](https://github.com/ExodusMovement/assets/issues/3071)) ([68b5339](https://github.com/ExodusMovement/assets/commit/68b53397b78ed11a94babd821fc8fe2625558ef5))
21
+
22
+
23
+
6
24
  ## [1.22.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.1...@exodus/bitcoin-plugin@1.22.2) (2024-07-31)
7
25
 
8
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-plugin",
3
- "version": "1.22.2",
3
+ "version": "1.23.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.21.3",
27
+ "@exodus/bitcoin-api": "^2.21.4",
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.12.2",
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": "a9a07ce549e5e911d65a75e2d768a6ff5a1d854e"
67
+ "gitHead": "9b0d4001b6844a054276211057b066b470b4ebca"
68
68
  }
@@ -379,7 +379,7 @@ export const createBitcoinAssetFactory =
379
379
  createToken,
380
380
  getTokens,
381
381
  validateAssetId,
382
- web3: createWeb3API({ asset, prepareForSigning }),
382
+ web3: createWeb3API({ asset, assetClientInterface, prepareForSigning }),
383
383
  }
384
384
 
385
385
  const fullAsset = {
@@ -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
- const psbtBase64 = Psbt.fromBuffer(transactionBuffers[0]).toBase64()
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
  }