@thru/sdk 0.2.22
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/README.abi.md +112 -0
- package/README.md +342 -0
- package/dist/abi/index.cjs +946 -0
- package/dist/abi/index.cjs.map +1 -0
- package/dist/abi/index.d.cts +331 -0
- package/dist/abi/index.d.ts +331 -0
- package/dist/abi/index.js +892 -0
- package/dist/abi/index.js.map +1 -0
- package/dist/abi/wasm/bundler/abi_reflect_wasm.d.ts +65 -0
- package/dist/abi/wasm/bundler/abi_reflect_wasm.js +5 -0
- package/dist/abi/wasm/bundler/abi_reflect_wasm_bg.js +412 -0
- package/dist/abi/wasm/bundler/abi_reflect_wasm_bg.wasm +0 -0
- package/dist/abi/wasm/bundler/abi_reflect_wasm_bg.wasm.d.ts +24 -0
- package/dist/abi/wasm/bundler/package.json +17 -0
- package/dist/abi/wasm/node/abi_reflect_wasm.d.ts +65 -0
- package/dist/abi/wasm/node/abi_reflect_wasm.js +425 -0
- package/dist/abi/wasm/node/abi_reflect_wasm_bg.wasm +0 -0
- package/dist/abi/wasm/node/abi_reflect_wasm_bg.wasm.d.ts +24 -0
- package/dist/abi/wasm/node/package.json +11 -0
- package/dist/abi/wasm/web/abi_reflect_wasm.d.ts +114 -0
- package/dist/abi/wasm/web/abi_reflect_wasm.js +499 -0
- package/dist/abi/wasm/web/abi_reflect_wasm_bg.wasm +0 -0
- package/dist/abi/wasm/web/abi_reflect_wasm_bg.wasm.d.ts +24 -0
- package/dist/abi/wasm/web/package.json +15 -0
- package/dist/chunk-CVBQ4UPL.js +3614 -0
- package/dist/chunk-CVBQ4UPL.js.map +1 -0
- package/dist/chunk-NSBPE2FW.js +15 -0
- package/dist/chunk-NSBPE2FW.js.map +1 -0
- package/dist/chunk-RL3Q6FDE.js +105 -0
- package/dist/chunk-RL3Q6FDE.js.map +1 -0
- package/dist/chunk-UDIXYJXC.js +260 -0
- package/dist/chunk-UDIXYJXC.js.map +1 -0
- package/dist/chunk-YQDWOMNO.js +271 -0
- package/dist/chunk-YQDWOMNO.js.map +1 -0
- package/dist/client-Cfi7zRLm.d.cts +1247 -0
- package/dist/client-worIo0a3.d.ts +1247 -0
- package/dist/client.cjs +3791 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +7 -0
- package/dist/client.d.ts +7 -0
- package/dist/client.js +7 -0
- package/dist/client.js.map +1 -0
- package/dist/crypto/index.cjs +170 -0
- package/dist/crypto/index.cjs.map +1 -0
- package/dist/crypto/index.d.cts +60 -0
- package/dist/crypto/index.d.ts +60 -0
- package/dist/crypto/index.js +5 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/helpers/index.cjs +270 -0
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.d.cts +15 -0
- package/dist/helpers/index.d.ts +15 -0
- package/dist/helpers/index.js +4 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/proto/index.cjs +433 -0
- package/dist/proto/index.cjs.map +1 -0
- package/dist/proto/index.d.cts +435 -0
- package/dist/proto/index.d.ts +435 -0
- package/dist/proto/index.js +4 -0
- package/dist/proto/index.js.map +1 -0
- package/dist/sdk.cjs +4137 -0
- package/dist/sdk.cjs.map +1 -0
- package/dist/sdk.d.cts +36 -0
- package/dist/sdk.d.ts +36 -0
- package/dist/sdk.js +7 -0
- package/dist/sdk.js.map +1 -0
- package/dist/streaming_service_pb-DvCdJiCr.d.cts +4877 -0
- package/dist/streaming_service_pb-DvCdJiCr.d.ts +4877 -0
- package/dist/webcrypto-LTajLAad.d.cts +3 -0
- package/dist/webcrypto-LTajLAad.d.ts +3 -0
- package/package.json +88 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const build_layout_ir: (a: number, b: number) => [number, number, number];
|
|
5
|
+
export const build_layout_ir_with_manifest: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
6
|
+
export const format_reflection: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const format_reflection_with_options: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
8
|
+
export const get_manifest_packages: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const reflect: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
10
|
+
export const reflect_account: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
+
export const reflect_account_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
12
|
+
export const reflect_event: (a: number, b: number, c: any) => [number, number, number];
|
|
13
|
+
export const reflect_event_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
14
|
+
export const reflect_instruction: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const reflect_instruction_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
16
|
+
export const reflect_with_manifest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
17
|
+
export const validate_manifest: (a: number, b: number) => [number, number, number];
|
|
18
|
+
export const wasm_start: () => void;
|
|
19
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
20
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
21
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
22
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
23
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
24
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "abi_reflect_wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"files": [
|
|
6
|
+
"abi_reflect_wasm_bg.wasm",
|
|
7
|
+
"abi_reflect_wasm.js",
|
|
8
|
+
"abi_reflect_wasm_bg.js",
|
|
9
|
+
"abi_reflect_wasm.d.ts"
|
|
10
|
+
],
|
|
11
|
+
"main": "abi_reflect_wasm.js",
|
|
12
|
+
"types": "abi_reflect_wasm.d.ts",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"./abi_reflect_wasm.js",
|
|
15
|
+
"./snippets/*"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export function build_layout_ir(abi_yaml: string): any;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Build layout IR from a pre-resolved manifest.
|
|
8
|
+
*/
|
|
9
|
+
export function build_layout_ir_with_manifest(manifest_json: string, root_package: string): any;
|
|
10
|
+
|
|
11
|
+
export function format_reflection(raw_json: string): any;
|
|
12
|
+
|
|
13
|
+
export function format_reflection_with_options(raw_json: string, options_json: string): any;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the list of package names in a manifest.
|
|
17
|
+
*/
|
|
18
|
+
export function get_manifest_packages(manifest_json: string): any;
|
|
19
|
+
|
|
20
|
+
export function reflect(abi_yaml: string, type_name: string, buffer: Uint8Array): any;
|
|
21
|
+
|
|
22
|
+
export function reflect_account(abi_yaml: string, buffer: Uint8Array): any;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Reflect an account using a pre-resolved manifest.
|
|
26
|
+
*/
|
|
27
|
+
export function reflect_account_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
28
|
+
|
|
29
|
+
export function reflect_event(abi_yaml: string, buffer: Uint8Array): any;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Reflect an event using a pre-resolved manifest.
|
|
33
|
+
*/
|
|
34
|
+
export function reflect_event_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
35
|
+
|
|
36
|
+
export function reflect_instruction(abi_yaml: string, buffer: Uint8Array): any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reflect an instruction using a pre-resolved manifest.
|
|
40
|
+
*/
|
|
41
|
+
export function reflect_instruction_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Reflect a binary buffer using a pre-resolved manifest.
|
|
45
|
+
*
|
|
46
|
+
* The manifest is a JSON object mapping package names to their ABI YAML content.
|
|
47
|
+
* The root_package parameter specifies which package contains the target type
|
|
48
|
+
* and root type configuration.
|
|
49
|
+
*
|
|
50
|
+
* Example manifest:
|
|
51
|
+
* ```json
|
|
52
|
+
* {
|
|
53
|
+
* "thru.program.token": "abi:\n package: thru.program.token\n ...",
|
|
54
|
+
* "thru.common.primitives": "abi:\n package: thru.common.primitives\n ..."
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function reflect_with_manifest(manifest_json: string, root_package: string, type_name: string, buffer: Uint8Array): any;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Validate a manifest and return information about its contents.
|
|
62
|
+
*/
|
|
63
|
+
export function validate_manifest(manifest_json: string): any;
|
|
64
|
+
|
|
65
|
+
export function wasm_start(): void;
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
|
|
5
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
6
|
+
ptr = ptr >>> 0;
|
|
7
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let cachedDataViewMemory0 = null;
|
|
11
|
+
function getDataViewMemory0() {
|
|
12
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
13
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
14
|
+
}
|
|
15
|
+
return cachedDataViewMemory0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getStringFromWasm0(ptr, len) {
|
|
19
|
+
ptr = ptr >>> 0;
|
|
20
|
+
return decodeText(ptr, len);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let cachedUint8ArrayMemory0 = null;
|
|
24
|
+
function getUint8ArrayMemory0() {
|
|
25
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
26
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
27
|
+
}
|
|
28
|
+
return cachedUint8ArrayMemory0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
32
|
+
if (realloc === undefined) {
|
|
33
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
34
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
35
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
36
|
+
WASM_VECTOR_LEN = buf.length;
|
|
37
|
+
return ptr;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let len = arg.length;
|
|
41
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
42
|
+
|
|
43
|
+
const mem = getUint8ArrayMemory0();
|
|
44
|
+
|
|
45
|
+
let offset = 0;
|
|
46
|
+
|
|
47
|
+
for (; offset < len; offset++) {
|
|
48
|
+
const code = arg.charCodeAt(offset);
|
|
49
|
+
if (code > 0x7F) break;
|
|
50
|
+
mem[ptr + offset] = code;
|
|
51
|
+
}
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function takeFromExternrefTable0(idx) {
|
|
69
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
70
|
+
wasm.__externref_table_dealloc(idx);
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
75
|
+
cachedTextDecoder.decode();
|
|
76
|
+
function decodeText(ptr, len) {
|
|
77
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const cachedTextEncoder = new TextEncoder();
|
|
81
|
+
|
|
82
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
83
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
84
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
85
|
+
view.set(buf);
|
|
86
|
+
return {
|
|
87
|
+
read: arg.length,
|
|
88
|
+
written: buf.length
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
let WASM_VECTOR_LEN = 0;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {string} abi_yaml
|
|
97
|
+
* @returns {any}
|
|
98
|
+
*/
|
|
99
|
+
function build_layout_ir(abi_yaml) {
|
|
100
|
+
const ptr0 = passStringToWasm0(abi_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
101
|
+
const len0 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.build_layout_ir(ptr0, len0);
|
|
103
|
+
if (ret[2]) {
|
|
104
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
105
|
+
}
|
|
106
|
+
return takeFromExternrefTable0(ret[0]);
|
|
107
|
+
}
|
|
108
|
+
exports.build_layout_ir = build_layout_ir;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Build layout IR from a pre-resolved manifest.
|
|
112
|
+
* @param {string} manifest_json
|
|
113
|
+
* @param {string} root_package
|
|
114
|
+
* @returns {any}
|
|
115
|
+
*/
|
|
116
|
+
function build_layout_ir_with_manifest(manifest_json, root_package) {
|
|
117
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
118
|
+
const len0 = WASM_VECTOR_LEN;
|
|
119
|
+
const ptr1 = passStringToWasm0(root_package, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
120
|
+
const len1 = WASM_VECTOR_LEN;
|
|
121
|
+
const ret = wasm.build_layout_ir_with_manifest(ptr0, len0, ptr1, len1);
|
|
122
|
+
if (ret[2]) {
|
|
123
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
124
|
+
}
|
|
125
|
+
return takeFromExternrefTable0(ret[0]);
|
|
126
|
+
}
|
|
127
|
+
exports.build_layout_ir_with_manifest = build_layout_ir_with_manifest;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @param {string} raw_json
|
|
131
|
+
* @returns {any}
|
|
132
|
+
*/
|
|
133
|
+
function format_reflection(raw_json) {
|
|
134
|
+
const ptr0 = passStringToWasm0(raw_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
135
|
+
const len0 = WASM_VECTOR_LEN;
|
|
136
|
+
const ret = wasm.format_reflection(ptr0, len0);
|
|
137
|
+
if (ret[2]) {
|
|
138
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
139
|
+
}
|
|
140
|
+
return takeFromExternrefTable0(ret[0]);
|
|
141
|
+
}
|
|
142
|
+
exports.format_reflection = format_reflection;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @param {string} raw_json
|
|
146
|
+
* @param {string} options_json
|
|
147
|
+
* @returns {any}
|
|
148
|
+
*/
|
|
149
|
+
function format_reflection_with_options(raw_json, options_json) {
|
|
150
|
+
const ptr0 = passStringToWasm0(raw_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
151
|
+
const len0 = WASM_VECTOR_LEN;
|
|
152
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
153
|
+
const len1 = WASM_VECTOR_LEN;
|
|
154
|
+
const ret = wasm.format_reflection_with_options(ptr0, len0, ptr1, len1);
|
|
155
|
+
if (ret[2]) {
|
|
156
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
157
|
+
}
|
|
158
|
+
return takeFromExternrefTable0(ret[0]);
|
|
159
|
+
}
|
|
160
|
+
exports.format_reflection_with_options = format_reflection_with_options;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Get the list of package names in a manifest.
|
|
164
|
+
* @param {string} manifest_json
|
|
165
|
+
* @returns {any}
|
|
166
|
+
*/
|
|
167
|
+
function get_manifest_packages(manifest_json) {
|
|
168
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
169
|
+
const len0 = WASM_VECTOR_LEN;
|
|
170
|
+
const ret = wasm.get_manifest_packages(ptr0, len0);
|
|
171
|
+
if (ret[2]) {
|
|
172
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
173
|
+
}
|
|
174
|
+
return takeFromExternrefTable0(ret[0]);
|
|
175
|
+
}
|
|
176
|
+
exports.get_manifest_packages = get_manifest_packages;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} abi_yaml
|
|
180
|
+
* @param {string} type_name
|
|
181
|
+
* @param {Uint8Array} buffer
|
|
182
|
+
* @returns {any}
|
|
183
|
+
*/
|
|
184
|
+
function reflect(abi_yaml, type_name, buffer) {
|
|
185
|
+
const ptr0 = passStringToWasm0(abi_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
186
|
+
const len0 = WASM_VECTOR_LEN;
|
|
187
|
+
const ptr1 = passStringToWasm0(type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
+
const len1 = WASM_VECTOR_LEN;
|
|
189
|
+
const ret = wasm.reflect(ptr0, len0, ptr1, len1, buffer);
|
|
190
|
+
if (ret[2]) {
|
|
191
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
192
|
+
}
|
|
193
|
+
return takeFromExternrefTable0(ret[0]);
|
|
194
|
+
}
|
|
195
|
+
exports.reflect = reflect;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @param {string} abi_yaml
|
|
199
|
+
* @param {Uint8Array} buffer
|
|
200
|
+
* @returns {any}
|
|
201
|
+
*/
|
|
202
|
+
function reflect_account(abi_yaml, buffer) {
|
|
203
|
+
const ptr0 = passStringToWasm0(abi_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
204
|
+
const len0 = WASM_VECTOR_LEN;
|
|
205
|
+
const ret = wasm.reflect_account(ptr0, len0, buffer);
|
|
206
|
+
if (ret[2]) {
|
|
207
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
208
|
+
}
|
|
209
|
+
return takeFromExternrefTable0(ret[0]);
|
|
210
|
+
}
|
|
211
|
+
exports.reflect_account = reflect_account;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Reflect an account using a pre-resolved manifest.
|
|
215
|
+
* @param {string} manifest_json
|
|
216
|
+
* @param {string} root_package
|
|
217
|
+
* @param {Uint8Array} buffer
|
|
218
|
+
* @returns {any}
|
|
219
|
+
*/
|
|
220
|
+
function reflect_account_with_manifest(manifest_json, root_package, buffer) {
|
|
221
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
222
|
+
const len0 = WASM_VECTOR_LEN;
|
|
223
|
+
const ptr1 = passStringToWasm0(root_package, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
224
|
+
const len1 = WASM_VECTOR_LEN;
|
|
225
|
+
const ret = wasm.reflect_account_with_manifest(ptr0, len0, ptr1, len1, buffer);
|
|
226
|
+
if (ret[2]) {
|
|
227
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
228
|
+
}
|
|
229
|
+
return takeFromExternrefTable0(ret[0]);
|
|
230
|
+
}
|
|
231
|
+
exports.reflect_account_with_manifest = reflect_account_with_manifest;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @param {string} abi_yaml
|
|
235
|
+
* @param {Uint8Array} buffer
|
|
236
|
+
* @returns {any}
|
|
237
|
+
*/
|
|
238
|
+
function reflect_event(abi_yaml, buffer) {
|
|
239
|
+
const ptr0 = passStringToWasm0(abi_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
240
|
+
const len0 = WASM_VECTOR_LEN;
|
|
241
|
+
const ret = wasm.reflect_event(ptr0, len0, buffer);
|
|
242
|
+
if (ret[2]) {
|
|
243
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
244
|
+
}
|
|
245
|
+
return takeFromExternrefTable0(ret[0]);
|
|
246
|
+
}
|
|
247
|
+
exports.reflect_event = reflect_event;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Reflect an event using a pre-resolved manifest.
|
|
251
|
+
* @param {string} manifest_json
|
|
252
|
+
* @param {string} root_package
|
|
253
|
+
* @param {Uint8Array} buffer
|
|
254
|
+
* @returns {any}
|
|
255
|
+
*/
|
|
256
|
+
function reflect_event_with_manifest(manifest_json, root_package, buffer) {
|
|
257
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
const ptr1 = passStringToWasm0(root_package, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
260
|
+
const len1 = WASM_VECTOR_LEN;
|
|
261
|
+
const ret = wasm.reflect_event_with_manifest(ptr0, len0, ptr1, len1, buffer);
|
|
262
|
+
if (ret[2]) {
|
|
263
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
264
|
+
}
|
|
265
|
+
return takeFromExternrefTable0(ret[0]);
|
|
266
|
+
}
|
|
267
|
+
exports.reflect_event_with_manifest = reflect_event_with_manifest;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @param {string} abi_yaml
|
|
271
|
+
* @param {Uint8Array} buffer
|
|
272
|
+
* @returns {any}
|
|
273
|
+
*/
|
|
274
|
+
function reflect_instruction(abi_yaml, buffer) {
|
|
275
|
+
const ptr0 = passStringToWasm0(abi_yaml, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
276
|
+
const len0 = WASM_VECTOR_LEN;
|
|
277
|
+
const ret = wasm.reflect_instruction(ptr0, len0, buffer);
|
|
278
|
+
if (ret[2]) {
|
|
279
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
280
|
+
}
|
|
281
|
+
return takeFromExternrefTable0(ret[0]);
|
|
282
|
+
}
|
|
283
|
+
exports.reflect_instruction = reflect_instruction;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Reflect an instruction using a pre-resolved manifest.
|
|
287
|
+
* @param {string} manifest_json
|
|
288
|
+
* @param {string} root_package
|
|
289
|
+
* @param {Uint8Array} buffer
|
|
290
|
+
* @returns {any}
|
|
291
|
+
*/
|
|
292
|
+
function reflect_instruction_with_manifest(manifest_json, root_package, buffer) {
|
|
293
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
const ptr1 = passStringToWasm0(root_package, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
296
|
+
const len1 = WASM_VECTOR_LEN;
|
|
297
|
+
const ret = wasm.reflect_instruction_with_manifest(ptr0, len0, ptr1, len1, buffer);
|
|
298
|
+
if (ret[2]) {
|
|
299
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
300
|
+
}
|
|
301
|
+
return takeFromExternrefTable0(ret[0]);
|
|
302
|
+
}
|
|
303
|
+
exports.reflect_instruction_with_manifest = reflect_instruction_with_manifest;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Reflect a binary buffer using a pre-resolved manifest.
|
|
307
|
+
*
|
|
308
|
+
* The manifest is a JSON object mapping package names to their ABI YAML content.
|
|
309
|
+
* The root_package parameter specifies which package contains the target type
|
|
310
|
+
* and root type configuration.
|
|
311
|
+
*
|
|
312
|
+
* Example manifest:
|
|
313
|
+
* ```json
|
|
314
|
+
* {
|
|
315
|
+
* "thru.program.token": "abi:\n package: thru.program.token\n ...",
|
|
316
|
+
* "thru.common.primitives": "abi:\n package: thru.common.primitives\n ..."
|
|
317
|
+
* }
|
|
318
|
+
* ```
|
|
319
|
+
* @param {string} manifest_json
|
|
320
|
+
* @param {string} root_package
|
|
321
|
+
* @param {string} type_name
|
|
322
|
+
* @param {Uint8Array} buffer
|
|
323
|
+
* @returns {any}
|
|
324
|
+
*/
|
|
325
|
+
function reflect_with_manifest(manifest_json, root_package, type_name, buffer) {
|
|
326
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
327
|
+
const len0 = WASM_VECTOR_LEN;
|
|
328
|
+
const ptr1 = passStringToWasm0(root_package, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
329
|
+
const len1 = WASM_VECTOR_LEN;
|
|
330
|
+
const ptr2 = passStringToWasm0(type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
331
|
+
const len2 = WASM_VECTOR_LEN;
|
|
332
|
+
const ret = wasm.reflect_with_manifest(ptr0, len0, ptr1, len1, ptr2, len2, buffer);
|
|
333
|
+
if (ret[2]) {
|
|
334
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
335
|
+
}
|
|
336
|
+
return takeFromExternrefTable0(ret[0]);
|
|
337
|
+
}
|
|
338
|
+
exports.reflect_with_manifest = reflect_with_manifest;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Validate a manifest and return information about its contents.
|
|
342
|
+
* @param {string} manifest_json
|
|
343
|
+
* @returns {any}
|
|
344
|
+
*/
|
|
345
|
+
function validate_manifest(manifest_json) {
|
|
346
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
348
|
+
const ret = wasm.validate_manifest(ptr0, len0);
|
|
349
|
+
if (ret[2]) {
|
|
350
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
351
|
+
}
|
|
352
|
+
return takeFromExternrefTable0(ret[0]);
|
|
353
|
+
}
|
|
354
|
+
exports.validate_manifest = validate_manifest;
|
|
355
|
+
|
|
356
|
+
function wasm_start() {
|
|
357
|
+
wasm.wasm_start();
|
|
358
|
+
}
|
|
359
|
+
exports.wasm_start = wasm_start;
|
|
360
|
+
|
|
361
|
+
exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
362
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
366
|
+
let deferred0_0;
|
|
367
|
+
let deferred0_1;
|
|
368
|
+
try {
|
|
369
|
+
deferred0_0 = arg0;
|
|
370
|
+
deferred0_1 = arg1;
|
|
371
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
372
|
+
} finally {
|
|
373
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
378
|
+
const ret = arg0.length;
|
|
379
|
+
return ret;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
383
|
+
const ret = new Error();
|
|
384
|
+
return ret;
|
|
385
|
+
};
|
|
386
|
+
|
|
387
|
+
exports.__wbg_new_df1173567d5ff028 = function(arg0, arg1) {
|
|
388
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
389
|
+
return ret;
|
|
390
|
+
};
|
|
391
|
+
|
|
392
|
+
exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
393
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
397
|
+
const ret = arg1.stack;
|
|
398
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
399
|
+
const len1 = WASM_VECTOR_LEN;
|
|
400
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
401
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
405
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
406
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
407
|
+
return ret;
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
exports.__wbindgen_init_externref_table = function() {
|
|
411
|
+
const table = wasm.__wbindgen_externrefs;
|
|
412
|
+
const offset = table.grow(4);
|
|
413
|
+
table.set(0, undefined);
|
|
414
|
+
table.set(offset + 0, undefined);
|
|
415
|
+
table.set(offset + 1, null);
|
|
416
|
+
table.set(offset + 2, true);
|
|
417
|
+
table.set(offset + 3, false);
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
const wasmPath = `${__dirname}/abi_reflect_wasm_bg.wasm`;
|
|
421
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
422
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
423
|
+
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
424
|
+
|
|
425
|
+
wasm.__wbindgen_start();
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const build_layout_ir: (a: number, b: number) => [number, number, number];
|
|
5
|
+
export const build_layout_ir_with_manifest: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
6
|
+
export const format_reflection: (a: number, b: number) => [number, number, number];
|
|
7
|
+
export const format_reflection_with_options: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
8
|
+
export const get_manifest_packages: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const reflect: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
10
|
+
export const reflect_account: (a: number, b: number, c: any) => [number, number, number];
|
|
11
|
+
export const reflect_account_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
12
|
+
export const reflect_event: (a: number, b: number, c: any) => [number, number, number];
|
|
13
|
+
export const reflect_event_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
14
|
+
export const reflect_instruction: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const reflect_instruction_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
16
|
+
export const reflect_with_manifest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
17
|
+
export const validate_manifest: (a: number, b: number) => [number, number, number];
|
|
18
|
+
export const wasm_start: () => void;
|
|
19
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
20
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
21
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
22
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
23
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
24
|
+
export const __wbindgen_start: () => void;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export function build_layout_ir(abi_yaml: string): any;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Build layout IR from a pre-resolved manifest.
|
|
8
|
+
*/
|
|
9
|
+
export function build_layout_ir_with_manifest(manifest_json: string, root_package: string): any;
|
|
10
|
+
|
|
11
|
+
export function format_reflection(raw_json: string): any;
|
|
12
|
+
|
|
13
|
+
export function format_reflection_with_options(raw_json: string, options_json: string): any;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the list of package names in a manifest.
|
|
17
|
+
*/
|
|
18
|
+
export function get_manifest_packages(manifest_json: string): any;
|
|
19
|
+
|
|
20
|
+
export function reflect(abi_yaml: string, type_name: string, buffer: Uint8Array): any;
|
|
21
|
+
|
|
22
|
+
export function reflect_account(abi_yaml: string, buffer: Uint8Array): any;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Reflect an account using a pre-resolved manifest.
|
|
26
|
+
*/
|
|
27
|
+
export function reflect_account_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
28
|
+
|
|
29
|
+
export function reflect_event(abi_yaml: string, buffer: Uint8Array): any;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Reflect an event using a pre-resolved manifest.
|
|
33
|
+
*/
|
|
34
|
+
export function reflect_event_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
35
|
+
|
|
36
|
+
export function reflect_instruction(abi_yaml: string, buffer: Uint8Array): any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Reflect an instruction using a pre-resolved manifest.
|
|
40
|
+
*/
|
|
41
|
+
export function reflect_instruction_with_manifest(manifest_json: string, root_package: string, buffer: Uint8Array): any;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Reflect a binary buffer using a pre-resolved manifest.
|
|
45
|
+
*
|
|
46
|
+
* The manifest is a JSON object mapping package names to their ABI YAML content.
|
|
47
|
+
* The root_package parameter specifies which package contains the target type
|
|
48
|
+
* and root type configuration.
|
|
49
|
+
*
|
|
50
|
+
* Example manifest:
|
|
51
|
+
* ```json
|
|
52
|
+
* {
|
|
53
|
+
* "thru.program.token": "abi:\n package: thru.program.token\n ...",
|
|
54
|
+
* "thru.common.primitives": "abi:\n package: thru.common.primitives\n ..."
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function reflect_with_manifest(manifest_json: string, root_package: string, type_name: string, buffer: Uint8Array): any;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Validate a manifest and return information about its contents.
|
|
62
|
+
*/
|
|
63
|
+
export function validate_manifest(manifest_json: string): any;
|
|
64
|
+
|
|
65
|
+
export function wasm_start(): void;
|
|
66
|
+
|
|
67
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
68
|
+
|
|
69
|
+
export interface InitOutput {
|
|
70
|
+
readonly memory: WebAssembly.Memory;
|
|
71
|
+
readonly build_layout_ir: (a: number, b: number) => [number, number, number];
|
|
72
|
+
readonly build_layout_ir_with_manifest: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
73
|
+
readonly format_reflection: (a: number, b: number) => [number, number, number];
|
|
74
|
+
readonly format_reflection_with_options: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
75
|
+
readonly get_manifest_packages: (a: number, b: number) => [number, number, number];
|
|
76
|
+
readonly reflect: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
77
|
+
readonly reflect_account: (a: number, b: number, c: any) => [number, number, number];
|
|
78
|
+
readonly reflect_account_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
79
|
+
readonly reflect_event: (a: number, b: number, c: any) => [number, number, number];
|
|
80
|
+
readonly reflect_event_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
81
|
+
readonly reflect_instruction: (a: number, b: number, c: any) => [number, number, number];
|
|
82
|
+
readonly reflect_instruction_with_manifest: (a: number, b: number, c: number, d: number, e: any) => [number, number, number];
|
|
83
|
+
readonly reflect_with_manifest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
84
|
+
readonly validate_manifest: (a: number, b: number) => [number, number, number];
|
|
85
|
+
readonly wasm_start: () => void;
|
|
86
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
87
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
88
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
89
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
90
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
91
|
+
readonly __wbindgen_start: () => void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
98
|
+
* a precompiled `WebAssembly.Module`.
|
|
99
|
+
*
|
|
100
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
101
|
+
*
|
|
102
|
+
* @returns {InitOutput}
|
|
103
|
+
*/
|
|
104
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
108
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
109
|
+
*
|
|
110
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
111
|
+
*
|
|
112
|
+
* @returns {Promise<InitOutput>}
|
|
113
|
+
*/
|
|
114
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|