⚙️Swagger
You can also find AKKA API swagger directly here :
Using AKKA Swap API, you can find the best route to exchange assets and make the exchange.
Step by step:
Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for ICE -> CORE
Check for allowance of AKKA router contract to spend source asset (/approve/allowance)
If necessary, give approval for AKKA router to spend source token (/approve/transaction)
Monitor the best exchange route using
/pks-quote
or/quote
When you are ready to perform the swap, use
/swap
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
10000000000000000
PKS Quote
GET /{chainId}/pks-quote?src=text&dst=text&amount=text HTTP/1.1
Host: v2
Accept: */*
PKS Quote
{}
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
10000000000000000
Return fromToken and toToken info in response
Return swap protocols in response
Quote
One of the following errors: Insufficient liquidity Cannot estimate You may not have enough ETH balance for gas fee FromTokenAddress cannot be equals to toTokenAddress Cannot estimate. Don't forget about miner fee. Try to leave the buffer of ETH for gas Not enough balance Not enough allowance
GET /{chainId}/quote?src=text&dst=text&amount=text HTTP/1.1
Host: v2
Accept: */*
{
"toAmount": "text",
"toToken": {
"symbol": "text",
"name": "text",
"decimals": 1,
"address": "text",
"logoURI": "text",
"tags": [
"text"
]
},
"fromToken": {
"symbol": "text",
"name": "text",
"decimals": 1,
"address": "text",
"logoURI": "text",
"tags": [
"text"
]
},
"protocols": [
[
[
{
"name": "string",
"part": "number",
"fromTokenAddress": "string",
"toTokenAddress": "string"
}
]
]
]
}
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
0x201EBa5CC46D216Ce6DC03F6a759e8E766e956aE
10000000000000000
The address that calls the AKKA contract
min: 0; max: 50;
1
Swap
One of the following errors: Insufficient liquidity Cannot estimate You may not have enough ETH balance for gas fee FromTokenAddress cannot be equal to toTokenAddress Cannot estimate. Don't forget about miner fee. Try to leave the buffer of ETH for gas Not enough balance Not enough allowance
GET /{chainId}/swap?src=text&dst=text&amount=text&from=text&slippage=1 HTTP/1.1
Host: v2
Accept: */*
{
"toAmount": "text",
"toToken": {
"symbol": "text",
"name": "text",
"decimals": 1,
"address": "text",
"logoURI": "text",
"tags": [
"text"
]
},
"fromToken": {
"symbol": "text",
"name": "text",
"decimals": 1,
"address": "text",
"logoURI": "text",
"tags": [
"text"
]
},
"protocols": [
[
[
{
"name": "string",
"part": "number",
"fromTokenAddress": "string",
"toTokenAddress": "string"
}
]
]
],
"tx": {
"from": "text",
"to": "text",
"data": "text",
"value": "text",
"gasPrice": "text",
"gas": 1
}
}
Address of the AKKA router that must be trusted to spend funds for the exchange
GET /{chainId}/approve/spender HTTP/1.1
Host: v2
Accept: */*
Address of the AKKA router that must be trusted to spend funds for the exchange
{
"address": "text"
}
Token address you want to exchange
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
The number of tokens that the AKKA router is allowed to spend. If not specified, it will be allowed to spend an infinite amount of tokens.
100000000000
Transaction body to allow the exchange with the AKKA router
GET /{chainId}/approve/transaction?tokenAddress=text HTTP/1.1
Host: v2
Accept: */*
Transaction body to allow the exchange with the AKKA router
{
"data": "text",
"gasPrice": "text",
"to": "text",
"value": "text"
}
Token address you want to exchange
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
Wallet address for which you want to check
GET /{chainId}/approve/allowance?tokenAddress=text&walletAddress=text HTTP/1.1
Host: v2
Accept: */*
{
"allowance": "text"
}
0
1000
All supported tokens (can also use your own)
GET /{chainId}/tokens HTTP/1.1
Host: v2
Accept: */*
All supported tokens (can also use your own)
{
"tokens": {
"token_address": {
"symbol": "string",
"name": "string",
"decimals": 0,
"address": "string",
"logoURI": "string",
"tags": [
"string"
]
}
}
}
0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8
Information about the requested token address
GET /{chainId}/tokens/{address} HTTP/1.1
Host: v2
Accept: */*
Information about the requested token address
{
"symbol": "text",
"name": "text",
"decimals": 1,
"address": "text",
"logoURI": "text",
"tags": [
"text"
]
}
Last updated