import { QueryRequest as QueryRequest$1, QueryResponse as QueryResponse$1 } from '@wormhole-foundation/wormhole-query-sdk'; type QueryNetwork = 'mainnet' | 'testnet'; /** * Configuration for calling the Wormhole Query Proxy. * * `apiKey` is required for hosted Query Proxy access. * `endpoint` may be overridden for custom proxy deployments. */ interface QueryConfig { apiKey: string; endpoint?: string; timeoutMs?: number; } /** * Re-exported Wormhole Query SDK types (type-only). * These map directly to the request/response shapes expected by the Query Proxy. */ type QueryRequest = QueryRequest$1; type QueryResponse = QueryResponse$1; type QueryOperationType = 'hubState' | 'portfolio'; interface HubStateQuery { type: 'hubState'; wormholeChainId: number; hubAddress: string; } interface PortfolioQuery { type: 'portfolio'; walletAddress: string; wormholeChainIds: readonly number[]; } type QueryOperation = HubStateQuery | PortfolioQuery; declare const WORMHOLE_QUERY_PROXY_URLS: { readonly mainnet: "https://query.wormhole.com/v1/query"; readonly testnet: "https://testnet.query.wormhole.com/v1/query"; }; /** * Wormhole Query Proxy rate limit: 6 queries per second. * SDK callers should throttle requests accordingly. */ declare const WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND = 6; /** * Convenience set of Wormhole chain IDs commonly supported by Queries. * This is not an exhaustive list of all Wormhole chains. */ declare const WORMHOLE_QUERY_CHAIN_IDS: { readonly ETHEREUM: 2; readonly POLYGON: 5; readonly ARBITRUM: 23; readonly OPTIMISM: 24; readonly BASE: 30; }; type QueryHubStateNetwork = 'testnet' | 'mainnet'; type QueryHubStateOptions = { /** Max response age in seconds (default: 60). */ maxAge?: number; network?: QueryHubStateNetwork; /** Maximum attempts including the first try (default: 4). */ maxAttempts?: number; }; type HubStateResult = { nonce: bigint; isRegistered: boolean; blockTime: number; proof: Uint8Array; /** Last action hash (Issue #9/#10 - for action-hash binding) */ lastActionHash?: string; }; type QueryHubStateErrorCode = 'INVALID_ARGUMENT' | 'UNSUPPORTED_NETWORK' | 'MISSING_HUB_ADDRESS' | 'PROXY_HTTP_ERROR' | 'PROXY_RESPONSE_INVALID' | 'ATTESTATION_STALE' | 'QUERY_RESPONSE_INVALID'; declare class QueryHubStateError extends Error { code: QueryHubStateErrorCode; cause?: unknown; constructor(code: QueryHubStateErrorCode, message: string, cause?: unknown); } /** * Fetch Guardian-attested Hub state directly from the Wormhole Query Proxy. * * Client-side only: this avoids relayer API costs and produces a Guardian-signed proof * that can be forwarded to the relayer for on-chain verification/submission. */ declare function queryHubState(userKeyHash: string, apiKey: string, options?: QueryHubStateOptions): Promise; type QueryPortfolioNetwork = 'testnet' | 'mainnet'; type QueryPortfolioOptions = { /** Max response age in seconds (default: 60). */ maxAge?: number; network?: QueryPortfolioNetwork; /** Maximum attempts including the first try (default: 4). */ maxAttempts?: number; /** Cache TTL in ms (default: 30_000). */ cacheTtlMs?: number; /** Request timeout in ms (default: 15_000 for testnet, 10_000 for mainnet). */ timeout?: number; /** Override Query Proxy endpoint. */ endpoint?: string; /** Override per-chain RPC URLs used for block tag lookups. */ rpcUrls?: Record; /** Override derived vault addresses for specific Wormhole chain IDs. */ vaultAddresses?: Record; /** Override token lists (ERC20 only) for specific Wormhole chain IDs. */ evmTokenAddresses?: Record; /** Additional Solana accounts to include in the Solana account query (base58). */ solanaAccounts?: string[]; /** Optional USD prices by symbol/address for aggregation (e.g. { USDC: 1 }). */ pricesUsd?: Record; }; type PortfolioBalance = { assetId: string; amount: bigint; decimals?: number; symbol?: string; usdValue?: number; }; type PortfolioChainErrorCode = 'UNSUPPORTED_CHAIN' | 'MISSING_VAULT' | 'MISSING_TOKENS' | 'ATTESTATION_STALE' | 'DECODE_ERROR'; type PortfolioChainResult = { wormholeChainId: number; chainName?: string; vaultAddress?: string; blockTime?: number; balances: PortfolioBalance[]; error?: { code: PortfolioChainErrorCode; message: string; }; }; type PortfolioResult = { proof: Uint8Array; totalUsd?: number; chains: PortfolioChainResult[]; }; type QueryPortfolioErrorCode = 'INVALID_ARGUMENT' | 'NETWORK_ERROR' | 'PROXY_HTTP_ERROR' | 'PROXY_RESPONSE_INVALID' | 'QUERY_RESPONSE_INVALID'; declare class QueryPortfolioError extends Error { code: QueryPortfolioErrorCode; cause?: unknown; constructor(code: QueryPortfolioErrorCode, message: string, cause?: unknown); } /** * Fetch Guardian-attested vault balances across multiple chains in one Query Proxy request. * * Notes: * - EVM balances are ERC20-only via `eth_call` (native ETH is not queryable via this query type). * - Solana balance uses lamports of the Veridex vault PDA (plus optional extra accounts). * - Aptos is included only if/when Wormhole Queries adds Aptos query types (currently returned as unsupported). */ declare function queryPortfolio(userKeyHash: string, apiKey: string, options?: QueryPortfolioOptions): Promise; export { type HubStateQuery, type HubStateResult, type PortfolioBalance, type PortfolioChainErrorCode, type PortfolioChainResult, type PortfolioQuery, type PortfolioResult, type QueryConfig, QueryHubStateError, type QueryHubStateErrorCode, type QueryHubStateNetwork, type QueryHubStateOptions, type QueryNetwork, type QueryOperation, type QueryOperationType, QueryPortfolioError, type QueryPortfolioErrorCode, type QueryPortfolioNetwork, type QueryPortfolioOptions, type QueryRequest, type QueryResponse, WORMHOLE_QUERY_CHAIN_IDS, WORMHOLE_QUERY_PROXY_URLS, WORMHOLE_QUERY_RATE_LIMIT_PER_SECOND, queryHubState, queryPortfolio };