diff --git a/calls.go b/calls.go index 4b6f936..b9aac9f 100644 --- a/calls.go +++ b/calls.go @@ -220,7 +220,7 @@ func (a *DerivAPI) EconomicCalendar(r schema.EconomicCalendar) (resp schema.Econ return } -// ExchangeRates Retrieves the exchange rates from a base currency to all currencies supported by the system. +// ExchangeRates Retrieves the exchange rate from a base currency to a target currency supported by the system. func (a *DerivAPI) ExchangeRates(r schema.ExchangeRates) (resp schema.ExchangeRatesResp, err error) { id := a.getNextRequestID() r.ReqId = &id diff --git a/schema/exchange_rates.go b/schema/exchange_rates.go index f63a641..8386034 100644 --- a/schema/exchange_rates.go +++ b/schema/exchange_rates.go @@ -62,8 +62,8 @@ func (j *ExchangeRatesSubscribe) UnmarshalJSON(b []byte) error { return nil } -// Retrieves the exchange rates from a base currency to all currencies supported by -// the system. +// Retrieves the exchange rate from a base currency to a target currency supported +// by the system. type ExchangeRates struct { // Base currency (can be obtained from `payout_currencies` call) BaseCurrency string `json:"base_currency"` @@ -86,7 +86,8 @@ type ExchangeRates struct { // currency. Subscribe *ExchangeRatesSubscribe `json:"subscribe,omitempty"` - // [Optional] Local currency + // [Optional] Target currency for the exchange rate. If subscribe is set, + // target_currency must be specified as well. TargetCurrency *string `json:"target_currency,omitempty"` } diff --git a/schema/exchange_rates_resp.go b/schema/exchange_rates_resp.go index 235f72c..3d2a6b3 100644 --- a/schema/exchange_rates_resp.go +++ b/schema/exchange_rates_resp.go @@ -9,7 +9,7 @@ import "reflect" // Echo of the request made. type ExchangeRatesRespEchoReq map[string]interface{} -// Exchange rate values from base to all other currencies +// Exchange rate values from base to target currency type ExchangeRatesRespExchangeRates struct { // Base currency BaseCurrency *string `json:"base_currency,omitempty"` @@ -17,11 +17,11 @@ type ExchangeRatesRespExchangeRates struct { // Date retrieval epoch time represented as an integer number Date *int `json:"date,omitempty"` - // Rates of exchanging a unit of base currency into the target currencies + // Rate of exchanging a unit of base currency into a target currency Rates ExchangeRatesRespExchangeRatesRates `json:"rates,omitempty"` } -// Rates of exchanging a unit of base currency into the target currencies +// Rate of exchanging a unit of base currency into a target currency type ExchangeRatesRespExchangeRatesRates map[string]interface{} type ExchangeRatesRespMsgType string @@ -77,13 +77,13 @@ func (j *ExchangeRatesRespSubscription) UnmarshalJSON(b []byte) error { return nil } -// The exchange rate values from the specified base currency to all currencies -// supported by the system. +// The exchange rate values from the specified base currency to the specified +// target currency supported by the system. type ExchangeRatesResp struct { // Echo of the request made. EchoReq ExchangeRatesRespEchoReq `json:"echo_req"` - // Exchange rate values from base to all other currencies + // Exchange rate values from base to target currency ExchangeRates *ExchangeRatesRespExchangeRates `json:"exchange_rates,omitempty"` // Action name of the request made. diff --git a/subscription_calls.go b/subscription_calls.go index 699231a..dc05394 100644 --- a/subscription_calls.go +++ b/subscription_calls.go @@ -37,7 +37,7 @@ func (a *DerivAPI) SubscribeCryptoEstimations(r schema.CryptoEstimations) (rsp s return } -// SubscribeExchangeRates Retrieves the exchange rates from a base currency to all currencies supported by the system. +// SubscribeExchangeRates Retrieves the exchange rate from a base currency to a target currency supported by the system. func (a *DerivAPI) SubscribeExchangeRates(r schema.ExchangeRates) (rsp schema.ExchangeRatesResp, s *Subsciption[schema.ExchangeRatesResp, schema.ExchangeRatesResp], err error) { id := a.getNextRequestID() var f schema.ExchangeRatesSubscribe = 1