usdc_buy_with_native
Buy a token by paying with the chain's native token (ETH, BNB, SOL). Auto-bridge from other chains is on by default for cross-chain purchases.
Instructions
Buy a token paying with the chain's native token (ETH, BNB, SOL...). Auto-bridge from other chains is on by default, as on gdex.pro.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiKey | No | GDEX API key for AES encryption | |
| chainId | Yes | Chain ID: 1, 10, 56, 146, 8453, 42161 or 622112261 (Solana). No USDC on Robinhood 4663 or Fraxtal 252 | |
| accountRef | No | Connected account from gdex_connect. Supplies session key, wallet address, API key and session data so no secret is passed in chat | |
| autoBridge | No | Automatic funding (default true, as on gdex.pro): bridge USDC and top up native gas from the user's other chains, within maxSourceSpendRaw | |
| tokenAddress | Yes | Token to buy | |
| walletAddress | No | Control wallet address | |
| minTokenOutRaw | Yes | Minimum token out, raw integer units | |
| nativeAmountRaw | Yes | Native amount to spend (18 decimals EVM, 9 Solana), raw integer units | |
| maxSourceSpendRaw | No | Signed cap on total source spend for auto-funding (default ceil(amount x 1.2)), raw integer units | |
| sessionPrivateKey | No | Session private key from sign-in |