Gate REST JavaScript SDK example: createOTCBank.ts

Gate REST create otcbank 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/createOTCBank.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/createOTCBank.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 { readFileSync } from 'fs';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 createOTCBankExample() {  try {    console.log('Using API keys:', account);     // Path to account-opening proof (jpg/jpeg/png/pdf, max 4MB per Gate docs)    const proofPath =      process.env.OTC_PROOF_FILE || './account-opening-proof.pdf';    const documentation_file = readFileSync(proofPath);     const result = await gateRestClient.createOTCBank({      bank_account_name: 'Account Holder Name',      bank_name: 'Example Bank',      bank_country: 'US',      bank_address: '123 Example Street',      iban: 'DE89370400440532013000',      swift: 'COBADEFFXXX',      remittance_line_number: '',      agent_bank_name: '',      agent_bank_swift: '',      documentation_file: {        filename: 'account-opening-proof.pdf',        content: documentation_file,      },    });     console.log('Response: ', result);  } catch (e) {    console.error('Error in execution: ', e);  }} createOTCBankExample(); 

Subscribe on Substack

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