Back to Ccxt

Fetch Orders

wiki/examples/js/fetch-orders.md

4.5.52553 B
Original Source
javascript


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.bittrex ({
   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 ()