Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 549 Bytes

File metadata and controls

23 lines (19 loc) · 549 Bytes

HTTPS Agent Configuration

import https from 'https';
import { C2C, C2CRestAPI } from '@binance/c2c';

const httpsAgent = new https.Agent({
    rejectUnauthorized: true,
});

const configurationRestAPI = {
    apiKey: 'your-api-key',
    apiSecret: 'your-api-secret',
    httpsAgent,
};
const client = new C2C({ configurationRestAPI });

client.restAPI
    .getC2CTradeHistory()
    .then((res) => res.data())
    .then((data: C2CRestAPI.GetC2CTradeHistoryResponse) => console.log(data))
    .catch((err) => console.error(err));