@hirosystems/clarinet-sdk-wasm
Advanced tools
Comparing version 2.7.0-beta5 to 2.7.0-beta6
@@ -263,5 +263,10 @@ /* tslint:disable */ | ||
* @param {string} snippet | ||
* @returns {string} | ||
*/ | ||
runSnippet(snippet: string): string; | ||
/** | ||
* @param {string} snippet | ||
* @returns {TransactionRes} | ||
*/ | ||
runSnippet(snippet: string): TransactionRes; | ||
execute(snippet: string): TransactionRes; | ||
/** | ||
@@ -268,0 +273,0 @@ * @param {string} recipient |
@@ -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_177(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h2d78d70b7078fa90(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_178(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h5b5768d1820d3851(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -810,5 +810,7 @@ | ||
* @param {string} snippet | ||
* @returns {TransactionRes} | ||
* @returns {string} | ||
*/ | ||
runSnippet(snippet) { | ||
let deferred2_0; | ||
let deferred2_1; | ||
try { | ||
@@ -821,2 +823,22 @@ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
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} 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]; | ||
@@ -1202,11 +1224,2 @@ if (r2) { | ||
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_cb_drop = function(arg0) { | ||
@@ -1227,2 +1240,11 @@ const obj = takeObject(arg0).original; | ||
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() { | ||
@@ -1263,2 +1285,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 () { | ||
@@ -1277,2 +1313,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) { | ||
@@ -1312,21 +1353,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) { | ||
@@ -1338,6 +1360,2 @@ const v = getObject(arg0); | ||
module.exports.__wbg_queueMicrotask_f61ee94ee663068b = function(arg0) { | ||
queueMicrotask(getObject(arg0)); | ||
}; | ||
module.exports.__wbg_queueMicrotask_f82fc5d1e8f816ae = function(arg0) { | ||
@@ -1353,2 +1371,6 @@ const ret = getObject(arg0).queueMicrotask; | ||
module.exports.__wbg_queueMicrotask_f61ee94ee663068b = function(arg0) { | ||
queueMicrotask(getObject(arg0)); | ||
}; | ||
module.exports.__wbindgen_is_object = function(arg0) { | ||
@@ -1551,3 +1573,3 @@ const val = getObject(arg0); | ||
try { | ||
return __wbg_adapter_177(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_178(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -1614,7 +1636,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) { | ||
@@ -1630,2 +1647,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) { | ||
@@ -1648,4 +1670,4 @@ const ret = debugString(getObject(arg1)); | ||
module.exports.__wbindgen_closure_wrapper2574 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 745, __wbg_adapter_44); | ||
module.exports.__wbindgen_closure_wrapper2573 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 736, __wbg_adapter_44); | ||
return addHeapObject(ret); | ||
@@ -1652,0 +1674,0 @@ }; |
{ | ||
"name": "@hirosystems/clarinet-sdk-wasm", | ||
"description": "The core lib that powers @hirosystems/clarinet-sdk", | ||
"version": "2.7.0-beta5", | ||
"version": "2.7.0-beta6", | ||
"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
7971855
1839
82