Your personal API key is:
1
must be logged in to view token
1
npm install endx-gg/typescript-client
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
export { createTradingClient } from 'endx';
const endx = await createTradingClient(
'production',
'must be logged in to view token'
);
const instruments = await endx.instruments();
endx.subscribeToOrderBook(instruments[0].id, (d) => {
console.log(d);
});
endx.subscribeToPortfolio((d) => {
console.log(d);
});
endx.subscribeToOrders((d) => {
console.log(d);
});
console.log(
await endx.makeOrder({
instrument: '17978',
orderType: 'Market', // if Limit set price too
quantity: 1,
side: 'Buy',
})
);