token_trade
Execute buy or sell trades for tokens on the Odin platform.Method Signature
Parameters
TradeRequest
Field | Type | Required | Description |
---|---|---|---|
tokenid | string | Yes | The token identifier to trade |
typeof | TradeType | Yes | Trade type: { buy: null } or { sell: null } |
amount | TradeAmount | Yes | Amount to trade (either BTC or token amount) |
settings | TradeSettings | No | Optional trade settings including slippage |
TradeType
TradeAmount
- btc: Amount in BTC (when buying tokens)
- token: Amount in tokens (when selling tokens)
TradeSettings (Optional)
Response
TradeResponse
- Success:
{ ok: null }
- Trade executed successfully - Error:
{ err: string }
- Error message describing what went wrong