Merge branch 'master' into wsapi

This commit is contained in:
Tiago
2025-01-25 01:18:59 +00:00
committed by GitHub

View File

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