build_buy_with_approval_tx
Creates two unsigned transactions—stablecoin approval and share purchase—so buyers can sign and send them in the required order to buy YES or NO shares.
Instructions
Build TWO unsigned transactions: (1) approve stablecoin spending and (2) buy shares. Convenience tool that combines approve + buyShares. Both must be signed and sent in order.
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": {
"market_address": "<market_address>",
"outcome": "<outcome>",
"amount": "<amount>",
"chain_id": "<chain_id>"
},
"name": "build_buy_with_approval_tx"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Stablecoin amount to spend (e.g. "10.5") | |
| outcome | Yes | Market outcome: YES or NO | |
| chain_id | Yes | EVM chain ID (e.g. 8453 for Base, 369 for PulseChain) | |
| min_shares | No | Minimum shares to accept (slippage protection) | 0 |
| market_address | Yes | PredictionMarket contract address |