@stacks/clarinet-sdk-wasm-browser 3.23.1 → 3.24.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 +18 -11
- package/clarinet_sdk.js +52 -18
- package/clarinet_sdk_bg.wasm +0 -0
- package/package.json +1 -1
package/clarinet_sdk.d.ts
CHANGED
|
@@ -144,7 +144,7 @@ type TraitReference = {
|
|
|
144
144
|
export class CallFnArgs {
|
|
145
145
|
free(): void;
|
|
146
146
|
[Symbol.dispose](): void;
|
|
147
|
-
constructor(contract: string, method: string, args: Uint8Array[], sender: string);
|
|
147
|
+
constructor(contract: string, method: string, args: Uint8Array[], sender: string, post_conditions?: string[] | null, post_condition_mode?: string | null);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export class ContractOptions {
|
|
@@ -156,7 +156,7 @@ export class ContractOptions {
|
|
|
156
156
|
export class DeployContractArgs {
|
|
157
157
|
free(): void;
|
|
158
158
|
[Symbol.dispose](): void;
|
|
159
|
-
constructor(name: string, content: string, options: ContractOptions, sender: string);
|
|
159
|
+
constructor(name: string, content: string, options: ContractOptions, sender: string, post_conditions?: string[] | null, post_condition_mode?: string | null);
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
export class SDK {
|
|
@@ -172,6 +172,12 @@ export class SDK {
|
|
|
172
172
|
execute(snippet: string): TransactionRes;
|
|
173
173
|
executeCommand(snippet: string): string;
|
|
174
174
|
generateDeploymentPlan(cwd: string, manifest_path: string): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* The number of transactions `address` has sent, as mainnet counts them.
|
|
177
|
+
* The deployer starts above zero because the deployment plan's contract
|
|
178
|
+
* publishes are themselves transactions.
|
|
179
|
+
*/
|
|
180
|
+
getAccountNonce(address: string): bigint;
|
|
175
181
|
getAccounts(): Map<string, string>;
|
|
176
182
|
getAssetsMap(): Map<string, Map<string, bigint>>;
|
|
177
183
|
getBlockTime(): bigint;
|
|
@@ -241,7 +247,7 @@ export class TransactionRes {
|
|
|
241
247
|
export class TransferSTXArgs {
|
|
242
248
|
free(): void;
|
|
243
249
|
[Symbol.dispose](): void;
|
|
244
|
-
constructor(amount: bigint, recipient: string, sender: string);
|
|
250
|
+
constructor(amount: bigint, recipient: string, sender: string, post_conditions?: string[] | null, post_condition_mode?: string | null);
|
|
245
251
|
}
|
|
246
252
|
|
|
247
253
|
export class TxArgs {
|
|
@@ -279,9 +285,9 @@ export interface InitOutput {
|
|
|
279
285
|
readonly __wbg_transactionres_free: (a: number, b: number) => void;
|
|
280
286
|
readonly __wbg_transferstxargs_free: (a: number, b: number) => void;
|
|
281
287
|
readonly __wbg_txargs_free: (a: number, b: number) => void;
|
|
282
|
-
readonly callfnargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
288
|
+
readonly callfnargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number) => number;
|
|
283
289
|
readonly contractoptions_new: (a: number) => number;
|
|
284
|
-
readonly deploycontractargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
290
|
+
readonly deploycontractargs_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
|
|
285
291
|
readonly sdk_blockHeight: (a: number) => number;
|
|
286
292
|
readonly sdk_burnBlockHeight: (a: number) => number;
|
|
287
293
|
readonly sdk_callPrivateFn: (a: number, b: number) => [number, number, number];
|
|
@@ -295,6 +301,7 @@ export interface InitOutput {
|
|
|
295
301
|
readonly sdk_execute: (a: number, b: number, c: number) => [number, number, number];
|
|
296
302
|
readonly sdk_executeCommand: (a: number, b: number, c: number) => [number, number];
|
|
297
303
|
readonly sdk_generateDeploymentPlan: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
304
|
+
readonly sdk_getAccountNonce: (a: number, b: number, c: number) => [bigint, number, number];
|
|
298
305
|
readonly sdk_getAccounts: (a: number) => [number, number, number];
|
|
299
306
|
readonly sdk_getAssetsMap: (a: number) => [number, number, number];
|
|
300
307
|
readonly sdk_getBlockTime: (a: number) => bigint;
|
|
@@ -324,17 +331,17 @@ export interface InitOutput {
|
|
|
324
331
|
readonly sdk_setLocalAccounts: (a: number, b: number, c: number) => void;
|
|
325
332
|
readonly sdk_transferSTX: (a: number, b: number) => [number, number, number];
|
|
326
333
|
readonly sdkoptions_new: (a: number, b: number, c: number) => number;
|
|
327
|
-
readonly transferstxargs_new: (a: bigint, b: number, c: number, d: number, e: number) => number;
|
|
334
|
+
readonly transferstxargs_new: (a: bigint, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
328
335
|
readonly __wbg_get_transactionres_events: (a: number) => [number, number];
|
|
329
336
|
readonly __wbg_get_transactionres_result: (a: number) => [number, number];
|
|
330
337
|
readonly __wbg_set_transactionres_events: (a: number, b: number, c: number) => void;
|
|
331
338
|
readonly __wbg_set_transactionres_result: (a: number, b: number, c: number) => void;
|
|
332
339
|
readonly sdk_stacksBlockHeight: (a: number) => number;
|
|
333
|
-
readonly
|
|
334
|
-
readonly
|
|
335
|
-
readonly
|
|
336
|
-
readonly
|
|
337
|
-
readonly
|
|
340
|
+
readonly wasm_bindgen_12d9f3daca1e64e2___closure__destroy___dyn_core_ed718c3d60ebd546___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
341
|
+
readonly wasm_bindgen_12d9f3daca1e64e2___closure__destroy___dyn_core_ed718c3d60ebd546___ops__function__FnMut__wasm_bindgen_12d9f3daca1e64e2___JsValue____Output___core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___: (a: number, b: number) => void;
|
|
342
|
+
readonly wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___wasm_bindgen_12d9f3daca1e64e2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
343
|
+
readonly wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
344
|
+
readonly wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
338
345
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
339
346
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
340
347
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/clarinet_sdk.js
CHANGED
|
@@ -16,8 +16,10 @@ export class CallFnArgs {
|
|
|
16
16
|
* @param {string} method
|
|
17
17
|
* @param {Uint8Array[]} args
|
|
18
18
|
* @param {string} sender
|
|
19
|
+
* @param {string[] | null} [post_conditions]
|
|
20
|
+
* @param {string | null} [post_condition_mode]
|
|
19
21
|
*/
|
|
20
|
-
constructor(contract, method, args, sender) {
|
|
22
|
+
constructor(contract, method, args, sender, post_conditions, post_condition_mode) {
|
|
21
23
|
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
22
24
|
const len0 = WASM_VECTOR_LEN;
|
|
23
25
|
const ptr1 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -26,7 +28,11 @@ export class CallFnArgs {
|
|
|
26
28
|
const len2 = WASM_VECTOR_LEN;
|
|
27
29
|
const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28
30
|
const len3 = WASM_VECTOR_LEN;
|
|
29
|
-
|
|
31
|
+
var ptr4 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
32
|
+
var len4 = WASM_VECTOR_LEN;
|
|
33
|
+
var ptr5 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
34
|
+
var len5 = WASM_VECTOR_LEN;
|
|
35
|
+
const ret = wasm.callfnargs_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
30
36
|
this.__wbg_ptr = ret >>> 0;
|
|
31
37
|
CallFnArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
32
38
|
return this;
|
|
@@ -73,8 +79,10 @@ export class DeployContractArgs {
|
|
|
73
79
|
* @param {string} content
|
|
74
80
|
* @param {ContractOptions} options
|
|
75
81
|
* @param {string} sender
|
|
82
|
+
* @param {string[] | null} [post_conditions]
|
|
83
|
+
* @param {string | null} [post_condition_mode]
|
|
76
84
|
*/
|
|
77
|
-
constructor(name, content, options, sender) {
|
|
85
|
+
constructor(name, content, options, sender, post_conditions, post_condition_mode) {
|
|
78
86
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
79
87
|
const len0 = WASM_VECTOR_LEN;
|
|
80
88
|
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -83,7 +91,11 @@ export class DeployContractArgs {
|
|
|
83
91
|
var ptr2 = options.__destroy_into_raw();
|
|
84
92
|
const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
85
93
|
const len3 = WASM_VECTOR_LEN;
|
|
86
|
-
|
|
94
|
+
var ptr4 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
95
|
+
var len4 = WASM_VECTOR_LEN;
|
|
96
|
+
var ptr5 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
97
|
+
var len5 = WASM_VECTOR_LEN;
|
|
98
|
+
const ret = wasm.deploycontractargs_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
87
99
|
this.__wbg_ptr = ret >>> 0;
|
|
88
100
|
DeployContractArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
89
101
|
return this;
|
|
@@ -266,6 +278,22 @@ export class SDK {
|
|
|
266
278
|
const ret = wasm.sdk_generateDeploymentPlan(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
267
279
|
return ret;
|
|
268
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* The number of transactions `address` has sent, as mainnet counts them.
|
|
283
|
+
* The deployer starts above zero because the deployment plan's contract
|
|
284
|
+
* publishes are themselves transactions.
|
|
285
|
+
* @param {string} address
|
|
286
|
+
* @returns {bigint}
|
|
287
|
+
*/
|
|
288
|
+
getAccountNonce(address) {
|
|
289
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
290
|
+
const len0 = WASM_VECTOR_LEN;
|
|
291
|
+
const ret = wasm.sdk_getAccountNonce(this.__wbg_ptr, ptr0, len0);
|
|
292
|
+
if (ret[2]) {
|
|
293
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
294
|
+
}
|
|
295
|
+
return BigInt.asUintN(64, ret[0]);
|
|
296
|
+
}
|
|
269
297
|
/**
|
|
270
298
|
* @returns {Map<string, string>}
|
|
271
299
|
*/
|
|
@@ -896,13 +924,19 @@ export class TransferSTXArgs {
|
|
|
896
924
|
* @param {bigint} amount
|
|
897
925
|
* @param {string} recipient
|
|
898
926
|
* @param {string} sender
|
|
927
|
+
* @param {string[] | null} [post_conditions]
|
|
928
|
+
* @param {string | null} [post_condition_mode]
|
|
899
929
|
*/
|
|
900
|
-
constructor(amount, recipient, sender) {
|
|
930
|
+
constructor(amount, recipient, sender, post_conditions, post_condition_mode) {
|
|
901
931
|
const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
902
932
|
const len0 = WASM_VECTOR_LEN;
|
|
903
933
|
const ptr1 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
904
934
|
const len1 = WASM_VECTOR_LEN;
|
|
905
|
-
|
|
935
|
+
var ptr2 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
936
|
+
var len2 = WASM_VECTOR_LEN;
|
|
937
|
+
var ptr3 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
938
|
+
var len3 = WASM_VECTOR_LEN;
|
|
939
|
+
const ret = wasm.transferstxargs_new(amount, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
906
940
|
this.__wbg_ptr = ret >>> 0;
|
|
907
941
|
TransferSTXArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
908
942
|
return this;
|
|
@@ -1193,7 +1227,7 @@ function __wbg_get_imports() {
|
|
|
1193
1227
|
const a = state0.a;
|
|
1194
1228
|
state0.a = 0;
|
|
1195
1229
|
try {
|
|
1196
|
-
return
|
|
1230
|
+
return wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
1197
1231
|
} finally {
|
|
1198
1232
|
state0.a = a;
|
|
1199
1233
|
}
|
|
@@ -1343,7 +1377,7 @@ function __wbg_get_imports() {
|
|
|
1343
1377
|
const ret = arg0.value;
|
|
1344
1378
|
return ret;
|
|
1345
1379
|
},
|
|
1346
|
-
|
|
1380
|
+
__wbg_vfs_1eb0df1eddbfde99: function(arg0, arg1, arg2) {
|
|
1347
1381
|
let deferred0_0;
|
|
1348
1382
|
let deferred0_1;
|
|
1349
1383
|
try {
|
|
@@ -1356,13 +1390,13 @@ function __wbg_get_imports() {
|
|
|
1356
1390
|
}
|
|
1357
1391
|
},
|
|
1358
1392
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1359
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1360
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1393
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 426, function: Function { arguments: [], shim_idx: 427, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1394
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_12d9f3daca1e64e2___closure__destroy___dyn_core_ed718c3d60ebd546___ops__function__FnMut_____Output_______, wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_);
|
|
1361
1395
|
return ret;
|
|
1362
1396
|
},
|
|
1363
1397
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1364
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1365
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1398
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 603, function: Function { arguments: [Externref], shim_idx: 604, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1399
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_12d9f3daca1e64e2___closure__destroy___dyn_core_ed718c3d60ebd546___ops__function__FnMut__wasm_bindgen_12d9f3daca1e64e2___JsValue____Output___core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___, wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___wasm_bindgen_12d9f3daca1e64e2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___true_);
|
|
1366
1400
|
return ret;
|
|
1367
1401
|
},
|
|
1368
1402
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -1413,19 +1447,19 @@ function __wbg_get_imports() {
|
|
|
1413
1447
|
};
|
|
1414
1448
|
}
|
|
1415
1449
|
|
|
1416
|
-
function
|
|
1417
|
-
wasm.
|
|
1450
|
+
function wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
1451
|
+
wasm.wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_(arg0, arg1);
|
|
1418
1452
|
}
|
|
1419
1453
|
|
|
1420
|
-
function
|
|
1421
|
-
const ret = wasm.
|
|
1454
|
+
function wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___wasm_bindgen_12d9f3daca1e64e2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___true_(arg0, arg1, arg2) {
|
|
1455
|
+
const ret = wasm.wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___wasm_bindgen_12d9f3daca1e64e2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___true_(arg0, arg1, arg2);
|
|
1422
1456
|
if (ret[1]) {
|
|
1423
1457
|
throw takeFromExternrefTable0(ret[0]);
|
|
1424
1458
|
}
|
|
1425
1459
|
}
|
|
1426
1460
|
|
|
1427
|
-
function
|
|
1428
|
-
wasm.
|
|
1461
|
+
function wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
1462
|
+
wasm.wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined___js_sys_451fdff4e929fe4f___Function_fn_wasm_bindgen_12d9f3daca1e64e2___JsValue_____wasm_bindgen_12d9f3daca1e64e2___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
1429
1463
|
}
|
|
1430
1464
|
|
|
1431
1465
|
|
package/clarinet_sdk_bg.wasm
CHANGED
|
Binary file
|