@stacks/clarinet-sdk-wasm 3.13.1 → 3.14.1

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 ContractInterfaceVariableAccess = "constant" | "variable";
3
+ export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4" | "Clarity5";
4
4
 
5
- type ContractInterfaceFunction = {
6
- name: string;
7
- access: ContractInterfaceFunctionAccess;
8
- args: ContractInterfaceFunctionArg[];
9
- outputs: ContractInterfaceFunctionOutput;
10
- };
5
+ export type EpochString =
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";
11
18
 
12
- type Expression = {
13
- expr: ExpressionType;
14
- id: number;
15
- span: Span;
19
+
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;
16
28
  };
17
29
 
18
- type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
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";
19
44
 
20
- type LiteralValue = {
21
- LiteralValue: any;
45
+ type Atom = {
46
+ Atom: String;
22
47
  };
23
48
 
24
49
  type AtomValue = {
25
- AtomValue: any;
50
+ AtomValue: any;
51
+ };
52
+
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";
67
+
68
+ type ContractInterfaceFunction = {
69
+ name: string;
70
+ access: ContractInterfaceFunctionAccess;
71
+ args: ContractInterfaceFunctionArg[];
72
+ outputs: ContractInterfaceFunctionOutput;
26
73
  };
27
74
 
75
+ type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
76
+
77
+ type ContractInterfaceFunctionArg = { name: string; type: ContractInterfaceAtomType };
78
+
28
79
  type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
29
80
 
30
- type ContractInterfaceAtomType =
31
- | "none"
32
- | "int128"
33
- | "uint128"
34
- | "bool"
35
- | "principal"
36
- | { buffer: { length: number } }
37
- | { "string-utf8": { length: number } }
38
- | { "string-ascii": { length: number } }
39
- | { tuple: ContractInterfaceTupleEntryType[] }
40
- | { optional: ContractInterfaceAtomType }
41
- | { response: { ok: ContractInterfaceAtomType; error: ContractInterfaceAtomType } }
42
- | { list: { type: ContractInterfaceAtomType; length: number } }
43
- | "trait_reference";
81
+ type ContractInterfaceFungibleTokens = { name: string };
44
82
 
45
83
  type ContractInterfaceMap = {
46
- name: string;
47
- key: ContractInterfaceAtomType;
48
- value: ContractInterfaceAtomType;
84
+ name: string;
85
+ key: ContractInterfaceAtomType;
86
+ value: ContractInterfaceAtomType;
49
87
  };
50
88
 
51
- type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
89
+ type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
52
90
 
53
- export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4";
91
+ type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
54
92
 
55
- type Span = {
56
- start_line: number;
57
- start_column: number;
58
- end_line: number;
59
- end_column: number;
93
+ type ContractInterfaceVariable = {
94
+ name: string;
95
+ type: ContractInterfaceAtomType;
96
+ access: ContractInterfaceVariableAccess;
60
97
  };
61
98
 
62
- export type StacksEpochId =
63
- | "Epoch10"
64
- | "Epoch20"
65
- | "Epoch2_05"
66
- | "Epoch21"
67
- | "Epoch22"
68
- | "Epoch23"
69
- | "Epoch24"
70
- | "Epoch25"
71
- | "Epoch30"
72
- | "Epoch31"
73
- | "Epoch32"
74
- | "Epoch33";
99
+ type ContractInterfaceVariableAccess = "constant" | "variable";
75
100
 
76
- export type IContractInterface = {
77
- functions: ContractInterfaceFunction[];
78
- variables: ContractInterfaceVariable[];
79
- maps: ContractInterfaceMap[];
80
- fungible_tokens: ContractInterfaceFungibleTokens[];
81
- non_fungible_tokens: ContractInterfaceNonFungibleTokens[];
82
- epoch: StacksEpochId;
83
- clarity_version: ClarityVersionString;
101
+ type Expression = {
102
+ expr: ExpressionType;
103
+ id: number;
104
+ span: Span;
84
105
  };
85
106
 
86
107
  type ExpressionType = Atom | AtomValue | List | LiteralValue | Field | TraitReference;
87
108
 
88
- type ContractInterfaceVariable = {
89
- name: string;
90
- type: ContractInterfaceAtomType;
91
- access: ContractInterfaceVariableAccess;
92
- };
93
-
94
- type Atom = {
95
- Atom: String;
109
+ type Field = {
110
+ Field: any;
96
111
  };
97
112
 
98
113
  type IContractAST = {
99
- contract_identifier: any;
100
- pre_expressions: any[];
101
- expressions: Expression[];
102
- top_level_expression_sorting: number[];
103
- referenced_traits: Map<any, any>;
104
- implemented_traits: any[];
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[];
105
120
  };
106
121
 
107
- type TraitReference = {
108
- TraitReference: any;
122
+ type List = {
123
+ List: Expression[];
109
124
  };
110
125
 
111
- type ContractInterfaceFunctionArg = { name: string; type: ContractInterfaceAtomType };
112
-
113
- type ContractInterfaceFungibleTokens = { name: string };
114
-
115
- type Field = {
116
- Field: any;
126
+ type LiteralValue = {
127
+ LiteralValue: any;
117
128
  };
118
129
 
119
- export type EpochString =
120
- | "2.0"
121
- | "2.05"
122
- | "2.1"
123
- | "2.2"
124
- | "2.3"
125
- | "2.4"
126
- | "2.5"
127
- | "3.0"
128
- | "3.1"
129
- | "3.2"
130
- | "3.3";
131
-
132
-
133
- type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
130
+ type Span = {
131
+ start_line: number;
132
+ start_column: number;
133
+ end_line: number;
134
+ end_column: number;
135
+ };
134
136
 
135
- type List = {
136
- List: Expression[];
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
  }