Crypto Agent
1 variantA wallet agent chat page that answers with transaction cards users review and approve in place, instead of plain text.
Transaction chat
Ask to swap, send, or approve: the agent's tool steps resolve one by one, the reply streams in, and a live card follows with a re-rolling swap quote, a send preview with the saved contact, or a capped approval, each tracked from signature to confirmation.
Atlas
Wallet agent
What should we move today?
Ask in plain words. I prepare every transaction as a card, and nothing is signed until you approve it.
Try asking
Swap tokens
Swap 0.5 ETH to USDC
Pay a contact
Send 120 USDC to lena.eth
Set an allowance
Approve 500 USDC for Uniswap
"use client";
import { CryptoAgentChat } from "@/components/premium/crypto-agent/crypto-agent-chat";
export function CryptoAgentChatPreview() {
return <CryptoAgentChat className="h-[46rem]" />;
}
Source code is locked
Get access to install premium components and view the full source.
Open dashboardInstall
API Reference
Every prop is optional unless marked required. Data, copy, and colors default to the sample content.
CryptoAgentChat13 props
initialMessagesMessages the thread starts with. Read on mount only.
CryptoAgentMessage[]Default
[]tokensStarting wallet tokens and balances. Read on mount, then updated by trades.
CryptoTradeToken[]contactsSaved contacts used to resolve and name send recipients.
CryptoTradeContact[]respondTurns a prompt into a reply. Defaults to a local demo parser.
((prompt: string, context: CryptoAgentContext) => CryptoAgentReply | Promise<CryptoAgentReply>)onSignAsks the wallet to sign and broadcast. Resolve with the hash.
((action: CryptoAgentAction, approval: CryptoAgentApproval) => Promise<{ hash: string; }>)waitForReceiptResolves once the transaction is confirmed onchain.
((hash: string) => Promise<void>)onRejectCalled with the action when the user declines its card.
((action: CryptoAgentAction) => void)labelsText overrides merged over the default labels.
Partial<CryptoAgentLabels>suggestionsStarter cards shown on the empty welcome screen.
CryptoAgentSuggestion[]walletAddressConnected wallet shown in the header.
stringDefault
0x7a3d9e1fb2c4a5d6e7f8091a2b3c4d5e6f70b41cnetworkNetwork id whose icon shows in the header wallet pill. Defaults to ethereum.
stringDefault
ethereumexplorerUrlBuilds the block explorer link for a transaction hash.
((hash: string) => string)Default
(hash) => `https://etherscan.io/tx/${hash}`classNameClasses merged onto the root element.
string
Types8 types
The object types these props take, field by field.
CryptoTradeToken9 fields
idRequiredUnique per network, since one symbol can live on several chains.
stringsymbolRequiredTicker shown next to amounts, such as "ETH".
stringnameRequiredFull token name shown in the token picker.
stringnetworkRequiredMatches a `CryptoTradeNetwork` id.
stringbalanceRequiredWallet balance in whole token units.
numberusdPriceRequiredCurrent price of one token, in USD.
numberprecisionRequiredMaximum fraction digits shown for amounts of this token.
numberchange24h24h price change in percent.
numberpopularShown as a quick pick above the token search.
boolean
CryptoTradeContact4 fields
idRequiredUnique id for the contact.
stringnameRequiredDisplay name shown in the recent recipients list.
stringaddressRequiredWallet address filled in when the contact is picked.
stringavatarAvatar image URL shown beside the name.
string
CryptoAgentReply3 fields
textRequiredAgent's answer, streamed in word by word after the steps finish.
stringstepsTool steps revealed one at a time before the text appears.
CryptoAgentStep[]actionTransaction to show as an approval card under the text.
CryptoAgentAction
CryptoAgentContext2 fields
tokensRequiredWallet tokens with their current balances, after any earlier trades.
CryptoTradeToken[]contactsRequiredSaved contacts the agent can resolve recipients from.
CryptoTradeContact[]
CryptoAgentLabels34 fields
agentNameRequiredAgent name shown in the header.
stringagentStatusRequiredMuted line under the agent name in the header.
stringgreetingRequiredWelcome heading shown before the first message.
stringgreetingBodyRequiredWelcome paragraph under the greeting.
stringplaceholderRequiredPlaceholder text in the message input.
stringsendRequiredSend button label. Currently not rendered by the chat.
stringthinkingRequiredLabel shown while the agent works on a reply.
stringsuggestionsRequiredScreen-reader heading for the starter suggestion cards.
stringapproveRequiredApprove button on a transaction card.
stringrejectRequiredDecline button on a transaction card.
stringsigningRequiredApprove button text while the wallet is signing.
stringconfirmedRequiredStatus chip shown once the transaction confirms.
stringrejectedRequiredStatus chip shown after the user declines a card.
stringfailedRequiredStatus chip shown when signing or confirmation fails.
stringretryRequiredApprove button text after a failed transaction.
stringrefreshQuoteRequiredButton that refreshes an expired swap quote.
stringquoteExpiresRequiredScreen-reader text before the swap quote countdown.
stringviewTxRequiredLink to the transaction on the block explorer.
stringstepsRequiredNames of the sign, submitted, and confirmed progress steps.
[sign: string, submit: string, confirm: string]networkFeeRequiredNetwork fee row on every transaction card.
stringpayRequiredLabel for the paid leg of a swap.
stringsendingRequiredLabel above the amount on a send card.
stringreceiveRequiredLabel for the received leg of a swap.
stringrateRequiredExchange rate row on a swap card.
stringminimumReceivedRequiredMinimum received row on a swap card.
stringpriceImpactRequiredPrice impact row on a swap card.
stringbalanceAfterRequiredBalance after row on a send card.
stringallowanceRequiredLabel above the amount on an approval card.
stringexactAmountRequiredNote on an approval card that the allowance is capped.
stringspenderRequiredSpender row on an approval card.
stringtitlesRequiredCard title for each action kind.
Record<CryptoAgentAction["kind"], string>declinedReplyRequiredAgent message added after the user declines a card.
stringfailedReplyRequiredAgent message shown when `respond` throws.
stringconfirmedReplyRequiredBuilds the agent message after a confirmed transaction from its plain receipt.
(action: CryptoAgentAction, summary: string) => string
CryptoAgentSuggestion3 fields
kindRequiredAction kind that picks the card's icon.
CryptoAgentAction["kind"]titleRequiredCard heading.
stringpromptRequiredMessage sent to the agent when the card is picked, also shown on the card.
string
CryptoAgentApproval1 field
amountOutSwap output quoted on the card when approved, used for the receipt and balances.
number
CryptoAgentStep3 fields
labelRequiredStep name shown in the list, such as "Checked balance". Also used as its key.
stringdetailMuted result line shown after the label.
stringstateSpinner while running, check when done. Set by the chat as steps resolve.
"running" | "done"