/** * Cross-Chain Vault Registry * * Address-keyed registry of August's LayerZero OVault deployments plus the * resolver helpers that turn a vault address into the * {@link ICrossChainVaultConfig} consumed by `buildCrossChainVaultTx`, * `crossChainVaultDeposit`, and `quoteCrossChainDeposit`. * * This is the cross-chain analogue of the SwapRouter registry * (`VAULTS_USING_SWAP_ROUTER` / `getSwapRouterAddress`): consumers resolve a * full config by vault address instead of hand-assembling the per-chain * contract maps and LayerZero EIDs. Without it, every consuming app would * re-encode the same address book. * * Addresses are ported verbatim from upshift-app `src/config/ovault.ts` and * cross-checked against the read-side `LAYERZERO_VAULTS` registry in * `services/layerzero/deposits.ts`. Verify against the deployed contracts * before adding or editing an entry — a wrong address silently routes funds * to the wrong chain. * * Return convention (deliberate, mirrors the SwapRouter helpers): lookups that * resolve a single optional value (`getCrossChainVaultConfig`, * `getOVaultChains`) return `undefined` for an unregistered vault, while * list-returning helpers (`getWithdrawDestinationChains`) return `[]` so * callers can iterate without a null-check. * * @module evm/methods/crossChainVaultRegistry */ import type { IAddress } from '../../types'; import type { ICrossChainVaultConfig } from '../types/crossChain'; /** * August's LayerZero OVault deployments, keyed by lowercase hub-chain vault * address. Resolve entries with {@link getCrossChainVaultConfig} rather than * indexing directly — the helper handles address-casing for you. * * @see {@link getCrossChainVaultConfig} for the typed, case-insensitive lookup. */ export declare const CROSS_CHAIN_VAULT_CONFIGS: Readonly>; /** * Resolve the full cross-chain config for a vault. Address comparison is * case-insensitive. * * @param vault - Hub-chain vault contract address. * @returns The {@link ICrossChainVaultConfig} to pass to * `crossChainVaultDeposit` / `quoteCrossChainDeposit`, or `undefined` when * the vault is not a registered OVault deployment. * @example * ```ts * const config = getCrossChainVaultConfig('0xE9B725010A9E419412ed67d0fA5f3A5f40159D32'); * if (config) await quoteCrossChainDeposit({ config, ...rest }); * ``` */ export declare function getCrossChainVaultConfig(vault: IAddress): ICrossChainVaultConfig | undefined; /** * Whether a vault is a registered LayerZero OVault and should route deposits * through the cross-chain flow. Address comparison is case-insensitive. * * @param vault - Vault contract address. * @returns `true` when the vault has an entry in * {@link CROSS_CHAIN_VAULT_CONFIGS}. */ export declare function isCrossChainVault(vault: IAddress): boolean; /** * Get the hub and spoke chain IDs a vault is deployed across — the set of * chains a user can deposit from. * * @param vault - Vault contract address. * @returns `{ hub, spokes }` chain IDs, or `undefined` when the vault is not a * registered OVault deployment. */ export declare function getOVaultChains(vault: IAddress): { hub: number; spokes: number[]; } | undefined; /** * Whether a vault's receipt token is hub-only (no cross-chain withdraw). * The deposit UI must not offer a spoke share destination for these vaults. * * @param vault - Vault contract address. * @returns `true` for vaults whose shares cannot leave the hub chain. */ export declare function isHubOnlyReceipt(vault: IAddress): boolean; /** * Chains a user can receive the underlying asset on when withdrawing. * Hub-only-receipt vaults redeem to the hub chain only; all * other OVault vaults can redeem to the hub or any spoke. * * @param vault - Vault contract address. * @returns Destination chain IDs, or an empty array when the vault is not a * registered OVault deployment. */ export declare function getWithdrawDestinationChains(vault: IAddress): number[];