For hosts that do not use wagmi. The adapter binds a 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.
import {createWalletAdapter} from "@parlays-live/taker";
import {hyperEvmTestnet} from "@parlays-live/sdk";

const adapter = createWalletAdapter(client, walletSource, {chain: hyperEvmTestnet});

createWalletAdapter(client, source, options)

client
TakerClient
required
A configured client from createTakerClient.
source
WalletSource
required
Where the active wallet comes from.
options
AdapterOptions
required
Build ONE adapter per active wallet and rebuild when it changes (cheap; memoize on the wallet object).

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.
returns
Promise<SubmitResponse & {quote: QuoteResponse}>
{txHash, parlayId, quote} - the quote is returned so the success UI can show payout and correlation without re-fetching.
Status walk: 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. Returns CashoutQuote. 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, as ParlayRow[] - 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 to options.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.