@xchainjs/xchain-dash 1.0.7 → 1.0.8

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/index.esm.js CHANGED
@@ -4131,7 +4131,7 @@ const buildTx = ({ amount, recipient, memo, feeRate, sender, network, }) => __aw
4131
4131
  if (memo) {
4132
4132
  tx.addData(memo);
4133
4133
  }
4134
- return { tx, utxos }; // Return the built transaction and its UTXOs
4134
+ return { tx, utxos, inputs }; // Return the built transaction and its UTXOs
4135
4135
  });
4136
4136
  /**
4137
4137
  * Function to get the prefix for a given network.
@@ -4328,7 +4328,7 @@ class Client extends Client$1 {
4328
4328
  prepareTx({ sender, memo, amount, recipient, feeRate, }) {
4329
4329
  return __awaiter(this, void 0, void 0, function* () {
4330
4330
  // Build the transaction using provided parameters
4331
- const { tx, utxos } = yield buildTx({
4331
+ const { tx, utxos, inputs } = yield buildTx({
4332
4332
  sender,
4333
4333
  recipient,
4334
4334
  memo,
@@ -4337,7 +4337,7 @@ class Client extends Client$1 {
4337
4337
  network: this.network,
4338
4338
  });
4339
4339
  // Return the raw unsigned transaction and UTXOs
4340
- return { rawUnsignedTx: tx.toString(), utxos };
4340
+ return { rawUnsignedTx: tx.toString(), utxos, inputs };
4341
4341
  });
4342
4342
  }
4343
4343
  /**
@@ -4559,16 +4559,17 @@ class ClientLedger extends Client {
4559
4559
  const fromAddressIndex = (params === null || params === void 0 ? void 0 : params.walletIndex) || 0;
4560
4560
  // Get fee rate
4561
4561
  const feeRate = params.feeRate || (yield this.getFeeRates())[FeeOption.Fast];
4562
+ checkFeeBounds(this.feeBounds, feeRate);
4562
4563
  // Get sender address
4563
4564
  const sender = yield this.getAddressAsync(fromAddressIndex);
4564
4565
  // Prepare transaction
4565
- const { rawUnsignedTx, utxos } = yield this.prepareTx(Object.assign(Object.assign({}, params), { sender, feeRate }));
4566
+ const { rawUnsignedTx, inputs } = yield this.prepareTx(Object.assign(Object.assign({}, params), { sender, feeRate }));
4566
4567
  const tx = new dashcore.Transaction(rawUnsignedTx);
4567
4568
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4568
4569
  const ledgerInputs = [];
4569
4570
  for (const input of tx.inputs) {
4570
4571
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4571
- const insightUtxo = utxos.find((utxo) => {
4572
+ const insightUtxo = inputs.find((utxo) => {
4572
4573
  return utxo.hash === input.prevTxId.toString('hex') && utxo.index == input.outputIndex;
4573
4574
  });
4574
4575
  if (!insightUtxo) {