whisk
Getting Started

Controlled inputs

Lock the amount, recipient, or chain so the widget becomes a confirm-and-pay surface.

There are two ways to put a value into <WhiskSend>. Controlled props lock the field so the user can read it but can't change it. Default props seed an initial value the user can still edit. Use controlled when the host app has the authoritative number (cart total, merchant address). Use defaults when you're nudging.

Controlled props

checkout.tsx
<WhiskSend
  amount="49.99"
  recipient="0xMerchantTreasury…"
  destinationChain="Base"
/>
PropWhat it locks
amountThe amount field.
recipientThe recipient field.
sourceChainThe source chain picker.
destinationChainThe destination chain picker.

When all three of amount, recipient, and destinationChain are locked, the widget reads like a checkout summary: the user signs once, and the transfer leaves.

Default props

These pre-fill the input but stay editable:

donate-button.tsx
<WhiskSend recipient="0xDAOTreasury…" defaultAmount="10" />
PropWhat it seeds
defaultAmountThe starting amount.
defaultRecipientThe starting recipient.

The recipient is locked (treasury address) but the amount nudges toward 10 USDC. Donors can change it before confirming.

Reading back what the user picked

Pair any unlocked field with a change callback to mirror its value in your app's state:

const [amount, setAmount] = useState("10");

<WhiskSend
  defaultAmount={amount}
  onAmountChange={setAmount}
  recipient="0xDAOTreasury…"
/>;

The full set: onAmountChange, onRecipientChange, onSourceChainChange, onDestinationChainChange. Each receives the new value as a string (or Chain literal for the chain callbacks).

Common shapes

FlowControlledDefault
Checkoutamount + recipient + dest chain
Donationrecipient + dest chainamount
Invoice linkamount + recipient + dest chainsource chain
Payroll batchamount + recipient + dest chain

The source chain almost always stays free. The customer pays from wherever their USDC sits. Whisk handles the bridge when source and destination differ.

Next

See the e-commerce checkout recipe for a full integration including the server-side payment verification.

On this page