Gate REST JavaScript SDK example: getOTCBankList.ts

Gate REST get otcbank list JavaScript example for the Siebly Gate SDK, covering exchange REST API and WebSocket integration, setup, and production SDK docs.

We use environment variables in our examples for API keys. It is your responsibility to manage and secure your keys appropriately.

examples/Gate/Rest/otc/getOTCBankList.ts

What this example covers

  • Gate REST API JavaScript example.
  • Uses the Siebly Gate SDK package gateio-api instead of hand-written HTTP request plumbing.
  • Source path: Gate/Rest/otc/getOTCBankList.ts.
  • Example category: REST.
  • Imports SDK symbols including RestClient.

How to use this example

  • Start here for the specific request or stream pattern, then check the matching SDK guide for install, credentials, and operational notes.
  • Open the repository source when you need the latest committed version: GitHub source file.
import { RestClient } from 'gateio-api'; const account = {  key: process.env.API_KEY || 'yourApiHere',  secret: process.env.API_SECRET || 'yourSecretHere',}; const gateRestClient = new RestClient({  apiKey: account.key,  apiSecret: account.secret,}); async function getOTCBankListExample() {  try {    console.log('Using API keys:', account);     const result = await gateRestClient.getOTCBankList();     console.log('Response: ', result);     const defaultCard = result.data?.lists?.find((c) => c.is_default === 1);    if (defaultCard) {      console.log(        'Default bank id for orders:',        defaultCard.id ?? defaultCard.bank_id,      );    }  } catch (e) {    console.error('Error in execution: ', e);  }} getOTCBankListExample(); 

Subscribe on Substack

Complete the Substack form below to join our newsletter. Substack handles all subscriber data directly.