@acala-network/chopsticks-executor 0.9.2-3 → 0.9.2-5
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/dist/cjs/LICENSE +201 -0
- package/dist/cjs/README.md +1 -0
- package/dist/cjs/chopsticks_executor.d.js +7 -0
- package/dist/cjs/chopsticks_executor.js +959 -0
- package/dist/cjs/chopsticks_executor_bg.wasm.d.js +20 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/LICENSE +201 -0
- package/dist/esm/README.md +1 -0
- package/dist/esm/chopsticks_executor.d.js +11 -0
- package/dist/esm/chopsticks_executor.js +949 -0
- package/dist/esm/chopsticks_executor_bg.wasm +0 -0
- package/dist/esm/chopsticks_executor_bg.wasm.d.js +2 -0
- package/dist/esm/index.js +14 -0
- package/dist/esm/package.json +1 -0
- package/package.json +25 -10
- package/pkg/chopsticks_executor.d.ts +85 -0
- package/browser/chopsticks_executor.js +0 -721
- package/browser/index.js +0 -13
- package/node/chopsticks_executor.d.ts +0 -46
- package/node/chopsticks_executor.js +0 -714
- package/node/chopsticks_executor_bg.wasm +0 -0
- package/node/chopsticks_executor_bg.wasm.d.ts +0 -15
- /package/{browser → dist/cjs}/chopsticks_executor_bg.wasm +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type": "module"}
|
package/package.json
CHANGED
|
@@ -1,30 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks-executor",
|
|
3
3
|
"description": "Chopsticks executor",
|
|
4
|
-
"version": "0.9.2-
|
|
4
|
+
"version": "0.9.2-5",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/AcalaNetwork/chopsticks"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
|
-
"clean": "rm -rf
|
|
12
|
-
"
|
|
12
|
+
"clean": "rm -rf pkg dist",
|
|
13
|
+
"wasm": "yarn clean && wasm-pack build --target web --out-dir pkg && scripts/pack-wasm.cjs",
|
|
14
|
+
"build": "yarn wasm && yarn build:cjs && yarn build:esm",
|
|
15
|
+
"build:cjs": "swc ./pkg -C module.type=commonjs -d dist/cjs --copy-files && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
16
|
+
"build:esm": "swc ./pkg -C module.type=es6 -d dist/esm --copy-files && echo '{\"type\": \"module\"}' > dist/esm/package.json"
|
|
13
17
|
},
|
|
14
18
|
"dependencies": {
|
|
15
19
|
"@polkadot/util": "^12.5.1",
|
|
16
20
|
"@polkadot/wasm-util": "^7.2.2"
|
|
17
21
|
},
|
|
18
22
|
"devDependencies": {
|
|
23
|
+
"@swc/cli": "0.1.62",
|
|
24
|
+
"@swc/core": "^1.3.96",
|
|
19
25
|
"fflate": "^0.8.1"
|
|
20
26
|
},
|
|
21
27
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"node/chopsticks_*"
|
|
28
|
+
"dist/esm/**",
|
|
29
|
+
"dist/cjs/**",
|
|
30
|
+
"pkg/chopsticks_executor.d.ts"
|
|
26
31
|
],
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
32
|
+
"require": "./dist/cjs/index.js",
|
|
33
|
+
"module": "./dist/esm/index.js",
|
|
34
|
+
"types": "./pkg/chopsticks_executor.d.ts",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"require": "./dist/cjs/index.js",
|
|
38
|
+
"module": "./dist/esm/index.js",
|
|
39
|
+
"default": "./dist/esm/index.js",
|
|
40
|
+
"types": "./pkg/chopsticks_executor.d.ts"
|
|
41
|
+
},
|
|
42
|
+
"./package.json": "./package.json",
|
|
43
|
+
"./package.cjs.json": "./dist/cjs/package.json"
|
|
44
|
+
}
|
|
30
45
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {any} code
|
|
5
|
+
* @returns {Promise<any>}
|
|
6
|
+
*/
|
|
7
|
+
export function get_runtime_version(code: any): Promise<any>;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} entries
|
|
10
|
+
* @param {any} trie_version
|
|
11
|
+
* @returns {Promise<any>}
|
|
12
|
+
*/
|
|
13
|
+
export function calculate_state_root(entries: any, trie_version: any): Promise<any>;
|
|
14
|
+
/**
|
|
15
|
+
* @param {any} root_trie_hash
|
|
16
|
+
* @param {any} keys
|
|
17
|
+
* @param {any} nodes
|
|
18
|
+
* @returns {Promise<any>}
|
|
19
|
+
*/
|
|
20
|
+
export function decode_proof(root_trie_hash: any, keys: any, nodes: any): Promise<any>;
|
|
21
|
+
/**
|
|
22
|
+
* @param {any} nodes
|
|
23
|
+
* @param {any} entries
|
|
24
|
+
* @returns {Promise<any>}
|
|
25
|
+
*/
|
|
26
|
+
export function create_proof(nodes: any, entries: any): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* @param {any} task
|
|
29
|
+
* @param {JsCallback} js
|
|
30
|
+
* @param {string | undefined} [log_level]
|
|
31
|
+
* @returns {Promise<any>}
|
|
32
|
+
*/
|
|
33
|
+
export function run_task(task: any, js: JsCallback, log_level?: string): Promise<any>;
|
|
34
|
+
|
|
35
|
+
type HexString = `0x${string}`;
|
|
36
|
+
export interface JsCallback {
|
|
37
|
+
getStorage: (key: HexString) => Promise<string | undefined>
|
|
38
|
+
getStateRoot: () => Promise<string>
|
|
39
|
+
getNextKey: (prefix: HexString, key: HexString) => Promise<string | undefined>
|
|
40
|
+
offchainGetStorage: (key: HexString) => Promise<string | undefined>
|
|
41
|
+
offchainTimestamp: () => Promise<number>
|
|
42
|
+
offchainRandomSeed: () => Promise<HexString>
|
|
43
|
+
offchainSubmitTransaction: (tx: HexString) => Promise<boolean>
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
49
|
+
|
|
50
|
+
export interface InitOutput {
|
|
51
|
+
readonly memory: WebAssembly.Memory;
|
|
52
|
+
readonly get_runtime_version: (a: number) => number;
|
|
53
|
+
readonly calculate_state_root: (a: number, b: number) => number;
|
|
54
|
+
readonly decode_proof: (a: number, b: number, c: number) => number;
|
|
55
|
+
readonly create_proof: (a: number, b: number) => number;
|
|
56
|
+
readonly run_task: (a: number, b: number, c: number, d: number) => number;
|
|
57
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
58
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
59
|
+
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
60
|
+
readonly wasm_bindgen__convert__closures__invoke1_mut__h84425a3baffea565: (a: number, b: number, c: number) => void;
|
|
61
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
62
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
63
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h59e4ab6c95dba127: (a: number, b: number, c: number, d: number) => void;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
67
|
+
/**
|
|
68
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
69
|
+
* a precompiled `WebAssembly.Module`.
|
|
70
|
+
*
|
|
71
|
+
* @param {SyncInitInput} module
|
|
72
|
+
*
|
|
73
|
+
* @returns {InitOutput}
|
|
74
|
+
*/
|
|
75
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
79
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
80
|
+
*
|
|
81
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
82
|
+
*
|
|
83
|
+
* @returns {Promise<InitOutput>}
|
|
84
|
+
*/
|
|
85
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|