Skip to content

Latest commit

 

History

History
23 lines (20 loc) · 633 Bytes

File metadata and controls

23 lines (20 loc) · 633 Bytes

WebSocket Agent Configuration

import { HttpsProxyAgent } from 'https-proxy-agent';
import { DerivativesTradingUsdsFutures } from '@binance/derivatives-trading-usds-futures';

const configurationWebsocketAPI = {
    apiKey: 'your-api-key',
    apiSecret: 'your-api-secret',
    agent: new HttpsProxyAgent('your-proxy-url'),
};
const client = new DerivativesTradingUsdsFutures({ configurationWebsocketAPI });

client.websocketAPI
    .connect()
    .then((connection) =>
        connection.positionInformation()
    )
    .then((res) =>
        console.log(res.data)
    )
    .catch((err) => console.error(err));