@veridex/sdk 1.0.0-beta.22 → 1.0.0-beta.24

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.
Files changed (112) hide show
  1. package/dist/EVMClient-CoOR_ywD.d.mts +332 -0
  2. package/dist/auth/prepareAuth.d.mts +1 -1
  3. package/dist/auth/prepareAuth.js +749 -3
  4. package/dist/auth/prepareAuth.js.map +1 -1
  5. package/dist/auth/prepareAuth.mjs +25 -1404
  6. package/dist/auth/prepareAuth.mjs.map +1 -1
  7. package/dist/chains/aptos/index.d.mts +1 -1
  8. package/dist/chains/aptos/index.mjs +5 -574
  9. package/dist/chains/aptos/index.mjs.map +1 -1
  10. package/dist/chains/avalanche/index.d.mts +137 -0
  11. package/dist/chains/avalanche/index.js +1407 -0
  12. package/dist/chains/avalanche/index.js.map +1 -0
  13. package/dist/chains/avalanche/index.mjs +10 -0
  14. package/dist/chains/avalanche/index.mjs.map +1 -0
  15. package/dist/chains/evm/index.d.mts +4 -2
  16. package/dist/chains/evm/index.mjs +8 -1200
  17. package/dist/chains/evm/index.mjs.map +1 -1
  18. package/dist/chains/solana/index.d.mts +1 -1
  19. package/dist/chains/solana/index.mjs +4 -486
  20. package/dist/chains/solana/index.mjs.map +1 -1
  21. package/dist/chains/stacks/index.d.mts +1 -1
  22. package/dist/chains/stacks/index.mjs +36 -1114
  23. package/dist/chains/stacks/index.mjs.map +1 -1
  24. package/dist/chains/starknet/index.d.mts +1 -1
  25. package/dist/chains/starknet/index.mjs +5 -503
  26. package/dist/chains/starknet/index.mjs.map +1 -1
  27. package/dist/chains/sui/index.d.mts +1 -1
  28. package/dist/chains/sui/index.mjs +5 -529
  29. package/dist/chains/sui/index.mjs.map +1 -1
  30. package/dist/chunk-3Q34PMHU.mjs +840 -0
  31. package/dist/chunk-3Q34PMHU.mjs.map +1 -0
  32. package/dist/chunk-72ZA3OYQ.mjs +20 -0
  33. package/dist/chunk-72ZA3OYQ.mjs.map +1 -0
  34. package/dist/chunk-7IEUU6LD.mjs +549 -0
  35. package/dist/chunk-7IEUU6LD.mjs.map +1 -0
  36. package/dist/chunk-ABLEEC5N.mjs +38 -0
  37. package/dist/chunk-ABLEEC5N.mjs.map +1 -0
  38. package/dist/chunk-AORSW75A.mjs +1101 -0
  39. package/dist/chunk-AORSW75A.mjs.map +1 -0
  40. package/dist/chunk-BKTCPT7P.mjs +269 -0
  41. package/dist/chunk-BKTCPT7P.mjs.map +1 -0
  42. package/dist/chunk-CCHASDAI.mjs +330 -0
  43. package/dist/chunk-CCHASDAI.mjs.map +1 -0
  44. package/dist/chunk-FQ2WU7PX.mjs +509 -0
  45. package/dist/chunk-FQ2WU7PX.mjs.map +1 -0
  46. package/dist/chunk-JO74ENTF.mjs +417 -0
  47. package/dist/chunk-JO74ENTF.mjs.map +1 -0
  48. package/dist/chunk-K73Y36KS.mjs +407 -0
  49. package/dist/chunk-K73Y36KS.mjs.map +1 -0
  50. package/dist/chunk-KHV3EP3I.mjs +179 -0
  51. package/dist/chunk-KHV3EP3I.mjs.map +1 -0
  52. package/dist/chunk-MMSTOW4F.mjs +722 -0
  53. package/dist/chunk-MMSTOW4F.mjs.map +1 -0
  54. package/dist/chunk-MWZ5UHCF.mjs +1082 -0
  55. package/dist/chunk-MWZ5UHCF.mjs.map +1 -0
  56. package/dist/chunk-NU6JGI7L.mjs +565 -0
  57. package/dist/chunk-NU6JGI7L.mjs.map +1 -0
  58. package/dist/chunk-PIC2Y5DF.mjs +422 -0
  59. package/dist/chunk-PIC2Y5DF.mjs.map +1 -0
  60. package/dist/chunk-PPN7BG3A.mjs +464 -0
  61. package/dist/chunk-PPN7BG3A.mjs.map +1 -0
  62. package/dist/chunk-RSV7J43V.mjs +438 -0
  63. package/dist/chunk-RSV7J43V.mjs.map +1 -0
  64. package/dist/chunk-UTT6KI7N.mjs +216 -0
  65. package/dist/chunk-UTT6KI7N.mjs.map +1 -0
  66. package/dist/constants.mjs +16 -389
  67. package/dist/constants.mjs.map +1 -1
  68. package/dist/index-Du1PoZqu.d.mts +216 -0
  69. package/dist/index.d.mts +131 -9
  70. package/dist/index.js +12064 -11594
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +4407 -12273
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/passkey.d.mts +142 -0
  75. package/dist/passkey.js +807 -0
  76. package/dist/passkey.js.map +1 -0
  77. package/dist/passkey.mjs +15 -0
  78. package/dist/passkey.mjs.map +1 -0
  79. package/dist/payload.mjs +25 -244
  80. package/dist/payload.mjs.map +1 -1
  81. package/dist/portfolio-UV3LLWKI.mjs +13 -0
  82. package/dist/portfolio-UV3LLWKI.mjs.map +1 -0
  83. package/dist/queries/index.js +39 -1
  84. package/dist/queries/index.js.map +1 -1
  85. package/dist/queries/index.mjs +14 -1591
  86. package/dist/queries/index.mjs.map +1 -1
  87. package/dist/{types-DakHNZIP.d.ts → types-Bmk689Lw.d.mts} +1 -1
  88. package/dist/types.d.mts +10 -0
  89. package/dist/types.js.map +1 -1
  90. package/dist/utils.mjs +19 -385
  91. package/dist/utils.mjs.map +1 -1
  92. package/dist/wormhole.mjs +25 -397
  93. package/dist/wormhole.mjs.map +1 -1
  94. package/package.json +11 -1
  95. package/dist/auth/prepareAuth.d.ts +0 -25
  96. package/dist/chains/aptos/index.d.ts +0 -146
  97. package/dist/chains/evm/index.d.ts +0 -5
  98. package/dist/chains/solana/index.d.ts +0 -116
  99. package/dist/chains/stacks/index.d.ts +0 -559
  100. package/dist/chains/starknet/index.d.ts +0 -172
  101. package/dist/chains/sui/index.d.ts +0 -182
  102. package/dist/constants.d.ts +0 -150
  103. package/dist/index-Dy29mvBf.d.mts +0 -683
  104. package/dist/index-eXXqodd0.d.ts +0 -683
  105. package/dist/index.d.ts +0 -3442
  106. package/dist/payload.d.ts +0 -125
  107. package/dist/queries/index.d.ts +0 -148
  108. package/dist/types-DakHNZIP.d.mts +0 -571
  109. package/dist/types-DvFRnIBd.d.ts +0 -172
  110. package/dist/types.d.ts +0 -413
  111. package/dist/utils.d.ts +0 -81
  112. package/dist/wormhole.d.ts +0 -167
