@xchainjs/xchain-bitcoin 2.0.5 → 2.0.7
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/client.d.ts +0 -2
- package/lib/index.esm.js +9 -9
- package/lib/index.js +9 -9
- package/package.json +6 -6
package/lib/client.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { AssetInfo, FeeRate } from '@xchainjs/xchain-client';
|
|
4
2
|
import { Address } from '@xchainjs/xchain-util';
|
|
5
3
|
import { Client as UTXOClient, PreparedTx, TxParams, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo';
|
package/lib/index.esm.js
CHANGED
|
@@ -192,7 +192,7 @@ const defaultBTCParams = {
|
|
|
192
192
|
explorerProviders: blockstreamExplorerProviders,
|
|
193
193
|
dataProviders: [BitgoProviders, BlockcypherDataProviders],
|
|
194
194
|
rootDerivationPaths: {
|
|
195
|
-
[Network.Mainnet]: `m/84'/0'/0'/0/`,
|
|
195
|
+
[Network.Mainnet]: `m/84'/0'/0'/0/`, // Not BIP44 compliant but compatible with pre-HD wallets
|
|
196
196
|
[Network.Testnet]: `m/84'/1'/0'/0/`,
|
|
197
197
|
[Network.Stagenet]: `m/84'/0'/0'/0/`,
|
|
198
198
|
},
|
|
@@ -289,8 +289,8 @@ class Client extends Client$1 {
|
|
|
289
289
|
* @param param0
|
|
290
290
|
* @deprecated
|
|
291
291
|
*/
|
|
292
|
-
buildTx(
|
|
293
|
-
return __awaiter(this,
|
|
292
|
+
buildTx(_a) {
|
|
293
|
+
return __awaiter(this, arguments, void 0, function* ({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, }) {
|
|
294
294
|
// Check memo length
|
|
295
295
|
if (memo && memo.length > 80) {
|
|
296
296
|
throw new Error('memo too long, must not be longer than 80 chars.');
|
|
@@ -373,8 +373,8 @@ class Client extends Client$1 {
|
|
|
373
373
|
* @param {TxParams&Address&FeeRate&boolean} params The transfer options.
|
|
374
374
|
* @returns {PreparedTx} The raw unsigned transaction.
|
|
375
375
|
*/
|
|
376
|
-
prepareTx(
|
|
377
|
-
return __awaiter(this,
|
|
376
|
+
prepareTx(_a) {
|
|
377
|
+
return __awaiter(this, arguments, void 0, function* ({ sender, memo, amount, recipient, spendPendingUTXO = true, feeRate, }) {
|
|
378
378
|
// Build the transaction using the provided parameters.
|
|
379
379
|
const { psbt, utxos, inputs } = yield this.buildTx({
|
|
380
380
|
sender,
|
|
@@ -444,8 +444,8 @@ class ClientKeystore extends Client {
|
|
|
444
444
|
* @returns {Promise<Address>} A promise that resolves to the Bitcoin address.
|
|
445
445
|
* @throws {"Phrase must be provided"} Thrown if the phrase has not been set before.
|
|
446
446
|
*/
|
|
447
|
-
getAddressAsync(
|
|
448
|
-
return __awaiter(this,
|
|
447
|
+
getAddressAsync() {
|
|
448
|
+
return __awaiter(this, arguments, void 0, function* (index = 0) {
|
|
449
449
|
return this.getAddress(index);
|
|
450
450
|
});
|
|
451
451
|
}
|
|
@@ -537,8 +537,8 @@ class ClientLedger extends Client {
|
|
|
537
537
|
throw Error('Sync method not supported for Ledger');
|
|
538
538
|
}
|
|
539
539
|
// Get the current address asynchronously
|
|
540
|
-
getAddressAsync(
|
|
541
|
-
return __awaiter(this,
|
|
540
|
+
getAddressAsync() {
|
|
541
|
+
return __awaiter(this, arguments, void 0, function* (index = 0, verify = false) {
|
|
542
542
|
const app = yield this.getApp();
|
|
543
543
|
const result = yield app.getWalletPublicKey(this.getFullDerivationPath(index), {
|
|
544
544
|
format: this.addressFormat === AddressFormat.P2TR ? 'bech32m' : 'bech32',
|
package/lib/index.js
CHANGED
|
@@ -219,7 +219,7 @@ const defaultBTCParams = {
|
|
|
219
219
|
explorerProviders: blockstreamExplorerProviders,
|
|
220
220
|
dataProviders: [BitgoProviders, BlockcypherDataProviders],
|
|
221
221
|
rootDerivationPaths: {
|
|
222
|
-
[xchainClient.Network.Mainnet]: `m/84'/0'/0'/0/`,
|
|
222
|
+
[xchainClient.Network.Mainnet]: `m/84'/0'/0'/0/`, // Not BIP44 compliant but compatible with pre-HD wallets
|
|
223
223
|
[xchainClient.Network.Testnet]: `m/84'/1'/0'/0/`,
|
|
224
224
|
[xchainClient.Network.Stagenet]: `m/84'/0'/0'/0/`,
|
|
225
225
|
},
|
|
@@ -316,8 +316,8 @@ class Client extends xchainUtxo.Client {
|
|
|
316
316
|
* @param param0
|
|
317
317
|
* @deprecated
|
|
318
318
|
*/
|
|
319
|
-
buildTx(
|
|
320
|
-
return __awaiter(this,
|
|
319
|
+
buildTx(_a) {
|
|
320
|
+
return __awaiter(this, arguments, void 0, function* ({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, }) {
|
|
321
321
|
// Check memo length
|
|
322
322
|
if (memo && memo.length > 80) {
|
|
323
323
|
throw new Error('memo too long, must not be longer than 80 chars.');
|
|
@@ -400,8 +400,8 @@ class Client extends xchainUtxo.Client {
|
|
|
400
400
|
* @param {TxParams&Address&FeeRate&boolean} params The transfer options.
|
|
401
401
|
* @returns {PreparedTx} The raw unsigned transaction.
|
|
402
402
|
*/
|
|
403
|
-
prepareTx(
|
|
404
|
-
return __awaiter(this,
|
|
403
|
+
prepareTx(_a) {
|
|
404
|
+
return __awaiter(this, arguments, void 0, function* ({ sender, memo, amount, recipient, spendPendingUTXO = true, feeRate, }) {
|
|
405
405
|
// Build the transaction using the provided parameters.
|
|
406
406
|
const { psbt, utxos, inputs } = yield this.buildTx({
|
|
407
407
|
sender,
|
|
@@ -471,8 +471,8 @@ class ClientKeystore extends Client {
|
|
|
471
471
|
* @returns {Promise<Address>} A promise that resolves to the Bitcoin address.
|
|
472
472
|
* @throws {"Phrase must be provided"} Thrown if the phrase has not been set before.
|
|
473
473
|
*/
|
|
474
|
-
getAddressAsync(
|
|
475
|
-
return __awaiter(this,
|
|
474
|
+
getAddressAsync() {
|
|
475
|
+
return __awaiter(this, arguments, void 0, function* (index = 0) {
|
|
476
476
|
return this.getAddress(index);
|
|
477
477
|
});
|
|
478
478
|
}
|
|
@@ -564,8 +564,8 @@ class ClientLedger extends Client {
|
|
|
564
564
|
throw Error('Sync method not supported for Ledger');
|
|
565
565
|
}
|
|
566
566
|
// Get the current address asynchronously
|
|
567
|
-
getAddressAsync(
|
|
568
|
-
return __awaiter(this,
|
|
567
|
+
getAddressAsync() {
|
|
568
|
+
return __awaiter(this, arguments, void 0, function* (index = 0, verify = false) {
|
|
569
569
|
const app = yield this.getApp();
|
|
570
570
|
const result = yield app.getWalletPublicKey(this.getFullDerivationPath(index), {
|
|
571
571
|
format: this.addressFormat === exports.AddressFormat.P2TR ? 'bech32m' : 'bech32',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xchainjs/xchain-bitcoin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
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.
|
|
41
|
-
"@xchainjs/xchain-util": "2.0.
|
|
42
|
-
"@xchainjs/xchain-utxo": "2.0.
|
|
43
|
-
"@xchainjs/xchain-utxo-providers": "2.0.
|
|
39
|
+
"@xchainjs/xchain-client": "2.0.7",
|
|
40
|
+
"@xchainjs/xchain-crypto": "1.0.5",
|
|
41
|
+
"@xchainjs/xchain-util": "2.0.4",
|
|
42
|
+
"@xchainjs/xchain-utxo": "2.0.7",
|
|
43
|
+
"@xchainjs/xchain-utxo-providers": "2.0.7",
|
|
44
44
|
"bitcoinjs-lib": "^6.1.7",
|
|
45
45
|
"coinselect": "3.1.12",
|
|
46
46
|
"ecpair": "2.1.0"
|