diff --git a/calls.go b/calls.go index 9c1661b..d56f58c 100644 --- a/calls.go +++ b/calls.go @@ -860,6 +860,14 @@ func (a *DerivAPI) Time(r schema.Time) (resp schema.TimeResp, err error) { return } +// TinValidations Get the validations for Tax Identification Numbers (TIN) +func (a *DerivAPI) TinValidations(r schema.TinValidations) (resp schema.TinValidationsResp, err error) { + id := a.getNextRequestID() + r.ReqId = &id + err = a.SendRequest(id, r, &resp) + return +} + // TncApproval To approve the latest version of terms and conditions. func (a *DerivAPI) TncApproval(r schema.TncApproval) (resp schema.TncApprovalResp, err error) { id := a.getNextRequestID() diff --git a/schema/active_symbols.go b/schema/active_symbols.go index e985e0f..7cdf2fe 100644 --- a/schema/active_symbols.go +++ b/schema/active_symbols.go @@ -27,8 +27,8 @@ type ActiveSymbols struct { // what you specify in this field. LandingCompanyShort *ActiveSymbolsLandingCompanyShort `json:"landing_company_short,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/api_token.go b/schema/api_token.go index b47f811..930d401 100644 --- a/schema/api_token.go +++ b/schema/api_token.go @@ -14,8 +14,8 @@ type ApiToken struct { // [Optional] The token to remove. DeleteToken *string `json:"delete_token,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] The name of the created token. diff --git a/schema/app_delete.go b/schema/app_delete.go index ec9359e..66b6cef 100644 --- a/schema/app_delete.go +++ b/schema/app_delete.go @@ -10,8 +10,8 @@ type AppDelete struct { // Application app_id AppDelete int `json:"app_delete"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/app_get.go b/schema/app_get.go index 32cb403..a570eb3 100644 --- a/schema/app_get.go +++ b/schema/app_get.go @@ -10,8 +10,8 @@ type AppGet struct { // Application app_id AppGet int `json:"app_get"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/app_list.go b/schema/app_list.go index beb9e29..85152aa 100644 --- a/schema/app_list.go +++ b/schema/app_list.go @@ -11,8 +11,8 @@ type AppList struct { // Must be `1` AppList AppListAppList `json:"app_list"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/app_markup_details.go b/schema/app_markup_details.go index c07ef08..b6c25b9 100644 --- a/schema/app_markup_details.go +++ b/schema/app_markup_details.go @@ -29,8 +29,8 @@ type AppMarkupDetails struct { // [Optional] Apply upper limit to count of transactions received. Limit float64 `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Number of transactions to skip. diff --git a/schema/app_markup_statistics.go b/schema/app_markup_statistics.go index b12d20d..335fabf 100644 --- a/schema/app_markup_statistics.go +++ b/schema/app_markup_statistics.go @@ -17,8 +17,8 @@ type AppMarkupStatistics struct { // End date (epoch or YYYY-MM-DD HH::MM::SS). Results are inclusive of this time. DateTo string `json:"date_to"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/app_register.go b/schema/app_register.go index 50f4f42..5efd9df 100644 --- a/schema/app_register.go +++ b/schema/app_register.go @@ -27,8 +27,8 @@ type AppRegister struct { // [Optional] Application's homepage URL. Homepage *string `json:"homepage,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Application name. diff --git a/schema/app_update.go b/schema/app_update.go index 6c29332..df05770 100644 --- a/schema/app_update.go +++ b/schema/app_update.go @@ -27,8 +27,8 @@ type AppUpdate struct { // [Optional] Application's homepage URL. Homepage *string `json:"homepage,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Application name. diff --git a/schema/asset_index.go b/schema/asset_index.go index 2403756..e6ef511 100644 --- a/schema/asset_index.go +++ b/schema/asset_index.go @@ -20,8 +20,8 @@ type AssetIndex struct { // landing company. LandingCompanyShort *AssetIndexLandingCompanyShort `json:"landing_company_short,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/authorize.go b/schema/authorize.go index a0d5ec1..ef9570f 100644 --- a/schema/authorize.go +++ b/schema/authorize.go @@ -15,7 +15,8 @@ type Authorize struct { AddToLoginHistory AuthorizeAddToLoginHistory `json:"add_to_login_history,omitempty"` // Authentication token. May be retrieved from - // https://www.binary.com/en/user/security/api_tokenws.html + // https://www.binary.com/en/user/security/api_tokenws.html. Set to MULTI when + // using multiple tokens. Authorize string `json:"authorize"` // [Optional] Used to pass data through the websocket, which may be retrieved via @@ -26,7 +27,7 @@ type Authorize struct { ReqId *int `json:"req_id,omitempty"` // Additional Authentication tokens of authorized user that may be used in this - // session. Upto 10 tokens. + // session. Upto 25 tokens. Tokens []string `json:"tokens,omitempty"` } @@ -78,8 +79,8 @@ func (j *Authorize) UnmarshalJSON(b []byte) error { if v, ok := raw["add_to_login_history"]; !ok || v == nil { plain.AddToLoginHistory = 0.0 } - if len(plain.Tokens) > 10 { - return fmt.Errorf("field %s length: must be <= %d", "tokens", 10) + if len(plain.Tokens) > 25 { + return fmt.Errorf("field %s length: must be <= %d", "tokens", 25) } *j = Authorize(plain) return nil diff --git a/schema/balance.go b/schema/balance.go index a13c299..7ddc706 100644 --- a/schema/balance.go +++ b/schema/balance.go @@ -16,8 +16,8 @@ type Balance struct { // Must be `1` Balance BalanceBalance `json:"balance"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/buy.go b/schema/buy.go index 4bb518d..a23e970 100644 --- a/schema/buy.go +++ b/schema/buy.go @@ -12,8 +12,8 @@ type Buy struct { // contract buy parameters are passed in the `parameters` field. Buy string `json:"buy"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass the parameters for contract buy. diff --git a/schema/buy_contract_for_multiple_accounts.go b/schema/buy_contract_for_multiple_accounts.go index 02ba181..3aa6725 100644 --- a/schema/buy_contract_for_multiple_accounts.go +++ b/schema/buy_contract_for_multiple_accounts.go @@ -14,8 +14,8 @@ type BuyContractForMultipleAccounts struct { // contract buy parameters are passed in the `parameters` field. BuyContractForMultipleAccounts string `json:"buy_contract_for_multiple_accounts"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass the parameters for contract buy. diff --git a/schema/cancel.go b/schema/cancel.go index a732f9d..e850242 100644 --- a/schema/cancel.go +++ b/schema/cancel.go @@ -10,8 +10,8 @@ type Cancel struct { // Value should be the `contract_id` which received from the `portfolio` call. Cancel int `json:"cancel"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/cashier.go b/schema/cashier.go index 02f6892..a899ffd 100644 --- a/schema/cashier.go +++ b/schema/cashier.go @@ -26,8 +26,8 @@ type Cashier struct { // in order to prioritise their withdrawal request. EstimatedFeeUniqueId *string `json:"estimated_fee_unique_id,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/contract_update.go b/schema/contract_update.go index c9de157..6a9f3fb 100644 --- a/schema/contract_update.go +++ b/schema/contract_update.go @@ -17,8 +17,8 @@ type ContractUpdate struct { // Specify limit order to update. LimitOrder ContractUpdateLimitOrder `json:"limit_order"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/contract_update_history.go b/schema/contract_update_history.go index 05e4380..8614c9a 100644 --- a/schema/contract_update_history.go +++ b/schema/contract_update_history.go @@ -17,8 +17,8 @@ type ContractUpdateHistory struct { // [Optional] Maximum number of historical updates to receive. Limit float64 `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/contracts_for.go b/schema/contracts_for.go index 8f56130..4f764a6 100644 --- a/schema/contracts_for.go +++ b/schema/contracts_for.go @@ -25,8 +25,8 @@ type ContractsFor struct { // take precendce until the deprecated field is removed from the api. LandingCompanyShort ContractsForLandingCompanyShort `json:"landing_company_short,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/copy_start.go b/schema/copy_start.go index 3f9755b..13b76f5 100644 --- a/schema/copy_start.go +++ b/schema/copy_start.go @@ -13,8 +13,8 @@ type CopyStart struct { // API tokens identifying the accounts of trader which will be used to copy trades CopyStart string `json:"copy_start"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to set maximum trade stake to be copied. diff --git a/schema/copy_stop.go b/schema/copy_stop.go index c65e66c..cecfaa3 100644 --- a/schema/copy_stop.go +++ b/schema/copy_stop.go @@ -10,8 +10,8 @@ type CopyStop struct { // API tokens identifying the accounts which needs not to be copied CopyStop string `json:"copy_stop"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/copytrading_list.go b/schema/copytrading_list.go index c9ac998..9d16a37 100644 --- a/schema/copytrading_list.go +++ b/schema/copytrading_list.go @@ -11,8 +11,8 @@ type CopytradingList struct { // Must be `1` CopytradingList CopytradingListCopytradingList `json:"copytrading_list"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/crypto_config.go b/schema/crypto_config.go index da6a6d0..30799ae 100644 --- a/schema/crypto_config.go +++ b/schema/crypto_config.go @@ -15,8 +15,8 @@ type CryptoConfig struct { // crypto config for the sent cryptocurrency code only. CurrencyCode *string `json:"currency_code,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/crypto_estimations.go b/schema/crypto_estimations.go index 045ccc7..8c605fa 100644 --- a/schema/crypto_estimations.go +++ b/schema/crypto_estimations.go @@ -14,8 +14,8 @@ type CryptoEstimations struct { // Cryptocurrency code for which fee estimation is provided. CurrencyCode string `json:"currency_code"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/document_upload.go b/schema/document_upload.go index 998d4a7..700ec15 100644 --- a/schema/document_upload.go +++ b/schema/document_upload.go @@ -39,8 +39,8 @@ type DocumentUpload struct { // any) LifetimeValid *DocumentUploadLifetimeValid `json:"lifetime_valid,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] To determine document side diff --git a/schema/exchange_rates.go b/schema/exchange_rates.go index d4612f4..fd9ef34 100644 --- a/schema/exchange_rates.go +++ b/schema/exchange_rates.go @@ -19,8 +19,8 @@ type ExchangeRates struct { // available if target_currency is provided. IncludeSpread *ExchangeRatesIncludeSpread `json:"include_spread,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/get_account_status.go b/schema/get_account_status.go index 90052c8..6b48791 100644 --- a/schema/get_account_status.go +++ b/schema/get_account_status.go @@ -11,8 +11,8 @@ type GetAccountStatus struct { // Must be `1` GetAccountStatus GetAccountStatusGetAccountStatus `json:"get_account_status"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/get_financial_assessment.go b/schema/get_financial_assessment.go index f0eb9da..227bdf5 100644 --- a/schema/get_financial_assessment.go +++ b/schema/get_financial_assessment.go @@ -13,8 +13,8 @@ type GetFinancialAssessment struct { // Must be `1` GetFinancialAssessment GetFinancialAssessmentGetFinancialAssessment `json:"get_financial_assessment"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/get_limits.go b/schema/get_limits.go index 2d25d0b..1b98d9f 100644 --- a/schema/get_limits.go +++ b/schema/get_limits.go @@ -11,8 +11,8 @@ type GetLimits struct { // Must be `1` GetLimits GetLimitsGetLimits `json:"get_limits"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/get_self_exclusion.go b/schema/get_self_exclusion.go index df6749a..73bae9f 100644 --- a/schema/get_self_exclusion.go +++ b/schema/get_self_exclusion.go @@ -13,8 +13,8 @@ type GetSelfExclusion struct { // Must be `1` GetSelfExclusion GetSelfExclusionGetSelfExclusion `json:"get_self_exclusion"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/get_settings.go b/schema/get_settings.go index 2c0787b..313c18c 100644 --- a/schema/get_settings.go +++ b/schema/get_settings.go @@ -11,8 +11,8 @@ type GetSettings struct { // Must be `1` GetSettings GetSettingsGetSettings `json:"get_settings"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/identity_verification_document_add.go b/schema/identity_verification_document_add.go index 545012c..d3c6c5c 100644 --- a/schema/identity_verification_document_add.go +++ b/schema/identity_verification_document_add.go @@ -25,8 +25,8 @@ type IdentityVerificationDocumentAdd struct { // 2-letter country code (can obtained from `residence_list` call). IssuingCountry string `json:"issuing_country"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/kyc_auth_status.go b/schema/kyc_auth_status.go index 0d7325b..78a597e 100644 --- a/schema/kyc_auth_status.go +++ b/schema/kyc_auth_status.go @@ -18,8 +18,8 @@ type KycAuthStatus struct { // Indicates which landing companies to get the KYC authentication status for. LandingCompanies []KycAuthStatusLandingCompaniesElem `json:"landing_companies,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/login_history.go b/schema/login_history.go index f7b46fd..b5f8aa4 100644 --- a/schema/login_history.go +++ b/schema/login_history.go @@ -14,8 +14,8 @@ type LoginHistory struct { // Must be `1` LoginHistory LoginHistoryLoginHistory `json:"login_history"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/logout.go b/schema/logout.go index 634559a..3a6e07d 100644 --- a/schema/logout.go +++ b/schema/logout.go @@ -8,8 +8,8 @@ import "reflect" // Logout the session type Logout struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_deposit.go b/schema/mt5_deposit.go index db74a94..d242524 100644 --- a/schema/mt5_deposit.go +++ b/schema/mt5_deposit.go @@ -15,8 +15,8 @@ type Mt5Deposit struct { // Binary account loginid to transfer money from FromBinary *string `json:"from_binary,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_get_settings.go b/schema/mt5_get_settings.go index 349c82d..7d9caae 100644 --- a/schema/mt5_get_settings.go +++ b/schema/mt5_get_settings.go @@ -11,8 +11,8 @@ type Mt5GetSettings struct { // MT5 user login Login string `json:"login"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_login_list.go b/schema/mt5_login_list.go index a5b1482..b47b25a 100644 --- a/schema/mt5_login_list.go +++ b/schema/mt5_login_list.go @@ -8,8 +8,8 @@ import "reflect" // Get list of MT5 accounts for client type Mt5LoginList struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_new_account.go b/schema/mt5_new_account.go index fea48c5..24fe9a5 100644 --- a/schema/mt5_new_account.go +++ b/schema/mt5_new_account.go @@ -45,8 +45,8 @@ type Mt5NewAccount struct { // Client leverage (from 1 to 1000). Leverage float64 `json:"leverage"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // The master password of the account. For validation (Accepts any printable ASCII diff --git a/schema/mt5_password_change.go b/schema/mt5_password_change.go index cea0f4c..6d6bc6e 100644 --- a/schema/mt5_password_change.go +++ b/schema/mt5_password_change.go @@ -11,8 +11,8 @@ type Mt5PasswordChange struct { // MT5 user login Login string `json:"login"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_password_check.go b/schema/mt5_password_check.go index f364099..e8b596c 100644 --- a/schema/mt5_password_check.go +++ b/schema/mt5_password_check.go @@ -11,8 +11,8 @@ type Mt5PasswordCheck struct { // MT5 user login Login string `json:"login"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_password_reset.go b/schema/mt5_password_reset.go index fb84f80..85b8d3a 100644 --- a/schema/mt5_password_reset.go +++ b/schema/mt5_password_reset.go @@ -11,8 +11,8 @@ type Mt5PasswordReset struct { // MT5 user login Login string `json:"login"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/mt5_withdrawal.go b/schema/mt5_withdrawal.go index abcf985..82453a2 100644 --- a/schema/mt5_withdrawal.go +++ b/schema/mt5_withdrawal.go @@ -15,8 +15,8 @@ type Mt5Withdrawal struct { // MT5 account login to withdraw money from FromMt5 string `json:"from_mt5"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/new_account_maltainvest.go b/schema/new_account_maltainvest.go index efea924..3b2bb90 100644 --- a/schema/new_account_maltainvest.go +++ b/schema/new_account_maltainvest.go @@ -97,8 +97,8 @@ type NewAccountMaltainvest struct { // features such as stop loss. Stop loss allows you to LeverageTradingHighRiskStopLoss *NewAccountMaltainvestLeverageTradingHighRiskStopLoss `json:"leverage_trading_high_risk_stop_loss,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Net Annual Income. diff --git a/schema/new_account_real.go b/schema/new_account_real.go index babf5c0..54325e5 100644 --- a/schema/new_account_real.go +++ b/schema/new_account_real.go @@ -61,8 +61,8 @@ type NewAccountReal struct { // apostrophes. LastName *string `json:"last_name,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/new_account_virtual.go b/schema/new_account_virtual.go index 50e1127..6d633fb 100644 --- a/schema/new_account_virtual.go +++ b/schema/new_account_virtual.go @@ -29,8 +29,8 @@ type NewAccountVirtual struct { // [Optional] Google Click Identifier to track source. GclidUrl *string `json:"gclid_url,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/oauth_apps.go b/schema/oauth_apps.go index ce3ce34..18817bd 100644 --- a/schema/oauth_apps.go +++ b/schema/oauth_apps.go @@ -8,8 +8,8 @@ import "reflect" // List all my used OAuth applications. type OauthApps struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/p2p_advert_create.go b/schema/p2p_advert_create.go index 9afddb3..dfa588b 100644 --- a/schema/p2p_advert_create.go +++ b/schema/p2p_advert_create.go @@ -29,8 +29,8 @@ type P2PAdvertCreate struct { // currency of client's residence by default. LocalCurrency *string `json:"local_currency,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Maximum allowed amount for the orders of this advert, in advertiser's diff --git a/schema/p2p_advert_info.go b/schema/p2p_advert_info.go index 02b95ff..dca70d1 100644 --- a/schema/p2p_advert_info.go +++ b/schema/p2p_advert_info.go @@ -12,8 +12,8 @@ type P2PAdvertInfo struct { // If not provided, all advertiser adverts will be subscribed. Id *string `json:"id,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_advert_list.go b/schema/p2p_advert_list.go index 81a0a5c..246e987 100644 --- a/schema/p2p_advert_list.go +++ b/schema/p2p_advert_list.go @@ -38,8 +38,8 @@ type P2PAdvertList struct { // ads from country of residence will be returned. LocalCurrency *string `json:"local_currency,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used for paging. diff --git a/schema/p2p_advert_update.go b/schema/p2p_advert_update.go index 4cee11f..1ea3fcf 100644 --- a/schema/p2p_advert_update.go +++ b/schema/p2p_advert_update.go @@ -31,8 +31,8 @@ type P2PAdvertUpdate struct { // [Optional] Local currency for this advert. LocalCurrency *string `json:"local_currency,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Maximum allowed amount for the orders of this advert, in diff --git a/schema/p2p_advertiser_adverts.go b/schema/p2p_advertiser_adverts.go index 40c79c5..3c84059 100644 --- a/schema/p2p_advertiser_adverts.go +++ b/schema/p2p_advertiser_adverts.go @@ -13,8 +13,8 @@ type P2PAdvertiserAdverts struct { // responses. Limit int `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used for paging. This value will also apply to subsription diff --git a/schema/p2p_advertiser_create.go b/schema/p2p_advertiser_create.go index c3fa6a4..c6a7636 100644 --- a/schema/p2p_advertiser_create.go +++ b/schema/p2p_advertiser_create.go @@ -16,8 +16,8 @@ type P2PAdvertiserCreate struct { // created. DefaultAdvertDescription *string `json:"default_advert_description,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // The advertiser's displayed name. diff --git a/schema/p2p_advertiser_info.go b/schema/p2p_advertiser_info.go index f679d31..849ea2c 100644 --- a/schema/p2p_advertiser_info.go +++ b/schema/p2p_advertiser_info.go @@ -12,8 +12,8 @@ type P2PAdvertiserInfo struct { // advertiser information about the current account. Id *string `json:"id,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_advertiser_list.go b/schema/p2p_advertiser_list.go index 23aaad4..09d0d89 100644 --- a/schema/p2p_advertiser_list.go +++ b/schema/p2p_advertiser_list.go @@ -17,8 +17,8 @@ type P2PAdvertiserList struct { // [Optional] Used for paging. Limit int `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used for paging. diff --git a/schema/p2p_advertiser_payment_methods.go b/schema/p2p_advertiser_payment_methods.go index 0c89b9d..813d3ff 100644 --- a/schema/p2p_advertiser_payment_methods.go +++ b/schema/p2p_advertiser_payment_methods.go @@ -14,8 +14,8 @@ type P2PAdvertiserPaymentMethods struct { // Contains payment methods to delete. Delete []float64 `json:"delete,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_advertiser_relations.go b/schema/p2p_advertiser_relations.go index 6c808ee..7a10df8 100644 --- a/schema/p2p_advertiser_relations.go +++ b/schema/p2p_advertiser_relations.go @@ -14,8 +14,8 @@ type P2PAdvertiserRelations struct { // IDs of advertisers to add as favourites. AddFavourites []float64 `json:"add_favourites,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_advertiser_update.go b/schema/p2p_advertiser_update.go index 53eb29b..3c1801d 100644 --- a/schema/p2p_advertiser_update.go +++ b/schema/p2p_advertiser_update.go @@ -22,8 +22,8 @@ type P2PAdvertiserUpdate struct { // change the `is_active` of each individual advert. IsListed *P2PAdvertiserUpdateIsListed `json:"is_listed,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_chat_create.go b/schema/p2p_chat_create.go index 0a8c70f..128e263 100644 --- a/schema/p2p_chat_create.go +++ b/schema/p2p_chat_create.go @@ -8,8 +8,8 @@ import "reflect" // Creates a P2P chat for the specified order. type P2PChatCreate struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // The unique identifier for the order to create the chat for. diff --git a/schema/p2p_country_list.go b/schema/p2p_country_list.go index 883e2e4..3a9ee8b 100644 --- a/schema/p2p_country_list.go +++ b/schema/p2p_country_list.go @@ -11,8 +11,8 @@ type P2PCountryList struct { // [Optional] 2-letter country code. If not provided all countries are returned. Country *string `json:"country,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_cancel.go b/schema/p2p_order_cancel.go index 1c74bcc..f9ea19a 100644 --- a/schema/p2p_order_cancel.go +++ b/schema/p2p_order_cancel.go @@ -11,8 +11,8 @@ type P2POrderCancel struct { // The unique identifier for this order. Id string `json:"id"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_confirm.go b/schema/p2p_order_confirm.go index e328c1b..c846102 100644 --- a/schema/p2p_order_confirm.go +++ b/schema/p2p_order_confirm.go @@ -14,8 +14,8 @@ type P2POrderConfirm struct { // The unique identifier for this order. Id string `json:"id"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_create.go b/schema/p2p_order_create.go index 056d90a..ac87dab 100644 --- a/schema/p2p_order_create.go +++ b/schema/p2p_order_create.go @@ -17,8 +17,8 @@ type P2POrderCreate struct { // [Optional] Seller contact information. Only applicable for 'sell orders'. ContactInfo *string `json:"contact_info,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_dispute.go b/schema/p2p_order_dispute.go index 4c16354..1f9f767 100644 --- a/schema/p2p_order_dispute.go +++ b/schema/p2p_order_dispute.go @@ -14,8 +14,8 @@ type P2POrderDispute struct { // The unique identifier for this order. Id string `json:"id"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_info.go b/schema/p2p_order_info.go index f0b8344..8c19488 100644 --- a/schema/p2p_order_info.go +++ b/schema/p2p_order_info.go @@ -11,8 +11,8 @@ type P2POrderInfo struct { // The unique identifier for the order. Id string `json:"id"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_order_list.go b/schema/p2p_order_list.go index 661e4b4..816e2d3 100644 --- a/schema/p2p_order_list.go +++ b/schema/p2p_order_list.go @@ -25,8 +25,8 @@ type P2POrderList struct { // [Optional] Used for paging. Limit int `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used for paging. diff --git a/schema/p2p_order_review.go b/schema/p2p_order_review.go index 29c97a0..bd6cb47 100644 --- a/schema/p2p_order_review.go +++ b/schema/p2p_order_review.go @@ -8,8 +8,8 @@ import "reflect" // Creates a review for the specified order. type P2POrderReview struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // The order identification number. diff --git a/schema/p2p_payment_methods.go b/schema/p2p_payment_methods.go index b55c906..c9bc450 100644 --- a/schema/p2p_payment_methods.go +++ b/schema/p2p_payment_methods.go @@ -8,8 +8,8 @@ import "reflect" // List all P2P payment methods. type P2PPaymentMethods struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be 1 diff --git a/schema/p2p_ping.go b/schema/p2p_ping.go index c41dc50..f8baddd 100644 --- a/schema/p2p_ping.go +++ b/schema/p2p_ping.go @@ -9,8 +9,8 @@ import "reflect" // 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. type P2PPing struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/p2p_settings.go b/schema/p2p_settings.go index e02605c..9989583 100644 --- a/schema/p2p_settings.go +++ b/schema/p2p_settings.go @@ -8,8 +8,8 @@ import "reflect" // Request P2P Settings information. type P2PSettings struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Must be `1` diff --git a/schema/payment_methods.go b/schema/payment_methods.go index 5066b59..9b238c1 100644 --- a/schema/payment_methods.go +++ b/schema/payment_methods.go @@ -12,8 +12,8 @@ type PaymentMethods struct { // [Optional] 2-letter country code (ISO standard). Country *string `json:"country,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_create.go b/schema/paymentagent_create.go index a6edc1b..e0f66c8 100644 --- a/schema/paymentagent_create.go +++ b/schema/paymentagent_create.go @@ -26,8 +26,8 @@ type PaymentagentCreate struct { // [Optional] Information about payment agent and their proposed service. Information string `json:"information"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_details.go b/schema/paymentagent_details.go index 0c0dcc2..70cf9bb 100644 --- a/schema/paymentagent_details.go +++ b/schema/paymentagent_details.go @@ -8,8 +8,8 @@ import "reflect" // Gets client's payment agent details. type PaymentagentDetails struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_list.go b/schema/paymentagent_list.go index 20a9124..2915b7e 100644 --- a/schema/paymentagent_list.go +++ b/schema/paymentagent_list.go @@ -13,8 +13,8 @@ type PaymentagentList struct { // be returned (obtained from `payout_currencies` call). Currency *string `json:"currency,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_transfer.go b/schema/paymentagent_transfer.go index 7648f22..53785ea 100644 --- a/schema/paymentagent_transfer.go +++ b/schema/paymentagent_transfer.go @@ -21,8 +21,8 @@ type PaymentagentTransfer struct { // [Optional] If set to `1`, just do validation. DryRun *PaymentagentTransferDryRun `json:"dry_run,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_withdraw.go b/schema/paymentagent_withdraw.go index 25df12f..5836149 100644 --- a/schema/paymentagent_withdraw.go +++ b/schema/paymentagent_withdraw.go @@ -21,8 +21,8 @@ type PaymentagentWithdraw struct { // [Optional] If set to 1, just do validation. DryRun *PaymentagentWithdrawDryRun `json:"dry_run,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/paymentagent_withdraw_justification.go b/schema/paymentagent_withdraw_justification.go index 539fa38..d701f20 100644 --- a/schema/paymentagent_withdraw_justification.go +++ b/schema/paymentagent_withdraw_justification.go @@ -8,8 +8,8 @@ import "reflect" // Provide justification to perform withdrawal using a Payment Agent. type PaymentagentWithdrawJustification struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // Reasons for needing to withdraw using a Payment Agent. diff --git a/schema/payout_currencies.go b/schema/payout_currencies.go index 11a9a5f..940affd 100644 --- a/schema/payout_currencies.go +++ b/schema/payout_currencies.go @@ -9,8 +9,8 @@ import "reflect" // Retrieve a list of available option payout currencies. If a user is logged in, // only the currencies available for the account will be returned. type PayoutCurrencies struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/portfolio.go b/schema/portfolio.go index 683047d..371a924 100644 --- a/schema/portfolio.go +++ b/schema/portfolio.go @@ -11,8 +11,8 @@ type Portfolio struct { // Return only contracts of the specified types ContractType []PortfolioContractTypeElem `json:"contract_type,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/profit_table.go b/schema/profit_table.go index 5343bc7..2e83908 100644 --- a/schema/profit_table.go +++ b/schema/profit_table.go @@ -23,8 +23,8 @@ type ProfitTable struct { // [Optional] Apply upper limit to count of transactions received. Limit float64 `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Number of transactions to skip. diff --git a/schema/proposal.go b/schema/proposal.go index 5f65a57..614fe4f 100644 --- a/schema/proposal.go +++ b/schema/proposal.go @@ -64,8 +64,8 @@ type Proposal struct { // `stop_loss`. LimitOrder *ProposalLimitOrder `json:"limit_order,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] The multiplier for non-binary options. E.g. lookbacks. diff --git a/schema/proposal_open_contract.go b/schema/proposal_open_contract.go index a009de8..01c7225 100644 --- a/schema/proposal_open_contract.go +++ b/schema/proposal_open_contract.go @@ -12,8 +12,8 @@ type ProposalOpenContract struct { // will receive stream of all open contracts. ContractId *int `json:"contract_id,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/reality_check.go b/schema/reality_check.go index b7635ea..453e0cd 100644 --- a/schema/reality_check.go +++ b/schema/reality_check.go @@ -11,8 +11,8 @@ import "reflect" // associated client profit/loss. The Reality Check facility is a regulatory // requirement for certain landing companies. type RealityCheck struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/revoke_oauth_app.go b/schema/revoke_oauth_app.go index 5b7081b..be0f169 100644 --- a/schema/revoke_oauth_app.go +++ b/schema/revoke_oauth_app.go @@ -7,8 +7,8 @@ import "fmt" // Used for revoking access of particular app. type RevokeOauthApp struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/sell.go b/schema/sell.go index af8ad57..8faea2b 100644 --- a/schema/sell.go +++ b/schema/sell.go @@ -7,8 +7,8 @@ import "fmt" // Sell a Contract as identified from a previous `portfolio` call. type Sell struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/sell_contract_for_multiple_accounts.go b/schema/sell_contract_for_multiple_accounts.go index 0fdad8d..594f367 100644 --- a/schema/sell_contract_for_multiple_accounts.go +++ b/schema/sell_contract_for_multiple_accounts.go @@ -13,8 +13,8 @@ import "reflect" // sell the contract on the currently-authorised account unless you include the // token for the current account. type SellContractForMultipleAccounts struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/sell_expired.go b/schema/sell_expired.go index c090e05..b84d94b 100644 --- a/schema/sell_expired.go +++ b/schema/sell_expired.go @@ -9,8 +9,8 @@ import "reflect" // This call will try to sell any expired contracts and return the number of sold // contracts. type SellExpired struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/set_account_currency.go b/schema/set_account_currency.go index a7bba09..3242039 100644 --- a/schema/set_account_currency.go +++ b/schema/set_account_currency.go @@ -9,8 +9,8 @@ import "fmt" // currency for trading, deposit. Please note that account currency can only be set // once, and then can never be changed. type SetAccountCurrency struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/set_financial_assessment.go b/schema/set_financial_assessment.go index 40f1461..373078c 100644 --- a/schema/set_financial_assessment.go +++ b/schema/set_financial_assessment.go @@ -49,8 +49,8 @@ type SetFinancialAssessment struct { // [Optional] Income Source. IncomeSource *SetFinancialAssessmentIncomeSource `json:"income_source,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Net Annual Income. diff --git a/schema/set_self_exclusion.go b/schema/set_self_exclusion.go index 769b857..1ac7361 100644 --- a/schema/set_self_exclusion.go +++ b/schema/set_self_exclusion.go @@ -14,8 +14,8 @@ type SetSelfExclusion struct { // the company. ExcludeUntil *string `json:"exclude_until,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] 7-day limit on deposits. diff --git a/schema/set_settings.go b/schema/set_settings.go index faa2cdd..2c92eb0 100644 --- a/schema/set_settings.go +++ b/schema/set_settings.go @@ -69,8 +69,8 @@ type SetSettings struct { // accounts). LastName *string `json:"last_name,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Indicates client's self-declaration of not being a PEP/RCA diff --git a/schema/statement.go b/schema/statement.go index e6f0a62..40ec4a9 100644 --- a/schema/statement.go +++ b/schema/statement.go @@ -23,8 +23,8 @@ type Statement struct { // [Optional] Maximum number of transactions to receive. Limit float64 `json:"limit,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Number of transactions to skip. diff --git a/schema/tin_validations.go b/schema/tin_validations.go new file mode 100644 index 0000000..b1153af --- /dev/null +++ b/schema/tin_validations.go @@ -0,0 +1,74 @@ +// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT. + +package schema + +import "encoding/json" +import "fmt" +import "reflect" + +// Get the validations for Tax Identification Numbers (TIN) +type TinValidations struct { + // [Optional] Used to pass data through the websocket, which may be retrieved via + // the `echo_req` output field. + Passthrough TinValidationsPassthrough `json:"passthrough,omitempty"` + + // [Optional] Used to map request to response. + ReqId *int `json:"req_id,omitempty"` + + // The tax residence selected by the client. + TaxResidence string `json:"tax_residence"` + + // Must be `1` + TinValidations TinValidationsTinValidations `json:"tin_validations"` +} + +// [Optional] Used to pass data through the websocket, which may be retrieved via +// the `echo_req` output field. +type TinValidationsPassthrough map[string]interface{} + +type TinValidationsTinValidations int + +var enumValues_TinValidationsTinValidations = []interface{}{ + 1, +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TinValidationsTinValidations) UnmarshalJSON(b []byte) error { + var v int + if err := json.Unmarshal(b, &v); err != nil { + return err + } + var ok bool + for _, expected := range enumValues_TinValidationsTinValidations { + if reflect.DeepEqual(v, expected) { + ok = true + break + } + } + if !ok { + return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_TinValidationsTinValidations, v) + } + *j = TinValidationsTinValidations(v) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TinValidations) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if _, ok := raw["tax_residence"]; raw != nil && !ok { + return fmt.Errorf("field tax_residence in TinValidations: required") + } + if _, ok := raw["tin_validations"]; raw != nil && !ok { + return fmt.Errorf("field tin_validations in TinValidations: required") + } + type Plain TinValidations + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = TinValidations(plain) + return nil +} diff --git a/schema/tin_validations_resp.go b/schema/tin_validations_resp.go new file mode 100644 index 0000000..dd83ef4 --- /dev/null +++ b/schema/tin_validations_resp.go @@ -0,0 +1,118 @@ +// Code generated by github.com/atombender/go-jsonschema, DO NOT EDIT. + +package schema + +import "encoding/json" +import "fmt" +import "reflect" + +// A message with validations for Tax Identification Numbers (TIN) +type TinValidationsResp struct { + // Echo of the request made. + EchoReq TinValidationsRespEchoReq `json:"echo_req"` + + // Action name of the request made. + MsgType TinValidationsRespMsgType `json:"msg_type"` + + // Optional field sent in request to map to response, present only when request + // contains `req_id`. + ReqId *int `json:"req_id,omitempty"` + + // Validations for Tax Identification Numbers (TIN) + TinValidations *TinValidationsRespTinValidations `json:"tin_validations,omitempty"` +} + +// Echo of the request made. +type TinValidationsRespEchoReq map[string]interface{} + +type TinValidationsRespMsgType string + +const TinValidationsRespMsgTypeTinValidations TinValidationsRespMsgType = "tin_validations" + +var enumValues_TinValidationsRespMsgType = []interface{}{ + "tin_validations", +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TinValidationsRespMsgType) UnmarshalJSON(b []byte) error { + var v string + if err := json.Unmarshal(b, &v); err != nil { + return err + } + var ok bool + for _, expected := range enumValues_TinValidationsRespMsgType { + if reflect.DeepEqual(v, expected) { + ok = true + break + } + } + if !ok { + return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_TinValidationsRespMsgType, v) + } + *j = TinValidationsRespMsgType(v) + return nil +} + +// Validations for Tax Identification Numbers (TIN) +type TinValidationsRespTinValidations struct { + // Invalid regex patterns for tin validation + InvalidPatterns []string `json:"invalid_patterns,omitempty"` + + // Whether the TIN is mandatory for the selected country + IsTinMandatory *TinValidationsRespTinValidationsIsTinMandatory `json:"is_tin_mandatory,omitempty"` + + // List of employment statuses that bypass TIN requirements for the selected + // country + TinEmploymentStatusBypass []string `json:"tin_employment_status_bypass,omitempty"` + + // Country tax identifier formats. + TinFormat []string `json:"tin_format,omitempty"` +} + +type TinValidationsRespTinValidationsIsTinMandatory int + +var enumValues_TinValidationsRespTinValidationsIsTinMandatory = []interface{}{ + 0, + 1, +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TinValidationsRespTinValidationsIsTinMandatory) UnmarshalJSON(b []byte) error { + var v int + if err := json.Unmarshal(b, &v); err != nil { + return err + } + var ok bool + for _, expected := range enumValues_TinValidationsRespTinValidationsIsTinMandatory { + if reflect.DeepEqual(v, expected) { + ok = true + break + } + } + if !ok { + return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_TinValidationsRespTinValidationsIsTinMandatory, v) + } + *j = TinValidationsRespTinValidationsIsTinMandatory(v) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TinValidationsResp) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if _, ok := raw["echo_req"]; raw != nil && !ok { + return fmt.Errorf("field echo_req in TinValidationsResp: required") + } + if _, ok := raw["msg_type"]; raw != nil && !ok { + return fmt.Errorf("field msg_type in TinValidationsResp: required") + } + type Plain TinValidationsResp + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = TinValidationsResp(plain) + return nil +} diff --git a/schema/tnc_approval.go b/schema/tnc_approval.go index e9548ef..2c80932 100644 --- a/schema/tnc_approval.go +++ b/schema/tnc_approval.go @@ -11,8 +11,8 @@ type TncApproval struct { // [Optional] For Affiliate's Code of Conduct Agreement. AffiliateCocAgreement *TncApprovalAffiliateCocAgreement `json:"affiliate_coc_agreement,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/topup_virtual.go b/schema/topup_virtual.go index d00cdb6..92ede10 100644 --- a/schema/topup_virtual.go +++ b/schema/topup_virtual.go @@ -9,8 +9,8 @@ import "reflect" // When a virtual-money's account balance becomes low, it can be topped up using // this call. type TopupVirtual struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/trading_durations.go b/schema/trading_durations.go index b0e00b7..955241b 100644 --- a/schema/trading_durations.go +++ b/schema/trading_durations.go @@ -17,8 +17,8 @@ type TradingDurations struct { // landing company. LandingCompanyShort *TradingDurationsLandingCompanyShort `json:"landing_company_short,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/trading_platform_investor_password_reset.go b/schema/trading_platform_investor_password_reset.go index 476baba..70374f5 100644 --- a/schema/trading_platform_investor_password_reset.go +++ b/schema/trading_platform_investor_password_reset.go @@ -11,8 +11,8 @@ type TradingPlatformInvestorPasswordReset struct { // Trading account ID. AccountId string `json:"account_id"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // New password of the account. For validation (Accepts any printable ASCII diff --git a/schema/trading_platform_password_reset.go b/schema/trading_platform_password_reset.go index fdb2374..1355439 100644 --- a/schema/trading_platform_password_reset.go +++ b/schema/trading_platform_password_reset.go @@ -8,8 +8,8 @@ import "reflect" // Reset the password of a Trading Platform Account type TradingPlatformPasswordReset struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // New password of the account. For validation (Accepts any printable ASCII diff --git a/schema/trading_servers.go b/schema/trading_servers.go index effafa2..e8a364a 100644 --- a/schema/trading_servers.go +++ b/schema/trading_servers.go @@ -15,8 +15,8 @@ type TradingServers struct { // one demo and two real environments. Defaults to 'all'. Environment TradingServersEnvironment `json:"environment,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Market type. diff --git a/schema/transaction.go b/schema/transaction.go index 5aa5c4e..006da7a 100644 --- a/schema/transaction.go +++ b/schema/transaction.go @@ -8,8 +8,8 @@ import "reflect" // Subscribe to transaction notifications type Transaction struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/transfer_between_accounts.go b/schema/transfer_between_accounts.go index 9eb8c80..dc2b470 100644 --- a/schema/transfer_between_accounts.go +++ b/schema/transfer_between_accounts.go @@ -28,8 +28,8 @@ type TransferBetweenAccounts struct { // [Optional] Currency code. Currency *string `json:"currency,omitempty"` - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/verify_email.go b/schema/verify_email.go index 7ed1bd3..eebb850 100644 --- a/schema/verify_email.go +++ b/schema/verify_email.go @@ -9,8 +9,8 @@ import "reflect" // Verify an email address for various purposes. The system will send an email to // the address containing a security code for verification. type VerifyEmail struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via diff --git a/schema/verify_email_cellxpert.go b/schema/verify_email_cellxpert.go index dde5337..e81d1a7 100644 --- a/schema/verify_email_cellxpert.go +++ b/schema/verify_email_cellxpert.go @@ -9,8 +9,8 @@ import "reflect" // Verify an email address for Cellxpert. The system will send an email to the // address containing a security code for verification. type VerifyEmailCellxpert struct { - // [Optional] The login id of the user. If left unspecified, it defaults to the - // initial authorized token's login id. + // [Optional] The login id of the user. Mandatory when multiple tokens were + // provided during authorize. Loginid *string `json:"loginid,omitempty"` // [Optional] Used to pass data through the websocket, which may be retrieved via