-
Notifications
You must be signed in to change notification settings - Fork 4
/
subscription_calls.go
171 lines (153 loc) · 6.85 KB
/
subscription_calls.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// Code generated by bin/generate_call.go, DO NOT EDIT.
package deriv
import "github.com/ksysoev/deriv-api/schema"
// SubscribeBalance Get user account balance
func (a *DerivAPI) SubscribeBalance(r schema.Balance) (rsp schema.BalanceResp, s *Subsciption[schema.BalanceResp, schema.BalanceResp], err error) {
id := a.getNextRequestID()
var f schema.BalanceSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.BalanceResp, schema.BalanceResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeBuy Buy a Contract
func (a *DerivAPI) SubscribeBuy(r schema.Buy) (rsp schema.BuyResp, s *Subsciption[schema.BuyResp, schema.ProposalOpenContractResp], err error) {
id := a.getNextRequestID()
var f schema.BuySubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.BuyResp, schema.ProposalOpenContractResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeCryptoEstimations Get the current estimations for cryptocurrencies. E.g. Withdrawal fee.
func (a *DerivAPI) SubscribeCryptoEstimations(r schema.CryptoEstimations) (rsp schema.CryptoEstimationsResp, s *Subsciption[schema.CryptoEstimationsResp, schema.CryptoEstimationsResp], err error) {
id := a.getNextRequestID()
var f schema.CryptoEstimationsSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.CryptoEstimationsResp, schema.CryptoEstimationsResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeExchangeRates Retrieves the exchange rate from a base currency to a target currency supported by the system.
func (a *DerivAPI) SubscribeExchangeRates(r schema.ExchangeRates) (rsp schema.ExchangeRatesResp, s *Subsciption[schema.ExchangeRatesResp, schema.ExchangeRatesResp], err error) {
id := a.getNextRequestID()
var f schema.ExchangeRatesSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ExchangeRatesResp, schema.ExchangeRatesResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertInfo Retrieve information about a P2P advert.
func (a *DerivAPI) SubscribeP2PAdvertInfo(r schema.P2PAdvertInfo) (rsp schema.P2PAdvertInfoResp, s *Subsciption[schema.P2PAdvertInfoResp, schema.P2PAdvertInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2PAdvertInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertInfoResp, schema.P2PAdvertInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertiserCreate Registers the client as a P2P advertiser.
func (a *DerivAPI) SubscribeP2PAdvertiserCreate(r schema.P2PAdvertiserCreate) (rsp schema.P2PAdvertiserCreateResp, s *Subsciption[schema.P2PAdvertiserCreateResp, schema.P2PAdvertInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2PAdvertiserCreateSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertiserCreateResp, schema.P2PAdvertInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertiserInfo Retrieve information about a P2P advertiser.
func (a *DerivAPI) SubscribeP2PAdvertiserInfo(r schema.P2PAdvertiserInfo) (rsp schema.P2PAdvertiserInfoResp, s *Subsciption[schema.P2PAdvertiserInfoResp, schema.P2PAdvertiserInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2PAdvertiserInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertiserInfoResp, schema.P2PAdvertiserInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderCreate Creates a P2P order for the specified advert.
func (a *DerivAPI) SubscribeP2POrderCreate(r schema.P2POrderCreate) (rsp schema.P2POrderCreateResp, s *Subsciption[schema.P2POrderCreateResp, schema.P2POrderInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2POrderCreateSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderCreateResp, schema.P2POrderInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderInfo Retrieves the information about a P2P order.
func (a *DerivAPI) SubscribeP2POrderInfo(r schema.P2POrderInfo) (rsp schema.P2POrderInfoResp, s *Subsciption[schema.P2POrderInfoResp, schema.P2POrderInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2POrderInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderInfoResp, schema.P2POrderInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderList List active orders.
func (a *DerivAPI) SubscribeP2POrderList(r schema.P2POrderList) (rsp schema.P2POrderListResp, s *Subsciption[schema.P2POrderListResp, schema.P2POrderInfoResp], err error) {
id := a.getNextRequestID()
var f schema.P2POrderListSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderListResp, schema.P2POrderInfoResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PSettings Request P2P Settings information.
func (a *DerivAPI) SubscribeP2PSettings(r schema.P2PSettings) (rsp schema.P2PSettingsResp, s *Subsciption[schema.P2PSettingsResp, schema.P2PSettingsResp], err error) {
id := a.getNextRequestID()
var f schema.P2PSettingsSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PSettingsResp, schema.P2PSettingsResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeProposal Gets latest price for a specific contract.
func (a *DerivAPI) SubscribeProposal(r schema.Proposal) (rsp schema.ProposalResp, s *Subsciption[schema.ProposalResp, schema.ProposalResp], err error) {
id := a.getNextRequestID()
var f schema.ProposalSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ProposalResp, schema.ProposalResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeProposalOpenContract Get latest price (and other information) for a contract in the user's portfolio
func (a *DerivAPI) SubscribeProposalOpenContract(r schema.ProposalOpenContract) (rsp schema.ProposalOpenContractResp, s *Subsciption[schema.ProposalOpenContractResp, schema.ProposalOpenContractResp], err error) {
id := a.getNextRequestID()
var f schema.ProposalOpenContractSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ProposalOpenContractResp, schema.ProposalOpenContractResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeTicks Initiate a continuous stream of spot price updates for a given symbol.
func (a *DerivAPI) SubscribeTicks(r schema.Ticks) (rsp schema.TicksResp, s *Subsciption[schema.TicksResp, schema.TicksResp], err error) {
id := a.getNextRequestID()
var f schema.TicksSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.TicksResp, schema.TicksResp](a)
rsp, err = s.Start(id, r)
return
}
// SubscribeWebsiteStatus Request server status.
func (a *DerivAPI) SubscribeWebsiteStatus(r schema.WebsiteStatus) (rsp schema.WebsiteStatusResp, s *Subsciption[schema.WebsiteStatusResp, schema.WebsiteStatusResp], err error) {
id := a.getNextRequestID()
var f schema.WebsiteStatusSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.WebsiteStatusResp, schema.WebsiteStatusResp](a)
rsp, err = s.Start(id, r)
return
}