@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.
- package/LICENSE +21 -0
- package/README.md +34 -13
- package/dist/FedimintWallet.d.ts +47 -12
- package/dist/FedimintWallet.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/wallet.d.ts +19 -3
- package/dist/types/wallet.d.ts.map +1 -1
- package/dist/worker.js +2 -0
- package/dist/worker.js.map +1 -0
- package/node_modules/fedimint-client-wasm/fedimint_client_wasm.d.ts +49 -0
- package/node_modules/fedimint-client-wasm/fedimint_client_wasm.js +4 -0
- package/node_modules/fedimint-client-wasm/fedimint_client_wasm_bg.js +1411 -0
- package/{dist/assets/fedimint_client_wasm_bg-DxOUItb-.wasm → node_modules/fedimint-client-wasm/fedimint_client_wasm_bg.wasm} +0 -0
- package/node_modules/fedimint-client-wasm/package.json +26 -0
- package/package.json +10 -5
- package/src/FedimintWallet.ts +225 -91
- package/src/types/wallet.ts +25 -2
- package/src/worker.js +80 -0
- package/wasm/fedimint_client_wasm.d.ts +41 -96
- package/wasm/fedimint_client_wasm.js +4 -1120
- package/wasm/fedimint_client_wasm_bg.js +1197 -659
- package/wasm/fedimint_client_wasm_bg.wasm +0 -0
- package/wasm/fedimint_client_wasm_bg.wasm.d.ts +108 -32
- package/wasm/package.json +26 -0
- package/dist/wasm.worker.d.ts +0 -1
- package/dist/wasm.worker.d.ts.map +0 -1
- package/src/vite-env.d.ts +0 -1
- package/src/wasm.worker.ts +0 -41
|
@@ -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
|
+
}
|