Skip to content

Commit 22d2897

Browse files
committed
update
1 parent 2bafd34 commit 22d2897

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

nodejs/api.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ let getUserOrderPending = function (pair, account_type, page, size) {
180180
{
181181
cmd: "orderpending/orderPendingList",
182182
body: {
183+
account_type: account_type,
183184
pair: pair,
184185
page: page,
185186
size: size
@@ -199,6 +200,7 @@ let getUserOrderHistory = function (pair, account_type, page, size) {
199200
{
200201
cmd: "orderpending/orderHistoryList",
201202
body: {
203+
account_type: account_type,
202204
pair: pair,
203205
page: page,
204206
size: size
@@ -211,6 +213,24 @@ let getUserOrderHistory = function (pair, account_type, page, size) {
211213
});
212214
};
213215

216+
let getOrder = function (order_id, account_type) {
217+
let _func_name_ = 'getOrder';
218+
219+
let cmds = [
220+
{
221+
cmd: "orderpending/order",
222+
body: {
223+
account_type: account_type,
224+
id: String(order_id)
225+
}
226+
}
227+
];
228+
229+
doApiRequestWithApikey(TRADE_URI, cmds, function (res) {
230+
console.log('%s: return:', _func_name_, JSON.stringify(res));
231+
});
232+
};
233+
214234
let doTrade = function (trade_order) {
215235
let _func_name_ = 'doTrade';
216236

@@ -288,6 +308,8 @@ let doTest = function () {
288308
getUserOrderHistory('BIX_BTC', 0, 1, 10);
289309
// user assets
290310
getUserAssets();
311+
// get order info by order id
312+
getOrder("9788952022908451", 0);
291313

292314
//place an order
293315
let trade_order = {
@@ -301,7 +323,7 @@ let doTest = function () {
301323
doTrade(trade_order);
302324

303325
//cancel an order
304-
doCancelTrade(7790955);//orders_id
326+
doCancelTrade("9788952022908451");//orders_id
305327
};
306328

307329
// doTest();

0 commit comments

Comments
 (0)