Hera Dex Aggregator
  • Welcome
  • About Aggregator
  • Features
    • AI Powered Pathfinder
    • Interoperability
    • Optimization
    • Chain Agnostic Core
    • Interchain
    • Utility Token
    • Swap Fee Distribution
  • Roadmap
  • Trade Mining
  • Staking Portal
  • 🆕Omnichain Staking
  • 🆕About OFT Upgrade
  • Hera Token
    • Token Overview
    • 🆕Hera OFT Token
    • Tokenomics
    • Buy Hera Token
  • Audits
  • Smart Contracts
    • 🟤LayerZero
    • 🟢Metis
    • 🟢Arbitrum
    • ⚪Avalanche
    • ⚪Base
    • ⚪BNB Chain
    • ⚪Ethereum
    • ⚪Fantom
    • ⚪Optimism
  • Developers
    • Emporia SDK
      • Overview
      • Swagger API
      • Swagger API (Arbitrum)
      • Examples
    • Tokenomics API
  • Branding Assets
    • Logo Types
    • Media Assets
  • Support
    • Help
Powered by GitBook
On this page
  1. Developers
  2. Emporia SDK

Swagger API

EmporiaSDK Swagger API - v1.1

Datasets providing access to the SDK have not been updated for a long time. Please note that the SDK may not function properly until the completion of the V3 upgrade!

Hera Dex Aggregator - Swap 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. Lookup addresses of tokens you want to swap, for example ‘0xxx’ , ‘0xxxx’ for USDC -> METIS

  2. Check for allowance and if necessary give approval for HeraAggregatorV2 contract to spend token (/allowance)

  3. Monitor the best exchange route using (/quote)

  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!

Design, describe, and document your API on the first open source editor supporting multiple API specifications and serialization formats. The Swagger Editor offers an easy way to get started with the OpenAPI Specification (formerly known as Swagger) as well as the AsyncAPI specification, with support for Swagger 2.0, OpenAPI 3.0, and AsyncAPI 2.* versions.

Swagger Paths:

Allowance

// Example Query:

GET https://pathfindersdk.hera.finance/allowance?account=0x0000000000000000000000000000000000000000&amount=1000000&tokenInAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21

Quote (Pathfinder)

// Example Query:

GET https://pathfindersdk.hera.finance/quote?account=0x0000000000000000000000000000000000000000&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000&type=exactIn

Swap

// Example Query:

GET https://pathfindersdk.hera.finance/swap?account=0x0000000000000000000000000000000000000000&tokenInAddress=0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000&tokenInChainId=1088&tokenOutAddress=0xEA32A96608495e54156Ae48931A7c20f0dcc1a21&tokenOutChainId=1088&amount=100000000000000000000
PreviousOverviewNextSwagger API (Arbitrum)

Last updated 10 months ago

Page cover image

Check for allowance and if necessary give approval for Hera Aggregator contract to spend token.

get
Query parameters
accountstringRequired

Your wallet address

Example: 0x0000000000000000000000000000000000000000
amountstringRequired

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.

Example: 1000000
tokenInAddressstringRequired

Token address you want to swap

