GateIO: Add GetEstimatedInterestRate REST endpoint (#2102)

* gateio: Add func GetEstimatedInterestRate (cherry-pickable)

* Add tests

* Update exchanges/gateio/gateio.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* Update exchanges/gateio/gateio.go

Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>

* gk: nits

* thrasher-: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
This commit is contained in:
Ryan O'Hara-Reid
2025-11-11 15:47:37 +11:00
committed by GitHub
parent 497e13dc62
commit a70c834f04
6 changed files with 84 additions and 27 deletions

View File

@@ -9,27 +9,29 @@ import (
"github.com/thrasher-corp/gocryptotrader/encoding/json"
)
// Public errors
var (
// ErrCurrencyCodeEmpty defines an error if the currency code is empty
ErrCurrencyCodeEmpty = errors.New("currency code is empty")
// ErrCurrencyNotFound returned when a currency is not found in a list
ErrCurrencyNotFound = errors.New("currency code not found in list")
// ErrCurrencyPairEmpty defines an error if the currency pair is empty
ErrCurrencyPairEmpty = errors.New("currency pair is empty")
// ErrCurrencyNotSupported defines an error if the currency pair is not supported
ErrCurrencyCodeEmpty = errors.New("currency code is empty")
ErrCurrencyNotFound = errors.New("currency code not found in list")
ErrCurrencyPairEmpty = errors.New("currency pair is empty")
ErrCurrencyNotSupported = errors.New("currency not supported")
// ErrCurrencyPairsEmpty returns when a currency.Pairs has len == 0
ErrCurrencyPairsEmpty = errors.New("currency pairs is empty")
// EMPTYCODE is an empty currency code
EMPTYCODE = Code{}
// EMPTYPAIR is an empty currency pair
EMPTYPAIR = Pair{}
ErrCurrencyPairsEmpty = errors.New("currency pairs is empty")
ErrCurrencyCodesEmpty = errors.New("currency codes is empty")
)
var (
errItemIsNil = errors.New("item is nil")
errItemIsEmpty = errors.New("item is empty")
errRoleUnset = errors.New("role unset")
)
var (
// EMPTYCODE is an empty currency code
EMPTYCODE Code
// EMPTYPAIR is an empty currency pair
EMPTYPAIR Pair
)
// String implements the stringer interface and returns a string representation
// of the underlying role.
func (r Role) String() string {