Prepare a buy
polypad_prepare_buyPrepares a buy of a launch token with ETH. Simulates it on-chain before returning. Returns the unsigned transaction (to, data, value, chainId 4663, gas estimate), a plain summary, and a one-tap signing link. Show the summary before the link. Never signs.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"token": "<token>",
"from": "<from>"
},
"name": "polypad_prepare_buy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Attribution tag for traffic measurement. Default "grok". | |
| from | Yes | The wallet address that will sign (0x...). Never a private key. Omit it when a walletToken is passed — the wallet is resolved from the token instead. | |
| token | Yes | Symbol, name, token address, or launch address. | |
| amountEth | No | ETH to spend, as a decimal such as 0.01. | |
| amountWei | No | ETH to spend in wei. Use instead of amountEth. | |
| returnUrl | No | Optional https:// link back to your agent flow. The signing page shows it as a button after the transaction confirms, with ?tx=<hash>&status=confirmed added. Anything that is not an https:// URL is ignored. | |
| slippageBps | No | Slippage limit in basis points. Default 100, maximum 1000. | |
| walletToken | No | A wallet token from /sign?connect=1: connect once, store the token, and pass it instead of from on every prepare call. The wallet is resolved from the token (signature-checked, 90-day expiry). When both are passed they must name the same wallet. | |
| confirmLarge | No | Set true only after the user confirmed an amount above 1 ETH. |