@xchainjs/xchain-doge 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';
@@ -42,9 +41,7 @@ declare abstract class Client extends UTXOClient {
42
41
  * @returns {Transaction} A promise that resolves to the built PSBT and the unspent transaction outputs (UTXOs) used in the transaction.
43
42
  * @deprecated This method is deprecated. Use the `transfer` method instead.
44
43
  */
45
- buildTx: ({ amount, recipient, memo, feeRate, sender, }: import("@xchainjs/xchain-client").TxParams & {
46
- asset?: import("@xchainjs/xchain-util").Asset | undefined;
47
- } & {
44
+ buildTx: ({ amount, recipient, memo, feeRate, sender, }: TxParams & {
48
45
  feeRate: FeeRate;
49
46
  sender: Address;
50
47
  }) => Promise<{
package/lib/index.esm.js CHANGED
@@ -101,7 +101,7 @@ const sochainDataProviders = {
101
101
  */
102
102
  const mainnetBlockcypherProvider = new BlockcypherProvider('https://api.blockcypher.com/v1', DOGEChain, AssetDOGE, 8, BlockcypherNetwork.DOGE, process.env.BLOCKCYPHER_API_KEY || '');
103
103
  const blockcypherDataProviders = {
104
- [Network.Testnet]: undefined,
104
+ [Network.Testnet]: undefined, //no provider here
105
105
  [Network.Stagenet]: mainnetBlockcypherProvider,
106
106
  [Network.Mainnet]: mainnetBlockcypherProvider,
107
107
  };
@@ -192,17 +192,17 @@ const getPrefix = (network) => {
192
192
  * Contains default values for network, phrase, explorer providers, data providers, root derivation paths, and fee bounds.
193
193
  */
194
194
  const defaultDogeParams = {
195
- network: Network.Mainnet,
196
- phrase: '',
197
- explorerProviders: blockstreamExplorerProviders,
198
- dataProviders: [BitgoProviders, blockcypherDataProviders],
195
+ network: Network.Mainnet, // Default network is Mainnet
196
+ phrase: '', // Default empty phrase
197
+ explorerProviders: blockstreamExplorerProviders, // Default explorer providers
198
+ dataProviders: [BitgoProviders, blockcypherDataProviders], // Default data providers
199
199
  rootDerivationPaths: {
200
- [Network.Mainnet]: `m/44'/3'/0'/0/`,
201
- [Network.Stagenet]: `m/44'/3'/0'/0/`,
200
+ [Network.Mainnet]: `m/44'/3'/0'/0/`, // Default root derivation path for Mainnet
201
+ [Network.Stagenet]: `m/44'/3'/0'/0/`, // Default root derivation path for Stagenet
202
202
  [Network.Testnet]: `m/44'/1'/0'/0/`, // Default root derivation path for Testnet
203
203
  },
204
204
  feeBounds: {
205
- lower: LOWER_FEE_BOUND,
205
+ lower: LOWER_FEE_BOUND, // Default lower fee bound
206
206
  upper: UPPER_FEE_BOUND, // Default upper fee bound
207
207
  },
208
208
  };
@@ -235,7 +235,7 @@ class Client extends Client$1 {
235
235
  * @returns {Transaction} A promise that resolves to the built PSBT and the unspent transaction outputs (UTXOs) used in the transaction.
236
236
  * @deprecated This method is deprecated. Use the `transfer` method instead.
237
237
  */
238
- this.buildTx = ({ amount, recipient, memo, feeRate, sender, }) => __awaiter(this, void 0, void 0, function* () {
238
+ this.buildTx = (_a) => __awaiter(this, [_a], void 0, function* ({ amount, recipient, memo, feeRate, sender, }) {
239
239
  // Validate the recipient address
240
240
  if (!this.validateAddress(recipient))
241
241
  throw new Error('Invalid address');
@@ -343,8 +343,8 @@ class Client extends Client$1 {
343
343
  * @param {TxParams & { sender: Address; feeRate: FeeRate; spendPendingUTXO?: boolean }} params The transfer options including sender address, fee rate, and optional flag for spending pending UTXOs.
344
344
  * @returns {Promise<PreparedTx>} A promise that resolves to the raw unsigned transaction (PSBT).
345
345
  */
346
- prepareTx({ sender, memo, amount, recipient, feeRate, }) {
347
- return __awaiter(this, void 0, void 0, function* () {
346
+ prepareTx(_a) {
347
+ return __awaiter(this, arguments, void 0, function* ({ sender, memo, amount, recipient, feeRate, }) {
348
348
  // Build the transaction (PSBT) with the specified transfer options
349
349
  const { psbt, utxos, inputs } = yield this.buildTx({
350
350
  sender,
@@ -465,8 +465,8 @@ class ClientKeystore extends Client {
465
465
  * @throws {"Phrase must be provided"} Thrown if phrase has not been set before.
466
466
  * @throws {"Address not defined"} Thrown if failed creating account from phrase.
467
467
  */
468
- getAddressAsync(index = 0) {
469
- return __awaiter(this, void 0, void 0, function* () {
468
+ getAddressAsync() {
469
+ return __awaiter(this, arguments, void 0, function* (index = 0) {
470
470
  return this.getAddress(index);
471
471
  });
472
472
  }
@@ -528,8 +528,8 @@ class ClientLedger extends Client {
528
528
  throw Error('Sync method not supported for Ledger');
529
529
  }
530
530
  // Get the current address asynchronously
531
- getAddressAsync(index = 0, verify = false) {
532
- return __awaiter(this, void 0, void 0, function* () {
531
+ getAddressAsync() {
532
+ return __awaiter(this, arguments, void 0, function* (index = 0, verify = false) {
533
533
  const app = yield this.getApp();
534
534
  const result = yield app.getWalletPublicKey(this.getFullDerivationPath(index), {
535
535
  format: 'legacy',
package/lib/index.js CHANGED
@@ -128,7 +128,7 @@ const sochainDataProviders = {
128
128
  */
129
129
  const mainnetBlockcypherProvider = new xchainUtxoProviders.BlockcypherProvider('https://api.blockcypher.com/v1', DOGEChain, AssetDOGE, 8, xchainUtxoProviders.BlockcypherNetwork.DOGE, process.env.BLOCKCYPHER_API_KEY || '');
130
130
  const blockcypherDataProviders = {
131
- [xchainClient.Network.Testnet]: undefined,
131
+ [xchainClient.Network.Testnet]: undefined, //no provider here
132
132
  [xchainClient.Network.Stagenet]: mainnetBlockcypherProvider,
133
133
  [xchainClient.Network.Mainnet]: mainnetBlockcypherProvider,
134
134
  };
@@ -219,17 +219,17 @@ const getPrefix = (network) => {
219
219
  * Contains default values for network, phrase, explorer providers, data providers, root derivation paths, and fee bounds.
220
220
  */
221
221
  const defaultDogeParams = {
222
- network: xchainClient.Network.Mainnet,
223
- phrase: '',
224
- explorerProviders: blockstreamExplorerProviders,
225
- dataProviders: [BitgoProviders, blockcypherDataProviders],
222
+ network: xchainClient.Network.Mainnet, // Default network is Mainnet
223
+ phrase: '', // Default empty phrase
224
+ explorerProviders: blockstreamExplorerProviders, // Default explorer providers
225
+ dataProviders: [BitgoProviders, blockcypherDataProviders], // Default data providers
226
226
  rootDerivationPaths: {
227
- [xchainClient.Network.Mainnet]: `m/44'/3'/0'/0/`,
228
- [xchainClient.Network.Stagenet]: `m/44'/3'/0'/0/`,
227
+ [xchainClient.Network.Mainnet]: `m/44'/3'/0'/0/`, // Default root derivation path for Mainnet
228
+ [xchainClient.Network.Stagenet]: `m/44'/3'/0'/0/`, // Default root derivation path for Stagenet
229
229
  [xchainClient.Network.Testnet]: `m/44'/1'/0'/0/`, // Default root derivation path for Testnet
230
230
  },
231
231
  feeBounds: {
232
- lower: LOWER_FEE_BOUND,
232
+ lower: LOWER_FEE_BOUND, // Default lower fee bound
233
233
  upper: UPPER_FEE_BOUND, // Default upper fee bound
234
234
  },
235
235
  };
@@ -262,7 +262,7 @@ class Client extends xchainUtxo.Client {
262
262
  * @returns {Transaction} A promise that resolves to the built PSBT and the unspent transaction outputs (UTXOs) used in the transaction.
263
263
  * @deprecated This method is deprecated. Use the `transfer` method instead.
264
264
  */
265
- this.buildTx = ({ amount, recipient, memo, feeRate, sender, }) => __awaiter(this, void 0, void 0, function* () {
265
+ this.buildTx = (_a) => __awaiter(this, [_a], void 0, function* ({ amount, recipient, memo, feeRate, sender, }) {
266
266
  // Validate the recipient address
267
267
  if (!this.validateAddress(recipient))
268
268
  throw new Error('Invalid address');
@@ -370,8 +370,8 @@ class Client extends xchainUtxo.Client {
370
370
  * @param {TxParams & { sender: Address; feeRate: FeeRate; spendPendingUTXO?: boolean }} params The transfer options including sender address, fee rate, and optional flag for spending pending UTXOs.
371
371
  * @returns {Promise<PreparedTx>} A promise that resolves to the raw unsigned transaction (PSBT).
372
372
  */
373
- prepareTx({ sender, memo, amount, recipient, feeRate, }) {
374
- return __awaiter(this, void 0, void 0, function* () {
373
+ prepareTx(_a) {
374
+ return __awaiter(this, arguments, void 0, function* ({ sender, memo, amount, recipient, feeRate, }) {
375
375
  // Build the transaction (PSBT) with the specified transfer options
376
376
  const { psbt, utxos, inputs } = yield this.buildTx({
377
377
  sender,
@@ -492,8 +492,8 @@ class ClientKeystore extends Client {
492
492
  * @throws {"Phrase must be provided"} Thrown if phrase has not been set before.
493
493
  * @throws {"Address not defined"} Thrown if failed creating account from phrase.
494
494
  */
495
- getAddressAsync(index = 0) {
496
- return __awaiter(this, void 0, void 0, function* () {
495
+ getAddressAsync() {
496
+ return __awaiter(this, arguments, void 0, function* (index = 0) {
497
497
  return this.getAddress(index);
498
498
  });
499
499
  }
@@ -555,8 +555,8 @@ class ClientLedger extends Client {
555
555
  throw Error('Sync method not supported for Ledger');
556
556
  }
557
557
  // Get the current address asynchronously
558
- getAddressAsync(index = 0, verify = false) {
559
- return __awaiter(this, void 0, void 0, function* () {
558
+ getAddressAsync() {
559
+ return __awaiter(this, arguments, void 0, function* (index = 0, verify = false) {
560
560
  const app = yield this.getApp();
561
561
  const result = yield app.getWalletPublicKey(this.getFullDerivationPath(index), {
562
562
  format: 'legacy',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-doge",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Custom Doge client and utilities used by XChain 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",