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
  1. Integration
  2. Processing redeem requests

Redeeming from other tokens

Redeem IDR to a bank account from other tokens.

PreviousProcessing redeem requests

Last updated 23 days ago

You can redeem IDR to a bank account from other tokens, such as USDT and USDC. Check to see the list of supported other tokens.

Each bank account has a deposit address that is associated with it. You can send funds to this address to request a redemption to the bank account. Here's an example code to list your currently registered bank accounts.

import { createSignature } from "./createSignature";
const axios = require('axios');

const apiKey = "{YOUR API KEY}";
const secret = "{YOUR SECRET}";

async function getBankAccounts() {
  const path = "https://idrx.co/api/auth/get-bank-accounts";

  const bufferReq = Buffer.from('', 'base64').toString('utf8');
  const timestamp = Math.round((new Date()).getTime()).toString();
  const sig = createSignature('GET', path, bufferReq, timestamp, secret);

  const res = await axios.get(path, {
    headers: {
      'Content-Type': 'application/json',
      'idrx-api-key': apiKey,
      'idrx-api-sig': sig,
    },
  });

  console.log('res.data: ');
  console.log(JSON.stringify(res.data, null, 4));
}

getBankAccounts();

After a successful request, you will get a response as follows:

{
    "statusCode": 200,
    "message": "success",
    "data": [
        {
            "id": 108,
            "userId": 411,
            "bankAccountNumber": "5017332241",
            "bankAccountName": "JOHN SMITH",
            "bankAccountNumberHash": null,
            "bankCode": "014",
            "bankName": "BANK CENTRAL ASIA",
            "maxAmountTransfer": "100000000",
            "deleted": false,
            "DepositWalletAddress": {
                "walletAddress": "0x07C158ab29f23D0821e7D24B191c5e5d9d72738b",
                "createdAt": "2024-01-17T10:34:22.304Z"
            }
        },
        ...,
    ]
}

You can then send the other tokens to the wallet address associated with the bank account to initiate the process of redeeming IDR to the bank account. To get information about swap rates, you can use .

this page
this api