forked from bitontop/gored
/
model.go
91 lines (80 loc) · 2.57 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package tradesatoshi
// 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 {
Success bool `json:"success"`
Message string `json:"message"`
Result json.RawMessage `json:"result"`
}
type CoinsData []struct {
Currency string `json:"currency"`
CurrencyLong string `json:"currencyLong"`
MinConfirmation int `json:"minConfirmation"`
TxFee float64 `json:"txFee"`
Status string `json:"status"`
StatusMessage string `json:"statusMessage"`
MinBaseTrade float64 `json:"minBaseTrade"`
IsTipEnabled bool `json:"isTipEnabled"`
MinTip float64 `json:"minTip"`
MaxTip float64 `json:"maxTip"`
}
type PairsData []struct {
Market string `json:"market"`
High float64 `json:"high"`
Low float64 `json:"low"`
Volume float64 `json:"volume"`
BaseVolume float64 `json:"baseVolume"`
Last float64 `json:"last"`
Bid float64 `json:"bid"`
Ask float64 `json:"ask"`
OpenBuyOrders int `json:"openBuyOrders"`
OpenSellOrders int `json:"openSellOrders"`
MarketStatus string `json:"marketStatus"`
Change float64 `json:"change"`
}
type OrderBook struct {
Buy []struct {
Quantity float64 `json:"quantity"`
Rate float64 `json:"rate"`
} `json:"buy"`
Sell []struct {
Quantity float64 `json:"quantity"`
Rate float64 `json:"rate"`
} `json:"sell"`
}
type AccountBalances []struct {
Currency string `json:"currency"`
CurrencyLong string `json:"currencyLong"`
Available float64 `json:"available"`
Total float64 `json:"total"`
HeldForTrades float64 `json:"heldForTrades"`
Unconfirmed float64 `json:"unconfirmed"`
PendingWithdraw float64 `json:"pendingWithdraw"`
Address string `json:"address"`
}
type Withdraw struct {
WithdrawalID int `json:"WithdrawalId"`
}
type PlaceOrder struct {
OrderID int `json:"OrderId"`
Filled []int `json:"Filled"`
}
type OrderStatus struct {
ID int `json:"id"`
Market string `json:"market"`
Type string `json:"type"`
Amount float64 `json:"amount"`
Rate float64 `json:"rate"`
Remaining float64 `json:"remaining"`
Total float64 `json:"total"`
Status string `json:"status"`
Timestamp string `json:"timestamp"`
IsAPI bool `json:"isApi"`
}
type CancelOrder struct {
CanceledOrders []int `json:"CanceledOrders"`
}