-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcalls.go
1057 lines (923 loc) · 42.1 KB
/
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by bin/generate_call.go, DO NOT EDIT.
package deriv
import (
"context"
"github.com/ksysoev/deriv-api/schema"
)
// AccountList Returns all accounts belonging to the authorized user.
func (api *Client) AccountList(ctx context.Context, r schema.AccountList) (resp schema.AccountListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ActiveSymbols Retrieve a list of all currently active symbols (underlying markets upon which contracts are available for trading).
func (api *Client) ActiveSymbols(ctx context.Context, r schema.ActiveSymbols) (resp schema.ActiveSymbolsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ApiToken This call manages API tokens
func (api *Client) ApiToken(ctx context.Context, r schema.ApiToken) (resp schema.ApiTokenResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppDelete The request for deleting an application.
func (api *Client) AppDelete(ctx context.Context, r schema.AppDelete) (resp schema.AppDeleteResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppGet To get the information of the OAuth application specified by 'app_id'
func (api *Client) AppGet(ctx context.Context, r schema.AppGet) (resp schema.AppGetResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppList List all of the account's OAuth applications
func (api *Client) AppList(ctx context.Context, r schema.AppList) (resp schema.AppListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppMarkupDetails Retrieve details of `app_markup` according to criteria specified.
func (api *Client) AppMarkupDetails(ctx context.Context, r schema.AppMarkupDetails) (resp schema.AppMarkupDetailsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppMarkupStatistics Retrieve statistics of `app_markup`.
func (api *Client) AppMarkupStatistics(ctx context.Context, r schema.AppMarkupStatistics) (resp schema.AppMarkupStatisticsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppRegister Register a new OAuth application
func (api *Client) AppRegister(ctx context.Context, r schema.AppRegister) (resp schema.AppRegisterResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AppUpdate Update a new OAuth application
func (api *Client) AppUpdate(ctx context.Context, r schema.AppUpdate) (resp schema.AppUpdateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// AssetIndex Retrieve a list of all available underlyings and the corresponding contract types and duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.
func (api *Client) AssetIndex(ctx context.Context, r schema.AssetIndex) (resp schema.AssetIndexResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Authorize Authorize current WebSocket session to act on behalf of the owner of a given token. Must precede requests that need to access client account, for example purchasing and selling contracts or viewing portfolio.
func (api *Client) Authorize(ctx context.Context, r schema.Authorize) (resp schema.AuthorizeResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Balance Get user account balance
func (api *Client) Balance(ctx context.Context, r schema.Balance) (resp schema.BalanceResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Buy Buy a Contract
func (api *Client) Buy(ctx context.Context, r schema.Buy) (resp schema.BuyResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// BuyContractForMultipleAccounts Buy a Contract for multiple Accounts specified by the `tokens` parameter. Note, although this is an authorized call, the contract is not bought for the authorized account.
func (api *Client) BuyContractForMultipleAccounts(ctx context.Context, r schema.BuyContractForMultipleAccounts) (resp schema.BuyContractForMultipleAccountsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Cancel Cancel contract with contract id
func (api *Client) Cancel(ctx context.Context, r schema.Cancel) (resp schema.CancelResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Cashier Request the cashier info for the specified type.
func (api *Client) Cashier(ctx context.Context, r schema.Cashier) (resp schema.CashierResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ConfirmEmail Verifies the email for the user using verification code passed in the request object
func (api *Client) ConfirmEmail(ctx context.Context, r schema.ConfirmEmail) (resp schema.ConfirmEmailResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ContractUpdate Update a contract condition.
func (api *Client) ContractUpdate(ctx context.Context, r schema.ContractUpdate) (resp schema.ContractUpdateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ContractUpdateHistory Request for contract update history.
func (api *Client) ContractUpdateHistory(ctx context.Context, r schema.ContractUpdateHistory) (resp schema.ContractUpdateHistoryResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ContractsFor For a given symbol, get the list of currently available contracts, and the latest barrier and duration limits for each contract.
func (api *Client) ContractsFor(ctx context.Context, r schema.ContractsFor) (resp schema.ContractsForResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ContractsForCompany Get the list of currently available contracts for a given landing company.
func (api *Client) ContractsForCompany(ctx context.Context, r schema.ContractsForCompany) (resp schema.ContractsForCompanyResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CopyStart Start copy trader bets
func (api *Client) CopyStart(ctx context.Context, r schema.CopyStart) (resp schema.CopyStartResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CopyStop Stop copy trader bets
func (api *Client) CopyStop(ctx context.Context, r schema.CopyStop) (resp schema.CopyStopResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CopytradingList Retrieves a list of active copiers and/or traders for Copy Trading
func (api *Client) CopytradingList(ctx context.Context, r schema.CopytradingList) (resp schema.CopytradingListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CopytradingStatistics Retrieve performance, trading, risk and copiers statistics of trader.
func (api *Client) CopytradingStatistics(ctx context.Context, r schema.CopytradingStatistics) (resp schema.CopytradingStatisticsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CryptoConfig The request for cryptocurrencies configuration.
func (api *Client) CryptoConfig(ctx context.Context, r schema.CryptoConfig) (resp schema.CryptoConfigResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// CryptoEstimations Get the current estimations for cryptocurrencies. E.g. Withdrawal fee.
func (api *Client) CryptoEstimations(ctx context.Context, r schema.CryptoEstimations) (resp schema.CryptoEstimationsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// DocumentUpload Request KYC information from client
func (api *Client) DocumentUpload(ctx context.Context, r schema.DocumentUpload) (resp schema.DocumentUploadResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// EconomicCalendar Specify a currency to receive a list of events related to that specific currency. For example, specifying USD will return a list of USD-related events. If the currency is omitted, you will receive a list for all currencies.
func (api *Client) EconomicCalendar(ctx context.Context, r schema.EconomicCalendar) (resp schema.EconomicCalendarResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ExchangeRates Retrieves the exchange rate from a base currency to a target currency supported by the system.
func (api *Client) ExchangeRates(ctx context.Context, r schema.ExchangeRates) (resp schema.ExchangeRatesResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// FinancialAssessmentQuestions This call gets the financial assessment questionnaire structure, which defines the questions, possible answers, and flow logic for the financial assessment form.
func (api *Client) FinancialAssessmentQuestions(ctx context.Context, r schema.FinancialAssessmentQuestions) (resp schema.FinancialAssessmentQuestionsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Forget Immediately cancel the real-time stream of messages with a specific ID.
func (api *Client) Forget(ctx context.Context, r schema.Forget) (resp schema.ForgetResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ForgetAll Immediately cancel the real-time streams of messages of given type.
func (api *Client) ForgetAll(ctx context.Context, r schema.ForgetAll) (resp schema.ForgetAllResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetAccountStatus Get Account Status
func (api *Client) GetAccountStatus(ctx context.Context, r schema.GetAccountStatus) (resp schema.GetAccountStatusResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetFinancialAssessment This call gets the financial assessment details. The 'financial assessment' is a questionnaire that clients of certain Landing Companies need to complete, due to regulatory and KYC (know your client) requirements.
func (api *Client) GetFinancialAssessment(ctx context.Context, r schema.GetFinancialAssessment) (resp schema.GetFinancialAssessmentResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetLimits Trading and Withdrawal Limits for a given user
func (api *Client) GetLimits(ctx context.Context, r schema.GetLimits) (resp schema.GetLimitsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetSelfExclusion Allows users to exclude themselves from the website for certain periods of time, or to set limits on their trading activities. This facility is a regulatory requirement for certain Landing Companies.
func (api *Client) GetSelfExclusion(ctx context.Context, r schema.GetSelfExclusion) (resp schema.GetSelfExclusionResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetSettings Get User Settings (email, date of birth, address etc)
func (api *Client) GetSettings(ctx context.Context, r schema.GetSettings) (resp schema.GetSettingsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// GetThirdPartyRedirect Get Third Party Redirect URL for sso login.
func (api *Client) GetThirdPartyRedirect(ctx context.Context, r schema.GetThirdPartyRedirect) (resp schema.GetThirdPartyRedirectResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// IdentityVerificationDocumentAdd Adds document information such as issuing country, id and type for identity verification processes.
func (api *Client) IdentityVerificationDocumentAdd(ctx context.Context, r schema.IdentityVerificationDocumentAdd) (resp schema.IdentityVerificationDocumentAddResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// KycAuthStatus Get KYC Authentication Status
func (api *Client) KycAuthStatus(ctx context.Context, r schema.KycAuthStatus) (resp schema.KycAuthStatusResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// LandingCompany The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies. This call will return the appropriate Landing Company for clients of a given country. The landing company may differ for derived contracts (Synthetic Indices) and Financial contracts (Forex, Stock Indices, Commodities).
func (api *Client) LandingCompany(ctx context.Context, r schema.LandingCompany) (resp schema.LandingCompanyResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// LandingCompanyDetails The company has a number of licensed subsidiaries in various jurisdictions, which are called Landing Companies (and which are wholly owned subsidiaries of the Deriv Group). This call provides information about each Landing Company.
func (api *Client) LandingCompanyDetails(ctx context.Context, r schema.LandingCompanyDetails) (resp schema.LandingCompanyDetailsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// LoginHistory Retrieve a summary of login history for user.
func (api *Client) LoginHistory(ctx context.Context, r schema.LoginHistory) (resp schema.LoginHistoryResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Logout Logout the session
func (api *Client) Logout(ctx context.Context, r schema.Logout) (resp schema.LogoutResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5Deposit This call allows deposit into MT5 account from Binary account.
func (api *Client) Mt5Deposit(ctx context.Context, r schema.Mt5Deposit) (resp schema.Mt5DepositResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5GetSettings Get MT5 user account settings
func (api *Client) Mt5GetSettings(ctx context.Context, r schema.Mt5GetSettings) (resp schema.Mt5GetSettingsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5LoginList Get list of MT5 accounts for client
func (api *Client) Mt5LoginList(ctx context.Context, r schema.Mt5LoginList) (resp schema.Mt5LoginListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5NewAccount This call creates new MT5 user, either demo or real money user.
func (api *Client) Mt5NewAccount(ctx context.Context, r schema.Mt5NewAccount) (resp schema.Mt5NewAccountResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5PasswordChange To change passwords of the MT5 account.
func (api *Client) Mt5PasswordChange(ctx context.Context, r schema.Mt5PasswordChange) (resp schema.Mt5PasswordChangeResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5PasswordCheck This call validates the main password for the MT5 user
func (api *Client) Mt5PasswordCheck(ctx context.Context, r schema.Mt5PasswordCheck) (resp schema.Mt5PasswordCheckResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5PasswordReset To reset the password of MT5 account.
func (api *Client) Mt5PasswordReset(ctx context.Context, r schema.Mt5PasswordReset) (resp schema.Mt5PasswordResetResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Mt5Withdrawal This call allows withdrawal from MT5 account to Binary account.
func (api *Client) Mt5Withdrawal(ctx context.Context, r schema.Mt5Withdrawal) (resp schema.Mt5WithdrawalResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// NewAccountMaltainvest This call opens a new real-money account with the `maltainvest` Landing Company. This call can be made from a virtual-money account or real-money account at Deriv (Europe) Limited. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.
func (api *Client) NewAccountMaltainvest(ctx context.Context, r schema.NewAccountMaltainvest) (resp schema.NewAccountMaltainvestResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// NewAccountReal This call opens a new real-money account. This call can be made from a virtual-money or a real-money account. If it is the latter, client information fields in this call will be ignored and data from your existing real-money account will be used.
func (api *Client) NewAccountReal(ctx context.Context, r schema.NewAccountReal) (resp schema.NewAccountRealResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// NewAccountVirtual Create a new virtual-money account.
func (api *Client) NewAccountVirtual(ctx context.Context, r schema.NewAccountVirtual) (resp schema.NewAccountVirtualResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// NewPartnerAccount This call opens a new Real-Partner Account
func (api *Client) NewPartnerAccount(ctx context.Context, r schema.NewPartnerAccount) (resp schema.NewPartnerAccountResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// OauthApps List all my used OAuth applications.
func (api *Client) OauthApps(ctx context.Context, r schema.OauthApps) (resp schema.OauthAppsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertCreate Creates a P2P (Peer to Peer) advert. Can only be used by an approved P2P advertiser.
func (api *Client) P2PAdvertCreate(ctx context.Context, r schema.P2PAdvertCreate) (resp schema.P2PAdvertCreateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertInfo Retrieve information about a P2P advert.
func (api *Client) P2PAdvertInfo(ctx context.Context, r schema.P2PAdvertInfo) (resp schema.P2PAdvertInfoResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertList Returns available adverts for use with `p2p_order_create` .
func (api *Client) P2PAdvertList(ctx context.Context, r schema.P2PAdvertList) (resp schema.P2PAdvertListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertUpdate Updates a P2P advert. Can only be used by the advertiser.
func (api *Client) P2PAdvertUpdate(ctx context.Context, r schema.P2PAdvertUpdate) (resp schema.P2PAdvertUpdateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserAdverts Returns all P2P adverts created by the authorized client. Can only be used by a registered P2P advertiser.
func (api *Client) P2PAdvertiserAdverts(ctx context.Context, r schema.P2PAdvertiserAdverts) (resp schema.P2PAdvertiserAdvertsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserCreate Registers the client as a P2P advertiser.
func (api *Client) P2PAdvertiserCreate(ctx context.Context, r schema.P2PAdvertiserCreate) (resp schema.P2PAdvertiserCreateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserInfo Retrieve information about a P2P advertiser.
func (api *Client) P2PAdvertiserInfo(ctx context.Context, r schema.P2PAdvertiserInfo) (resp schema.P2PAdvertiserInfoResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserList Retrieve advertisers has/had trade with the current advertiser.
func (api *Client) P2PAdvertiserList(ctx context.Context, r schema.P2PAdvertiserList) (resp schema.P2PAdvertiserListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserPaymentMethods Manage or list P2P advertiser payment methods.
func (api *Client) P2PAdvertiserPaymentMethods(ctx context.Context, r schema.P2PAdvertiserPaymentMethods) (resp schema.P2PAdvertiserPaymentMethodsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserRelations Updates and returns favourite and blocked advertisers of the current user.
func (api *Client) P2PAdvertiserRelations(ctx context.Context, r schema.P2PAdvertiserRelations) (resp schema.P2PAdvertiserRelationsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PAdvertiserUpdate Update the information of the P2P advertiser for the current account. Can only be used by an approved P2P advertiser.
func (api *Client) P2PAdvertiserUpdate(ctx context.Context, r schema.P2PAdvertiserUpdate) (resp schema.P2PAdvertiserUpdateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PChatCreate Creates a P2P chat for the specified order.
func (api *Client) P2PChatCreate(ctx context.Context, r schema.P2PChatCreate) (resp schema.P2PChatCreateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PCountryList List all or specific country and its payment methods.
func (api *Client) P2PCountryList(ctx context.Context, r schema.P2PCountryList) (resp schema.P2PCountryListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderCancel Cancel a P2P order.
func (api *Client) P2POrderCancel(ctx context.Context, r schema.P2POrderCancel) (resp schema.P2POrderCancelResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderConfirm Confirm a P2P order.
func (api *Client) P2POrderConfirm(ctx context.Context, r schema.P2POrderConfirm) (resp schema.P2POrderConfirmResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderCreate Creates a P2P order for the specified advert.
func (api *Client) P2POrderCreate(ctx context.Context, r schema.P2POrderCreate) (resp schema.P2POrderCreateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderDispute Dispute a P2P order.
func (api *Client) P2POrderDispute(ctx context.Context, r schema.P2POrderDispute) (resp schema.P2POrderDisputeResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderInfo Retrieves the information about a P2P order.
func (api *Client) P2POrderInfo(ctx context.Context, r schema.P2POrderInfo) (resp schema.P2POrderInfoResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderList List active orders.
func (api *Client) P2POrderList(ctx context.Context, r schema.P2POrderList) (resp schema.P2POrderListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2POrderReview Creates a review for the specified order.
func (api *Client) P2POrderReview(ctx context.Context, r schema.P2POrderReview) (resp schema.P2POrderReviewResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PPaymentMethods List all P2P payment methods.
func (api *Client) P2PPaymentMethods(ctx context.Context, r schema.P2PPaymentMethods) (resp schema.P2PPaymentMethodsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PPing Keeps the connection alive and updates the P2P advertiser's online status. The advertiser will be considered offline 60 seconds after a call is made.
func (api *Client) P2PPing(ctx context.Context, r schema.P2PPing) (resp schema.P2PPingResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// P2PSettings Request P2P Settings information.
func (api *Client) P2PSettings(ctx context.Context, r schema.P2PSettings) (resp schema.P2PSettingsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PartnerAccountCreation This call initiates the state machine for account creation process
func (api *Client) PartnerAccountCreation(ctx context.Context, r schema.PartnerAccountCreation) (resp schema.PartnerAccountCreationResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PartnerAccountCreationStatus This call polls the state machine and returns the completion status for each step.
func (api *Client) PartnerAccountCreationStatus(ctx context.Context, r schema.PartnerAccountCreationStatus) (resp schema.PartnerAccountCreationStatusResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PartnerAccounts Get All Partner Accounts (Partner account details like website, provider, company details)
func (api *Client) PartnerAccounts(ctx context.Context, r schema.PartnerAccounts) (resp schema.PartnerAccountsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PartnerSettings Get Partner Settings (Partner Type, Company Details etc)
func (api *Client) PartnerSettings(ctx context.Context, r schema.PartnerSettings) (resp schema.PartnerSettingsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PartnerSettingsUpdate A message with Partner Settings
func (api *Client) PartnerSettingsUpdate(ctx context.Context, r schema.PartnerSettingsUpdate) (resp schema.PartnerSettingsUpdateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentMethods Will return a list payment methods available for the given country. If the request is authenticated the client's residence country will be used.
func (api *Client) PaymentMethods(ctx context.Context, r schema.PaymentMethods) (resp schema.PaymentMethodsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentCreate Saves client's payment agent details.
func (api *Client) PaymentagentCreate(ctx context.Context, r schema.PaymentagentCreate) (resp schema.PaymentagentCreateResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentDetails Gets client's payment agent details.
func (api *Client) PaymentagentDetails(ctx context.Context, r schema.PaymentagentDetails) (resp schema.PaymentagentDetailsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentList Will return a list of Payment Agents for a given country for a given currency. Payment agents allow users to deposit and withdraw funds using local payment methods that might not be available via the main website's cashier system.
func (api *Client) PaymentagentList(ctx context.Context, r schema.PaymentagentList) (resp schema.PaymentagentListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentTransfer Payment Agent Transfer - this call is available only to accounts that are approved Payment Agents.
func (api *Client) PaymentagentTransfer(ctx context.Context, r schema.PaymentagentTransfer) (resp schema.PaymentagentTransferResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentWithdraw Initiate a withdrawal to an approved Payment Agent.
func (api *Client) PaymentagentWithdraw(ctx context.Context, r schema.PaymentagentWithdraw) (resp schema.PaymentagentWithdrawResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PaymentagentWithdrawJustification Provide justification to perform withdrawal using a Payment Agent.
func (api *Client) PaymentagentWithdrawJustification(ctx context.Context, r schema.PaymentagentWithdrawJustification) (resp schema.PaymentagentWithdrawJustificationResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// PayoutCurrencies Retrieve a list of available option payout currencies. If a user is logged in, only the currencies available for the account will be returned.
func (api *Client) PayoutCurrencies(ctx context.Context, r schema.PayoutCurrencies) (resp schema.PayoutCurrenciesResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Ping To send the ping request to the server. Mostly used to test the connection or to keep it alive.
func (api *Client) Ping(ctx context.Context, r schema.Ping) (resp schema.PingResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Portfolio Receive information about my current portfolio of outstanding options
func (api *Client) Portfolio(ctx context.Context, r schema.Portfolio) (resp schema.PortfolioResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ProfitTable Retrieve a summary of account Profit Table, according to given search criteria
func (api *Client) ProfitTable(ctx context.Context, r schema.ProfitTable) (resp schema.ProfitTableResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Proposal Gets latest price for a specific contract.
func (api *Client) Proposal(ctx context.Context, r schema.Proposal) (resp schema.ProposalResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ProposalOpenContract Get latest price (and other information) for a contract in the user's portfolio
func (api *Client) ProposalOpenContract(ctx context.Context, r schema.ProposalOpenContract) (resp schema.ProposalOpenContractResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// RealityCheck Retrieve summary of client's trades and account for the Reality Check facility. A 'reality check' means a display of time elapsed since the session began, and associated client profit/loss. The Reality Check facility is a regulatory requirement for certain landing companies.
func (api *Client) RealityCheck(ctx context.Context, r schema.RealityCheck) (resp schema.RealityCheckResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// ResidenceList This call returns a list of countries and 2-letter country codes, suitable for populating the account opening form.
func (api *Client) ResidenceList(ctx context.Context, r schema.ResidenceList) (resp schema.ResidenceListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// RevokeOauthApp Used for revoking access of particular app.
func (api *Client) RevokeOauthApp(ctx context.Context, r schema.RevokeOauthApp) (resp schema.RevokeOauthAppResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Sell Sell a Contract as identified from a previous `portfolio` call.
func (api *Client) Sell(ctx context.Context, r schema.Sell) (resp schema.SellResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SellContractForMultipleAccounts Sell contracts for multiple accounts simultaneously. Uses the shortcode response from `buy_contract_for_multiple_accounts` to identify the contract, and authorisation tokens to select which accounts to sell those contracts on. Note that only the accounts identified by the tokens will be affected. This will not sell the contract on the currently-authorised account unless you include the token for the current account.
func (api *Client) SellContractForMultipleAccounts(ctx context.Context, r schema.SellContractForMultipleAccounts) (resp schema.SellContractForMultipleAccountsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SellExpired This call will try to sell any expired contracts and return the number of sold contracts.
func (api *Client) SellExpired(ctx context.Context, r schema.SellExpired) (resp schema.SellExpiredResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SetAccountCurrency Set account currency, this will be default currency for your account i.e currency for trading, deposit. Please note that account currency can only be set once, and then can never be changed.
func (api *Client) SetAccountCurrency(ctx context.Context, r schema.SetAccountCurrency) (resp schema.SetAccountCurrencyResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SetFinancialAssessment This call sets the financial assessment details based on the client's answers to analyze whether they possess the experience and knowledge to understand the risks involved with binary options trading.
func (api *Client) SetFinancialAssessment(ctx context.Context, r schema.SetFinancialAssessment) (resp schema.SetFinancialAssessmentResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SetSelfExclusion Set Self-Exclusion (this call should be used in conjunction with `get_self_exclusion`)
func (api *Client) SetSelfExclusion(ctx context.Context, r schema.SetSelfExclusion) (resp schema.SetSelfExclusionResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// SetSettings Set User Settings (this call should be used in conjunction with `get_settings`)
func (api *Client) SetSettings(ctx context.Context, r schema.SetSettings) (resp schema.SetSettingsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Statement Retrieve a summary of account transactions, according to given search criteria
func (api *Client) Statement(ctx context.Context, r schema.Statement) (resp schema.StatementResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// StatesList For a given country, returns a list of States of that country. This is useful to populate the account opening form.
func (api *Client) StatesList(ctx context.Context, r schema.StatesList) (resp schema.StatesListResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Ticks Initiate a continuous stream of spot price updates for a given symbol.
func (api *Client) Ticks(ctx context.Context, r schema.Ticks) (resp schema.TicksResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TicksBatch Initiate a continuous stream of spot price updates for a group symbols.
func (api *Client) TicksBatch(ctx context.Context, r schema.TicksBatch) (resp schema.TicksBatchResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TicksHistory Get historic tick data for a given symbol.
func (api *Client) TicksHistory(ctx context.Context, r schema.TicksHistory) (resp schema.TicksHistoryResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// Time Request back-end server epoch time.
func (api *Client) Time(ctx context.Context, r schema.Time) (resp schema.TimeResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TinValidations Get the validations for Tax Identification Numbers (TIN)
func (api *Client) TinValidations(ctx context.Context, r schema.TinValidations) (resp schema.TinValidationsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TncApproval To approve the latest version of terms and conditions.
func (api *Client) TncApproval(ctx context.Context, r schema.TncApproval) (resp schema.TncApprovalResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TopupVirtual When a virtual-money's account balance becomes low, it can be topped up using this call.
func (api *Client) TopupVirtual(ctx context.Context, r schema.TopupVirtual) (resp schema.TopupVirtualResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TradingDurations Retrieve a list of all available underlyings and the corresponding contract types and trading duration boundaries. If the user is logged in, only the assets available for that user's landing company will be returned.
func (api *Client) TradingDurations(ctx context.Context, r schema.TradingDurations) (resp schema.TradingDurationsResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TradingPlatformInvestorPasswordReset Reset the investor password of a Trading Platform Account
func (api *Client) TradingPlatformInvestorPasswordReset(ctx context.Context, r schema.TradingPlatformInvestorPasswordReset) (resp schema.TradingPlatformInvestorPasswordResetResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TradingPlatformPasswordReset Reset the password of a Trading Platform Account
func (api *Client) TradingPlatformPasswordReset(ctx context.Context, r schema.TradingPlatformPasswordReset) (resp schema.TradingPlatformPasswordResetResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TradingPlatformStatus Request trading platform status
func (api *Client) TradingPlatformStatus(ctx context.Context, r schema.TradingPlatformStatus) (resp schema.TradingPlatformStatusResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}
// TradingServers Get the list of servers for a trading platform.
func (api *Client) TradingServers(ctx context.Context, r schema.TradingServers) (resp schema.TradingServersResp, err error) {
id := api.getNextRequestID()
r.ReqId = &id
err = api.SendRequest(ctx, id, r, &resp)
return
}