@xchainjs/xchain-bitcoin 2.2.6 → 2.3.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/lib/const.d.ts +1 -0
- package/lib/index.esm.js +14 -3
- package/lib/index.js +13 -1
- package/package.json +5 -5
package/lib/const.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const SochainDataProviders: UtxoOnlineDataProviders;
|
|
|
29
29
|
export declare const HaskoinDataProviders: UtxoOnlineDataProviders;
|
|
30
30
|
export declare const BlockcypherDataProviders: UtxoOnlineDataProviders;
|
|
31
31
|
export declare const BitgoProviders: UtxoOnlineDataProviders;
|
|
32
|
+
export declare const BlockbookDataProviders: UtxoOnlineDataProviders;
|
|
32
33
|
export declare const tapRootDerivationPaths: {
|
|
33
34
|
mainnet: string;
|
|
34
35
|
testnet: string;
|
package/lib/index.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as Bitcoin from 'bitcoinjs-lib';
|
|
|
6
6
|
import { ECPairFactory } from 'ecpair';
|
|
7
7
|
import { Client as Client$1, UtxoTransactionValidator, UtxoError } from '@xchainjs/xchain-utxo';
|
|
8
8
|
import { AssetType } from '@xchainjs/xchain-util';
|
|
9
|
-
import { SochainProvider, SochainNetwork, HaskoinProvider, HaskoinNetwork, BlockcypherProvider, BlockcypherNetwork, BitgoProvider } from '@xchainjs/xchain-utxo-providers';
|
|
9
|
+
import { SochainProvider, SochainNetwork, HaskoinProvider, HaskoinNetwork, BlockcypherProvider, BlockcypherNetwork, BitgoProvider, BlockbookProvider } from '@xchainjs/xchain-utxo-providers';
|
|
10
10
|
import AppBtc from '@ledgerhq/hw-app-btc';
|
|
11
11
|
|
|
12
12
|
var AddressFormat;
|
|
@@ -111,6 +111,17 @@ const BitgoProviders = {
|
|
|
111
111
|
[Network.Stagenet]: mainnetBitgoProvider,
|
|
112
112
|
[Network.Mainnet]: mainnetBitgoProvider,
|
|
113
113
|
};
|
|
114
|
+
// NowNodes Blockbook data providers for Bitcoin
|
|
115
|
+
// Docs: https://nownodes.io/nodes/bitcoin-btc
|
|
116
|
+
const mainnetBtcBlockbookProvider = new BlockbookProvider('https://btcbook.nownodes.io/api/v2', AssetBTC, BTC_DECIMAL, {
|
|
117
|
+
apiKey: process.env.NOWNODES_API_KEY || '',
|
|
118
|
+
});
|
|
119
|
+
const testnetBtcBlockbookProvider = new BlockbookProvider('https://btcbook-testnet.nownodes.io/api/v2', AssetBTC, BTC_DECIMAL, { apiKey: process.env.NOWNODES_API_KEY || '' });
|
|
120
|
+
const BlockbookDataProviders = {
|
|
121
|
+
[Network.Testnet]: testnetBtcBlockbookProvider,
|
|
122
|
+
[Network.Stagenet]: mainnetBtcBlockbookProvider,
|
|
123
|
+
[Network.Mainnet]: mainnetBtcBlockbookProvider,
|
|
124
|
+
};
|
|
114
125
|
const tapRootDerivationPaths = {
|
|
115
126
|
[Network.Mainnet]: `m/86'/0'/0'/0/`,
|
|
116
127
|
[Network.Testnet]: `m/86'/1'/0'/0/`,
|
|
@@ -189,7 +200,7 @@ const defaultBTCParams = {
|
|
|
189
200
|
network: Network.Mainnet,
|
|
190
201
|
phrase: '',
|
|
191
202
|
explorerProviders: blockstreamExplorerProviders,
|
|
192
|
-
dataProviders: [BitgoProviders, BlockcypherDataProviders],
|
|
203
|
+
dataProviders: [BitgoProviders, BlockcypherDataProviders, BlockbookDataProviders],
|
|
193
204
|
rootDerivationPaths: {
|
|
194
205
|
[Network.Mainnet]: `m/84'/0'/0'/0/`, // Not BIP44 compliant but compatible with pre-HD wallets
|
|
195
206
|
[Network.Testnet]: `m/84'/1'/0'/0/`,
|
|
@@ -838,4 +849,4 @@ class ClientLedger extends Client {
|
|
|
838
849
|
}
|
|
839
850
|
}
|
|
840
851
|
|
|
841
|
-
export { AddressFormat, AssetBTC, BTCChain, BTC_DECIMAL, BTC_SATOSHI_SYMBOL, BTC_SYMBOL, BitgoProviders, BlockcypherDataProviders, ClientKeystore as Client, ClientLedger, HaskoinDataProviders, LOWER_FEE_BOUND, MIN_TX_FEE, SochainDataProviders, UPPER_FEE_BOUND, blockstreamExplorerProviders, defaultBTCParams, getPrefix, tapRootDerivationPaths, validateAddress };
|
|
852
|
+
export { AddressFormat, AssetBTC, BTCChain, BTC_DECIMAL, BTC_SATOSHI_SYMBOL, BTC_SYMBOL, BitgoProviders, BlockbookDataProviders, BlockcypherDataProviders, ClientKeystore as Client, ClientLedger, HaskoinDataProviders, LOWER_FEE_BOUND, MIN_TX_FEE, SochainDataProviders, UPPER_FEE_BOUND, blockstreamExplorerProviders, defaultBTCParams, getPrefix, tapRootDerivationPaths, validateAddress };
|
package/lib/index.js
CHANGED
|
@@ -137,6 +137,17 @@ const BitgoProviders = {
|
|
|
137
137
|
[xchainClient.Network.Stagenet]: mainnetBitgoProvider,
|
|
138
138
|
[xchainClient.Network.Mainnet]: mainnetBitgoProvider,
|
|
139
139
|
};
|
|
140
|
+
// NowNodes Blockbook data providers for Bitcoin
|
|
141
|
+
// Docs: https://nownodes.io/nodes/bitcoin-btc
|
|
142
|
+
const mainnetBtcBlockbookProvider = new xchainUtxoProviders.BlockbookProvider('https://btcbook.nownodes.io/api/v2', AssetBTC, BTC_DECIMAL, {
|
|
143
|
+
apiKey: process.env.NOWNODES_API_KEY || '',
|
|
144
|
+
});
|
|
145
|
+
const testnetBtcBlockbookProvider = new xchainUtxoProviders.BlockbookProvider('https://btcbook-testnet.nownodes.io/api/v2', AssetBTC, BTC_DECIMAL, { apiKey: process.env.NOWNODES_API_KEY || '' });
|
|
146
|
+
const BlockbookDataProviders = {
|
|
147
|
+
[xchainClient.Network.Testnet]: testnetBtcBlockbookProvider,
|
|
148
|
+
[xchainClient.Network.Stagenet]: mainnetBtcBlockbookProvider,
|
|
149
|
+
[xchainClient.Network.Mainnet]: mainnetBtcBlockbookProvider,
|
|
150
|
+
};
|
|
140
151
|
const tapRootDerivationPaths = {
|
|
141
152
|
[xchainClient.Network.Mainnet]: `m/86'/0'/0'/0/`,
|
|
142
153
|
[xchainClient.Network.Testnet]: `m/86'/1'/0'/0/`,
|
|
@@ -215,7 +226,7 @@ const defaultBTCParams = {
|
|
|
215
226
|
network: xchainClient.Network.Mainnet,
|
|
216
227
|
phrase: '',
|
|
217
228
|
explorerProviders: blockstreamExplorerProviders,
|
|
218
|
-
dataProviders: [BitgoProviders, BlockcypherDataProviders],
|
|
229
|
+
dataProviders: [BitgoProviders, BlockcypherDataProviders, BlockbookDataProviders],
|
|
219
230
|
rootDerivationPaths: {
|
|
220
231
|
[xchainClient.Network.Mainnet]: `m/84'/0'/0'/0/`, // Not BIP44 compliant but compatible with pre-HD wallets
|
|
221
232
|
[xchainClient.Network.Testnet]: `m/84'/1'/0'/0/`,
|
|
@@ -870,6 +881,7 @@ exports.BTC_DECIMAL = BTC_DECIMAL;
|
|
|
870
881
|
exports.BTC_SATOSHI_SYMBOL = BTC_SATOSHI_SYMBOL;
|
|
871
882
|
exports.BTC_SYMBOL = BTC_SYMBOL;
|
|
872
883
|
exports.BitgoProviders = BitgoProviders;
|
|
884
|
+
exports.BlockbookDataProviders = BlockbookDataProviders;
|
|
873
885
|
exports.BlockcypherDataProviders = BlockcypherDataProviders;
|
|
874
886
|
exports.Client = ClientKeystore;
|
|
875
887
|
exports.ClientLedger = ClientLedger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-bitcoin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Custom Bitcoin client and utilities used by XChainJS clients",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"XChain",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
|
|
37
37
|
"@ledgerhq/hw-app-btc": "^10.9.0",
|
|
38
38
|
"@scure/bip32": "^1.7.0",
|
|
39
|
-
"@xchainjs/xchain-client": "2.0.
|
|
40
|
-
"@xchainjs/xchain-crypto": "1.0.
|
|
39
|
+
"@xchainjs/xchain-client": "2.0.16",
|
|
40
|
+
"@xchainjs/xchain-crypto": "1.0.8",
|
|
41
41
|
"@xchainjs/xchain-util": "2.0.7",
|
|
42
|
-
"@xchainjs/xchain-utxo": "2.2.
|
|
43
|
-
"@xchainjs/xchain-utxo-providers": "2.0
|
|
42
|
+
"@xchainjs/xchain-utxo": "2.2.8",
|
|
43
|
+
"@xchainjs/xchain-utxo-providers": "2.1.0",
|
|
44
44
|
"bitcoinjs-lib": "^6.1.7",
|
|
45
45
|
"coinselect": "3.1.12",
|
|
46
46
|
"ecpair": "2.1.0"
|