@stacks/clarinet-sdk-wasm 3.8.1 → 3.9.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 +111 -110
- package/clarinet_sdk.js +316 -288
- package/clarinet_sdk_bg.wasm +0 -0
- package/package.json +1 -1
package/clarinet_sdk.d.ts
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
type ContractInterfaceFunctionAccess = "private" | "public" | "read_only";
|
|
4
|
+
|
|
5
|
+
type IContractAST = {
|
|
6
|
+
contract_identifier: any;
|
|
7
|
+
pre_expressions: any[];
|
|
8
|
+
expressions: Expression[];
|
|
9
|
+
top_level_expression_sorting: number[];
|
|
10
|
+
referenced_traits: Map<any, any>;
|
|
11
|
+
implemented_traits: any[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type ContractInterfaceNonFungibleTokens = { name: string; type: ContractInterfaceAtomType };
|
|
15
|
+
|
|
16
|
+
type Expression = {
|
|
17
|
+
expr: ExpressionType;
|
|
18
|
+
id: number;
|
|
19
|
+
span: Span;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type ExpressionType = Atom | AtomValue | List | LiteralValue | Field | TraitReference;
|
|
23
|
+
|
|
24
|
+
type ContractInterfaceVariable = {
|
|
25
|
+
name: string;
|
|
26
|
+
type: ContractInterfaceAtomType;
|
|
27
|
+
access: ContractInterfaceVariableAccess;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type IContractInterface = {
|
|
31
|
+
functions: ContractInterfaceFunction[];
|
|
32
|
+
variables: ContractInterfaceVariable[];
|
|
33
|
+
maps: ContractInterfaceMap[];
|
|
34
|
+
fungible_tokens: ContractInterfaceFungibleTokens[];
|
|
35
|
+
non_fungible_tokens: ContractInterfaceNonFungibleTokens[];
|
|
36
|
+
epoch: StacksEpochId;
|
|
37
|
+
clarity_version: ClarityVersionString;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
|
|
41
|
+
|
|
42
|
+
type ContractInterfaceVariableAccess = "constant" | "variable";
|
|
43
|
+
|
|
3
44
|
export type EpochString =
|
|
4
45
|
| "2.0"
|
|
5
46
|
| "2.05"
|
|
@@ -14,57 +55,50 @@ export type EpochString =
|
|
|
14
55
|
| "3.3";
|
|
15
56
|
|
|
16
57
|
|
|
17
|
-
type
|
|
18
|
-
Atom: String;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
type AtomValue = {
|
|
22
|
-
AtomValue: any;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
type List = {
|
|
26
|
-
List: Expression[];
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
type LiteralValue = {
|
|
30
|
-
LiteralValue: any;
|
|
31
|
-
};
|
|
58
|
+
type ContractInterfaceTupleEntryType = { name: string; type: ContractInterfaceAtomType };
|
|
32
59
|
|
|
33
60
|
type Field = {
|
|
34
61
|
Field: any;
|
|
35
62
|
};
|
|
36
63
|
|
|
37
|
-
type
|
|
38
|
-
|
|
64
|
+
type ContractInterfaceMap = {
|
|
65
|
+
name: string;
|
|
66
|
+
key: ContractInterfaceAtomType;
|
|
67
|
+
value: ContractInterfaceAtomType;
|
|
39
68
|
};
|
|
40
69
|
|
|
41
|
-
type
|
|
70
|
+
type ContractInterfaceFungibleTokens = { name: string };
|
|
42
71
|
|
|
43
|
-
type
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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";
|
|
49
85
|
|
|
50
|
-
type
|
|
51
|
-
expr: ExpressionType;
|
|
52
|
-
id: number;
|
|
53
|
-
span: Span;
|
|
54
|
-
};
|
|
86
|
+
type ContractInterfaceFunctionArg = { name: string; type: ContractInterfaceAtomType };
|
|
55
87
|
|
|
56
|
-
type
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
referenced_traits: Map<any, any>;
|
|
62
|
-
implemented_traits: any[];
|
|
88
|
+
type ContractInterfaceFunction = {
|
|
89
|
+
name: string;
|
|
90
|
+
access: ContractInterfaceFunctionAccess;
|
|
91
|
+
args: ContractInterfaceFunctionArg[];
|
|
92
|
+
outputs: ContractInterfaceFunctionOutput;
|
|
63
93
|
};
|
|
64
94
|
|
|
65
|
-
type
|
|
95
|
+
type AtomValue = {
|
|
96
|
+
AtomValue: any;
|
|
97
|
+
};
|
|
66
98
|
|
|
67
|
-
type
|
|
99
|
+
type TraitReference = {
|
|
100
|
+
TraitReference: any;
|
|
101
|
+
};
|
|
68
102
|
|
|
69
103
|
type ContractInterfaceAtomType =
|
|
70
104
|
| "none"
|
|
@@ -81,59 +115,25 @@ type ContractInterfaceAtomType =
|
|
|
81
115
|
| { list: { type: ContractInterfaceAtomType; length: number } }
|
|
82
116
|
| "trait_reference";
|
|
83
117
|
|
|
84
|
-
type
|
|
85
|
-
|
|
86
|
-
type ContractInterfaceFunctionOutput = { type: ContractInterfaceAtomType };
|
|
118
|
+
export type ClarityVersionString = "Clarity1" | "Clarity2" | "Clarity3"| "Clarity4";
|
|
87
119
|
|
|
88
|
-
type
|
|
89
|
-
|
|
90
|
-
access: ContractInterfaceFunctionAccess;
|
|
91
|
-
args: ContractInterfaceFunctionArg[];
|
|
92
|
-
outputs: ContractInterfaceFunctionOutput;
|
|
120
|
+
type LiteralValue = {
|
|
121
|
+
LiteralValue: any;
|
|
93
122
|
};
|
|
94
123
|
|
|
95
|
-
type
|
|
96
|
-
|
|
97
|
-
type ContractInterfaceVariable = {
|
|
98
|
-
name: string;
|
|
99
|
-
type: ContractInterfaceAtomType;
|
|
100
|
-
access: ContractInterfaceVariableAccess;
|
|
124
|
+
type Atom = {
|
|
125
|
+
Atom: String;
|
|
101
126
|
};
|
|
102
127
|
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
key: ContractInterfaceAtomType;
|
|
106
|
-
value: ContractInterfaceAtomType;
|
|
128
|
+
type List = {
|
|
129
|
+
List: Expression[];
|
|
107
130
|
};
|
|
108
131
|
|
|
109
|
-
type
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
export type IContractInterface = {
|
|
130
|
-
functions: ContractInterfaceFunction[];
|
|
131
|
-
variables: ContractInterfaceVariable[];
|
|
132
|
-
maps: ContractInterfaceMap[];
|
|
133
|
-
fungible_tokens: ContractInterfaceFungibleTokens[];
|
|
134
|
-
non_fungible_tokens: ContractInterfaceNonFungibleTokens[];
|
|
135
|
-
epoch: StacksEpochId;
|
|
136
|
-
clarity_version: ClarityVersionString;
|
|
132
|
+
type Span = {
|
|
133
|
+
start_line: number;
|
|
134
|
+
start_column: number;
|
|
135
|
+
end_line: number;
|
|
136
|
+
end_column: number;
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
export class CallFnArgs {
|
|
@@ -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;
|
package/clarinet_sdk.js
CHANGED
|
@@ -245,16 +245,16 @@ function takeFromExternrefTable0(idx) {
|
|
|
245
245
|
wasm.__externref_table_dealloc(idx);
|
|
246
246
|
return value;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
wasm.
|
|
248
|
+
function __wbg_adapter_10(arg0, arg1) {
|
|
249
|
+
wasm.wasm_bindgen__convert__closures_____invoke__ha61c3f571615b8ef(arg0, arg1);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
function
|
|
253
|
-
wasm.
|
|
252
|
+
function __wbg_adapter_21(arg0, arg1, arg2) {
|
|
253
|
+
wasm.closure618_externref_shim(arg0, arg1, arg2);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
function
|
|
257
|
-
wasm.
|
|
256
|
+
function __wbg_adapter_224(arg0, arg1, arg2, arg3) {
|
|
257
|
+
wasm.closure3361_externref_shim(arg0, arg1, arg2, arg3);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
@@ -412,42 +412,70 @@ class SDK {
|
|
|
412
412
|
const len0 = WASM_VECTOR_LEN;
|
|
413
413
|
wasm.__wbg_set_sdk_deployer(this.__wbg_ptr, ptr0, len0);
|
|
414
414
|
}
|
|
415
|
+
clearCache() {
|
|
416
|
+
wasm.sdk_clearCache(this.__wbg_ptr);
|
|
417
|
+
}
|
|
415
418
|
/**
|
|
416
|
-
* @param {
|
|
417
|
-
* @
|
|
419
|
+
* @param {string} snippet
|
|
420
|
+
* @returns {string}
|
|
418
421
|
*/
|
|
419
|
-
|
|
420
|
-
let
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
ptr0 =
|
|
422
|
+
runSnippet(snippet) {
|
|
423
|
+
let deferred2_0;
|
|
424
|
+
let deferred2_1;
|
|
425
|
+
try {
|
|
426
|
+
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
427
|
+
const len0 = WASM_VECTOR_LEN;
|
|
428
|
+
const ret = wasm.sdk_runSnippet(this.__wbg_ptr, ptr0, len0);
|
|
429
|
+
deferred2_0 = ret[0];
|
|
430
|
+
deferred2_1 = ret[1];
|
|
431
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
432
|
+
} finally {
|
|
433
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
424
434
|
}
|
|
425
|
-
const ret = wasm.sdk_new(fs_request, ptr0);
|
|
426
|
-
this.__wbg_ptr = ret >>> 0;
|
|
427
|
-
SDKFinalization.register(this, this.__wbg_ptr, this);
|
|
428
|
-
return this;
|
|
429
435
|
}
|
|
430
436
|
/**
|
|
431
|
-
* @returns {
|
|
437
|
+
* @returns {number}
|
|
432
438
|
*/
|
|
433
|
-
|
|
434
|
-
const ret = wasm.
|
|
435
|
-
return ret;
|
|
439
|
+
get blockHeight() {
|
|
440
|
+
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
441
|
+
return ret >>> 0;
|
|
436
442
|
}
|
|
437
443
|
/**
|
|
438
|
-
* @returns {
|
|
444
|
+
* @returns {Map<string, string>}
|
|
439
445
|
*/
|
|
440
|
-
|
|
441
|
-
const ret = wasm.
|
|
442
|
-
|
|
446
|
+
getAccounts() {
|
|
447
|
+
const ret = wasm.sdk_getAccounts(this.__wbg_ptr);
|
|
448
|
+
if (ret[2]) {
|
|
449
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
450
|
+
}
|
|
451
|
+
return takeFromExternrefTable0(ret[0]);
|
|
443
452
|
}
|
|
444
453
|
/**
|
|
445
|
-
* @param {
|
|
446
|
-
* @
|
|
454
|
+
* @param {string} contract
|
|
455
|
+
* @param {string} var_name
|
|
456
|
+
* @returns {string}
|
|
447
457
|
*/
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
458
|
+
getDataVar(contract, var_name) {
|
|
459
|
+
let deferred4_0;
|
|
460
|
+
let deferred4_1;
|
|
461
|
+
try {
|
|
462
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
463
|
+
const len0 = WASM_VECTOR_LEN;
|
|
464
|
+
const ptr1 = passStringToWasm0(var_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
465
|
+
const len1 = WASM_VECTOR_LEN;
|
|
466
|
+
const ret = wasm.sdk_getDataVar(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
467
|
+
var ptr3 = ret[0];
|
|
468
|
+
var len3 = ret[1];
|
|
469
|
+
if (ret[3]) {
|
|
470
|
+
ptr3 = 0; len3 = 0;
|
|
471
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
472
|
+
}
|
|
473
|
+
deferred4_0 = ptr3;
|
|
474
|
+
deferred4_1 = len3;
|
|
475
|
+
return getStringFromWasm0(ptr3, len3);
|
|
476
|
+
} finally {
|
|
477
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
478
|
+
}
|
|
451
479
|
}
|
|
452
480
|
/**
|
|
453
481
|
* @param {string} cwd
|
|
@@ -462,29 +490,17 @@ class SDK {
|
|
|
462
490
|
const ret = wasm.sdk_initSession(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
463
491
|
return ret;
|
|
464
492
|
}
|
|
465
|
-
clearCache() {
|
|
466
|
-
wasm.sdk_clearCache(this.__wbg_ptr);
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* @returns {number}
|
|
470
|
-
*/
|
|
471
|
-
get blockHeight() {
|
|
472
|
-
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
473
|
-
return ret >>> 0;
|
|
474
|
-
}
|
|
475
493
|
/**
|
|
476
|
-
* @
|
|
477
|
-
|
|
478
|
-
get stacksBlockHeight() {
|
|
479
|
-
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
480
|
-
return ret >>> 0;
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* @returns {number}
|
|
494
|
+
* @param {TransferSTXArgs} args
|
|
495
|
+
* @returns {TransactionRes}
|
|
484
496
|
*/
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
497
|
+
transferSTX(args) {
|
|
498
|
+
_assertClass(args, TransferSTXArgs);
|
|
499
|
+
const ret = wasm.sdk_transferSTX(this.__wbg_ptr, args.__wbg_ptr);
|
|
500
|
+
if (ret[2]) {
|
|
501
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
502
|
+
}
|
|
503
|
+
return TransactionRes.__wrap(ret[0]);
|
|
488
504
|
}
|
|
489
505
|
/**
|
|
490
506
|
* @returns {string}
|
|
@@ -502,132 +518,157 @@ class SDK {
|
|
|
502
518
|
}
|
|
503
519
|
}
|
|
504
520
|
/**
|
|
505
|
-
* @param {
|
|
521
|
+
* @param {string} contract
|
|
522
|
+
* @param {string} map_name
|
|
523
|
+
* @param {Uint8Array} map_key
|
|
524
|
+
* @returns {string}
|
|
506
525
|
*/
|
|
507
|
-
|
|
508
|
-
|
|
526
|
+
getMapEntry(contract, map_name, map_key) {
|
|
527
|
+
let deferred5_0;
|
|
528
|
+
let deferred5_1;
|
|
529
|
+
try {
|
|
530
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
531
|
+
const len0 = WASM_VECTOR_LEN;
|
|
532
|
+
const ptr1 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
533
|
+
const len1 = WASM_VECTOR_LEN;
|
|
534
|
+
const ptr2 = passArray8ToWasm0(map_key, wasm.__wbindgen_malloc);
|
|
535
|
+
const len2 = WASM_VECTOR_LEN;
|
|
536
|
+
const ret = wasm.sdk_getMapEntry(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
537
|
+
var ptr4 = ret[0];
|
|
538
|
+
var len4 = ret[1];
|
|
539
|
+
if (ret[3]) {
|
|
540
|
+
ptr4 = 0; len4 = 0;
|
|
541
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
542
|
+
}
|
|
543
|
+
deferred5_0 = ptr4;
|
|
544
|
+
deferred5_1 = len4;
|
|
545
|
+
return getStringFromWasm0(ptr4, len4);
|
|
546
|
+
} finally {
|
|
547
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
548
|
+
}
|
|
509
549
|
}
|
|
510
550
|
/**
|
|
511
|
-
* @
|
|
551
|
+
* @param {Array<any>} js_txs
|
|
552
|
+
* @returns {any}
|
|
512
553
|
*/
|
|
513
|
-
|
|
514
|
-
const ret = wasm.
|
|
554
|
+
mineBlock(js_txs) {
|
|
555
|
+
const ret = wasm.sdk_mineBlock(this.__wbg_ptr, js_txs);
|
|
515
556
|
if (ret[2]) {
|
|
516
557
|
throw takeFromExternrefTable0(ret[1]);
|
|
517
558
|
}
|
|
518
559
|
return takeFromExternrefTable0(ret[0]);
|
|
519
560
|
}
|
|
520
561
|
/**
|
|
521
|
-
* @param {
|
|
522
|
-
* @returns {
|
|
562
|
+
* @param {CallFnArgs} args
|
|
563
|
+
* @returns {TransactionRes}
|
|
523
564
|
*/
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
if (ret[0] !== 0) {
|
|
530
|
-
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
531
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
565
|
+
callPublicFn(args) {
|
|
566
|
+
_assertClass(args, CallFnArgs);
|
|
567
|
+
const ret = wasm.sdk_callPublicFn(this.__wbg_ptr, args.__wbg_ptr);
|
|
568
|
+
if (ret[2]) {
|
|
569
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
532
570
|
}
|
|
533
|
-
return
|
|
571
|
+
return TransactionRes.__wrap(ret[0]);
|
|
534
572
|
}
|
|
535
573
|
/**
|
|
536
|
-
* @param {
|
|
537
|
-
* @
|
|
574
|
+
* @param {boolean} include_boot_contracts
|
|
575
|
+
* @param {string} boot_contracts_path
|
|
576
|
+
* @returns {SessionReport}
|
|
538
577
|
*/
|
|
539
|
-
|
|
540
|
-
const ptr0 = passStringToWasm0(
|
|
578
|
+
collectReport(include_boot_contracts, boot_contracts_path) {
|
|
579
|
+
const ptr0 = passStringToWasm0(boot_contracts_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
541
580
|
const len0 = WASM_VECTOR_LEN;
|
|
542
|
-
const ret = wasm.
|
|
581
|
+
const ret = wasm.sdk_collectReport(this.__wbg_ptr, include_boot_contracts, ptr0, len0);
|
|
543
582
|
if (ret[2]) {
|
|
544
583
|
throw takeFromExternrefTable0(ret[1]);
|
|
545
584
|
}
|
|
546
|
-
return
|
|
585
|
+
return SessionReport.__wrap(ret[0]);
|
|
547
586
|
}
|
|
548
587
|
/**
|
|
549
|
-
* @returns {
|
|
588
|
+
* @returns {bigint}
|
|
550
589
|
*/
|
|
551
|
-
|
|
552
|
-
const ret = wasm.
|
|
590
|
+
getBlockTime() {
|
|
591
|
+
const ret = wasm.sdk_getBlockTime(this.__wbg_ptr);
|
|
592
|
+
return BigInt.asUintN(64, ret);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* @param {CallFnArgs} args
|
|
596
|
+
* @returns {TransactionRes}
|
|
597
|
+
*/
|
|
598
|
+
callPrivateFn(args) {
|
|
599
|
+
_assertClass(args, CallFnArgs);
|
|
600
|
+
const ret = wasm.sdk_callPrivateFn(this.__wbg_ptr, args.__wbg_ptr);
|
|
553
601
|
if (ret[2]) {
|
|
554
602
|
throw takeFromExternrefTable0(ret[1]);
|
|
555
603
|
}
|
|
556
|
-
return
|
|
604
|
+
return TransactionRes.__wrap(ret[0]);
|
|
557
605
|
}
|
|
558
606
|
/**
|
|
559
|
-
* @
|
|
607
|
+
* @param {DeployContractArgs} args
|
|
608
|
+
* @returns {TransactionRes}
|
|
560
609
|
*/
|
|
561
|
-
|
|
562
|
-
|
|
610
|
+
deployContract(args) {
|
|
611
|
+
_assertClass(args, DeployContractArgs);
|
|
612
|
+
const ret = wasm.sdk_deployContract(this.__wbg_ptr, args.__wbg_ptr);
|
|
563
613
|
if (ret[2]) {
|
|
564
614
|
throw takeFromExternrefTable0(ret[1]);
|
|
565
615
|
}
|
|
566
|
-
return
|
|
616
|
+
return TransactionRes.__wrap(ret[0]);
|
|
567
617
|
}
|
|
568
618
|
/**
|
|
569
|
-
* @param {string}
|
|
570
|
-
* @param {string} var_name
|
|
619
|
+
* @param {string} snippet
|
|
571
620
|
* @returns {string}
|
|
572
621
|
*/
|
|
573
|
-
|
|
574
|
-
let
|
|
575
|
-
let
|
|
622
|
+
executeCommand(snippet) {
|
|
623
|
+
let deferred2_0;
|
|
624
|
+
let deferred2_1;
|
|
576
625
|
try {
|
|
577
|
-
const ptr0 = passStringToWasm0(
|
|
626
|
+
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
578
627
|
const len0 = WASM_VECTOR_LEN;
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var len3 = ret[1];
|
|
584
|
-
if (ret[3]) {
|
|
585
|
-
ptr3 = 0; len3 = 0;
|
|
586
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
587
|
-
}
|
|
588
|
-
deferred4_0 = ptr3;
|
|
589
|
-
deferred4_1 = len3;
|
|
590
|
-
return getStringFromWasm0(ptr3, len3);
|
|
628
|
+
const ret = wasm.sdk_executeCommand(this.__wbg_ptr, ptr0, len0);
|
|
629
|
+
deferred2_0 = ret[0];
|
|
630
|
+
deferred2_1 = ret[1];
|
|
631
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
591
632
|
} finally {
|
|
592
|
-
wasm.__wbindgen_free(
|
|
633
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
593
634
|
}
|
|
594
635
|
}
|
|
595
636
|
/**
|
|
596
|
-
* @returns {bigint}
|
|
637
|
+
* @returns {Map<string, Map<string, bigint>>}
|
|
597
638
|
*/
|
|
598
|
-
|
|
599
|
-
const ret = wasm.
|
|
600
|
-
|
|
639
|
+
getAssetsMap() {
|
|
640
|
+
const ret = wasm.sdk_getAssetsMap(this.__wbg_ptr);
|
|
641
|
+
if (ret[2]) {
|
|
642
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
643
|
+
}
|
|
644
|
+
return takeFromExternrefTable0(ret[0]);
|
|
601
645
|
}
|
|
602
646
|
/**
|
|
603
647
|
* @param {string} contract
|
|
604
|
-
* @
|
|
605
|
-
* @param {Uint8Array} map_key
|
|
606
|
-
* @returns {string}
|
|
648
|
+
* @returns {IContractAST}
|
|
607
649
|
*/
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
const ptr1 = passStringToWasm0(map_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
615
|
-
const len1 = WASM_VECTOR_LEN;
|
|
616
|
-
const ptr2 = passArray8ToWasm0(map_key, wasm.__wbindgen_malloc);
|
|
617
|
-
const len2 = WASM_VECTOR_LEN;
|
|
618
|
-
const ret = wasm.sdk_getMapEntry(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
619
|
-
var ptr4 = ret[0];
|
|
620
|
-
var len4 = ret[1];
|
|
621
|
-
if (ret[3]) {
|
|
622
|
-
ptr4 = 0; len4 = 0;
|
|
623
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
624
|
-
}
|
|
625
|
-
deferred5_0 = ptr4;
|
|
626
|
-
deferred5_1 = len4;
|
|
627
|
-
return getStringFromWasm0(ptr4, len4);
|
|
628
|
-
} finally {
|
|
629
|
-
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
650
|
+
getContractAST(contract) {
|
|
651
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
652
|
+
const len0 = WASM_VECTOR_LEN;
|
|
653
|
+
const ret = wasm.sdk_getContractAST(this.__wbg_ptr, ptr0, len0);
|
|
654
|
+
if (ret[2]) {
|
|
655
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
630
656
|
}
|
|
657
|
+
return takeFromExternrefTable0(ret[0]);
|
|
658
|
+
}
|
|
659
|
+
/**
|
|
660
|
+
* @returns {number}
|
|
661
|
+
*/
|
|
662
|
+
mineEmptyBlock() {
|
|
663
|
+
const ret = wasm.sdk_mineEmptyBlock(this.__wbg_ptr);
|
|
664
|
+
return ret >>> 0;
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* @returns {number}
|
|
668
|
+
*/
|
|
669
|
+
get burnBlockHeight() {
|
|
670
|
+
const ret = wasm.sdk_burnBlockHeight(this.__wbg_ptr);
|
|
671
|
+
return ret >>> 0;
|
|
631
672
|
}
|
|
632
673
|
/**
|
|
633
674
|
* @param {CallFnArgs} args
|
|
@@ -642,77 +683,90 @@ class SDK {
|
|
|
642
683
|
return TransactionRes.__wrap(ret[0]);
|
|
643
684
|
}
|
|
644
685
|
/**
|
|
645
|
-
* @
|
|
646
|
-
|
|
686
|
+
* @returns {EpochString}
|
|
687
|
+
*/
|
|
688
|
+
static getDefaultEpoch() {
|
|
689
|
+
const ret = wasm.sdk_getDefaultEpoch();
|
|
690
|
+
return ret;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* @param {number | null} [count]
|
|
694
|
+
* @returns {number}
|
|
695
|
+
*/
|
|
696
|
+
mineEmptyBlocks(count) {
|
|
697
|
+
const ret = wasm.sdk_mineEmptyBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
698
|
+
return ret >>> 0;
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* @param {string} cost_field
|
|
647
702
|
*/
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
const
|
|
651
|
-
|
|
652
|
-
|
|
703
|
+
enablePerformance(cost_field) {
|
|
704
|
+
const ptr0 = passStringToWasm0(cost_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
705
|
+
const len0 = WASM_VECTOR_LEN;
|
|
706
|
+
const ret = wasm.sdk_enablePerformance(this.__wbg_ptr, ptr0, len0);
|
|
707
|
+
if (ret[1]) {
|
|
708
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
653
709
|
}
|
|
654
|
-
return TransactionRes.__wrap(ret[0]);
|
|
655
710
|
}
|
|
656
711
|
/**
|
|
657
|
-
* @param {
|
|
658
|
-
* @returns {
|
|
712
|
+
* @param {any} remote_data_settings
|
|
713
|
+
* @returns {Promise<void>}
|
|
659
714
|
*/
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
if (ret[2]) {
|
|
664
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
665
|
-
}
|
|
666
|
-
return TransactionRes.__wrap(ret[0]);
|
|
715
|
+
initEmptySession(remote_data_settings) {
|
|
716
|
+
const ret = wasm.sdk_initEmptySession(this.__wbg_ptr, remote_data_settings);
|
|
717
|
+
return ret;
|
|
667
718
|
}
|
|
668
719
|
/**
|
|
669
|
-
* @param {
|
|
670
|
-
* @returns {TransactionRes}
|
|
720
|
+
* @param {string[]} addresses
|
|
671
721
|
*/
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
676
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
677
|
-
}
|
|
678
|
-
return TransactionRes.__wrap(ret[0]);
|
|
722
|
+
setLocalAccounts(addresses) {
|
|
723
|
+
const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc);
|
|
724
|
+
const len0 = WASM_VECTOR_LEN;
|
|
725
|
+
wasm.sdk_setLocalAccounts(this.__wbg_ptr, ptr0, len0);
|
|
679
726
|
}
|
|
680
727
|
/**
|
|
681
|
-
* @param {
|
|
682
|
-
* @returns {
|
|
728
|
+
* @param {string} contract
|
|
729
|
+
* @returns {string | undefined}
|
|
683
730
|
*/
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
|
|
731
|
+
getContractSource(contract) {
|
|
732
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
733
|
+
const len0 = WASM_VECTOR_LEN;
|
|
734
|
+
const ret = wasm.sdk_getContractSource(this.__wbg_ptr, ptr0, len0);
|
|
735
|
+
let v2;
|
|
736
|
+
if (ret[0] !== 0) {
|
|
737
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
738
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
689
739
|
}
|
|
690
|
-
return
|
|
740
|
+
return v2;
|
|
691
741
|
}
|
|
692
742
|
/**
|
|
693
|
-
* @
|
|
694
|
-
* @returns {any}
|
|
743
|
+
* @returns {number}
|
|
695
744
|
*/
|
|
696
|
-
|
|
697
|
-
const ret = wasm.
|
|
698
|
-
|
|
699
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
700
|
-
}
|
|
701
|
-
return takeFromExternrefTable0(ret[0]);
|
|
745
|
+
get stacksBlockHeight() {
|
|
746
|
+
const ret = wasm.sdk_blockHeight(this.__wbg_ptr);
|
|
747
|
+
return ret >>> 0;
|
|
702
748
|
}
|
|
703
749
|
/**
|
|
704
750
|
* @returns {number}
|
|
705
751
|
*/
|
|
706
|
-
|
|
707
|
-
const ret = wasm.
|
|
752
|
+
mineEmptyBurnBlock() {
|
|
753
|
+
const ret = wasm.sdk_mineEmptyBurnBlock(this.__wbg_ptr);
|
|
708
754
|
return ret >>> 0;
|
|
709
755
|
}
|
|
756
|
+
/**
|
|
757
|
+
* @param {string} test_name
|
|
758
|
+
*/
|
|
759
|
+
setCurrentTestName(test_name) {
|
|
760
|
+
const ptr0 = passStringToWasm0(test_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
761
|
+
const len0 = WASM_VECTOR_LEN;
|
|
762
|
+
wasm.sdk_setCurrentTestName(this.__wbg_ptr, ptr0, len0);
|
|
763
|
+
}
|
|
710
764
|
/**
|
|
711
765
|
* @param {number | null} [count]
|
|
712
766
|
* @returns {number}
|
|
713
767
|
*/
|
|
714
|
-
|
|
715
|
-
const ret = wasm.
|
|
768
|
+
mineEmptyBurnBlocks(count) {
|
|
769
|
+
const ret = wasm.sdk_mineEmptyBurnBlocks(this.__wbg_ptr, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
716
770
|
return ret >>> 0;
|
|
717
771
|
}
|
|
718
772
|
/**
|
|
@@ -725,6 +779,16 @@ class SDK {
|
|
|
725
779
|
}
|
|
726
780
|
return ret[0] >>> 0;
|
|
727
781
|
}
|
|
782
|
+
/**
|
|
783
|
+
* @returns {Map<string, IContractInterface>}
|
|
784
|
+
*/
|
|
785
|
+
getContractsInterfaces() {
|
|
786
|
+
const ret = wasm.sdk_getContractsInterfaces(this.__wbg_ptr);
|
|
787
|
+
if (ret[2]) {
|
|
788
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
789
|
+
}
|
|
790
|
+
return takeFromExternrefTable0(ret[0]);
|
|
791
|
+
}
|
|
728
792
|
/**
|
|
729
793
|
* @param {number | null} [count]
|
|
730
794
|
* @returns {number}
|
|
@@ -737,37 +801,39 @@ class SDK {
|
|
|
737
801
|
return ret[0] >>> 0;
|
|
738
802
|
}
|
|
739
803
|
/**
|
|
740
|
-
*
|
|
804
|
+
* Returns the last contract call trace as a string, if available.
|
|
805
|
+
* @returns {string | undefined}
|
|
741
806
|
*/
|
|
742
|
-
|
|
743
|
-
const ret = wasm.
|
|
744
|
-
|
|
807
|
+
getLastContractCallTrace() {
|
|
808
|
+
const ret = wasm.sdk_getLastContractCallTrace(this.__wbg_ptr);
|
|
809
|
+
let v1;
|
|
810
|
+
if (ret[0] !== 0) {
|
|
811
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
812
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
813
|
+
}
|
|
814
|
+
return v1;
|
|
745
815
|
}
|
|
746
816
|
/**
|
|
747
|
-
* @param {
|
|
748
|
-
* @
|
|
817
|
+
* @param {Function} fs_request
|
|
818
|
+
* @param {SDKOptions | null} [options]
|
|
749
819
|
*/
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
820
|
+
constructor(fs_request, options) {
|
|
821
|
+
let ptr0 = 0;
|
|
822
|
+
if (!isLikeNone(options)) {
|
|
823
|
+
_assertClass(options, SDKOptions);
|
|
824
|
+
ptr0 = options.__destroy_into_raw();
|
|
825
|
+
}
|
|
826
|
+
const ret = wasm.sdk_new(fs_request, ptr0);
|
|
827
|
+
this.__wbg_ptr = ret >>> 0;
|
|
828
|
+
SDKFinalization.register(this, this.__wbg_ptr, this);
|
|
829
|
+
return this;
|
|
753
830
|
}
|
|
754
831
|
/**
|
|
755
|
-
* @
|
|
756
|
-
* @returns {string}
|
|
832
|
+
* @returns {ClarityVersionString}
|
|
757
833
|
*/
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
try {
|
|
762
|
-
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
763
|
-
const len0 = WASM_VECTOR_LEN;
|
|
764
|
-
const ret = wasm.sdk_runSnippet(this.__wbg_ptr, ptr0, len0);
|
|
765
|
-
deferred2_0 = ret[0];
|
|
766
|
-
deferred2_1 = ret[1];
|
|
767
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
768
|
-
} finally {
|
|
769
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
770
|
-
}
|
|
834
|
+
getDefaultClarityVersionForCurrentEpoch() {
|
|
835
|
+
const ret = wasm.sdk_getDefaultClarityVersionForCurrentEpoch(this.__wbg_ptr);
|
|
836
|
+
return ret;
|
|
771
837
|
}
|
|
772
838
|
/**
|
|
773
839
|
* @param {string} snippet
|
|
@@ -783,43 +849,32 @@ class SDK {
|
|
|
783
849
|
return TransactionRes.__wrap(ret[0]);
|
|
784
850
|
}
|
|
785
851
|
/**
|
|
786
|
-
* @param {string}
|
|
852
|
+
* @param {string} token
|
|
853
|
+
* @param {string} recipient
|
|
854
|
+
* @param {bigint} amount
|
|
787
855
|
* @returns {string}
|
|
788
856
|
*/
|
|
789
|
-
|
|
790
|
-
let
|
|
791
|
-
let
|
|
857
|
+
mintFT(token, recipient, amount) {
|
|
858
|
+
let deferred4_0;
|
|
859
|
+
let deferred4_1;
|
|
792
860
|
try {
|
|
793
|
-
const ptr0 = passStringToWasm0(
|
|
861
|
+
const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
794
862
|
const len0 = WASM_VECTOR_LEN;
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
863
|
+
const ptr1 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
864
|
+
const len1 = WASM_VECTOR_LEN;
|
|
865
|
+
const ret = wasm.sdk_mintFT(this.__wbg_ptr, ptr0, len0, ptr1, len1, amount);
|
|
866
|
+
var ptr3 = ret[0];
|
|
867
|
+
var len3 = ret[1];
|
|
868
|
+
if (ret[3]) {
|
|
869
|
+
ptr3 = 0; len3 = 0;
|
|
870
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
871
|
+
}
|
|
872
|
+
deferred4_0 = ptr3;
|
|
873
|
+
deferred4_1 = len3;
|
|
874
|
+
return getStringFromWasm0(ptr3, len3);
|
|
799
875
|
} finally {
|
|
800
|
-
wasm.__wbindgen_free(
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* Returns the last contract call trace as a string, if available.
|
|
805
|
-
* @returns {string | undefined}
|
|
806
|
-
*/
|
|
807
|
-
getLastContractCallTrace() {
|
|
808
|
-
const ret = wasm.sdk_getLastContractCallTrace(this.__wbg_ptr);
|
|
809
|
-
let v1;
|
|
810
|
-
if (ret[0] !== 0) {
|
|
811
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
812
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
876
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
813
877
|
}
|
|
814
|
-
return v1;
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* @param {string[]} addresses
|
|
818
|
-
*/
|
|
819
|
-
setLocalAccounts(addresses) {
|
|
820
|
-
const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc);
|
|
821
|
-
const len0 = WASM_VECTOR_LEN;
|
|
822
|
-
wasm.sdk_setLocalAccounts(this.__wbg_ptr, ptr0, len0);
|
|
823
878
|
}
|
|
824
879
|
/**
|
|
825
880
|
* @param {string} recipient
|
|
@@ -847,37 +902,10 @@ class SDK {
|
|
|
847
902
|
}
|
|
848
903
|
}
|
|
849
904
|
/**
|
|
850
|
-
* @param {
|
|
851
|
-
*/
|
|
852
|
-
setCurrentTestName(test_name) {
|
|
853
|
-
const ptr0 = passStringToWasm0(test_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
854
|
-
const len0 = WASM_VECTOR_LEN;
|
|
855
|
-
wasm.sdk_setCurrentTestName(this.__wbg_ptr, ptr0, len0);
|
|
856
|
-
}
|
|
857
|
-
/**
|
|
858
|
-
* @param {boolean} include_boot_contracts
|
|
859
|
-
* @param {string} boot_contracts_path
|
|
860
|
-
* @returns {SessionReport}
|
|
861
|
-
*/
|
|
862
|
-
collectReport(include_boot_contracts, boot_contracts_path) {
|
|
863
|
-
const ptr0 = passStringToWasm0(boot_contracts_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
864
|
-
const len0 = WASM_VECTOR_LEN;
|
|
865
|
-
const ret = wasm.sdk_collectReport(this.__wbg_ptr, include_boot_contracts, ptr0, len0);
|
|
866
|
-
if (ret[2]) {
|
|
867
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
868
|
-
}
|
|
869
|
-
return SessionReport.__wrap(ret[0]);
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* @param {string} cost_field
|
|
905
|
+
* @param {EpochString} epoch
|
|
873
906
|
*/
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
const len0 = WASM_VECTOR_LEN;
|
|
877
|
-
const ret = wasm.sdk_enablePerformance(this.__wbg_ptr, ptr0, len0);
|
|
878
|
-
if (ret[1]) {
|
|
879
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
880
|
-
}
|
|
907
|
+
setEpoch(epoch) {
|
|
908
|
+
wasm.sdk_setEpoch(this.__wbg_ptr, epoch);
|
|
881
909
|
}
|
|
882
910
|
}
|
|
883
911
|
module.exports.SDK = SDK;
|
|
@@ -899,6 +927,17 @@ class SDKOptions {
|
|
|
899
927
|
const ptr = this.__destroy_into_raw();
|
|
900
928
|
wasm.__wbg_sdkoptions_free(ptr, 0);
|
|
901
929
|
}
|
|
930
|
+
/**
|
|
931
|
+
* @param {boolean} track_costs
|
|
932
|
+
* @param {boolean} track_coverage
|
|
933
|
+
* @param {boolean | null} [track_performance]
|
|
934
|
+
*/
|
|
935
|
+
constructor(track_costs, track_coverage, track_performance) {
|
|
936
|
+
const ret = wasm.sdkoptions_new(track_costs, track_coverage, isLikeNone(track_performance) ? 0xFFFFFF : track_performance ? 1 : 0);
|
|
937
|
+
this.__wbg_ptr = ret >>> 0;
|
|
938
|
+
SDKOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
939
|
+
return this;
|
|
940
|
+
}
|
|
902
941
|
/**
|
|
903
942
|
* @returns {boolean}
|
|
904
943
|
*/
|
|
@@ -938,17 +977,6 @@ class SDKOptions {
|
|
|
938
977
|
set trackPerformance(arg0) {
|
|
939
978
|
wasm.__wbg_set_sdkoptions_trackPerformance(this.__wbg_ptr, arg0);
|
|
940
979
|
}
|
|
941
|
-
/**
|
|
942
|
-
* @param {boolean} track_costs
|
|
943
|
-
* @param {boolean} track_coverage
|
|
944
|
-
* @param {boolean | null} [track_performance]
|
|
945
|
-
*/
|
|
946
|
-
constructor(track_costs, track_coverage, track_performance) {
|
|
947
|
-
const ret = wasm.sdkoptions_new(track_costs, track_coverage, isLikeNone(track_performance) ? 0xFFFFFF : track_performance ? 1 : 0);
|
|
948
|
-
this.__wbg_ptr = ret >>> 0;
|
|
949
|
-
SDKOptionsFinalization.register(this, this.__wbg_ptr, this);
|
|
950
|
-
return this;
|
|
951
|
-
}
|
|
952
980
|
}
|
|
953
981
|
module.exports.SDKOptions = SDKOptions;
|
|
954
982
|
|
|
@@ -1284,7 +1312,7 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
1284
1312
|
}
|
|
1285
1313
|
};
|
|
1286
1314
|
|
|
1287
|
-
module.exports.
|
|
1315
|
+
module.exports.__wbg_execSync_556dd4ede81723fc = function(arg0, arg1, arg2) {
|
|
1288
1316
|
const ret = execSync(getStringFromWasm0(arg1, arg2));
|
|
1289
1317
|
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
1290
1318
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -1292,7 +1320,7 @@ module.exports.__wbg_execSync_4988208c0d656457 = function(arg0, arg1, arg2) {
|
|
|
1292
1320
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1293
1321
|
};
|
|
1294
1322
|
|
|
1295
|
-
module.exports.
|
|
1323
|
+
module.exports.__wbg_existsSync_46aca4398d5a262b = function(arg0, arg1) {
|
|
1296
1324
|
const ret = existsSync(getStringFromWasm0(arg0, arg1));
|
|
1297
1325
|
return ret;
|
|
1298
1326
|
};
|
|
@@ -1403,7 +1431,7 @@ module.exports.__wbg_log_f3c04200b995730f = function(arg0) {
|
|
|
1403
1431
|
console.log(arg0);
|
|
1404
1432
|
};
|
|
1405
1433
|
|
|
1406
|
-
module.exports.
|
|
1434
|
+
module.exports.__wbg_mkdirSync_4cfa053ed2a67697 = function(arg0, arg1, arg2) {
|
|
1407
1435
|
mkdirSync(getStringFromWasm0(arg0, arg1), arg2);
|
|
1408
1436
|
};
|
|
1409
1437
|
|
|
@@ -1454,7 +1482,7 @@ module.exports.__wbg_new_d5e3800b120e37e1 = function(arg0, arg1) {
|
|
|
1454
1482
|
const a = state0.a;
|
|
1455
1483
|
state0.a = 0;
|
|
1456
1484
|
try {
|
|
1457
|
-
return
|
|
1485
|
+
return __wbg_adapter_224(a, state0.b, arg0, arg1);
|
|
1458
1486
|
} finally {
|
|
1459
1487
|
state0.a = a;
|
|
1460
1488
|
}
|
|
@@ -1533,7 +1561,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handl
|
|
|
1533
1561
|
arg0.randomFillSync(arg1);
|
|
1534
1562
|
}, arguments) };
|
|
1535
1563
|
|
|
1536
|
-
module.exports.
|
|
1564
|
+
module.exports.__wbg_readFileSync_049189bc267c8635 = function(arg0, arg1, arg2) {
|
|
1537
1565
|
const ret = readFileSync(getStringFromWasm0(arg1, arg2));
|
|
1538
1566
|
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
1539
1567
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -1615,7 +1643,7 @@ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
|
1615
1643
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
1616
1644
|
};
|
|
1617
1645
|
|
|
1618
|
-
module.exports.
|
|
1646
|
+
module.exports.__wbg_static_accessor_ENV_44aae7330b9b3546 = function() {
|
|
1619
1647
|
const ret = env;
|
|
1620
1648
|
return ret;
|
|
1621
1649
|
};
|
|
@@ -1758,7 +1786,7 @@ module.exports.__wbg_wbindgenthrow_4c11a24fca429ccf = function(arg0, arg1) {
|
|
|
1758
1786
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1759
1787
|
};
|
|
1760
1788
|
|
|
1761
|
-
module.exports.
|
|
1789
|
+
module.exports.__wbg_writeFileSync_5b6ae73880998457 = function(arg0, arg1, arg2, arg3) {
|
|
1762
1790
|
writeFileSync(getStringFromWasm0(arg0, arg1), getArrayU8FromWasm0(arg2, arg3));
|
|
1763
1791
|
};
|
|
1764
1792
|
|
|
@@ -1768,12 +1796,6 @@ module.exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
|
1768
1796
|
return ret;
|
|
1769
1797
|
};
|
|
1770
1798
|
|
|
1771
|
-
module.exports.__wbindgen_cast_29d9d4936f0ef296 = function(arg0, arg1) {
|
|
1772
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 606, function: Function { arguments: [Externref], shim_idx: 607, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1773
|
-
const ret = makeMutClosure(arg0, arg1, 606, __wbg_adapter_17);
|
|
1774
|
-
return ret;
|
|
1775
|
-
};
|
|
1776
|
-
|
|
1777
1799
|
module.exports.__wbindgen_cast_2ddd8a25ff58642a = function(arg0, arg1) {
|
|
1778
1800
|
// Cast intrinsic for `I128 -> Externref`.
|
|
1779
1801
|
const ret = (BigInt.asUintN(64, arg0) | (arg1 << BigInt(64)));
|
|
@@ -1786,9 +1808,15 @@ module.exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
|
1786
1808
|
return ret;
|
|
1787
1809
|
};
|
|
1788
1810
|
|
|
1789
|
-
module.exports.
|
|
1790
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1791
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1811
|
+
module.exports.__wbindgen_cast_4ee81445540451b2 = function(arg0, arg1) {
|
|
1812
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 617, function: Function { arguments: [Externref], shim_idx: 618, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1813
|
+
const ret = makeMutClosure(arg0, arg1, 617, __wbg_adapter_21);
|
|
1814
|
+
return ret;
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
module.exports.__wbindgen_cast_73996509814681e3 = function(arg0, arg1) {
|
|
1818
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 420, function: Function { arguments: [], shim_idx: 421, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1819
|
+
const ret = makeMutClosure(arg0, arg1, 420, __wbg_adapter_10);
|
|
1792
1820
|
return ret;
|
|
1793
1821
|
};
|
|
1794
1822
|
|
package/clarinet_sdk_bg.wasm
CHANGED
|
Binary file
|