Types
Shared types across the TypeScript SDK. Import value types from propamm/router / propamm/client / propamm/overrides; primitives (Address, Hash, Account, Chain) re-export from the root.
SwapParams
Common parameters shared by every swap entrypoint.
interface SwapParams {
tokenIn: Address;
tokenOut: Address;
amountIn: bigint;
amountOutMin: bigint;
recipient: Address;
deadline: bigint;
}tokenIn— token being sold, orETH_SENTINELfor native ETH (attachesmsg.valueautomatically).tokenOut— token being bought;ETH_SENTINELdelivers native ETH.amountIn— exact input amount, in atomic units.amountOutMin— minimum acceptable output (net of the frontend fee, when one is passed); derive from a quote withapplySlippage.recipient— receiver oftokenOut.deadline— unix timestamp after which the swap is invalid; build withdeadlineIn.
Quote
Result of every quote method.
interface Quote {
amountOut: bigint;
venue: Address;
}amountOut— the quoted output amount, in atomic units.venue— the venue that produced the quote (or the Uniswap fallback router); pin it in a follow-upswapviaSwapOptions.venuesto execute against it.
SwapResult
Decoded outcome of a mined swap, from waitForSwap or swapAndWait.
interface SwapResult {
hash: Hash;
receipt: TransactionReceipt;
amountIn: bigint;
amountOut: bigint;
executedVenue: Address;
recipient: Address;
fee?: { recipient: Address; amount: bigint };
}hash/receipt— the transaction and its receipt.amountIn— input pulled from the sender (from theSwappedevent).amountOut— output delivered to the recipient, net of any fee.executedVenue— the venue that actually filled, or the Uniswap fallback router.recipient— who receivedtokenOut.fee— present when the swap charged a frontend fee (fromFrontendFeeCharged).
SwapOptions
Per-swap options, accepted by swap and swapAndWait.
interface SwapOptions {
venues?: readonly Address[];
frontendFee?: FrontendFee;
gasLimit?: bigint;
}venues— restrict the swap to these venues: a single entry executes through that venue directly, several re-quote on-chain and fill via the best of them. Must be non-empty when present; omit to swap through the best-quoting venue overall.frontendFee— skim a frontend fee from the output; routes the call through the contract'sWithFeeselector.gasLimit— explicit transaction gas limit, in gas units. Overrides the hardcoded per-function default (see swap); read the effective value withgasLimitFor.
FrontendFee
Frontend fee skimmed from a swap's output; pass via SwapOptions.frontendFee. Validated before the swap is sent.
interface FrontendFee {
bps: number;
recipient: Address;
}bps— fee in basis points of the output token, an integer in[1, MAX_FEE_BPS](MAX_FEE_BPS = 100, i.e. 1%).recipient— receives the fee intokenOut; must not be the zero address.
QuoteOptions
Per-call options accepted by quote.
interface QuoteOptions {
overrides?: OverridesSource | OverridesSnapshot | null;
bebopDefault?: boolean;
venues?: readonly Address[];
}overrides— replace the router's attached overrides source for this call: another source, a fixed snapshot, ornullto quote raw on-chain state.bebopDefault— setfalseto keep Bebop's raw on-chain slot instead of zeroing it when the snapshot has no Bebop entry (defaulttrue).venues— restrict the quote to these venues: a single entry quotes that venue directly, several pick the best among them. Must be non-empty when present.
CallParams
Parameters of ContractClient.call — an eth_call simulation with optional overrides.
interface CallParams {
address: Address;
abi: Abi;
functionName: string;
args?: unknown[];
value?: bigint;
stateOverride?: StateOverride;
blockNumber?: bigint;
blockTimestamp?: bigint;
}stateOverride— state overrides applied to the call (thirdeth_callparameter, viem format; seetoStateOverride).blockNumber/blockTimestamp— pin the simulatedblock.number/block.timestamp(block overrides, fourth parameter).
OverridesSnapshot
A parsed pAMM state-override payload, returned by every source's getOverrides().
interface OverridesSnapshot {
blockNumber?: bigint;
timestampNs?: bigint;
perPamm: Record<Address, Record<Address, Record<Hex, Hex>>>;
}blockNumber— block the overrides were generated against; quotes pin the simulation to it.timestampNs— generation time in nanoseconds since epoch; quotes pin the simulatedblock.timestampto it.perPamm— pAMM address → overridden contract → storage slot → value.
OverridesSource
The interface both override sources implement — implement it to plug in a custom source.
interface OverridesSource {
getOverrides(): Promise<OverridesSnapshot | undefined>;
close?(): void;
}PriceLevelsSnapshot
A parsed price-levels payload, returned by every source's getPriceLevels().
interface PriceLevelsSnapshot {
blockNumber?: bigint;
slot?: bigint;
timestampNs?: bigint;
pamms: PammPriceLevels[];
}blockNumber— block the levels were generated against.slot— beacon slot the levels were generated against.timestampNs— generation time in nanoseconds since epoch (approximate — JSON serialization loses sub-millisecond precision for large values).pamms— per-pAMM order books.
PammPriceLevels
One pAMM's price levels across all pairs it quotes.
interface PammPriceLevels {
pamm: Address;
pairs: PairPriceLevels[];
}PairPriceLevels
The order book a pAMM quotes for one tokenIn/tokenOut pair.
interface PairPriceLevels {
tokenIn: Address;
tokenOut: Address;
orderBook: PriceLevel[];
}PriceLevel
One rung of a pair's order book.
interface PriceLevel {
amountIn: bigint;
amountOut: bigint;
variant: "Simulated" | "Interpolated";
}amountIn/amountOut— amounts in atomic units.variant—"Simulated"means the rung came from an EVM simulation;"Interpolated"from a linear spline between simulated rungs.
TitanQuote
Result of getQuote / getQuoteVenue (titan_getPammQuote / titan_getPammQuoteVenue).
interface TitanQuote {
tokenIn: Address;
tokenOut: Address;
amountIn: bigint;
amountOut: bigint;
pamm: Address;
router: Address;
blockNumber?: bigint;
slot?: bigint;
timestampNs?: bigint;
}pamm— pAMM that produced the quote.router— router associated with the quote.
PriceLevelsSource
The interface both price-level sources implement — implement it to plug in a custom source.
interface PriceLevelsSource {
getPriceLevels(): Promise<PriceLevelsSnapshot | undefined>;
close?(): void;
}