@btc-vision/transaction 1.3.5 → 1.3.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/browser/_version.d.ts +1 -1
- package/browser/buffer/BinaryReader.d.ts +2 -0
- package/browser/generators/Features.d.ts +9 -4
- package/browser/generators/Generator.d.ts +5 -2
- package/browser/generators/builders/CalldataGenerator.d.ts +2 -2
- package/browser/generators/builders/LegacyCalldataGenerator.d.ts +2 -2
- package/browser/index.js +1 -1
- package/browser/transaction/builders/InteractionTransaction.d.ts +1 -0
- package/browser/transaction/interfaces/ITransactionParameters.d.ts +4 -0
- package/build/_version.d.ts +1 -1
- package/build/_version.js +1 -1
- package/build/buffer/BinaryReader.d.ts +2 -0
- package/build/buffer/BinaryReader.js +6 -0
- package/build/generators/Features.d.ts +9 -4
- package/build/generators/Features.js +1 -5
- package/build/generators/Generator.d.ts +5 -2
- package/build/generators/Generator.js +40 -5
- package/build/generators/builders/CalldataGenerator.d.ts +2 -2
- package/build/generators/builders/CalldataGenerator.js +10 -4
- package/build/generators/builders/DeploymentGenerator.js +13 -2
- package/build/generators/builders/LegacyCalldataGenerator.d.ts +2 -2
- package/build/generators/builders/LegacyCalldataGenerator.js +10 -4
- package/build/transaction/builders/InteractionTransaction.d.ts +1 -0
- package/build/transaction/builders/InteractionTransaction.js +12 -1
- package/build/transaction/interfaces/ITransactionParameters.d.ts +4 -0
- package/eslint.config.js +1 -0
- package/package.json +1 -1
- package/src/_version.ts +1 -1
- package/src/buffer/BinaryReader.ts +8 -0
- package/src/generators/Features.ts +10 -5
- package/src/generators/Generator.ts +54 -5
- package/src/generators/builders/CalldataGenerator.ts +16 -9
- package/src/generators/builders/DeploymentGenerator.ts +17 -1
- package/src/generators/builders/LegacyCalldataGenerator.ts +14 -6
- package/src/transaction/builders/InteractionTransaction.ts +15 -0
- package/src/transaction/interfaces/ITransactionParameters.ts +7 -1
|
@@ -3,6 +3,7 @@ import { TransactionType } from '../enums/TransactionType.js';
|
|
|
3
3
|
import { TapLeafScript } from '../interfaces/Tap.js';
|
|
4
4
|
import { IInteractionParameters } from '../interfaces/ITransactionParameters.js';
|
|
5
5
|
import { SharedInteractionTransaction } from './SharedInteractionTransaction.js';
|
|
6
|
+
import { Feature, Features } from '../../generators/Features.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Class for interaction transactions
|
|
@@ -32,9 +33,23 @@ export class InteractionTransaction extends SharedInteractionTransaction<Transac
|
|
|
32
33
|
this.contractSecret,
|
|
33
34
|
this.preimage,
|
|
34
35
|
this.priorityFee,
|
|
36
|
+
this.generateFeatures(parameters),
|
|
35
37
|
);
|
|
36
38
|
|
|
37
39
|
this.scriptTree = this.getScriptTree();
|
|
38
40
|
this.internalInit();
|
|
39
41
|
}
|
|
42
|
+
|
|
43
|
+
private generateFeatures(parameters: IInteractionParameters): Feature<Features>[] {
|
|
44
|
+
const features: Feature<Features>[] = [];
|
|
45
|
+
|
|
46
|
+
if (parameters.loadedStorage) {
|
|
47
|
+
features.push({
|
|
48
|
+
opcode: Features.ACCESS_LIST,
|
|
49
|
+
data: parameters.loadedStorage,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return features;
|
|
54
|
+
}
|
|
40
55
|
}
|
|
@@ -3,6 +3,10 @@ import { ITweakedTransactionData } from '../shared/TweakedTransaction.js';
|
|
|
3
3
|
import { ChainId } from '../../network/ChainId.js';
|
|
4
4
|
import { PsbtOutputExtended } from '@btc-vision/bitcoin';
|
|
5
5
|
|
|
6
|
+
export interface LoadedStorage {
|
|
7
|
+
[key: string]: string[];
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
export interface ITransactionParameters extends ITweakedTransactionData {
|
|
7
11
|
readonly from?: string;
|
|
8
12
|
readonly to?: string;
|
|
@@ -11,7 +15,7 @@ export interface ITransactionParameters extends ITweakedTransactionData {
|
|
|
11
15
|
|
|
12
16
|
nonWitnessUtxo?: Buffer;
|
|
13
17
|
estimatedFees?: bigint;
|
|
14
|
-
|
|
18
|
+
|
|
15
19
|
optionalInputs?: UTXO[];
|
|
16
20
|
optionalOutputs?: PsbtOutputExtended[];
|
|
17
21
|
|
|
@@ -40,6 +44,8 @@ export interface SharedInteractionParameters extends ITransactionParameters {
|
|
|
40
44
|
|
|
41
45
|
readonly preimage: Buffer;
|
|
42
46
|
readonly randomBytes?: Buffer;
|
|
47
|
+
|
|
48
|
+
readonly loadedStorage?: LoadedStorage;
|
|
43
49
|
}
|
|
44
50
|
|
|
45
51
|
export interface IInteractionParameters extends SharedInteractionParameters {
|