@xchainjs/xchain-dash 2.0.3 → 2.0.5

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,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  import { AssetInfo, FeeRate, TxHistoryParams } from '@xchainjs/xchain-client';
3
4
  import { Address } from '@xchainjs/xchain-util';
4
5
  import { Balance, Client as UTXOClient, Tx, TxParams, TxsPage, UTXO, UtxoClientParams } from '@xchainjs/xchain-utxo';
package/lib/index.esm.js CHANGED
@@ -2,6 +2,7 @@ import { ExplorerProvider, Network, TxType, FeeOption, checkFeeBounds } from '@x
2
2
  import { AssetType, baseAmount, assetToBase, assetAmount } from '@xchainjs/xchain-util';
3
3
  import { BlockcypherProvider, BlockcypherNetwork, BitgoProvider } from '@xchainjs/xchain-utxo-providers';
4
4
  import * as dashcore from '@dashevo/dashcore-lib';
5
+ import dashcore__default from '@dashevo/dashcore-lib';
5
6
  import { toBitcoinJS, Client as Client$1 } from '@xchainjs/xchain-utxo';
6
7
  import * as Dash from 'bitcoinjs-lib';
7
8
  import accumulative from 'coinselect/accumulative';
@@ -1426,12 +1427,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1426
1427
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1427
1428
 
1428
1429
  var utils = /*#__PURE__*/Object.freeze({
1429
- __proto__: null,
1430
- hasBrowserEnv: hasBrowserEnv,
1431
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1432
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1433
- navigator: _navigator,
1434
- origin: origin
1430
+ __proto__: null,
1431
+ hasBrowserEnv: hasBrowserEnv,
1432
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1433
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1434
+ navigator: _navigator,
1435
+ origin: origin
1435
1436
  });
1436
1437
 
