IDRX Documentation
  • Introduction
    • IDRX Whitepaper
    • Supported Chain and Contract Address
  • IDRX Account
    • Create Account
    • Sign In
    • Forgot Password
    • Account Verification (KYC)
    • Business Account
  • Services
    • Mint IDRX
    • Redeem IDRX
    • Bridge IDRX
    • Get Other Tokens
    • Redeem Other Stablecoin
    • Fees
  • API
    • Getting Started
    • Generating a Signature
    • Onboarding API
      • POST /api/auth/onboarding
      • GET /api/auth/members
      • POST /api/auth/add-bank-account
      • GET /api/auth/get-bank-accounts
      • DELETE /api/auth/delete-bank-account/:bankId
    • Transaction API
      • POST /api/transaction/mint-request
      • POST /api/transaction/redeem-request
      • POST /api/transaction/bridge-request
      • GET /api/transaction/method
      • GET /api/transaction/user-transaction-history
      • GET /api/transaction/rates
      • GET /api/transaction/get-additional-fees
  • Smart Contract
    • Staking
      • Staking Type
      • Staking IDRX
      • Claim Staking Reward
      • Unbond Staked IDRX
      • Claim Unbonded IDRX
      • Claim Principal and Staking Rewards
      • Application Binary Interface
  • Integration
    • Overview
    • Onboarding a new user
    • Managing bank accounts
    • Processing mint requests
      • Getting other tokens
    • Processing redeem requests
      • Redeeming from other tokens
Powered by GitBook
On this page
  • Parameters
  • Example Request
  • Response
  1. API
  2. Transaction API

GET /api/transaction/rates

Get current swap rates of IDRX to other tokens.

Parameters

  1. idrxAmount (String):

    The IDRX amount to sell.

  2. usdtAmount (String):

    The USDT/USDC amount to sell.

  3. chainId (String): Blockchain ID.

You must provide either one of idrxAmount or usdtAmount as parameter. chainId will default to 137 (Polygon) if left unspecified.

Example Request

curl '<https://idrx.co/api/transaction/rates?usdtAmount=15>' --header 'idrx-api-key: <API_KEY>' --header 'idrx-api-sig: <signature>' --header 'idrx-api-ts': <timestamp>'

Response

If the request is successful, the response will be as shown below:

{
    "statusCode": 200,
    "message": "success",
    "data": {
        "price":"15323",
        "buyAmount":"229854",
        "chainId":137
    }
}

buyAmount represents the IDRX amount you would get from the specified USDT/USDC amount in the parameter.

PreviousGET /api/transaction/user-transaction-historyNextGET /api/transaction/get-additional-fees

Last updated 1 month ago