Merge pull request #408 from tiagosiebler/ordersubmitdoc

Fix submit order example
This commit is contained in:
Tiago
2025-01-25 01:13:55 +00:00
committed by GitHub

View File

@@ -6,22 +6,35 @@ const client = new RestClientV5({
secret: 'apisecret',
});
// Submit a market order
client
.submitOrder({
category: 'spot',
symbol: 'BTCUSDT',
side: 'Buy',
orderType: 'Market',
qty: '0.1',
price: '15600',
timeInForce: 'PostOnly',
orderLinkId: 'spot-test-postonly',
isLeverage: 0,
orderFilter: 'Order',
qty: '1',
})
.then((response) => {
console.log(response);
console.log('Market order result', response);
})
.catch((error) => {
console.error(error);
console.error('Market order error', error);
});
// Submit a limit order
client
.submitOrder({
category: 'spot',
symbol: 'BTCUSDT',
side: 'Buy',
orderType: 'Limit',
qty: '1',
price: '55000',
})
.then((response) => {
console.log('Limit order result', response);
})
.catch((error) => {
console.error('Limit order error', error);
});