@exodus/bitcoin-api 2.6.4 → 2.6.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 +3 -3
- package/src/bitcoinjs-lib/ec-pair.js +9 -0
- package/src/bitcoinjs-lib/ecc/desktop.js +1 -1
- package/src/bitcoinjs-lib/ecc/mobile.js +1 -1
- package/src/bitcoinjs-lib/index.js +1 -0
- package/src/bitcoinjs-lib/script-classify/index.js +1 -1
- package/src/btc-like-address.js +1 -1
- package/src/btc-like-keys.js +1 -1
- package/src/insight-api-client/index.js +4 -5
- package/src/parse-unsigned-tx.js +1 -1
- package/src/tx-log/bitcoin-monitor-scanner.js +2 -2
- package/src/tx-send/index.js +1 -1
- package/src/tx-sign/default-create-tx.js +3 -4
- package/src/tx-sign/taproot.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-api",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.6",
|
|
4
4
|
"description": "Exodus bitcoin-api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"@exodus/basic-utils": "^2.1.0",
|
|
23
23
|
"@exodus/bip-schnorr": "0.6.6-fork-1",
|
|
24
24
|
"@exodus/bip44-constants": "^195.0.0",
|
|
25
|
+
"@exodus/bitcoinjs-lib": "^6.1.5-exodus.0",
|
|
25
26
|
"@exodus/models": "^11.0.0",
|
|
26
27
|
"@exodus/secp256k1": "4.0.2-exodus.0",
|
|
27
28
|
"@exodus/simple-retry": "0.0.6",
|
|
28
29
|
"@exodus/timer": "^1.0.0",
|
|
29
30
|
"@noble/secp256k1": "~1.7.1",
|
|
30
31
|
"bech32": "^1.1.3",
|
|
31
|
-
"bitcoinjs-lib": "^6.1.5",
|
|
32
32
|
"coininfo": "5.1.0",
|
|
33
33
|
"delay": "4.0.1",
|
|
34
34
|
"ecpair": "2.0.1",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"@scure/btc-signer": "^1.1.0",
|
|
44
44
|
"jest-when": "^3.5.1"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "b2ed2bffe712facdd412df1a0ebc6a8ac92c4d1c"
|
|
47
47
|
}
|
package/src/btc-like-address.js
CHANGED
|
@@ -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 'bitcoinjs-lib'
|
|
5
|
+
import * as bitcoinjsOriginal from '@exodus/bitcoinjs-lib'
|
|
6
6
|
|
|
7
7
|
export const createBtcLikeAddress = ({
|
|
8
8
|
versions,
|
package/src/btc-like-keys.js
CHANGED
|
@@ -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 'bitcoinjs-lib'
|
|
6
|
+
import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
7
7
|
import secp256k1 from 'secp256k1'
|
|
8
8
|
import { hash160 } from './hash-utils'
|
|
9
9
|
import { toXOnly } from './bitcoinjs-lib/ecc-utils'
|
|
@@ -57,12 +57,11 @@ export default class InsightAPIClient {
|
|
|
57
57
|
return !!peerStatus.connected
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
return (
|
|
60
|
+
async fetchBalance(address) {
|
|
61
|
+
const encodedAddress = encodeURIComponent(address)
|
|
62
|
+
const url = urlJoin(this._baseURL, `/balance/${encodedAddress}`)
|
|
63
|
+
return fetchJson(url)
|
|
64
64
|
}
|
|
65
|
-
*/
|
|
66
65
|
|
|
67
66
|
async fetchBlockHeight() {
|
|
68
67
|
const url = urlJoin(this._baseURL, '/status')
|
package/src/parse-unsigned-tx.js
CHANGED
|
@@ -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 'bitcoinjs-lib'
|
|
5
|
+
import { Transaction as BitcoinTransactionClass } from '@exodus/bitcoinjs-lib'
|
|
6
6
|
|
|
7
7
|
export const parseUnsignedTxFactory = ({ Transaction = BitcoinTransactionClass } = {}) => async ({
|
|
8
8
|
asset,
|
|
@@ -505,8 +505,8 @@ export class BitcoinMonitorScanner {
|
|
|
505
505
|
let utxoCol = UtxoCollection.fromArray(utxos, { currency })
|
|
506
506
|
|
|
507
507
|
const utxosToRemoveCol = UtxoCollection.fromArray(utxosToRemove, { currency })
|
|
508
|
-
//
|
|
509
|
-
utxoCol =
|
|
508
|
+
// Keep new utxos when they intersect with the stored utxos.
|
|
509
|
+
utxoCol = utxoCol.union(currentStoredUtxos).difference(utxosToRemoveCol)
|
|
510
510
|
|
|
511
511
|
for (let tx of Object.values(unconfirmedTxsToCheck)) {
|
|
512
512
|
existingTxs.push({ ...tx, dropped: true }) // TODO: this will decrease the chain index, it shouldn't be an issue considering the gap limit
|
package/src/tx-send/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import { findUnconfirmedSentRbfTxs } from '../tx-utils'
|
|
17
17
|
import { getOrdinalsUtxos, getUsableUtxos, getUtxos } from '../utxos-utils'
|
|
18
18
|
|
|
19
|
-
import * as defaultBitcoinjsLib from 'bitcoinjs-lib'
|
|
19
|
+
import * as defaultBitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
20
20
|
|
|
21
21
|
const ASSETS_SUPPORTED_BIP_174 = [
|
|
22
22
|
'bitcoin',
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from 'minimalistic-assert'
|
|
2
2
|
import lodash from 'lodash'
|
|
3
|
-
import
|
|
4
|
-
import { payments, Psbt, Transaction } from 'bitcoinjs-lib'
|
|
3
|
+
import { payments, Psbt, Transaction } from '@exodus/bitcoinjs-lib'
|
|
5
4
|
import { getOwnProperty } from '@exodus/basic-utils'
|
|
6
5
|
|
|
7
6
|
import secp256k1 from 'secp256k1'
|
|
8
7
|
|
|
9
8
|
import { toXOnly } from '../bitcoinjs-lib/ecc-utils'
|
|
10
9
|
import { toAsyncSigner, tweakSigner } from './taproot'
|
|
11
|
-
import {
|
|
10
|
+
import { getECPair } from '../bitcoinjs-lib'
|
|
12
11
|
|
|
13
12
|
let ECPair
|
|
14
13
|
|
|
@@ -100,7 +99,7 @@ export const signTxFactory = ({ assetName, resolvePurpose, keys, coinInfo, netwo
|
|
|
100
99
|
const { addressPathsMap } = unsignedTx.txMeta
|
|
101
100
|
const networkInfo = { ...coinInfo.toBitcoinJS(), messagePrefix: '' }
|
|
102
101
|
|
|
103
|
-
ECPair =
|
|
102
|
+
ECPair = getECPair()
|
|
104
103
|
|
|
105
104
|
const getKeyAndPurpose = lodash.memoize((address) => {
|
|
106
105
|
const purpose = resolvePurpose(address)
|
package/src/tx-sign/taproot.js
CHANGED