Type/to search

封装Bithumb的ordersDetail接口

Tool
8
Follow
1363
Followers

应部分用户需求,使用bithumb 的时候希望查询 某个ID 的订单信息,
封装了 交易所的这个接口 : https://api.bithumb.com/info/order_detail
只能查询完全成交的订单,其它状态的订单是查询不到的。

接口信息如下:

/* https://api.bithumb.com/info/order_detail order_id : type : bid : Buy ask : sell currency : Currency code ,Default : BTC */
function main() { var id = exchange.Sell(-1, 0.01) // 下市价单 成交,因为 $.GetOrder 只能查询 完全成交的订单。 // 下限价单不成交的话,去查询这个ID ,会报错 Futures_OP 4: status: 5600, message: 거래 체결내역이 존재하지 않습니다. (在交易中不存在), ,意思是查询不到这个订单 Sleep(5000) var order = $.GetOrder(exchange, id) // 传入交易所 Bithumb 的交易所对象, 传入ID ,查询不到 返回 null Log(order) }
Source
JavaScript
function GetOrder(e, id, type){
    /*
        https://api.bithumb.com/info/order_detail
        order_id   :
        type       : bid : Buy ask : sell
        currency   : Currency code ,Default : BTC
    */
    var symbol = e.GetCurrency()
    var arr = symbol.split("_")
    var currency = arr[0]
    
    var ret = e.IO("api", "POST", "/info/order_detail", "order_id=" + id + "&type=" + type + "&currency=" + currency)
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)