@exodus/bitcoin-api 2.29.3 → 2.29.5

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,26 @@
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
+ ## [2.29.5](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.29.4...@exodus/bitcoin-api@2.29.5) (2024-12-19)
7
+
8
+
9
+ ### License
10
+
11
+
12
+ * license: re-license under MIT license (#4694)
13
+
14
+
15
+
16
+ ## [2.29.4](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.29.3...@exodus/bitcoin-api@2.29.4) (2024-12-13)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+
22
+ * fix: allow uncompressed private key import (#4705)
23
+
24
+
25
+
6
26
  ## [2.29.3](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-api@2.29.2...@exodus/bitcoin-api@2.29.3) (2024-11-22)
7
27
 
8
28
 
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2024 Exodus Movement, Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @exodus/bitcoin-api
2
+
3
+ Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Bitcoin and Bitcoin-like assets (e.g. dogecoin, litecoin, zcash). See [Asset Packages](../../docs/asset-packages.md) for more detail on this package's role.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.29.3",
4
- "description": "Exodus bitcoin-api",
3
+ "version": "2.29.5",
4
+ "description": "Bitcoin transaction and fee monitors, RPC with the blockchain node, other networking code.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
7
7
  "files": [
@@ -10,9 +10,9 @@
10
10
  "!src/**/__tests__"
11
11
  ],
12
12
  "author": "Exodus Movement, Inc.",
13
- "license": "ISC",
13
+ "license": "MIT",
14
14
  "publishConfig": {
15
- "access": "restricted"
15
+ "access": "public"
16
16
  },
17
17
  "scripts": {
18
18
  "test": "run -T exodus-test --jest",
@@ -25,7 +25,7 @@
25
25
  "@exodus/bip32": "^3.3.0",
26
26
  "@exodus/bip322-js": "^2.0.0",
27
27
  "@exodus/bip44-constants": "^195.0.0",
28
- "@exodus/bitcoin-lib": "^2.4.2",
28
+ "@exodus/bitcoin-lib": "^2.4.3",
29
29
  "@exodus/bitcoinjs": "^1.1.0",
30
30
  "@exodus/crypto": "^1.0.0-rc.13",
31
31
  "@exodus/currency": "^6.0.1",
@@ -56,5 +56,5 @@
56
56
  "type": "git",
57
57
  "url": "git+https://github.com/ExodusMovement/assets.git"
58
58
  },
59
- "gitHead": "3d9da782c98f837d61fb67987dde5c2a009294bf"
59
+ "gitHead": "9f590f5439d73cba02054d608fb3d5c62fbdcf34"
60
60
  }
@@ -39,8 +39,8 @@ export const createGetKeyWithMetadata = ({
39
39
  function getPrivateKeyFromMap(privateKeysAddressMap, networkInfo, purpose, address) {
40
40
  const privateWif = getOwnProperty(privateKeysAddressMap, address, 'string')
41
41
  assert(privateWif, `there is no private key for address ${address}`)
42
- const { privateKey } = ECPair.fromWIF(privateWif, networkInfo)
43
- const publicKey = privateKeyToPublicKey({ privateKey, format: 'buffer' })
42
+ const { privateKey, compressed } = ECPair.fromWIF(privateWif, networkInfo)
43
+ const publicKey = privateKeyToPublicKey({ privateKey, compressed, format: 'buffer' })
44
44
  return { privateKey, publicKey, purpose }
45
45
  }
46
46
 
@@ -77,7 +77,7 @@ export function createSignWithWallet({
77
77
 
78
78
  const asyncSigner = signer
79
79
  ? await toAsyncBufferSigner({ signer, isTaprootKeySpend, keyId })
80
- : toAsyncSigner({ privateKey, isTaprootKeySpend })
80
+ : toAsyncSigner({ privateKey, publicKey, isTaprootKeySpend })
81
81
 
82
82
  // desktop / BE / mobile with bip-schnorr signing
83
83
  signingPromises.push(psbt.signInputAsync(index, asyncSigner, allowedSigHashTypes))
@@ -23,19 +23,14 @@ export const tapTweakHash = (publicKey, h) => {
23
23
  return crypto.taggedHash('TapTweak', Buffer.concat(h ? [xOnly, h] : [xOnly]))
24
24
  }
25
25
 
26
- export function toAsyncSigner({ keyPair, privateKey, isTaprootKeySpend }) {
27
- if (keyPair && !privateKey) {
28
- // compat mode to avoid a breaking change
29
- // TODO: remove in semver-major
30
- privateKey = keyPair.privateKey
31
- keyPair = null
32
- }
33
-
26
+ export function toAsyncSigner({ privateKey, publicKey, isTaprootKeySpend }) {
34
27
  assert(privateKey, 'privateKey is required')
35
- assert(!keyPair, 'keyPair is not supported, use privateKey')
28
+ assert(publicKey, 'publicKey is required')
36
29
 
37
- if (isTaprootKeySpend) privateKey = tweakPrivateKey({ privateKey })
38
- const publicKey = secp256k1.privateKeyToPublicKey({ privateKey, format: 'buffer' })
30
+ if (isTaprootKeySpend) {
31
+ privateKey = tweakPrivateKey({ privateKey })
32
+ publicKey = tweakPublicKey({ publicKey, tweak: tapTweakHash(publicKey) })
33
+ }
39
34
 
40
35
  return {
41
36
  sign: async (hash) =>