@stacks/clarinet-sdk-wasm 3.13.0 → 3.14.0

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/clarinet_sdk.d.ts CHANGED
@@ -1,247 +1,249 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- type IContractAST = {
4
- contract_identifier: any;
5
- pre_expressions: any[];
6
- expressions: Expression[];
7
- top_level_expression_sorting: number[];
8
- referenced_traits: Map<any, any>;
9
- implemented_traits: any[];
10
- };
3
+ export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4" | "Clarity5";
11
4
 
12
5
  export type EpochString =
13
- | "2.0"
14
- | "2.05"
15
- | "2.1"
16
- | "2.2"
17
- | "2.3"
18
- | "2.4"
19
- | "2.5"
20
- | "3.0"
21
- | "3.1"
22
- | "3.2"
23
- | "3.3";
6
+ | "2.0"
7
+ | "2.05"
8
+ | "2.1"
9
+ | "2.2"
10
+ | "2.3"
11
+ | "2.4"
12
+ | "2.5"
13
+ | "3.0"
14
+ | "3.1"
15
+ | "3.2"
16
+ | "3.3"
17
+ | "3.4";
24
18
 
25
19
 
26
- type Expression = {
27
- expr: ExpressionType;
28
- id: number;
29
- span: Span;
20
+ export type IContractInterface = {
21
+ functions: ContractInterfaceFunction[];
22
+ variables: ContractInterfaceVariable[];
23
+ maps: ContractInterfaceMap[];
24
+ fungible_tokens: ContractInterfaceFungibleTokens[];
25
+ non_fungible_tokens: ContractInterfaceNonFungibleTokens[];
26
+ epoch: StacksEpochId;
27
+ clarity_version: ClarityVersionString;
30
28
  };
31
29
 
32
- type ContractInterfaceVariable = {
33
- name: string;
34
- type: ContractInterfaceAtomType;
35
- access: ContractInterfaceVariableAccess;
30
+ export type StacksEpochId =
31
+ | "Epoch10"
32
+ | "Epoch20"
33
+ | "Epoch2_05"
34
+ | "Epoch21"
35
+ | "Epoch22"
36
+ | "Epoch23"
37
+ | "Epoch24"
38
+ | "Epoch25"
39
+ | "Epoch30"
40
+ | "Epoch31"
41
+ | "Epoch32"
42
+ | "Epoch33"
43
+ | "Epoch34";
44
+
45
+ type Atom = {
46
+ Atom: String;
36
47
  };
37
48
 
38
- type ContractInterfaceAtomType =
39
- | "none"
40
- | "int128"
41
- | "uint128"
42
- | "bool"
43
- | "principal"
44
- | { buffer: { length: number } }
45
- | { "string-utf8": { length: number } }
46
- | { "string-ascii": { length: number } }
47
- | { tuple: ContractInterfaceTupleEntryType[] }
48
- | { optional: ContractInterfaceAtomType }
49
- | { response: { ok: ContractInterfaceAtomType; error: ContractInterfaceAtomType } }
50
- | { list: { type: ContractInterfaceAtomType; length: number } }
51
- | "trait_reference";
49
+ type AtomValue = {
50
+ AtomValue: any;
51
+ };
52
52
 
53
- type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
53
+ type ContractInterfaceAtomType =
54
+ | "none"
55
+ | "int128"
56
+ | "uint128"
57
+ | "bool"
58
+ | "principal"
59
+ | { buffer: { length: number } }
60
+ | { "string-utf8": { length: number } }
61
+ | { "string-ascii": { length: number } }
62
+ | { tuple: ContractInterfaceTupleEntryType[] }
63
+ | { optional: ContractInterfaceAtomType }
64
+ | { response: { ok: ContractInterfaceAtomType; error: ContractInterfaceAtomType } }
65
+ | { list: { type: ContractInterfaceAtomType; length: number } }
66
+ | "trait_reference";
54
67
 
55
- type Atom = {
56
- Atom: String;
68
+ type ContractInterfaceFunction = {
69
+ name: string;
70
+ access: ContractInterfaceFunctionAccess;
71
+ args: ContractInterfaceFunctionArg[];
72
+ outputs: ContractInterfaceFunctionOutput;
57
73
  };
58
74
 
75
+ type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
76
+
59
77
  type ContractInterfaceFunctionArg = { name: string; type: ContractInterfaceAtomType };
60
78
 
61
- type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
79
+ type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
62
80
 
63
- export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4";
81
+ type ContractInterfaceFungibleTokens = { name: string };
64
82
 
65
- type Span = {
66
- start_line: number;
67
- start_column: number;
68
- end_line: number;
69
- end_column: number;
83
+ type ContractInterfaceMap = {
84
+ name: string;
85
+ key: ContractInterfaceAtomType;
86
+ value: ContractInterfaceAtomType;
70
87
  };
71
88
 
72
- export type StacksEpochId =
73
- | "Epoch10"
74
- | "Epoch20"
75
- | "Epoch2_05"
76
- | "Epoch21"
77
- | "Epoch22"
78
- | "Epoch23"
79
- | "Epoch24"
80
- | "Epoch25"
81
- | "Epoch30"
82
- | "Epoch31"
83
- | "Epoch32"
84
- | "Epoch33";
89
+ type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
85
90
 
86
91
  type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
87
92
 
88
- type List = {
89
- List: Expression[];
93
+ type ContractInterfaceVariable = {
94
+ name: string;
95
+ type: ContractInterfaceAtomType;
96
+ access: ContractInterfaceVariableAccess;
90
97
  };
91
98
 
92
- type ContractInterfaceFungibleTokens = { name: string };
93
-
94
- type ExpressionType = Atom | AtomValue | List | LiteralValue | Field | TraitReference;
95
-
96
- type LiteralValue = {
97
- LiteralValue: any;
98
- };
99
+ type ContractInterfaceVariableAccess = "constant" | "variable";
99
100
 
100
- type ContractInterfaceFunction = {
101
- name: string;
102
- access: ContractInterfaceFunctionAccess;
103
- args: ContractInterfaceFunctionArg[];
104
- outputs: ContractInterfaceFunctionOutput;
101
+ type Expression = {
102
+ expr: ExpressionType;
103
+ id: number;
104
+ span: Span;
105
105
  };
106
106
 
107
- type TraitReference = {
108
- TraitReference: any;
109
- };
107
+ type ExpressionType = Atom | AtomValue | List | LiteralValue | Field | TraitReference;
110
108
 
111
109
  type Field = {
112
- Field: any;
110
+ Field: any;
113
111
  };
114
112
 
115
- type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
113
+ type IContractAST = {
114
+ contract_identifier: any;
115
+ pre_expressions: any[];
116
+ expressions: Expression[];
117
+ top_level_expression_sorting: number[];
118
+ referenced_traits: Map<any, any>;
119
+ implemented_traits: any[];
120
+ };
116
121
 
117
- type ContractInterfaceMap = {
118
- name: string;
119
- key: ContractInterfaceAtomType;
120
- value: ContractInterfaceAtomType;
122
+ type List = {
123
+ List: Expression[];
121
124
  };
122
125
 
123
- type ContractInterfaceVariableAccess = "constant" | "variable";
126
+ type LiteralValue = {
127
+ LiteralValue: any;
128
+ };
124
129
 
125
- export type IContractInterface = {
126
- functions: ContractInterfaceFunction[];
127
- variables: ContractInterfaceVariable[];
128
- maps: ContractInterfaceMap[];
129
- fungible_tokens: ContractInterfaceFungibleTokens[];
130
- non_fungible_tokens: ContractInterfaceNonFungibleTokens[];
131
- epoch: StacksEpochId;
132
- clarity_version: ClarityVersionString;
130
+ type Span = {
131
+ start_line: number;
132
+ start_column: number;
133
+ end_line: number;
134
+ end_column: number;
133
135
  };
134
136
 
135
- type AtomValue = {
136
- AtomValue: any;
137
+ type TraitReference = {
138
+ TraitReference: any;
137
139
  };
138
140
 
139
141
 
140
142
  export class CallFnArgs {
141
- free(): void;
142
- [Symbol.dispose](): void;
143
- constructor(contract: string, method: string, args: Uint8Array[], sender: string);
143
+ free(): void;
144
+ [Symbol.dispose](): void;
145
+ constructor(contract: string, method: string, args: Uint8Array[], sender: string);
144
146
  }
145
147
 
146
148
  export class ContractOptions {
147
- free(): void;
148
- [Symbol.dispose](): void;
149
- constructor(clarity_version?: number | null);
149
+ free(): void;
150
+ [Symbol.dispose](): void;
151
+ constructor(clarity_version?: number | null);
150
152
  }
151
153
 
152
154
  export class DeployContractArgs {
153
- free(): void;
154
- [Symbol.dispose](): void;
155
- constructor(name: string, content: string, options: ContractOptions, sender: string);
155
+ free(): void;
156
+ [Symbol.dispose](): void;
157
+ constructor(name: string, content: string, options: ContractOptions, sender: string);
156
158
  }
157
159
 
158
160
  export class SDK {
159
- free(): void;
160
- [Symbol.dispose](): void;
161
- clearCache(): void;
162
- runSnippet(snippet: string): string;
163
- getAccounts(): Map<string, string>;
164
- getDataVar(contract: string, var_name: string): string;
165
- initSession(cwd: string, manifest_path: string): Promise<void>;
166
- transferSTX(args: TransferSTXArgs): TransactionRes;
167
- getMapEntry(contract: string, map_name: string, map_key: Uint8Array): string;
168
- mineBlock(js_txs: Array<any>): any;
169
- callPublicFn(args: CallFnArgs): TransactionRes;
170
- collectReport(include_boot_contracts: boolean, boot_contracts_path: string): SessionReport;
171
- getBlockTime(): bigint;
172
- callPrivateFn(args: CallFnArgs): TransactionRes;
173
- deployContract(args: DeployContractArgs): TransactionRes;
174
- executeCommand(snippet: string): string;
175
- getAssetsMap(): Map<string, Map<string, bigint>>;
176
- getContractAST(contract: string): IContractAST;
177
- mineEmptyBlock(): number;
178
- callReadOnlyFn(args: CallFnArgs): TransactionRes;
179
- static getDefaultEpoch(): EpochString;
180
- mineEmptyBlocks(count?: number | null): number;
181
- enablePerformance(cost_field: string): void;
182
- initEmptySession(remote_data_settings: any): Promise<void>;
183
- setLocalAccounts(addresses: string[]): void;
184
- getContractSource(contract: string): string | undefined;
185
- mineEmptyBurnBlock(): number;
186
- setCurrentTestName(test_name: string): void;
187
- mineEmptyBurnBlocks(count?: number | null): number;
188
- mineEmptyStacksBlock(): number;
189
- generateDeploymentPlan(cwd: string, manifest_path: string): Promise<void>;
190
- getContractsInterfaces(): Map<string, IContractInterface>;
191
- mineEmptyStacksBlocks(count?: number | null): number;
192
- /**
193
- * Returns the last contract call trace as a string, if available.
194
- */
195
- getLastContractCallTrace(): string | undefined;
196
- constructor(fs_request: Function, options?: SDKOptions | null);
197
- getDefaultClarityVersionForCurrentEpoch(): ClarityVersionString;
198
- execute(snippet: string): TransactionRes;
199
- mintFT(token: string, recipient: string, amount: bigint): string;
200
- mintSTX(recipient: string, amount: bigint): string;
201
- setEpoch(epoch: EpochString): void;
202
- deployer: string;
203
- readonly blockHeight: number;
204
- readonly currentEpoch: string;
205
- readonly burnBlockHeight: number;
206
- readonly stacksBlockHeight: number;
161
+ free(): void;
162
+ [Symbol.dispose](): void;
163
+ callPrivateFn(args: CallFnArgs): TransactionRes;
164
+ callPublicFn(args: CallFnArgs): TransactionRes;
165
+ callReadOnlyFn(args: CallFnArgs): TransactionRes;
166
+ clearCache(): void;
167
+ collectReport(include_boot_contracts: boolean, boot_contracts_path: string): SessionReport;
168
+ deployContract(args: DeployContractArgs): TransactionRes;
169
+ enablePerformance(cost_field: string): void;
170
+ execute(snippet: string): TransactionRes;
171
+ executeCommand(snippet: string): string;
172
+ generateDeploymentPlan(cwd: string, manifest_path: string): Promise<void>;
173
+ getAccounts(): Map<string, string>;
174
+ getAssetsMap(): Map<string, Map<string, bigint>>;
175
+ getBlockTime(): bigint;
176
+ getContractAST(contract: string): IContractAST;
177
+ getContractSource(contract: string): string | undefined;
178
+ getContractsInterfaces(): Map<string, IContractInterface>;
179
+ getDataVar(contract: string, var_name: string): string;
180
+ getDefaultClarityVersionForCurrentEpoch(): ClarityVersionString;
181
+ static getDefaultEpoch(): EpochString;
182
+ /**
183
+ * Returns the last contract call trace as a string, if available.
184
+ */
185
+ getLastContractCallTrace(): string | undefined;
186
+ getMapEntry(contract: string, map_name: string, map_key: Uint8Array): string;
187
+ initEmptySession(remote_data_settings: any): Promise<void>;
188
+ initSession(cwd: string, manifest_path: string): Promise<void>;
189
+ mineBlock(js_txs: Array<any>): any;
190
+ mineEmptyBlock(): number;
191
+ mineEmptyBlocks(count?: number | null): number;
192
+ mineEmptyBurnBlock(): number;
193
+ mineEmptyBurnBlocks(count?: number | null): number;
194
+ mineEmptyStacksBlock(): number;
195
+ mineEmptyStacksBlocks(count?: number | null): number;
196
+ mintFT(token: string, recipient: string, amount: bigint): string;
197
+ mintSTX(recipient: string, amount: bigint): string;
198
+ constructor(fs_request: Function, options?: SDKOptions | null);
199
+ runSnippet(snippet: string): string;
200
+ setCurrentTestName(test_name: string): void;
201
+ setEpoch(epoch: EpochString): void;
202
+ setLocalAccounts(addresses: string[]): void;
203
+ transferSTX(args: TransferSTXArgs): TransactionRes;
204
+ deployer: string;
205
+ readonly blockHeight: number;
206
+ readonly burnBlockHeight: number;
207
+ readonly currentEpoch: string;
208
+ readonly stacksBlockHeight: number;
207
209
  }
208
210
 
209
211
  export class SDKOptions {
210
- free(): void;
211
- [Symbol.dispose](): void;
212
- constructor(track_costs: boolean, track_coverage: boolean, track_performance?: boolean | null);
213
- trackCosts: boolean;
214
- trackCoverage: boolean;
215
- trackPerformance: boolean;
212
+ free(): void;
213
+ [Symbol.dispose](): void;
214
+ constructor(track_costs: boolean, track_coverage: boolean, track_performance?: boolean | null);
215
+ trackCosts: boolean;
216
+ trackCoverage: boolean;
217
+ trackPerformance: boolean;
216
218
  }
217
219
 
218
220
  export class SessionReport {
219
- private constructor();
220
- free(): void;
221
- [Symbol.dispose](): void;
222
- coverage: string;
223
- costs: string;
221
+ private constructor();
222
+ free(): void;
223
+ [Symbol.dispose](): void;
224
+ costs: string;
225
+ coverage: string;
224
226
  }
225
227
 
226
228
  export class TransactionRes {
227
- private constructor();
228
- free(): void;
229
- [Symbol.dispose](): void;
230
- result: string;
231
- events: string;
232
- costs: string;
233
- get performance(): string | undefined;
234
- set performance(value: string | null | undefined);
229
+ private constructor();
230
+ free(): void;
231
+ [Symbol.dispose](): void;
232
+ costs: string;
233
+ events: string;
234
+ get performance(): string | undefined;
235
+ set performance(value: string | null | undefined);
236
+ result: string;
235
237
  }
236
238
 
237
239
  export class TransferSTXArgs {
238
- free(): void;
239
- [Symbol.dispose](): void;
240
- constructor(amount: bigint, recipient: string, sender: string);
240
+ free(): void;
241
+ [Symbol.dispose](): void;
242
+ constructor(amount: bigint, recipient: string, sender: string);
241
243
  }
242
244
 
243
245
  export class TxArgs {
244
- private constructor();
245
- free(): void;
246
- [Symbol.dispose](): void;
246
+ private constructor();
247
+ free(): void;
248
+ [Symbol.dispose](): void;
247
249
  }