/
model.go
99 lines (88 loc) · 3.19 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
92
93
94
95
96
97
98
99
package bittrex
// 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"
"github.com/bitontop/gored/exchange"
)
type JsonResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
Result json.RawMessage `json:"result"`
}
type AccountBalances []struct {
Currency string `json:"Currency"`
Balance float64 `json:"Balance"`
Available float64 `json:"Available"`
Pending float64 `json:"Pending"`
CryptoAddress string `json:"CryptoAddress"`
Requested bool `json:"Requested"`
Uuid string `json:"Uuid"`
}
type Uuid struct {
Id string `json:"uuid"`
}
type PlaceOrder struct {
AccountId string
OrderUuid string `json:"OrderUuid"`
Exchange string `json:"Exchange"`
Type string
Quantity float64 `json:"Quantity"`
QuantityRemaining float64 `json:"QuantityRemaining"`
Limit float64 `json:"Limit"`
Reserved float64
ReserveRemaining float64
CommissionReserved float64
CommissionReserveRemaining float64
CommissionPaid float64
Price float64 `json:"Price"`
PricePerUnit float64 `json:"PricePerUnit"`
Opened string
Closed string
IsOpen bool
Sentinel string
CancelInitiated bool
ImmediateOrCancel bool
IsConditional bool
Condition string
ConditionTarget float64
}
type PairsData []struct {
MarketCurrency string `json:"MarketCurrency"`
BaseCurrency string `json:"BaseCurrency"`
MarketCurrencyLong string `json:"MarketCurrencyLong"`
BaseCurrencyLong string `json:"BaseCurrencyLong"`
MinTradeSize float64 `json:"MinTradeSize"`
MarketName string `json:"MarketName"`
IsActive bool `json:"IsActive"`
Created string `json:"Created"`
Notice interface{} `json:"Notice"`
IsSponsored interface{} `json:"IsSponsored"`
LogoURL string `json:"LogoUrl"`
}
type CoinsData []struct {
Currency string `json:"Currency"`
CurrencyLong string `json:"CurrencyLong"`
MinConfirmation int `json:"MinConfirmation"`
TxFee float64 `json:"TxFee"`
IsActive bool `json:"IsActive"`
IsRestricted bool `json:"IsRestricted"`
CoinType string `json:"CoinType"`
BaseAddress string `json:"BaseAddress"`
Notice interface{} `json:"Notice"`
}
type OrderBook struct {
Buy []exchange.Order `json:"buy"`
Sell []exchange.Order `json:"sell"`
}
type TradeHistory []struct {
ID int `json:"Id"`
TimeStamp string `json:"TimeStamp"`
Quantity float64 `json:"Quantity"`
Price float64 `json:"Price"`
Total float64 `json:"Total"`
FillType string `json:"FillType"`
OrderType string `json:"OrderType"`
UUID string `json:"Uuid"`
}