opnet 1.2.16 → 1.2.17
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/browser/transactions/Transaction.d.ts +1 -0
- package/browser/transactions/interfaces/ITransaction.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/contracts/CallResult.js +4 -2
- package/build/transactions/Transaction.d.ts +1 -0
- package/build/transactions/Transaction.js +2 -0
- package/build/transactions/interfaces/ITransaction.d.ts +1 -0
- package/package.json +2 -2
- package/src/_version.ts +1 -1
- package/src/contracts/CallResult.ts +4 -2
- package/src/transactions/Transaction.ts +6 -0
- package/src/transactions/interfaces/ITransaction.ts +5 -0
|
@@ -11,6 +11,7 @@ export declare abstract class TransactionBase<T extends OPNetTransactionTypes> e
|
|
|
11
11
|
readonly hash: string;
|
|
12
12
|
readonly index: number;
|
|
13
13
|
readonly burnedBitcoin: BigNumberish;
|
|
14
|
+
readonly priorityFee: BigNumberish;
|
|
14
15
|
readonly inputs: TransactionInput[];
|
|
15
16
|
readonly outputs: TransactionOutput[];
|
|
16
17
|
readonly OPNetType: T;
|
|
@@ -11,6 +11,7 @@ export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITran
|
|
|
11
11
|
readonly hash: string;
|
|
12
12
|
readonly index: number;
|
|
13
13
|
readonly burnedBitcoin: string | BigNumberish;
|
|
14
|
+
readonly priorityFee: string | BigNumberish;
|
|
14
15
|
readonly revert?: string | Buffer;
|
|
15
16
|
readonly inputs: ITransactionInput[] | TransactionInput[];
|
|
16
17
|
readonly outputs: ITransactionOutput[] | TransactionOutput[];
|
package/build/_version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.2.
|
|
1
|
+
export declare const version = "1.2.17";
|
package/build/_version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
1
|
+
export const version = '1.2.17';
|
|
@@ -41,16 +41,18 @@ 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 priorityFee =
|
|
44
|
+
const priorityFee = interactionParams.priorityFee || 0n;
|
|
45
|
+
const totalFee = this.estimatedSatGas + priorityFee;
|
|
45
46
|
try {
|
|
46
47
|
const UTXOs = interactionParams.utxos ||
|
|
47
|
-
(await this.#fetchUTXOs(
|
|
48
|
+
(await this.#fetchUTXOs(totalFee + interactionParams.maximumAllowedSatToSpend, interactionParams));
|
|
48
49
|
if (!UTXOs || UTXOs.length === 0) {
|
|
49
50
|
throw new Error('No UTXOs found');
|
|
50
51
|
}
|
|
51
52
|
const params = {
|
|
52
53
|
calldata: this.calldata,
|
|
53
54
|
priorityFee: priorityFee,
|
|
55
|
+
gasSatFee: this.estimatedSatGas,
|
|
54
56
|
feeRate: interactionParams.feeRate || 10,
|
|
55
57
|
from: interactionParams.refundTo,
|
|
56
58
|
signer: interactionParams.signer,
|
|
@@ -11,6 +11,7 @@ export declare abstract class TransactionBase<T extends OPNetTransactionTypes> e
|
|
|
11
11
|
readonly hash: string;
|
|
12
12
|
readonly index: number;
|
|
13
13
|
readonly burnedBitcoin: BigNumberish;
|
|
14
|
+
readonly priorityFee: BigNumberish;
|
|
14
15
|
readonly inputs: TransactionInput[];
|
|
15
16
|
readonly outputs: TransactionOutput[];
|
|
16
17
|
readonly OPNetType: T;
|
|
@@ -6,6 +6,7 @@ export class TransactionBase extends TransactionReceipt {
|
|
|
6
6
|
hash;
|
|
7
7
|
index;
|
|
8
8
|
burnedBitcoin;
|
|
9
|
+
priorityFee;
|
|
9
10
|
inputs;
|
|
10
11
|
outputs;
|
|
11
12
|
OPNetType;
|
|
@@ -22,6 +23,7 @@ export class TransactionBase extends TransactionReceipt {
|
|
|
22
23
|
this.hash = transaction.hash;
|
|
23
24
|
this.index = transaction.index;
|
|
24
25
|
this.burnedBitcoin = BigInt(transaction.burnedBitcoin) || 0n;
|
|
26
|
+
this.priorityFee = BigInt(transaction.priorityFee) || 0n;
|
|
25
27
|
this.inputs = transaction.inputs.map((input) => new TransactionInput(input));
|
|
26
28
|
this.outputs = transaction.outputs.map((output) => new TransactionOutput(output));
|
|
27
29
|
this.OPNetType = transaction.OPNetType;
|
|
@@ -11,6 +11,7 @@ export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITran
|
|
|
11
11
|
readonly hash: string;
|
|
12
12
|
readonly index: number;
|
|
13
13
|
readonly burnedBitcoin: string | BigNumberish;
|
|
14
|
+
readonly priorityFee: string | BigNumberish;
|
|
14
15
|
readonly revert?: string | Buffer;
|
|
15
16
|
readonly inputs: ITransactionInput[] | TransactionInput[];
|
|
16
17
|
readonly outputs: ITransactionOutput[] | TransactionOutput[];
|
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.17",
|
|
5
5
|
"author": "OP_NET",
|
|
6
6
|
"description": "The perfect library for building Bitcoin-based applications.",
|
|
7
7
|
"engines": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@bitcoinerlab/secp256k1": "^1.2.0",
|
|
102
102
|
"@btc-vision/bitcoin": "^6.3.3",
|
|
103
103
|
"@btc-vision/bitcoin-rpc": "^1.0.0",
|
|
104
|
-
"@btc-vision/transaction": "^1.2.
|
|
104
|
+
"@btc-vision/transaction": "^1.2.7",
|
|
105
105
|
"@noble/hashes": "^1.7.0",
|
|
106
106
|
"bignumber.js": "^9.1.2",
|
|
107
107
|
"buffer": "^6.0.3",
|
package/src/_version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '1.2.
|
|
1
|
+
export const version = '1.2.17';
|
|
@@ -110,12 +110,13 @@ export class CallResult<
|
|
|
110
110
|
throw new Error(`Can not send transaction! Simulation reverted: ${this.revert}`);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
const priorityFee
|
|
113
|
+
const priorityFee = interactionParams.priorityFee || 0n;
|
|
114
|
+
const totalFee: bigint = this.estimatedSatGas + priorityFee;
|
|
114
115
|
try {
|
|
115
116
|
const UTXOs: UTXO[] =
|
|
116
117
|
interactionParams.utxos ||
|
|
117
118
|
(await this.#fetchUTXOs(
|
|
118
|
-
|
|
119
|
+
totalFee + interactionParams.maximumAllowedSatToSpend,
|
|
119
120
|
interactionParams,
|
|
120
121
|
));
|
|
121
122
|
|
|
@@ -126,6 +127,7 @@ export class CallResult<
|
|
|
126
127
|
const params: IInteractionParameters | InteractionParametersWithoutSigner = {
|
|
127
128
|
calldata: this.calldata,
|
|
128
129
|
priorityFee: priorityFee,
|
|
130
|
+
gasSatFee: this.estimatedSatGas,
|
|
129
131
|
feeRate: interactionParams.feeRate || 10,
|
|
130
132
|
from: interactionParams.refundTo,
|
|
131
133
|
signer: interactionParams.signer,
|
|
@@ -39,6 +39,11 @@ export abstract class TransactionBase<T extends OPNetTransactionTypes>
|
|
|
39
39
|
*/
|
|
40
40
|
public readonly burnedBitcoin: BigNumberish;
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* @description The priority fee of the transaction.
|
|
44
|
+
*/
|
|
45
|
+
public readonly priorityFee: BigNumberish;
|
|
46
|
+
|
|
42
47
|
/**
|
|
43
48
|
* @description The inputs of the transaction.
|
|
44
49
|
*/
|
|
@@ -80,6 +85,7 @@ export abstract class TransactionBase<T extends OPNetTransactionTypes>
|
|
|
80
85
|
this.index = transaction.index;
|
|
81
86
|
|
|
82
87
|
this.burnedBitcoin = BigInt(transaction.burnedBitcoin) || 0n;
|
|
88
|
+
this.priorityFee = BigInt(transaction.priorityFee) || 0n;
|
|
83
89
|
|
|
84
90
|
this.inputs = transaction.inputs.map((input) => new TransactionInput(input));
|
|
85
91
|
this.outputs = transaction.outputs.map(
|
|
@@ -34,6 +34,11 @@ export interface ITransactionBase<T extends OPNetTransactionTypes> extends ITran
|
|
|
34
34
|
*/
|
|
35
35
|
readonly burnedBitcoin: string | BigNumberish;
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* @description The priority fee of the transaction.
|
|
39
|
+
*/
|
|
40
|
+
readonly priorityFee: string | BigNumberish;
|
|
41
|
+
|
|
37
42
|
/**
|
|
38
43
|
* @description If the transaction was reverted, this field will contain the revert message.
|
|
39
44
|
*/
|