@fedimint/core-web 0.0.2 → 0.0.3

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,49 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ */
5
+ export class RpcHandle {
6
+ free(): void
7
+ /**
8
+ */
9
+ cancel(): void
10
+ }
11
+ /**
12
+ */
13
+ export class WasmClient {
14
+ free(): void
15
+ /**
16
+ * Open fedimint client with already joined federation.
17
+ *
18
+ * After you have joined a federation, you can reopen the fedimint client
19
+ * with same client_name. Opening client with same name at same time is
20
+ * not supported. You can close the current client by calling
21
+ * `client.free()`. NOTE: The client will remain active until all the
22
+ * running rpc calls have finished.
23
+ * @param {string} client_name
24
+ * @returns {Promise<WasmClient | undefined>}
25
+ */
26
+ static open(client_name: string): Promise<WasmClient | undefined>
27
+ /**
28
+ * Open a fedimint client by join a federation.
29
+ * @param {string} client_name
30
+ * @param {string} invite_code
31
+ * @returns {Promise<WasmClient>}
32
+ */
33
+ static join_federation(
34
+ client_name: string,
35
+ invite_code: string,
36
+ ): Promise<WasmClient>
37
+ /**
38
+ * Call a fedimint client rpc the responses are returned using `cb`
39
+ * callback. Each rpc call *can* return multiple responses by calling
40
+ * `cb` multiple times. The returned RpcHandle can be used to cancel the
41
+ * operation.
42
+ * @param {string} module
43
+ * @param {string} method
44
+ * @param {string} payload
45
+ * @param {Function} cb
46
+ * @returns {RpcHandle}
47
+ */
48
+ rpc(module: string, method: string, payload: string, cb: Function): RpcHandle
49
+ }
@@ -0,0 +1,4 @@
1
+ import * as wasm from './fedimint_client_wasm_bg.wasm'
2
+ import { __wbg_set_wasm } from './fedimint_client_wasm_bg.js'
3
+ __wbg_set_wasm(wasm)
4
+ export * from './fedimint_client_wasm_bg.js'