import { Aptos } from '@aptos-labs/ts-sdk'; 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-DP2CQT8p.mjs'; /** * Veridex Protocol SDK - Aptos Chain Client * * Implementation of ChainClient interface for Aptos blockchain * Updated to use @aptos-labs/ts-sdk v5.x */ interface AptosClientConfig { wormholeChainId: number; rpcUrl: string; moduleAddress: string; wormholeCoreBridge: string; tokenBridge: string; network?: 'mainnet' | 'testnet' | 'devnet'; } /** * Aptos implementation of the ChainClient interface */ declare class AptosClient implements ChainClient { private config; private client; private moduleAddress; constructor(config: AptosClientConfig); getConfig(): ChainConfig; getNonce(userKeyHash: string): Promise; getMessageFee(): Promise; buildTransferPayload(params: TransferParams): Promise; buildExecutePayload(params: ExecuteParams): Promise; buildBridgePayload(params: BridgeParams): Promise; dispatch(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, signer: any): Promise; /** * Dispatch an action via relayer (gasless) * Note: On Aptos, this still goes through the Hub chain * Aptos is a spoke-only chain in Veridex architecture */ dispatchGasless(signature: WebAuthnSignature, publicKeyX: bigint, publicKeyY: bigint, targetChain: number, actionPayload: string, nonce: bigint, relayerUrl: string): Promise; /** * Get vault address from on-chain VaultRegistry. * Queries the get_vault_address view function which looks up the vault in the registry. */ getVaultAddress(userKeyHash: string): Promise; /** * @deprecated Use getVaultAddress() instead - this method uses incorrect address derivation. * On Aptos, vaults are created as named objects by the relayer, not resource accounts. * The vault address depends on which relayer created it, so must be queried on-chain. */ computeVaultAddress(userKeyHash: string): string; private computeVaultAddressFromHash; /** * Convert hex string to Uint8Array (browser-compatible) */ private hexToBytes; vaultExists(userKeyHash: string): Promise; createVault(userKeyHash: string, signer: any): Promise; createVaultSponsored?(userKeyHash: string, sponsorPrivateKey: string, rpcUrl?: string): Promise; /** * Create a vault via the relayer (sponsored/gasless) * This is the recommended way to create Aptos vaults * * The relayer will dispatch a vault creation action from Hub to Aptos spoke */ createVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise; /** * Get vault info via relayer (includes existence check) */ getVaultViaRelayer(userKeyHash: string, relayerUrl: string): Promise<{ vaultAddress: string; exists: boolean; }>; estimateVaultCreationGas(userKeyHash: string): Promise; getFactoryAddress(): string | undefined; getImplementationAddress(): string | undefined; /** * Get native APT balance */ getNativeBalance(address: string): Promise; /** * Get fungible asset (FA) or coin balance */ getTokenBalance(tokenAddress: string, ownerAddress: string): Promise; /** * Compute key hash from public key coordinates * Matches EVM keccak256(abi.encode(publicKeyX, publicKeyY)) */ private computeKeyHash; /** * Build message for signing (matches Hub chain format) */ private buildMessage; /** * Get Aptos client instance for advanced usage */ getClient(): Aptos; /** * Get module address */ getModuleAddress(): string; /** * Get current ledger version */ getLedgerVersion(): Promise; /** * Get transaction by hash */ getTransaction(txHash: string): Promise; /** * Wait for transaction confirmation */ waitForTransaction(txHash: string, timeoutSecs?: number): Promise; /** * Get vault resource for an owner * * @param ownerKeyHash - Owner's passkey hash (32 bytes as hex) * @returns Vault resource data or null if not found */ getVaultResource(ownerKeyHash: string): Promise<{ ownerKeyHash: string; authorizedSigners: string[]; nonce: bigint; } | null>; /** * Get authorized signers for a vault * * @param ownerKeyHash - Owner's passkey hash (32 bytes as hex) * @returns Array of authorized signer key hashes */ getAuthorizedSigners(ownerKeyHash: string): Promise; /** * Check if a VAA has been processed (for replay protection) * * @param vaaHash - VAA hash as hex string * @returns Whether the VAA has been processed */ isVaaProcessed(vaaHash: string): Promise; /** * Check if protocol is paused * * @returns Whether the protocol is paused */ isProtocolPaused(): Promise; } export { AptosClient, type AptosClientConfig };