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

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
@@ -0,0 +1,332 @@
1
+ import { RegisterSessionParams, SessionValidationResult, RevokeSessionParams, SessionKey, IdentityState } from './types.mjs';
2
+ import { ethers } from 'ethers';
3
+ import { C as ChainClient, a as ChainConfig, T as TransferParams, E as ExecuteParams, B as BridgeParams, W as WebAuthnSignature, D as DispatchResult, V as VaultCreationResult } from './types-Bmk689Lw.mjs';
4
+
5
+ interface EVMClientConfig {
6
+ chainId: number;
7
+ wormholeChainId: number;
8
+ rpcUrl: string;
9
+ hubContractAddress: string;
10
+ wormholeCoreBridge: string;
11
+ name?: string;
12
+ explorerUrl?: string;
13
+ vaultFactory?: string;
14
+ vaultImplementation?: string;
15
+ tokenBridge?: string;
16
+ }
17
+ /**
18
+ * EVM implementation of the ChainClient interface
19
+ */
20
+ declare class EVMClient implements ChainClient {
21
+ private config;
22
+ private provider;
23
+ private hubContract;
24
+ private factoryContract;
25
+ private cachedImplementation;
26
+ constructor(config: EVMClientConfig);
27
+ getConfig(): ChainConfig;
28
+ getNonce(userKeyHash: string): Promise<bigint>;
29
+ /**
30
+ * Get user state from Hub (Issue #9/#10)
31
+ * Returns comprehensive state including last action hash
32
+ */
33
+ getUserState(userKeyHash: string): Promise<{
34
+ keyHash: string;
35
+ nonce: bigint;
36
+ lastActionHash: string;
37
+ }>;
38
+ /**
39
+ * Get user's last action hash from Hub (Issue #9/#10)
40
+ * Returns zero hash if user has no actions yet
41
+ */
42
+ getUserLastActionHash(userKeyHash: string): Promise<string>;
43
+ /**
44
+ * Register a new session key for temporary authentication
45
+ * Enables native L1 speed for repeat transactions without biometric auth
46
+ *
47
+ * @param params Session registration parameters
48
+ * @param signer Ethereum signer to pay gas
49
+ * @returns Transaction receipt
50
+ */
51
+ registerSession(params: RegisterSessionParams, signer: ethers.Signer): Promise<ethers.TransactionReceipt>;
52
+ /**
53
+ * Check if a session is currently active (queryable via Wormhole CCQ)
54
+ *
55
+ * @param userKeyHash Hash of the user's Passkey public key
56
+ * @param sessionKeyHash Hash of the session key to check
57
+ * @returns Session validation result
58
+ */
59
+ isSessionActive(userKeyHash: string, sessionKeyHash: string): Promise<SessionValidationResult>;
60
+ /**
61
+ * Revoke a session key immediately
62
+ *
63
+ * @param params Session revocation parameters
64
+ * @param signer Ethereum signer to pay gas
65
+ * @returns Transaction receipt
66
+ */
67
+ revokeSession(params: RevokeSessionParams, signer: ethers.Signer): Promise<ethers.TransactionReceipt>;
68
+ /**
69
+ * Get all sessions for a user
70
+ *
71
+ * @param userKeyHash Hash of the user's Passkey public key
72
+ * @returns Array of all sessions (active and expired/revoked)
73
+ */
74
+ getUserSessions(userKeyHash: string): Promise<SessionKey[]>;
75
+ /**
76
+ * Get the number of sessions for a user
77
+ *
78
+ * @param userKeyHash Hash of the user's Passkey public key
79
+ * @returns Number of sessions
80
+ */
81
+ getUserSessionCount(userKeyHash: string): Promise<number>;
82
+ getMessageFee(): Promise<bigint>;
83
+ buildTransferPayload(params: TransferParams): Promise<string>;
84
+ buildExecutePayload(params: ExecuteParams): Promise<string>;
85
+ buildBridgePayload(params: BridgeParams): Promise<string>;
86
+ dispatch(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: ethers.Signer): Promise<DispatchResult>;
87
+ /**
88
+ * Dispatch an action to the Hub via relayer (gasless)
89
+ * The relayer pays for gas and submits the transaction on behalf of the user
90
+ */
91
+ dispatchGasless(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise<DispatchResult>;
92
+ getVaultAddress(userKeyHash: string): Promise<string | null>;
93
+ /**
94
+ * Compute vault address deterministically without querying the chain
95
+ * Uses CREATE2 with EIP-1167 minimal proxy pattern
96
+ */
97
+ computeVaultAddress(userKeyHash: string): string;
98
+ /**
99
+ * Build EIP-1167 minimal proxy initcode
100
+ */
101
+ private buildProxyInitCode;
102
+ vaultExists(userKeyHash: string): Promise<boolean>;
103
+ createVault(userKeyHash: string, signer: ethers.Signer): Promise<VaultCreationResult>;
104
+ /**
105
+ * Create a vault with a sponsor wallet paying for gas
106
+ *
107
+ * @param userKeyHash - The user's passkey hash
108
+ * @param sponsorPrivateKey - Private key of the wallet that will pay gas
109
+ * @param rpcUrl - Optional RPC URL to use (defaults to client's RPC)
110
+ * @returns VaultCreationResult with address and transaction details
111
+ */
112
+ createVaultSponsored(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise<VaultCreationResult>;
113
+ estimateVaultCreationGas(userKeyHash: string): Promise<bigint>;
114
+ getFactoryAddress(): string | undefined;
115
+ getImplementationAddress(): string | undefined;
116
+ /**
117
+ * Fetch implementation address from factory contract
118
+ */
119
+ fetchImplementationAddress(): Promise<string | null>;
120
+ /**
121
+ * Get the provider instance
122
+ */
123
+ getProvider(): ethers.JsonRpcProvider;
124
+ /**
125
+ * Get native token balance for an address
126
+ */
127
+ getNativeBalance(address: string): Promise<bigint>;
128
+ /**
129
+ * Get ERC20 token balance for an address
130
+ */
131
+ getTokenBalance(tokenAddress: string, ownerAddress: string): Promise<bigint>;
132
+ /**
133
+ * Get token allowance
134
+ */
135
+ getTokenAllowance(tokenAddress: string, ownerAddress: string, spenderAddress: string): Promise<bigint>;
136
+ /**
137
+ * Estimate gas for a dispatch transaction
138
+ */
139
+ estimateDispatchGas(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint): Promise<bigint>;
140
+ /**
141
+ * Get current gas price
142
+ */
143
+ getGasPrice(): Promise<bigint>;
144
+ /**
145
+ * Get current block number
146
+ */
147
+ getBlockNumber(): Promise<number>;
148
+ /**
149
+ * Get transaction receipt
150
+ */
151
+ getTransactionReceipt(hash: string): Promise<ethers.TransactionReceipt | null>;
152
+ /**
153
+ * Wait for transaction confirmation
154
+ */
155
+ waitForTransaction(hash: string, confirmations?: number): Promise<ethers.TransactionReceipt | null>;
156
+ /**
157
+ * Get the identity for a given key hash
158
+ * Returns zero hash if key is not registered to any identity
159
+ *
160
+ * @param keyHash Hash of the passkey to look up
161
+ * @returns Identity (first passkey's keyHash) or zero hash
162
+ */
163
+ getIdentityForKey(keyHash: string): Promise<string>;
164
+ /**
165
+ * Get all authorized keys for an identity
166
+ *
167
+ * @param identity The identity key hash (first passkey's keyHash)
168
+ * @returns Array of authorized key hashes
169
+ */
170
+ getAuthorizedKeys(identity: string): Promise<string[]>;
171
+ /**
172
+ * Get count of authorized keys for an identity
173
+ *
174
+ * @param identity The identity key hash
175
+ * @returns Number of authorized keys
176
+ */
177
+ getAuthorizedKeyCount(identity: string): Promise<number>;
178
+ /**
179
+ * Check if a key is authorized for an identity
180
+ *
181
+ * @param identity The identity key hash
182
+ * @param keyHash The key hash to check
183
+ * @returns Whether the key is authorized
184
+ */
185
+ isAuthorizedForIdentity(identity: string, keyHash: string): Promise<boolean>;
186
+ /**
187
+ * Check if a key is the root identity key
188
+ *
189
+ * @param keyHash The key hash to check
190
+ * @returns Whether the key is a root identity
191
+ */
192
+ isIdentityRootKey(keyHash: string): Promise<boolean>;
193
+ /**
194
+ * Get comprehensive identity state for a key
195
+ *
196
+ * @param keyHash Hash of any key in the identity
197
+ * @returns Identity state including count, max, and root status
198
+ */
199
+ getIdentityState(keyHash: string): Promise<IdentityState>;
200
+ /**
201
+ * Register a new identity with the first passkey
202
+ * This makes the passkey the root identity key
203
+ *
204
+ * @param signature WebAuthn signature
205
+ * @param publicKeyX Passkey public key X coordinate
206
+ * @param publicKeyY Passkey public key Y coordinate
207
+ * @param signer Ethereum signer to pay gas
208
+ * @returns Transaction receipt and identity hash
209
+ */
210
+ registerIdentity(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, signer: ethers.Signer): Promise<{
211
+ receipt: ethers.TransactionReceipt;
212
+ identity: string;
213
+ }>;
214
+ /**
215
+ * Add a backup passkey to an existing identity
216
+ * Requires WebAuthn signature from an authorized key
217
+ *
218
+ * @param signature WebAuthn signature from existing authorized key
219
+ * @param publicKeyX Existing key's X coordinate
220
+ * @param publicKeyY Existing key's Y coordinate
221
+ * @param newPublicKeyX New backup key's X coordinate
222
+ * @param newPublicKeyY New backup key's Y coordinate
223
+ * @param nonce Current nonce for the signing key
224
+ * @param signer Ethereum signer to pay gas
225
+ * @returns Transaction receipt and sequence number
226
+ */
227
+ addBackupKey(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, newPublicKeyX: bigint, newPublicKeyY: bigint, nonce: bigint, signer: ethers.Signer): Promise<{
228
+ receipt: ethers.TransactionReceipt;
229
+ sequence: bigint;
230
+ }>;
231
+ /**
232
+ * Remove a passkey from an identity
233
+ * Cannot remove the last remaining key
234
+ *
235
+ * @param signature WebAuthn signature from an authorized key
236
+ * @param publicKeyX Signing key's X coordinate
237
+ * @param publicKeyY Signing key's Y coordinate
238
+ * @param keyToRemove Hash of the key to remove
239
+ * @param nonce Current nonce for the signing key
240
+ * @param signer Ethereum signer to pay gas
241
+ * @returns Transaction receipt and sequence number
242
+ */
243
+ removeKey(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, keyToRemove: string, nonce: bigint, signer: ethers.Signer): Promise<{
244
+ receipt: ethers.TransactionReceipt;
245
+ sequence: bigint;
246
+ }>;
247
+ /**
248
+ * Setup guardians for an identity
249
+ * @param signature WebAuthn signature from owner
250
+ * @param publicKeyX Owner's public key X coordinate
251
+ * @param publicKeyY Owner's public key Y coordinate
252
+ * @param guardians Array of guardian key hashes
253
+ * @param threshold Required approvals for recovery
254
+ * @param signer Ethers signer for transaction
255
+ */
256
+ setupGuardians(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, guardians: string[], threshold: bigint, signer: ethers.Signer): Promise<{
257
+ receipt: ethers.TransactionReceipt;
258
+ sequence: bigint;
259
+ }>;
260
+ /**
261
+ * Add a guardian to an identity
262
+ */
263
+ addGuardian(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, guardianKeyHash: string, signer: ethers.Signer): Promise<{
264
+ receipt: ethers.TransactionReceipt;
265
+ sequence: bigint;
266
+ }>;
267
+ /**
268
+ * Remove a guardian from an identity
269
+ */
270
+ removeGuardian(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, guardianKeyHash: string, signer: ethers.Signer): Promise<{
271
+ receipt: ethers.TransactionReceipt;
272
+ sequence: bigint;
273
+ }>;
274
+ /**
275
+ * Initiate recovery as a guardian
276
+ */
277
+ initiateRecovery(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, identityToRecover: string, newOwnerKeyHash: string, signer: ethers.Signer): Promise<{
278
+ receipt: ethers.TransactionReceipt;
279
+ sequence: bigint;
280
+ }>;
281
+ /**
282
+ * Approve recovery as a guardian
283
+ */
284
+ approveRecovery(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, identityToRecover: string, signer: ethers.Signer): Promise<{
285
+ receipt: ethers.TransactionReceipt;
286
+ sequence: bigint;
287
+ }>;
288
+ /**
289
+ * Execute recovery after timelock (anyone can call)
290
+ */
291
+ executeRecovery(identityToRecover: string, newPublicKeyX: bigint, newPublicKeyY: bigint, signer: ethers.Signer): Promise<{
292
+ receipt: ethers.TransactionReceipt;
293
+ sequence: bigint;
294
+ }>;
295
+ /**
296
+ * Cancel recovery as owner
297
+ */
298
+ cancelRecovery(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, signer: ethers.Signer): Promise<{
299
+ receipt: ethers.TransactionReceipt;
300
+ sequence: bigint;
301
+ }>;
302
+ /**
303
+ * Get guardians for an identity
304
+ */
305
+ getGuardians(identityKeyHash: string): Promise<{
306
+ guardians: string[];
307
+ threshold: bigint;
308
+ isConfigured: boolean;
309
+ }>;
310
+ /**
311
+ * Get recovery status for an identity
312
+ */
313
+ getRecoveryStatus(identityKeyHash: string): Promise<{
314
+ isActive: boolean;
315
+ newOwnerKeyHash: string;
316
+ initiatedAt: bigint;
317
+ approvalCount: bigint;
318
+ threshold: bigint;
319
+ canExecuteAt: bigint;
320
+ expiresAt: bigint;
321
+ }>;
322
+ /**
323
+ * Check if a guardian has approved recovery
324
+ */
325
+ hasGuardianApproved(identityKeyHash: string, guardianKeyHash: string): Promise<boolean>;
326
+ /**
327
+ * Helper to extract sequence from transaction receipt
328
+ */
329
+ private _extractSequenceFromReceipt;
330
+ }
331
+
332
+ export { EVMClient as E, type EVMClientConfig as a };
@@ -1,4 +1,4 @@
1
- import { P as PasskeyCredential, T as TransferParams, E as ExecuteParams, B as BridgeParams } from '../types-DakHNZIP.mjs';
1
+ import { P as PasskeyCredential, T as TransferParams, E as ExecuteParams, B as BridgeParams } from '../types-Bmk689Lw.mjs';
2
2
 
3
3
  type AuthenticateAndPrepareParams = {
4
4
  credential: PasskeyCredential;