Links

Swagger API

EmporiaSDK Swagger API - v1.1

Hera Aggregation Protocol API

Metis Mainnet Release

Using Hera Aggregation protocol API, you can find the best route to exchange assets and make the exchange. Progressing:
  1. 1.
    Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for USDC -> METIS
  2. 2.
    Check for allowance and if necessary give approval for HeraAggregatorV2 contract to spend token (/allowance)
  3. 3.
    Monitor the best exchange route using (/quote)
  4. 4.
    When you ready use to perform swap (/swap)
EmporiaSDK is now available on Metis Mainnet. Other chains are coming soon!
Built with OpenAPI & Swagger!

Swagger Paths:

Allowance

get
https://pathfindersdk.hera.finance
/allowance
Check for allowance and if necessary give approval for Hera Aggregator contract to spend token.
Parameters
Query
account*
string
Your wallet address
amount*
string
The number of tokens that the Hera Aggregator router is allowed to spend. If not specified, it will be allowed to spend an infinite amount of tokens.
tokenInAddress*
string
Token address you want to swap
Responses
200: OK
Transaction body to allow the swap with the Hera Aggregator router
400: Bad Request
Error details
// Example Query:
GET https://pathfindersdk.hera.finance/allowance?account=0x0000Fee3F6eEB1Ebddb23251A3918A55CAF03365&amount=1000000&tokenInAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21

Quote (Pathfinder)

get
https://pathfindersdk.hera.finance
/quote
Find the best quote to swap via Hera Aggregator router
Parameters
Query
account*
string
Your wallet address
amount*
integer
tokenInAddress*
string
from token
tokenInChainId*
integer
tokenOutAddress*
string
to token
tokenOutChainId
integer
Responses
200: OK
Quote
400: Bad Request
One of the following errors: <br><br>Insufficient liquidity<br>Cannot estimate<br>You may not have enough METIS balance for gas fee<br>tokenInAddress cannot be equals to tokenOutAddress<br>Cannot estimate. Don't forget about miner fee. Try to leave the buffer of METIS for gas<br>Not enough balance<br>Not enough allowance
// Example Query:
GET https://pathfindersdk.hera.finance/quote?account=0x0000Fee3F6eEB1Ebddb23251A3918A55CAF03365&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000&type=exactIn

Swap

get
https://pathfindersdk.hera.finance
/swap
When you ready use to perform swap
Parameters
Query
account*
string
Your wallet address
dstAccount
string
Recipient address ( if dstAccount is left blank, dstAccount = account )
amount*
integer
tokenInAddress*
string
from token
tokenOutAddress*
string
to token
slippage
number
While HeraGuard is active, the slippage rate is set to 0% and will protect you from front-running. However, if this feature is active, your transaction may fail due to price fluctuations during processing.<br><br>Min: 0% and Max: 50%<br><br><b>!! Default slippage: 0% !!</b>
deadline
integer
Default deadline: ~20min
Responses
200: OK
Swap
400: Bad Request
One of the following errors: <br><br>Insufficient liquidity<br>Cannot estimate<br>You may not have enough METIS balance for gas fee<br>tokenInAddress cannot be equals to tokenOutAddress<br>Cannot estimate. Don't forget about miner fee. Try to leave the buffer of METIS for gas<br>Not enough balance<br>Not enough allowance
// Example Query:
GET https://pathfindersdk.hera.finance/swap?account=0x0000Fee3F6eEB1Ebddb23251A3918A55CAF03365&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000
Last modified 8d ago