@fedimint/core-web 0.0.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.
@@ -0,0 +1,94 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ */
5
+ export class WasmClient {
6
+ free(): void;
7
+ /**
8
+ * Open fedimint client with already joined federation.
9
+ *
10
+ * After you have joined a federation, you can reopen the fedimint client
11
+ * with same client_name. Opening client with same name at same time is
12
+ * not supported. You can close the current client by calling
13
+ * `client.free()`. NOTE: The client will remain active until all the
14
+ * running rpc calls have finished.
15
+ * @param {string} client_name
16
+ * @returns {Promise<WasmClient | undefined>}
17
+ */
18
+ static open(client_name: string): Promise<WasmClient | undefined>;
19
+ /**
20
+ * Open a fedimint client by join a federation.
21
+ * @param {string} client_name
22
+ * @param {string} invite_code
23
+ * @returns {Promise<WasmClient>}
24
+ */
25
+ static join_federation(client_name: string, invite_code: string): Promise<WasmClient>;
26
+ /**
27
+ * Call a fedimint client rpc the responses are returned using `cb`
28
+ * callback. Each rpc call *can* return multiple responses by calling
29
+ * `cb` multiple times. You should ignore the promise by this function
30
+ * because it has no significance.
31
+ * @param {string} module
32
+ * @param {string} method
33
+ * @param {string} payload
34
+ * @param {Function} cb
35
+ * @returns {Promise<void>}
36
+ */
37
+ rpc(module: string, method: string, payload: string, cb: Function): Promise<void>;
38
+ }
39
+
40
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
41
+
42
+ export interface InitOutput {
43
+ readonly memory: WebAssembly.Memory;
44
+ readonly __wbg_wasmclient_free: (a: number) => void;
45
+ readonly wasmclient_open: (a: number, b: number) => number;
46
+ readonly wasmclient_join_federation: (a: number, b: number, c: number, d: number) => number;
47
+ readonly wasmclient_rpc: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
48
+ readonly ring_core_0_17_8_bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
49
+ readonly rustsecp256k1zkp_v0_8_0_default_illegal_callback_fn: (a: number, b: number) => void;
50
+ readonly rustsecp256k1zkp_v0_8_0_default_error_callback_fn: (a: number, b: number) => void;
51
+ readonly rustsecp256k1_v0_6_1_context_create: (a: number) => number;
52
+ readonly rustsecp256k1_v0_6_1_context_destroy: (a: number) => void;
53
+ readonly rustsecp256k1_v0_6_1_default_illegal_callback_fn: (a: number, b: number) => void;
54
+ readonly rustsecp256k1_v0_6_1_default_error_callback_fn: (a: number, b: number) => void;
55
+ readonly rustsecp256k1_v0_8_1_context_create: (a: number) => number;
56
+ readonly rustsecp256k1_v0_8_1_context_destroy: (a: number) => void;
57
+ readonly rustsecp256k1_v0_8_1_default_illegal_callback_fn: (a: number, b: number) => void;
58
+ readonly rustsecp256k1_v0_8_1_default_error_callback_fn: (a: number, b: number) => void;
59
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
60
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
61
+ readonly __wbindgen_export_2: WebAssembly.Table;
62
+ readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
63
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h30ddf3bee31ebb33: (a: number, b: number, c: number, d: number) => void;
64
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h31a94cc9a05d5ca0: (a: number, b: number, c: number) => void;
65
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4d11ec113460b95d: (a: number, b: number) => void;
66
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he7056307c6986185: (a: number, b: number, c: number, d: number) => void;
67
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5b16159cdfa166b0: (a: number, b: number) => void;
68
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hebf1bd391d12b3cb: (a: number, b: number, c: number) => void;
69
+ readonly _dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09ee3e3abd173580: (a: number, b: number) => void;
70
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
71
+ readonly __wbindgen_exn_store: (a: number) => void;
72
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h8bdaa9faeb7d5075: (a: number, b: number, c: number, d: number) => void;
73
+ }
74
+
75
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
76
+ /**
77
+ * Instantiates the given `module`, which can either be bytes or
78
+ * a precompiled `WebAssembly.Module`.
79
+ *
80
+ * @param {SyncInitInput} module
81
+ *
82
+ * @returns {InitOutput}
83
+ */
84
+ export function initSync(module: SyncInitInput): InitOutput;
85
+
86
+ /**
87
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
88
+ * for everything else, calls `WebAssembly.instantiate` directly.
89
+ *
90
+ * @param {InitInput | Promise<InitInput>} module_or_path
91
+ *
92
+ * @returns {Promise<InitOutput>}
93
+ */
94
+ export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;