-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsubscription_calls.go
185 lines (166 loc) · 7.79 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// Code generated by bin/generate_call.go, DO NOT EDIT.
package deriv
import (
"context"
"github.com/ksysoev/deriv-api/schema"
)
// SubscribeBalance Get user account balance
func (api *Client) SubscribeBalance(ctx context.Context, r schema.Balance) (rsp schema.BalanceResp, s *Subsciption[schema.BalanceResp, schema.BalanceResp], err error) {
id := api.getNextRequestID()
var f schema.BalanceSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.BalanceResp, schema.BalanceResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeBuy Buy a Contract
func (api *Client) SubscribeBuy(ctx context.Context, r schema.Buy) (rsp schema.BuyResp, s *Subsciption[schema.BuyResp, schema.ProposalOpenContractResp], err error) {
id := api.getNextRequestID()
var f schema.BuySubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.BuyResp, schema.ProposalOpenContractResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeCryptoEstimations Get the current estimations for cryptocurrencies. E.g. Withdrawal fee.
func (api *Client) SubscribeCryptoEstimations(ctx context.Context, r schema.CryptoEstimations) (rsp schema.CryptoEstimationsResp, s *Subsciption[schema.CryptoEstimationsResp, schema.CryptoEstimationsResp], err error) {
id := api.getNextRequestID()
var f schema.CryptoEstimationsSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.CryptoEstimationsResp, schema.CryptoEstimationsResp](ctx, api)
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 (api *Client) SubscribeExchangeRates(ctx context.Context, r schema.ExchangeRates) (rsp schema.ExchangeRatesResp, s *Subsciption[schema.ExchangeRatesResp, schema.ExchangeRatesResp], err error) {
id := api.getNextRequestID()
var f schema.ExchangeRatesSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ExchangeRatesResp, schema.ExchangeRatesResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertInfo Retrieve information about a P2P advert.
func (api *Client) SubscribeP2PAdvertInfo(ctx context.Context, r schema.P2PAdvertInfo) (rsp schema.P2PAdvertInfoResp, s *Subsciption[schema.P2PAdvertInfoResp, schema.P2PAdvertInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2PAdvertInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertInfoResp, schema.P2PAdvertInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertiserCreate Registers the client as a P2P advertiser.
func (api *Client) SubscribeP2PAdvertiserCreate(ctx context.Context, r schema.P2PAdvertiserCreate) (rsp schema.P2PAdvertiserCreateResp, s *Subsciption[schema.P2PAdvertiserCreateResp, schema.P2PAdvertInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2PAdvertiserCreateSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertiserCreateResp, schema.P2PAdvertInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PAdvertiserInfo Retrieve information about a P2P advertiser.
func (api *Client) SubscribeP2PAdvertiserInfo(ctx context.Context, r schema.P2PAdvertiserInfo) (rsp schema.P2PAdvertiserInfoResp, s *Subsciption[schema.P2PAdvertiserInfoResp, schema.P2PAdvertiserInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2PAdvertiserInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PAdvertiserInfoResp, schema.P2PAdvertiserInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderCreate Creates a P2P order for the specified advert.
func (api *Client) SubscribeP2POrderCreate(ctx context.Context, r schema.P2POrderCreate) (rsp schema.P2POrderCreateResp, s *Subsciption[schema.P2POrderCreateResp, schema.P2POrderInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2POrderCreateSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderCreateResp, schema.P2POrderInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderInfo Retrieves the information about a P2P order.
func (api *Client) SubscribeP2POrderInfo(ctx context.Context, r schema.P2POrderInfo) (rsp schema.P2POrderInfoResp, s *Subsciption[schema.P2POrderInfoResp, schema.P2POrderInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2POrderInfoSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderInfoResp, schema.P2POrderInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2POrderList List active orders.
func (api *Client) SubscribeP2POrderList(ctx context.Context, r schema.P2POrderList) (rsp schema.P2POrderListResp, s *Subsciption[schema.P2POrderListResp, schema.P2POrderInfoResp], err error) {
id := api.getNextRequestID()
var f schema.P2POrderListSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2POrderListResp, schema.P2POrderInfoResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeP2PSettings Request P2P Settings information.
func (api *Client) SubscribeP2PSettings(ctx context.Context, r schema.P2PSettings) (rsp schema.P2PSettingsResp, s *Subsciption[schema.P2PSettingsResp, schema.P2PSettingsResp], err error) {
id := api.getNextRequestID()
var f schema.P2PSettingsSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.P2PSettingsResp, schema.P2PSettingsResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeProposal Gets latest price for a specific contract.
func (api *Client) SubscribeProposal(ctx context.Context, r schema.Proposal) (rsp schema.ProposalResp, s *Subsciption[schema.ProposalResp, schema.ProposalResp], err error) {
id := api.getNextRequestID()
var f schema.ProposalSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ProposalResp, schema.ProposalResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeProposalOpenContract Get latest price (and other information) for a contract in the user's portfolio
func (api *Client) SubscribeProposalOpenContract(ctx context.Context, r schema.ProposalOpenContract) (rsp schema.ProposalOpenContractResp, s *Subsciption[schema.ProposalOpenContractResp, schema.ProposalOpenContractResp], err error) {
id := api.getNextRequestID()
var f schema.ProposalOpenContractSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.ProposalOpenContractResp, schema.ProposalOpenContractResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeTicks Initiate a continuous stream of spot price updates for a given symbol.
func (api *Client) SubscribeTicks(ctx context.Context, r schema.Ticks) (rsp schema.TicksResp, s *Subsciption[schema.TicksResp, schema.TicksResp], err error) {
id := api.getNextRequestID()
var f schema.TicksSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.TicksResp, schema.TicksResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeTicksBatch Initiate a continuous stream of spot price updates for a group symbols.
func (api *Client) SubscribeTicksBatch(ctx context.Context, r schema.TicksBatch) (rsp schema.TicksBatchResp, s *Subsciption[schema.TicksBatchResp, schema.TicksBatchResp], err error) {
id := api.getNextRequestID()
var f schema.TicksBatchSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.TicksBatchResp, schema.TicksBatchResp](ctx, api)
rsp, err = s.Start(id, r)
return
}
// SubscribeWebsiteStatus Request server status.
func (api *Client) SubscribeWebsiteStatus(ctx context.Context, r schema.WebsiteStatus) (rsp schema.WebsiteStatusResp, s *Subsciption[schema.WebsiteStatusResp, schema.WebsiteStatusResp], err error) {
id := api.getNextRequestID()
var f schema.WebsiteStatusSubscribe = 1
r.ReqId = &id
r.Subscribe = &f
s = NewSubcription[schema.WebsiteStatusResp, schema.WebsiteStatusResp](ctx, api)
rsp, err = s.Start(id, r)
return
}