@@ -1,683 +0,0 @@
1
- import { RegisterSessionParams, RevokeSessionParams, SessionValidationResult, SessionKey as SessionKey$1, IdentityState } from './types.js';
2
- import { ethers } from 'ethers';
3
- import { f as ChainClient, a as ChainConfig, T as TransferParams, E as ExecuteParams, B as BridgeParams, w as WebAuthnSignature$1, D as DispatchResult, j as VaultCreationResult } from './types-DakHNZIP.js';
4
- import { b as SessionConfig, d as SessionManagerConfig, a as SessionKey, A as ActionParams, c as SessionSignature, g as SessionSignedAction, f as SessionEventCallback } from './types-DvFRnIBd.js';
5
-
6
- /**
7
- * Veridex Protocol SDK - Passkey Manager
8
- *
9
- * Chain-agnostic WebAuthn/Passkey credential management
10
- */
11
- interface PasskeyCredential {
12
- credentialId: string;
13
- publicKeyX: bigint;
14
- publicKeyY: bigint;
15
- keyHash: string;
16
- }
17
- interface WebAuthnSignature {
18
- authenticatorData: string;
19
- clientDataJSON: string;
20
- challengeIndex: number;
21
- typeIndex: number;
22
- r: bigint;
23
- s: bigint;
24
- }
25
- interface PasskeyManagerConfig {
26
- rpName?: string;
27
- rpId?: string;
28
- timeout?: number;
29
- userVerification?: 'required' | 'preferred' | 'discouraged';
30
- authenticatorAttachment?: 'platform' | 'cross-platform';
31
- /** Relayer API URL for cross-device credential recovery */
32
- relayerUrl?: string;
33
- }
34
- /**
35
- * The canonical Veridex RP ID for cross-domain passkey sharing.
36
- * All Veridex SDK instances should use this RP ID to enable passkey
37
- * portability across different applications and domains.
38
- *
39
- * This works via W3C Related Origin Requests (ROR) - veridex.network
40
- * hosts a .well-known/webauthn file that lists allowed origins.
41
- */
42
- declare const VERIDEX_RP_ID = "veridex.network";
43
- /**
44
- * Detects the appropriate RP ID for passkey sharing.
45
- *
46
- * For production: Returns VERIDEX_RP_ID ('veridex.network') to enable
47
- * cross-domain passkey sharing via Related Origin Requests (ROR).
48
- *
49
- * For local development:
50
- * - localhost/127.0.0.1 → returns as-is
51
- * - IP addresses → returns as-is
52
- *
53
- * @param forceLocal - If true, uses local domain detection instead of canonical RP ID
54
- */
55
- declare function detectRpId(forceLocal?: boolean): string;
56
- /**
57
- * Check if the browser supports Related Origin Requests (ROR).
58
- * This is a WebAuthn Level 3 feature that allows using passkeys
59
- * across different domains listed in the RP's .well-known/webauthn file.
60
- *
61
- * @returns true if ROR is supported, false otherwise
62
- */
63
- declare function supportsRelatedOrigins(): Promise<boolean>;
64
-
65
- /**
66
- * Manages WebAuthn passkey credentials for Veridex Protocol
67
- */
68
- declare class PasskeyManager {
69
- private config;
70
- private credential;
71
- constructor(config?: PasskeyManagerConfig);
72
- static isSupported(): boolean;
73
- static isPlatformAuthenticatorAvailable(): Promise<boolean>;
74
- register(username: string, displayName: string): Promise<PasskeyCredential>;
75
- sign(challenge: Uint8Array): Promise<WebAuthnSignature>;
76
- /**
77
- * Authenticate using a discoverable credential (passkey)
78
- * This allows sign-in without knowing the credential ID ahead of time.
79
- * The authenticator will show all available passkeys for this RP.
80
- *
81
- * @param challenge - Optional challenge bytes. If not provided, a random challenge is used.
82
- * @returns The credential that was used to authenticate, along with the signature
83
- */
84
- authenticate(challenge?: Uint8Array): Promise<{
85
- credential: PasskeyCredential;
86
- signature: WebAuthnSignature;
87
- }>;
88
- /**
89
- * Find a credential by ID in the list of stored credentials
90
- */
91
- private findCredentialById;
92
- /**
93
- * Get all credentials stored in localStorage
94
- */
95
- getAllStoredCredentials(key?: string): PasskeyCredential[];
96
- private parseStoredCredential;
97
- /**
98
- * Save a list of credentials to localStorage
99
- */
100
- saveCredentials(credentials: PasskeyCredential[], key?: string): void;
101
- /**
102
- * Add a single credential to storage (append or update)
103
- */
104
- addCredentialToStorage(credential: PasskeyCredential, key?: string): void;
105
- /**
106
- * Check if there's ANY stored credential for this RP
107
- */
108
- hasStoredCredential(): boolean;
109
- getCredential(): PasskeyCredential | null;
110
- setCredential(credential: PasskeyCredential): void;
111
- createCredentialFromPublicKey(credentialId: string, publicKeyX: bigint, publicKeyY: bigint): PasskeyCredential;
112
- clearCredential(): void;
113
- /**
114
- * Save the current credential to localStorage (appends to list)
115
- */
116
- saveToLocalStorage(key?: string): void;
117
- loadFromLocalStorage(key?: string): PasskeyCredential | null;
118
- removeFromLocalStorage(key?: string): void;
119
- /**
120
- * Save the current credential to the relayer for cross-device recovery.
121
- * This should be called after registration.
122
- */
123
- saveCredentialToRelayer(): Promise<boolean>;
124
- /**
125
- * Load a credential from the relayer by credential ID.
126
- * Used during discoverable credential authentication when localStorage is empty.
127
- */
128
- loadCredentialFromRelayer(credentialId: string): Promise<PasskeyCredential | null>;
129
- /**
130
- * Load a credential from the relayer by keyHash.
131
- * Useful when you know the user's keyHash but not their credential ID.
132
- */
133
- loadCredentialFromRelayerByKeyHash(keyHash: string): Promise<PasskeyCredential | null>;
134
- private extractPublicKeyFromAttestation;
135
- private parseCOSEKey;
136
- private tryParseCOSEKeyStrategies;
137
- private parseCOSEKeyWithCBORStructure;
138
- private tryParseASN1Structure;
139
- private find32ByteSequences;
140
- private isValidCoordinate;
141
- private bytesToBigInt;
142
- private bytesToHex;
143
- private analyzeCOSEStructure;
144
- private parseAuthenticationResponse;
145
- }
146
-
147
- /**
148
- * Veridex Protocol SDK - Session Manager
149
- *
150
- * Manages ephemeral session keys for fast, native L1-speed transactions
151
- * after initial biometric authentication.
152
- *
153
- * Key Features:
154
- * - One-time Passkey auth to create session
155
- * - Instant software-backed signing for subsequent transactions
156
- * - Query-based validation on Spokes (no VAA wait)
157
- * - ~400ms transactions after initial setup
158
- * - Secure encrypted storage (AES-GCM)
159
- * - Auto-refresh before expiry
160
- * - Per-session value limits
161
- */
162
-
163
- /**
164
- * Interface for Hub contract interactions
165
- *
166
- * This should be implemented by chain clients (e.g., EVMHubClientAdapter).
167
- */
168
- interface HubClient {
169
- /**
170
- * Register a session on the Hub
171
- *
172
- * @param params Registration parameters with Passkey signature
173
- * @returns Promise that resolves when registration completes
174
- */
175
- registerSession(params: RegisterSessionParams): Promise<void>;
176
- /**
177
- * Revoke a session on the Hub
178
- *
179
- * @param params Revocation parameters with Passkey signature
180
- * @returns Promise that resolves when revocation completes
181
- */
182
- revokeSession(params: RevokeSessionParams): Promise<void>;
183
- }
184
- /**
185
- * Manages session key lifecycle and signing operations
186
- *
187
- * Usage:
188
- * ```typescript
189
- * const manager = new SessionManager(credential, hubClient, passkeySign, config);
190
- *
191
- * // Create session (requires biometric)
192
- * const session = await manager.createSession();
193
- *
194
- * // Sign actions instantly (no biometric)
195
- * const signature = await manager.signWithSession(action);
196
- *
197
- * // Revoke session (requires biometric)
198
- * await manager.revokeSession();
199
- * ```
200
- */
201
- declare class SessionManager {
202
- private credential;
203
- private hubClient;
204
- private passkeySign;
205
- private currentSession;
206
- private storage;
207
- private config;
208
- private refreshTimer;
209
- private eventCallbacks;
210
- private debug;
211
- /**
212
- * @param credential User's Passkey credential (for Hub interaction)
213
- * @param hubClient Hub client for on-chain session operations
214
- * @param passkeySign Function to sign challenges with Passkey
215
- * @param config Session configuration
216
- * @param managerConfig SessionManager configuration
217
- */
218
- constructor(credential: PasskeyCredential, hubClient: HubClient, passkeySign: (challenge: Uint8Array) => Promise<any>, config: Partial<SessionConfig>, managerConfig?: SessionManagerConfig);
219
- /**
220
- * Create a new session (requires biometric authentication)
221
- *
222
- * Steps:
223
- * 1. Generate ephemeral secp256k1 key pair
224
- * 2. Sign session registration with Passkey
225
- * 3. Register session on Hub contract
226
- * 4. Store session securely (encrypted)
227
- * 5. Start auto-refresh timer (if enabled)
228
- *
229
- * @returns Created session key
230
- * @throws SessionError if registration fails
231
- */
232
- createSession(): Promise<SessionKey>;
233
- /**
234
- * Load existing session from storage
235
- *
236
- * @returns Loaded session or null if no valid session exists
237
- */
238
- loadSession(): Promise<SessionKey | null>;
239
- /**
240
- * Revoke the current session (requires biometric authentication)
241
- *
242
- * @throws SessionError if no active session or revocation fails
243
- */
244
- revokeSession(): Promise<void>;
245
- /**
246
- * Sign an action with the session key (instant, no biometric)
247
- *
248
- * @param action Action parameters to sign
249
- * @returns Session signature
250
- * @throws SessionError if no active session, expired, or value exceeds limit
251
- */
252
- signWithSession(action: ActionParams): Promise<SessionSignature>;
253
- /**
254
- * Sign an action and prepare for submission
255
- *
256
- * @param action Action parameters
257
- * @returns Session-signed action ready for submission
258
- */
259
- signAction(action: ActionParams): Promise<SessionSignedAction>;
260
- /**
261
- * Check if a session is currently active
262
- *
263
- * @returns True if an active, non-expired session exists
264
- */
265
- isActive(): boolean;
266
- /**
267
- * Get current session information (if active)
268
- *
269
- * @returns Current session or null
270
- */
271
- getSession(): SessionKey | null;
272
- /**
273
- * Get time remaining until session expiry (in seconds)
274
- *
275
- * @returns Seconds until expiry, or 0 if no active session
276
- */
277
- getTimeRemaining(): number;
278
- /**
279
- * Schedule automatic session refresh
280
- */
281
- private scheduleRefresh;
282
- /**
283
- * Refresh the current session (creates a new session)
284
- *
285
- * @returns New session key
286
- */
287
- refreshSession(): Promise<SessionKey>;
288
- /**
289
- * Register an event callback
290
- */
291
- on(callback: SessionEventCallback): void;
292
- /**
293
- * Unregister an event callback
294
- */
295
- off(callback: SessionEventCallback): void;
296
- /**
297
- * Emit a session event
298
- */
299
- private emit;
300
- /**
301
- * Log debug message (if debug enabled)
302
- */
303
- private log;
304
- /**
305
- * Cleanup resources
306
- */
307
- dispose(): void;
308
- }
309
-
310
- interface EVMClientConfig {
311
- chainId: number;
312
- wormholeChainId: number;
313
- rpcUrl: string;
314
- hubContractAddress: string;
315
- wormholeCoreBridge: string;
316
- name?: string;
317
- explorerUrl?: string;
318
- vaultFactory?: string;
319
- vaultImplementation?: string;
320
- tokenBridge?: string;
321
- }
322
- /**
323
- * EVM implementation of the ChainClient interface
324
- */
325
- declare class EVMClient implements ChainClient {
326
- private config;
327
- private provider;
328
- private hubContract;
329
- private factoryContract;
330
- private cachedImplementation;
331
- constructor(config: EVMClientConfig);
332
- getConfig(): ChainConfig;
333
- getNonce(userKeyHash: string): Promise<bigint>;
334
- /**
335
- * Get user state from Hub (Issue #9/#10)
336
- * Returns comprehensive state including last action hash
337
- */
338
- getUserState(userKeyHash: string): Promise<{
339
- keyHash: string;
340
- nonce: bigint;
341
- lastActionHash: string;
342
- }>;
343
- /**
344
- * Get user's last action hash from Hub (Issue #9/#10)
345
- * Returns zero hash if user has no actions yet
346
- */
347
- getUserLastActionHash(userKeyHash: string): Promise<string>;
348
- /**
349
- * Register a new session key for temporary authentication
350
- * Enables native L1 speed for repeat transactions without biometric auth
351
- *
352
- * @param params Session registration parameters
353
- * @param signer Ethereum signer to pay gas
354
- * @returns Transaction receipt
355
- */
356
- registerSession(params: RegisterSessionParams, signer: ethers.Signer): Promise<ethers.TransactionReceipt>;
357
- /**
358
- * Check if a session is currently active (queryable via Wormhole CCQ)
359
- *
360
- * @param userKeyHash Hash of the user's Passkey public key
361
- * @param sessionKeyHash Hash of the session key to check
362
- * @returns Session validation result
363
- */
364
- isSessionActive(userKeyHash: string, sessionKeyHash: string): Promise<SessionValidationResult>;
365
- /**
366
- * Revoke a session key immediately
367
- *
368
- * @param params Session revocation parameters
369
- * @param signer Ethereum signer to pay gas
370
- * @returns Transaction receipt
371
- */
372
- revokeSession(params: RevokeSessionParams, signer: ethers.Signer): Promise<ethers.TransactionReceipt>;
373
- /**
374
- * Get all sessions for a user
375
- *
376
- * @param userKeyHash Hash of the user's Passkey public key
377
- * @returns Array of all sessions (active and expired/revoked)
378
- */
379
- getUserSessions(userKeyHash: string): Promise<SessionKey$1[]>;
380
- /**
381
- * Get the number of sessions for a user
382
- *
383
- * @param userKeyHash Hash of the user's Passkey public key
384
- * @returns Number of sessions
385
- */
386
- getUserSessionCount(userKeyHash: string): Promise<number>;
387
- getMessageFee(): Promise<bigint>;
388
- buildTransferPayload(params: TransferParams): Promise<string>;
389
- buildExecutePayload(params: ExecuteParams): Promise<string>;
390
- buildBridgePayload(params: BridgeParams): Promise<string>;
391
- dispatch(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: ethers.Signer): Promise<DispatchResult>;
392
- /**
393
- * Dispatch an action to the Hub via relayer (gasless)
394
- * The relayer pays for gas and submits the transaction on behalf of the user
395
- */
396
- dispatchGasless(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise<DispatchResult>;
397
- getVaultAddress(userKeyHash: string): Promise<string | null>;
398
- /**
399
- * Compute vault address deterministically without querying the chain
400
- * Uses CREATE2 with EIP-1167 minimal proxy pattern
401
- */
402
- computeVaultAddress(userKeyHash: string): string;
403
- /**
404
- * Build EIP-1167 minimal proxy initcode
405
- */
406
- private buildProxyInitCode;
407
- vaultExists(userKeyHash: string): Promise<boolean>;
408
- createVault(userKeyHash: string, signer: ethers.Signer): Promise<VaultCreationResult>;
409
- /**
410
- * Create a vault with a sponsor wallet paying for gas
411
- *
412
- * @param userKeyHash - The user's passkey hash
413
- * @param sponsorPrivateKey - Private key of the wallet that will pay gas
414
- * @param rpcUrl - Optional RPC URL to use (defaults to client's RPC)
415
- * @returns VaultCreationResult with address and transaction details
416
- */
417
- createVaultSponsored(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise<VaultCreationResult>;
418
- estimateVaultCreationGas(userKeyHash: string): Promise<bigint>;
419
- getFactoryAddress(): string | undefined;
420
- getImplementationAddress(): string | undefined;
421
- /**
422
- * Fetch implementation address from factory contract
423
- */
424
- fetchImplementationAddress(): Promise<string | null>;
425
- /**
426
- * Get the provider instance
427
- */
428
- getProvider(): ethers.JsonRpcProvider;
429
- /**
430
- * Get native token balance for an address
431
- */
432
- getNativeBalance(address: string): Promise<bigint>;
433
- /**
434
- * Get ERC20 token balance for an address
435
- */
436
- getTokenBalance(tokenAddress: string, ownerAddress: string): Promise<bigint>;
437
- /**
438
- * Get token allowance
439
- */
440
- getTokenAllowance(tokenAddress: string, ownerAddress: string, spenderAddress: string): Promise<bigint>;
441
- /**
442
- * Estimate gas for a dispatch transaction
443
- */
444
- estimateDispatchGas(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint): Promise<bigint>;
445
- /**
446
- * Get current gas price
447
- */
448
- getGasPrice(): Promise<bigint>;
449
- /**
450
- * Get current block number
451
- */
452
- getBlockNumber(): Promise<number>;
453
- /**
454
- * Get transaction receipt
455
- */
456
- getTransactionReceipt(hash: string): Promise<ethers.TransactionReceipt | null>;
457
- /**
458
- * Wait for transaction confirmation
459
- */
460
- waitForTransaction(hash: string, confirmations?: number): Promise<ethers.TransactionReceipt | null>;
461
- /**
462
- * Get the identity for a given key hash
463
- * Returns zero hash if key is not registered to any identity
464
- *
465
- * @param keyHash Hash of the passkey to look up
466
- * @returns Identity (first passkey's keyHash) or zero hash
467
- */
468
- getIdentityForKey(keyHash: string): Promise<string>;
469
- /**
470
- * Get all authorized keys for an identity
471
- *
472
- * @param identity The identity key hash (first passkey's keyHash)
473
- * @returns Array of authorized key hashes
474
- */
475
- getAuthorizedKeys(identity: string): Promise<string[]>;
476
- /**
477
- * Get count of authorized keys for an identity
478
- *
479
- * @param identity The identity key hash
480
- * @returns Number of authorized keys
481
- */
482
- getAuthorizedKeyCount(identity: string): Promise<number>;
483
- /**
484
- * Check if a key is authorized for an identity
485
- *
486
- * @param identity The identity key hash
487
- * @param keyHash The key hash to check
488
- * @returns Whether the key is authorized
489
- */
490
- isAuthorizedForIdentity(identity: string, keyHash: string): Promise<boolean>;
491
- /**
492
- * Check if a key is the root identity key
493
- *
494
- * @param keyHash The key hash to check
495
- * @returns Whether the key is a root identity
496
- */
497
- isIdentityRootKey(keyHash: string): Promise<boolean>;
498
- /**
499
- * Get comprehensive identity state for a key
500
- *
501
- * @param keyHash Hash of any key in the identity
502
- * @returns Identity state including count, max, and root status
503
- */
504
- getIdentityState(keyHash: string): Promise<IdentityState>;
505
- /**
506
- * Register a new identity with the first passkey
507
- * This makes the passkey the root identity key
508
- *
509
- * @param signature WebAuthn signature
510
- * @param publicKeyX Passkey public key X coordinate
511
- * @param publicKeyY Passkey public key Y coordinate
512
- * @param signer Ethereum signer to pay gas
513
- * @returns Transaction receipt and identity hash
514
- */
515
- registerIdentity(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, signer: ethers.Signer): Promise<{
516
- receipt: ethers.TransactionReceipt;
517
- identity: string;
518
- }>;
519
- /**
520
- * Add a backup passkey to an existing identity
521
- * Requires WebAuthn signature from an authorized key
522
- *
523
- * @param signature WebAuthn signature from existing authorized key
524
- * @param publicKeyX Existing key's X coordinate
525
- * @param publicKeyY Existing key's Y coordinate
526
- * @param newPublicKeyX New backup key's X coordinate
527
- * @param newPublicKeyY New backup key's Y coordinate
528
- * @param nonce Current nonce for the signing key
529
- * @param signer Ethereum signer to pay gas
530
- * @returns Transaction receipt and sequence number
531
- */
532
- addBackupKey(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, newPublicKeyX: bigint, newPublicKeyY: bigint, nonce: bigint, signer: ethers.Signer): Promise<{
533
- receipt: ethers.TransactionReceipt;
534
- sequence: bigint;
535
- }>;
536
- /**
537
- * Remove a passkey from an identity
538
- * Cannot remove the last remaining key
539
- *
540
- * @param signature WebAuthn signature from an authorized key
541
- * @param publicKeyX Signing key's X coordinate
542
- * @param publicKeyY Signing key's Y coordinate
543
- * @param keyToRemove Hash of the key to remove
544
- * @param nonce Current nonce for the signing key
545
- * @param signer Ethereum signer to pay gas
546
- * @returns Transaction receipt and sequence number
547
- */
548
- removeKey(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, keyToRemove: string, nonce: bigint, signer: ethers.Signer): Promise<{
549
- receipt: ethers.TransactionReceipt;
550
- sequence: bigint;
551
- }>;
552
- /**
553
- * Setup guardians for an identity
554
- * @param signature WebAuthn signature from owner
555
- * @param publicKeyX Owner's public key X coordinate
556
- * @param publicKeyY Owner's public key Y coordinate
557
- * @param guardians Array of guardian key hashes
558
- * @param threshold Required approvals for recovery
559
- * @param signer Ethers signer for transaction
560
- */
561
- setupGuardians(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, guardians: string[], threshold: bigint, signer: ethers.Signer): Promise<{
562
- receipt: ethers.TransactionReceipt;
563
- sequence: bigint;
564
- }>;
565
- /**
566
- * Add a guardian to an identity
567
- */
568
- addGuardian(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, guardianKeyHash: string, signer: ethers.Signer): Promise<{
569
- receipt: ethers.TransactionReceipt;
570
- sequence: bigint;
571
- }>;
572
- /**
573
- * Remove a guardian from an identity
574
- */
575
- removeGuardian(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, guardianKeyHash: string, signer: ethers.Signer): Promise<{
576
- receipt: ethers.TransactionReceipt;
577
- sequence: bigint;
578
- }>;
579
- /**
580
- * Initiate recovery as a guardian
581
- */
582
- initiateRecovery(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, identityToRecover: string, newOwnerKeyHash: string, signer: ethers.Signer): Promise<{
583
- receipt: ethers.TransactionReceipt;
584
- sequence: bigint;
585
- }>;
586
- /**
587
- * Approve recovery as a guardian
588
- */
589
- approveRecovery(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, identityToRecover: string, signer: ethers.Signer): Promise<{
590
- receipt: ethers.TransactionReceipt;
591
- sequence: bigint;
592
- }>;
593
- /**
594
- * Execute recovery after timelock (anyone can call)
595
- */
596
- executeRecovery(identityToRecover: string, newPublicKeyX: bigint, newPublicKeyY: bigint, signer: ethers.Signer): Promise<{
597
- receipt: ethers.TransactionReceipt;
598
- sequence: bigint;
599
- }>;
600
- /**
601
- * Cancel recovery as owner
602
- */
603
- cancelRecovery(signature: WebAuthnSignature$1, publicKeyX: bigint, publicKeyY: bigint, signer: ethers.Signer): Promise<{
604
- receipt: ethers.TransactionReceipt;
605
- sequence: bigint;
606
- }>;
607
- /**
608
- * Get guardians for an identity
609
- */
610
- getGuardians(identityKeyHash: string): Promise<{
611
- guardians: string[];
612
- threshold: bigint;
613
- isConfigured: boolean;
614
- }>;
615
- /**
616
- * Get recovery status for an identity
617
- */
618
- getRecoveryStatus(identityKeyHash: string): Promise<{
619
- isActive: boolean;
620
- newOwnerKeyHash: string;
621
- initiatedAt: bigint;
622
- approvalCount: bigint;
623
- threshold: bigint;
624
- canExecuteAt: bigint;
625
- expiresAt: bigint;
626
- }>;
627
- /**
628
- * Check if a guardian has approved recovery
629
- */
630
- hasGuardianApproved(identityKeyHash: string, guardianKeyHash: string): Promise<boolean>;
631
- /**
632
- * Helper to extract sequence from transaction receipt
633
- */
634
- private _extractSequenceFromReceipt;
635
- }
636
-
637
- /**
638
- * Veridex Protocol SDK - EVM Hub Client Adapter
639
- *
640
- * Adapts EVMClient to work with SessionManager's HubClient interface.
641
- * Provides a clean integration layer between session management and chain clients.
642
- */
643
-
644
- /**
645
- * Adapter that makes EVMClient compatible with SessionManager's HubClient interface
646
- *
647
- * Usage:
648
- * ```typescript
649
- * const hubAdapter = new EVMHubClientAdapter(evmClient, signer);
650
- * const sessionManager = new SessionManager(
651
- * credential,
652
- * hubAdapter,
653
- * config
654
- * );
655
- * ```
656
- */
657
- declare class EVMHubClientAdapter implements HubClient {
658
- private evmClient;
659
- private signer;
660
- constructor(evmClient: EVMClient, signer: ethers.Signer);
661
- /**
662
- * Register a session on the Hub
663
- *
664
- * @param params Registration parameters with Passkey signature
665
- * @returns Promise that resolves when registration completes
666
- */
667
- registerSession(params: RegisterSessionParams): Promise<void>;
668
- /**
669
- * Revoke a session on the Hub
670
- *
671
- * @param params Revocation parameters with Passkey signature
672
- * @returns Promise that resolves when revocation completes
673
- */
674
- revokeSession(params: RevokeSessionParams): Promise<void>;
675
- /**
676
- * Update the signer (e.g., when switching accounts)
677
- *
678
- * @param signer New Ethereum signer
679
- */
680
- updateSigner(signer: ethers.Signer): void;
681
- }
682
-
683
- export { EVMClient as E, type HubClient as H, PasskeyManager as P, SessionManager as S, VERIDEX_RP_ID as V, type WebAuthnSignature as W, type PasskeyCredential as a, type PasskeyManagerConfig as b, EVMHubClientAdapter as c, detectRpId as d, type EVMClientConfig as e, supportsRelatedOrigins as s };