@panoptic-eng/sdk 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cow/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import "../position-Bo7y8jcj.js";
2
- import { APP_DATA_DOC, APP_DATA_HASH, COW_API_URLS, COW_CANCELLATION_TYPES, COW_NATIVE_ETH, COW_ORDER_TYPES, COW_SETTLEMENT, COW_VAULT_RELAYER, CowApiError, CowNativeTokenError, CowOrderTooSmallError, CowUnsupportedChainError, DEFAULT_VALID_FOR_SECONDS, XSTOCK_WRAPPERS, approveErc20ForCow, cancelCowOrder, checkCowApproval, cowDomain, findCowToken, getCowOrderStatus, getXstockUnderlying, getXstockWrapper, isCowSupportedChain, isXstockUnderlying, isXstockWrapper, pickBestVenue, quoteCowSwap, signAndSubmitCowOrder } from "../cow-BciGptKA.js";
3
- import "../writes-CGmOSeKi.js";
1
+ import "../position-zqvENVuf.js";
2
+ import { APP_DATA_DOC, APP_DATA_HASH, COW_API_URLS, COW_CANCELLATION_TYPES, COW_NATIVE_ETH, COW_ORDER_TYPES, COW_SETTLEMENT, COW_VAULT_RELAYER, CowApiError, CowNativeTokenError, CowOrderTooSmallError, CowUnsupportedChainError, DEFAULT_VALID_FOR_SECONDS, XSTOCK_WRAPPERS, approveErc20ForCow, cancelCowOrder, checkCowApproval, cowDomain, findCowToken, getCowOrderStatus, getXstockUnderlying, getXstockWrapper, isCowSupportedChain, isXstockUnderlying, isXstockWrapper, pickBestVenue, quoteCowSwap, signAndSubmitCowOrder } from "../cow-Cqw3sako.js";
3
+ import "../writes-CRjVFjMt.js";
4
4
 
5
5
  export { APP_DATA_DOC, APP_DATA_HASH, COW_API_URLS, COW_CANCELLATION_TYPES, COW_NATIVE_ETH, COW_ORDER_TYPES, COW_SETTLEMENT, COW_VAULT_RELAYER, CowApiError, CowNativeTokenError, CowOrderTooSmallError, CowUnsupportedChainError, DEFAULT_VALID_FOR_SECONDS, XSTOCK_WRAPPERS, approveErc20ForCow, cancelCowOrder, checkCowApproval, cowDomain, findCowToken, getCowOrderStatus, getXstockUnderlying, getXstockWrapper, isCowSupportedChain, isXstockUnderlying, isXstockWrapper, pickBestVenue, quoteCowSwap, signAndSubmitCowOrder };
@@ -1,4 +1,4 @@
1
- import { PanopticError$1 as PanopticError, submitWrite } from "./position-Bo7y8jcj.js";
1
+ import { PanopticError$1 as PanopticError, submitWrite } from "./position-zqvENVuf.js";
2
2
  import { erc20Abi, getAddress, keccak256, maxUint256, stringToHex, zeroAddress } from "viem";
3
3
 
4
4
  //#region src/cow/addresses.ts
