/** * Helpers for ERC20-denominated listing fulfillment. * * When a listing is priced in an ERC20 token instead of the native currency, * `transaction.value` is `0` and Seaport pulls the payment from the buyer with * `transferFrom`. That only works if the buyer has already approved the spender, * so the fulfillment reverts with a bare "execution reverted" when they haven't. * These helpers read the payment token and amount out of the API's fulfillment * input data so the SDK can check the allowance before spending gas. */ /** A `bytes32(0)` conduit key means Seaport transfers directly, with no conduit. */ export declare const ZERO_CONDUIT_KEY: string; export type Erc20Payment = { /** Payment token contract address. */ token: string; /** Total amount the fulfiller owes, in the token's base units. */ amount: bigint; }; /** * Coerce a value an RPC adapter may return as a bigint, a decimal string, or a * number into a bigint. Returns null for anything else. */ export declare function toBigInt(value: unknown): bigint | null; /** * Read the ERC20 payment a fulfiller owes from the `inputData` of an OpenSea * fulfillment response. * * Returns null whenever the payment is not a single ERC20 amount we can read * with confidence, including native-priced listings and offer fulfillments. * Callers must treat null as "no preflight possible" and submit the transaction * unchanged, so an unfamiliar response shape can never block a working purchase. */ export declare function getErc20Payment(inputData: unknown): Erc20Payment | null; /** * Read the fulfiller's conduit key, which decides who the buyer must approve: * the resolved conduit for a non-zero key, or Seaport itself for `bytes32(0)`. * Returns null when the response does not carry one. */ export declare function getFulfillerConduitKey(inputData: unknown): string | null; /** Whether a conduit key means "transfer directly from Seaport, no conduit". */ export declare function isZeroConduitKey(conduitKey: string | null): boolean;