Demo Project
A working example app showing authentication, streaming, and client-side tool call handling.
Endpoint
Methods
| Method | Description |
|---|---|
message/send | Send a message and get a response |
message/stream | Send a message and stream the response via SSE |
tasks/get | Get a task by ID (optionally limit history length) |
tasks/cancel | Cancel a running task |
Agent ID
Everymessage/send and message/stream request must include an agentId. The endpoint is agent-agnostic — the agent is resolved at request time from the value you supply.
Pass it in params.configuration:
agentId on a new request returns: "agentId is required: provide in configuration.agentId or as a DataPart". Once a task exists, subsequent messages that include its taskId do not need to repeat it.
Find the numeric ID in the agent card under skills where each entry is a separate chat agent.
Example: Send a Message
Streaming
Usemessage/stream to get Server-Sent Events back. Each event is a JSON-RPC response wrapping an A2A stream event:
Authentication
Authentication uses SIWE (Sign-In with Ethereum). Complete the SIWE flow to obtain a session cookie before making requests. See Authentication for the full flow with curl examples.Client-side tool calls
The CoinFello chat agent which you can get from its agent card returns tool call requests as part of its A2A responses. Your frontend is responsible for handling these calls — rendering UI, prompting the user for approval, executing wallet transactions, and returning results back to the agent. Tool calls appear in the agent’s response asfunctionCall parts:
message/send with a functionReturn part:
Tool reference
call_smart_contract_function
call_smart_contract_function
Proposes a generic smart contract call for the user to approve or reject. Display the contract address, function name, arguments, and value before submitting the transaction.
| Parameter | Type | Description |
|---|---|---|
to | string | Contract address |
functionName | string | Name of the contract function |
args | string[] | Encoded function arguments |
chainId | number | Target chain ID |
value | string | Native token value in wei |
abi | string[] | ABI fragments needed to encode the call |
send_native_gas_token
send_native_gas_token
Sends native gas token (e.g. ETH) to an address. Show the recipient and amount for user confirmation before broadcasting.
| Parameter | Type | Description |
|---|---|---|
to | string | Recipient address |
chainId | number | Target chain ID |
value | string | Amount in wei |
transfer_nft
transfer_nft
Transfers an NFT to another address. Display the NFT details and recipient before the user approves.
| Parameter | Type | Description |
|---|---|---|
contractAddress | string | NFT contract address |
tokenId | string | Token ID |
toAddress | string | Recipient address |
amount | string | Amount (for ERC-1155; use "1" for ERC-721) |
chainId | number | Target chain ID |
show_token_balance_ui
show_token_balance_ui
Requests a visual token balance display. Render balance cards or a portfolio summary using the provided data — no wallet transaction required.
| Parameter | Type | Description |
|---|---|---|
address | string | Wallet address |
balances | object[] | Array of token balance objects (symbol, amount, price, value, logo, etc.) |
totalValue | number | Total portfolio value in USD |
execute_lifi_swap
execute_lifi_swap
Executes a token swap or cross-chain bridge via LI.FI. Fetch a quote from LI.FI using the provided parameters, show the route to the user, then execute on approval.
| Parameter | Type | Description |
|---|---|---|
fromChainId | number | Source chain ID |
toChainId | number | Destination chain ID |
fromTokenAddress | string | Source token address |
toTokenAddress | string | Destination token address |
fromAmount | string | Amount in source token’s smallest unit |
slippage | number | Slippage tolerance (e.g. 0.005 for 0.5%) |
fromTokenSymbol | string | Source token symbol |
toTokenSymbol | string | Destination token symbol |
fromTokenDecimals | number | Source token decimals |
toTokenDecimals | number | Destination token decimals |
enter_staking_yield
enter_staking_yield
Prepares a staking transaction for a specific yield opportunity. Show the APY, protocol, pool, and lockup period before requesting approval.
| Parameter | Type | Description |
|---|---|---|
yieldId | string | Yield opportunity ID |
amount | string | Amount to stake |
walletAddress | string | User’s wallet address |
tokenSymbol | string | Token to stake |
tokenAddress | string | Token contract address |
chainId | number | Target chain ID |
network | string | Network name |
protocol | string | Protocol name |
poolName | string | Pool name |
apy | number | Current APY |
lockupPeriod | string | Human-readable lockup duration |
rewardTokenSymbols | string[] | Reward token symbols |
exit_staking_yield
exit_staking_yield
Prepares an unstaking transaction to withdraw from a staking position.
| Parameter | Type | Description |
|---|---|---|
yieldId | string | Yield opportunity ID |
amount | string | Amount to withdraw |
walletAddress | string | User’s wallet address |
aave_supply / aave_borrow / aave_repay / aave_withdraw
aave_supply / aave_borrow / aave_repay / aave_withdraw
Aave V4 lending market interactions. All four share the same parameter shape and require user approval before executing.
| Parameter | Type | Description |
|---|---|---|
marketAddress | string | Aave market contract address |
tokenAddress | string | Token contract address |
tokenSymbol | string | Token symbol |
amount | string | Amount in token’s smallest unit |
walletAddress | string | User’s wallet address |
chainId | number | Target chain ID |
request_auto_rebalance_permission
request_auto_rebalance_permission
Asks the user to grant permission for automatic yield rebalancing. Display the current position, minimum yield increase threshold, and maximum lockup before the user accepts or declines.
| Parameter | Type | Description |
|---|---|---|
chainId | number | Target chain ID |
tokenAddress | string | Token to rebalance |
currentPosition.protocol | string | Current protocol |
currentPosition.amount | string | Current staked amount |
currentPosition.apy | number | Current APY |
minYieldIncrease | number | Minimum APY improvement to trigger rebalance |
maxLockupDays | number | Maximum lockup days the user will accept |
React Package
Interested in a drop-in@coinfello/react package? Reach out to us — it’s on the roadmap.