@veridex/sdk 1.0.0-beta.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/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +212 -0
- package/dist/chains/aptos/index.d.mts +140 -0
- package/dist/chains/aptos/index.d.ts +140 -0
- package/dist/chains/aptos/index.js +563 -0
- package/dist/chains/aptos/index.js.map +1 -0
- package/dist/chains/aptos/index.mjs +536 -0
- package/dist/chains/aptos/index.mjs.map +1 -0
- package/dist/chains/evm/index.d.mts +5 -0
- package/dist/chains/evm/index.d.ts +5 -0
- package/dist/chains/evm/index.js +1233 -0
- package/dist/chains/evm/index.js.map +1 -0
- package/dist/chains/evm/index.mjs +1205 -0
- package/dist/chains/evm/index.mjs.map +1 -0
- package/dist/chains/solana/index.d.mts +116 -0
- package/dist/chains/solana/index.d.ts +116 -0
- package/dist/chains/solana/index.js +513 -0
- package/dist/chains/solana/index.js.map +1 -0
- package/dist/chains/solana/index.mjs +491 -0
- package/dist/chains/solana/index.mjs.map +1 -0
- package/dist/chains/starknet/index.d.mts +172 -0
- package/dist/chains/starknet/index.d.ts +172 -0
- package/dist/chains/starknet/index.js +534 -0
- package/dist/chains/starknet/index.js.map +1 -0
- package/dist/chains/starknet/index.mjs +507 -0
- package/dist/chains/starknet/index.mjs.map +1 -0
- package/dist/chains/sui/index.d.mts +182 -0
- package/dist/chains/sui/index.d.ts +182 -0
- package/dist/chains/sui/index.js +560 -0
- package/dist/chains/sui/index.js.map +1 -0
- package/dist/chains/sui/index.mjs +533 -0
- package/dist/chains/sui/index.mjs.map +1 -0
- package/dist/constants.d.mts +150 -0
- package/dist/constants.d.ts +150 -0
- package/dist/constants.js +430 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +392 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/index-0NXfbk0z.d.ts +637 -0
- package/dist/index-D0dLVjTA.d.mts +637 -0
- package/dist/index.d.mts +3101 -0
- package/dist/index.d.ts +3101 -0
- package/dist/index.js +13186 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +13011 -0
- package/dist/index.mjs.map +1 -0
- package/dist/payload.d.mts +125 -0
- package/dist/payload.d.ts +125 -0
- package/dist/payload.js +315 -0
- package/dist/payload.js.map +1 -0
- package/dist/payload.mjs +269 -0
- package/dist/payload.mjs.map +1 -0
- package/dist/queries/index.d.mts +148 -0
- package/dist/queries/index.d.ts +148 -0
- package/dist/queries/index.js +1533 -0
- package/dist/queries/index.js.map +1 -0
- package/dist/queries/index.mjs +1508 -0
- package/dist/queries/index.mjs.map +1 -0
- package/dist/types-ChIsqCiw.d.mts +565 -0
- package/dist/types-ChIsqCiw.d.ts +565 -0
- package/dist/types-FJL7j6gQ.d.mts +172 -0
- package/dist/types-FJL7j6gQ.d.ts +172 -0
- package/dist/types.d.mts +407 -0
- package/dist/types.d.ts +407 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/dist/types.mjs +1 -0
- package/dist/types.mjs.map +1 -0
- package/dist/utils.d.mts +81 -0
- package/dist/utils.d.ts +81 -0
- package/dist/utils.js +430 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +390 -0
- package/dist/utils.mjs.map +1 -0
- package/dist/wormhole.d.mts +167 -0
- package/dist/wormhole.d.ts +167 -0
- package/dist/wormhole.js +468 -0
- package/dist/wormhole.js.map +1 -0
- package/dist/wormhole.mjs +422 -0
- package/dist/wormhole.mjs.map +1 -0
- package/package.json +151 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Veridex Protocol SDK - Core Type Definitions
|
|
3
|
+
*/
|
|
4
|
+
interface VeridexConfig {
|
|
5
|
+
/**
|
|
6
|
+
* Chain-specific client implementation
|
|
7
|
+
*/
|
|
8
|
+
chain: ChainClient;
|
|
9
|
+
/**
|
|
10
|
+
* Relayer URL for:
|
|
11
|
+
* 1. Automated VAA submission
|
|
12
|
+
* 2. Remote gas sponsorship (primary method for vault creation)
|
|
13
|
+
* When available, this takes priority over local wallet sponsorship
|
|
14
|
+
*/
|
|
15
|
+
relayerUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* API key for relayer service authentication
|
|
18
|
+
*/
|
|
19
|
+
relayerApiKey?: string;
|
|
20
|
+
/**
|
|
21
|
+
* API key for Wormhole Query Proxy requests (optional).
|
|
22
|
+
* If omitted, the SDK will fall back to `relayerApiKey` for Queries.
|
|
23
|
+
*/
|
|
24
|
+
queryApiKey?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to use testnet or mainnet
|
|
27
|
+
*/
|
|
28
|
+
testnet?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to persist wallet data to localStorage
|
|
31
|
+
*/
|
|
32
|
+
persistWallet?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Veridex sponsor wallet private key for gasless vault creation (fallback)
|
|
35
|
+
* When set, vault creation is sponsored (user doesn't pay gas)
|
|
36
|
+
* This is the fallback when relayer is not available
|
|
37
|
+
*/
|
|
38
|
+
sponsorPrivateKey?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Integrator-provided sponsor key for platforms using Veridex SDK
|
|
41
|
+
* Takes priority over Veridex default sponsorship
|
|
42
|
+
* Allows platforms to pay for their users' vault creation
|
|
43
|
+
*/
|
|
44
|
+
integratorSponsorKey?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Additional chain RPC URLs for multi-chain sponsored vault creation
|
|
47
|
+
* Maps Wormhole chain ID to RPC URL
|
|
48
|
+
*/
|
|
49
|
+
chainRpcUrls?: Record<number, string>;
|
|
50
|
+
}
|
|
51
|
+
interface WalletManagerConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Whether to cache computed addresses in memory
|
|
54
|
+
*/
|
|
55
|
+
cacheAddresses?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether to persist addresses to localStorage
|
|
58
|
+
*/
|
|
59
|
+
persistToStorage?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Storage key for localStorage
|
|
62
|
+
*/
|
|
63
|
+
storageKey?: string;
|
|
64
|
+
}
|
|
65
|
+
interface ChainConfig {
|
|
66
|
+
name: string;
|
|
67
|
+
chainId: number;
|
|
68
|
+
/** Wormhole chain ID of the hub chain (if different from wormholeChainId) */
|
|
69
|
+
hubChainId?: number;
|
|
70
|
+
wormholeChainId: number;
|
|
71
|
+
rpcUrl: string;
|
|
72
|
+
explorerUrl: string;
|
|
73
|
+
isEvm: boolean;
|
|
74
|
+
contracts: {
|
|
75
|
+
hub?: string;
|
|
76
|
+
vaultFactory?: string;
|
|
77
|
+
vaultImplementation?: string;
|
|
78
|
+
wormholeCoreBridge: string;
|
|
79
|
+
tokenBridge?: string;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Parameters for registering a new session key
|
|
84
|
+
*/
|
|
85
|
+
interface RegisterSessionParams {
|
|
86
|
+
/** Public key of the session (secp256k1) */
|
|
87
|
+
sessionPublicKey: Uint8Array;
|
|
88
|
+
/** Session expiry timestamp (seconds) */
|
|
89
|
+
expiry: number;
|
|
90
|
+
/** Maximum transaction value in base units */
|
|
91
|
+
maxValue: bigint;
|
|
92
|
+
/** Wormhole chain IDs where session is valid */
|
|
93
|
+
chainScopes: number[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parameters for revoking an existing session
|
|
97
|
+
*/
|
|
98
|
+
interface RevokeSessionParams {
|
|
99
|
+
/** Keccak256 hash of session public key to revoke */
|
|
100
|
+
sessionKeyHash: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Result of session validation query
|
|
104
|
+
*/
|
|
105
|
+
interface SessionValidationResult {
|
|
106
|
+
/** Whether session is currently active */
|
|
107
|
+
isActive: boolean;
|
|
108
|
+
/** Session expiry timestamp (0 if not active) */
|
|
109
|
+
expiry: number;
|
|
110
|
+
/** Max transaction value (0 if not active) */
|
|
111
|
+
maxValue: bigint;
|
|
112
|
+
/** Allowed chain scopes */
|
|
113
|
+
chainScopes: number[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Identity state for multi-key management
|
|
117
|
+
* First passkey registered becomes the immutable identity root
|
|
118
|
+
*/
|
|
119
|
+
interface IdentityState {
|
|
120
|
+
/** Identity key hash (first passkey's keyHash) */
|
|
121
|
+
identity: string;
|
|
122
|
+
/** Number of authorized keys */
|
|
123
|
+
keyCount: number;
|
|
124
|
+
/** Maximum allowed keys per identity */
|
|
125
|
+
maxKeys: number;
|
|
126
|
+
/** Whether the specified key is the root identity */
|
|
127
|
+
isRoot: boolean;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Result from registering a backup passkey
|
|
131
|
+
*/
|
|
132
|
+
interface AddBackupKeyResult {
|
|
133
|
+
/** Transaction hash on Hub chain */
|
|
134
|
+
transactionHash: string;
|
|
135
|
+
/** Wormhole sequence number for cross-chain sync */
|
|
136
|
+
sequence: bigint;
|
|
137
|
+
/** The identity the key was added to */
|
|
138
|
+
identity: string;
|
|
139
|
+
/** The new key hash that was added */
|
|
140
|
+
newKeyHash: string;
|
|
141
|
+
/** Total number of keys after addition */
|
|
142
|
+
keyCount: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Result from removing a passkey
|
|
146
|
+
*/
|
|
147
|
+
interface RemoveKeyResult {
|
|
148
|
+
/** Transaction hash on Hub chain */
|
|
149
|
+
transactionHash: string;
|
|
150
|
+
/** Wormhole sequence number for cross-chain sync */
|
|
151
|
+
sequence: bigint;
|
|
152
|
+
/** The identity the key was removed from */
|
|
153
|
+
identity: string;
|
|
154
|
+
/** The key hash that was removed */
|
|
155
|
+
removedKeyHash: string;
|
|
156
|
+
/** Remaining number of keys after removal */
|
|
157
|
+
keyCount: number;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Authorized key information
|
|
161
|
+
*/
|
|
162
|
+
interface AuthorizedKey {
|
|
163
|
+
/** Key hash of the authorized passkey */
|
|
164
|
+
keyHash: string;
|
|
165
|
+
/** Whether this key is the root identity key */
|
|
166
|
+
isRoot: boolean;
|
|
167
|
+
}
|
|
168
|
+
interface PasskeyCredential {
|
|
169
|
+
credentialId: string;
|
|
170
|
+
publicKeyX: bigint;
|
|
171
|
+
publicKeyY: bigint;
|
|
172
|
+
keyHash: string;
|
|
173
|
+
}
|
|
174
|
+
interface WebAuthnSignature {
|
|
175
|
+
authenticatorData: string;
|
|
176
|
+
clientDataJSON: string;
|
|
177
|
+
challengeIndex: number;
|
|
178
|
+
typeIndex: number;
|
|
179
|
+
r: bigint;
|
|
180
|
+
s: bigint;
|
|
181
|
+
}
|
|
182
|
+
interface TransferParams {
|
|
183
|
+
targetChain: number;
|
|
184
|
+
token: string;
|
|
185
|
+
recipient: string;
|
|
186
|
+
amount: bigint;
|
|
187
|
+
}
|
|
188
|
+
interface ExecuteParams {
|
|
189
|
+
targetChain: number;
|
|
190
|
+
target: string;
|
|
191
|
+
value: bigint;
|
|
192
|
+
data: string;
|
|
193
|
+
}
|
|
194
|
+
interface BridgeParams {
|
|
195
|
+
sourceChain: number;
|
|
196
|
+
token: string;
|
|
197
|
+
amount: bigint;
|
|
198
|
+
destinationChain: number;
|
|
199
|
+
recipient: string;
|
|
200
|
+
}
|
|
201
|
+
interface ConfigParams {
|
|
202
|
+
targetChain: number;
|
|
203
|
+
configType: number;
|
|
204
|
+
configData: string;
|
|
205
|
+
}
|
|
206
|
+
interface DispatchResult {
|
|
207
|
+
transactionHash: string;
|
|
208
|
+
sequence: bigint;
|
|
209
|
+
userKeyHash: string;
|
|
210
|
+
targetChain: number;
|
|
211
|
+
blockNumber?: number;
|
|
212
|
+
}
|
|
213
|
+
interface VaultInfo {
|
|
214
|
+
address: string;
|
|
215
|
+
ownerKeyHash: string;
|
|
216
|
+
chain: string;
|
|
217
|
+
wormholeChainId: number;
|
|
218
|
+
exists: boolean;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Represents an address on a specific chain
|
|
222
|
+
*/
|
|
223
|
+
interface ChainAddress {
|
|
224
|
+
/** Wormhole chain identifier */
|
|
225
|
+
wormholeChainId: number;
|
|
226
|
+
/** Human-readable chain name */
|
|
227
|
+
chainName: string;
|
|
228
|
+
/** The address on this chain */
|
|
229
|
+
address: string;
|
|
230
|
+
/** Whether this is an EVM chain */
|
|
231
|
+
isEvm: boolean;
|
|
232
|
+
/** Whether the vault has been deployed */
|
|
233
|
+
deployed: boolean;
|
|
234
|
+
/** Transaction hash of vault deployment */
|
|
235
|
+
deploymentTxHash?: string;
|
|
236
|
+
/** For non-EVM chains, the derivation type used */
|
|
237
|
+
derivationType?: 'pda' | 'resource_account' | 'object' | 'create2' | 'keyHash';
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Unified identity representing a user across all chains
|
|
241
|
+
*/
|
|
242
|
+
interface UnifiedIdentity {
|
|
243
|
+
/** The unique key hash derived from public key */
|
|
244
|
+
keyHash: string;
|
|
245
|
+
/** P-256 public key X coordinate */
|
|
246
|
+
publicKeyX: bigint;
|
|
247
|
+
/** P-256 public key Y coordinate */
|
|
248
|
+
publicKeyY: bigint;
|
|
249
|
+
/** WebAuthn credential ID */
|
|
250
|
+
credentialId: string;
|
|
251
|
+
/** Addresses on each supported chain */
|
|
252
|
+
addresses: ChainAddress[];
|
|
253
|
+
/** Timestamp when identity was created */
|
|
254
|
+
createdAt: number;
|
|
255
|
+
/** Timestamp when identity was last updated */
|
|
256
|
+
updatedAt: number;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Result of vault creation operation
|
|
260
|
+
*/
|
|
261
|
+
interface VaultCreationResult {
|
|
262
|
+
/** The vault address */
|
|
263
|
+
address: string;
|
|
264
|
+
/** Transaction hash of the creation */
|
|
265
|
+
transactionHash: string;
|
|
266
|
+
/** Block number where vault was created */
|
|
267
|
+
blockNumber: number;
|
|
268
|
+
/** Gas used for creation */
|
|
269
|
+
gasUsed: bigint;
|
|
270
|
+
/** Whether this was a new deployment or already existed */
|
|
271
|
+
alreadyExisted: boolean;
|
|
272
|
+
/** Address of the sponsor wallet if gas was sponsored */
|
|
273
|
+
sponsoredBy?: string;
|
|
274
|
+
}
|
|
275
|
+
interface TransferAction {
|
|
276
|
+
type: 'transfer';
|
|
277
|
+
token: string;
|
|
278
|
+
recipient: string;
|
|
279
|
+
amount: bigint;
|
|
280
|
+
}
|
|
281
|
+
interface BridgeAction {
|
|
282
|
+
type: 'bridge';
|
|
283
|
+
token: string;
|
|
284
|
+
amount: bigint;
|
|
285
|
+
targetChain: number;
|
|
286
|
+
recipient: string;
|
|
287
|
+
}
|
|
288
|
+
interface ExecuteAction {
|
|
289
|
+
type: 'execute';
|
|
290
|
+
target: string;
|
|
291
|
+
value: bigint;
|
|
292
|
+
data: string;
|
|
293
|
+
}
|
|
294
|
+
interface ConfigAction {
|
|
295
|
+
type: 'config';
|
|
296
|
+
configType: number;
|
|
297
|
+
configData: string;
|
|
298
|
+
}
|
|
299
|
+
type ActionPayload = TransferAction | BridgeAction | ExecuteAction | ConfigAction | {
|
|
300
|
+
type: string;
|
|
301
|
+
raw: string;
|
|
302
|
+
};
|
|
303
|
+
interface VAA {
|
|
304
|
+
version: number;
|
|
305
|
+
guardianSetIndex: number;
|
|
306
|
+
signatures: VAASignature[];
|
|
307
|
+
timestamp: number;
|
|
308
|
+
nonce: number;
|
|
309
|
+
emitterChain: number;
|
|
310
|
+
emitterAddress: string;
|
|
311
|
+
sequence: bigint;
|
|
312
|
+
consistencyLevel: number;
|
|
313
|
+
payload: string;
|
|
314
|
+
hash: string;
|
|
315
|
+
}
|
|
316
|
+
interface VAASignature {
|
|
317
|
+
guardianIndex: number;
|
|
318
|
+
signature: string;
|
|
319
|
+
}
|
|
320
|
+
interface VeridexPayload {
|
|
321
|
+
version: number;
|
|
322
|
+
userKeyHash: string;
|
|
323
|
+
targetChain: number;
|
|
324
|
+
nonce: bigint;
|
|
325
|
+
publicKeyX: bigint;
|
|
326
|
+
publicKeyY: bigint;
|
|
327
|
+
actionPayload: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Chain-agnostic interface that all chain implementations must follow
|
|
331
|
+
*/
|
|
332
|
+
interface ChainClient {
|
|
333
|
+
/**
|
|
334
|
+
* Get the chain configuration
|
|
335
|
+
*/
|
|
336
|
+
getConfig(): ChainConfig;
|
|
337
|
+
/**
|
|
338
|
+
* Get the current nonce for a user
|
|
339
|
+
*/
|
|
340
|
+
getNonce(userKeyHash: string): Promise<bigint>;
|
|
341
|
+
/**
|
|
342
|
+
* Get the Wormhole message fee
|
|
343
|
+
*/
|
|
344
|
+
getMessageFee(): Promise<bigint>;
|
|
345
|
+
/**
|
|
346
|
+
* Build a transfer action payload
|
|
347
|
+
*/
|
|
348
|
+
buildTransferPayload(params: TransferParams): Promise<string>;
|
|
349
|
+
/**
|
|
350
|
+
* Build an execute action payload
|
|
351
|
+
*/
|
|
352
|
+
buildExecutePayload(params: ExecuteParams): Promise<string>;
|
|
353
|
+
/**
|
|
354
|
+
* Build a bridge action payload
|
|
355
|
+
*/
|
|
356
|
+
buildBridgePayload(params: BridgeParams): Promise<string>;
|
|
357
|
+
/**
|
|
358
|
+
* Dispatch an action to the Hub
|
|
359
|
+
*/
|
|
360
|
+
dispatch(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: any): Promise<DispatchResult>;
|
|
361
|
+
/**
|
|
362
|
+
* Dispatch an action to the Hub via relayer (gasless)
|
|
363
|
+
* The relayer pays for gas and submits the transaction on behalf of the user
|
|
364
|
+
* @param signature - WebAuthn signature
|
|
365
|
+
* @param publicKeyX - P-256 public key X coordinate
|
|
366
|
+
* @param publicKeyY - P-256 public key Y coordinate
|
|
367
|
+
* @param targetChain - Target chain Wormhole ID
|
|
368
|
+
* @param actionPayload - Encoded action payload
|
|
369
|
+
* @param nonce - User nonce
|
|
370
|
+
* @param relayerUrl - URL of the relayer service
|
|
371
|
+
*/
|
|
372
|
+
dispatchGasless?(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise<DispatchResult>;
|
|
373
|
+
/**
|
|
374
|
+
* Get vault address for a user (may query on-chain registry)
|
|
375
|
+
*/
|
|
376
|
+
getVaultAddress(userKeyHash: string): Promise<string | null>;
|
|
377
|
+
/**
|
|
378
|
+
* Compute vault address deterministically (off-chain calculation)
|
|
379
|
+
* Returns the address the vault will have when deployed
|
|
380
|
+
*/
|
|
381
|
+
computeVaultAddress(userKeyHash: string): string;
|
|
382
|
+
/**
|
|
383
|
+
* Check if a vault exists for a user
|
|
384
|
+
*/
|
|
385
|
+
vaultExists(userKeyHash: string): Promise<boolean>;
|
|
386
|
+
/**
|
|
387
|
+
* Create a vault for a user
|
|
388
|
+
*/
|
|
389
|
+
createVault(userKeyHash: string, signer: any): Promise<VaultCreationResult>;
|
|
390
|
+
/**
|
|
391
|
+
* Create a vault with a sponsor wallet paying for gas
|
|
392
|
+
* @param userKeyHash - The user's passkey hash
|
|
393
|
+
* @param sponsorPrivateKey - Private key of the wallet that will pay gas
|
|
394
|
+
* @param rpcUrl - Optional RPC URL to use
|
|
395
|
+
*/
|
|
396
|
+
createVaultSponsored?(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise<VaultCreationResult>;
|
|
397
|
+
/**
|
|
398
|
+
* Estimate gas for vault creation
|
|
399
|
+
*/
|
|
400
|
+
estimateVaultCreationGas(userKeyHash: string): Promise<bigint>;
|
|
401
|
+
/**
|
|
402
|
+
* Get the factory contract address (if applicable)
|
|
403
|
+
*/
|
|
404
|
+
getFactoryAddress(): string | undefined;
|
|
405
|
+
/**
|
|
406
|
+
* Get the implementation contract address (if applicable)
|
|
407
|
+
*/
|
|
408
|
+
getImplementationAddress(): string | undefined;
|
|
409
|
+
}
|
|
410
|
+
interface TestResult {
|
|
411
|
+
success: boolean;
|
|
412
|
+
sourceChain: string;
|
|
413
|
+
targetChain: string;
|
|
414
|
+
txHash?: string;
|
|
415
|
+
vaaSequence?: bigint;
|
|
416
|
+
error?: string;
|
|
417
|
+
duration?: number;
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Prepared transfer with gas estimates
|
|
421
|
+
*/
|
|
422
|
+
interface PreparedTransfer {
|
|
423
|
+
/** Original transfer parameters */
|
|
424
|
+
params: TransferParams;
|
|
425
|
+
/** Encoded action payload */
|
|
426
|
+
actionPayload: string;
|
|
427
|
+
/** Current nonce */
|
|
428
|
+
nonce: bigint;
|
|
429
|
+
/** Challenge to sign */
|
|
430
|
+
challenge: Uint8Array;
|
|
431
|
+
/** Estimated gas for the transaction */
|
|
432
|
+
estimatedGas: bigint;
|
|
433
|
+
/** Current gas price */
|
|
434
|
+
gasPrice: bigint;
|
|
435
|
+
/** Wormhole message fee */
|
|
436
|
+
messageFee: bigint;
|
|
437
|
+
/** Total estimated cost (gas + message fee) */
|
|
438
|
+
totalCost: bigint;
|
|
439
|
+
/** Formatted total cost in native token */
|
|
440
|
+
formattedCost: string;
|
|
441
|
+
/** Timestamp when prepared */
|
|
442
|
+
preparedAt: number;
|
|
443
|
+
/** Expiration timestamp (nonce may change) */
|
|
444
|
+
expiresAt: number;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* Enhanced transfer result with tracking info
|
|
448
|
+
*/
|
|
449
|
+
interface TransferResult extends DispatchResult {
|
|
450
|
+
/** Transfer parameters used */
|
|
451
|
+
params: TransferParams;
|
|
452
|
+
/** Gas used in the transaction */
|
|
453
|
+
gasUsed?: bigint;
|
|
454
|
+
/** Effective gas price */
|
|
455
|
+
effectiveGasPrice?: bigint;
|
|
456
|
+
/** Total cost of the transaction */
|
|
457
|
+
totalCost?: bigint;
|
|
458
|
+
/** Timestamp of the transfer */
|
|
459
|
+
timestamp: number;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Receive address information for sharing
|
|
463
|
+
*/
|
|
464
|
+
interface ReceiveAddress {
|
|
465
|
+
/** The vault address */
|
|
466
|
+
address: string;
|
|
467
|
+
/** Chain name */
|
|
468
|
+
chainName: string;
|
|
469
|
+
/** Wormhole chain ID */
|
|
470
|
+
wormholeChainId: number;
|
|
471
|
+
/** QR code data URI (if generated) */
|
|
472
|
+
qrCodeDataUri?: string;
|
|
473
|
+
/** Deep link for wallet apps */
|
|
474
|
+
deepLink?: string;
|
|
475
|
+
/** Plain text for copying */
|
|
476
|
+
copyText: string;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Transaction history entry
|
|
480
|
+
*/
|
|
481
|
+
interface TransactionHistoryEntry {
|
|
482
|
+
/** Transaction hash */
|
|
483
|
+
hash: string;
|
|
484
|
+
/** Type of transaction */
|
|
485
|
+
type: 'transfer' | 'bridge' | 'execute' | 'vault_creation';
|
|
486
|
+
/** Transaction status */
|
|
487
|
+
status: 'pending' | 'confirmed' | 'failed';
|
|
488
|
+
/** Source chain */
|
|
489
|
+
sourceChain: number;
|
|
490
|
+
/** Target chain (for cross-chain txs) */
|
|
491
|
+
targetChain?: number;
|
|
492
|
+
/** Token address involved */
|
|
493
|
+
token?: string;
|
|
494
|
+
/** Amount transferred */
|
|
495
|
+
amount?: bigint;
|
|
496
|
+
/** Recipient address */
|
|
497
|
+
recipient?: string;
|
|
498
|
+
/** Timestamp */
|
|
499
|
+
timestamp: number;
|
|
500
|
+
/** Block number */
|
|
501
|
+
blockNumber?: number;
|
|
502
|
+
/** VAA sequence for cross-chain */
|
|
503
|
+
vaaSequence?: bigint;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Fee breakdown for cross-chain transfers
|
|
507
|
+
*/
|
|
508
|
+
interface CrossChainFees {
|
|
509
|
+
/** Gas cost on source chain */
|
|
510
|
+
sourceGas: bigint;
|
|
511
|
+
/** Wormhole message fee */
|
|
512
|
+
messageFee: bigint;
|
|
513
|
+
/** Relayer fee (if using automatic relay) */
|
|
514
|
+
relayerFee: bigint;
|
|
515
|
+
/** Total estimated cost in source chain native token */
|
|
516
|
+
totalCost: bigint;
|
|
517
|
+
/** Formatted total cost */
|
|
518
|
+
formattedTotal: string;
|
|
519
|
+
/** Currency symbol */
|
|
520
|
+
currency: string;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Prepared bridge with fee estimates
|
|
524
|
+
*/
|
|
525
|
+
interface PreparedBridge {
|
|
526
|
+
/** Original bridge parameters */
|
|
527
|
+
params: BridgeParams;
|
|
528
|
+
/** Encoded action payload */
|
|
529
|
+
actionPayload: string;
|
|
530
|
+
/** Current nonce */
|
|
531
|
+
nonce: bigint;
|
|
532
|
+
/** Challenge to sign */
|
|
533
|
+
challenge: Uint8Array;
|
|
534
|
+
/** Fee breakdown */
|
|
535
|
+
fees: CrossChainFees;
|
|
536
|
+
/** Source chain Wormhole ID */
|
|
537
|
+
sourceChain: number;
|
|
538
|
+
/** Destination chain Wormhole ID */
|
|
539
|
+
destinationChain: number;
|
|
540
|
+
/** Timestamp when prepared */
|
|
541
|
+
preparedAt: number;
|
|
542
|
+
/** Expiration timestamp */
|
|
543
|
+
expiresAt: number;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Result of a bridge/cross-chain transfer
|
|
547
|
+
*/
|
|
548
|
+
interface BridgeResult extends DispatchResult {
|
|
549
|
+
/** Bridge parameters used */
|
|
550
|
+
params: BridgeParams;
|
|
551
|
+
/** Source chain Wormhole ID */
|
|
552
|
+
sourceChain: number;
|
|
553
|
+
/** Destination chain Wormhole ID */
|
|
554
|
+
destinationChain: number;
|
|
555
|
+
/** VAA base64 (once fetched) */
|
|
556
|
+
vaa?: string;
|
|
557
|
+
/** Destination chain transaction hash */
|
|
558
|
+
destinationTxHash?: string;
|
|
559
|
+
/** Duration of the operation in ms */
|
|
560
|
+
duration: number;
|
|
561
|
+
/** Timestamp of completion */
|
|
562
|
+
timestamp: number;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export type { AuthorizedKey as A, BridgeParams as B, ChainClient as C, DispatchResult as D, ExecuteParams as E, IdentityState as I, PasskeyCredential as P, RegisterSessionParams as R, SessionValidationResult as S, TransferParams as T, UnifiedIdentity as U, VaultCreationResult as V, WebAuthnSignature as W, ChainConfig as a, RevokeSessionParams as b, WalletManagerConfig as c, ChainAddress as d, VAA as e, VeridexPayload as f, PreparedTransfer as g, PreparedBridge as h, VeridexConfig as i, BridgeResult as j, TransferResult as k, ReceiveAddress as l, VaultInfo as m, AddBackupKeyResult as n, RemoveKeyResult as o, ConfigParams as p, TransferAction as q, BridgeAction as r, ExecuteAction as s, ConfigAction as t, ActionPayload as u, VAASignature as v, TestResult as w, TransactionHistoryEntry as x, CrossChainFees as y };
|