@exodus/bitcoin-api 2.9.3 → 2.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -18,12 +18,10 @@
18
18
  "lint:fix": "yarn lint --fix"
19
19
  },
20
20
  "dependencies": {
21
- "@exodus/asset-lib": "^4.0.0",
21
+ "@exodus/asset-lib": "^4.1.0",
22
22
  "@exodus/basic-utils": "^2.1.0",
23
- "@exodus/bip-schnorr": "0.6.6-fork-1",
24
23
  "@exodus/bip44-constants": "^195.0.0",
25
24
  "@exodus/bitcoin-lib": "2.3.0",
26
- "@exodus/bitcoinjs-lib": "^6.1.5-exodus.0",
27
25
  "@exodus/currency": "^2.3.2",
28
26
  "@exodus/fetch": "^1.3.0",
29
27
  "@exodus/models": "^11.0.0",
@@ -33,6 +31,7 @@
33
31
  "@noble/secp256k1": "~1.7.1",
34
32
  "bech32": "^1.1.3",
35
33
  "bip32-path": "^0.4.2",
34
+ "bitcoinjs-lib": "^6.1.5",
36
35
  "bn.js": "4.12.0",
37
36
  "bs58check": "^2.1.2",
38
37
  "coininfo": "5.1.0",
@@ -58,5 +57,5 @@
58
57
  "jest-when": "^3.5.1",
59
58
  "safe-buffer": "^5.2.1"
60
59
  },
61
- "gitHead": "fe5b49b00fff26b6090cad149ca522db8aa971f8"
60
+ "gitHead": "fe502508d90e04ca63c4a7d134c7ef83082f7fce"
62
61
  }
@@ -1,4 +1,4 @@
1
- import { initEccLib } from '@exodus/bitcoinjs-lib'
1
+ import { initEccLib } from 'bitcoinjs-lib'
2
2
  import { Point, schnorr, sign } from '@noble/secp256k1'
3
3
  import { common, toPubKey } from './common'
4
4
 
@@ -1,4 +1,4 @@
1
- import { payments } from '@exodus/bitcoinjs-lib'
1
+ import { payments } from 'bitcoinjs-lib'
2
2
 
