999) — from checking allowance to executing the swap.
Prerequisites
- An API key (get one on Telegram)
- A wallet with tokens on HyperEVM
- Tokens to swap (this example swaps HYPE for UBTC)
1
Check allowance
Before swapping an ERC-20 token, check if the AKKA Router is allowed to spend it. For native token swaps (HYPE), skip to step 3.Response:If
allowance is 0 or less than your swap amount, proceed to step 2. Otherwise, skip to step 3.2
Approve token spending
Generate and submit an approval transaction so the AKKA Router can spend your tokens.Response:
3
Get a quote
Check the expected output amount before executing the swap.Response:
4
Execute the swap
Generate the swap transaction data and submit it to the blockchain.Response:
5
Sign and broadcast
Submit the transaction object from step 4 to the blockchain.
JavaScript (viem)
Next steps
Full Working Example
Complete TypeScript implementation you can copy and run.
API Reference
Explore all endpoints with the interactive playground.
