@stacks/clarinet-sdk-wasm-browser 3.8.1 → 3.9.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 +157 -155
- package/clarinet_sdk.js +302 -274
- package/clarinet_sdk_bg.wasm +0 -0
- package/package.json +1 -1
package/clarinet_sdk.d.ts
CHANGED
|
@@ -1,44 +1,42 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
| "2.05"
|
|
6
|
-
| "2.1"
|
|
7
|
-
| "2.2"
|
|
8
|
-
| "2.3"
|
|
9
|
-
| "2.4"
|
|
10
|
-
| "2.5"
|
|
11
|
-
| "3.0"
|
|
12
|
-
| "3.1"
|
|
13
|
-
| "3.2"
|
|
14
|
-
| "3.3";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type Atom = {
|
|
18
|
-
Atom: String;
|
|
3
|
+
type Field = {
|
|
4
|
+
Field: any;
|
|
19
5
|
};
|
|
20
6
|
|
|
21
|
-
type
|
|
22
|
-
|
|
7
|
+
type ContractInterfaceMap = {
|
|
8
|
+
name: string;
|
|
9
|
+
key: ContractInterfaceAtomType;
|
|
10
|
+
value: ContractInterfaceAtomType;
|
|
23
11
|
};
|
|
24
12
|
|
|
25
|
-
type
|
|
26
|
-
|
|
13
|
+
type Atom = {
|
|
14
|
+
Atom: String;
|
|
27
15
|
};
|
|
28
16
|
|
|
29
|
-
type
|
|
30
|
-
LiteralValue: any;
|
|
31
|
-
};
|
|
17
|
+
type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
|
|
32
18
|
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
|
|
19
|
+
export type StacksEpochId =
|
|
20
|
+
| "Epoch10"
|
|
21
|
+
| "Epoch20"
|
|
22
|
+
| "Epoch2_05"
|
|
23
|
+
| "Epoch21"
|
|
24
|
+
| "Epoch22"
|
|
25
|
+
| "Epoch23"
|
|
26
|
+
| "Epoch24"
|
|
27
|
+
| "Epoch25"
|
|
28
|
+
| "Epoch30"
|
|
29
|
+
| "Epoch31"
|
|
30
|
+
| "Epoch32"
|
|
31
|
+
| "Epoch33";
|
|
36
32
|
|
|
37
33
|
type TraitReference = {
|
|
38
34
|
TraitReference: any;
|
|
39
35
|
};
|
|
40
36
|
|
|
41
|
-
type
|
|
37
|
+
type ContractInterfaceFunctionArg = { name: string; type: ContractInterfaceAtomType };
|
|
38
|
+
|
|
39
|
+
type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
|
|
42
40
|
|
|
43
41
|
type Span = {
|
|
44
42
|
start_line: number;
|
|
@@ -47,24 +45,22 @@ type Span = {
|
|
|
47
45
|
end_column: number;
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
type
|
|
51
|
-
expr: ExpressionType;
|
|
52
|
-
id: number;
|
|
53
|
-
span: Span;
|
|
54
|
-
};
|
|
48
|
+
type ContractInterfaceFungibleTokens = { name: string };
|
|
55
49
|
|
|
56
|
-
type
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
referenced_traits: Map<any, any>;
|
|
62
|
-
implemented_traits: any[];
|
|
50
|
+
type ContractInterfaceFunction = {
|
|
51
|
+
name: string;
|
|
52
|
+
access: ContractInterfaceFunctionAccess;
|
|
53
|
+
args: ContractInterfaceFunctionArg[];
|
|
54
|
+
outputs: ContractInterfaceFunctionOutput;
|
|
63
55
|
};
|
|
64
56
|
|
|
65
|
-
type
|
|
57
|
+
type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
|
|
66
58
|
|
|
67
|
-
type
|
|
59
|
+
type LiteralValue = {
|
|
60
|
+
LiteralValue: any;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4";
|
|
68
64
|
|
|
69
65
|
type ContractInterfaceAtomType =
|
|
70
66
|
| "none"
|
|
@@ -81,51 +77,22 @@ type ContractInterfaceAtomType =
|
|
|
81
77
|
| { list: { type: ContractInterfaceAtomType; length: number } }
|
|
82
78
|
| "trait_reference";
|
|
83
79
|
|
|
84
|
-
type
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
type ContractInterfaceFunction = {
|
|
89
|
-
name: string;
|
|
90
|
-
access: ContractInterfaceFunctionAccess;
|
|
91
|
-
args: ContractInterfaceFunctionArg[];
|
|
92
|
-
outputs: ContractInterfaceFunctionOutput;
|
|
80
|
+
type Expression = {
|
|
81
|
+
expr: ExpressionType;
|
|
82
|
+
id: number;
|
|
83
|
+
span: Span;
|
|
93
84
|
};
|
|
94
85
|
|
|
95
|
-
type ContractInterfaceVariableAccess = "constant" | "variable";
|
|
96
|
-
|
|
97
86
|
type ContractInterfaceVariable = {
|
|
98
87
|
name: string;
|
|
99
88
|
type: ContractInterfaceAtomType;
|
|
100
89
|
access: ContractInterfaceVariableAccess;
|
|
101
90
|
};
|
|
102
91
|
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
key: ContractInterfaceAtomType;
|
|
106
|
-
value: ContractInterfaceAtomType;
|
|
92
|
+
type AtomValue = {
|
|
93
|
+
AtomValue: any;
|
|
107
94
|
};
|
|
108
95
|
|
|
109
|
-
type ContractInterfaceFungibleTokens = { name: string };
|
|
110
|
-
|
|
111
|
-
type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
|
|
112
|
-
|
|
113
|
-
export type StacksEpochId =
|
|
114
|
-
| "Epoch10"
|
|
115
|
-
| "Epoch20"
|
|
116
|
-
| "Epoch2_05"
|
|
117
|
-
| "Epoch21"
|
|
118
|
-
| "Epoch22"
|
|
119
|
-
| "Epoch23"
|
|
120
|
-
| "Epoch24"
|
|
121
|
-
| "Epoch25"
|
|
122
|
-
| "Epoch30"
|
|
123
|
-
| "Epoch31"
|
|
124
|
-
| "Epoch32"
|
|
125
|
-
| "Epoch33";
|
|
126
|
-
|
|
127
|
-
export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4";
|
|
128
|
-
|
|
129
96
|
export type IContractInterface = {
|
|
130
97
|
functions: ContractInterfaceFunction[];
|
|
131
98
|
variables: ContractInterfaceVariable[];
|
|
@@ -136,6 +103,39 @@ export type IContractInterface = {
|
|
|
136
103
|
clarity_version: ClarityVersionString;
|
|
137
104
|
};
|
|
138
105
|
|
|
106
|
+
type ExpressionType = Atom | AtomValue | List | LiteralValue | Field | TraitReference;
|
|
107
|
+
|
|
108
|
+
type IContractAST = {
|
|
109
|
+
contract_identifier: any;
|
|
110
|
+
pre_expressions: any[];
|
|
111
|
+
expressions: Expression[];
|
|
112
|
+
top_level_expression_sorting: number[];
|
|
113
|
+
referenced_traits: Map<any, any>;
|
|
114
|
+
implemented_traits: any[];
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export type EpochString =
|
|
118
|
+
| "2.0"
|
|
119
|
+
| "2.05"
|
|
120
|
+
| "2.1"
|
|
121
|
+
| "2.2"
|
|
122
|
+
| "2.3"
|
|
123
|
+
| "2.4"
|
|
124
|
+
| "2.5"
|
|
125
|
+
| "3.0"
|
|
126
|
+
| "3.1"
|
|
127
|
+
| "3.2"
|
|
128
|
+
| "3.3";
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
type List = {
|
|
132
|
+
List: Expression[];
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
type ContractInterfaceVariableAccess = "constant" | "variable";
|
|
136
|
+
|
|
137
|
+
type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
|
|
138
|
+
|
|
139
139
|
export class CallFnArgs {
|
|
140
140
|
free(): void;
|
|
141
141
|
constructor(contract: string, method: string, args: Uint8Array[], sender: string);
|
|
@@ -150,50 +150,51 @@ export class DeployContractArgs {
|
|
|
150
150
|
}
|
|
151
151
|
export class SDK {
|
|
152
152
|
free(): void;
|
|
153
|
-
constructor(fs_request: Function, options?: SDKOptions | null);
|
|
154
|
-
static getDefaultEpoch(): EpochString;
|
|
155
|
-
getDefaultClarityVersionForCurrentEpoch(): ClarityVersionString;
|
|
156
|
-
initEmptySession(remote_data_settings: any): Promise<void>;
|
|
157
|
-
initSession(cwd: string, manifest_path: string): Promise<void>;
|
|
158
153
|
clearCache(): void;
|
|
159
|
-
|
|
160
|
-
getContractsInterfaces(): Map<string, IContractInterface>;
|
|
161
|
-
getContractSource(contract: string): string | undefined;
|
|
162
|
-
getContractAST(contract: string): IContractAST;
|
|
163
|
-
getAssetsMap(): Map<string, Map<string, bigint>>;
|
|
154
|
+
runSnippet(snippet: string): string;
|
|
164
155
|
getAccounts(): Map<string, string>;
|
|
165
156
|
getDataVar(contract: string, var_name: string): string;
|
|
166
|
-
|
|
167
|
-
getMapEntry(contract: string, map_name: string, map_key: Uint8Array): string;
|
|
168
|
-
callReadOnlyFn(args: CallFnArgs): TransactionRes;
|
|
169
|
-
deployContract(args: DeployContractArgs): TransactionRes;
|
|
157
|
+
initSession(cwd: string, manifest_path: string): Promise<void>;
|
|
170
158
|
transferSTX(args: TransferSTXArgs): TransactionRes;
|
|
159
|
+
getMapEntry(contract: string, map_name: string, map_key: Uint8Array): string;
|
|
160
|
+
mineBlock(js_txs: Array<any>): any;
|
|
171
161
|
callPublicFn(args: CallFnArgs): TransactionRes;
|
|
162
|
+
collectReport(include_boot_contracts: boolean, boot_contracts_path: string): SessionReport;
|
|
163
|
+
getBlockTime(): bigint;
|
|
172
164
|
callPrivateFn(args: CallFnArgs): TransactionRes;
|
|
173
|
-
|
|
165
|
+
deployContract(args: DeployContractArgs): TransactionRes;
|
|
166
|
+
executeCommand(snippet: string): string;
|
|
167
|
+
getAssetsMap(): Map<string, Map<string, bigint>>;
|
|
168
|
+
getContractAST(contract: string): IContractAST;
|
|
174
169
|
mineEmptyBlock(): number;
|
|
170
|
+
callReadOnlyFn(args: CallFnArgs): TransactionRes;
|
|
171
|
+
static getDefaultEpoch(): EpochString;
|
|
175
172
|
mineEmptyBlocks(count?: number | null): number;
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
enablePerformance(cost_field: string): void;
|
|
174
|
+
initEmptySession(remote_data_settings: any): Promise<void>;
|
|
175
|
+
setLocalAccounts(addresses: string[]): void;
|
|
176
|
+
getContractSource(contract: string): string | undefined;
|
|
178
177
|
mineEmptyBurnBlock(): number;
|
|
178
|
+
setCurrentTestName(test_name: string): void;
|
|
179
179
|
mineEmptyBurnBlocks(count?: number | null): number;
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
mineEmptyStacksBlock(): number;
|
|
181
|
+
getContractsInterfaces(): Map<string, IContractInterface>;
|
|
182
|
+
mineEmptyStacksBlocks(count?: number | null): number;
|
|
183
183
|
/**
|
|
184
184
|
* Returns the last contract call trace as a string, if available.
|
|
185
185
|
*/
|
|
186
186
|
getLastContractCallTrace(): string | undefined;
|
|
187
|
-
|
|
187
|
+
constructor(fs_request: Function, options?: SDKOptions | null);
|
|
188
|
+
getDefaultClarityVersionForCurrentEpoch(): ClarityVersionString;
|
|
189
|
+
execute(snippet: string): TransactionRes;
|
|
190
|
+
mintFT(token: string, recipient: string, amount: bigint): string;
|
|
188
191
|
mintSTX(recipient: string, amount: bigint): string;
|
|
189
|
-
|
|
190
|
-
collectReport(include_boot_contracts: boolean, boot_contracts_path: string): SessionReport;
|
|
191
|
-
enablePerformance(cost_field: string): void;
|
|
192
|
+
setEpoch(epoch: EpochString): void;
|
|
192
193
|
deployer: string;
|
|
193
194
|
readonly blockHeight: number;
|
|
194
|
-
readonly stacksBlockHeight: number;
|
|
195
|
-
readonly burnBlockHeight: number;
|
|
196
195
|
readonly currentEpoch: string;
|
|
196
|
+
readonly burnBlockHeight: number;
|
|
197
|
+
readonly stacksBlockHeight: number;
|
|
197
198
|
}
|
|
198
199
|
export class SDKOptions {
|
|
199
200
|
free(): void;
|
|
@@ -231,79 +232,80 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
231
232
|
export interface InitOutput {
|
|
232
233
|
readonly memory: WebAssembly.Memory;
|
|
233
234
|
readonly __wbg_callfnargs_free: (a: number, b: number) => void;
|
|
234
|
-
readonly callfnargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
235
235
|
readonly __wbg_contractoptions_free: (a: number, b: number) => void;
|
|
236
|
-
readonly contractoptions_new: (a: number) => number;
|
|
237
236
|
readonly __wbg_deploycontractargs_free: (a: number, b: number) => void;
|
|
238
|
-
readonly
|
|
239
|
-
readonly
|
|
240
|
-
readonly
|
|
241
|
-
readonly
|
|
242
|
-
readonly
|
|
243
|
-
readonly
|
|
244
|
-
readonly __wbg_get_transactionres_events: (a: number) => [number, number];
|
|
237
|
+
readonly __wbg_get_sdk_deployer: (a: number) => [number, number];
|
|
238
|
+
readonly __wbg_get_sdkoptions_trackCosts: (a: number) => number;
|
|
239
|
+
readonly __wbg_get_sdkoptions_trackCoverage: (a: number) => number;
|
|
240
|
+
readonly __wbg_get_sdkoptions_trackPerformance: (a: number) => number;
|
|
241
|
+
readonly __wbg_get_sessionreport_costs: (a: number) => [number, number];
|
|
242
|
+
readonly __wbg_get_sessionreport_coverage: (a: number) => [number, number];
|
|
245
243
|
readonly __wbg_get_transactionres_costs: (a: number) => [number, number];
|
|
246
|
-
readonly
|
|
244
|
+
readonly __wbg_get_transactionres_events: (a: number) => [number, number];
|
|
247
245
|
readonly __wbg_get_transactionres_performance: (a: number) => [number, number];
|
|
248
|
-
readonly
|
|
249
|
-
readonly
|
|
250
|
-
readonly __wbg_get_sessionreport_coverage: (a: number) => [number, number];
|
|
251
|
-
readonly __wbg_set_sessionreport_coverage: (a: number, b: number, c: number) => void;
|
|
252
|
-
readonly __wbg_get_sessionreport_costs: (a: number) => [number, number];
|
|
253
|
-
readonly __wbg_set_sessionreport_costs: (a: number, b: number, c: number) => void;
|
|
246
|
+
readonly __wbg_get_transactionres_result: (a: number) => [number, number];
|
|
247
|
+
readonly __wbg_sdk_free: (a: number, b: number) => void;
|
|
254
248
|
readonly __wbg_sdkoptions_free: (a: number, b: number) => void;
|
|
255
|
-
readonly
|
|
249
|
+
readonly __wbg_sessionreport_free: (a: number, b: number) => void;
|
|
250
|
+
readonly __wbg_set_sdk_deployer: (a: number, b: number, c: number) => void;
|
|
256
251
|
readonly __wbg_set_sdkoptions_trackCosts: (a: number, b: number) => void;
|
|
257
|
-
readonly __wbg_get_sdkoptions_trackCoverage: (a: number) => number;
|
|
258
252
|
readonly __wbg_set_sdkoptions_trackCoverage: (a: number, b: number) => void;
|
|
259
|
-
readonly __wbg_get_sdkoptions_trackPerformance: (a: number) => number;
|
|
260
253
|
readonly __wbg_set_sdkoptions_trackPerformance: (a: number, b: number) => void;
|
|
261
|
-
readonly
|
|
262
|
-
readonly
|
|
263
|
-
readonly
|
|
264
|
-
readonly
|
|
265
|
-
readonly
|
|
266
|
-
readonly
|
|
267
|
-
readonly
|
|
268
|
-
readonly
|
|
269
|
-
readonly
|
|
270
|
-
readonly
|
|
254
|
+
readonly __wbg_set_sessionreport_costs: (a: number, b: number, c: number) => void;
|
|
255
|
+
readonly __wbg_set_sessionreport_coverage: (a: number, b: number, c: number) => void;
|
|
256
|
+
readonly __wbg_set_transactionres_costs: (a: number, b: number, c: number) => void;
|
|
257
|
+
readonly __wbg_set_transactionres_performance: (a: number, b: number, c: number) => void;
|
|
258
|
+
readonly __wbg_transactionres_free: (a: number, b: number) => void;
|
|
259
|
+
readonly __wbg_transferstxargs_free: (a: number, b: number) => void;
|
|
260
|
+
readonly __wbg_txargs_free: (a: number, b: number) => void;
|
|
261
|
+
readonly callfnargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
262
|
+
readonly contractoptions_new: (a: number) => number;
|
|
263
|
+
readonly deploycontractargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
271
264
|
readonly sdk_blockHeight: (a: number) => number;
|
|
272
265
|
readonly sdk_burnBlockHeight: (a: number) => number;
|
|
266
|
+
readonly sdk_callPrivateFn: (a: number, b: number) => [number, number, number];
|
|
267
|
+
readonly sdk_callPublicFn: (a: number, b: number) => [number, number, number];
|
|
268
|
+
readonly sdk_callReadOnlyFn: (a: number, b: number) => [number, number, number];
|
|
269
|
+
readonly sdk_clearCache: (a: number) => void;
|
|
270
|
+
readonly sdk_collectReport: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
273
271
|
readonly sdk_currentEpoch: (a: number) => [number, number];
|
|
274
|
-
readonly
|
|
275
|
-
readonly
|
|
276
|
-
readonly
|
|
277
|
-
readonly
|
|
278
|
-
readonly sdk_getAssetsMap: (a: number) => [number, number, number];
|
|
272
|
+
readonly sdk_deployContract: (a: number, b: number) => [number, number, number];
|
|
273
|
+
readonly sdk_enablePerformance: (a: number, b: number, c: number) => [number, number];
|
|
274
|
+
readonly sdk_execute: (a: number, b: number, c: number) => [number, number, number];
|
|
275
|
+
readonly sdk_executeCommand: (a: number, b: number, c: number) => [number, number];
|
|
279
276
|
readonly sdk_getAccounts: (a: number) => [number, number, number];
|
|
280
|
-
readonly
|
|
277
|
+
readonly sdk_getAssetsMap: (a: number) => [number, number, number];
|
|
281
278
|
readonly sdk_getBlockTime: (a: number) => bigint;
|
|
279
|
+
readonly sdk_getContractAST: (a: number, b: number, c: number) => [number, number, number];
|
|
280
|
+
readonly sdk_getContractSource: (a: number, b: number, c: number) => [number, number];
|
|
281
|
+
readonly sdk_getContractsInterfaces: (a: number) => [number, number, number];
|
|
282
|
+
readonly sdk_getDataVar: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
283
|
+
readonly sdk_getDefaultClarityVersionForCurrentEpoch: (a: number) => any;
|
|
284
|
+
readonly sdk_getDefaultEpoch: () => any;
|
|
285
|
+
readonly sdk_getLastContractCallTrace: (a: number) => [number, number];
|
|
282
286
|
readonly sdk_getMapEntry: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
283
|
-
readonly
|
|
284
|
-
readonly
|
|
285
|
-
readonly sdk_transferSTX: (a: number, b: number) => [number, number, number];
|
|
286
|
-
readonly sdk_callPublicFn: (a: number, b: number) => [number, number, number];
|
|
287
|
-
readonly sdk_callPrivateFn: (a: number, b: number) => [number, number, number];
|
|
287
|
+
readonly sdk_initEmptySession: (a: number, b: any) => any;
|
|
288
|
+
readonly sdk_initSession: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
288
289
|
readonly sdk_mineBlock: (a: number, b: any) => [number, number, number];
|
|
289
290
|
readonly sdk_mineEmptyBlock: (a: number) => number;
|
|
290
291
|
readonly sdk_mineEmptyBlocks: (a: number, b: number) => number;
|
|
291
|
-
readonly sdk_mineEmptyStacksBlock: (a: number) => [number, number, number];
|
|
292
|
-
readonly sdk_mineEmptyStacksBlocks: (a: number, b: number) => [number, number, number];
|
|
293
292
|
readonly sdk_mineEmptyBurnBlock: (a: number) => number;
|
|
294
293
|
readonly sdk_mineEmptyBurnBlocks: (a: number, b: number) => number;
|
|
295
|
-
readonly
|
|
296
|
-
readonly
|
|
297
|
-
readonly
|
|
298
|
-
readonly sdk_getLastContractCallTrace: (a: number) => [number, number];
|
|
299
|
-
readonly sdk_setLocalAccounts: (a: number, b: number, c: number) => void;
|
|
294
|
+
readonly sdk_mineEmptyStacksBlock: (a: number) => [number, number, number];
|
|
295
|
+
readonly sdk_mineEmptyStacksBlocks: (a: number, b: number) => [number, number, number];
|
|
296
|
+
readonly sdk_mintFT: (a: number, b: number, c: number, d: number, e: number, f: bigint) => [number, number, number, number];
|
|
300
297
|
readonly sdk_mintSTX: (a: number, b: number, c: number, d: bigint) => [number, number, number, number];
|
|
298
|
+
readonly sdk_new: (a: any, b: number) => number;
|
|
299
|
+
readonly sdk_runSnippet: (a: number, b: number, c: number) => [number, number];
|
|
301
300
|
readonly sdk_setCurrentTestName: (a: number, b: number, c: number) => void;
|
|
302
|
-
readonly
|
|
303
|
-
readonly
|
|
301
|
+
readonly sdk_setEpoch: (a: number, b: any) => void;
|
|
302
|
+
readonly sdk_setLocalAccounts: (a: number, b: number, c: number) => void;
|
|
303
|
+
readonly sdk_transferSTX: (a: number, b: number) => [number, number, number];
|
|
304
|
+
readonly sdkoptions_new: (a: number, b: number, c: number) => number;
|
|
305
|
+
readonly transferstxargs_new: (a: bigint, b: number, c: number, d: number, e: number) => number;
|
|
304
306
|
readonly sdk_stacksBlockHeight: (a: number) => number;
|
|
305
|
-
readonly __wbg_set_transactionres_result: (a: number, b: number, c: number) => void;
|
|
306
307
|
readonly __wbg_set_transactionres_events: (a: number, b: number, c: number) => void;
|
|
308
|
+
readonly __wbg_set_transactionres_result: (a: number, b: number, c: number) => void;
|
|
307
309
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
308
310
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
309
311
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
@@ -312,9 +314,9 @@ export interface InitOutput {
|
|
|
312
314
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
313
315
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
314
316
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
315
|
-
readonly
|
|
316
|
-
readonly
|
|
317
|
-
readonly
|
|
317
|
+
readonly wasm_bindgen__convert__closures_____invoke__h640ed087ddae9bb5: (a: number, b: number) => void;
|
|
318
|
+
readonly closure618_externref_shim: (a: number, b: number, c: any) => void;
|
|
319
|
+
readonly closure3353_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
318
320
|
readonly __wbindgen_start: () => void;
|
|
319
321
|
}
|
|
320
322
|
|
package/clarinet_sdk.js
CHANGED
|
@@ -246,16 +246,16 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
246
246
|
WASM_VECTOR_LEN = arg.length;
|
|
247
247
|
return ptr;
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
wasm.
|
|
249
|
+
function __wbg_adapter_16(arg0, arg1) {
|
|
250
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h640ed087ddae9bb5(arg0, arg1);
|
|
251
251
|
}
|
|
252
252
|
|
|
253
|
-
function
|
|
254
|
-
wasm.
|
|
253
|
+
function __wbg_adapter_19(arg0, arg1, arg2) {
|
|
254
|
+
wasm.closure618_externref_shim(arg0, arg1, arg2);
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
function
|
|
258
|
-
wasm.
|
|
257
|
+
function __wbg_adapter_228(arg0, arg1, arg2, arg3) {
|
|
258
|
+
wasm.closure3353_externref_shim(arg0, arg1, arg2, arg3);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
@@ -410,148 +410,33 @@ export class SDK {
|
|
|
410
410
|
const len0 = WASM_VECTOR_LEN;
|
|
411
411
|
wasm.__wbg_set_sdk_deployer(this.__wbg_ptr, ptr0, len0);
|
|
412
412
|
}
|
|
413
|
-
/**
|
|
414
|
-
* @param {Function} fs_request
|
|
415
|
-
* @param {SDKOptions | null} [options]
|
|
416
|
-
*/
|
|
417
|
-
constructor(fs_request, options) {
|
|
418
|
-
let ptr0 = 0;
|
|
419
|
-
if (!isLikeNone(options)) {
|
|
420
|
-
_assertClass(options, SDKOptions);
|
|
421
|
-
ptr0 = options.__destroy_into_raw();
|
|
422
|
-
}
|
|
423
|
-
const ret = wasm.sdk_new(fs_request, ptr0);
|
|
424
|
-
this.__wbg_ptr = ret >>> 0;
|
|
425
|
-
SDKFinalization.register(this, this.__wbg_ptr, this);
|
|
426
|
-
return this;
|
|
427
|
-
}
|
|
428
|
-
/**
|
|
429
|
-
* @returns {EpochString}
|
|
430
|
-
*/
|
|
431
|
-
static getDefaultEpoch() {
|
|
432
|
-
const ret = wasm.sdk_getDefaultEpoch();
|
|
433
|
-
return ret;
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* @returns {ClarityVersionString}
|
|
437
|
-
*/
|
|
438
|
-
getDefaultClarityVersionForCurrentEpoch() {
|
|
439
|
-
const ret = wasm.sdk_getDefaultClarityVersionForCurrentEpoch(this.__wbg_ptr);
|
|
440
|
-
return ret;
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* @param {any} remote_data_settings
|
|
444
|
-
* @returns {Promise<void>}
|
|
445
|
-
*/
|
|
446
|
-
initEmptySession(remote_data_settings) {
|
|
447
|
-
const ret = wasm.sdk_initEmptySession(this.__wbg_ptr, remote_data_settings);
|
|
448
|
-
return ret;
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* @param {string} cwd
|
|
452
|
-
* @param {string} manifest_path
|
|
453
|
-
* @returns {Promise<void>}
|
|
454
|
-
*/
|
|
455
|
-
initSession(cwd, manifest_path) {
|
|
456
|
-
const ptr0 = passStringToWasm0(cwd, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
457
|
-
const len0 = WASM_VECTOR_LEN;
|
|
458
|
-
const ptr1 = passStringToWasm0(manifest_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
459
|
-
const len1 = WASM_VECTOR_LEN;
|
|
460
|
-
const ret = wasm.sdk_initSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
461
|
-
return ret;
|
|
462
|
-
}
|
|
463
413
|
clearCache() {
|
|
464
414
|
wasm.sdk_clearCache(this.__wbg_ptr);
|
|
465
415
|
}
|
|
466
416
|
/**
|
|
467
|
-
* @
|
|
468
|
-
*/
|
|
469
|
-
get blockHeight() {
|
|
470
|
-
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
471
|
-
return ret >>> 0;
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* @returns {number}
|
|
475
|
-
*/
|
|
476
|
-
get stacksBlockHeight() {
|
|
477
|
-
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
478
|
-
return ret >>> 0;
|
|
479
|
-
}
|
|
480
|
-
/**
|
|
481
|
-
* @returns {number}
|
|
482
|
-
*/
|
|
483
|
-
get burnBlockHeight() {
|
|
484
|
-
const ret = wasm.sdk_burnBlockHeight(this.__wbg_ptr);
|
|
485
|
-
return ret >>> 0;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
417
|
+
* @param {string} snippet
|
|
488
418
|
* @returns {string}
|
|
489
419
|
*/
|
|
490
|
-
|
|
491
|
-
let
|
|
492
|
-
let
|
|
420
|
+
runSnippet(snippet) {
|
|
421
|
+
let deferred2_0;
|
|
422
|
+
let deferred2_1;
|
|
493
423
|
try {
|
|
494
|
-
const
|
|
495
|
-
|
|
496
|
-
|
|
424
|
+
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
425
|
+
const len0 = WASM_VECTOR_LEN;
|
|
426
|
+
const ret = wasm.sdk_runSnippet(this.__wbg_ptr, ptr0, len0);
|
|
427
|
+
deferred2_0 = ret[0];
|
|
428
|
+
deferred2_1 = ret[1];
|
|
497
429
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
498
430
|
} finally {
|
|
499
|
-
wasm.__wbindgen_free(
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* @param {EpochString} epoch
|
|
504
|
-
*/
|
|
505
|
-
setEpoch(epoch) {
|
|
506
|
-
wasm.sdk_setEpoch(this.__wbg_ptr, epoch);
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* @returns {Map<string, IContractInterface>}
|
|
510
|
-
*/
|
|
511
|
-
getContractsInterfaces() {
|
|
512
|
-
const ret = wasm.sdk_getContractsInterfaces(this.__wbg_ptr);
|
|
513
|
-
if (ret[2]) {
|
|
514
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
515
|
-
}
|
|
516
|
-
return takeFromExternrefTable0(ret[0]);
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
* @param {string} contract
|
|
520
|
-
* @returns {string | undefined}
|
|
521
|
-
*/
|
|
522
|
-
getContractSource(contract) {
|
|
523
|
-
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
524
|
-
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.sdk_getContractSource(this.__wbg_ptr, ptr0, len0);
|
|
526
|
-
let v2;
|
|
527
|
-
if (ret[0] !== 0) {
|
|
528
|
-
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
529
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
530
|
-
}
|
|
531
|
-
return v2;
|
|
532
|
-
}
|
|
533
|
-
/**
|
|
534
|
-
* @param {string} contract
|
|
535
|
-
* @returns {IContractAST}
|
|
536
|
-
*/
|
|
537
|
-
getContractAST(contract) {
|
|
538
|
-
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
539
|
-
const len0 = WASM_VECTOR_LEN;
|
|
540
|
-
const ret = wasm.sdk_getContractAST(this.__wbg_ptr, ptr0, len0);
|
|
541
|
-
if (ret[2]) {
|
|
542
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
431
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
543
432
|
}
|
|
544
|
-
return takeFromExternrefTable0(ret[0]);
|
|
545
433
|
}
|
|
546
434
|
/**
|
|
547
|
-
* @returns {
|
|
435
|
+
* @returns {number}
|
|
548
436
|
*/
|
|
549
|
-
|
|
550
|
-
const ret = wasm.
|
|
551
|
-
|
|
552
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
553
|
-
}
|
|
554
|
-
return takeFromExternrefTable0(ret[0]);
|
|
437
|
+
get blockHeight() {
|
|
438
|
+
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
439
|
+
return ret >>> 0;
|
|
555
440
|
}
|
|
556
441
|
/**
|
|
557
442
|
* @returns {Map<string, string>}
|
|
@@ -591,11 +476,44 @@ export class SDK {
|
|
|
591
476
|
}
|
|
592
477
|
}
|
|
593
478
|
/**
|
|
594
|
-
* @
|
|
479
|
+
* @param {string} cwd
|
|
480
|
+
* @param {string} manifest_path
|
|
481
|
+
* @returns {Promise<void>}
|
|
595
482
|
*/
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
|
|
483
|
+
initSession(cwd, manifest_path) {
|
|
484
|
+
const ptr0 = passStringToWasm0(cwd, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
485
|
+
const len0 = WASM_VECTOR_LEN;
|
|
486
|
+
const ptr1 = passStringToWasm0(manifest_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
|
+
const len1 = WASM_VECTOR_LEN;
|
|
488
|
+
const ret = wasm.sdk_initSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
489
|
+
return ret;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @param {TransferSTXArgs} args
|
|
493
|
+
* @returns {TransactionRes}
|
|
494
|
+
*/
|
|
495
|
+
transferSTX(args) {
|
|
496
|
+
_assertClass(args, TransferSTXArgs);
|
|
497
|
+
const ret = wasm.sdk_transferSTX(this.__wbg_ptr, args.__wbg_ptr);
|
|
498
|
+
if (ret[2]) {
|
|
499
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
500
|
+
}
|
|
501
|
+
return TransactionRes.__wrap(ret[0]);
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* @returns {string}
|
|
505
|
+
*/
|
|
506
|
+
get currentEpoch() {
|
|
507
|
+
let deferred1_0;
|
|
508
|
+
let deferred1_1;
|
|
509
|
+
try {
|
|
510
|
+
const ret = wasm.sdk_currentEpoch(this.__wbg_ptr);
|
|
511
|
+
deferred1_0 = ret[0];
|
|
512
|
+
deferred1_1 = ret[1];
|
|
513
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
514
|
+
} finally {
|
|
515
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
516
|
+
}
|
|
599
517
|
}
|
|
600
518
|
/**
|
|
601
519
|
* @param {string} contract
|
|
@@ -627,13 +545,57 @@ export class SDK {
|
|
|
627
545
|
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
628
546
|
}
|
|
629
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* @param {Array<any>} js_txs
|
|
550
|
+
* @returns {any}
|
|
551
|
+
*/
|
|
552
|
+
mineBlock(js_txs) {
|
|
553
|
+
const ret = wasm.sdk_mineBlock(this.__wbg_ptr, js_txs);
|
|
554
|
+
if (ret[2]) {
|
|
555
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
556
|
+
}
|
|
557
|
+
return takeFromExternrefTable0(ret[0]);
|
|
558
|
+
}
|
|
630
559
|
/**
|
|
631
560
|
* @param {CallFnArgs} args
|
|
632
561
|
* @returns {TransactionRes}
|
|
633
562
|
*/
|
|
634
|
-
|
|
563
|
+
callPublicFn(args) {
|
|
635
564
|
_assertClass(args, CallFnArgs);
|
|
636
|
-
const ret = wasm.
|
|
565
|
+
const ret = wasm.sdk_callPublicFn(this.__wbg_ptr, args.__wbg_ptr);
|
|
566
|
+
if (ret[2]) {
|
|
567
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
568
|
+
}
|
|
569
|
+
return TransactionRes.__wrap(ret[0]);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* @param {boolean} include_boot_contracts
|
|
573
|
+
* @param {string} boot_contracts_path
|
|
574
|
+
* @returns {SessionReport}
|
|
575
|
+
*/
|
|
576
|
+
collectReport(include_boot_contracts, boot_contracts_path) {
|
|
577
|
+
const ptr0 = passStringToWasm0(boot_contracts_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
|
+
const len0 = WASM_VECTOR_LEN;
|
|
579
|
+
const ret = wasm.sdk_collectReport(this.__wbg_ptr, include_boot_contracts, ptr0, len0);
|
|
580
|
+
if (ret[2]) {
|
|
581
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
582
|
+
}
|
|
583
|
+
return SessionReport.__wrap(ret[0]);
|
|
584
|
+
}
|
|
585
|
+
/**
|
|
586
|
+
* @returns {bigint}
|
|
587
|
+
*/
|
|
588
|
+
getBlockTime() {
|
|
589
|
+
const ret = wasm.sdk_getBlockTime(this.__wbg_ptr);
|
|
590
|
+
return BigInt.asUintN(64, ret);
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* @param {CallFnArgs} args
|
|
594
|
+
* @returns {TransactionRes}
|
|
595
|
+
*/
|
|
596
|
+
callPrivateFn(args) {
|
|
597
|
+
_assertClass(args, CallFnArgs);
|
|
598
|
+
const ret = wasm.sdk_callPrivateFn(this.__wbg_ptr, args.__wbg_ptr);
|
|
637
599
|
if (ret[2]) {
|
|
638
600
|
throw takeFromExternrefTable0(ret[1]);
|
|
639
601
|
}
|
|
@@ -652,65 +614,157 @@ export class SDK {
|
|
|
652
614
|
return TransactionRes.__wrap(ret[0]);
|
|
653
615
|
}
|
|
654
616
|
/**
|
|
655
|
-
* @param {
|
|
656
|
-
* @returns {
|
|
617
|
+
* @param {string} snippet
|
|
618
|
+
* @returns {string}
|
|
657
619
|
*/
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
620
|
+
executeCommand(snippet) {
|
|
621
|
+
let deferred2_0;
|
|
622
|
+
let deferred2_1;
|
|
623
|
+
try {
|
|
624
|
+
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
625
|
+
const len0 = WASM_VECTOR_LEN;
|
|
626
|
+
const ret = wasm.sdk_executeCommand(this.__wbg_ptr, ptr0, len0);
|
|
627
|
+
deferred2_0 = ret[0];
|
|
628
|
+
deferred2_1 = ret[1];
|
|
629
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
630
|
+
} finally {
|
|
631
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* @returns {Map<string, Map<string, bigint>>}
|
|
636
|
+
*/
|
|
637
|
+
getAssetsMap() {
|
|
638
|
+
const ret = wasm.sdk_getAssetsMap(this.__wbg_ptr);
|
|
661
639
|
if (ret[2]) {
|
|
662
640
|
throw takeFromExternrefTable0(ret[1]);
|
|
663
641
|
}
|
|
664
|
-
return
|
|
642
|
+
return takeFromExternrefTable0(ret[0]);
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* @param {string} contract
|
|
646
|
+
* @returns {IContractAST}
|
|
647
|
+
*/
|
|
648
|
+
getContractAST(contract) {
|
|
649
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
650
|
+
const len0 = WASM_VECTOR_LEN;
|
|
651
|
+
const ret = wasm.sdk_getContractAST(this.__wbg_ptr, ptr0, len0);
|
|
652
|
+
if (ret[2]) {
|
|
653
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
654
|
+
}
|
|
655
|
+
return takeFromExternrefTable0(ret[0]);
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* @returns {number}
|
|
659
|
+
*/
|
|
660
|
+
mineEmptyBlock() {
|
|
661
|
+
const ret = wasm.sdk_mineEmptyBlock(this.__wbg_ptr);
|
|
662
|
+
return ret >>> 0;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @returns {number}
|
|
666
|
+
*/
|
|
667
|
+
get burnBlockHeight() {
|
|
668
|
+
const ret = wasm.sdk_burnBlockHeight(this.__wbg_ptr);
|
|
669
|
+
return ret >>> 0;
|
|
665
670
|
}
|
|
666
671
|
/**
|
|
667
672
|
* @param {CallFnArgs} args
|
|
668
673
|
* @returns {TransactionRes}
|
|
669
674
|
*/
|
|
670
|
-
|
|
675
|
+
callReadOnlyFn(args) {
|
|
671
676
|
_assertClass(args, CallFnArgs);
|
|
672
|
-
const ret = wasm.
|
|
677
|
+
const ret = wasm.sdk_callReadOnlyFn(this.__wbg_ptr, args.__wbg_ptr);
|
|
673
678
|
if (ret[2]) {
|
|
674
679
|
throw takeFromExternrefTable0(ret[1]);
|
|
675
680
|
}
|
|
676
681
|
return TransactionRes.__wrap(ret[0]);
|
|
677
682
|
}
|
|
678
683
|
/**
|
|
679
|
-
* @
|
|
680
|
-
* @returns {TransactionRes}
|
|
684
|
+
* @returns {EpochString}
|
|
681
685
|
*/
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
686
|
+
static getDefaultEpoch() {
|
|
687
|
+
const ret = wasm.sdk_getDefaultEpoch();
|
|
688
|
+
return ret;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* @param {number | null} [count]
|
|
692
|
+
* @returns {number}
|
|
693
|
+
*/
|
|
694
|
+
mineEmptyBlocks(count) {
|
|
695
|
+
const ret = wasm.sdk_mineEmptyBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
696
|
+
return ret >>> 0;
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* @param {string} cost_field
|
|
700
|
+
*/
|
|
701
|
+
enablePerformance(cost_field) {
|
|
702
|
+
const ptr0 = passStringToWasm0(cost_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
703
|
+
const len0 = WASM_VECTOR_LEN;
|
|
704
|
+
const ret = wasm.sdk_enablePerformance(this.__wbg_ptr, ptr0, len0);
|
|
705
|
+
if (ret[1]) {
|
|
706
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
687
707
|
}
|
|
688
|
-
return TransactionRes.__wrap(ret[0]);
|
|
689
708
|
}
|
|
690
709
|
/**
|
|
691
|
-
* @param {
|
|
692
|
-
* @returns {
|
|
710
|
+
* @param {any} remote_data_settings
|
|
711
|
+
* @returns {Promise<void>}
|
|
693
712
|
*/
|
|
694
|
-
|
|
695
|
-
const ret = wasm.
|
|
696
|
-
|
|
697
|
-
|
|
713
|
+
initEmptySession(remote_data_settings) {
|
|
714
|
+
const ret = wasm.sdk_initEmptySession(this.__wbg_ptr, remote_data_settings);
|
|
715
|
+
return ret;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* @param {string[]} addresses
|
|
719
|
+
*/
|
|
720
|
+
setLocalAccounts(addresses) {
|
|
721
|
+
const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc);
|
|
722
|
+
const len0 = WASM_VECTOR_LEN;
|
|
723
|
+
wasm.sdk_setLocalAccounts(this.__wbg_ptr, ptr0, len0);
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* @param {string} contract
|
|
727
|
+
* @returns {string | undefined}
|
|
728
|
+
*/
|
|
729
|
+
getContractSource(contract) {
|
|
730
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
731
|
+
const len0 = WASM_VECTOR_LEN;
|
|
732
|
+
const ret = wasm.sdk_getContractSource(this.__wbg_ptr, ptr0, len0);
|
|
733
|
+
let v2;
|
|
734
|
+
if (ret[0] !== 0) {
|
|
735
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
736
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
698
737
|
}
|
|
699
|
-
return
|
|
738
|
+
return v2;
|
|
700
739
|
}
|
|
701
740
|
/**
|
|
702
741
|
* @returns {number}
|
|
703
742
|
*/
|
|
704
|
-
|
|
705
|
-
const ret = wasm.
|
|
743
|
+
get stacksBlockHeight() {
|
|
744
|
+
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
706
745
|
return ret >>> 0;
|
|
707
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* @returns {number}
|
|
749
|
+
*/
|
|
750
|
+
mineEmptyBurnBlock() {
|
|
751
|
+
const ret = wasm.sdk_mineEmptyBurnBlock(this.__wbg_ptr);
|
|
752
|
+
return ret >>> 0;
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* @param {string} test_name
|
|
756
|
+
*/
|
|
757
|
+
setCurrentTestName(test_name) {
|
|
758
|
+
const ptr0 = passStringToWasm0(test_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
759
|
+
const len0 = WASM_VECTOR_LEN;
|
|
760
|
+
wasm.sdk_setCurrentTestName(this.__wbg_ptr, ptr0, len0);
|
|
761
|
+
}
|
|
708
762
|
/**
|
|
709
763
|
* @param {number | null} [count]
|
|
710
764
|
* @returns {number}
|
|
711
765
|
*/
|
|
712
|
-
|
|
713
|
-
const ret = wasm.
|
|
766
|
+
mineEmptyBurnBlocks(count) {
|
|
767
|
+
const ret = wasm.sdk_mineEmptyBurnBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
714
768
|
return ret >>> 0;
|
|
715
769
|
}
|
|
716
770
|
/**
|
|
@@ -723,6 +777,16 @@ export class SDK {
|
|
|
723
777
|
}
|
|
724
778
|
return ret[0] >>> 0;
|
|
725
779
|
}
|
|
780
|
+
/**
|
|
781
|
+
* @returns {Map<string, IContractInterface>}
|
|
782
|
+
*/
|
|
783
|
+
getContractsInterfaces() {
|
|
784
|
+
const ret = wasm.sdk_getContractsInterfaces(this.__wbg_ptr);
|
|
785
|
+
if (ret[2]) {
|
|
786
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
787
|
+
}
|
|
788
|
+
return takeFromExternrefTable0(ret[0]);
|
|
789
|
+
}
|
|
726
790
|
/**
|
|
727
791
|
* @param {number | null} [count]
|
|
728
792
|
* @returns {number}
|
|
@@ -735,37 +799,39 @@ export class SDK {
|
|
|
735
799
|
return ret[0] >>> 0;
|
|
736
800
|
}
|
|
737
801
|
/**
|
|
738
|
-
*
|
|
802
|
+
* Returns the last contract call trace as a string, if available.
|
|
803
|
+
* @returns {string | undefined}
|
|
739
804
|
*/
|
|
740
|
-
|
|
741
|
-
const ret = wasm.
|
|
742
|
-
|
|
805
|
+
getLastContractCallTrace() {
|
|
806
|
+
const ret = wasm.sdk_getLastContractCallTrace(this.__wbg_ptr);
|
|
807
|
+
let v1;
|
|
808
|
+
if (ret[0] !== 0) {
|
|
809
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
810
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
811
|
+
}
|
|
812
|
+
return v1;
|
|
743
813
|
}
|
|
744
814
|
/**
|
|
745
|
-
* @param {
|
|
746
|
-
* @
|
|
815
|
+
* @param {Function} fs_request
|
|
816
|
+
* @param {SDKOptions | null} [options]
|
|
747
817
|
*/
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
818
|
+
constructor(fs_request, options) {
|
|
819
|
+
let ptr0 = 0;
|
|
820
|
+
if (!isLikeNone(options)) {
|
|
821
|
+
_assertClass(options, SDKOptions);
|
|
822
|
+
ptr0 = options.__destroy_into_raw();
|
|
823
|
+
}
|
|
824
|
+
const ret = wasm.sdk_new(fs_request, ptr0);
|
|
825
|
+
this.__wbg_ptr = ret >>> 0;
|
|
826
|
+
SDKFinalization.register(this, this.__wbg_ptr, this);
|
|
827
|
+
return this;
|
|
751
828
|
}
|
|
752
829
|
/**
|
|
753
|
-
* @
|
|
754
|
-
* @returns {string}
|
|
830
|
+
* @returns {ClarityVersionString}
|
|
755
831
|
*/
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
try {
|
|
760
|
-
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
761
|
-
const len0 = WASM_VECTOR_LEN;
|
|
762
|
-
const ret = wasm.sdk_runSnippet(this.__wbg_ptr, ptr0, len0);
|
|
763
|
-
deferred2_0 = ret[0];
|
|
764
|
-
deferred2_1 = ret[1];
|
|
765
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
766
|
-
} finally {
|
|
767
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
768
|
-
}
|
|
832
|
+
getDefaultClarityVersionForCurrentEpoch() {
|
|
833
|
+
const ret = wasm.sdk_getDefaultClarityVersionForCurrentEpoch(this.__wbg_ptr);
|
|
834
|
+
return ret;
|
|
769
835
|
}
|
|
770
836
|
/**
|
|
771
837
|
* @param {string} snippet
|
|
@@ -781,43 +847,32 @@ export class SDK {
|
|
|
781
847
|
return TransactionRes.__wrap(ret[0]);
|
|
782
848
|
}
|
|
783
849
|
/**
|
|
784
|
-
* @param {string}
|
|
850
|
+
* @param {string} token
|
|
851
|
+
* @param {string} recipient
|
|
852
|
+
* @param {bigint} amount
|
|
785
853
|
* @returns {string}
|
|
786
854
|
*/
|
|
787
|
-
|
|
788
|
-
let
|
|
789
|
-
let
|
|
855
|
+
mintFT(token, recipient, amount) {
|
|
856
|
+
let deferred4_0;
|
|
857
|
+
let deferred4_1;
|
|
790
858
|
try {
|
|
791
|
-
const ptr0 = passStringToWasm0(
|
|
859
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
792
860
|
const len0 = WASM_VECTOR_LEN;
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
861
|
+
const ptr1 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
862
|
+
const len1 = WASM_VECTOR_LEN;
|
|
863
|
+
const ret = wasm.sdk_mintFT(this.__wbg_ptr, ptr0, len0, ptr1, len1, amount);
|
|
864
|
+
var ptr3 = ret[0];
|
|
865
|
+
var len3 = ret[1];
|
|
866
|
+
if (ret[3]) {
|
|
867
|
+
ptr3 = 0; len3 = 0;
|
|
868
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
869
|
+
}
|
|
870
|
+
deferred4_0 = ptr3;
|
|
871
|
+
deferred4_1 = len3;
|
|
872
|
+
return getStringFromWasm0(ptr3, len3);
|
|
797
873
|
} finally {
|
|
798
|
-
wasm.__wbindgen_free(
|
|
799
|
-
}
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* Returns the last contract call trace as a string, if available.
|
|
803
|
-
* @returns {string | undefined}
|
|
804
|
-
*/
|
|
805
|
-
getLastContractCallTrace() {
|
|
806
|
-
const ret = wasm.sdk_getLastContractCallTrace(this.__wbg_ptr);
|
|
807
|
-
let v1;
|
|
808
|
-
if (ret[0] !== 0) {
|
|
809
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
810
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
874
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
811
875
|
}
|
|
812
|
-
return v1;
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* @param {string[]} addresses
|
|
816
|
-
*/
|
|
817
|
-
setLocalAccounts(addresses) {
|
|
818
|
-
const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc);
|
|
819
|
-
const len0 = WASM_VECTOR_LEN;
|
|
820
|
-
wasm.sdk_setLocalAccounts(this.__wbg_ptr, ptr0, len0);
|
|
821
876
|
}
|
|
822
877
|
/**
|
|
823
878
|
* @param {string} recipient
|
|
@@ -845,37 +900,10 @@ export class SDK {
|
|
|
845
900
|
}
|
|
846
901
|
}
|
|
847
902
|
/**
|
|
848
|
-
* @param {
|
|
849
|
-
*/
|
|
850
|
-
setCurrentTestName(test_name) {
|
|
851
|
-
const ptr0 = passStringToWasm0(test_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
852
|
-
const len0 = WASM_VECTOR_LEN;
|
|
853
|
-
wasm.sdk_setCurrentTestName(this.__wbg_ptr, ptr0, len0);
|
|
854
|
-
}
|
|
855
|
-
/**
|
|
856
|
-
* @param {boolean} include_boot_contracts
|
|
857
|
-
* @param {string} boot_contracts_path
|
|
858
|
-
* @returns {SessionReport}
|
|
859
|
-
*/
|
|
860
|
-
collectReport(include_boot_contracts, boot_contracts_path) {
|
|
861
|
-
const ptr0 = passStringToWasm0(boot_contracts_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
862
|
-
const len0 = WASM_VECTOR_LEN;
|
|
863
|
-
const ret = wasm.sdk_collectReport(this.__wbg_ptr, include_boot_contracts, ptr0, len0);
|
|
864
|
-
if (ret[2]) {
|
|
865
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
866
|
-
}
|
|
867
|
-
return SessionReport.__wrap(ret[0]);
|
|
868
|
-
}
|
|
869
|
-
/**
|
|
870
|
-
* @param {string} cost_field
|
|
903
|
+
* @param {EpochString} epoch
|
|
871
904
|
*/
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
const len0 = WASM_VECTOR_LEN;
|
|
875
|
-
const ret = wasm.sdk_enablePerformance(this.__wbg_ptr, ptr0, len0);
|
|
876
|
-
if (ret[1]) {
|
|
877
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
878
|
-
}
|
|
905
|
+
setEpoch(epoch) {
|
|
906
|
+
wasm.sdk_setEpoch(this.__wbg_ptr, epoch);
|
|
879
907
|
}
|
|
880
908
|
}
|
|
881
909
|
|
|
@@ -896,6 +924,17 @@ export class SDKOptions {
|
|
|
896
924
|
const ptr = this.__destroy_into_raw();
|
|
897
925
|
wasm.__wbg_sdkoptions_free(ptr, 0);
|
|
898
926
|
}
|
|
927
|
+
/**
|
|
928
|
+
* @param {boolean} track_costs
|
|
929
|
+
* @param {boolean} track_coverage
|
|
930
|
+
* @param {boolean | null} [track_performance]
|
|
931
|
+
*/
|
|
932
|
+
constructor(track_costs, track_coverage, track_performance) {
|
|
933
|
+
const ret = wasm.sdkoptions_new(track_costs, track_coverage, isLikeNone(track_performance) ? 0xFFFFFF : track_performance ? 1 : 0);
|
|
934
|
+
this.__wbg_ptr = ret >>> 0;
|
|
935
|
+
SDKOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
936
|
+
return this;
|
|
937
|
+
}
|
|
899
938
|
/**
|
|
900
939
|
* @returns {boolean}
|
|
901
940
|
*/
|
|
@@ -935,17 +974,6 @@ export class SDKOptions {
|
|
|
935
974
|
set trackPerformance(arg0) {
|
|
936
975
|
wasm.__wbg_set_sdkoptions_trackPerformance(this.__wbg_ptr, arg0);
|
|
937
976
|
}
|
|
938
|
-
/**
|
|
939
|
-
* @param {boolean} track_costs
|
|
940
|
-
* @param {boolean} track_coverage
|
|
941
|
-
* @param {boolean | null} [track_performance]
|
|
942
|
-
*/
|
|
943
|
-
constructor(track_costs, track_coverage, track_performance) {
|
|
944
|
-
const ret = wasm.sdkoptions_new(track_costs, track_coverage, isLikeNone(track_performance) ? 0xFFFFFF : track_performance ? 1 : 0);
|
|
945
|
-
this.__wbg_ptr = ret >>> 0;
|
|
946
|
-
SDKOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
947
|
-
return this;
|
|
948
|
-
}
|
|
949
977
|
}
|
|
950
978
|
|
|
951
979
|
const SessionReportFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -1429,7 +1457,7 @@ function __wbg_get_imports() {
|
|
|
1429
1457
|
const a = state0.a;
|
|
1430
1458
|
state0.a = 0;
|
|
1431
1459
|
try {
|
|
1432
|
-
return
|
|
1460
|
+
return __wbg_adapter_228(a, state0.b, arg0, arg1);
|
|
1433
1461
|
} finally {
|
|
1434
1462
|
state0.a = a;
|
|
1435
1463
|
}
|
|
@@ -1622,7 +1650,7 @@ function __wbg_get_imports() {
|
|
|
1622
1650
|
const ret = arg0.versions;
|
|
1623
1651
|
return ret;
|
|
1624
1652
|
};
|
|
1625
|
-
imports.wbg.
|
|
1653
|
+
imports.wbg.__wbg_vfs_f55de1a13819b6e9 = function(arg0, arg1, arg2) {
|
|
1626
1654
|
let deferred0_0;
|
|
1627
1655
|
let deferred0_1;
|
|
1628
1656
|
try {
|
|
@@ -1702,11 +1730,6 @@ function __wbg_get_imports() {
|
|
|
1702
1730
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1703
1731
|
return ret;
|
|
1704
1732
|
};
|
|
1705
|
-
imports.wbg.__wbindgen_cast_29d9d4936f0ef296 = function(arg0, arg1) {
|
|
1706
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 606, function: Function { arguments: [Externref], shim_idx: 607, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1707
|
-
const ret = makeMutClosure(arg0, arg1, 606, __wbg_adapter_8);
|
|
1708
|
-
return ret;
|
|
1709
|
-
};
|
|
1710
1733
|
imports.wbg.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
|
|
1711
1734
|
// Cast intrinsic for `I128 -> Externref`.
|
|
1712
1735
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
@@ -1717,9 +1740,14 @@ function __wbg_get_imports() {
|
|
|
1717
1740
|
const ret = BigInt.asUintN(64, arg0);
|
|
1718
1741
|
return ret;
|
|
1719
1742
|
};
|
|
1720
|
-
imports.wbg.
|
|
1721
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1722
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1743
|
+
imports.wbg.__wbindgen_cast_4ee81445540451b2 = function(arg0, arg1) {
|
|
1744
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 617, function: Function { arguments: [Externref], shim_idx: 618, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1745
|
+
const ret = makeMutClosure(arg0, arg1, 617, __wbg_adapter_19);
|
|
1746
|
+
return ret;
|
|
1747
|
+
};
|
|
1748
|
+
imports.wbg.__wbindgen_cast_73996509814681e3 = function(arg0, arg1) {
|
|
1749
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 420, function: Function { arguments: [], shim_idx: 421, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1750
|
+
const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_16);
|
|
1723
1751
|
return ret;
|
|
1724
1752
|
};
|
|
1725
1753
|
imports.wbg.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
|
package/clarinet_sdk_bg.wasm
CHANGED
|
Binary file
|