3
3
  function isPaymentFactory(payment) {
4
4
  return (script, eccLib) => {
@@ -2,7 +2,7 @@ import bs58check from 'bs58check'
2
2
  import * as bech32 from 'bech32'
3
3
  import assert from 'minimalistic-assert'
4
4
  import { identity, pickBy } from 'lodash'
5
- import * as bitcoinjsOriginal from '@exodus/bitcoinjs-lib'
5
+ import * as bitcoinjsOriginal from 'bitcoinjs-lib'
6
6
 
7
7
  export const createBtcLikeAddress = ({
8
8
  versions,
@@ -3,7 +3,7 @@ import wif from 'wif'
3
3
  import * as bech32 from 'bech32'
4
4
  import assert from 'minimalistic-assert'
5
5
  import { identity, pickBy } from 'lodash'
6
- import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
6
+ import * as defaultBitcoinjsLib from 'bitcoinjs-lib'
7
7
  import secp256k1 from 'secp256k1'
8
8
  import { hash160 } from './hash-utils'
9
9
  import { toXOnly } from './bitcoinjs-lib/ecc-utils'
@@ -2,7 +2,7 @@ import assert from 'minimalistic-assert'
2
2
  import BIPPath from 'bip32-path'
3
3
  import BN from 'bn.js'
4
4
  import lodash from 'lodash'
5
- import { Transaction as BitcoinTransactionClass } from '@exodus/bitcoinjs-lib'
5
+ import { Transaction as BitcoinTransactionClass } from 'bitcoinjs-lib'
6
6
 
7
7
  export const parseUnsignedTxFactory =
8
8
  ({ Transaction = BitcoinTransactionClass } = {}) =>
@@ -21,7 +21,7 @@ import {
21
21
  getUtxos,
22
22
  } from '../utxos-utils'
23
23
 
24
- import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
24
+ import * as defaultBitcoinjsLib from 'bitcoinjs-lib'
25
25
  import { getUnconfirmedTxAncestorMap } from '../unconfirmed-ancestor-data'
26
26
 
27
27
  const ASSETS_SUPPORTED_BIP_174 = new Set([
@@ -1,4 +1,4 @@
1
- import { Transaction, payments } from '@exodus/bitcoinjs-lib'
1
+ import { Transaction, payments } from 'bitcoinjs-lib'
2
2
 
3
3
  import { getECPair } from '../bitcoinjs-lib'
4
4
  import { toXOnly } from '../bitcoinjs-lib/ecc-utils'
@@ -1,5 +1,5 @@
1
1
  import assert from 'minimalistic-assert'
2
- import { Psbt, Transaction } from '@exodus/bitcoinjs-lib'
2
+ import { Psbt, Transaction } from 'bitcoinjs-lib'
3
3
 
4
4
  const _MAXIMUM_FEE_RATES = {
5
5
  qtumignition: 25_000,
@@ -1,4 +1,4 @@
1
- import { crypto } from '@exodus/bitcoinjs-lib'
1
+ import { crypto } from 'bitcoinjs-lib'
2
2
  import assert from 'minimalistic-assert'
3
3
  import { getSchnorrEntropy } from './default-entropy'
4
4
  import { toXOnly } from '../bitcoinjs-lib/ecc-utils'
@@ -1,3 +0,0 @@
1
- import { mobileEcc } from './mobile'
2
-
3
- export const eccFactory = () => mobileEcc
@@ -1,102 +0,0 @@
1
- import { initEccLib } from '@exodus/bitcoinjs-lib'
2
- import secp256k1 from '@exodus/secp256k1'
3
- // TODO: temp import until '@noble/secp256k1' can be used
4
- import { isPoint } from 'tiny-secp256k1'
5
- import { common, toPubKey } from './common'
6
- import schnorr from '@exodus/bip-schnorr'
7
-
8
- /**
9
- * Wrapper around `secp256k1` in order to follow the bitcoinjs-lib `TinySecp256k1Interface`
10
- * Schnorr signatures are offered by @exodus/bip-schnorr
11
- *
12
- */
13
-
14
- export const mobileEcc = {
15
- ...common,
16
-
17
- /**
18
- *
19
- * @param message {Uint8Array}
20
- * @param seckey {Uint8Array}
21
- * @param extraEntropy {Uint8Array}
22
- * @returns {Promise<(function(*): Uint8Array)|*>}
23
- */
24
- signAsync: async (message, seckey, extraEntropy) =>
25
- secp256k1.ecdsaSign(message, seckey, { data: extraEntropy }).signature,
26
-
27
- /**
28
- *
29
- * @param message {Uint8Array}
30
- * @param privateKey {Uint8Array}
31
- * @param extraEntropy {Uint8Array}
32
- * @returns {Buffer}
33
- */
34
- signSchnorr: (message, privateKey, extraEntropy) =>
35
- schnorr.sign(privateKey.toString('hex'), message, extraEntropy),
36
-
37
- /**
38
- * @param message {Uint8Array}
39
- * @param privateKey {Uint8Array}
40
- * @param extraEntropy {Uint8Array}
41
- * @returns {Promise<Buffer>}
42
- */
43
- signSchnorrAsync: async (message, privateKey, extraEntropy) =>
44
- mobileEcc.signSchnorr(message, privateKey, extraEntropy),
45
-
46
- /**
47
- * @param publicKey {Uint8Array}
48
- * @param message {Uint8Array}
49
- * @param signature {Uint8Array}
50
- * @returns {boolean}
51
- */
52
- verifySchnorr: (publicKey, message, signature) => {
53
- try {
54
- schnorr.verify(message, publicKey, signature)
55
- return true
56
- } catch {
57
- return false
58
- }
59
- },
60
-
61
- /**
62
- * @param publicKey {Uint8Array}
63
- * @param message {Uint8Array}
64
- * @param signature {Uint8Array}
65
- * @returns {Promise<boolean>}
66
- */
67
- verifySchnorrAsync: async (publicKey, message, signature) =>
68
- mobileEcc.verifySchnorr(publicKey, message, signature),
69
-
70
- /**
71
- * @param publicKey {Uint8Array}
72
- * @returns {boolean}
73
- */
74
- isPoint: (publicKey) => {
75
- try {
76
- // temp solution secp256k1 does not actually verify the value range, only the data length
77
- return isPoint(Buffer.from(publicKey))
78
- } catch {
79
- return false
80
- }
81
- },
82
-
83
- /**
84
- * @param publicKey {Uint8Array}
85
- * @returns {boolean}
86
- */
87
- isXOnlyPoint: (publicKey) => {
88
- try {
89
- // temp solution secp256k1 does not actually verify the value range, only the data length
90
- return isPoint(Buffer.from(toPubKey(publicKey)))
91
- } catch {
92
- return false
93
- }
94
- },
95
-
96
- /**
97
- * @param publicKey {Uint8Array}
98
- */
99
- pointCompress: (publicKey, compressed) => secp256k1.publicKeyConvert(publicKey, compressed),
100
- }
101
-
102
- initEccLib(mobileEcc)