forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb3Wallet.ts
More file actions
41 lines (34 loc) · 1.25 KB
/
Copy pathweb3Wallet.ts
File metadata and controls
41 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import type { Web3WalletJSONSnapshot } from 'snapshots';
import type { ClerkResource } from './resource';
import type { Web3Strategy } from './strategies';
import type { VerificationResource } from './verification';
import type { Web3Provider } from './web3';
export type PrepareWeb3WalletVerificationParams = {
strategy: Web3Strategy;
};
export type AttemptWeb3WalletVerificationParams = {
signature: string;
strategy?: Web3Strategy;
};
export interface Web3WalletResource extends ClerkResource {
id: string;
web3Wallet: string;
verification: VerificationResource;
toString: () => string;
prepareVerification: (params: PrepareWeb3WalletVerificationParams) => Promise<Web3WalletResource>;
attemptVerification: (params: AttemptWeb3WalletVerificationParams) => Promise<Web3WalletResource>;
destroy: () => Promise<void>;
create: () => Promise<Web3WalletResource>;
__internal_toSnapshot: () => Web3WalletJSONSnapshot;
}
export type GenerateSignature = (opts: GenerateSignatureParams) => Promise<string>;
export interface AuthenticateWithWeb3Params {
identifier: string;
generateSignature: GenerateSignature;
strategy?: Web3Strategy;
}
export interface GenerateSignatureParams {
identifier: string;
nonce: string;
provider?: Web3Provider;
}