TakerClient to an
EIP-1193 provider and exposes the full money flows with the same status
machine and ParlayEvent analytics union as the wagmi hooks, so swapping
bindings never touches your analytics mapping.
createWalletAdapter(client, source, options)
A configured client from
createTakerClient.Where the active wallet comes from.
Methods
submitParlay(legs, stake)
The full taker flow: chain guard (switch, adding the chain on first use) -> collateral allowance check and approve if short -> relayer quote (maker-signed) -> taker EIP-712 signature over the identical order -> gasless relay.{txHash, parlayId, quote} - the quote is returned so the success UI can
show payout and correlation without re-fetching.approving -> quoting -> signing -> submitting -> done
(or error). Throws on failure after emitting the failed event with the
stage it died in.
cashoutQuote(parlayId)
Quoter-signed buy-back price for a live parlay owned by the source wallet. ReturnsCashoutQuote. Display cashValue before executing; quotes expire
in about two minutes.
cashOut(parlayId, quote)
Executes the quoted cash-out on the escrow (cashOut write + receipt).
Returns {txHash}. On a deadline revert, re-quote and retry.
positions(opts?)
Every parlay on the escrow, newest first, asParlayRow[] - feed
positionsOf / positionsOnMarket (or wrap in react-query; see the
recipe). opts.max caps the scan
(default 1000).
Chain-switch behavior
Before any write the adapter asks the wallet to switch tooptions.chain,
adding the chain first (EIP-3085) if the wallet has never seen it. Some
embedded wallets are single-chain and reject switching; the adapter proceeds
and lets the write itself fail loudly if the chain is truly wrong.
