@exodus/bitcoin-plugin 1.27.0 → 1.29.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,35 @@
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.29.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.28.0...@exodus/bitcoin-plugin@1.29.0) (2024-10-17)
7
+
8
+
9
+ ### Features
10
+
11
+ * **bitcoin-api:** switch from ecpair to plain keys ([#4043](https://github.com/ExodusMovement/assets/issues/4043)) ([dac115d](https://github.com/ExodusMovement/assets/commit/dac115daadbb2e2f8933eef152ba3c3c0a5f9fce))
12
+ * **bitcoin-plugin:** switch to exodus/crypto for secp256k1 ([#4073](https://github.com/ExodusMovement/assets/issues/4073)) ([73f2e19](https://github.com/ExodusMovement/assets/commit/73f2e19dcb055527c410c705558b04f090947d1a))
13
+ * btc-like unconfirmed received ([#4277](https://github.com/ExodusMovement/assets/issues/4277)) ([70d4b73](https://github.com/ExodusMovement/assets/commit/70d4b73811acd87265ad2c1fcf984afb5a89df73))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * reduce max pubkeys for multisig to 16 ([#4108](https://github.com/ExodusMovement/assets/issues/4108)) ([8c4c33b](https://github.com/ExodusMovement/assets/commit/8c4c33b08c5dc0786d601887e08b413a780b32a7))
19
+ * remove stray direct dependencies ([#4176](https://github.com/ExodusMovement/assets/issues/4176)) ([c4f93fa](https://github.com/ExodusMovement/assets/commit/c4f93fad5a930b40d326d7add1093b2d4f243f2a))
20
+
21
+
22
+
23
+ ## [1.28.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.27.0...@exodus/bitcoin-plugin@1.28.0) (2024-09-25)
24
+
25
+
26
+ ### Features
27
+
28
+ * make secp256k1 ecc dependency explicit in bitcoin-plugin ([#3991](https://github.com/ExodusMovement/assets/issues/3991)) ([048f06e](https://github.com/ExodusMovement/assets/commit/048f06e05f23f23cabc6c6540c578ac73886bb4a))
29
+ * move ec-pair and script-classify to bitcoinjs ([#4001](https://github.com/ExodusMovement/assets/issues/4001)) ([adb759b](https://github.com/ExodusMovement/assets/commit/adb759be5b264194f216b6a8f65d370f63555d81))
30
+ * unfork bitcoinjs-lib ([#3968](https://github.com/ExodusMovement/assets/issues/3968)) ([287ba8f](https://github.com/ExodusMovement/assets/commit/287ba8f4e7dacb0f4eb91f31090b74a67eb78733))
31
+ * use a single secp256k1 impl in bitcoin-plugin ([#3992](https://github.com/ExodusMovement/assets/issues/3992)) ([b37ee99](https://github.com/ExodusMovement/assets/commit/b37ee99f684ee164bb872be7b1ee3d5bd1f72276))
32
+
33
+
34
+
6
35
  ## [1.27.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.26.1...@exodus/bitcoin-plugin@1.27.0) (2024-09-24)
7
36
 
8
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-plugin",
3
- "version": "1.27.0",
3
+ "version": "1.29.0",
4
4
  "description": "Exodus bitcoin-plugin",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -22,13 +22,12 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@exodus/asset-lib": "^5.0.0",
25
- "@exodus/bip32": "^3.1.0",
26
25
  "@exodus/bip44-constants": "^195.0.0",
27
- "@exodus/bitcoin-api": "^2.24.0",
26
+ "@exodus/bitcoin-api": "^2.27.0",
28
27
  "@exodus/bitcoin-lib": "^2.4.2",
29
28
  "@exodus/bitcoin-meta": "^2.0.0",
30
- "@exodus/bitcoinjs-lib": "^6.1.6",
31
- "@exodus/crypto": "^1.0.0-rc.1",
29
+ "@exodus/bitcoinjs": "^1.1.0",
30
+ "@exodus/crypto": "^1.0.0-rc.13",
32
31
  "@exodus/fetch": "^1.3.0",
33
32
  "@exodus/models": "^12.0.1",
34
33
  "@exodus/text-encoding-utf8": "^1.0.2",
@@ -36,19 +35,17 @@
36
35
  "coininfo": "^5.1.0",
37
36
  "lodash": "^4.17.21",
38
37
  "minimalistic-assert": "^1.0.1",
39
- "ms": "^2.1.3",
40
- "secp256k1": "^3.4.0"
38
+ "ms": "^2.1.3"
41
39
  },
42
40
  "devDependencies": {
43
41
  "@exodus/assets-testing": "^1.0.0",
44
- "@exodus/bitcoin-meta": "^2.0.0",
42
+ "@exodus/bip32": "^3.3.0",
45
43
  "@exodus/bitcoinregtest-meta": "^2.0.0",
46
44
  "@exodus/bitcointestnet-meta": "^2.0.0",
47
45
  "@exodus/currency": "^5.0.2",
48
- "@exodus/hdkey": "^2.1.0-exodus.0",
49
- "@exodus/key-identifier": "^1.1.1",
50
- "@exodus/key-utils": "^3.2.1",
51
- "@exodus/keychain": "^6.4.0",
46
+ "@exodus/key-identifier": "^1.3.0",
47
+ "@exodus/key-utils": "^3.7.0",
48
+ "@exodus/keychain": "^7.3.0",
52
49
  "@exodus/tx-signer": "^2.3.1",
53
50
  "@scure/btc-signer": "^1.1.0",
54
51
  "bip39": "^2.6.0",
@@ -61,5 +58,5 @@
61
58
  "type": "git",
62
59
  "url": "git+https://github.com/ExodusMovement/assets.git"
63
60
  },
64
- "gitHead": "fab5429fe99be08b08575100e4be6f151ce9638f"
61
+ "gitHead": "3218754fdfad087b6d789eb81f7fe9f21b636fef"
65
62
  }
@@ -24,7 +24,7 @@ import {
24
24
  } from '@exodus/bitcoin-api'
25
25
  import { parseCurrency } from '@exodus/bitcoin-api/src/fee/fee-utils.js'
26
26
  import { createGetKeyIdentifier } from '@exodus/bitcoin-lib'
27
- import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
27
+ import * as bitcoinjsLib from '@exodus/bitcoinjs'
28
28
  import { Tx } from '@exodus/models'
29
29
  import _coinInfo from 'coininfo'
30
30
  import assert from 'minimalistic-assert'
@@ -1,11 +1,10 @@
1
- import { ecc, getECPair, getOrdinalsUtxos, toAsyncSigner, toXOnly } from '@exodus/bitcoin-api'
1
+ import { getOrdinalsUtxos, toAsyncSigner } from '@exodus/bitcoin-api'
2
2
  import { getTxSequence } from '@exodus/bitcoin-lib'
3
- import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
4
- import { witnessStackToScriptWitness } from '@exodus/bitcoinjs-lib/src/psbt/psbtutils.js'
3
+ import * as bitcoinjsLib from '@exodus/bitcoinjs'
5
4
  import { randomBytes } from '@exodus/crypto/randomBytes'
5
+ import { privateKeyToPublicKey, publicKeyToX } from '@exodus/crypto/secp256k1'
6
6
  import { TextEncoder } from '@exodus/text-encoding-utf8'
7
7
  import assert from 'minimalistic-assert'
8
- import secp256k1 from 'secp256k1'
9
8
 
10
9
  import { DEFAULT_BRC20_POSTAGE, DEFAULT_ORDINAL_POSTAGE } from './ordinals-constants.js'
11
10
 
@@ -84,7 +83,7 @@ export const inscriptionsServiceFactory = ({ network, ordinalChainIndex }) => {
84
83
  function createCommitTxData({ publicKey, inscription }) {
85
84
  assert(publicKey, 'encodePublic is required')
86
85
  assert(inscription, 'inscription is required')
87
- const xOnlyPublicKey = toXOnly(publicKey)
86
+ const xOnlyPublicKey = publicKeyToX({ publicKey, format: 'buffer' })
88
87
  const script = createInscriptionScript({ xOnlyPublicKey, inscription })
89
88
 
90
89
  const outputScript = bitcoinjsLib.script.compile(script)
@@ -149,7 +148,7 @@ export const inscriptionsServiceFactory = ({ network, ordinalChainIndex }) => {
149
148
  ]
150
149
 
151
150
  return {
152
- finalScriptWitness: witnessStackToScriptWitness(witness),
151
+ finalScriptWitness: bitcoinjsLib.witnessStackToScriptWitness(witness),
153
152
  }
154
153
  }
155
154
 
@@ -206,11 +205,7 @@ export const inscriptionsServiceFactory = ({ network, ordinalChainIndex }) => {
206
205
  ...commitTxData,
207
206
  })
208
207
 
209
- const ECPair = getECPair()
210
-
211
- const keypair = ECPair.fromPrivateKey(privateKey, { network })
212
-
213
- await psbt.signInputAsync(0, toAsyncSigner({ keyPair: keypair, ecc }))
208
+ await psbt.signInputAsync(0, toAsyncSigner({ privateKey }))
214
209
 
215
210
  const signature = psbt.data.inputs[0].tapScriptSig[0].signature.toString('hex')
216
211
 
@@ -280,7 +275,7 @@ export const inscriptionsServiceFactory = ({ network, ordinalChainIndex }) => {
280
275
 
281
276
  const postage = inscription.postage
282
277
 
283
- const publicKey = secp256k1.publicKeyCreate(privateKey, false)
278
+ const publicKey = privateKeyToPublicKey({ privateKey, compressed: false, format: 'buffer' })
284
279
  const commitTxData = createCommitTxData({ publicKey, inscription })
285
280
 
286
281
  const feeData = await assetClientInterface.getFeeConfig({ assetName })