@hirosystems/clarinet-sdk-wasm
Advanced tools
Comparing version 2.7.0-beta1 to 2.7.0-beta10
@@ -112,3 +112,3 @@ /* tslint:disable */ | ||
type ClarityVersion = "Clarity1" | "Clarity2"; | ||
type ClarityVersion = "Clarity1" | "Clarity2" | "Clarity3"; | ||
@@ -178,2 +178,5 @@ type IContractInterface = { | ||
/** | ||
*/ | ||
clearCache(): void; | ||
/** | ||
* @param {EpochString} epoch | ||
@@ -266,2 +269,18 @@ */ | ||
/** | ||
* @param {string} snippet | ||
* @returns {TransactionRes} | ||
*/ | ||
execute(snippet: string): TransactionRes; | ||
/** | ||
* @param {string} snippet | ||
* @returns {string} | ||
*/ | ||
executeCommand(snippet: string): string; | ||
/** | ||
* @param {string} recipient | ||
* @param {bigint} amount | ||
* @returns {string} | ||
*/ | ||
mintSTX(recipient: string, amount: bigint): string; | ||
/** | ||
* @param {string} test_name | ||
@@ -268,0 +287,0 @@ */ |
@@ -227,3 +227,3 @@ let imports = {}; | ||
function __wbg_adapter_44(arg0, arg1, arg2) { | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb071c8bafab595a1(arg0, arg1, addHeapObject(arg2)); | ||
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h122e58737f156e20(arg0, arg1, addHeapObject(arg2)); | ||
} | ||
@@ -271,4 +271,4 @@ | ||
} | ||
function __wbg_adapter_175(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2d78d70b7078fa90(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_179(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h5b5768d1820d3851(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -465,2 +465,7 @@ | ||
/** | ||
*/ | ||
clearCache() { | ||
wasm.sdk_clearCache(this.__wbg_ptr); | ||
} | ||
/** | ||
* @returns {number} | ||
@@ -827,2 +832,76 @@ */ | ||
/** | ||
* @param {string} snippet | ||
* @returns {TransactionRes} | ||
*/ | ||
execute(snippet) { | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.sdk_execute(retptr, this.__wbg_ptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
if (r2) { | ||
throw takeObject(r1); | ||
} | ||
return TransactionRes.__wrap(r0); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
} | ||
} | ||
/** | ||
* @param {string} snippet | ||
* @returns {string} | ||
*/ | ||
executeCommand(snippet) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(snippet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.sdk_executeCommand(retptr, this.__wbg_ptr, ptr0, len0); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
deferred2_0 = r0; | ||
deferred2_1 = r1; | ||
return getStringFromWasm0(r0, r1); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); | ||
} | ||
} | ||
/** | ||
* @param {string} recipient | ||
* @param {bigint} amount | ||
* @returns {string} | ||
*/ | ||
mintSTX(recipient, amount) { | ||
let deferred3_0; | ||
let deferred3_1; | ||
try { | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
const ptr0 = passStringToWasm0(recipient, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.sdk_mintSTX(retptr, this.__wbg_ptr, ptr0, len0, amount); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var r2 = getInt32Memory0()[retptr / 4 + 2]; | ||
var r3 = getInt32Memory0()[retptr / 4 + 3]; | ||
var ptr2 = r0; | ||
var len2 = r1; | ||
if (r3) { | ||
ptr2 = 0; len2 = 0; | ||
throw takeObject(r2); | ||
} | ||
deferred3_0 = ptr2; | ||
deferred3_1 = len2; | ||
return getStringFromWasm0(ptr2, len2); | ||
} finally { | ||
wasm.__wbindgen_add_to_stack_pointer(16); | ||
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); | ||
} | ||
} | ||
/** | ||
* @param {string} test_name | ||
@@ -1167,16 +1246,2 @@ */ | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_cb_drop = function(arg0) { | ||
@@ -1192,2 +1257,16 @@ const obj = takeObject(arg0).original; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
const ret = getObject(arg0) === undefined; | ||
return ret; | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'string' ? obj : undefined; | ||
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len1 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len1; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr1; | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -1228,2 +1307,16 @@ const ret = new Error(); | ||
module.exports.__wbg_signal_a61f78a3478fd9bc = function(arg0) { | ||
const ret = getObject(arg0).signal; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_0d76b0581eca6298 = function() { return handleError(function () { | ||
const ret = new AbortController(); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_abort_2aa7521d5690750e = function(arg0) { | ||
getObject(arg0).abort(); | ||
}; | ||
module.exports.__wbg_new_ab6fd82b10560829 = function() { return handleError(function () { | ||
@@ -1242,2 +1335,7 @@ const ret = new Headers(); | ||
module.exports.__wbg_newwithstrandinit_3fd6fba4083ff2d0 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_instanceof_Response_849eb93e75734b6e = function(arg0) { | ||
@@ -1277,21 +1375,2 @@ let result; | ||
module.exports.__wbg_signal_a61f78a3478fd9bc = function(arg0) { | ||
const ret = getObject(arg0).signal; | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_0d76b0581eca6298 = function() { return handleError(function () { | ||
const ret = new AbortController(); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_abort_2aa7521d5690750e = function(arg0) { | ||
getObject(arg0).abort(); | ||
}; | ||
module.exports.__wbg_newwithstrandinit_3fd6fba4083ff2d0 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbindgen_boolean_get = function(arg0) { | ||
@@ -1303,6 +1382,2 @@ const v = getObject(arg0); | ||
module.exports.__wbg_queueMicrotask_f61ee94ee663068b = function(arg0) { | ||
queueMicrotask(getObject(arg0)); | ||
}; | ||
module.exports.__wbg_queueMicrotask_f82fc5d1e8f816ae = function(arg0) { | ||
@@ -1318,2 +1393,6 @@ const ret = getObject(arg0).queueMicrotask; | ||
module.exports.__wbg_queueMicrotask_f61ee94ee663068b = function(arg0) { | ||
queueMicrotask(getObject(arg0)); | ||
}; | ||
module.exports.__wbindgen_is_object = function(arg0) { | ||
@@ -1516,3 +1595,3 @@ const val = getObject(arg0); | ||
try { | ||
return __wbg_adapter_175(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_179(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -1579,7 +1658,2 @@ state0.a = a; | ||
module.exports.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbg_has_0af94d20077affa2 = function() { return handleError(function (arg0, arg1) { | ||
@@ -1595,2 +1669,7 @@ const ret = Reflect.has(getObject(arg0), getObject(arg1)); | ||
module.exports.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) { | ||
const ret = JSON.stringify(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}, arguments) }; | ||
module.exports.__wbindgen_debug_string = function(arg0, arg1) { | ||
@@ -1613,4 +1692,4 @@ const ret = debugString(getObject(arg1)); | ||
module.exports.__wbindgen_closure_wrapper2572 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 745, __wbg_adapter_44); | ||
module.exports.__wbindgen_closure_wrapper2587 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 741, __wbg_adapter_44); | ||
return addHeapObject(ret); | ||
@@ -1617,0 +1696,0 @@ }; |
{ | ||
"name": "@hirosystems/clarinet-sdk-wasm", | ||
"description": "The core lib that powers @hirosystems/clarinet-sdk", | ||
"version": "2.7.0-beta1", | ||
"version": "2.7.0-beta10", | ||
"license": "GPL-3.0", | ||
@@ -6,0 +6,0 @@ "repository": { |
# Clarity SDK WASM | ||
This package is built with wasm-pack. | ||
This component exposes Clarinet features to a JS interface through wasm-bindgen. | ||
It's built with wasm-pack. | ||
It powers [@hirosystems/clarinet-sdk](https://npmjs.com/package/@hirosystems/clarinet-sdk) and | ||
[@hirosystems/clarinet-sdk-browser](https://npmjs.com/package/@hirosystems/clarinet-sdk-browser). | ||
## Release | ||
The package is built twice with `wasm-pack` as it can't target `node` and `web` at the same time. | ||
The following script will build for both target, it will also rename the package name for the | ||
browser build. | ||
```sh | ||
node build.mjs | ||
``` | ||
Once built, the packages can be released by running the following commands. Note that by default we | ||
release with the beta tag. | ||
## Contributing | ||
@@ -38,7 +26,13 @@ | ||
## Use the local version of the package | ||
Run this script to build **both versions**: | ||
### NPM overrides | ||
```sh | ||
node build.mjs | ||
``` | ||
In 99% of the situations, your project don't directly depend on this package, but instead on | ||
### Use the local version of the package | ||
#### NPM overrides | ||
In most of the situations, your project won't directly depend on this package, but instead on | ||
`@hirosystems/clarinet-sdk` or `@hirosystems/clarinet-sdk-browser`. If you want to use a local or | ||
@@ -66,5 +60,24 @@ a different version of `@hirosystems/clarinet-sdk-wasm` or `@hirosystems/clarinet-sdk-wasm-browser`, | ||
### NPM link | ||
#### NPM link | ||
The command `npm link` can be useful to run the unit tests in the `clarinet-sdk`. | ||
See the contribution section of `@hirosystems/clarinet-sdk` (`../clarinet-sdk/README.md). | ||
### Release | ||
The package is built twice with `wasm-pack` as it can't target `node` and `web` at the same time. | ||
The following script will build for both target, it will also rename the package name for the | ||
browser build. | ||
```sh | ||
cd components/clarinet-sdk-wasm | ||
node build.mjs | ||
``` | ||
Once built, the packages can be released by running the following commands. Note that by default we | ||
release with the beta tag. | ||
```sh | ||
cd pkg-node && npm publish --tag beta && cd .. | ||
cd pkg-browser && npm publish --tag beta && cd .. | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8090355
1866
82