opnet 1.2.18 → 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.
- package/browser/_version.d.ts +1 -1
- package/browser/index.js +1 -1
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/contracts/CallResult.js +3 -1
- package/package.json +3 -3
- package/src/_version.ts +1 -1
- package/src/contracts/CallResult.ts +4 -1
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.20";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
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.
|
|
4
|
+
"version": "1.2.20",
|
|
5
5
|
"author": "OP_NET",
|
|
6
6
|
"description": "The perfect library for building Bitcoin-based applications.",
|
|
7
7
|
"engines": {
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
},
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
103
|
-
"@btc-vision/bitcoin": "^6.3.
|
|
103
|
+
"@btc-vision/bitcoin": "^6.3.4",
|
|
104
104
|
"@btc-vision/bitcoin-rpc": "^1.0.0",
|
|
105
|
-
"@btc-vision/transaction": "^1.2.
|
|
105
|
+
"@btc-vision/transaction": "^1.2.8",
|
|
106
106
|
"@noble/hashes": "^1.7.0",
|
|
107
107
|
"bignumber.js": "^9.1.2",
|
|
108
108
|
"buffer": "^6.0.3",
|
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
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
|
|