Example: 0xEA32A96608495e54156Ae48931A7c20f0dcc1a21
Responses
200
Transaction body to allow the swap with the Hera Aggregator router
application/json
400
Error details
application/json
get
GET /allowance HTTP/1.1
Host: pathfindersdk.hera.finance
Accept: */*
{
  "status": true,
  "allowance": 1,
  "tx": {
    "to": "text",
    "data": "text",
    "gasPrice": 1,
    "value": 1
  }
}

Find the best quote to swap via Hera Aggregator router

get
Query parameters
accountstringRequired

Your wallet address

Example: 0x0000000000000000000000000000000000000000
amountintegerRequiredExample: 1000000
tokenInAddressstringRequired

from token

Example: 0xEA32A96608495e54156Ae48931A7c20f0dcc1a21
tokenInChainIdintegerRequiredExample: 1088
tokenOutAddressstringRequired

to token

Example: 0x6F05709bc91Bad933346F9E159f0D3FdBc2c9DCE
tokenOutChainIdintegerOptionalExample: 1088
Responses
200
Quote
application/json
400
One of the following errors: "Insufficient liquidity", "Cannot estimate", "You may not have enough METIS balance for gas fee", "tokenInAddress cannot be equals to tokenOutAddress", "Cannot estimate. Don't forget about miner fee. Try to leave the buffer of METIS for gas", "Not enough balance", "Not enough allowance"
application/json
get
GET /quote HTTP/1.1
Host: pathfindersdk.hera.finance
Accept: */*
{
  "blockNumber": 1,
  "maxReturnResult": {
    "fromTokenAmount": "text",
    "fromTokenAmountNumber": 1,
    "toTokenAmount": "text",
    "toTokenAmountNumber": 1,
    "toTokenNativeAmount": "text",
    "gasUnitsConsumed": "text",
    "routes": [
      {
        "amount": "text",
        "amountOut": "text",
        "subRoutes": [
          {
            "amount": "text",
            "amountOut": "text",
            "paths": [
              {
                "fromTokenAddress": "text",
                "toTokenAddress": "text",
                "meta": {
                  "fromTokenAddress": "text",
                  "toTokenAddress": "text",
                  "pairAddress": "text",
                  "routerAddress": "text",
                  "fromAmount": "text",
                  "toTokenAmount": "text"
                },
                "market": {
                  "id": "text",
                  "name": "text"
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "directResult": {
    "amm": "text",
    "route": [
      "0xEA32A96608495e54156Ae48931A7c20f0dcc1a21"
    ],
    "fromTokenAmount": 1,
    "toTokenAmount": 1
  },
  "fromTokenAddress": "text",
  "fromTokenAmount": "text",
  "toTokenAddress": "text",
  "toTokenAmount": "text"
}

When you ready use to perform swap

get
Query parameters
accountstringRequired

Your wallet address

Example: 0x0000000000000000000000000000000000000000
dstAccountstringOptional

Recipient address ( if dstAccount is left blank, dstAccount = account )

Example: 0x0000000000000000000000000000000000000000
amountintegerRequiredExample: 1000000
tokenInAddressstringRequired

from token

Example: 0xEA32A96608495e54156Ae48931A7c20f0dcc1a21
tokenOutAddressstringRequired

to token

Example: 0x6F05709bc91Bad933346F9E159f0D3FdBc2c9DCE
slippagenumberOptional

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. Min: 0% and Max: 50% - !! Default slippage: 0% !!

Example: 0
deadlineintegerOptional

Default deadline: ~20min

Responses
200
Swap
application/json
400
One of the following errors: "Insufficient liquidity", "Cannot estimate", "You may not have enough METIS balance for gas fee", "tokenInAddress cannot be equals to tokenOutAddress", "Cannot estimate. Don't forget about miner fee. Try to leave the buffer of METIS for gas", "Not enough balance", "Not enough allowance"
application/json
get
GET /swap HTTP/1.1
Host: pathfindersdk.hera.finance
Accept: */*
{
  "blockNumber": 1,
  "fromTokenAddress": "text",
  "fromTokenAmount": "text",
  "fromTokenAmountNumber": 1,
  "toTokenAddress": "text",
  "toTokenAmount": "text",
  "toTokenAmountNumber": 1,
  "tx": {
    "data": "text",
    "gasPrice": "text",
    "gas": "text",
    "value": "text",
    "to": "text"
  }
}
  • Hera Dex Aggregator - Swap Protocol API
  • Metis Mainnet Release
  • Swagger Paths:
  • GETCheck for allowance and if necessary give approval for Hera Aggregator contract to spend token.
  • GETFind the best quote to swap via Hera Aggregator router
  • GETWhen you ready use to perform swap