Get Swap Price
get_swap_priceFetch an indicative swap price for a token pair before trading. Provide sell and buy tokens to preview rates, slippage, and amounts via WalletChan's swap API.
Instructions
Fetch an indicative WalletChan swap price using the same first-party swap API as the extension.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Optional taker/approved account. | |
| chain | No | Chain name or ID. Defaults to the active WalletChan RPC chain. | |
| taker | No | Alias for from. | |
| buyToken | Yes | Buy token address, symbol from the WalletChan token list, or native/ETH. | |
| decimals | No | Optional token decimals when sellToken is an address not in the token list. | |
| recipient | No | Optional recipient for bought tokens. | |
| sellToken | Yes | Sell token address, symbol from the WalletChan token list, or native/ETH. | |
| sellAmount | No | Decimal sell amount in token units, e.g. 1.5. Use sellAmountWei for base units. | |
| slippageBps | No | Slippage in basis points. Defaults to 500 (5%). | |
| sellAmountWei | No | Optional base-unit sell amount as an integer string. | |
| tokenDecimals | No | Alias for decimals. |