@exodus/bitcoin-api 2.9.5 → 2.9.6

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-api",
3
- "version": "2.9.5",
3
+ "version": "2.9.6",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -28,6 +28,7 @@
28
28
  "@exodus/secp256k1": "4.0.2-exodus.0",
29
29
  "@exodus/simple-retry": "0.0.6",
30
30
  "@exodus/timer": "^1.0.0",
31
+ "@noble/hashes": "^1.3.3",
31
32
  "@noble/secp256k1": "~1.7.1",
32
33
  "bech32": "^1.1.3",
33
34
  "bip32-path": "^0.4.2",
@@ -57,5 +58,5 @@
57
58
  "jest-when": "^3.5.1",
58
59
  "safe-buffer": "^5.2.1"
59
60
  },
60
- "gitHead": "fe502508d90e04ca63c4a7d134c7ef83082f7fce"
61
+ "gitHead": "aa2228b4d986dacc2f2ce1975d75f81b48b22d9a"
61
62
  }
@@ -1,7 +1,15 @@
1
1
  import { initEccLib } from 'bitcoinjs-lib'
2
- import { Point, schnorr, sign } from '@noble/secp256k1'
2
+ import { utils, Point, schnorr, sign } from '@noble/secp256k1'
3
3
  import { common, toPubKey } from './common'
4
4
 
5
+ import { hmac } from '@noble/hashes/hmac'
6
+ import { sha256 } from '@noble/hashes/sha256'
7
+
8
+ // hijack to avoid the usage of crypto.subtle, not present in RN atm
9
+ utils.hmacSha256 = (key, ...msgs) => hmac(sha256, key, utils.concatBytes(...msgs))
10
+
11
+ utils.sha256 = (...msgs) => sha256(utils.concatBytes(...msgs))
12
+
5
13
  /**
6
14
  * Wrapper around `secp256k1` in order to follow the bitcoinjs-lib `TinySecp256k1Interface`
7
15
  * Schnorr signatures are offered by @noble/secp256k1