@@ -1402,4 +1402,4 @@ function isXstockWrapper(chainId, address) {
1402
1402
 
1403
1403
  //#endregion
1404
1404
  export { APP_DATA_DOC, APP_DATA_HASH, COW_API_URLS, COW_CANCELLATION_TYPES, COW_NATIVE_ETH, COW_ORDER_TYPES, COW_SETTLEMENT, COW_VAULT_RELAYER, CowApiError, CowNativeTokenError, CowOrderTooSmallError, CowUnsupportedChainError, DEFAULT_VALID_FOR_SECONDS, XSTOCK_WRAPPERS, approveErc20ForCow, cancelCowOrder, checkCowApproval, cowDomain, findCowToken, getCowOrderStatus, getXstockUnderlying, getXstockWrapper, isCowSupportedChain, isXstockUnderlying, isXstockWrapper, pickBestVenue, quoteCowSwap, signAndSubmitCowOrder };
1405
- //# sourceMappingURL=cow-BciGptKA.js.map
1405
+ //# sourceMappingURL=cow-Cqw3sako.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cow-BciGptKA.js","names":["COW_SETTLEMENT: Address","COW_VAULT_RELAYER: Address","COW_NATIVE_ETH: Address","COW_API_URLS: Partial<Record<number, string>>","chainId: bigint | number","params: CheckCowApprovalParams","params: ApproveErc20ForCowParams","BPS_DENOMINATOR","params: PickBestVenueParams","chainId: bigint | number","chainId: bigint","cause?: Error","errorType: string","message: string","status: number","chainId: bigint","apiUrl?: string","baseUrl: string","path: string","init?: RequestInit","body: CowApiErrorBody","params: SignAndSubmitCowOrderParams","params: CancelCowOrderParams","slippageBps: bigint","params: QuoteCowSwapParams","params: GetCowOrderStatusParams","settlementTxHash: Hex | undefined","COINGECKO_CHAIN_SLUGS: Partial<Record<number, string>>","chainId: number","url: string","params: FindCowTokenParams","address: Address","XSTOCK_WRAPPERS: XstockWrapperRegistry","chainId: number","underlying: Address","wrapper: Address","address: Address"],"sources":["../src/cow/addresses.ts","../src/cow/approval.ts","../src/cow/compare.ts","../src/cow/eip712.ts","../src/cow/errors.ts","../src/cow/api.ts","../src/cow/order.ts","../src/cow/quote.ts","../src/cow/status.ts","../src/cow/tokens.ts","../src/cow/xstockWrappers.generated.ts","../src/cow/xstockWrappers.ts"],"sourcesContent":["/**\n * CoW Protocol contract addresses and order-book API endpoints.\n *\n * Both contracts are deployed deterministically (CREATE2) and share the same\n * address on every supported chain.\n *\n * @module cow/addresses\n */\n\nimport type { Address } from 'viem'\n\n/** GPv2Settlement — EIP-712 verifying contract for signed orders. */\nexport const COW_SETTLEMENT: Address = '0x9008D19f58AAbD9eD0D60971565AA8510560ab41'\n\n/** GPv2VaultRelayer — the ERC20 approval target (NOT the settlement contract). */\nexport const COW_VAULT_RELAYER: Address = '0xC92E8bdf79f0507f65a392b0ab4667716BFE0110'\n\n/**\n * Buy-token marker for native ETH. Orders buying this sentinel settle in\n * native ETH (the settlement contract unwraps WETH). Only valid on the buy\n * side — selling native ETH requires the eth-flow contract (unsupported here).\n */\nexport const COW_NATIVE_ETH: Address = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'\n\n/** Order-book API base URL per chain. */\nexport const COW_API_URLS: Partial<Record<number, string>> = {\n 1: 'https://api.cow.fi/mainnet',\n 11155111: 'https://api.cow.fi/sepolia',\n}\n\n/** Whether CoW Protocol has an order book for the chain. */\nexport function isCowSupportedChain(chainId: bigint | number): boolean {\n return COW_API_URLS[Number(chainId)] !== undefined\n}\n","/**\n * ERC20 approval to the CoW vault relayer.\n *\n * Single-step plain `approve` to GPv2VaultRelayer — CoW does not use Permit2.\n *\n * @module cow/approval\n */\n\nimport { erc20Abi, maxUint256 } from 'viem'\n\nimport type { TxResult } from '../panoptic/v2/types'\nimport { submitWrite } from '../panoptic/v2/writes'\nimport { COW_VAULT_RELAYER } from './addresses'\nimport type { ApproveErc20ForCowParams, CheckCowApprovalParams, CowApprovalStatus } from './types'\n\n/** Check whether the vault relayer can pull `amount` of the sell token. */\nexport async function checkCowApproval(params: CheckCowApprovalParams): Promise<CowApprovalStatus> {\n const { client, sellToken, owner, amount } = params\n\n const allowance = await client.readContract({\n address: sellToken,\n abi: erc20Abi,\n functionName: 'allowance',\n args: [owner, COW_VAULT_RELAYER],\n })\n\n return { needsApproval: allowance < amount, allowance }\n}\n\n/** Approve the sell token to the vault relayer (defaults to unlimited). */\nexport async function approveErc20ForCow(params: ApproveErc20ForCowParams): Promise<TxResult> {\n const { client, walletClient, account, sellToken, amount = maxUint256, txOverrides } = params\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: sellToken,\n abi: erc20Abi,\n functionName: 'approve',\n args: [COW_VAULT_RELAYER, amount],\n txOverrides,\n })\n}\n","/**\n * Venue selection between the Uniswap v4 router and CoW Swap.\n *\n * Pure amount comparison so it stays testable and reusable outside React.\n * Gas cost of the router tx is not factored in (CoW ERC20 sells are gasless);\n * TODO: optionally discount the Uniswap side by gasEstimate × gas price.\n *\n * @module cow/compare\n */\n\n/** Swap venues the UI can route through. */\nexport type SwapVenue = 'uniswap' | 'cow'\n\nconst BPS_DENOMINATOR = 10_000n\n\n/** Parameters for {@link pickBestVenue}. */\nexport interface PickBestVenueParams {\n /** 'sell' = exact-in (maximize output), 'buy' = exact-out (minimize input). */\n kind: 'sell' | 'buy'\n /** Uniswap quote amounts; omit when the quote failed or is unavailable. */\n uniswap?: {\n /** Quoted output (exact-in). */\n amountOut?: bigint\n /** Quoted input (exact-out). */\n amountIn?: bigint\n }\n /** CoW quote amounts; omit when the quote failed or is unavailable. */\n cow?: {\n /** Quoted net output (exact-in). */\n buyAmount?: bigint\n /** Quoted gross input including fee (exact-out). */\n sellAmountTotal?: bigint\n }\n}\n\n/** Result of {@link pickBestVenue}. */\nexport interface BestVenue {\n winner: SwapVenue\n /** Price advantage of the winner over the loser in bps (only when both quoted). */\n advantageBps?: bigint\n}\n\n/**\n * Pick the venue with the better effective price. Exact-in compares net\n * output (higher wins); exact-out compares gross input (lower wins). With a\n * single usable quote that venue wins; ties go to Uniswap (instant\n * settlement); with no usable quotes Uniswap wins by default.\n */\nexport function pickBestVenue(params: PickBestVenueParams): BestVenue {\n const { kind, uniswap, cow } = params\n\n const uniAmount = kind === 'sell' ? uniswap?.amountOut : uniswap?.amountIn\n const cowAmount = kind === 'sell' ? cow?.buyAmount : cow?.sellAmountTotal\n\n if (cowAmount === undefined || cowAmount <= 0n) return { winner: 'uniswap' }\n if (uniAmount === undefined || uniAmount <= 0n) return { winner: 'cow' }\n\n // 'sell': bigger output wins; 'buy': smaller input wins. Ties → Uniswap.\n const cowWins = kind === 'sell' ? cowAmount > uniAmount : cowAmount < uniAmount\n const [better, worse] = cowWins ? [cowAmount, uniAmount] : [uniAmount, cowAmount]\n const advantageBps =\n kind === 'sell'\n ? ((better - worse) * BPS_DENOMINATOR) / worse\n : ((worse - better) * BPS_DENOMINATOR) / better\n\n return { winner: cowWins ? 'cow' : 'uniswap', advantageBps }\n}\n","/**\n * EIP-712 typed-data definitions for GPv2 (CoW Protocol) orders.\n * @module cow/eip712\n */\n\nimport { type Address, keccak256, stringToHex } from 'viem'\n\nimport { COW_SETTLEMENT } from './addresses'\n\n/** GPv2 `Order` struct, in EIP-712 typed-data form. */\nexport const COW_ORDER_TYPES = {\n Order: [\n { name: 'sellToken', type: 'address' },\n { name: 'buyToken', type: 'address' },\n { name: 'receiver', type: 'address' },\n { name: 'sellAmount', type: 'uint256' },\n { name: 'buyAmount', type: 'uint256' },\n { name: 'validTo', type: 'uint32' },\n { name: 'appData', type: 'bytes32' },\n { name: 'feeAmount', type: 'uint256' },\n { name: 'kind', type: 'string' },\n { name: 'partiallyFillable', type: 'bool' },\n { name: 'sellTokenBalance', type: 'string' },\n { name: 'buyTokenBalance', type: 'string' },\n ],\n} as const\n\n/** GPv2 order-cancellation struct (batch of order UIDs). */\nexport const COW_CANCELLATION_TYPES = {\n OrderCancellations: [{ name: 'orderUids', type: 'bytes[]' }],\n} as const\n\n/** EIP-712 domain for GPv2Settlement on the given chain. */\nexport function cowDomain(chainId: bigint | number): {\n name: string\n version: string\n chainId: number\n verifyingContract: Address\n} {\n return {\n name: 'Gnosis Protocol',\n version: 'v2',\n chainId: Number(chainId),\n verifyingContract: COW_SETTLEMENT,\n }\n}\n\n/**\n * Full appData JSON document attached to orders. The order itself carries only\n * its keccak256 hash; the API stores the document when it accompanies the\n * order POST. Must stay byte-identical to {@link APP_DATA_HASH}.\n */\nexport const APP_DATA_DOC = '{\"appCode\":\"panoptic\",\"metadata\":{},\"version\":\"1.3.0\"}'\n\n/** keccak256 of {@link APP_DATA_DOC} — the `appData` field signed in the order. */\nexport const APP_DATA_HASH = keccak256(stringToHex(APP_DATA_DOC))\n","/**\n * Errors for the CoW Protocol swap module.\n *\n * All extend {@link PanopticError} so callers can keep a single\n * `instanceof PanopticError` check and so they satisfy `SimulationResult`'s\n * error type.\n *\n * @module cow/errors\n */\n\nimport { PanopticError } from '../panoptic/v2/errors'\n\n/** The chain has no CoW order book. */\nexport class CowUnsupportedChainError extends PanopticError {\n override readonly name = 'CowUnsupportedChainError'\n\n constructor(\n public readonly chainId: bigint,\n cause?: Error,\n ) {\n super(`CoW Protocol not available on chain ${chainId}`, cause)\n }\n}\n\n/** The order-book API rejected a request (non-2xx response). */\nexport class CowApiError extends PanopticError {\n override readonly name: string = 'CowApiError'\n\n constructor(\n /** Machine-readable API error type, e.g. 'SellAmountDoesNotCoverFee'. */\n public readonly errorType: string,\n message: string,\n public readonly status: number,\n cause?: Error,\n ) {\n super(message, cause)\n }\n}\n\n/** The sell amount is too small to cover the protocol fee (dust order). */\nexport class CowOrderTooSmallError extends CowApiError {\n override readonly name = 'CowOrderTooSmallError'\n\n constructor(message: string, status: number, cause?: Error) {\n super('SellAmountDoesNotCoverFee', message, status, cause)\n }\n}\n\n/** Selling native ETH requires the eth-flow contract (unsupported here); buying it is fine. */\nexport class CowNativeTokenError extends PanopticError {\n override readonly name = 'CowNativeTokenError'\n\n constructor(cause?: Error) {\n super('CoW orders cannot sell native ETH (eth-flow not supported)', cause)\n }\n}\n","/**\n * Minimal fetch wrapper for the CoW order-book REST API.\n * @module cow/api\n */\n\nimport { COW_API_URLS } from './addresses'\nimport { CowApiError, CowOrderTooSmallError, CowUnsupportedChainError } from './errors'\n\n/** Resolve the order-book base URL for a chain (override wins). */\nexport function resolveCowApiUrl(chainId: bigint, apiUrl?: string): string {\n const url = apiUrl ?? COW_API_URLS[Number(chainId)]\n if (!url) throw new CowUnsupportedChainError(chainId)\n return url\n}\n\n/** Shape of order-book error payloads. */\ninterface CowApiErrorBody {\n errorType?: string\n description?: string\n}\n\n/**\n * Call the order book and parse JSON, mapping non-2xx responses to\n * {@link CowApiError} (dust orders to {@link CowOrderTooSmallError}).\n */\nexport async function cowApiRequest<T>(\n baseUrl: string,\n path: string,\n init?: RequestInit,\n): Promise<T> {\n // Normalize headers so a Headers instance / tuple array passed by the caller\n // is preserved (a spread would drop those), only defaulting Content-Type.\n const headers = new Headers(init?.headers)\n if (!headers.has('Content-Type')) headers.set('Content-Type', 'application/json')\n const response = await fetch(`${baseUrl}/api/v1${path}`, { ...init, headers })\n\n if (!response.ok) {\n let body: CowApiErrorBody = {}\n try {\n body = (await response.json()) as CowApiErrorBody\n } catch {\n // Non-JSON error body — fall through with the status text.\n }\n const errorType = body.errorType ?? 'UnknownError'\n const message = body.description ?? `CoW API request failed (${response.status})`\n if (errorType === 'SellAmountDoesNotCoverFee') {\n throw new CowOrderTooSmallError(message, response.status)\n }\n throw new CowApiError(errorType, message, response.status)\n }\n\n // Tolerate empty / non-JSON success bodies (e.g. DELETE /orders for a\n // cancellation, which callers type as void): return undefined rather than\n // throwing inside response.json().\n if (response.status === 204) return undefined as T\n const text = await response.text()\n if (text === '') return undefined as T\n return JSON.parse(text) as T\n}\n","/**\n * Sign and submit CoW orders (and signed cancellations) to the order book.\n *\n * Orders are EIP-712 intents — submission returns an order UID, not a tx\n * hash. Settlement happens later when a solver includes the order in a batch;\n * track it via {@link getCowOrderStatus}.\n *\n * @module cow/order\n */\n\nimport type { Hex } from 'viem'\n\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport {\n APP_DATA_DOC,\n APP_DATA_HASH,\n COW_CANCELLATION_TYPES,\n COW_ORDER_TYPES,\n cowDomain,\n} from './eip712'\nimport type { CancelCowOrderParams, CowOrderResult, SignAndSubmitCowOrderParams } from './types'\n\n/**\n * Build the final order from a quote, sign it (EIP-712) and POST it to the\n * order book. The signed `feeAmount` is 0 — the fee is already folded into the\n * quote's `orderSellAmount`.\n */\nexport async function signAndSubmitCowOrder(\n params: SignAndSubmitCowOrderParams,\n): Promise<CowOrderResult> {\n const { walletClient, account, chainId, quote, receiver = account, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const order = {\n sellToken: quote.sellToken,\n buyToken: quote.buyToken,\n receiver,\n sellAmount: quote.orderSellAmount,\n buyAmount: quote.orderBuyAmount,\n validTo: Number(quote.validTo),\n appData: APP_DATA_HASH,\n feeAmount: 0n,\n kind: quote.kind,\n partiallyFillable: false,\n sellTokenBalance: 'erc20',\n buyTokenBalance: 'erc20',\n } as const\n\n const signature = await walletClient.signTypedData({\n account,\n domain: cowDomain(chainId),\n types: COW_ORDER_TYPES,\n primaryType: 'Order',\n message: order,\n })\n\n const orderUid = await cowApiRequest<Hex>(baseUrl, '/orders', {\n method: 'POST',\n body: JSON.stringify({\n ...order,\n sellAmount: order.sellAmount.toString(),\n buyAmount: order.buyAmount.toString(),\n feeAmount: '0',\n // Full appData document so the API can verify it against the signed hash.\n appData: APP_DATA_DOC,\n appDataHash: APP_DATA_HASH,\n signingScheme: 'eip712',\n signature,\n from: account,\n quoteId: quote.quoteId ?? undefined,\n }),\n })\n\n return { orderUid }\n}\n\n/**\n * Cancel an open order off-chain (free, signed cancellation). Cancellation is\n * best-effort: an order already committed to a solver batch can still settle.\n */\nexport async function cancelCowOrder(params: CancelCowOrderParams): Promise<void> {\n const { walletClient, account, chainId, orderUid, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const signature = await walletClient.signTypedData({\n account,\n domain: cowDomain(chainId),\n types: COW_CANCELLATION_TYPES,\n primaryType: 'OrderCancellations',\n message: { orderUids: [orderUid] },\n })\n\n await cowApiRequest<void>(baseUrl, '/orders', {\n method: 'DELETE',\n body: JSON.stringify({ orderUids: [orderUid], signature, signingScheme: 'eip712' }),\n })\n}\n","/**\n * Quote swaps via the CoW order-book API.\n *\n * Unlike the Uniswap quoter this is an off-chain HTTP call; results still come\n * back as a `SimulationResult` so UI error handling matches the router path.\n *\n * @module cow/quote\n */\n\nimport { zeroAddress } from 'viem'\n\nimport { PanopticError } from '../panoptic/v2/errors'\nimport type { SimulationResult } from '../panoptic/v2/types'\nimport { COW_NATIVE_ETH } from './addresses'\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport { APP_DATA_DOC } from './eip712'\nimport { CowNativeTokenError } from './errors'\nimport type { CowQuote, QuoteCowSwapParams } from './types'\n\nconst BPS_DENOMINATOR = 10_000n\n/** Default order validity window (30 minutes). */\nexport const DEFAULT_VALID_FOR_SECONDS = 1800n\n\n/** No block context for off-chain quotes. */\nconst OFFCHAIN_META = {\n blockNumber: 0n,\n blockTimestamp: 0n,\n blockHash: '0x0' as `0x${string}`,\n}\n\n/**\n * Reject out-of-range slippage so the limit-amount math can't underflow/overflow.\n * 100% (BPS_DENOMINATOR) is forbidden too: on the exact-in path it would reduce\n * `orderBuyAmount` to 0, signing an order that accepts any fill.\n */\nfunction assertSlippageBps(slippageBps: bigint): void {\n if (slippageBps < 0n || slippageBps >= BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..9999`)\n }\n}\n\n/** Raw order-book quote response (amounts are decimal strings). */\ninterface CowQuoteResponse {\n quote: {\n sellToken: string\n buyToken: string\n sellAmount: string\n buyAmount: string\n feeAmount: string\n validTo: number\n kind: 'sell' | 'buy'\n }\n id: number | null\n}\n\n/**\n * Quote a swap via the CoW order book.\n *\n * For `kind: 'sell'` (exact-in) `amount` is the sell amount before fee; for\n * `kind: 'buy'` (exact-out) it is the exact buy amount. The returned\n * `orderSellAmount`/`orderBuyAmount` are ready to sign: the fee is folded into\n * the sell side (orders are placed with `feeAmount: 0` under the current fee\n * model) and `slippageBps` is applied to the non-exact side.\n */\nexport async function quoteCowSwap(\n params: QuoteCowSwapParams,\n): Promise<SimulationResult<CowQuote>> {\n const {\n chainId,\n sellToken,\n buyToken,\n kind,\n amount,\n from,\n slippageBps,\n validForSeconds = DEFAULT_VALID_FOR_SECONDS,\n apiUrl,\n } = params\n\n try {\n assertSlippageBps(slippageBps)\n // Selling native ETH would need the eth-flow contract; buying it is fine —\n // orders use the buy-token sentinel and settle in native ETH.\n if (sellToken === zeroAddress) {\n throw new CowNativeTokenError()\n }\n const resolvedBuyToken = buyToken === zeroAddress ? COW_NATIVE_ETH : buyToken\n if (amount <= 0n) {\n throw new PanopticError(`amount ${amount} must be positive`)\n }\n\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n const response = await cowApiRequest<CowQuoteResponse>(baseUrl, '/quote', {\n method: 'POST',\n body: JSON.stringify({\n sellToken,\n buyToken: resolvedBuyToken,\n from,\n receiver: from,\n validFor: Number(validForSeconds),\n appData: APP_DATA_DOC,\n partiallyFillable: false,\n sellTokenBalance: 'erc20',\n buyTokenBalance: 'erc20',\n signingScheme: 'eip712',\n ...(kind === 'sell'\n ? { kind: 'sell', sellAmountBeforeFee: amount.toString() }\n : { kind: 'buy', buyAmountAfterFee: amount.toString() }),\n }),\n })\n\n const sellAmount = BigInt(response.quote.sellAmount)\n const buyAmount = BigInt(response.quote.buyAmount)\n const feeAmount = BigInt(response.quote.feeAmount)\n const sellAmountTotal = sellAmount + feeAmount\n\n // Fold the fee into the signed sell amount (feeAmount signs as 0), then\n // apply slippage to the side the user did not fix. Buy-order sell cap uses\n // ceiling division so the buffer never rounds down.\n const orderSellAmount =\n kind === 'sell'\n ? sellAmountTotal\n : (sellAmountTotal * (BPS_DENOMINATOR + slippageBps) + BPS_DENOMINATOR - 1n) /\n BPS_DENOMINATOR\n const orderBuyAmount =\n kind === 'sell' ? (buyAmount * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR : buyAmount\n\n return {\n success: true,\n data: {\n kind,\n sellToken,\n // The signed order must carry the resolved (sentinel) buy token.\n buyToken: resolvedBuyToken,\n sellAmount,\n buyAmount,\n feeAmount,\n sellAmountTotal,\n orderSellAmount,\n orderBuyAmount,\n validTo: BigInt(response.quote.validTo),\n quoteId: response.id,\n },\n gasEstimate: 0n,\n _meta: OFFCHAIN_META,\n }\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof PanopticError\n ? error\n : new PanopticError(\n error instanceof Error ? error.message : 'CoW quote failed',\n error instanceof Error ? error : undefined,\n ),\n _meta: OFFCHAIN_META,\n }\n }\n}\n","/**\n * Poll order state from the CoW order book.\n * @module cow/status\n */\n\nimport type { Hex } from 'viem'\n\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport type { CowOrderState, CowOrderStatus, GetCowOrderStatusParams } from './types'\n\n/** Raw `GET /orders/{uid}` fields we consume. */\ninterface CowOrderResponse {\n status: CowOrderStatus\n executedSellAmount: string\n executedBuyAmount: string\n}\n\n/** Raw `GET /trades` entry fields we consume. */\ninterface CowTradeResponse {\n txHash: Hex | null\n}\n\n/**\n * Fetch an order's lifecycle state. Once any trade has executed, the\n * settlement tx hash is included (fetched from the trades endpoint).\n */\nexport async function getCowOrderStatus(params: GetCowOrderStatusParams): Promise<CowOrderState> {\n const { chainId, orderUid, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const order = await cowApiRequest<CowOrderResponse>(baseUrl, `/orders/${orderUid}`)\n\n const executedSellAmount = BigInt(order.executedSellAmount ?? '0')\n const executedBuyAmount = BigInt(order.executedBuyAmount ?? '0')\n\n let settlementTxHash: Hex | undefined\n if (executedBuyAmount > 0n) {\n const trades = await cowApiRequest<CowTradeResponse[]>(baseUrl, `/trades?orderUid=${orderUid}`)\n settlementTxHash = trades.find((t) => t.txHash)?.txHash ?? undefined\n }\n\n return { status: order.status, executedSellAmount, executedBuyAmount, settlementTxHash }\n}\n","/**\n * Resolve token symbols to addresses using the token lists CoW Swap trades\n * from. Lets a UI route any listed token (e.g. xStocks like NVDAx) to the\n * order book without maintaining a static registry.\n *\n * Sources, in priority order:\n * 1. CoW's curated list (canonical entries for blue-chip symbols like UNI)\n * 2. CoinGecko's full per-chain list (carries the long tail, incl. xStocks)\n *\n * Lists are fetched lazily and cached in-module for an hour.\n *\n * @module cow/tokens\n */\n\nimport { type Address, getAddress } from 'viem'\n\n/** Resolved token-list entry. */\nexport interface CowTokenInfo {\n chainId: number\n address: Address\n symbol: string\n name: string\n decimals: number\n logoURI?: string\n}\n\n/** Parameters for {@link findCowToken}. */\nexport interface FindCowTokenParams {\n /** Chain to resolve on. */\n chainId: bigint\n /** Token symbol, case-insensitive (e.g. 'nvdax'). */\n symbol: string\n /** Override the token-list URLs (e.g. tests). */\n listUrls?: string[]\n}\n\n/** CoinGecko per-chain list slugs for the chains CoW supports here. */\nconst COINGECKO_CHAIN_SLUGS: Partial<Record<number, string>> = {\n 1: 'ethereum',\n}\n\nfunction tokenListUrls(chainId: number): string[] {\n const urls = ['https://files.cow.fi/tokens/CowSwap.json']\n const slug = COINGECKO_CHAIN_SLUGS[chainId]\n if (slug) urls.push(`https://tokens.coingecko.com/${slug}/all.json`)\n return urls\n}\n\ninterface RawTokenList {\n tokens: {\n chainId?: number\n address: string\n symbol: string\n name: string\n decimals: number\n logoURI?: string\n }[]\n}\n\nconst LIST_CACHE_TTL_MS = 3_600_000\nconst listCache = new Map<string, { fetchedAt: number; list: Promise<RawTokenList | null> }>()\n\n/** Fetch a token list with an in-module 1h cache; resolves null on any failure. */\nfunction fetchTokenList(url: string): Promise<RawTokenList | null> {\n const cached = listCache.get(url)\n if (cached && Date.now() - cached.fetchedAt < LIST_CACHE_TTL_MS) return cached.list\n\n const list = fetch(url)\n .then((res) => (res.ok ? (res.json() as Promise<RawTokenList>) : null))\n .catch(() => null)\n .then((parsed) => {\n // Drop failures from the cache so the next call retries.\n if (parsed === null || !Array.isArray(parsed.tokens)) {\n listCache.delete(url)\n return null\n }\n return parsed\n })\n listCache.set(url, { fetchedAt: Date.now(), list })\n return list\n}\n\n/**\n * Find a token by symbol on the given chain across CoW's token lists. The\n * first list containing a (case-insensitive) symbol match wins; within a\n * list the first match wins, which favors canonical entries on collisions.\n * Returns null when no list resolves the symbol (or all fetches fail).\n *\n * Resolution only proves the token is listed — whether solvers can actually\n * fill a given pair/size is answered by `quoteCowSwap`.\n */\nexport async function findCowToken(params: FindCowTokenParams): Promise<CowTokenInfo | null> {\n const { chainId, symbol, listUrls } = params\n const chain = Number(chainId)\n const wanted = symbol.toUpperCase()\n\n for (const url of listUrls ?? tokenListUrls(chain)) {\n const list = await fetchTokenList(url)\n if (!list) continue\n const match = list.tokens.find(\n // CoW's own list omits chainId on some entries (single-chain lists).\n (t) => (t.chainId === undefined || t.chainId === chain) && t.symbol.toUpperCase() === wanted,\n )\n if (match) {\n // Validate/checksum the external address; skip a malformed entry rather\n // than leak a non-Address string to callers.\n let address: Address\n try {\n address = getAddress(match.address)\n } catch {\n continue\n }\n return {\n chainId: chain,\n address,\n symbol: match.symbol,\n name: match.name,\n decimals: match.decimals,\n logoURI: match.logoURI,\n }\n }\n }\n return null\n}\n","/**\n * Generated registry of Backed xStock ERC4626 wrappers on Ethereum mainnet.\n *\n * DO NOT EDIT BY HAND. Regenerate with `pnpm --filter panoptic-v2-sdk gen:xstock-wrappers`\n * (scripts/gen-xstock-wrappers.ts), which scans the WrappedBackedTokenFactory\n * `NewToken` events and reads each wrapper's ERC4626 `asset()` as the underlying.\n *\n * @module cow/xstockWrappers.generated\n */\n\nimport type { XstockWrapperRegistry } from './xstockWrappers'\n\nexport const XSTOCK_WRAPPERS: XstockWrapperRegistry = {\n 1: [\n {\n wrapper: '0x5AA7649fdbDa47De64A07aC81D64B682AF9C0724',\n underlying: '0x9d275685dC284C8eB1C79f6ABA7a63Dc75ec890a',\n symbol: 'wAAPLx',\n name: 'Wrapped Apple xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5CC079963Fb70C0f987F65F539E3B61a6EBdf6Db',\n underlying: '0xfBF2398dF672cEE4aFcC2A4A733222331c742a6A',\n symbol: 'wABBVx',\n name: 'Wrapped AbbVie xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD812B37181Ae89801e4BB3F49E4C1FAF11fC0b57',\n underlying: '0x89233399708C18Ac6887F90A2B4Cd8Ba5fEdD06e',\n symbol: 'wABTx',\n name: 'Wrapped Abbott xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc262Bea18cb810Cc7715EE48fe3cbD3D79B4aFe1',\n underlying: '0x03183Ce31b1656B72A55fa6056e287f50C35BbEB',\n symbol: 'wACNx',\n name: 'Wrapped Accenture xStock',\n decimals: 18,\n },\n {\n wrapper: '0x444DE06b76C9a1417A21A877038F49A1f0D8A1cD',\n underlying: '0x16E0B579be45bAaE54cEddd52e742B6457A7fE12',\n symbol: 'wADBEx',\n name: 'Wrapped Adobe xStock',\n decimals: 18,\n },\n {\n wrapper: '0x36d2fe6e6e4136C6BF286588391FAD6d45422350',\n underlying: '0x2f9a35aB5dDFBc49927BFdEab98A86c53DC6E763',\n symbol: 'wAMBRx',\n name: 'Wrapped Amber xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1eb8909B5C46A24F005A76C469912f5518F448eF',\n underlying: '0x3522513E5F146a2006e2901b05f16B2821485E19',\n symbol: 'wAMDx',\n name: 'Wrapped AMD xStock',\n decimals: 18,\n },\n {\n wrapper: '0xac85d37acbadCa37545E21ab0fB991bcE8c1187C',\n underlying: '0x3557Ba345B01EFa20A1bdDC61F573BFD87195081',\n symbol: 'wAMZNx',\n name: 'Wrapped Amazon.com xStock',\n decimals: 18,\n },\n {\n wrapper: '0xd17E483364D849e3B3A52464bb2CA56626EDfc31',\n underlying: '0x50a1291F69D9d3853Def8209cFb1AF0b46927BE1',\n symbol: 'wAPPx',\n name: 'Wrapped AppLovin xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD0798d3c30F4408350C8448d75DA1c7721227dBa',\n underlying: '0xC0B417e7F83db438631Eb5E096684dd742E5294F',\n symbol: 'wASMLx',\n name: 'Wrapped ASML xStock',\n decimals: 18,\n },\n {\n wrapper: '0x720347faf9D745B841541De0d7B2abc8A4b87531',\n underlying: '0x89b2607878ae19baB8020b8140eD550Ef3E953bb',\n symbol: 'wASTSx',\n name: 'Wrapped AST SpaceMobile xStock',\n decimals: 18,\n },\n {\n wrapper: '0x8DEb752aAA807E0258afd5cCFFe2b5A804026f28',\n underlying: '0x38BAC69cbBd28156796e4163B2B6dcb81E336565',\n symbol: 'wAVGOx',\n name: 'Wrapped Broadcom xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0b306951161b856Ad02c8566B4eF184c6BB08564',\n underlying: '0xb23767492D0Ca6dC7221CBeA45689a0410f388c4',\n symbol: 'wAXPx',\n name: 'Wrapped American Express xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB908FEAeab7E671dB697d77c3acFD8859E92a4e2',\n underlying: '0x5D642505FE1a28897eb3BaBA665F454755D8daA2',\n symbol: 'wAZNx',\n name: 'Wrapped AstraZeneca xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA2b1335256cd663Da89F650180508dd1f0DC3BAa',\n underlying: '0x314938c596F5ce31C3f75307d2979338C346D7F2',\n symbol: 'wBACx',\n name: 'Wrapped Bank of America xStock',\n decimals: 18,\n },\n {\n wrapper: '0xDEc933e2392AD908263e70A386fbF34e703Ffe8F',\n underlying: '0xbbcb0356bB9e6B3Faa5CbF9E5F36185d53403Ac9',\n symbol: 'wbCOIN',\n name: 'Wrapped Backed Coinbase Global',\n decimals: 18,\n },\n {\n wrapper: '0x277f724d12DD0249b48CBD7eB2623c5e5042b970',\n underlying: '0xa8A25DB6Cf17Fa097f1DBbc9c841892456898fF3',\n symbol: 'wBKNGx',\n name: 'Wrapped Booking xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE5365A5A16A7D1DD37b33e6F8D78aeB89847398B',\n underlying: '0x5A6a0742cA689E7E8a91A38F5255589CB2191646',\n symbol: 'wBLKx',\n name: 'Wrapped BlackRock xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7a1d054e09eAe0294D53959674EE9DE14a1f70B1',\n underlying: '0x38DE7b9FC733DeF81525E65C1Bf99722026489e2',\n symbol: 'wBLSHx',\n name: 'Wrapped Bullish xStock',\n decimals: 18,\n },\n {\n wrapper: '0xBFd29b7F395d30932033c2F45ab792024E71AA94',\n underlying: '0xaeB681B69E5094E04d11BCeF51A71358A374C3ED',\n symbol: 'wBMNRx',\n name: 'Wrapped Bitmine xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1a4F71B0Ff3C22540887bcf83b50054a213c673d',\n underlying: '0xaC28C9178ACc8BA4A11A29E013a3A2627086e422',\n symbol: 'wbMSTR',\n name: 'Wrapped Backed MicroStrategy Inc',\n decimals: 18,\n },\n {\n wrapper: '0x7E8101A1C322D394b3961498c7D40d2DFA94C392',\n underlying: '0xA34C5e0AbE843E10461E2C9586Ea03E55Dbcc495',\n symbol: 'wbNVDA',\n name: 'Wrapped Backed NVIDIA Corp',\n decimals: 18,\n },\n {\n wrapper: '0xa150245f155778e749185C9446e9e59E406674eF',\n underlying: '0x12992613fDd35aBe95DEc5a4964331b1ee23B50d',\n symbol: 'wBRK.Bx',\n name: 'Wrapped Berkshire Hathaway xStock',\n decimals: 18,\n },\n {\n wrapper: '0x88E437dbebdDe3D75Ff7c0cb830F54dd834538f0',\n underlying: '0x22E1991e5f82736A2a990322a46aac0e95826c5B',\n symbol: 'wBTBTx',\n name: 'Wrapped Bit Digital xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1f82284C1658Ad71C576f7230E6C2DEE7901c1FA',\n underlying: '0x14A5f2872396802C3Cc8942A39Ab3E4118EE5038',\n symbol: 'wbTSLA',\n name: 'Wrapped Backed Tesla Inc',\n decimals: 18,\n },\n {\n wrapper: '0xdCE0CA61bC9F95b771e0764dc4C553288b7F2f13',\n underlying: '0xD0194F0f077968DA8ca59811e9407f54AE6c9432',\n symbol: 'wCLSKx',\n name: 'Wrapped CleanSpark xStock',\n decimals: 18,\n },\n {\n wrapper: '0xd1A01e3F9c7565e88b1CF2413ba0a0E671e57b33',\n underlying: '0xBC7170a1280Be28513B4e940C681537EB25e39f4',\n symbol: 'wCMCSAx',\n name: 'Wrapped Comcast xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3a98E79cDc7D8B2716A8696E25af028E429f11dA',\n underlying: '0x364f210f430eC2448Fc68A49203040F6124096F0',\n symbol: 'wCOINx',\n name: 'Wrapped Coinbase xStock',\n decimals: 18,\n },\n {\n wrapper: '0x89E2B6cA78DBee629544679780963b85Ba76fe2a',\n underlying: '0x51eD5b74A05F256DbD9Ebb4e4f68Bb41ba10160b',\n symbol: 'wCORZx',\n name: 'Wrapped Core Scientific xStock',\n decimals: 18,\n },\n {\n wrapper: '0xFa48FeE923600Fecaa7af0DfB4a66E3109Ad51bf',\n underlying: '0x4720B5e6421e6879132aED52040d56Bb6e5CFeeF',\n symbol: 'wCOSTx',\n name: 'Wrapped Costco xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA90872ACa656eBE47bDEBF3B19Ec9Dd9C5ADC7f8',\n underlying: '0xfEbDEd1B0986a8ee107f5AB1a1c5a813491DeCEB',\n symbol: 'wCRCLx',\n name: 'Wrapped Circle xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc6B6B8D50A6673C04C495e30B411da5A7adF39f5',\n underlying: '0x4A4073f2EAF299A1be22254DCD2C41727F6F54a2',\n symbol: 'wCRMx',\n name: 'Wrapped Salesforce xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD71a6aDBc40c2674591CDB11B8C7ae03A880b06E',\n underlying: '0x214151022C2a5E380aB80CdaC31f23Ae554a7345',\n symbol: 'wCRWDx',\n name: 'Wrapped CrowdStrike xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCFa485bc42c2492917351F89F5cf5c7b2C5a66aa',\n underlying: '0x053C784cD87B74f42e0c089f98643E79c1A3ff16',\n symbol: 'wCSCOx',\n name: 'Wrapped Cisco xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7F88888b7A81546a036554Aa67a289Ea428b20d4',\n underlying: '0xad5cdc3340904285B8159089974A99a1A09EB4C0',\n symbol: 'wCVXx',\n name: 'Wrapped Chevron xStock',\n decimals: 18,\n },\n {\n wrapper: '0xce41bF7482E86fFF0Ab0A971dD425496BB58E4FD',\n underlying: '0x521860bB5dF5468358875266B89BFE90d990C6e7',\n symbol: 'wDFDVx',\n name: 'Wrapped DFDV xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6c7AD1886a6Da37766fED060d5F08fF43285DcdD',\n underlying: '0xdbA228936F4079DaF9Aa906fd48a87f2300405F4',\n symbol: 'wDHRx',\n name: 'Wrapped Danaher xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3E5ceeA6D6399Ac1a1FEE67C1644fc7F616aD9fD',\n underlying: '0x03D44b9bB0398E2Be3C89417D51E615C3D461F5a',\n symbol: 'wDUOLx',\n name: 'Wrapped Duolingo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0c4F0256FB31cC71666Fee3f0cE1De3B1abE347B',\n underlying: '0x4c7610990cb63cdca174ce61822F7693B49FCe93',\n symbol: 'wEBAYx',\n name: 'Wrapped eBay xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5230C4b621bd2d1f22933903F9a4fA82a9F17fcf',\n underlying: '0xd1be5bA0c293997C7F69da707D14EB4ABCB13ddD',\n symbol: 'wEXPEx',\n name: 'Wrapped Expedia xStock',\n decimals: 18,\n },\n {\n wrapper: '0x91049e9586301c54B2eF410C2b7e9040Ffb02182',\n underlying: '0x3C313D234D0C6C876F6c21ba2EC1F26823247Be2',\n symbol: 'wFIGx',\n name: 'Wrapped Figma xStock',\n decimals: 18,\n },\n {\n wrapper: '0xdeAE051463CD8C457e7e9D97A398c575E8629c18',\n underlying: '0x3AE27479E6e52f6ddB6EA8AA567e6Cc92C78d93a',\n symbol: 'wFUFUx',\n name: 'Wrapped BitFuFu xStock',\n decimals: 18,\n },\n {\n wrapper: '0x61532Ce3f1DF7fBf5fFb7B891d184226e85B37c6',\n underlying: '0x2380F2673C640fB67E2d6B55B44C62F0E0e69DA9',\n symbol: 'wGLDx',\n name: 'Wrapped Gold xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4c79D4A1a863830EF845431578FB40E31bD51f4A',\n underlying: '0xf7F4fAC56f012dE7Dd6adFF54C761986B9E0655a',\n symbol: 'wGLXYx',\n name: 'Wrapped Galaxy Digital xStock',\n decimals: 18,\n },\n {\n wrapper: '0xb2f6ED0ED3eEb22bEF7A648794FFC19b8aF3761C',\n underlying: '0xE5f6d3b2405ABdfE6F660e63202B25D23763160d',\n symbol: 'wGMEx',\n name: 'Wrapped Gamestop xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1630F08370917E79df0B7572395a5e907508bBBc',\n underlying: '0xe92f673Ca36C5E2Efd2DE7628f815f84807e803F',\n symbol: 'wGOOGLx',\n name: 'Wrapped Alphabet xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6eEd78e2780d82BE4E37d9937C27Bcf32C8DA072',\n underlying: '0x3Ee7E9B3A992fD23CD1C363B0e296856B04ab149',\n symbol: 'wGSx',\n name: 'Wrapped Goldman Sachs xStock',\n decimals: 18,\n },\n {\n wrapper: '0xC641E2eBF6E076e2AE53477C2E725b3c67C0fd94',\n underlying: '0x766b0CD6ED6D90B5d49d2c36a3761E9728501BA9',\n symbol: 'wHDx',\n name: 'Wrapped Home Depot xStock',\n decimals: 18,\n },\n {\n wrapper: '0xBd1B73b2E89967e83507B500D798998200A53380',\n underlying: '0x62a48560861B0b451654bFffdb5be6E47aa8ff1B',\n symbol: 'wHONx',\n name: 'Wrapped Honeywell xStock',\n decimals: 18,\n },\n {\n wrapper: '0x953707d7A1cB30cc5C636bDA8EaeBe410341eB14',\n underlying: '0xE1385FDd5ffB10081Cd52C56584F25EFa9084015',\n symbol: 'wHOODx',\n name: 'Wrapped Robinhood xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6Ec2763859C5b04F5598017880744081aFeFa3Bb',\n underlying: '0xd457b379801433EA5c3A8542b61902023AE39DcD',\n symbol: 'wHSDTx',\n name: 'Wrapped Helius Medical Technologies xStock',\n decimals: 18,\n },\n {\n wrapper: '0x154f25Cfd146d2DF6420ec1f575C3c46D45f4Db7',\n underlying: '0x560deb3D70Ac90064fF809349cDf9A771a06fd36',\n symbol: 'wHUTx',\n name: 'Wrapped Hut 8 xStock',\n decimals: 18,\n },\n {\n wrapper: '0xa8F31436FFE4E71f51B2D65b7D5a5c457AE2000f',\n underlying: '0xd9913208647671Fe0F48F7F260076B2C6F310Aac',\n symbol: 'wIBMx',\n name: 'Wrapped International Business Machines xStock',\n decimals: 18,\n },\n {\n wrapper: '0x59361E881b186e48D71EC61E969dCF50a4dbC75b',\n underlying: '0x6a668332825450ACD2e449372057d31b3de16a1E',\n symbol: 'wIEMGx',\n name: 'Wrapped Core MSCI Emerging Markets xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3ab20fd7c57146AF128E8565261CBdaDa0F015E6',\n underlying: '0xAA28cB97D7f7E172f54deE950743886D2d65447d',\n symbol: 'wIJRx',\n name: 'Wrapped S&P Small Cap xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6A2a68Ca7FC793D8CEa36326a6Ec1eF7AC3D9742',\n underlying: '0xf8A80D1cb9cFD70D03D655D9dF42339846F3B3C8',\n symbol: 'wINTCx',\n name: 'Wrapped Intel xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5A47DE111D731Fd2Df90E4A2d7a9b459b31Bd643',\n underlying: '0xdadfb355c6110eda0908740d52c834d6C2BCDDc7',\n symbol: 'wIWMx',\n name: 'Wrapped Russell 2000 xStock',\n decimals: 18,\n },\n {\n wrapper: '0xcdB53A7cBa9Ec6d55dfE8f58bd6772826722D7BD',\n underlying: '0xdb0482cfaD4789798623E64b15eebA01b16e917C',\n symbol: 'wJNJx',\n name: 'Wrapped Johnson & Johnson xStock',\n decimals: 18,\n },\n {\n wrapper: '0xaB635f839f81A12dC8Db8Ab31006af14E26292fE',\n underlying: '0xD9FC3E075d45254a1D834fEa18AF8041207DeA0A',\n symbol: 'wJPMx',\n name: 'Wrapped JPMorgan Chase xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9a2486fbe7bC17C9100be65c31aBE7c9Bf84C23c',\n underlying: '0xdCC1a2699441079dA889B1F49e12B69cC791129b',\n symbol: 'wKOx',\n name: 'Wrapped Coca-Cola xStock',\n decimals: 18,\n },\n {\n wrapper: '0x316fFEa434348c2cB72024e62Ae845770315351E',\n underlying: '0x15059c599C16Fd8f70B633Ade165502D6402CD49',\n symbol: 'wLINx',\n name: 'Wrapped Linde xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3644971A7E971f60e707F7E8716cCaC5a0461290',\n underlying: '0x19c41EA77b34BbDEe61c3A87A75D1ABDA2ED0be4',\n symbol: 'wLLYx',\n name: 'Wrapped Eli Lilly xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD395C4dAd12eb071714d2b86cB5bC16acE9996B6',\n underlying: '0x847dEB9c78fb00319bC7A006dFF729c11428E537',\n symbol: 'wLULUx',\n name: 'Wrapped lululemon xStock',\n decimals: 18,\n },\n {\n wrapper: '0x34f5273693C880a9B2d9B6cfc8e13A2f3B8C0F06',\n underlying: '0x9D692bffEf6f6BedF4274053ff9998EFE3B2539E',\n symbol: 'wMARAx',\n name: 'Wrapped MARA xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5b32624f352d2FC6cC70889967A143ba1814f82b',\n underlying: '0xb365Cd2588065F522D379AD19e903304f6B622C6',\n symbol: 'wMAx',\n name: 'Wrapped Mastercard xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1717D8Be2Bcb27f4E8f36c817088Fa6a2c0b3B30',\n underlying: '0x80A77a372c1e12AcCdA84299492f404902E2DA67',\n symbol: 'wMCDx',\n name: \"Wrapped McDonald's xStock\",\n decimals: 18,\n },\n {\n wrapper: '0x02C1b10e5329c4502469396B2ce9f200E60b4a77',\n underlying: '0x0588e851ec0418d660BeE81230d6c678dAF21d46',\n symbol: 'wMDTx',\n name: 'Wrapped Medtronic xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4E41a262cAA93C6575d336E0a4eb79f3c67caa06',\n underlying: '0x96702be57Cd9777f835117a809C7124fe4ec989A',\n symbol: 'wMETAx',\n name: 'Wrapped Meta xStock',\n decimals: 18,\n },\n {\n wrapper: '0x61a6Cd11f658D1b418e1082b564678983b71Fb7F',\n underlying: '0x8499b26BBfC8c3830a37b92E47DF2d7cBc0154e9',\n symbol: 'wMNSTx',\n name: 'Wrapped Monster xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4728E48c2C201E32fe210AaB68A71E419FEAc74a',\n underlying: '0x17D8186Ed8F68059124190D147174D0f6697dc40',\n symbol: 'wMRKx',\n name: 'Wrapped Merck xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0d6fce45796D5c00689c0916b976645a0FF1F0cE',\n underlying: '0xeAAd46F4146Ded5a47B55AA7F6c48c191dEAEC88',\n symbol: 'wMRVLx',\n name: 'Wrapped Marvell xStock',\n decimals: 18,\n },\n {\n wrapper: '0x63Ad27614231767C8C489745B9145272De50D09b',\n underlying: '0x5621737f42dAE558b81269FcB9E9E70c19Aa6b35',\n symbol: 'wMSFTx',\n name: 'Wrapped Microsoft xStock',\n decimals: 18,\n },\n {\n wrapper: '0x266E5923F6118F8b340cA5a23AE7f71897361476',\n underlying: '0xAE2f842EF90C0d5213259Ab82639D5BBF649b08E',\n symbol: 'wMSTRx',\n name: 'Wrapped MicroStrategy xStock',\n decimals: 18,\n },\n {\n wrapper: '0x529E286229963bE57F0EC6F57d2D70A2F3E29935',\n underlying: '0xf6a873BAe4Ba1B304e45dF52A4b7D176E1C6a8c4',\n symbol: 'wMUx',\n name: 'Wrapped Micron Technology xStock',\n decimals: 18,\n },\n {\n wrapper: '0xfE0D2545f9E7f3678CB35Ed3CDf70488C5570D11',\n underlying: '0xA6a65AC27E76cD53cB790473E4345c46e5eBf961',\n symbol: 'wNFLXx',\n name: 'Wrapped Netflix xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93E62845C1DD5822EbC807ab71A5Fb750DecD15A',\n underlying: '0xc845b2894dBddd03858fd2D643B4eF725fE0849d',\n symbol: 'wNVDAx',\n name: 'Wrapped NVIDIA xStock',\n decimals: 18,\n },\n {\n wrapper: '0x16E443AEbc83E2089AA90431A1C0d311854EEC69',\n underlying: '0xF9523E369c5f55ad72DbAA75B0a9b92B3D8b147e',\n symbol: 'wNVOx',\n name: 'Wrapped Novo Nordisk xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9608a6eB064dd1C35eC9A4332bD9F8b05D1dE66C',\n underlying: '0x4b0eE7C047D43cA403239f28f42115bEdB7c0076',\n symbol: 'wOKLOx',\n name: 'Wrapped Oklo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9836479c80823f5f8B60FD0171F8D96301185714',\n underlying: '0xbEe6b69345F376598Fe16AbD5592c6F844825E66',\n symbol: 'wOPENx',\n name: 'Wrapped OPEN xStock',\n decimals: 18,\n },\n {\n wrapper: '0x54f34Ceb15313Caaee838F77c1c3C2Fe2E94526A',\n underlying: '0x548308E91ec9F285C7bFf05295baDBD56a6e4971',\n symbol: 'wORCLx',\n name: 'Wrapped Oracle xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7FbE0E7ACB47DCb053BF6146cCA6Bfb81A5D1319',\n underlying: '0xe12BB32D77BE4DB10DDC82088b230D35d097E9C5',\n symbol: 'wPANWx',\n name: 'Wrapped Palo Alto Networks xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA00A5538708b5aca7045F2ca15104707965bac94',\n underlying: '0x36c424a6EC0e264b1616102Ad63eD2aD7857413e',\n symbol: 'wPEPx',\n name: 'Wrapped PepsiCo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4E6894c3481B3A45393ce8ac9552945Ad50A3758',\n underlying: '0x1Ac765B5BEa23184802C7d2d497f7c33f1444A9e',\n symbol: 'wPFEx',\n name: 'Wrapped Pfizer xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0afC19943fA98E9E9E90Fc4ab4d4D3c13E162232',\n underlying: '0xa90424D5D3E770e8644103AB503ed775dD1318FD',\n symbol: 'wPGx',\n name: 'Wrapped Procter & Gamble xStock',\n decimals: 18,\n },\n {\n wrapper: '0xa3B6Fe1a923585bb828fCFAa460B78EeFD5aE2EC',\n underlying: '0x6d482CeC5f9dd1f05CCee9Fd3ff79B246170F8e2',\n symbol: 'wPLTRx',\n name: 'Wrapped Palantir xStock',\n decimals: 18,\n },\n {\n wrapper: '0xF429759BBf687118efd6B3713303006C356b8765',\n underlying: '0x536825370F1159cBA953055f5c2F16DDc7B5a348',\n symbol: 'wPLx',\n name: 'Wrapped Planet Labs xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7C2e00e6b0d519a8C492d20c2524342A4398FF34',\n underlying: '0x02a6c1789c3B4FDb1a7a3DfA39F90e5d3c94F4F9',\n symbol: 'wPMx',\n name: 'Wrapped Philip Morris xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCf4953c617CD1306A1f9236084204fBc67FDA2Ac',\n underlying: '0xf706585e7e8900bE0267bEE3B9A2F70835EC6628',\n symbol: 'wPYPLx',\n name: 'Wrapped PayPal xStock',\n decimals: 18,\n },\n {\n wrapper: '0xdbD9232fee15351068Fe02F0683146e16D9f2cEa',\n underlying: '0xa753A7395cAe905Cd615Da0B82A53E0560f250af',\n symbol: 'wQQQx',\n name: 'Wrapped Nasdaq xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc1de0BA489E6a5df9ebbA3911e382b455DeDF8c3',\n underlying: '0x5d8dA1417E3565eb02C9ca8cC588bE5D8F65b1c5',\n symbol: 'wRBLXx',\n name: 'Wrapped Roblox xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE99c177Bcb254bE2A0333c3B7071c696400Df1cF',\n underlying: '0x6Ac47387f0a2798dF4C4eE5bb31ab9517ac97cb8',\n symbol: 'wRIOTx',\n name: 'Wrapped Riot Platforms xStock',\n decimals: 18,\n },\n {\n wrapper: '0xf3f249dBaA9E3e9C9B78b1784cECd954e829aC81',\n underlying: '0xE17ce7dD2afb6Da3488fD9ef2558523D569e17B4',\n symbol: 'wRKLBx',\n name: 'Wrapped Rocket Lab xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4329d7C2Fa1De1c7218cd0c68587e2225C8C53fB',\n underlying: '0x7c7445A40926152B8d24aBDb9020e219d3D3380a',\n symbol: 'wSATAx',\n name: 'Wrapped Strive, Inc. Series A Preferred xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9Fd163B1020535C24A3140DB9BB1153E6dEf8fCd',\n underlying: '0x338791c58fdED314b81EAb139A1A2Fb7967D90d6',\n symbol: 'wSBETx',\n name: 'Wrapped SharpLink Gaming xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB9FCE7dcDfa1962EB53B3e2000554A77F0c10E8b',\n underlying: '0xF6D87E523512704C29E9b7cA3e9e6226bDCE3EA1',\n symbol: 'wSCHFx',\n name: 'Wrapped Schwab International Equity xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93bd84EE978b60f37df0639f70EAC621e542AD4b',\n underlying: '0x4833e7f4f0460f4B72A3a5879A6C9841bCC5B58B',\n symbol: 'wSLVx',\n name: 'Wrapped iShares Silver Trust xStock',\n decimals: 18,\n },\n {\n wrapper: '0x382567e5D72eca3eD2Bb97a4e42918107E09fab0',\n underlying: '0x7F8ba411ECBC0A135d669d5EaE5D15b0Ca0b0ea1',\n symbol: 'wSPCEx',\n name: 'Wrapped Virgin Galactic xStock',\n decimals: 18,\n },\n {\n wrapper: '0x8e2eeD8b8B5E13Ea7BF38e50d7821d2C57309072',\n underlying: '0x68fa48B1C2FE52b3D776E1953e0E782b5044Ce28',\n symbol: 'wSPCXx',\n name: 'Wrapped SpaceX xStock',\n decimals: 18,\n },\n {\n wrapper: '0x2f5a59Dd87C57fBfA10a5Ab12fD902C8AFdA2dfD',\n underlying: '0xD3c5Af6B2F0F754b2141f368cFc5ea99C3594d3a',\n symbol: 'wSPGIx',\n name: 'Wrapped S&P Global xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc88FcD8B874fDb3256E8B55b3decB8c24EAb4c02',\n underlying: '0x90A2a4c76b5D8c0bc892A69EA28Aa775a8f2dD48',\n symbol: 'wSPYx',\n name: 'Wrapped SP500 xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0B2456017C5Df2dFc0289740C4b352049892780C',\n underlying: '0x1Aad217B8F78dbA5E6693460e8470F8b1A3977f3',\n symbol: 'wSTRCx',\n name: 'Wrapped Strategy PP Variable xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB038B3b1f999897035AD4Ea65A9d6F59E2e86588',\n underlying: '0x38E0445308E7FcD5230F2DF6b52B36DD4FF313b6',\n symbol: 'wSTRKx',\n name: 'Wrapped Strategy PP Fixed xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCd932bF1c895B7143ec34Df5Ae7889D3853904D8',\n underlying: '0x4cbf89ED7Bb30b8a860fa86d3c96E9c72931299b',\n symbol: 'wTBLLx',\n name: 'Wrapped TBLL xStock',\n decimals: 18,\n },\n {\n wrapper: '0xfa4fFDbf6D53E1539B03823D72886Ab9510250E7',\n underlying: '0x61AeE4f4e6B62806c26eafF921e7F41782cA2E03',\n symbol: 'wTEMx',\n name: 'Wrapped Tempus AI xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0420112790C619Fbbd44106bC72ce217b515269A',\n underlying: '0xAB6a44AD34D083f463fa6F64d0619F11eB2cb48D',\n symbol: 'wTGTx',\n name: 'Wrapped Target xStock',\n decimals: 18,\n },\n {\n wrapper: '0x89EA0284308dEEF33a22abd7ea33888b4349108C',\n underlying: '0xAF072F109A2C173D822a4fe9af311A1B18F83d19',\n symbol: 'wTMOx',\n name: 'Wrapped Thermo Fisher xStock',\n decimals: 18,\n },\n {\n wrapper: '0xF940Fd9D8B80412C47691442075848cc05cD6732',\n underlying: '0x68F3DDEE8BAE33691E7CD0372984fD857E842760',\n symbol: 'wTMUSx',\n name: 'Wrapped T-Mobile xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4b12EB39418e30fC0e86E36CDac0545c1d9edAc9',\n underlying: '0xe95ab205e333443D7970336D5fD827eF9eD97608',\n symbol: 'wTONXx',\n name: 'Wrapped TON xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3D843414E617CBb9D2328c7eCF155d7C18139D6A',\n underlying: '0xfDDDb57878eF9D6f681Ec4381DCB626b9E69AC86',\n symbol: 'wTQQQx',\n name: 'Wrapped TQQQ xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93730D679190e831caea5e4ce46a5701D555e0F2',\n underlying: '0xeCF59a3FD0224D33429920f8fa6dE493abc4EFC0',\n symbol: 'wTRONx',\n name: 'Wrapped Tron xStock',\n decimals: 18,\n },\n {\n wrapper: '0x43680aBF18cf54898Be84C6eF78237CFBD441883',\n underlying: '0x8aD3c73F833d3F9A523aB01476625F269aEB7Cf0',\n symbol: 'wTSLAx',\n name: 'Wrapped Tesla xStock',\n decimals: 18,\n },\n {\n wrapper: '0x083283FAfD9CEC6145ce6a4A50F020A01737De52',\n underlying: '0x9e3bf4Ecfc44EeDD624F26656B6736a3F093b073',\n symbol: 'wTSMx',\n name: 'Wrapped TSMC xStock',\n decimals: 18,\n },\n {\n wrapper: '0xb10F7AA3BC0ad9FcE5Fc99702C2022d47BA93827',\n underlying: '0x75639aE3A05079873D7189DcbDBc455898cAe904',\n symbol: 'wTx',\n name: 'Wrapped AT&T xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4BEa51f138A30329b8855bf0DaE85EA5644Ada82',\n underlying: '0xdb9783Ca04bBD64fe2c6d7B9503A979b3DE30729',\n symbol: 'wUBERx',\n name: 'Wrapped Uber xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA0412CE46fE877b7f174B82aCD95E70063BbaF2a',\n underlying: '0x167A6375DA1eFc4a5BE0f470E73eCEfd66245048',\n symbol: 'wUNHx',\n name: 'Wrapped UnitedHealth xStock',\n decimals: 18,\n },\n {\n wrapper: '0x92DB84B2358E97976DAD16f91E6aeb9B2A757e76',\n underlying: '0x7AB6C97f65e4227adc5090Bd31a376D1F36f39fa',\n symbol: 'wVSTx',\n name: 'Wrapped Vistra xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE9161F111c55Bdd67525C1d4F9bbca07750aaAb7',\n underlying: '0xbD730E618bcD88C82dDeE52e10275CF2f88A4777',\n symbol: 'wVTIx',\n name: 'Wrapped Vanguard xStock',\n decimals: 18,\n },\n {\n wrapper: '0x48Da55D8FE70A4E3ec421736369BACB8D62Fa089',\n underlying: '0x6d5edEEbBc6A4099Eb8bb289EB3b80D799f7b28C',\n symbol: 'wVTx',\n name: 'Wrapped Vanguard Total World xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3cf193acf378Ec224a0209Be888b4b0B963E1896',\n underlying: '0x2363FD1235C1B6d3A5088DdF8dF3A0b3A30C5293',\n symbol: 'wVx',\n name: 'Wrapped Visa xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4cA269239B760787bB2A54C055c383FD2DADE779',\n underlying: '0xc435b3C41AE56d9Bc57b8525F4d522C978F168e8',\n symbol: 'wWBDx',\n name: 'Wrapped Warner Bros. Discovery xStock',\n decimals: 18,\n },\n {\n wrapper: '0x97C4C1704111B7c2304B177C37858B7169c667f9',\n underlying: '0xfEEE18422F8F1cD6193C12aAfad7123DbfF15517',\n symbol: 'wWENx',\n name: \"Wrapped Wendy's xStock\",\n decimals: 18,\n },\n {\n wrapper: '0xa24D9c43D64c76aCD962003647FD43a85eb44Db8',\n underlying: '0x7AEfc9965699fBea943e03264d96e50CD4A97b21',\n symbol: 'wWMTx',\n name: 'Wrapped Walmart xStock',\n decimals: 18,\n },\n {\n wrapper: '0xf068165CFf011A56562F855b44CF690e371232C8',\n underlying: '0xC0c2150cf0870E2d7aBc7cDe17C20A542faFBB9B',\n symbol: 'wWULFx',\n name: 'Wrapped TeraWulf xStock',\n decimals: 18,\n },\n {\n wrapper: '0x448bC811F60eac772775dD53421380E8D4DC4338',\n underlying: '0xEEdb0273c5Af792745180e9fF568cD01550fFA13',\n symbol: 'wXOMx',\n name: 'Wrapped Exxon Mobil xStock',\n decimals: 18,\n },\n ],\n}\n","/**\n * Resolve xStocks (tokenized equities) to their Backed ERC4626 wrapper, and\n * back.\n *\n * xStocks are rebasing, so they can't be used directly in AMMs / Panoptic\n * pools — those are built on the non-rebasing **wrapped** version minted by the\n * Backed `WrappedBackedTokenFactory`. CoW Swap, by contrast, trades the\n * unwrapped xStock. A user who buys e.g. NVDAx on CoW therefore holds the\n * unwrapped token and must wrap it before lending it or selling it through the\n * Uniswap/Panoptic venue.\n *\n * The factory exposes no underlying→wrapper lookup and its `NewToken` event\n * omits the underlying, so this mapping is generated offline (see\n * `scripts/gen-xstock-wrappers.ts`) into {@link XSTOCK_WRAPPERS} and resolved\n * statically here — no runtime fetch.\n *\n * Each wrapper is a standard ERC4626 vault: `asset()` is the underlying xStock,\n * `deposit` wraps, `redeem` unwraps, and `convertToShares`/`convertToAssets`\n * (or `previewDeposit`/`previewRedeem`) convert amounts.\n *\n * @module cow/xstockWrappers\n */\n\nimport type { Address } from 'viem'\n\nimport { XSTOCK_WRAPPERS } from './xstockWrappers.generated'\n\nexport { XSTOCK_WRAPPERS }\n\n/** A single xStock → wrapper mapping entry. */\nexport interface XstockWrapperInfo {\n /** ERC4626 wrapper (the token Panoptic/Uniswap pools trade). */\n wrapper: Address\n /** Underlying rebasing xStock (`asset()` of the wrapper; the CoW-traded token). */\n underlying: Address\n /** Wrapper symbol, e.g. `wNVDAx`. */\n symbol: string\n /** Wrapper name, e.g. `Wrapped NVIDIA xStock`. */\n name: string\n /** Wrapper (and underlying) ERC20 decimals. */\n decimals: number\n}\n\n/** Generated registry keyed by chainId. */\nexport type XstockWrapperRegistry = Partial<Record<number, XstockWrapperInfo[]>>\n\n/**\n * Per-chain lookup indices, built lazily from the static registry. Keys are\n * lowercased addresses for case-insensitive matching. Caching static config is\n * safe (it carries no dynamic on-chain data).\n */\nconst indexCache = new Map<\n number,\n { byUnderlying: Map<string, XstockWrapperInfo>; byWrapper: Map<string, XstockWrapperInfo> }\n>()\n\nfunction getIndex(chainId: number) {\n let idx = indexCache.get(chainId)\n if (!idx) {\n const byUnderlying = new Map<string, XstockWrapperInfo>()\n const byWrapper = new Map<string, XstockWrapperInfo>()\n for (const entry of XSTOCK_WRAPPERS[chainId] ?? []) {\n byUnderlying.set(entry.underlying.toLowerCase(), entry)\n byWrapper.set(entry.wrapper.toLowerCase(), entry)\n }\n idx = { byUnderlying, byWrapper }\n indexCache.set(chainId, idx)\n }\n return idx\n}\n\n/**\n * Resolve the wrapper for an unwrapped xStock. Returns `undefined` when the\n * address isn't a known xStock underlying on this chain.\n */\nexport function getXstockWrapper(\n chainId: number,\n underlying: Address,\n): XstockWrapperInfo | undefined {\n return getIndex(chainId).byUnderlying.get(underlying.toLowerCase())\n}\n\n/**\n * Resolve the underlying xStock for a wrapper address. Returns `undefined` when\n * the address isn't a known xStock wrapper on this chain.\n */\nexport function getXstockUnderlying(\n chainId: number,\n wrapper: Address,\n): XstockWrapperInfo | undefined {\n return getIndex(chainId).byWrapper.get(wrapper.toLowerCase())\n}\n\n/** True if `address` is a known unwrapped xStock on this chain. */\nexport function isXstockUnderlying(chainId: number, address: Address): boolean {\n return getXstockWrapper(chainId, address) !== undefined\n}\n\n/** True if `address` is a known xStock wrapper on this chain. */\nexport function isXstockWrapper(chainId: number, address: Address): boolean {\n return getXstockUnderlying(chainId, address) !== undefined\n}\n"],"mappings":";;;;;AAYA,MAAaA,iBAA0B;;AAGvC,MAAaC,oBAA6B;;;;;;AAO1C,MAAaC,iBAA0B;;AAGvC,MAAaC,eAAgD;CAC3D,GAAG;CACH,UAAU;AACX;;AAGD,SAAgB,oBAAoBC,SAAmC;AACrE,QAAO,aAAa,OAAO,QAAQ;AACpC;;;;;ACjBD,eAAsB,iBAAiBC,QAA4D;CACjG,MAAM,EAAE,QAAQ,WAAW,OAAO,QAAQ,GAAG;CAE7C,MAAM,YAAY,MAAM,OAAO,aAAa;EAC1C,SAAS;EACT,KAAK;EACL,cAAc;EACd,MAAM,CAAC,OAAO,iBAAkB;CACjC,EAAC;AAEF,QAAO;EAAE,eAAe,YAAY;EAAQ;CAAW;AACxD;;AAGD,eAAsB,mBAAmBC,QAAqD;CAC5F,MAAM,EAAE,QAAQ,cAAc,SAAS,WAAW,SAAS,YAAY,aAAa,GAAG;AAEvF,QAAO,YAAY;EACjB;EACA;EACA;EACA,SAAS;EACT,KAAK;EACL,cAAc;EACd,MAAM,CAAC,mBAAmB,MAAO;EACjC;CACD,EAAC;AACH;;;;AC9BD,MAAMC,oBAAkB;;;;;;;AAmCxB,SAAgB,cAAcC,QAAwC;CACpE,MAAM,EAAE,MAAM,SAAS,KAAK,GAAG;CAE/B,MAAM,YAAY,SAAS,SAAS,SAAS,YAAY,SAAS;CAClE,MAAM,YAAY,SAAS,SAAS,KAAK,YAAY,KAAK;AAE1D,KAAI,wBAA2B,aAAa,GAAI,QAAO,EAAE,QAAQ,UAAW;AAC5E,KAAI,wBAA2B,aAAa,GAAI,QAAO,EAAE,QAAQ,MAAO;CAGxE,MAAM,UAAU,SAAS,SAAS,YAAY,YAAY,YAAY;CACtE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EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,UAAU;CACX;CACD;EACE,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,UAAU;CACX;CACD;EACE,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,UAAU;CACX;CACD;EACE,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,UAAU;CACX;CACD;EACE,SAAS;EACT,YAAY;EACZ,QAAQ;EACR,MAAM;EACN,UAAU;CACX;AACF,EACF;;;;;;;;;ACh0BD,MAAM,aAAa,IAAI;AAKvB,SAAS,SAASC,SAAiB;CACjC,IAAI,MAAM,WAAW,IAAI,QAAQ;AACjC,MAAK,KAAK;EACR,MAAM,eAAe,IAAI;EACzB,MAAM,YAAY,IAAI;AACtB,OAAK,MAAM,SAAS,gBAAgB,YAAY,CAAE,GAAE;AAClD,gBAAa,IAAI,MAAM,WAAW,aAAa,EAAE,MAAM;AACvD,aAAU,IAAI,MAAM,QAAQ,aAAa,EAAE,MAAM;EAClD;AACD,QAAM;GAAE;GAAc;EAAW;AACjC,aAAW,IAAI,SAAS,IAAI;CAC7B;AACD,QAAO;AACR;;;;;AAMD,SAAgB,iBACdA,SACAC,YAC+B;AAC/B,QAAO,SAAS,QAAQ,CAAC,aAAa,IAAI,WAAW,aAAa,CAAC;AACpE;;;;;AAMD,SAAgB,oBACdD,SACAE,SAC+B;AAC/B,QAAO,SAAS,QAAQ,CAAC,UAAU,IAAI,QAAQ,aAAa,CAAC;AAC9D;;AAGD,SAAgB,mBAAmBF,SAAiBG,SAA2B;AAC7E,QAAO,iBAAiB,SAAS,QAAQ;AAC1C;;AAGD,SAAgB,gBAAgBH,SAAiBG,SAA2B;AAC1E,QAAO,oBAAoB,SAAS,QAAQ;AAC7C"}
1
+ {"version":3,"file":"cow-Cqw3sako.js","names":["COW_SETTLEMENT: Address","COW_VAULT_RELAYER: Address","COW_NATIVE_ETH: Address","COW_API_URLS: Partial<Record<number, string>>","chainId: bigint | number","params: CheckCowApprovalParams","params: ApproveErc20ForCowParams","BPS_DENOMINATOR","params: PickBestVenueParams","chainId: bigint | number","chainId: bigint","cause?: Error","errorType: string","message: string","status: number","chainId: bigint","apiUrl?: string","baseUrl: string","path: string","init?: RequestInit","body: CowApiErrorBody","params: SignAndSubmitCowOrderParams","params: CancelCowOrderParams","slippageBps: bigint","params: QuoteCowSwapParams","params: GetCowOrderStatusParams","settlementTxHash: Hex | undefined","COINGECKO_CHAIN_SLUGS: Partial<Record<number, string>>","chainId: number","url: string","params: FindCowTokenParams","address: Address","XSTOCK_WRAPPERS: XstockWrapperRegistry","chainId: number","underlying: Address","wrapper: Address","address: Address"],"sources":["../src/cow/addresses.ts","../src/cow/approval.ts","../src/cow/compare.ts","../src/cow/eip712.ts","../src/cow/errors.ts","../src/cow/api.ts","../src/cow/order.ts","../src/cow/quote.ts","../src/cow/status.ts","../src/cow/tokens.ts","../src/cow/xstockWrappers.generated.ts","../src/cow/xstockWrappers.ts"],"sourcesContent":["/**\n * CoW Protocol contract addresses and order-book API endpoints.\n *\n * Both contracts are deployed deterministically (CREATE2) and share the same\n * address on every supported chain.\n *\n * @module cow/addresses\n */\n\nimport type { Address } from 'viem'\n\n/** GPv2Settlement — EIP-712 verifying contract for signed orders. */\nexport const COW_SETTLEMENT: Address = '0x9008D19f58AAbD9eD0D60971565AA8510560ab41'\n\n/** GPv2VaultRelayer — the ERC20 approval target (NOT the settlement contract). */\nexport const COW_VAULT_RELAYER: Address = '0xC92E8bdf79f0507f65a392b0ab4667716BFE0110'\n\n/**\n * Buy-token marker for native ETH. Orders buying this sentinel settle in\n * native ETH (the settlement contract unwraps WETH). Only valid on the buy\n * side — selling native ETH requires the eth-flow contract (unsupported here).\n */\nexport const COW_NATIVE_ETH: Address = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'\n\n/** Order-book API base URL per chain. */\nexport const COW_API_URLS: Partial<Record<number, string>> = {\n 1: 'https://api.cow.fi/mainnet',\n 11155111: 'https://api.cow.fi/sepolia',\n}\n\n/** Whether CoW Protocol has an order book for the chain. */\nexport function isCowSupportedChain(chainId: bigint | number): boolean {\n return COW_API_URLS[Number(chainId)] !== undefined\n}\n","/**\n * ERC20 approval to the CoW vault relayer.\n *\n * Single-step plain `approve` to GPv2VaultRelayer — CoW does not use Permit2.\n *\n * @module cow/approval\n */\n\nimport { erc20Abi, maxUint256 } from 'viem'\n\nimport type { TxResult } from '../panoptic/v2/types'\nimport { submitWrite } from '../panoptic/v2/writes'\nimport { COW_VAULT_RELAYER } from './addresses'\nimport type { ApproveErc20ForCowParams, CheckCowApprovalParams, CowApprovalStatus } from './types'\n\n/** Check whether the vault relayer can pull `amount` of the sell token. */\nexport async function checkCowApproval(params: CheckCowApprovalParams): Promise<CowApprovalStatus> {\n const { client, sellToken, owner, amount } = params\n\n const allowance = await client.readContract({\n address: sellToken,\n abi: erc20Abi,\n functionName: 'allowance',\n args: [owner, COW_VAULT_RELAYER],\n })\n\n return { needsApproval: allowance < amount, allowance }\n}\n\n/** Approve the sell token to the vault relayer (defaults to unlimited). */\nexport async function approveErc20ForCow(params: ApproveErc20ForCowParams): Promise<TxResult> {\n const { client, walletClient, account, sellToken, amount = maxUint256, txOverrides } = params\n\n return submitWrite({\n client,\n walletClient,\n account,\n address: sellToken,\n abi: erc20Abi,\n functionName: 'approve',\n args: [COW_VAULT_RELAYER, amount],\n txOverrides,\n })\n}\n","/**\n * Venue selection between the Uniswap v4 router and CoW Swap.\n *\n * Pure amount comparison so it stays testable and reusable outside React.\n * Gas cost of the router tx is not factored in (CoW ERC20 sells are gasless);\n * TODO: optionally discount the Uniswap side by gasEstimate × gas price.\n *\n * @module cow/compare\n */\n\n/** Swap venues the UI can route through. */\nexport type SwapVenue = 'uniswap' | 'cow'\n\nconst BPS_DENOMINATOR = 10_000n\n\n/** Parameters for {@link pickBestVenue}. */\nexport interface PickBestVenueParams {\n /** 'sell' = exact-in (maximize output), 'buy' = exact-out (minimize input). */\n kind: 'sell' | 'buy'\n /** Uniswap quote amounts; omit when the quote failed or is unavailable. */\n uniswap?: {\n /** Quoted output (exact-in). */\n amountOut?: bigint\n /** Quoted input (exact-out). */\n amountIn?: bigint\n }\n /** CoW quote amounts; omit when the quote failed or is unavailable. */\n cow?: {\n /** Quoted net output (exact-in). */\n buyAmount?: bigint\n /** Quoted gross input including fee (exact-out). */\n sellAmountTotal?: bigint\n }\n}\n\n/** Result of {@link pickBestVenue}. */\nexport interface BestVenue {\n winner: SwapVenue\n /** Price advantage of the winner over the loser in bps (only when both quoted). */\n advantageBps?: bigint\n}\n\n/**\n * Pick the venue with the better effective price. Exact-in compares net\n * output (higher wins); exact-out compares gross input (lower wins). With a\n * single usable quote that venue wins; ties go to Uniswap (instant\n * settlement); with no usable quotes Uniswap wins by default.\n */\nexport function pickBestVenue(params: PickBestVenueParams): BestVenue {\n const { kind, uniswap, cow } = params\n\n const uniAmount = kind === 'sell' ? uniswap?.amountOut : uniswap?.amountIn\n const cowAmount = kind === 'sell' ? cow?.buyAmount : cow?.sellAmountTotal\n\n if (cowAmount === undefined || cowAmount <= 0n) return { winner: 'uniswap' }\n if (uniAmount === undefined || uniAmount <= 0n) return { winner: 'cow' }\n\n // 'sell': bigger output wins; 'buy': smaller input wins. Ties → Uniswap.\n const cowWins = kind === 'sell' ? cowAmount > uniAmount : cowAmount < uniAmount\n const [better, worse] = cowWins ? [cowAmount, uniAmount] : [uniAmount, cowAmount]\n const advantageBps =\n kind === 'sell'\n ? ((better - worse) * BPS_DENOMINATOR) / worse\n : ((worse - better) * BPS_DENOMINATOR) / better\n\n return { winner: cowWins ? 'cow' : 'uniswap', advantageBps }\n}\n","/**\n * EIP-712 typed-data definitions for GPv2 (CoW Protocol) orders.\n * @module cow/eip712\n */\n\nimport { type Address, keccak256, stringToHex } from 'viem'\n\nimport { COW_SETTLEMENT } from './addresses'\n\n/** GPv2 `Order` struct, in EIP-712 typed-data form. */\nexport const COW_ORDER_TYPES = {\n Order: [\n { name: 'sellToken', type: 'address' },\n { name: 'buyToken', type: 'address' },\n { name: 'receiver', type: 'address' },\n { name: 'sellAmount', type: 'uint256' },\n { name: 'buyAmount', type: 'uint256' },\n { name: 'validTo', type: 'uint32' },\n { name: 'appData', type: 'bytes32' },\n { name: 'feeAmount', type: 'uint256' },\n { name: 'kind', type: 'string' },\n { name: 'partiallyFillable', type: 'bool' },\n { name: 'sellTokenBalance', type: 'string' },\n { name: 'buyTokenBalance', type: 'string' },\n ],\n} as const\n\n/** GPv2 order-cancellation struct (batch of order UIDs). */\nexport const COW_CANCELLATION_TYPES = {\n OrderCancellations: [{ name: 'orderUids', type: 'bytes[]' }],\n} as const\n\n/** EIP-712 domain for GPv2Settlement on the given chain. */\nexport function cowDomain(chainId: bigint | number): {\n name: string\n version: string\n chainId: number\n verifyingContract: Address\n} {\n return {\n name: 'Gnosis Protocol',\n version: 'v2',\n chainId: Number(chainId),\n verifyingContract: COW_SETTLEMENT,\n }\n}\n\n/**\n * Full appData JSON document attached to orders. The order itself carries only\n * its keccak256 hash; the API stores the document when it accompanies the\n * order POST. Must stay byte-identical to {@link APP_DATA_HASH}.\n */\nexport const APP_DATA_DOC = '{\"appCode\":\"panoptic\",\"metadata\":{},\"version\":\"1.3.0\"}'\n\n/** keccak256 of {@link APP_DATA_DOC} — the `appData` field signed in the order. */\nexport const APP_DATA_HASH = keccak256(stringToHex(APP_DATA_DOC))\n","/**\n * Errors for the CoW Protocol swap module.\n *\n * All extend {@link PanopticError} so callers can keep a single\n * `instanceof PanopticError` check and so they satisfy `SimulationResult`'s\n * error type.\n *\n * @module cow/errors\n */\n\nimport { PanopticError } from '../panoptic/v2/errors'\n\n/** The chain has no CoW order book. */\nexport class CowUnsupportedChainError extends PanopticError {\n override readonly name = 'CowUnsupportedChainError'\n\n constructor(\n public readonly chainId: bigint,\n cause?: Error,\n ) {\n super(`CoW Protocol not available on chain ${chainId}`, cause)\n }\n}\n\n/** The order-book API rejected a request (non-2xx response). */\nexport class CowApiError extends PanopticError {\n override readonly name: string = 'CowApiError'\n\n constructor(\n /** Machine-readable API error type, e.g. 'SellAmountDoesNotCoverFee'. */\n public readonly errorType: string,\n message: string,\n public readonly status: number,\n cause?: Error,\n ) {\n super(message, cause)\n }\n}\n\n/** The sell amount is too small to cover the protocol fee (dust order). */\nexport class CowOrderTooSmallError extends CowApiError {\n override readonly name = 'CowOrderTooSmallError'\n\n constructor(message: string, status: number, cause?: Error) {\n super('SellAmountDoesNotCoverFee', message, status, cause)\n }\n}\n\n/** Selling native ETH requires the eth-flow contract (unsupported here); buying it is fine. */\nexport class CowNativeTokenError extends PanopticError {\n override readonly name = 'CowNativeTokenError'\n\n constructor(cause?: Error) {\n super('CoW orders cannot sell native ETH (eth-flow not supported)', cause)\n }\n}\n","/**\n * Minimal fetch wrapper for the CoW order-book REST API.\n * @module cow/api\n */\n\nimport { COW_API_URLS } from './addresses'\nimport { CowApiError, CowOrderTooSmallError, CowUnsupportedChainError } from './errors'\n\n/** Resolve the order-book base URL for a chain (override wins). */\nexport function resolveCowApiUrl(chainId: bigint, apiUrl?: string): string {\n const url = apiUrl ?? COW_API_URLS[Number(chainId)]\n if (!url) throw new CowUnsupportedChainError(chainId)\n return url\n}\n\n/** Shape of order-book error payloads. */\ninterface CowApiErrorBody {\n errorType?: string\n description?: string\n}\n\n/**\n * Call the order book and parse JSON, mapping non-2xx responses to\n * {@link CowApiError} (dust orders to {@link CowOrderTooSmallError}).\n */\nexport async function cowApiRequest<T>(\n baseUrl: string,\n path: string,\n init?: RequestInit,\n): Promise<T> {\n // Normalize headers so a Headers instance / tuple array passed by the caller\n // is preserved (a spread would drop those), only defaulting Content-Type.\n const headers = new Headers(init?.headers)\n if (!headers.has('Content-Type')) headers.set('Content-Type', 'application/json')\n const response = await fetch(`${baseUrl}/api/v1${path}`, { ...init, headers })\n\n if (!response.ok) {\n let body: CowApiErrorBody = {}\n try {\n body = (await response.json()) as CowApiErrorBody\n } catch {\n // Non-JSON error body — fall through with the status text.\n }\n const errorType = body.errorType ?? 'UnknownError'\n const message = body.description ?? `CoW API request failed (${response.status})`\n if (errorType === 'SellAmountDoesNotCoverFee') {\n throw new CowOrderTooSmallError(message, response.status)\n }\n throw new CowApiError(errorType, message, response.status)\n }\n\n // Tolerate empty / non-JSON success bodies (e.g. DELETE /orders for a\n // cancellation, which callers type as void): return undefined rather than\n // throwing inside response.json().\n if (response.status === 204) return undefined as T\n const text = await response.text()\n if (text === '') return undefined as T\n return JSON.parse(text) as T\n}\n","/**\n * Sign and submit CoW orders (and signed cancellations) to the order book.\n *\n * Orders are EIP-712 intents — submission returns an order UID, not a tx\n * hash. Settlement happens later when a solver includes the order in a batch;\n * track it via {@link getCowOrderStatus}.\n *\n * @module cow/order\n */\n\nimport type { Hex } from 'viem'\n\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport {\n APP_DATA_DOC,\n APP_DATA_HASH,\n COW_CANCELLATION_TYPES,\n COW_ORDER_TYPES,\n cowDomain,\n} from './eip712'\nimport type { CancelCowOrderParams, CowOrderResult, SignAndSubmitCowOrderParams } from './types'\n\n/**\n * Build the final order from a quote, sign it (EIP-712) and POST it to the\n * order book. The signed `feeAmount` is 0 — the fee is already folded into the\n * quote's `orderSellAmount`.\n */\nexport async function signAndSubmitCowOrder(\n params: SignAndSubmitCowOrderParams,\n): Promise<CowOrderResult> {\n const { walletClient, account, chainId, quote, receiver = account, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const order = {\n sellToken: quote.sellToken,\n buyToken: quote.buyToken,\n receiver,\n sellAmount: quote.orderSellAmount,\n buyAmount: quote.orderBuyAmount,\n validTo: Number(quote.validTo),\n appData: APP_DATA_HASH,\n feeAmount: 0n,\n kind: quote.kind,\n partiallyFillable: false,\n sellTokenBalance: 'erc20',\n buyTokenBalance: 'erc20',\n } as const\n\n const signature = await walletClient.signTypedData({\n account,\n domain: cowDomain(chainId),\n types: COW_ORDER_TYPES,\n primaryType: 'Order',\n message: order,\n })\n\n const orderUid = await cowApiRequest<Hex>(baseUrl, '/orders', {\n method: 'POST',\n body: JSON.stringify({\n ...order,\n sellAmount: order.sellAmount.toString(),\n buyAmount: order.buyAmount.toString(),\n feeAmount: '0',\n // Full appData document so the API can verify it against the signed hash.\n appData: APP_DATA_DOC,\n appDataHash: APP_DATA_HASH,\n signingScheme: 'eip712',\n signature,\n from: account,\n quoteId: quote.quoteId ?? undefined,\n }),\n })\n\n return { orderUid }\n}\n\n/**\n * Cancel an open order off-chain (free, signed cancellation). Cancellation is\n * best-effort: an order already committed to a solver batch can still settle.\n */\nexport async function cancelCowOrder(params: CancelCowOrderParams): Promise<void> {\n const { walletClient, account, chainId, orderUid, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const signature = await walletClient.signTypedData({\n account,\n domain: cowDomain(chainId),\n types: COW_CANCELLATION_TYPES,\n primaryType: 'OrderCancellations',\n message: { orderUids: [orderUid] },\n })\n\n await cowApiRequest<void>(baseUrl, '/orders', {\n method: 'DELETE',\n body: JSON.stringify({ orderUids: [orderUid], signature, signingScheme: 'eip712' }),\n })\n}\n","/**\n * Quote swaps via the CoW order-book API.\n *\n * Unlike the Uniswap quoter this is an off-chain HTTP call; results still come\n * back as a `SimulationResult` so UI error handling matches the router path.\n *\n * @module cow/quote\n */\n\nimport { zeroAddress } from 'viem'\n\nimport { PanopticError } from '../panoptic/v2/errors'\nimport type { SimulationResult } from '../panoptic/v2/types'\nimport { COW_NATIVE_ETH } from './addresses'\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport { APP_DATA_DOC } from './eip712'\nimport { CowNativeTokenError } from './errors'\nimport type { CowQuote, QuoteCowSwapParams } from './types'\n\nconst BPS_DENOMINATOR = 10_000n\n/** Default order validity window (30 minutes). */\nexport const DEFAULT_VALID_FOR_SECONDS = 1800n\n\n/** No block context for off-chain quotes. */\nconst OFFCHAIN_META = {\n blockNumber: 0n,\n blockTimestamp: 0n,\n blockHash: '0x0' as `0x${string}`,\n}\n\n/**\n * Reject out-of-range slippage so the limit-amount math can't underflow/overflow.\n * 100% (BPS_DENOMINATOR) is forbidden too: on the exact-in path it would reduce\n * `orderBuyAmount` to 0, signing an order that accepts any fill.\n */\nfunction assertSlippageBps(slippageBps: bigint): void {\n if (slippageBps < 0n || slippageBps >= BPS_DENOMINATOR) {\n throw new PanopticError(`invalid slippageBps ${slippageBps}, must be 0..9999`)\n }\n}\n\n/** Raw order-book quote response (amounts are decimal strings). */\ninterface CowQuoteResponse {\n quote: {\n sellToken: string\n buyToken: string\n sellAmount: string\n buyAmount: string\n feeAmount: string\n validTo: number\n kind: 'sell' | 'buy'\n }\n id: number | null\n}\n\n/**\n * Quote a swap via the CoW order book.\n *\n * For `kind: 'sell'` (exact-in) `amount` is the sell amount before fee; for\n * `kind: 'buy'` (exact-out) it is the exact buy amount. The returned\n * `orderSellAmount`/`orderBuyAmount` are ready to sign: the fee is folded into\n * the sell side (orders are placed with `feeAmount: 0` under the current fee\n * model) and `slippageBps` is applied to the non-exact side.\n */\nexport async function quoteCowSwap(\n params: QuoteCowSwapParams,\n): Promise<SimulationResult<CowQuote>> {\n const {\n chainId,\n sellToken,\n buyToken,\n kind,\n amount,\n from,\n slippageBps,\n validForSeconds = DEFAULT_VALID_FOR_SECONDS,\n apiUrl,\n } = params\n\n try {\n assertSlippageBps(slippageBps)\n // Selling native ETH would need the eth-flow contract; buying it is fine —\n // orders use the buy-token sentinel and settle in native ETH.\n if (sellToken === zeroAddress) {\n throw new CowNativeTokenError()\n }\n const resolvedBuyToken = buyToken === zeroAddress ? COW_NATIVE_ETH : buyToken\n if (amount <= 0n) {\n throw new PanopticError(`amount ${amount} must be positive`)\n }\n\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n const response = await cowApiRequest<CowQuoteResponse>(baseUrl, '/quote', {\n method: 'POST',\n body: JSON.stringify({\n sellToken,\n buyToken: resolvedBuyToken,\n from,\n receiver: from,\n validFor: Number(validForSeconds),\n appData: APP_DATA_DOC,\n partiallyFillable: false,\n sellTokenBalance: 'erc20',\n buyTokenBalance: 'erc20',\n signingScheme: 'eip712',\n ...(kind === 'sell'\n ? { kind: 'sell', sellAmountBeforeFee: amount.toString() }\n : { kind: 'buy', buyAmountAfterFee: amount.toString() }),\n }),\n })\n\n const sellAmount = BigInt(response.quote.sellAmount)\n const buyAmount = BigInt(response.quote.buyAmount)\n const feeAmount = BigInt(response.quote.feeAmount)\n const sellAmountTotal = sellAmount + feeAmount\n\n // Fold the fee into the signed sell amount (feeAmount signs as 0), then\n // apply slippage to the side the user did not fix. Buy-order sell cap uses\n // ceiling division so the buffer never rounds down.\n const orderSellAmount =\n kind === 'sell'\n ? sellAmountTotal\n : (sellAmountTotal * (BPS_DENOMINATOR + slippageBps) + BPS_DENOMINATOR - 1n) /\n BPS_DENOMINATOR\n const orderBuyAmount =\n kind === 'sell' ? (buyAmount * (BPS_DENOMINATOR - slippageBps)) / BPS_DENOMINATOR : buyAmount\n\n return {\n success: true,\n data: {\n kind,\n sellToken,\n // The signed order must carry the resolved (sentinel) buy token.\n buyToken: resolvedBuyToken,\n sellAmount,\n buyAmount,\n feeAmount,\n sellAmountTotal,\n orderSellAmount,\n orderBuyAmount,\n validTo: BigInt(response.quote.validTo),\n quoteId: response.id,\n },\n gasEstimate: 0n,\n _meta: OFFCHAIN_META,\n }\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof PanopticError\n ? error\n : new PanopticError(\n error instanceof Error ? error.message : 'CoW quote failed',\n error instanceof Error ? error : undefined,\n ),\n _meta: OFFCHAIN_META,\n }\n }\n}\n","/**\n * Poll order state from the CoW order book.\n * @module cow/status\n */\n\nimport type { Hex } from 'viem'\n\nimport { cowApiRequest, resolveCowApiUrl } from './api'\nimport type { CowOrderState, CowOrderStatus, GetCowOrderStatusParams } from './types'\n\n/** Raw `GET /orders/{uid}` fields we consume. */\ninterface CowOrderResponse {\n status: CowOrderStatus\n executedSellAmount: string\n executedBuyAmount: string\n}\n\n/** Raw `GET /trades` entry fields we consume. */\ninterface CowTradeResponse {\n txHash: Hex | null\n}\n\n/**\n * Fetch an order's lifecycle state. Once any trade has executed, the\n * settlement tx hash is included (fetched from the trades endpoint).\n */\nexport async function getCowOrderStatus(params: GetCowOrderStatusParams): Promise<CowOrderState> {\n const { chainId, orderUid, apiUrl } = params\n const baseUrl = resolveCowApiUrl(chainId, apiUrl)\n\n const order = await cowApiRequest<CowOrderResponse>(baseUrl, `/orders/${orderUid}`)\n\n const executedSellAmount = BigInt(order.executedSellAmount ?? '0')\n const executedBuyAmount = BigInt(order.executedBuyAmount ?? '0')\n\n let settlementTxHash: Hex | undefined\n if (executedBuyAmount > 0n) {\n const trades = await cowApiRequest<CowTradeResponse[]>(baseUrl, `/trades?orderUid=${orderUid}`)\n settlementTxHash = trades.find((t) => t.txHash)?.txHash ?? undefined\n }\n\n return { status: order.status, executedSellAmount, executedBuyAmount, settlementTxHash }\n}\n","/**\n * Resolve token symbols to addresses using the token lists CoW Swap trades\n * from. Lets a UI route any listed token (e.g. xStocks like NVDAx) to the\n * order book without maintaining a static registry.\n *\n * Sources, in priority order:\n * 1. CoW's curated list (canonical entries for blue-chip symbols like UNI)\n * 2. CoinGecko's full per-chain list (carries the long tail, incl. xStocks)\n *\n * Lists are fetched lazily and cached in-module for an hour.\n *\n * @module cow/tokens\n */\n\nimport { type Address, getAddress } from 'viem'\n\n/** Resolved token-list entry. */\nexport interface CowTokenInfo {\n chainId: number\n address: Address\n symbol: string\n name: string\n decimals: number\n logoURI?: string\n}\n\n/** Parameters for {@link findCowToken}. */\nexport interface FindCowTokenParams {\n /** Chain to resolve on. */\n chainId: bigint\n /** Token symbol, case-insensitive (e.g. 'nvdax'). */\n symbol: string\n /** Override the token-list URLs (e.g. tests). */\n listUrls?: string[]\n}\n\n/** CoinGecko per-chain list slugs for the chains CoW supports here. */\nconst COINGECKO_CHAIN_SLUGS: Partial<Record<number, string>> = {\n 1: 'ethereum',\n}\n\nfunction tokenListUrls(chainId: number): string[] {\n const urls = ['https://files.cow.fi/tokens/CowSwap.json']\n const slug = COINGECKO_CHAIN_SLUGS[chainId]\n if (slug) urls.push(`https://tokens.coingecko.com/${slug}/all.json`)\n return urls\n}\n\ninterface RawTokenList {\n tokens: {\n chainId?: number\n address: string\n symbol: string\n name: string\n decimals: number\n logoURI?: string\n }[]\n}\n\nconst LIST_CACHE_TTL_MS = 3_600_000\nconst listCache = new Map<string, { fetchedAt: number; list: Promise<RawTokenList | null> }>()\n\n/** Fetch a token list with an in-module 1h cache; resolves null on any failure. */\nfunction fetchTokenList(url: string): Promise<RawTokenList | null> {\n const cached = listCache.get(url)\n if (cached && Date.now() - cached.fetchedAt < LIST_CACHE_TTL_MS) return cached.list\n\n const list = fetch(url)\n .then((res) => (res.ok ? (res.json() as Promise<RawTokenList>) : null))\n .catch(() => null)\n .then((parsed) => {\n // Drop failures from the cache so the next call retries.\n if (parsed === null || !Array.isArray(parsed.tokens)) {\n listCache.delete(url)\n return null\n }\n return parsed\n })\n listCache.set(url, { fetchedAt: Date.now(), list })\n return list\n}\n\n/**\n * Find a token by symbol on the given chain across CoW's token lists. The\n * first list containing a (case-insensitive) symbol match wins; within a\n * list the first match wins, which favors canonical entries on collisions.\n * Returns null when no list resolves the symbol (or all fetches fail).\n *\n * Resolution only proves the token is listed — whether solvers can actually\n * fill a given pair/size is answered by `quoteCowSwap`.\n */\nexport async function findCowToken(params: FindCowTokenParams): Promise<CowTokenInfo | null> {\n const { chainId, symbol, listUrls } = params\n const chain = Number(chainId)\n const wanted = symbol.toUpperCase()\n\n for (const url of listUrls ?? tokenListUrls(chain)) {\n const list = await fetchTokenList(url)\n if (!list) continue\n const match = list.tokens.find(\n // CoW's own list omits chainId on some entries (single-chain lists).\n (t) => (t.chainId === undefined || t.chainId === chain) && t.symbol.toUpperCase() === wanted,\n )\n if (match) {\n // Validate/checksum the external address; skip a malformed entry rather\n // than leak a non-Address string to callers.\n let address: Address\n try {\n address = getAddress(match.address)\n } catch {\n continue\n }\n return {\n chainId: chain,\n address,\n symbol: match.symbol,\n name: match.name,\n decimals: match.decimals,\n logoURI: match.logoURI,\n }\n }\n }\n return null\n}\n","/**\n * Generated registry of Backed xStock ERC4626 wrappers on Ethereum mainnet.\n *\n * DO NOT EDIT BY HAND. Regenerate with `pnpm --filter panoptic-v2-sdk gen:xstock-wrappers`\n * (scripts/gen-xstock-wrappers.ts), which scans the WrappedBackedTokenFactory\n * `NewToken` events and reads each wrapper's ERC4626 `asset()` as the underlying.\n *\n * @module cow/xstockWrappers.generated\n */\n\nimport type { XstockWrapperRegistry } from './xstockWrappers'\n\nexport const XSTOCK_WRAPPERS: XstockWrapperRegistry = {\n 1: [\n {\n wrapper: '0x5AA7649fdbDa47De64A07aC81D64B682AF9C0724',\n underlying: '0x9d275685dC284C8eB1C79f6ABA7a63Dc75ec890a',\n symbol: 'wAAPLx',\n name: 'Wrapped Apple xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5CC079963Fb70C0f987F65F539E3B61a6EBdf6Db',\n underlying: '0xfBF2398dF672cEE4aFcC2A4A733222331c742a6A',\n symbol: 'wABBVx',\n name: 'Wrapped AbbVie xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD812B37181Ae89801e4BB3F49E4C1FAF11fC0b57',\n underlying: '0x89233399708C18Ac6887F90A2B4Cd8Ba5fEdD06e',\n symbol: 'wABTx',\n name: 'Wrapped Abbott xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc262Bea18cb810Cc7715EE48fe3cbD3D79B4aFe1',\n underlying: '0x03183Ce31b1656B72A55fa6056e287f50C35BbEB',\n symbol: 'wACNx',\n name: 'Wrapped Accenture xStock',\n decimals: 18,\n },\n {\n wrapper: '0x444DE06b76C9a1417A21A877038F49A1f0D8A1cD',\n underlying: '0x16E0B579be45bAaE54cEddd52e742B6457A7fE12',\n symbol: 'wADBEx',\n name: 'Wrapped Adobe xStock',\n decimals: 18,\n },\n {\n wrapper: '0x36d2fe6e6e4136C6BF286588391FAD6d45422350',\n underlying: '0x2f9a35aB5dDFBc49927BFdEab98A86c53DC6E763',\n symbol: 'wAMBRx',\n name: 'Wrapped Amber xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1eb8909B5C46A24F005A76C469912f5518F448eF',\n underlying: '0x3522513E5F146a2006e2901b05f16B2821485E19',\n symbol: 'wAMDx',\n name: 'Wrapped AMD xStock',\n decimals: 18,\n },\n {\n wrapper: '0xac85d37acbadCa37545E21ab0fB991bcE8c1187C',\n underlying: '0x3557Ba345B01EFa20A1bdDC61F573BFD87195081',\n symbol: 'wAMZNx',\n name: 'Wrapped Amazon.com xStock',\n decimals: 18,\n },\n {\n wrapper: '0xd17E483364D849e3B3A52464bb2CA56626EDfc31',\n underlying: '0x50a1291F69D9d3853Def8209cFb1AF0b46927BE1',\n symbol: 'wAPPx',\n name: 'Wrapped AppLovin xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD0798d3c30F4408350C8448d75DA1c7721227dBa',\n underlying: '0xC0B417e7F83db438631Eb5E096684dd742E5294F',\n symbol: 'wASMLx',\n name: 'Wrapped ASML xStock',\n decimals: 18,\n },\n {\n wrapper: '0x720347faf9D745B841541De0d7B2abc8A4b87531',\n underlying: '0x89b2607878ae19baB8020b8140eD550Ef3E953bb',\n symbol: 'wASTSx',\n name: 'Wrapped AST SpaceMobile xStock',\n decimals: 18,\n },\n {\n wrapper: '0x8DEb752aAA807E0258afd5cCFFe2b5A804026f28',\n underlying: '0x38BAC69cbBd28156796e4163B2B6dcb81E336565',\n symbol: 'wAVGOx',\n name: 'Wrapped Broadcom xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0b306951161b856Ad02c8566B4eF184c6BB08564',\n underlying: '0xb23767492D0Ca6dC7221CBeA45689a0410f388c4',\n symbol: 'wAXPx',\n name: 'Wrapped American Express xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB908FEAeab7E671dB697d77c3acFD8859E92a4e2',\n underlying: '0x5D642505FE1a28897eb3BaBA665F454755D8daA2',\n symbol: 'wAZNx',\n name: 'Wrapped AstraZeneca xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA2b1335256cd663Da89F650180508dd1f0DC3BAa',\n underlying: '0x314938c596F5ce31C3f75307d2979338C346D7F2',\n symbol: 'wBACx',\n name: 'Wrapped Bank of America xStock',\n decimals: 18,\n },\n {\n wrapper: '0xDEc933e2392AD908263e70A386fbF34e703Ffe8F',\n underlying: '0xbbcb0356bB9e6B3Faa5CbF9E5F36185d53403Ac9',\n symbol: 'wbCOIN',\n name: 'Wrapped Backed Coinbase Global',\n decimals: 18,\n },\n {\n wrapper: '0x277f724d12DD0249b48CBD7eB2623c5e5042b970',\n underlying: '0xa8A25DB6Cf17Fa097f1DBbc9c841892456898fF3',\n symbol: 'wBKNGx',\n name: 'Wrapped Booking xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE5365A5A16A7D1DD37b33e6F8D78aeB89847398B',\n underlying: '0x5A6a0742cA689E7E8a91A38F5255589CB2191646',\n symbol: 'wBLKx',\n name: 'Wrapped BlackRock xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7a1d054e09eAe0294D53959674EE9DE14a1f70B1',\n underlying: '0x38DE7b9FC733DeF81525E65C1Bf99722026489e2',\n symbol: 'wBLSHx',\n name: 'Wrapped Bullish xStock',\n decimals: 18,\n },\n {\n wrapper: '0xBFd29b7F395d30932033c2F45ab792024E71AA94',\n underlying: '0xaeB681B69E5094E04d11BCeF51A71358A374C3ED',\n symbol: 'wBMNRx',\n name: 'Wrapped Bitmine xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1a4F71B0Ff3C22540887bcf83b50054a213c673d',\n underlying: '0xaC28C9178ACc8BA4A11A29E013a3A2627086e422',\n symbol: 'wbMSTR',\n name: 'Wrapped Backed MicroStrategy Inc',\n decimals: 18,\n },\n {\n wrapper: '0x7E8101A1C322D394b3961498c7D40d2DFA94C392',\n underlying: '0xA34C5e0AbE843E10461E2C9586Ea03E55Dbcc495',\n symbol: 'wbNVDA',\n name: 'Wrapped Backed NVIDIA Corp',\n decimals: 18,\n },\n {\n wrapper: '0xa150245f155778e749185C9446e9e59E406674eF',\n underlying: '0x12992613fDd35aBe95DEc5a4964331b1ee23B50d',\n symbol: 'wBRK.Bx',\n name: 'Wrapped Berkshire Hathaway xStock',\n decimals: 18,\n },\n {\n wrapper: '0x88E437dbebdDe3D75Ff7c0cb830F54dd834538f0',\n underlying: '0x22E1991e5f82736A2a990322a46aac0e95826c5B',\n symbol: 'wBTBTx',\n name: 'Wrapped Bit Digital xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1f82284C1658Ad71C576f7230E6C2DEE7901c1FA',\n underlying: '0x14A5f2872396802C3Cc8942A39Ab3E4118EE5038',\n symbol: 'wbTSLA',\n name: 'Wrapped Backed Tesla Inc',\n decimals: 18,\n },\n {\n wrapper: '0xdCE0CA61bC9F95b771e0764dc4C553288b7F2f13',\n underlying: '0xD0194F0f077968DA8ca59811e9407f54AE6c9432',\n symbol: 'wCLSKx',\n name: 'Wrapped CleanSpark xStock',\n decimals: 18,\n },\n {\n wrapper: '0xd1A01e3F9c7565e88b1CF2413ba0a0E671e57b33',\n underlying: '0xBC7170a1280Be28513B4e940C681537EB25e39f4',\n symbol: 'wCMCSAx',\n name: 'Wrapped Comcast xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3a98E79cDc7D8B2716A8696E25af028E429f11dA',\n underlying: '0x364f210f430eC2448Fc68A49203040F6124096F0',\n symbol: 'wCOINx',\n name: 'Wrapped Coinbase xStock',\n decimals: 18,\n },\n {\n wrapper: '0x89E2B6cA78DBee629544679780963b85Ba76fe2a',\n underlying: '0x51eD5b74A05F256DbD9Ebb4e4f68Bb41ba10160b',\n symbol: 'wCORZx',\n name: 'Wrapped Core Scientific xStock',\n decimals: 18,\n },\n {\n wrapper: '0xFa48FeE923600Fecaa7af0DfB4a66E3109Ad51bf',\n underlying: '0x4720B5e6421e6879132aED52040d56Bb6e5CFeeF',\n symbol: 'wCOSTx',\n name: 'Wrapped Costco xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA90872ACa656eBE47bDEBF3B19Ec9Dd9C5ADC7f8',\n underlying: '0xfEbDEd1B0986a8ee107f5AB1a1c5a813491DeCEB',\n symbol: 'wCRCLx',\n name: 'Wrapped Circle xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc6B6B8D50A6673C04C495e30B411da5A7adF39f5',\n underlying: '0x4A4073f2EAF299A1be22254DCD2C41727F6F54a2',\n symbol: 'wCRMx',\n name: 'Wrapped Salesforce xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD71a6aDBc40c2674591CDB11B8C7ae03A880b06E',\n underlying: '0x214151022C2a5E380aB80CdaC31f23Ae554a7345',\n symbol: 'wCRWDx',\n name: 'Wrapped CrowdStrike xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCFa485bc42c2492917351F89F5cf5c7b2C5a66aa',\n underlying: '0x053C784cD87B74f42e0c089f98643E79c1A3ff16',\n symbol: 'wCSCOx',\n name: 'Wrapped Cisco xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7F88888b7A81546a036554Aa67a289Ea428b20d4',\n underlying: '0xad5cdc3340904285B8159089974A99a1A09EB4C0',\n symbol: 'wCVXx',\n name: 'Wrapped Chevron xStock',\n decimals: 18,\n },\n {\n wrapper: '0xce41bF7482E86fFF0Ab0A971dD425496BB58E4FD',\n underlying: '0x521860bB5dF5468358875266B89BFE90d990C6e7',\n symbol: 'wDFDVx',\n name: 'Wrapped DFDV xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6c7AD1886a6Da37766fED060d5F08fF43285DcdD',\n underlying: '0xdbA228936F4079DaF9Aa906fd48a87f2300405F4',\n symbol: 'wDHRx',\n name: 'Wrapped Danaher xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3E5ceeA6D6399Ac1a1FEE67C1644fc7F616aD9fD',\n underlying: '0x03D44b9bB0398E2Be3C89417D51E615C3D461F5a',\n symbol: 'wDUOLx',\n name: 'Wrapped Duolingo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0c4F0256FB31cC71666Fee3f0cE1De3B1abE347B',\n underlying: '0x4c7610990cb63cdca174ce61822F7693B49FCe93',\n symbol: 'wEBAYx',\n name: 'Wrapped eBay xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5230C4b621bd2d1f22933903F9a4fA82a9F17fcf',\n underlying: '0xd1be5bA0c293997C7F69da707D14EB4ABCB13ddD',\n symbol: 'wEXPEx',\n name: 'Wrapped Expedia xStock',\n decimals: 18,\n },\n {\n wrapper: '0x91049e9586301c54B2eF410C2b7e9040Ffb02182',\n underlying: '0x3C313D234D0C6C876F6c21ba2EC1F26823247Be2',\n symbol: 'wFIGx',\n name: 'Wrapped Figma xStock',\n decimals: 18,\n },\n {\n wrapper: '0xdeAE051463CD8C457e7e9D97A398c575E8629c18',\n underlying: '0x3AE27479E6e52f6ddB6EA8AA567e6Cc92C78d93a',\n symbol: 'wFUFUx',\n name: 'Wrapped BitFuFu xStock',\n decimals: 18,\n },\n {\n wrapper: '0x61532Ce3f1DF7fBf5fFb7B891d184226e85B37c6',\n underlying: '0x2380F2673C640fB67E2d6B55B44C62F0E0e69DA9',\n symbol: 'wGLDx',\n name: 'Wrapped Gold xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4c79D4A1a863830EF845431578FB40E31bD51f4A',\n underlying: '0xf7F4fAC56f012dE7Dd6adFF54C761986B9E0655a',\n symbol: 'wGLXYx',\n name: 'Wrapped Galaxy Digital xStock',\n decimals: 18,\n },\n {\n wrapper: '0xb2f6ED0ED3eEb22bEF7A648794FFC19b8aF3761C',\n underlying: '0xE5f6d3b2405ABdfE6F660e63202B25D23763160d',\n symbol: 'wGMEx',\n name: 'Wrapped Gamestop xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1630F08370917E79df0B7572395a5e907508bBBc',\n underlying: '0xe92f673Ca36C5E2Efd2DE7628f815f84807e803F',\n symbol: 'wGOOGLx',\n name: 'Wrapped Alphabet xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6eEd78e2780d82BE4E37d9937C27Bcf32C8DA072',\n underlying: '0x3Ee7E9B3A992fD23CD1C363B0e296856B04ab149',\n symbol: 'wGSx',\n name: 'Wrapped Goldman Sachs xStock',\n decimals: 18,\n },\n {\n wrapper: '0xC641E2eBF6E076e2AE53477C2E725b3c67C0fd94',\n underlying: '0x766b0CD6ED6D90B5d49d2c36a3761E9728501BA9',\n symbol: 'wHDx',\n name: 'Wrapped Home Depot xStock',\n decimals: 18,\n },\n {\n wrapper: '0xBd1B73b2E89967e83507B500D798998200A53380',\n underlying: '0x62a48560861B0b451654bFffdb5be6E47aa8ff1B',\n symbol: 'wHONx',\n name: 'Wrapped Honeywell xStock',\n decimals: 18,\n },\n {\n wrapper: '0x953707d7A1cB30cc5C636bDA8EaeBe410341eB14',\n underlying: '0xE1385FDd5ffB10081Cd52C56584F25EFa9084015',\n symbol: 'wHOODx',\n name: 'Wrapped Robinhood xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6Ec2763859C5b04F5598017880744081aFeFa3Bb',\n underlying: '0xd457b379801433EA5c3A8542b61902023AE39DcD',\n symbol: 'wHSDTx',\n name: 'Wrapped Helius Medical Technologies xStock',\n decimals: 18,\n },\n {\n wrapper: '0x154f25Cfd146d2DF6420ec1f575C3c46D45f4Db7',\n underlying: '0x560deb3D70Ac90064fF809349cDf9A771a06fd36',\n symbol: 'wHUTx',\n name: 'Wrapped Hut 8 xStock',\n decimals: 18,\n },\n {\n wrapper: '0xa8F31436FFE4E71f51B2D65b7D5a5c457AE2000f',\n underlying: '0xd9913208647671Fe0F48F7F260076B2C6F310Aac',\n symbol: 'wIBMx',\n name: 'Wrapped International Business Machines xStock',\n decimals: 18,\n },\n {\n wrapper: '0x59361E881b186e48D71EC61E969dCF50a4dbC75b',\n underlying: '0x6a668332825450ACD2e449372057d31b3de16a1E',\n symbol: 'wIEMGx',\n name: 'Wrapped Core MSCI Emerging Markets xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3ab20fd7c57146AF128E8565261CBdaDa0F015E6',\n underlying: '0xAA28cB97D7f7E172f54deE950743886D2d65447d',\n symbol: 'wIJRx',\n name: 'Wrapped S&P Small Cap xStock',\n decimals: 18,\n },\n {\n wrapper: '0x6A2a68Ca7FC793D8CEa36326a6Ec1eF7AC3D9742',\n underlying: '0xf8A80D1cb9cFD70D03D655D9dF42339846F3B3C8',\n symbol: 'wINTCx',\n name: 'Wrapped Intel xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5A47DE111D731Fd2Df90E4A2d7a9b459b31Bd643',\n underlying: '0xdadfb355c6110eda0908740d52c834d6C2BCDDc7',\n symbol: 'wIWMx',\n name: 'Wrapped Russell 2000 xStock',\n decimals: 18,\n },\n {\n wrapper: '0xcdB53A7cBa9Ec6d55dfE8f58bd6772826722D7BD',\n underlying: '0xdb0482cfaD4789798623E64b15eebA01b16e917C',\n symbol: 'wJNJx',\n name: 'Wrapped Johnson & Johnson xStock',\n decimals: 18,\n },\n {\n wrapper: '0xaB635f839f81A12dC8Db8Ab31006af14E26292fE',\n underlying: '0xD9FC3E075d45254a1D834fEa18AF8041207DeA0A',\n symbol: 'wJPMx',\n name: 'Wrapped JPMorgan Chase xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9a2486fbe7bC17C9100be65c31aBE7c9Bf84C23c',\n underlying: '0xdCC1a2699441079dA889B1F49e12B69cC791129b',\n symbol: 'wKOx',\n name: 'Wrapped Coca-Cola xStock',\n decimals: 18,\n },\n {\n wrapper: '0x316fFEa434348c2cB72024e62Ae845770315351E',\n underlying: '0x15059c599C16Fd8f70B633Ade165502D6402CD49',\n symbol: 'wLINx',\n name: 'Wrapped Linde xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3644971A7E971f60e707F7E8716cCaC5a0461290',\n underlying: '0x19c41EA77b34BbDEe61c3A87A75D1ABDA2ED0be4',\n symbol: 'wLLYx',\n name: 'Wrapped Eli Lilly xStock',\n decimals: 18,\n },\n {\n wrapper: '0xD395C4dAd12eb071714d2b86cB5bC16acE9996B6',\n underlying: '0x847dEB9c78fb00319bC7A006dFF729c11428E537',\n symbol: 'wLULUx',\n name: 'Wrapped lululemon xStock',\n decimals: 18,\n },\n {\n wrapper: '0x34f5273693C880a9B2d9B6cfc8e13A2f3B8C0F06',\n underlying: '0x9D692bffEf6f6BedF4274053ff9998EFE3B2539E',\n symbol: 'wMARAx',\n name: 'Wrapped MARA xStock',\n decimals: 18,\n },\n {\n wrapper: '0x5b32624f352d2FC6cC70889967A143ba1814f82b',\n underlying: '0xb365Cd2588065F522D379AD19e903304f6B622C6',\n symbol: 'wMAx',\n name: 'Wrapped Mastercard xStock',\n decimals: 18,\n },\n {\n wrapper: '0x1717D8Be2Bcb27f4E8f36c817088Fa6a2c0b3B30',\n underlying: '0x80A77a372c1e12AcCdA84299492f404902E2DA67',\n symbol: 'wMCDx',\n name: \"Wrapped McDonald's xStock\",\n decimals: 18,\n },\n {\n wrapper: '0x02C1b10e5329c4502469396B2ce9f200E60b4a77',\n underlying: '0x0588e851ec0418d660BeE81230d6c678dAF21d46',\n symbol: 'wMDTx',\n name: 'Wrapped Medtronic xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4E41a262cAA93C6575d336E0a4eb79f3c67caa06',\n underlying: '0x96702be57Cd9777f835117a809C7124fe4ec989A',\n symbol: 'wMETAx',\n name: 'Wrapped Meta xStock',\n decimals: 18,\n },\n {\n wrapper: '0x61a6Cd11f658D1b418e1082b564678983b71Fb7F',\n underlying: '0x8499b26BBfC8c3830a37b92E47DF2d7cBc0154e9',\n symbol: 'wMNSTx',\n name: 'Wrapped Monster xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4728E48c2C201E32fe210AaB68A71E419FEAc74a',\n underlying: '0x17D8186Ed8F68059124190D147174D0f6697dc40',\n symbol: 'wMRKx',\n name: 'Wrapped Merck xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0d6fce45796D5c00689c0916b976645a0FF1F0cE',\n underlying: '0xeAAd46F4146Ded5a47B55AA7F6c48c191dEAEC88',\n symbol: 'wMRVLx',\n name: 'Wrapped Marvell xStock',\n decimals: 18,\n },\n {\n wrapper: '0x63Ad27614231767C8C489745B9145272De50D09b',\n underlying: '0x5621737f42dAE558b81269FcB9E9E70c19Aa6b35',\n symbol: 'wMSFTx',\n name: 'Wrapped Microsoft xStock',\n decimals: 18,\n },\n {\n wrapper: '0x266E5923F6118F8b340cA5a23AE7f71897361476',\n underlying: '0xAE2f842EF90C0d5213259Ab82639D5BBF649b08E',\n symbol: 'wMSTRx',\n name: 'Wrapped MicroStrategy xStock',\n decimals: 18,\n },\n {\n wrapper: '0x529E286229963bE57F0EC6F57d2D70A2F3E29935',\n underlying: '0xf6a873BAe4Ba1B304e45dF52A4b7D176E1C6a8c4',\n symbol: 'wMUx',\n name: 'Wrapped Micron Technology xStock',\n decimals: 18,\n },\n {\n wrapper: '0xfE0D2545f9E7f3678CB35Ed3CDf70488C5570D11',\n underlying: '0xA6a65AC27E76cD53cB790473E4345c46e5eBf961',\n symbol: 'wNFLXx',\n name: 'Wrapped Netflix xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93E62845C1DD5822EbC807ab71A5Fb750DecD15A',\n underlying: '0xc845b2894dBddd03858fd2D643B4eF725fE0849d',\n symbol: 'wNVDAx',\n name: 'Wrapped NVIDIA xStock',\n decimals: 18,\n },\n {\n wrapper: '0x16E443AEbc83E2089AA90431A1C0d311854EEC69',\n underlying: '0xF9523E369c5f55ad72DbAA75B0a9b92B3D8b147e',\n symbol: 'wNVOx',\n name: 'Wrapped Novo Nordisk xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9608a6eB064dd1C35eC9A4332bD9F8b05D1dE66C',\n underlying: '0x4b0eE7C047D43cA403239f28f42115bEdB7c0076',\n symbol: 'wOKLOx',\n name: 'Wrapped Oklo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9836479c80823f5f8B60FD0171F8D96301185714',\n underlying: '0xbEe6b69345F376598Fe16AbD5592c6F844825E66',\n symbol: 'wOPENx',\n name: 'Wrapped OPEN xStock',\n decimals: 18,\n },\n {\n wrapper: '0x54f34Ceb15313Caaee838F77c1c3C2Fe2E94526A',\n underlying: '0x548308E91ec9F285C7bFf05295baDBD56a6e4971',\n symbol: 'wORCLx',\n name: 'Wrapped Oracle xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7FbE0E7ACB47DCb053BF6146cCA6Bfb81A5D1319',\n underlying: '0xe12BB32D77BE4DB10DDC82088b230D35d097E9C5',\n symbol: 'wPANWx',\n name: 'Wrapped Palo Alto Networks xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA00A5538708b5aca7045F2ca15104707965bac94',\n underlying: '0x36c424a6EC0e264b1616102Ad63eD2aD7857413e',\n symbol: 'wPEPx',\n name: 'Wrapped PepsiCo xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4E6894c3481B3A45393ce8ac9552945Ad50A3758',\n underlying: '0x1Ac765B5BEa23184802C7d2d497f7c33f1444A9e',\n symbol: 'wPFEx',\n name: 'Wrapped Pfizer xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0afC19943fA98E9E9E90Fc4ab4d4D3c13E162232',\n underlying: '0xa90424D5D3E770e8644103AB503ed775dD1318FD',\n symbol: 'wPGx',\n name: 'Wrapped Procter & Gamble xStock',\n decimals: 18,\n },\n {\n wrapper: '0xa3B6Fe1a923585bb828fCFAa460B78EeFD5aE2EC',\n underlying: '0x6d482CeC5f9dd1f05CCee9Fd3ff79B246170F8e2',\n symbol: 'wPLTRx',\n name: 'Wrapped Palantir xStock',\n decimals: 18,\n },\n {\n wrapper: '0xF429759BBf687118efd6B3713303006C356b8765',\n underlying: '0x536825370F1159cBA953055f5c2F16DDc7B5a348',\n symbol: 'wPLx',\n name: 'Wrapped Planet Labs xStock',\n decimals: 18,\n },\n {\n wrapper: '0x7C2e00e6b0d519a8C492d20c2524342A4398FF34',\n underlying: '0x02a6c1789c3B4FDb1a7a3DfA39F90e5d3c94F4F9',\n symbol: 'wPMx',\n name: 'Wrapped Philip Morris xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCf4953c617CD1306A1f9236084204fBc67FDA2Ac',\n underlying: '0xf706585e7e8900bE0267bEE3B9A2F70835EC6628',\n symbol: 'wPYPLx',\n name: 'Wrapped PayPal xStock',\n decimals: 18,\n },\n {\n wrapper: '0xdbD9232fee15351068Fe02F0683146e16D9f2cEa',\n underlying: '0xa753A7395cAe905Cd615Da0B82A53E0560f250af',\n symbol: 'wQQQx',\n name: 'Wrapped Nasdaq xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc1de0BA489E6a5df9ebbA3911e382b455DeDF8c3',\n underlying: '0x5d8dA1417E3565eb02C9ca8cC588bE5D8F65b1c5',\n symbol: 'wRBLXx',\n name: 'Wrapped Roblox xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE99c177Bcb254bE2A0333c3B7071c696400Df1cF',\n underlying: '0x6Ac47387f0a2798dF4C4eE5bb31ab9517ac97cb8',\n symbol: 'wRIOTx',\n name: 'Wrapped Riot Platforms xStock',\n decimals: 18,\n },\n {\n wrapper: '0xf3f249dBaA9E3e9C9B78b1784cECd954e829aC81',\n underlying: '0xE17ce7dD2afb6Da3488fD9ef2558523D569e17B4',\n symbol: 'wRKLBx',\n name: 'Wrapped Rocket Lab xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4329d7C2Fa1De1c7218cd0c68587e2225C8C53fB',\n underlying: '0x7c7445A40926152B8d24aBDb9020e219d3D3380a',\n symbol: 'wSATAx',\n name: 'Wrapped Strive, Inc. Series A Preferred xStock',\n decimals: 18,\n },\n {\n wrapper: '0x9Fd163B1020535C24A3140DB9BB1153E6dEf8fCd',\n underlying: '0x338791c58fdED314b81EAb139A1A2Fb7967D90d6',\n symbol: 'wSBETx',\n name: 'Wrapped SharpLink Gaming xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB9FCE7dcDfa1962EB53B3e2000554A77F0c10E8b',\n underlying: '0xF6D87E523512704C29E9b7cA3e9e6226bDCE3EA1',\n symbol: 'wSCHFx',\n name: 'Wrapped Schwab International Equity xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93bd84EE978b60f37df0639f70EAC621e542AD4b',\n underlying: '0x4833e7f4f0460f4B72A3a5879A6C9841bCC5B58B',\n symbol: 'wSLVx',\n name: 'Wrapped iShares Silver Trust xStock',\n decimals: 18,\n },\n {\n wrapper: '0x382567e5D72eca3eD2Bb97a4e42918107E09fab0',\n underlying: '0x7F8ba411ECBC0A135d669d5EaE5D15b0Ca0b0ea1',\n symbol: 'wSPCEx',\n name: 'Wrapped Virgin Galactic xStock',\n decimals: 18,\n },\n {\n wrapper: '0x8e2eeD8b8B5E13Ea7BF38e50d7821d2C57309072',\n underlying: '0x68fa48B1C2FE52b3D776E1953e0E782b5044Ce28',\n symbol: 'wSPCXx',\n name: 'Wrapped SpaceX xStock',\n decimals: 18,\n },\n {\n wrapper: '0x2f5a59Dd87C57fBfA10a5Ab12fD902C8AFdA2dfD',\n underlying: '0xD3c5Af6B2F0F754b2141f368cFc5ea99C3594d3a',\n symbol: 'wSPGIx',\n name: 'Wrapped S&P Global xStock',\n decimals: 18,\n },\n {\n wrapper: '0xc88FcD8B874fDb3256E8B55b3decB8c24EAb4c02',\n underlying: '0x90A2a4c76b5D8c0bc892A69EA28Aa775a8f2dD48',\n symbol: 'wSPYx',\n name: 'Wrapped SP500 xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0B2456017C5Df2dFc0289740C4b352049892780C',\n underlying: '0x1Aad217B8F78dbA5E6693460e8470F8b1A3977f3',\n symbol: 'wSTRCx',\n name: 'Wrapped Strategy PP Variable xStock',\n decimals: 18,\n },\n {\n wrapper: '0xB038B3b1f999897035AD4Ea65A9d6F59E2e86588',\n underlying: '0x38E0445308E7FcD5230F2DF6b52B36DD4FF313b6',\n symbol: 'wSTRKx',\n name: 'Wrapped Strategy PP Fixed xStock',\n decimals: 18,\n },\n {\n wrapper: '0xCd932bF1c895B7143ec34Df5Ae7889D3853904D8',\n underlying: '0x4cbf89ED7Bb30b8a860fa86d3c96E9c72931299b',\n symbol: 'wTBLLx',\n name: 'Wrapped TBLL xStock',\n decimals: 18,\n },\n {\n wrapper: '0xfa4fFDbf6D53E1539B03823D72886Ab9510250E7',\n underlying: '0x61AeE4f4e6B62806c26eafF921e7F41782cA2E03',\n symbol: 'wTEMx',\n name: 'Wrapped Tempus AI xStock',\n decimals: 18,\n },\n {\n wrapper: '0x0420112790C619Fbbd44106bC72ce217b515269A',\n underlying: '0xAB6a44AD34D083f463fa6F64d0619F11eB2cb48D',\n symbol: 'wTGTx',\n name: 'Wrapped Target xStock',\n decimals: 18,\n },\n {\n wrapper: '0x89EA0284308dEEF33a22abd7ea33888b4349108C',\n underlying: '0xAF072F109A2C173D822a4fe9af311A1B18F83d19',\n symbol: 'wTMOx',\n name: 'Wrapped Thermo Fisher xStock',\n decimals: 18,\n },\n {\n wrapper: '0xF940Fd9D8B80412C47691442075848cc05cD6732',\n underlying: '0x68F3DDEE8BAE33691E7CD0372984fD857E842760',\n symbol: 'wTMUSx',\n name: 'Wrapped T-Mobile xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4b12EB39418e30fC0e86E36CDac0545c1d9edAc9',\n underlying: '0xe95ab205e333443D7970336D5fD827eF9eD97608',\n symbol: 'wTONXx',\n name: 'Wrapped TON xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3D843414E617CBb9D2328c7eCF155d7C18139D6A',\n underlying: '0xfDDDb57878eF9D6f681Ec4381DCB626b9E69AC86',\n symbol: 'wTQQQx',\n name: 'Wrapped TQQQ xStock',\n decimals: 18,\n },\n {\n wrapper: '0x93730D679190e831caea5e4ce46a5701D555e0F2',\n underlying: '0xeCF59a3FD0224D33429920f8fa6dE493abc4EFC0',\n symbol: 'wTRONx',\n name: 'Wrapped Tron xStock',\n decimals: 18,\n },\n {\n wrapper: '0x43680aBF18cf54898Be84C6eF78237CFBD441883',\n underlying: '0x8aD3c73F833d3F9A523aB01476625F269aEB7Cf0',\n symbol: 'wTSLAx',\n name: 'Wrapped Tesla xStock',\n decimals: 18,\n },\n {\n wrapper: '0x083283FAfD9CEC6145ce6a4A50F020A01737De52',\n underlying: '0x9e3bf4Ecfc44EeDD624F26656B6736a3F093b073',\n symbol: 'wTSMx',\n name: 'Wrapped TSMC xStock',\n decimals: 18,\n },\n {\n wrapper: '0xb10F7AA3BC0ad9FcE5Fc99702C2022d47BA93827',\n underlying: '0x75639aE3A05079873D7189DcbDBc455898cAe904',\n symbol: 'wTx',\n name: 'Wrapped AT&T xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4BEa51f138A30329b8855bf0DaE85EA5644Ada82',\n underlying: '0xdb9783Ca04bBD64fe2c6d7B9503A979b3DE30729',\n symbol: 'wUBERx',\n name: 'Wrapped Uber xStock',\n decimals: 18,\n },\n {\n wrapper: '0xA0412CE46fE877b7f174B82aCD95E70063BbaF2a',\n underlying: '0x167A6375DA1eFc4a5BE0f470E73eCEfd66245048',\n symbol: 'wUNHx',\n name: 'Wrapped UnitedHealth xStock',\n decimals: 18,\n },\n {\n wrapper: '0x92DB84B2358E97976DAD16f91E6aeb9B2A757e76',\n underlying: '0x7AB6C97f65e4227adc5090Bd31a376D1F36f39fa',\n symbol: 'wVSTx',\n name: 'Wrapped Vistra xStock',\n decimals: 18,\n },\n {\n wrapper: '0xE9161F111c55Bdd67525C1d4F9bbca07750aaAb7',\n underlying: '0xbD730E618bcD88C82dDeE52e10275CF2f88A4777',\n symbol: 'wVTIx',\n name: 'Wrapped Vanguard xStock',\n decimals: 18,\n },\n {\n wrapper: '0x48Da55D8FE70A4E3ec421736369BACB8D62Fa089',\n underlying: '0x6d5edEEbBc6A4099Eb8bb289EB3b80D799f7b28C',\n symbol: 'wVTx',\n name: 'Wrapped Vanguard Total World xStock',\n decimals: 18,\n },\n {\n wrapper: '0x3cf193acf378Ec224a0209Be888b4b0B963E1896',\n underlying: '0x2363FD1235C1B6d3A5088DdF8dF3A0b3A30C5293',\n symbol: 'wVx',\n name: 'Wrapped Visa xStock',\n decimals: 18,\n },\n {\n wrapper: '0x4cA269239B760787bB2A54C055c383FD2DADE779',\n underlying: '0xc435b3C41AE56d9Bc57b8525F4d522C978F168e8',\n symbol: 'wWBDx',\n name: 'Wrapped Warner Bros. Discovery xStock',\n decimals: 18,\n },\n {\n wrapper: '0x97C4C1704111B7c2304B177C37858B7169c667f9',\n underlying: '0xfEEE18422F8F1cD6193C12aAfad7123DbfF15517',\n symbol: 'wWENx',\n name: \"Wrapped Wendy's xStock\",\n decimals: 18,\n },\n {\n wrapper: '0xa24D9c43D64c76aCD962003647FD43a85eb44Db8',\n underlying: '0x7AEfc9965699fBea943e03264d96e50CD4A97b21',\n symbol: 'wWMTx',\n name: 'Wrapped Walmart xStock',\n decimals: 18,\n },\n {\n wrapper: '0xf068165CFf011A56562F855b44CF690e371232C8',\n underlying: '0xC0c2150cf0870E2d7aBc7cDe17C20A542faFBB9B',\n symbol: 'wWULFx',\n name: 'Wrapped TeraWulf xStock',\n decimals: 18,\n },\n {\n wrapper: '0x448bC811F60eac772775dD53421380E8D4DC4338',\n underlying: '0xEEdb0273c5Af792745180e9fF568cD01550fFA13',\n symbol: 'wXOMx',\n name: 'Wrapped Exxon Mobil xStock',\n decimals: 18,\n },\n ],\n}\n","/**\n * Resolve xStocks (tokenized equities) to their Backed ERC4626 wrapper, and\n * back.\n *\n * xStocks are rebasing, so they can't be used directly in AMMs / Panoptic\n * pools — those are built on the non-rebasing **wrapped** version minted by the\n * Backed `WrappedBackedTokenFactory`. CoW Swap, by contrast, trades the\n * unwrapped xStock. A user who buys e.g. NVDAx on CoW therefore holds the\n * unwrapped token and must wrap it before lending it or selling it through the\n * Uniswap/Panoptic venue.\n *\n * The factory exposes no underlying→wrapper lookup and its `NewToken` event\n * omits the underlying, so this mapping is generated offline (see\n * `scripts/gen-xstock-wrappers.ts`) into {@link XSTOCK_WRAPPERS} and resolved\n * statically here — no runtime fetch.\n *\n * Each wrapper is a standard ERC4626 vault: `asset()` is the underlying xStock,\n * `deposit` wraps, `redeem` unwraps, and `convertToShares`/`convertToAssets`\n * (or `previewDeposit`/`previewRedeem`) convert amounts.\n *\n * @module cow/xstockWrappers\n */\n\nimport type { Address } from 'viem'\n\nimport { XSTOCK_WRAPPERS } from './xstockWrappers.generated'\n\nexport { XSTOCK_WRAPPERS }\n\n/** A single xStock → wrapper mapping entry. */\nexport interface XstockWrapperInfo {\n /** ERC4626 wrapper (the token Panoptic/Uniswap pools trade). */\n wrapper: Address\n /** Underlying rebasing xStock (`asset()` of the wrapper; the CoW-traded token). */\n underlying: Address\n /** Wrapper symbol, e.g. `wNVDAx`. */\n symbol: string\n /** Wrapper name, e.g. `Wrapped NVIDIA xStock`. */\n name: string\n /** Wrapper (and underlying) ERC20 decimals. */\n decimals: number\n}\n\n/** Generated registry keyed by chainId. */\nexport type XstockWrapperRegistry = Partial<Record<number, XstockWrapperInfo[]>>\n\n/**\n * Per-chain lookup indices, built lazily from the static registry. Keys are\n * lowercased addresses for case-insensitive matching. Caching static config is\n * safe (it carries no dynamic on-chain data).\n */\nconst indexCache = new Map<\n number,\n { byUnderlying: Map<string, XstockWrapperInfo>; byWrapper: Map<string, XstockWrapperInfo> }\n>()\n\nfunction getIndex(chainId: number) {\n let idx = indexCache.get(chainId)\n if (!idx) {\n const byUnderlying = new Map<string, XstockWrapperInfo>()\n const byWrapper = new Map<string, XstockWrapperInfo>()\n for (const entry of XSTOCK_WRAPPERS[chainId] ?? []) {\n byUnderlying.set(entry.underlying.toLowerCase(), entry)\n byWrapper.set(entry.wrapper.toLowerCase(), entry)\n }\n idx = { byUnderlying, byWrapper }\n indexCache.set(chainId, idx)\n }\n return idx\n}\n\n/**\n * Resolve the wrapper for an unwrapped xStock. Returns `undefined` when the\n * address isn't a known xStock underlying on this chain.\n */\nexport function getXstockWrapper(\n chainId: number,\n underlying: Address,\n): XstockWrapperInfo | undefined {\n return getIndex(chainId).byUnderlying.get(underlying.toLowerCase())\n}\n\n/**\n * Resolve the underlying xStock for a wrapper address. Returns `undefined` when\n * the address isn't a known xStock wrapper on this chain.\n */\nexport function getXstockUnderlying(\n chainId: number,\n wrapper: Address,\n): XstockWrapperInfo | undefined {\n return getIndex(chainId).byWrapper.get(wrapper.toLowerCase())\n}\n\n/** True if `address` is a known unwrapped xStock on this chain. */\nexport function isXstockUnderlying(chainId: number, address: Address): boolean {\n return getXstockWrapper(chainId, address) !== undefined\n}\n\n/** True if `address` is a known xStock wrapper on this chain. */\nexport function isXstockWrapper(chainId: number, address: Address): boolean {\n return getXstockUnderlying(chainId, address) !== undefined\n}\n"],"mappings":";;;;;AAYA,MAAaA,iBAA0B;;AAGvC,MAAaC,oBAA6B;;;;;;AAO1C,MAAaC,iBAA0B;;AAGvC,MAAaC,eAAgD;CAC3D,GAAG;CACH,UAAU;AACX;;AAGD,SAAgB,oBAAoBC,SAAmC;AACrE,QAAO,aAAa,OAAO,QAAQ;AACpC;;;;;ACjBD,eAAsB,iBAAiBC,QAA4D;CACjG,MAAM,EAAE,QAAQ,WAAW,OAAO,QAAQ,GAAG;CAE7C,MAAM,YAAY,MAAM,OAAO,aAAa;EAC1C,SAAS;EACT,KAAK;EACL,cAAc;EACd,MAAM,CAAC,OAAO,iBAAkB;CACjC,EAAC;AAEF,QAAO;EAAE,eAAe,YAAY;EAAQ;CAAW;AACxD;;AAGD,eAAsB,mBAAmBC,QAAqD;CAC5F,MAAM,EAAE,QAAQ,cAAc,SAAS,WAAW,SAAS,YAAY,aAAa,GAAG;AAEvF,QAAO,YAAY;EACjB;EACA;EACA;EACA,SAAS;EACT,KAAK;EACL,cAAc;EACd,MAAM,CAAC,mBAAmB,MAAO;EACjC;CACD,EAAC;AACH;;;;AC9BD,MAAMC,oBAAkB;;;;;;;AAmCxB,SAAgB,cAAcC,QAAwC;CACpE,MAAM,EAAE,MAAM,SAAS,KAAK,GAAG;CAE/B,MAAM,YAAY,SAAS,SAAS,SAAS,YAAY,SAAS;CAClE,MAAM,YAAY,SAAS,SAAS,KAAK,Y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SAAiBG,SAA2B;AAC1E,QAAO,oBAAoB,SAAS,QAAQ;AAC7C"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, getAccountCollateral, getCollateralData, getIrmCurrent, getIrmCurve, packMarketState, ratePerSecWadToAprPct, utilizationBpsToWad, utilizationPctToWad } from "./irm-y3T4tvfM.js";
2
- import { collateralTrackerV2Abi, getPoolMetadata$1 as getPoolMetadata, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, panopticQueryAbi$1 as panopticQueryAbi, riskEngineAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi } from "./position-Bo7y8jcj.js";
1
+ import { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD$1 as WAD, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, getAccountCollateral, getCollateralData, getIrmCurrent, getIrmCurve, packMarketState, ratePerSecWadToAprPct, utilizationBpsToWad, utilizationPctToWad } from "./irm-DF4NwYIY.js";
2
+ import { collateralTrackerV2Abi, getPoolMetadata$1 as getPoolMetadata, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, panopticQueryAbi, riskEngineAbi, semiFungiblePositionManagerV3Abi, semiFungiblePositionManagerV4Abi } from "./position-zqvENVuf.js";
3
3
  import { BaseError, ContractFunctionExecutionError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, keccak256, maxUint256, parseAbi, zeroAddress } from "viem";
4
4
  import { readContract, simulateContract, writeContract } from "viem/actions";
5
5
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
@@ -1,4 +1,4 @@
1
- import { MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, PanopticValidationError, collateralTrackerV2Abi, decodeLeftRightUnsigned, getBlockMeta, getPool$1 as getPool, getPositions, panopticPoolV2Abi, riskEngineAbi, tickToSqrtPriceX96$1 as tickToSqrtPriceX96 } from "./position-Bo7y8jcj.js";
1
+ import { MulticallNoDataError, MulticallResultFailedError, MulticallResultMissingError, PanopticValidationError, collateralTrackerV2Abi, decodeLeftRightUnsigned, getBlockMeta, getPool$1 as getPool, getPositions, panopticPoolV2Abi, riskEngineAbi, tickToSqrtPriceX96$1 as tickToSqrtPriceX96 } from "./position-zqvENVuf.js";
2
2
  import { decodeFunctionResult, encodeFunctionData } from "viem";
3
3
  import { call } from "viem/actions";
4
4
 
@@ -2332,5 +2332,5 @@ async function getIrmCurve(params) {
2332
2332
  }
2333
2333
 
2334
2334
  //#endregion
2335
- export { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatRateWad, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatWad, formatWadPercent, formatWadSigned, getAccountCollateral, getAccountSummaryBasic, getAccountSummaryRisk, getCollateralAddresses, getCollateralData, getCurrentRates, getInterestState, getIrmCurrent, getIrmCurve, getLiquidationPrices, getNetLiquidationValue, getNetLiquidationValues, isLiquidatable, packMarketState, panopticQueryAbi, parseTokenAmount, parseWad, ratePerSecWadToAprPct, readBlockAndAggregate, requireReturnData, utilizationBpsToWad, utilizationPctToWad };
2336
- //# sourceMappingURL=irm-y3T4tvfM.js.map
2335
+ export { BORROW_INDEX_BITS, BPS_SCALE, MARKET_EPOCH_BITS, MARKET_EPOCH_SHIFT, Multicall3Abi, RATE_AT_TARGET_BITS, SECONDS_PER_YEAR, UNREALIZED_INTEREST_BITS, WAD as WAD$1, annualizePerSecondRateWad, deriveSupplyRatePerSecWad, formatPerSecondRateWadAsAprPct, formatPerSecondRateWadAsApyPct, formatRateWad, formatTokenAmount, formatTokenAmountSigned, formatTokenDelta, formatTokenFlow, formatWad, formatWadPercent, formatWadSigned, getAccountCollateral, getAccountSummaryBasic, getAccountSummaryRisk, getCollateralAddresses, getCollateralData, getCurrentRates, getInterestState, getIrmCurrent, getIrmCurve, getLiquidationPrices, getNetLiquidationValue, getNetLiquidationValues, isLiquidatable, packMarketState, panopticQueryAbi as panopticQueryAbi$1, parseTokenAmount, parseWad, ratePerSecWadToAprPct, readBlockAndAggregate, requireReturnData, utilizationBpsToWad, utilizationPctToWad };
2336
+ //# sourceMappingURL=irm-DF4NwYIY.js.map