Hedgex Single User Interface

H5 rest apiļ¼Œ URL : https://api.triple.fi

1. GET /contract/trade_pairs get the trade pair list

parameter

none

result

{
    "result": true,
    "data":[
		{
            "contract":"contract address",
            "margin_address":"margin erc20 address",
            "margin_coin":"margin coin name",
            "trade_coin":"trade coin name"
        }
	]
}

2. GET /contract/kline get the kline data from current time(now)

parameter

Name Type Description
contract string contract address, as “0x0x1660854c03b461E6BC07f94567D1D6E6bF99a1A9”
type string kline’s type. There are “m1″,”m3″,”m5″,”m10″,”m15″,”m30″,”h1″,”h2″,”h4″,”h6″,”h12″,”d1″,”w1″,”M1″,”y1”
count int data’s count, max is 2000

result

{
    "result": true,
    "data":[
		["open","high","low","close","ts"]
	]
}
Name Type Description
open int open price
high int highest price
low int lowest price
close int close price
ts int the timestamp as second, the earliest time is the first one

3. GET /account/trade get user’s trade list

parameter

Name Type Description
contract string contract address, as “0x0x1660854c03b461E6BC07f94567D1D6E6bF99a1A9”
account string user’s wallet address
count int the count of list, max is 100 latest

result

{
    "result": true,
    "data":[
		{
            "tx":"transaction hash",
            "block":12234,
            "direction":1,
            "amount":10,
            "price":52346
        }
	]
}
Name Type Description
block int the blocknumber when explosive happen
direction int 1:open long,-1:open short,-2:close long,2:close short
amount int piece
price int the price of one piece

4. GET /account/explosive get the user’s explosive list

parameter

Name Type Description
contract string contract address, as “0x0x1660854c03b461E6BC07f94567D1D6E6bF99a1A9”
account string user’s wallet address
count int the count of list, max is 100 latest

result

{
    "result": true,
    "data":[
		{
            "tx":"transaction hash",
            "block":12234,
            "amount":10,
            "price":52346
        }
	]
}
Name Type Description
block int the blocknumber when explosive happen
amount int piece
price int the price of one piece

5. /account/interest get user’s interest records

parameter

Name Type Description
contract string contract address, as “0x0x1660854c03b461E6BC07f94567D1D6E6bF99a1A9”
account string user’s wallet address
count int the count of list, max is 100 latest

result

{
    "result": true,
    "data":[
		{
            "tx":"transaction hash",
            "block":12234,
            "amount":10,
            "price":52346
        }
	]
}
Name Type Description
block int the blocknumber when explosive happen
amount int the margin’s amount
price int the price of one piece

GitHub

View Github