import { Currency, TradeType } from '@uniswap/sdk-core'; import type { SwapRoute } from '../routers/router'; import { CurrencyAmount } from './amounts'; /** * Arc (chain id 5042): USDC is the gas asset and exists as views over ONE * balance, kept in sync by a precompile: * * - native, 18 decimals: address(0) in Uniswap V4 PoolKeys, `msg.value`; * - ERC-20, 6 decimals: the predeploy USDC_ARC at 0x3600…0000, held by * Uniswap V3 pools and by V4 pools keyed on the ERC-20; * - (router-internal) WRAPPED_NATIVE_CURRENCY[ChainId.ARC], a synthetic * 18-decimal token with no pools that the gas models and the quoters use as * the "wrapped" form of the native view. * * There is no wrapper contract, so the router cannot connect the native and * the ERC-20 pools with the usual ETH/WETH fake pool: the two views have * different pool keys AND different decimals. Instead, a swap that involves * either view is also routed with the other view substituted, and the better * gas-adjusted result is returned (see AlphaRouter.route). */ /** True for any of the three USDC views on Arc. */ export declare function isArcUsdcView(currency: Currency): boolean; /** * The other on-chain view of Arc USDC: ERC-20 for native, native for ERC-20. * Undefined for anything else (including the synthetic wrapped token, which * callers should never route with directly). */ export declare function getArcUsdcAlias(currency: Currency): Currency | undefined; /** * Re-expresses an amount of one Arc USDC view as another view. Raw units are * shifted by the decimals difference (10^12 between native and ERC-20) and the * result is truncated to a whole raw unit of the target, so the 18 -> 6 * direction drops sub-micro-USDC dust that the ERC-20 view cannot represent. */ export declare function convertArcUsdcAmount(amount: CurrencyAmount, target: Currency): CurrencyAmount; export type ArcUsdcAliasRun = { /** Amount to route with in the alias run. */ amount: CurrencyAmount; /** Quote currency to route with in the alias run. */ quoteCurrency: Currency; /** The USDC view the caller asked for. */ requested: Currency; /** The USDC view substituted in the alias run. */ alias: Currency; /** Which side of the swap was substituted. */ side: 'amount' | 'quote'; }; /** * Describes the second routing run for an Arc USDC swap, or undefined when the * swap does not involve USDC, is not on Arc, or is native USDC <-> ERC-20 USDC * (which is not a swap at all). */ export declare function getArcUsdcAliasRun(chainId: number, amount: CurrencyAmount, quoteCurrency: Currency): ArcUsdcAliasRun | undefined; /** * Converts the caller-facing amounts of a SwapRoute produced by an alias run * into `target` (the currency the requested-view run labels its quote in). * Only amounts that are themselves an Arc USDC view are touched, and only when * `target` is one too. `route` and `trade` are left untouched on purpose: they * describe the real pools and must keep the pools' currencies. */ export declare function normalizeArcUsdcSwapRoute(swapRoute: SwapRoute, target: Currency): SwapRoute; /** * Picks the better of the requested-view result and the (already normalized) * alias-view result by gas-adjusted quote. Ties go to the requested view. */ export declare function pickBetterArcUsdcSwapRoute(primary: SwapRoute | null, alias: SwapRoute | null, tradeType: TradeType): SwapRoute | null;