import type { IAddress } from '../../types'; /** * Address of the `SwapRouter` periphery contract on each supported chain. * * Missing keys mean no SwapRouter is deployed on that chain — callers * should fall back to legacy adapter paths. * * @see {@link getSwapRouterAddress} for the typed lookup helper. */ export declare const SWAP_ROUTER_ADDRESSES: Readonly>; /** * Human-readable display name of the `SwapRouter` periphery contract on each * supported chain. * * The contract exposes no on-chain name (no `@title` accessor), so UIs that * want to show *which contract* performed the swap-and-deposit — rather than a * bare address — read it from here. Display metadata only: never derive * routing or eligibility logic from it. * * Missing keys mean no SwapRouter is deployed on that chain. * * @see {@link getSwapRouterName} for the typed lookup helper. */ export declare const SWAP_ROUTER_NAMES: Readonly>; /** * Vaults whose UI **may offer the any-token SwapRouter deposit surface** — * i.e. the SwapRouter is `enableVault`-ed for them on-chain. * * This is *eligibility metadata only*. It is consumed by: * - the app UI, to decide whether to render the (flag-gated) swap-router * deposit surface for a vault; and * - {@link swapRouterDeposit}, optionally, as a fail-fast eligibility check. * * It is deliberately **NOT** read by {@link vaultDeposit}: `vaultDeposit` never * swaps, and uses the SwapRouter only for a direct deposit carrying a * configured origin code (see `getDepositRoute`). That separation is what * stops a natively-accepted asset from being silently swapped — the * regression that implicit auto-routing caused. Any-token swap * deposits are the explicit, opt-in job of {@link swapRouterDeposit}. * * Membership requires the vault to be registered on-chain * (`vaultInfo[addr].referenceAsset != 0`) — an unregistered vault reverts with * `InvalidVault` at deposit time. A listed vault's natively-accepted assets * (for a multi-asset vault, its whole deposit-asset set) still deposit via * `vaultDeposit`; only tokens OUTSIDE that set go through `swapRouterDeposit`. * * Lowercase comparison is required when checking — use * {@link isSwapRouterEligible} rather than reading this set directly. * * @deprecated Superseded by {@link getSwapRouterEligibleVaults}, which derives * the eligible set from the router's on-chain `VaultEnabled` history and * verifies each vault's current registration (`vaultInfo.referenceAsset != 0`) * — so new enablements surface without an SDK release. This static set stays * functional as the zero-RPC fallback seed (e.g. TanStack Query `initialData`) * and for SDK-internal sync consumers. */ export declare const SWAP_ROUTER_ELIGIBLE_VAULTS: ReadonlySet; /** * @deprecated Renamed to {@link SWAP_ROUTER_ELIGIBLE_VAULTS} (itself now * superseded by {@link getSwapRouterEligibleVaults}, the on-chain-derived * resolver), and the semantics changed: this set no longer drives * `vaultDeposit` auto-routing (that branch was removed) — it only marks vaults * whose UI may offer the swap-router deposit surface. Kept as an alias for one * release; migrate to the async resolver. */ export declare const VAULTS_USING_SWAP_ROUTER: ReadonlySet; /** * Block at which each chain's `SwapRouter` was deployed/configured — the safe * lower bound for scanning its `TokenEnabled` / `VaultEnabled` log history. * * The router stores its allowlist as `mapping(address => bool) whitelistedTokens` * with no on-chain enumeration, so {@link getSwapRouterWhitelistedTokens} must * reconstruct the candidate set from `TokenEnabled` events before verifying each * against the current mapping. Starting the `eth_getLogs` scan here (rather than * from genesis) bounds it to the router's own lifetime — a few chunks — instead * of the whole chain. * * Each value is the router's deployment block (its first emitted event, the * constructor `OwnershipTransferred`). A too-low value only costs extra empty * log ranges; a value ABOVE the first `TokenEnabled` would silently miss tokens, * so err on the side of earlier. */ export declare const SWAP_ROUTER_DEPLOY_BLOCKS: Readonly>; /** * 32-byte origin codes registered on the `SwapRouter` via `addOrigin`. * Drives origin/referral-fee accrual. The on-chain admin must register a * code before it can be used — calls with an unknown code revert with * `InvalidOrigin`. * * `default` is the all-zero sentinel — the SwapRouter treats it as "no * origin fee" and skips the origin-fee transfer. */ export declare const ORIGIN_CODES: { /** All-zero sentinel — no origin fee. */ readonly default: `0x${string}`; }; /** * Shape of a SwapRouter origin code: `0x` followed by exactly 64 hex chars * (a `bytes32`). Shared by every origin-code entry point so the constructor * option, the per-call override and the registration read validate the same * way. * @internal */ export declare const ORIGIN_CODE_PATTERN: RegExp; /** * Chains on which the SDK sends the instance origin code * (`attribution.originCode`). Ethereum mainnet only: it is the one SwapRouter * deployment whose origin registry has been verified. On any other chain the * instance code is never sent, even where a SwapRouter is configured; an * `originCode` passed to a call is still sent. */ export declare const ORIGIN_ATTRIBUTION_CHAINS: readonly number[]; /** * Maximum number of swap legs the contract accepts in a single * `swapAndDeposit` call. Mirrors the on-chain `MAX_SWAPS` constant; reading * the on-chain value at call time would add an RPC for no gain. * * Kept here so the SDK can reject oversize inputs at the boundary rather * than wait for the on-chain `TooManySwaps` revert. */ export declare const SWAP_ROUTER_MAX_SWAPS = 9; /** * Wrapped-native ERC-20 per chain that has a SwapRouter deployment. Mirrors * the on-chain `wrappedNativeTokenAddress()` view to avoid an extra RPC on * every dispatch. Used to validate that native-token deposits target a * vault whose reference asset is the wrapped native — the only configuration * the contract's `depositNativeToken` / `swapAndDepositNativeToken` accept. * * **Wrap-only, WETH-vaults-only limitation.** Both payable entry points on the * deployed router (`depositNativeToken` and `swapAndDepositNativeToken`) only * wrap native ETH to this address and deposit — neither has an ETH→other-asset * swap leg. `swapAndDepositNativeToken`'s ABI takes no swap payload, so a DEX * swap is structurally impossible on that path too; its only difference from * `depositNativeToken` is applying the vault swap fee on the pure wrap. The * practical consequence: **native ETH can only be deposited into a vault whose * reference asset is this wrapped-native token** (e.g. a WETH-reference * vault). There is no atomic native-ETH deposit into a non-WETH-reference * vault (e.g. a USDC vault) — deposit the wrapped native token instead * (already whitelisted, and it routes through the swap leg for a vault whose * reference asset differs). True atomic ETH→any-asset support would require a * contract change (a payable `swapAndDeposit` variant), which is out of scope * for this SDK. Use {@link isNativeSwapRouterDepositSupported} to check a * vault's eligibility for the native path before offering it in a UI. */ export declare const SWAP_ROUTER_WRAPPED_NATIVE: Readonly>; /** * The DEX aggregator whitelisted on each chain's `SwapRouter` via * `enableRouter`, plus the single aggregator contract method every swap leg is * pinned to and that method's 4-byte selector. * * This is the single source of truth tying the off-chain swap-leg builder to * the on-chain router whitelist. The two MUST agree or `swapAndDeposit` reverts * with `InvalidRouter()` (router not whitelisted) or `InvalidNotWhitelisted()` * (selector not authorized). It is consumed in three places: * * - `dispatchViaSwapRouter` asks {@link fetchSwapQuote} to pin the aggregator to * `contractMethod`, then asserts the returned quote's `router` and payload * selector match this entry before broadcasting — failing closed rather than * letting the user pay gas for a transaction the contract will reject. * - The CI check `scripts/verify-swap-router-aggregator.mjs` asserts the * deployed `SwapRouter` actually has `tokenTransferProxies[router] != 0` and * `isAuthorizedSelector(router, selector) == true` for every entry here, so * config drift is caught at release time, not by a user's failed deposit. * * Pinning to one generic method matters: the aggregator otherwise picks a route * method per quote (e.g. a direct `swapExactAmountInOnUniswapV3`) that varies * with market conditions, producing a different selector each time. Pinning * collapses that to one stable selector so the on-chain whitelist needs only * that selector and never drifts as routing changes. * * `router` is the address the aggregator's calldata targets (ParaSwap v6.2 * pulls tokens to the Augustus contract itself, so the SwapRouter's * `tokenTransferProxies[router]` is the router address). `selector` is * `bytes4(keccak256("(...)"))`. Verify both against the * deployed router before adding a chain — a wrong value reverts at deposit time. */ export declare const SWAP_ROUTER_DEX_AGGREGATOR: Readonly>;