@btc-vision/transaction 1.2.6 → 1.2.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/README.md +4 -19
- package/browser/_version.d.ts +1 -1
- package/browser/generators/Generator.d.ts +1 -0
- package/browser/generators/builders/CalldataGenerator.d.ts +1 -1
- package/browser/generators/builders/DeploymentGenerator.d.ts +1 -1
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
- package/browser/index.js +1 -1
- package/browser/transaction/builders/MultiSignTransaction.d.ts +1 -1
- package/browser/transaction/builders/TransactionBuilder.d.ts +1 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +1 -0
- package/browser/verification/TapscriptVerificator.d.ts +1 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/generators/Generator.d.ts +1 -0
- package/build/generators/Generator.js +7 -0
- package/build/generators/builders/CalldataGenerator.d.ts +1 -1
- package/build/generators/builders/CalldataGenerator.js +2 -2
- package/build/generators/builders/DeploymentGenerator.d.ts +1 -1
- package/build/generators/builders/DeploymentGenerator.js +4 -4
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +1 -1
- package/build/generators/builders/LegacyCalldataGenerator.js +5 -23
- package/build/transaction/TransactionFactory.js +3 -2
- package/build/transaction/builders/DeploymentTransaction.js +1 -1
- package/build/transaction/builders/InteractionTransaction.js +1 -1
- package/build/transaction/builders/MultiSignTransaction.d.ts +1 -1
- package/build/transaction/builders/MultiSignTransaction.js +1 -0
- package/build/transaction/builders/SharedInteractionTransaction.js +3 -0
- package/build/transaction/builders/TransactionBuilder.d.ts +1 -0
- package/build/transaction/builders/TransactionBuilder.js +5 -2
- package/build/transaction/interfaces/ITransactionParameters.d.ts +1 -0
- package/build/utxo/OPNetLimitedProvider.js +2 -1
- package/build/verification/TapscriptVerificator.d.ts +1 -0
- package/build/verification/TapscriptVerificator.js +2 -2
- package/package.json +3 -3
- package/src/_version.ts +1 -1
- package/src/generators/Generator.ts +9 -0
- package/src/generators/builders/CalldataGenerator.ts +4 -1
- package/src/generators/builders/DeploymentGenerator.ts +6 -3
- package/src/generators/builders/LegacyCalldataGenerator.ts +11 -40
- package/src/transaction/TransactionFactory.ts +3 -2
- package/src/transaction/browser/extensions/UnisatSigner.ts +1 -1
- package/src/transaction/builders/DeploymentTransaction.ts +1 -0
- package/src/transaction/builders/InteractionTransaction.ts +1 -0
- package/src/transaction/builders/MultiSignTransaction.ts +2 -1
- package/src/transaction/builders/SharedInteractionTransaction.ts +4 -0
- package/src/transaction/builders/TransactionBuilder.ts +6 -2
- package/src/transaction/interfaces/ITransactionParameters.ts +1 -0
- package/src/utxo/OPNetLimitedProvider.ts +2 -1
- package/src/verification/TapscriptVerificator.ts +3 -0
|
@@ -111,6 +111,7 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
111
111
|
* @description The opnet priority fee of the transaction
|
|
112
112
|
*/
|
|
113
113
|
protected priorityFee: bigint;
|
|
114
|
+
protected gasSatFee: bigint;
|
|
114
115
|
|
|
115
116
|
/**
|
|
116
117
|
* @description The utxos used in the transaction
|
|
@@ -151,6 +152,7 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
151
152
|
this.network = parameters.network;
|
|
152
153
|
this.feeRate = parameters.feeRate;
|
|
153
154
|
this.priorityFee = parameters.priorityFee ?? 0n;
|
|
155
|
+
this.gasSatFee = parameters.gasSatFee ?? 0n;
|
|
154
156
|
this.utxos = parameters.utxos;
|
|
155
157
|
this.to = parameters.to || undefined;
|
|
156
158
|
|
|
@@ -230,6 +232,7 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
230
232
|
network: this.network,
|
|
231
233
|
feeRate: this.feeRate,
|
|
232
234
|
priorityFee: this.priorityFee ?? 0n,
|
|
235
|
+
gasSatFee: this.gasSatFee ?? 0n,
|
|
233
236
|
from: this.from,
|
|
234
237
|
amount: this.estimatedFees,
|
|
235
238
|
optionalOutputs: this.optionalOutputs,
|
|
@@ -530,8 +533,9 @@ export abstract class TransactionBuilder<T extends TransactionType> extends Twea
|
|
|
530
533
|
* @returns {bigint}
|
|
531
534
|
*/
|
|
532
535
|
protected getTransactionOPNetFee(): bigint {
|
|
533
|
-
|
|
534
|
-
|
|
536
|
+
const totalFee = this.priorityFee + this.gasSatFee;
|
|
537
|
+
if (totalFee > TransactionBuilder.MINIMUM_DUST) {
|
|
538
|
+
return totalFee;
|
|
535
539
|
}
|
|
536
540
|
|
|
537
541
|
return TransactionBuilder.MINIMUM_DUST;
|
|
@@ -16,6 +16,7 @@ export interface ContractAddressVerificationParams {
|
|
|
16
16
|
readonly originalSalt: Buffer;
|
|
17
17
|
readonly bytecode: Buffer;
|
|
18
18
|
readonly preimage: Buffer;
|
|
19
|
+
readonly priorityFee: bigint;
|
|
19
20
|
readonly calldata?: Buffer;
|
|
20
21
|
readonly network?: Network;
|
|
21
22
|
}
|
|
@@ -37,6 +38,7 @@ export class TapscriptVerificator {
|
|
|
37
38
|
params.bytecode,
|
|
38
39
|
params.originalSalt,
|
|
39
40
|
params.preimage,
|
|
41
|
+
params.priorityFee,
|
|
40
42
|
params.calldata,
|
|
41
43
|
);
|
|
42
44
|
|
|
@@ -69,6 +71,7 @@ export class TapscriptVerificator {
|
|
|
69
71
|
params.bytecode,
|
|
70
72
|
params.originalSalt,
|
|
71
73
|
params.preimage,
|
|
74
|
+
params.priorityFee,
|
|
72
75
|
params.calldata,
|
|
73
76
|
);
|
|
74
77
|
|