Back to Ccxt

Fetch Orders

wiki/examples/js/fetch-orders.md

4.5.60522 B
Original Source
javascript
// @NO_AUTO_TRANSPILE
import ccxt from '../../js/ccxt.js';
import asTable from 'as-table';
import log from 'ololog';
import ansicolor from 'ansicolor';
ansicolor.nice;
const exchange = new ccxt.binance({
    apiKey: "YOUR_API_KEY",
    secret: "YOUR_SECRET",
});
async function test() {
    const orders = await exchange.fetchOrders();
    log(asTable(orders.map(order => ccxt.omit(order, ['timestamp', 'info']))));
    const order = await exchange.fetchOrder(orders[0]['id']);
    log(order);
}
test();