@btc-vision/transaction 1.0.78 → 1.0.80

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.
@@ -4,12 +4,14 @@ import { Address } from '@btc-vision/bsi-binary';
4
4
  import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
5
5
  import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
6
6
  import { VaultUTXOs } from '../processor/PsbtTransaction.js';
7
+ import { ChainId } from '../../network/ChainId.js';
7
8
  export interface ITransactionParameters extends ITweakedTransactionData {
8
9
  readonly from?: Address;
9
10
  readonly to?: Address | undefined;
10
11
  utxos: UTXO[];
11
12
  nonWitnessUtxo?: Buffer | undefined;
12
13
  estimatedFees?: bigint;
14
+ chainId?: ChainId;
13
15
  readonly feeRate: number;
14
16
  readonly priorityFee: bigint;
15
17
  }
@@ -26,7 +28,7 @@ export interface IInteractionParameters extends SharedInteractionParameters {
26
28
  readonly to: Address;
27
29
  }
28
30
  export interface IWrapParameters extends SharedInteractionParameters {
29
- readonly to?: undefined | Address;
31
+ readonly to?: Address;
30
32
  readonly from: Address;
31
33
  readonly amount: bigint;
32
34
  readonly receiver?: Address;
@@ -1 +1 @@
1
- export declare const version = "1.0.78";
1
+ export declare const version = "1.0.80";
package/build/_version.js CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.78';
1
+ export const version = '1.0.80';
@@ -26,7 +26,7 @@ export class UnwrapSegwitTransaction extends SharedInteractionTransaction {
26
26
  parameters.disableAutoRefund = true;
27
27
  parameters.calldata = UnwrapSegwitTransaction.generateBurnCalldata(parameters.amount);
28
28
  super(parameters);
29
- this.wbtc = new wBTC(parameters.network);
29
+ this.wbtc = new wBTC(parameters.network, parameters.chainId);
30
30
  this.to = this.wbtc.getAddress();
31
31
  this.vaultUTXOs = parameters.unwrapUTXOs;
32
32
  this.amount = parameters.amount;
@@ -34,7 +34,7 @@ export class UnwrapTransaction extends SharedInteractionTransaction {
34
34
  parameters.disableAutoRefund = true;
35
35
  parameters.calldata = UnwrapTransaction.generateBurnCalldata(parameters.amount);
36
36
  super(parameters);
37
- this.wbtc = new wBTC(parameters.network);
37
+ this.wbtc = new wBTC(parameters.network, parameters.chainId);
38
38
  this.to = this.wbtc.getAddress();
39
39
  this.vaultUTXOs = parameters.unwrapUTXOs;
40
40
  this.estimatedFeeLoss = UnwrapTransaction.preEstimateTaprootTransactionFees(BigInt(this.feeRate), this.calculateNumInputs(this.vaultUTXOs), 2n, this.calculateNumSignatures(this.vaultUTXOs), 65n, this.calculateNumEmptyWitnesses(this.vaultUTXOs));
@@ -29,7 +29,7 @@ export class WrapTransaction extends SharedInteractionTransaction {
29
29
  TransactionBuilder.getFrom(parameters.from, parameters.signer, parameters.network);
30
30
  parameters.calldata = WrapTransaction.generateMintCalldata(parameters.amount, receiver, parameters.network);
31
31
  super(parameters);
32
- this.wbtc = new wBTC(parameters.network);
32
+ this.wbtc = new wBTC(parameters.network, parameters.chainId);
33
33
  this.vault = parameters.generationParameters.vault;
34
34
  this.to = this.wbtc.getAddress();
35
35
  this.receiver = receiver;
@@ -4,12 +4,14 @@ import { Address } from '@btc-vision/bsi-binary';
4
4
  import { WrappedGeneration } from '../../wbtc/WrappedGenerationParameters.js';
5
5
  import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
6
6
  import { VaultUTXOs } from '../processor/PsbtTransaction.js';
7
+ import { ChainId } from '../../network/ChainId.js';
7
8
  export interface ITransactionParameters extends ITweakedTransactionData {
8
9
  readonly from?: Address;
9
10
  readonly to?: Address | undefined;
10
11
  utxos: UTXO[];
11
12
  nonWitnessUtxo?: Buffer | undefined;
12
13
  estimatedFees?: bigint;
14
+ chainId?: ChainId;
13
15
  readonly feeRate: number;
14
16
  readonly priorityFee: bigint;
15
17
  }
@@ -26,7 +28,7 @@ export interface IInteractionParameters extends SharedInteractionParameters {
26
28
  readonly to: Address;
27
29
  }
28
30
  export interface IWrapParameters extends SharedInteractionParameters {
29
- readonly to?: undefined | Address;
31
+ readonly to?: Address;
30
32
  readonly from: Address;
31
33
  readonly amount: bigint;
32
34
  readonly receiver?: Address;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "version": "1.0.78",
3
+ "version": "1.0.80",
4
4
  "author": "BlobMaster41",
5
5
  "description": "OPNet transaction library allows you to create and sign transactions for the OPNet network.",
6
6
  "engines": {
package/src/_version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '1.0.78';
1
+ export const version = '1.0.80';