opnet 1.2.19 → 1.2.20

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.
@@ -1 +1 @@
1
- export declare const version = "1.2.19";
1
+ export declare const version = "1.2.20";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.2.19';
1
+ export const version = '1.2.20';
@@ -41,11 +41,13 @@ export class CallResult {
41
41
  if (this.revert) {
42
42
  throw new Error(`Can not send transaction! Simulation reverted: ${this.revert}`);
43
43
  }
44
+ const addedOutputs = interactionParams.extraOutputs || [];
45
+ const totalAmount = BigInt(addedOutputs.reduce((acc, output) => acc + output.value, 0));
44
46
  const priorityFee = interactionParams.priorityFee || 0n;
45
47
  const totalFee = this.estimatedSatGas + priorityFee;
46
48
  try {
47
49
  const UTXOs = interactionParams.utxos ||
48
- (await this.#fetchUTXOs(totalFee + interactionParams.maximumAllowedSatToSpend, interactionParams));
50
+ (await this.#fetchUTXOs(totalFee + interactionParams.maximumAllowedSatToSpend + totalAmount, interactionParams));
49
51
  if (!UTXOs || UTXOs.length === 0) {
50
52
  throw new Error('No UTXOs found');
51
53
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opnet",
3
3
  "type": "module",
4
- "version": "1.2.19",
4
+ "version": "1.2.20",
5
5
  "author": "OP_NET",
6
6
  "description": "The perfect library for building Bitcoin-based applications.",
7
7
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.2.19';
1
+ export const version = '1.2.20';
@@ -110,13 +110,16 @@ export class CallResult<
110
110
  throw new Error(`Can not send transaction! Simulation reverted: ${this.revert}`);
111
111
  }
112
112
 
113
+ const addedOutputs = interactionParams.extraOutputs || [];
114
+ const totalAmount = BigInt(addedOutputs.reduce((acc, output) => acc + output.value, 0));
115
+
113
116
  const priorityFee = interactionParams.priorityFee || 0n;
114
117
  const totalFee: bigint = this.estimatedSatGas + priorityFee;
115
118
  try {
116
119
  const UTXOs: UTXO[] =
117
120
  interactionParams.utxos ||
118
121
  (await this.#fetchUTXOs(
119
- totalFee + interactionParams.maximumAllowedSatToSpend,
122
+ totalFee + interactionParams.maximumAllowedSatToSpend + totalAmount,
120
123
  interactionParams,
121
124
  ));
122
125