import type { FiatReadEndpoint } from '@funkit/api-base'; import type { PollSpec, Transition } from '@fun-xyz/fiat-contract/types'; export type SubmitTransition = Extract; export type AwaitTransition = Extract; export type SurfaceTransition = Extract; export interface TransitionDispatch { /** Every SUBMIT, in emitted order — the buttons a screen renders. */ ctas: SubmitTransition[]; /** At most one AWAIT; a second would mean two pollers on one state. */ poll?: AwaitTransition; /** At most one CLIENT_SURFACE; the surface owns the screen while it runs. */ surface?: SurfaceTransition; } /** * Splits `transitions[]` by mode so screens never inspect the array. * * Mode is the whole dispatch: SUBMIT is something the user does, AWAIT is * something the client waits for, CLIENT_SURFACE is something a provider runs. * A screen that filtered the array itself would be free to disagree with the * harness about which is which. * * Extra AWAIT or CLIENT_SURFACE entries are ignored rather than merged — the * first wins, deterministically, because running two pollers or mounting two * surfaces is worse than ignoring an emission the contract does not produce. */ export declare function selectTransitions(transitions: readonly Transition[]): TransitionDispatch; /** * Builds a poll's request endpoint, with its params as a query string. * * Polls are GETs, so their `params` cannot ride in a body — and the recorded * `GET /fiat/quotes/{ref}` poll carries one. Encoded here rather than in the * transport, which takes the endpoint whole and stays free of the contract. * * Returns the read type: a poll that arrived as anything but a GET is a * contract violation, and the transport would refuse it for want of an * idempotency key it has no business minting for a read. */ export declare function buildPollEndpoint(poll: PollSpec): FiatReadEndpoint; //# sourceMappingURL=selectTransitions.d.ts.map