1437
1438
  var platform = {
@@ -3900,7 +3901,7 @@ const TX_MIN_FEE = 1000;
3900
3901
  /**
3901
3902
  * Threshold value for dust amount in Dash transactions.
3902
3903
  */
3903
- dashcore.Transaction.DUST_AMOUNT;
3904
+ dashcore__default.Transaction.DUST_AMOUNT;
3904
3905
  /**
3905
3906
  * Function to determine the Dash network based on the provided network type.
3906
3907
  * @param {Network} network The network type (Mainnet, Testnet, or Stagenet).
@@ -3964,7 +3965,7 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
3964
3965
  if (!inputs || !outputs)
3965
3966
  throw new Error('Insufficient balance for transaction');
3966
3967
  // Initialize new Dash transaction
3967
- const tx = new dashcore.Transaction().to(recipient, amount.amount().toNumber());
3968
+ const tx = new dashcore__default.Transaction().to(recipient, amount.amount().toNumber());
3968
3969
  // Add inputs to the transaction
3969
3970
  inputs.forEach((utxo) => {
3970
3971
  const insightUtxo = insightUtxos.find((x) => x.txid === utxo.hash && x.vout == utxo.index);
@@ -3972,12 +3973,12 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
3972
3973
  throw new Error('Unable to match accumulative inputs with insight UTXOs');
3973
3974
  }
3974
3975
  const scriptBuffer = Buffer.from(insightUtxo.scriptPubKey, 'hex');
3975
- const script = new dashcore.Script(scriptBuffer);
3976
- const input = new dashcore.Transaction.Input.PublicKeyHash({
3976
+ const script = new dashcore__default.Script(scriptBuffer);
3977
+ const input = new dashcore__default.Transaction.Input.PublicKeyHash({
3977
3978
  prevTxId: Buffer.from(insightUtxo.txid, 'hex'),
3978
3979
  outputIndex: insightUtxo.vout,
3979
3980
  script: '',
3980
- output: new dashcore.Transaction.Output({
3981
+ output: new dashcore__default.Transaction.Output({
3981
3982
  satoshis: utxo.value,
3982
3983
  script,
3983
3984
  }),
@@ -3985,7 +3986,7 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
3985
3986
  tx.uncheckedAddInput(input);
3986
3987
  });
3987
3988
  // Define sender address
3988
- const senderAddress = dashcore.Address.fromString(sender, network);
3989
+ const senderAddress = dashcore__default.Address.fromString(sender, network);
3989
3990
  tx.change(senderAddress);
3990
3991
  // Add memo to the transaction if provided
3991
3992
  if (memo) {
package/lib/index.js CHANGED
@@ -16,21 +16,21 @@ var AppBtc = require('@ledgerhq/hw-app-btc');
16
16
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
17
 
18
18
  function _interopNamespace(e) {
19
- if (e && e.__esModule) return e;
20
- var n = Object.create(null);
21
- if (e) {
22
- Object.keys(e).forEach(function (k) {
23
- if (k !== 'default') {
24
- var d = Object.getOwnPropertyDescriptor(e, k);
25
- Object.defineProperty(n, k, d.get ? d : {
26
- enumerable: true,
27
- get: function () { return e[k]; }
19
+ if (e && e.__esModule) return e;
20
+ var n = Object.create(null);
21
+ if (e) {
22
+ Object.keys(e).forEach(function (k) {
23
+ if (k !== 'default') {
24
+ var d = Object.getOwnPropertyDescriptor(e, k);
25
+ Object.defineProperty(n, k, d.get ? d : {
26
+ enumerable: true,
27
+ get: function () { return e[k]; }
28
+ });
29
+ }
28
30
  });
29
- }
30
- });
31
- }
32
- n.default = e;
33
- return Object.freeze(n);
31
+ }
32
+ n.default = e;
33
+ return Object.freeze(n);
34
34
  }
35
35
 
36
36
  var dashcore__namespace = /*#__PURE__*/_interopNamespace(dashcore);
@@ -1454,12 +1454,12 @@ const hasStandardBrowserWebWorkerEnv = (() => {
1454
1454
  const origin = hasBrowserEnv && window.location.href || 'http://localhost';
1455
1455
 
1456
1456
  var utils = /*#__PURE__*/Object.freeze({
1457
- __proto__: null,
1458
- hasBrowserEnv: hasBrowserEnv,
1459
- hasStandardBrowserEnv: hasStandardBrowserEnv,
1460
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1461
- navigator: _navigator,
1462
- origin: origin
1457
+ __proto__: null,
1458
+ hasBrowserEnv: hasBrowserEnv,
1459
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
1460
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
1461
+ navigator: _navigator,
1462
+ origin: origin
1463
1463
  });
1464
1464
 
1465
1465
  var platform = {
@@ -3928,7 +3928,7 @@ const TX_MIN_FEE = 1000;
3928
3928
  /**
3929
3929
  * Threshold value for dust amount in Dash transactions.
3930
3930
  */
3931
- dashcore__namespace.Transaction.DUST_AMOUNT;
3931
+ dashcore__namespace.default.Transaction.DUST_AMOUNT;
3932
3932
  /**
3933
3933
  * Function to determine the Dash network based on the provided network type.
3934
3934
  * @param {Network} network The network type (Mainnet, Testnet, or Stagenet).
@@ -3992,7 +3992,7 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
3992
3992
  if (!inputs || !outputs)
3993
3993
  throw new Error('Insufficient balance for transaction');
3994
3994
  // Initialize new Dash transaction
3995
- const tx = new dashcore__namespace.Transaction().to(recipient, amount.amount().toNumber());
3995
+ const tx = new dashcore__namespace.default.Transaction().to(recipient, amount.amount().toNumber());
3996
3996
  // Add inputs to the transaction
3997
3997
  inputs.forEach((utxo) => {
3998
3998
  const insightUtxo = insightUtxos.find((x) => x.txid === utxo.hash && x.vout == utxo.index);
@@ -4000,12 +4000,12 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
4000
4000
  throw new Error('Unable to match accumulative inputs with insight UTXOs');
4001
4001
  }
4002
4002
  const scriptBuffer = Buffer.from(insightUtxo.scriptPubKey, 'hex');
4003
- const script = new dashcore__namespace.Script(scriptBuffer);
4004
- const input = new dashcore__namespace.Transaction.Input.PublicKeyHash({
4003
+ const script = new dashcore__namespace.default.Script(scriptBuffer);
4004
+ const input = new dashcore__namespace.default.Transaction.Input.PublicKeyHash({
4005
4005
  prevTxId: Buffer.from(insightUtxo.txid, 'hex'),
4006
4006
  outputIndex: insightUtxo.vout,
4007
4007
  script: '',
4008
- output: new dashcore__namespace.Transaction.Output({
4008
+ output: new dashcore__namespace.default.Transaction.Output({
4009
4009
  satoshis: utxo.value,
4010
4010
  script,
4011
4011
  }),
@@ -4013,7 +4013,7 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
4013
4013
  tx.uncheckedAddInput(input);
4014
4014
  });
4015
4015
  // Define sender address
4016
- const senderAddress = dashcore__namespace.Address.fromString(sender, network);
4016
+ const senderAddress = dashcore__namespace.default.Address.fromString(sender, network);
4017
4017
  tx.change(senderAddress);
4018
4018
  // Add memo to the transaction if provided
4019
4019
  if (memo) {
@@ -1 +1 @@
1
- export { DashPreparedTx, NodeAuth, NodeUrls } from './client-types';
1
+ export type { DashPreparedTx, NodeAuth, NodeUrls } from './client-types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-dash",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "Custom Dash client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "XChain",
@@ -28,29 +28,28 @@
28
28
  "build": "yarn clean && rollup -c --bundleConfigAsCjs",
29
29
  "build:release": "yarn exec rm -rf release && yarn pack && yarn exec \"mkdir release && tar zxvf package.tgz --directory release && rm package.tgz\"",
30
30
  "test": "jest",
31
- "e2e": "jest --config jest.config.e2e.js",
31
+ "e2e": "jest --config jest.config.e2e.mjs",
32
32
  "lint": "eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0",
33
33
  "postversion": "git push --follow-tags"
34
34
  },
35
35
  "dependencies": {
36
36
  "@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
37
37
  "@dashevo/dashcore-lib": "^0.25.0",
38
- "@ledgerhq/hw-app-btc": "10.9.0",
38
+ "@ledgerhq/hw-app-btc": "^10.9.0",
39
39
  "@scure/bip32": "^1.7.0",
40
- "@xchainjs/xchain-client": "2.0.3",
41
- "@xchainjs/xchain-crypto": "1.0.1",
42
- "@xchainjs/xchain-util": "2.0.2",
43
- "@xchainjs/xchain-utxo": "2.0.3",
44
- "@xchainjs/xchain-utxo-providers": "2.0.3",
40
+ "@xchainjs/xchain-client": "2.0.5",
41
+ "@xchainjs/xchain-crypto": "1.0.3",
42
+ "@xchainjs/xchain-util": "2.0.3",
43
+ "@xchainjs/xchain-utxo": "2.0.5",
44
+ "@xchainjs/xchain-utxo-providers": "2.0.5",
45
45
  "bitcoinjs-lib": "^6.1.7",
46
46
  "coinselect": "3.1.12",
47
47
  "ecpair": "2.1.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@ledgerhq/hw-transport-node-hid": "6.28.6",
51
- "@types/bitcoinjs-lib": "^5.0.4",
52
- "axios": "1.8.4",
53
- "axios-mock-adapter": "2.1.0"
50
+ "@ledgerhq/hw-transport-node-hid": "^6.28.6",
51
+ "axios": "^1.8.4",
52
+ "axios-mock-adapter": "^2.1.0"
54
53
  },
55
54
  "publishConfig": {
56
55
  "access": "public",