feat: start work on axios integration, deprecating request.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
const Request = require('./request.js');
|
||||
const Request = require('./request-v2');
|
||||
|
||||
module.exports = class RestClient {
|
||||
|
||||
@@ -17,7 +17,7 @@ module.exports = class RestClient {
|
||||
assert(params.qty, 'Parameter qty is required');
|
||||
assert(params.time_in_force, 'Parameter time_in_force is required');
|
||||
|
||||
if(params.order_type === 'Limit') assert(params.price, 'Parameter price is required for limit orders');
|
||||
if (params.order_type === 'Limit') assert(params.price, 'Parameter price is required for limit orders');
|
||||
|
||||
return await this.request.post('v2/private/order/create', params);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ module.exports = class RestClient {
|
||||
assert(params.base_price, 'Parameter base_price is required');
|
||||
assert(params.stop_px, 'Parameter stop_px is required');
|
||||
|
||||
if(params.order_type === 'Limit') assert(params.price, 'Parameter price is required for limit orders');
|
||||
if (params.order_type === 'Limit') assert(params.price, 'Parameter price is required for limit orders');
|
||||
|
||||
return await this.request.post('open-api/stop-order/create', params);
|
||||
}
|
||||
@@ -274,4 +274,4 @@ module.exports = class RestClient {
|
||||
async getTimeOffset() {
|
||||
return await this.request.getTimeOffset();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user