@stacks/clarinet-sdk-wasm 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
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 {
|
package/clarinet_sdk.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @ts-self-types="./clarinet_sdk.d.ts" */
|
|
2
|
-
const { syncHttpRequest, syncSleep } = require(String.raw`./snippets/clarity-repl-
|
|
2
|
+
const { syncHttpRequest, syncSleep } = require(String.raw`./snippets/clarity-repl-f375bc19a63c0f54/src/repl/remote_data/http_request/sync_http.cjs`);
|
|
3
3
|
const { existsSync, mkdirSync, readFileSync, writeFileSync } = require(`fs`);
|
|
4
4
|
|
|
5
5
|
class CallFnArgs {
|
|
@@ -18,8 +18,10 @@ class CallFnArgs {
|
|
|
18
18
|
* @param {string} method
|
|
19
19
|
* @param {Uint8Array[]} args
|
|
20
20
|
* @param {string} sender
|
|
21
|
+
* @param {string[] | null} [post_conditions]
|
|
22
|
+
* @param {string | null} [post_condition_mode]
|
|
21
23
|
*/
|
|
22
|
-
constructor(contract, method, args, sender) {
|
|
24
|
+
constructor(contract, method, args, sender, post_conditions, post_condition_mode) {
|
|
23
25
|
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
24
26
|
const len0 = WASM_VECTOR_LEN;
|
|
25
27
|
const ptr1 = passStringToWasm0(method, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -28,7 +30,11 @@ class CallFnArgs {
|
|
|
28
30
|
const len2 = WASM_VECTOR_LEN;
|
|
29
31
|
const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
30
32
|
const len3 = WASM_VECTOR_LEN;
|
|
31
|
-
|
|
33
|
+
var ptr4 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
34
|
+
var len4 = WASM_VECTOR_LEN;
|
|
35
|
+
var ptr5 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
36
|
+
var len5 = WASM_VECTOR_LEN;
|
|
37
|
+
const ret = wasm.callfnargs_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
32
38
|
this.__wbg_ptr = ret >>> 0;
|
|
33
39
|
CallFnArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
34
40
|
return this;
|
|
@@ -77,8 +83,10 @@ class DeployContractArgs {
|
|
|
77
83
|
* @param {string} content
|
|
78
84
|
* @param {ContractOptions} options
|
|
79
85
|
* @param {string} sender
|
|
86
|
+
* @param {string[] | null} [post_conditions]
|
|
87
|
+
* @param {string | null} [post_condition_mode]
|
|
80
88
|
*/
|
|
81
|
-
constructor(name, content, options, sender) {
|
|
89
|
+
constructor(name, content, options, sender, post_conditions, post_condition_mode) {
|
|
82
90
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
83
91
|
const len0 = WASM_VECTOR_LEN;
|
|
84
92
|
const ptr1 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -87,7 +95,11 @@ class DeployContractArgs {
|
|
|
87
95
|
var ptr2 = options.__destroy_into_raw();
|
|
88
96
|
const ptr3 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
89
97
|
const len3 = WASM_VECTOR_LEN;
|
|
90
|
-
|
|
98
|
+
var ptr4 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
99
|
+
var len4 = WASM_VECTOR_LEN;
|
|
100
|
+
var ptr5 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
101
|
+
var len5 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.deploycontractargs_new(ptr0, len0, ptr1, len1, ptr2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
91
103
|
this.__wbg_ptr = ret >>> 0;
|
|
92
104
|
DeployContractArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
93
105
|
return this;
|
|
@@ -271,6 +283,22 @@ class SDK {
|
|
|
271
283
|
const ret = wasm.sdk_generateDeploymentPlan(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
272
284
|
return ret;
|
|
273
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* The number of transactions `address` has sent, as mainnet counts them.
|
|
288
|
+
* The deployer starts above zero because the deployment plan's contract
|
|
289
|
+
* publishes are themselves transactions.
|
|
290
|
+
* @param {string} address
|
|
291
|
+
* @returns {bigint}
|
|
292
|
+
*/
|
|
293
|
+
getAccountNonce(address) {
|
|
294
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
295
|
+
const len0 = WASM_VECTOR_LEN;
|
|
296
|
+
const ret = wasm.sdk_getAccountNonce(this.__wbg_ptr, ptr0, len0);
|
|
297
|
+
if (ret[2]) {
|
|
298
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
299
|
+
}
|
|
300
|
+
return BigInt.asUintN(64, ret[0]);
|
|
301
|
+
}
|
|
274
302
|
/**
|
|
275
303
|
* @returns {Map<string, string>}
|
|
276
304
|
*/
|
|
@@ -905,13 +933,19 @@ class TransferSTXArgs {
|
|
|
905
933
|
* @param {bigint} amount
|
|
906
934
|
* @param {string} recipient
|
|
907
935
|
* @param {string} sender
|
|
936
|
+
* @param {string[] | null} [post_conditions]
|
|
937
|
+
* @param {string | null} [post_condition_mode]
|
|
908
938
|
*/
|
|
909
|
-
constructor(amount, recipient, sender) {
|
|
939
|
+
constructor(amount, recipient, sender, post_conditions, post_condition_mode) {
|
|
910
940
|
const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
911
941
|
const len0 = WASM_VECTOR_LEN;
|
|
912
942
|
const ptr1 = passStringToWasm0(sender, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
913
943
|
const len1 = WASM_VECTOR_LEN;
|
|
914
|
-
|
|
944
|
+
var ptr2 = isLikeNone(post_conditions) ? 0 : passArrayJsValueToWasm0(post_conditions, wasm.__wbindgen_malloc);
|
|
945
|
+
var len2 = WASM_VECTOR_LEN;
|
|
946
|
+
var ptr3 = isLikeNone(post_condition_mode) ? 0 : passStringToWasm0(post_condition_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
947
|
+
var len3 = WASM_VECTOR_LEN;
|
|
948
|
+
const ret = wasm.transferstxargs_new(amount, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
915
949
|
this.__wbg_ptr = ret >>> 0;
|
|
916
950
|
TransferSTXArgsFinalization.register(this, this.__wbg_ptr, this);
|
|
917
951
|
return this;
|
|
@@ -1061,7 +1095,7 @@ function __wbg_get_imports() {
|
|
|
1061
1095
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1062
1096
|
}
|
|
1063
1097
|
},
|
|
1064
|
-
|
|
1098
|
+
__wbg_existsSync_1cab735735eec3d9: function(arg0, arg1) {
|
|
1065
1099
|
const ret = existsSync(getStringFromWasm0(arg0, arg1));
|
|
1066
1100
|
return ret;
|
|
1067
1101
|
},
|
|
@@ -1161,7 +1195,7 @@ function __wbg_get_imports() {
|
|
|
1161
1195
|
__wbg_log_524eedafa26daa59: function(arg0) {
|
|
1162
1196
|
console.log(arg0);
|
|
1163
1197
|
},
|
|
1164
|
-
|
|
1198
|
+
__wbg_mkdirSync_41f7dfcdae9db91d: function(arg0, arg1, arg2) {
|
|
1165
1199
|
mkdirSync(getStringFromWasm0(arg0, arg1), arg2);
|
|
1166
1200
|
},
|
|
1167
1201
|
__wbg_new_0837727332ac86ba: function() { return handleError(function () {
|
|
@@ -1211,7 +1245,7 @@ function __wbg_get_imports() {
|
|
|
1211
1245
|
const a = state0.a;
|
|
1212
1246
|
state0.a = 0;
|
|
1213
1247
|
try {
|
|
1214
|
-
return
|
|
1248
|
+
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);
|
|
1215
1249
|
} finally {
|
|
1216
1250
|
state0.a = a;
|
|
1217
1251
|
}
|
|
@@ -1244,7 +1278,7 @@ function __wbg_get_imports() {
|
|
|
1244
1278
|
__wbg_queueMicrotask_a082d78ce798393e: function(arg0) {
|
|
1245
1279
|
queueMicrotask(arg0);
|
|
1246
1280
|
},
|
|
1247
|
-
|
|
1281
|
+
__wbg_readFileSync_e4dc01d1a30b8ca3: function(arg0, arg1, arg2) {
|
|
1248
1282
|
const ret = readFileSync(getStringFromWasm0(arg1, arg2));
|
|
1249
1283
|
const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
|
|
1250
1284
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -1329,11 +1363,11 @@ function __wbg_get_imports() {
|
|
|
1329
1363
|
const ret = JSON.stringify(arg0);
|
|
1330
1364
|
return ret;
|
|
1331
1365
|
}, arguments); },
|
|
1332
|
-
|
|
1366
|
+
__wbg_syncHttpRequest_2c1f062dec0753da: function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
1333
1367
|
const ret = syncHttpRequest(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
1334
1368
|
return ret;
|
|
1335
1369
|
}, arguments); },
|
|
1336
|
-
|
|
1370
|
+
__wbg_syncSleep_42581279039b276e: function(arg0) {
|
|
1337
1371
|
syncSleep(arg0 >>> 0);
|
|
1338
1372
|
},
|
|
1339
1373
|
__wbg_then_098abe61755d12f6: function(arg0, arg1) {
|
|
@@ -1355,17 +1389,17 @@ function __wbg_get_imports() {
|
|
|
1355
1389
|
const ret = arg0.value;
|
|
1356
1390
|
return ret;
|
|
1357
1391
|
},
|
|
1358
|
-
|
|
1392
|
+
__wbg_writeFileSync_4d423e32a272058f: function(arg0, arg1, arg2, arg3) {
|
|
1359
1393
|
writeFileSync(getStringFromWasm0(arg0, arg1), getArrayU8FromWasm0(arg2, arg3));
|
|
1360
1394
|
},
|
|
1361
1395
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1362
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1363
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1396
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 426, function: Function { arguments: [], shim_idx: 427, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1397
|
+
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_);
|
|
1364
1398
|
return ret;
|
|
1365
1399
|
},
|
|
1366
1400
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1367
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1368
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
1401
|
+
// 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`.
|
|
1402
|
+
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_);
|
|
1369
1403
|
return ret;
|
|
1370
1404
|
},
|
|
1371
1405
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -1409,19 +1443,19 @@ function __wbg_get_imports() {
|
|
|
1409
1443
|
};
|
|
1410
1444
|
}
|
|
1411
1445
|
|
|
1412
|
-
function
|
|
1413
|
-
wasm.
|
|
1446
|
+
function wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_(arg0, arg1) {
|
|
1447
|
+
wasm.wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke_______true_(arg0, arg1);
|
|
1414
1448
|
}
|
|
1415
1449
|
|
|
1416
|
-
function
|
|
1417
|
-
const ret = wasm.
|
|
1450
|
+
function wasm_bindgen_12d9f3daca1e64e2___convert__closures_____invoke___wasm_bindgen_12d9f3daca1e64e2___JsValue__core_ed718c3d60ebd546___result__Result_____wasm_bindgen_12d9f3daca1e64e2___JsError___true_(arg0, arg1, arg2) {
|
|
1451
|
+
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);
|
|
1418
1452
|
if (ret[1]) {
|
|
1419
1453
|
throw takeFromExternrefTable0(ret[0]);
|
|
1420
1454
|
}
|
|
1421
1455
|
}
|
|
1422
1456
|
|
|
1423
|
-
function
|
|
1424
|
-
wasm.
|
|
1457
|
+
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) {
|
|
1458
|
+
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);
|
|
1425
1459
|
}
|
|
1426
1460
|
|
|
1427
1461
|
|
package/clarinet_sdk_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED