@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 +183 -181
- package/clarinet_sdk.js +1095 -1207
- package/clarinet_sdk_bg.wasm +0 -0
- package/package.json +1 -1
package/clarinet_sdk.d.ts
CHANGED
|
@@ -1,247 +1,249 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
type
|
|
3
|
+
export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4" | "Clarity5";
|
|
4
4
|
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
|
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
|
|
21
|
-
|
|
45
|
+
type Atom = {
|
|
46
|
+
Atom: String;
|
|
22
47
|
};
|
|
23
48
|
|
|
24
49
|
type AtomValue = {
|
|
25
|
-
|
|
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
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
84
|
+
name: string;
|
|
85
|
+
key: ContractInterfaceAtomType;
|
|
86
|
+
value: ContractInterfaceAtomType;
|
|
49
87
|
};
|
|
50
88
|
|
|
51
|
-
type
|
|
89
|
+
type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
|
|
52
90
|
|
|
53
|
-
|
|
91
|
+
type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
|
|
54
92
|
|
|
55
|
-
type
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
end_column: number;
|
|
93
|
+
type ContractInterfaceVariable = {
|
|
94
|
+
name: string;
|
|
95
|
+
type: ContractInterfaceAtomType;
|
|
96
|
+
access: ContractInterfaceVariableAccess;
|
|
60
97
|
};
|
|
61
98
|
|
|
62
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
89
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
|
108
|
-
|
|
122
|
+
type List = {
|
|
123
|
+
List: Expression[];
|
|
109
124
|
};
|
|
110
125
|
|
|
111
|
-
type
|
|
112
|
-
|
|
113
|
-
type ContractInterfaceFungibleTokens = { name: string };
|
|
114
|
-
|
|
115
|
-
type Field = {
|
|
116
|
-
Field: any;
|
|
126
|
+
type LiteralValue = {
|
|
127
|
+
LiteralValue: any;
|
|
117
128
|
};
|
|
118
129
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
136
|
-
|
|
137
|
+
type TraitReference = {
|
|
138
|
+
TraitReference: any;
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
|
|
140
142
|
export class CallFnArgs {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
free(): void;
|
|
150
|
+
[Symbol.dispose](): void;
|
|
151
|
+
constructor(clarity_version?: number | null);
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
export class DeployContractArgs {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
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
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
private constructor();
|
|
247
|
+
free(): void;
|
|
248
|
+
[Symbol.dispose](): void;
|
|
247
249
|
}
|