@xchainjs/xchain-bitcoin 2.0.4 → 2.0.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/lib/client.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { AssetInfo, FeeRate } from '@xchainjs/xchain-client';
3
2
  import { Address } from '@xchainjs/xchain-util';
4
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({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, }) {
293
- return __awaiter(this, void 0, void 0, function* () {
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({ sender, memo, amount, recipient, spendPendingUTXO = true, feeRate, }) {
377
- return __awaiter(this, void 0, void 0, function* () {
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(index = 0) {
448
- return __awaiter(this, void 0, void 0, function* () {
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(index = 0, verify = false) {
541
- return __awaiter(this, void 0, void 0, function* () {
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
@@ -15,21 +15,21 @@ var AppBtc = require('@ledgerhq/hw-app-btc');
15
15
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
16
 
17
17
  function _interopNamespace(e) {
18
- if (e && e.__esModule) return e;
19
- var n = Object.create(null);
20
- if (e) {
21
- Object.keys(e).forEach(function (k) {
22
- if (k !== 'default') {
23
- var d = Object.getOwnPropertyDescriptor(e, k);
24
- Object.defineProperty(n, k, d.get ? d : {
25
- enumerable: true,
26
- get: function () { return e[k]; }
18
+ if (e && e.__esModule) return e;
19
+ var n = Object.create(null);
20
+ if (e) {
21
+ Object.keys(e).forEach(function (k) {
22
+ if (k !== 'default') {
23
+ var d = Object.getOwnPropertyDescriptor(e, k);
24
+ Object.defineProperty(n, k, d.get ? d : {
25
+ enumerable: true,
26
+ get: function () { return e[k]; }
27
+ });
28
+ }
27
29
  });
28
- }
29
- });
30
- }
31
- n.default = e;
32
- return Object.freeze(n);
30
+ }
31
+ n.default = e;
32
+ return Object.freeze(n);
33
33
  }
34
34
 
35
35
  var ecc__namespace = /*#__PURE__*/_interopNamespace(ecc);
@@ -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({ amount, recipient, memo, feeRate, sender, spendPendingUTXO = true, }) {
320
- return __awaiter(this, void 0, void 0, function* () {
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({ sender, memo, amount, recipient, spendPendingUTXO = true, feeRate, }) {
404
- return __awaiter(this, void 0, void 0, function* () {
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(index = 0) {
475
- return __awaiter(this, void 0, void 0, function* () {
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(index = 0, verify = false) {
568
- return __awaiter(this, void 0, void 0, function* () {
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/lib/utils.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { Network } from '@xchainjs/xchain-client';
3
2
  import { Address } from '@xchainjs/xchain-util';
4
3
  import { UTXO } from '@xchainjs/xchain-utxo';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-bitcoin",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Custom Bitcoin client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "XChain",
@@ -34,22 +34,21 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
37
- "@ledgerhq/hw-app-btc": "10.9.0",
37
+ "@ledgerhq/hw-app-btc": "^10.9.0",
38
38
  "@scure/bip32": "^1.7.0",
39
- "@xchainjs/xchain-client": "2.0.4",
40
- "@xchainjs/xchain-crypto": "1.0.2",
41
- "@xchainjs/xchain-util": "2.0.3",
42
- "@xchainjs/xchain-utxo": "2.0.4",
43
- "@xchainjs/xchain-utxo-providers": "2.0.4",
39
+ "@xchainjs/xchain-client": "2.0.6",
40
+ "@xchainjs/xchain-crypto": "1.0.4",
41
+ "@xchainjs/xchain-util": "2.0.4",
42
+ "@xchainjs/xchain-utxo": "2.0.6",
43
+ "@xchainjs/xchain-utxo-providers": "2.0.6",
44
44
  "bitcoinjs-lib": "^6.1.7",
45
45
  "coinselect": "3.1.12",
46
46
  "ecpair": "2.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@ledgerhq/hw-transport-node-hid": "6.28.6",
50
- "@types/bitcoinjs-lib": "^5.0.4",
51
- "axios": "1.8.4",
52
- "axios-mock-adapter": "2.1.0"
49
+ "@ledgerhq/hw-transport-node-hid": "^6.28.6",
50
+ "axios": "^1.8.4",
51
+ "axios-mock-adapter": "^2.1.0"
53
52
  },
54
53
  "publishConfig": {
55
54
  "access": "public",
File without changes