Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 613 Bytes

File metadata and controls

23 lines (19 loc) · 613 Bytes

HTTPS Agent Configuration

import https from 'https';
import { SimpleEarn, SimpleEarnRestAPI } from '@binance/simple-earn';

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

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

client.restAPI
    .getSimpleEarnFlexibleProductList()
    .then((res) => res.data())
    .then((data: SimpleEarnRestAPI.GetSimpleEarnFlexibleProductListResponse) => console.log(data))
    .catch((err) => console.error(err));