forked from bitontop/gored
/
model.go
73 lines (63 loc) · 1.83 KB
/
model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package mxc
// Copyright (c) 2015-2019 Bitontop Technologies Inc.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
import (
"encoding/json"
)
type JsonResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data json.RawMessage `json:"data"`
}
type PairsData struct {
PriceScale int `json:"priceScale"`
QuantityScale int `json:"quantityScale"`
MinAmount float64 `json:"minAmount"`
BuyFeeRate float64 `json:"buyFeeRate"`
SellFeeRate float64 `json:"sellFeeRate"`
}
type OrderBook struct {
Asks []struct {
Price string `json:"price"`
Quantity string `json:"quantity"`
} `json:"asks"`
Bids []struct {
Price string `json:"price"`
Quantity string `json:"quantity"`
} `json:"bids"`
}
type AccountBalances struct {
Frozen string `json:"frozen"`
Available string `json:"available"`
}
// type AutoGenerated struct {
// BTC struct {
// Frozen string `json:"frozen"`
// Available string `json:"available"`
// } `json:"BTC"`
// ETH struct {
// Frozen string `json:"frozen"`
// Available string `json:"available"`
// } `json:"ETH"`
// }
type PlaceOrder struct {
OrderID string `json:"data"`
}
type OrderStatus struct {
ID string `json:"id"`
Market string `json:"market"`
Price string `json:"price"`
Status string `json:"status"`
TotalQuantity string `json:"totalQuantity"`
TradedQuantity string `json:"tradedQuantity"`
TradedAmount string `json:"tradedAmount"`
CreateTime string `json:"createTime"`
Type int `json:"type"`
}
type TradeHistory []struct {
TradeTime string `json:"tradeTime"`
TradePrice string `json:"tradePrice"`
TradeQuantity string `json:"tradeQuantity"`
TradeType string `json:"tradeType"`
}