walletkit-web 0.21.3 → 0.22.1
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.md +105 -17
- package/dist/generated/walletkit.wasm +0 -0
- package/dist/generated/walletkit_bg.d.ts +30 -0
- package/dist/generated/walletkit_core-ffi.d.ts +210 -26
- package/dist/generated/walletkit_core.d.ts +662 -48
- package/dist/index.d.ts +21 -10
- package/dist/index.js +110 -11416
- package/dist/protocol.d.ts +94 -0
- package/dist/walletkit.worker.d.ts +1 -0
- package/dist/walletkit.worker.js +14597 -0
- package/package.json +14 -6
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** Values crossing the worker boundary are plain structured-clone data. */
|
|
2
|
+
export interface RecoveryData {
|
|
3
|
+
authenticatorAddress: string;
|
|
4
|
+
authenticatorPubkey: string;
|
|
5
|
+
offchainSignerCommitment: string;
|
|
6
|
+
}
|
|
7
|
+
export type RegistrationStatus = {
|
|
8
|
+
state: "queued" | "batching" | "submitted" | "finalized";
|
|
9
|
+
} | {
|
|
10
|
+
state: "failed";
|
|
11
|
+
error: string;
|
|
12
|
+
errorCode?: string;
|
|
13
|
+
};
|
|
14
|
+
export interface InitializeOptions {
|
|
15
|
+
/** 32-byte database encryption key. Supply the same databaseKey when reopening storage. */
|
|
16
|
+
databaseKey: Uint8Array;
|
|
17
|
+
/** Stable storage namespace, unique per consumer/account. Default: "default". */
|
|
18
|
+
storageId?: string;
|
|
19
|
+
environment?: "production" | "staging";
|
|
20
|
+
region?: "eu" | "us" | "ap";
|
|
21
|
+
rpcUrl?: string;
|
|
22
|
+
workerUrl?: string | URL;
|
|
23
|
+
wasmUrl?: string | URL;
|
|
24
|
+
/** Abort initialization and release the worker (for example on unmount). */
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}
|
|
27
|
+
export type WorkerOptions = Required<Pick<InitializeOptions, "storageId" | "environment" | "region">> & Pick<InitializeOptions, "rpcUrl"> & {
|
|
28
|
+
databaseKey: Uint8Array;
|
|
29
|
+
wasmUrl: string;
|
|
30
|
+
};
|
|
31
|
+
export interface Operations {
|
|
32
|
+
initialize: {
|
|
33
|
+
args: [WorkerOptions];
|
|
34
|
+
result: void;
|
|
35
|
+
};
|
|
36
|
+
recoveryDataFromSeed: {
|
|
37
|
+
args: [Uint8Array];
|
|
38
|
+
result: RecoveryData;
|
|
39
|
+
};
|
|
40
|
+
register: {
|
|
41
|
+
args: [Uint8Array];
|
|
42
|
+
result: void;
|
|
43
|
+
};
|
|
44
|
+
pollRegistration: {
|
|
45
|
+
args: [];
|
|
46
|
+
result: RegistrationStatus;
|
|
47
|
+
};
|
|
48
|
+
initializeAuthenticator: {
|
|
49
|
+
args: [Uint8Array, bigint];
|
|
50
|
+
result: void;
|
|
51
|
+
};
|
|
52
|
+
prepareCredential: {
|
|
53
|
+
args: [bigint];
|
|
54
|
+
result: {
|
|
55
|
+
blindingFactor: string;
|
|
56
|
+
sub: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
storeCredential: {
|
|
60
|
+
args: [Uint8Array, string, bigint];
|
|
61
|
+
result: {
|
|
62
|
+
credentialId: bigint;
|
|
63
|
+
issuerSchemaId: bigint;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
generateProof: {
|
|
67
|
+
args: [string, bigint];
|
|
68
|
+
result: string;
|
|
69
|
+
};
|
|
70
|
+
close: {
|
|
71
|
+
args: [];
|
|
72
|
+
result: void;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export type Method = keyof Operations;
|
|
76
|
+
export type Request = {
|
|
77
|
+
[M in Method]: {
|
|
78
|
+
id: number;
|
|
79
|
+
method: M;
|
|
80
|
+
args: Operations[M]["args"];
|
|
81
|
+
};
|
|
82
|
+
}[Method];
|
|
83
|
+
export type Response = {
|
|
84
|
+
id: number;
|
|
85
|
+
} & ({
|
|
86
|
+
ok: true;
|
|
87
|
+
result: unknown;
|
|
88
|
+
} | {
|
|
89
|
+
ok: false;
|
|
90
|
+
error: {
|
|
91
|
+
name: string;
|
|
92
|
+
message: string;
|
|
93
|
+
};
|
|
94
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|