@@ -1136,16 +1136,16 @@ func (e *Exchange) GetAllWallets(ctx context.Context, pag PaginationInp) (*GetAl
1136
1136
}
1137
1137
1138
1138
// GetWalletByID returns information about a single wallet. In lieu of a wallet ID, a currency can be provided to get the primary account for that currency
1139
- func (e * Exchange ) GetWalletByID (ctx context.Context , walletID string , currency currency.Code ) (* WalletData , error ) {
1140
- if (walletID == "" && currency .IsEmpty ()) || (walletID != "" && ! currency .IsEmpty ()) {
1139
+ func (e * Exchange ) GetWalletByID (ctx context.Context , walletID string , cur currency.Code ) (* WalletData , error ) {
1140
+ if (walletID == "" && cur .IsEmpty ()) || (walletID != "" && ! cur .IsEmpty ()) {
1141
1141
return nil , errCurrWalletConflict
1142
1142
}
1143
1143
var path string
1144
1144
if walletID != "" {
1145
1145
path = v2Path + accountsPath + "/" + walletID
1146
1146
}
1147
- if ! currency .IsEmpty () {
1148
- path = v2Path + accountsPath + "/" + currency .String ()
1147
+ if ! cur .IsEmpty () {
1148
+ path = v2Path + accountsPath + "/" + cur .String ()
1149
1149
}
1150
1150
resp := struct {
1151
1151
Data WalletData `json:"data"`
@@ -1201,12 +1201,12 @@ func (e *Exchange) GetCryptocurrencies(ctx context.Context) ([]CryptoData, error
1201
1201
}
1202
1202
1203
1203
// GetExchangeRates returns exchange rates for the specified currency. If none is specified, it defaults to USD
1204
- func (e * Exchange ) GetExchangeRates (ctx context.Context , currency string ) (* GetExchangeRatesResp , error ) {
1204
+ func (e * Exchange ) GetExchangeRates (ctx context.Context , cur string ) (* GetExchangeRatesResp , error ) {
1205
1205
resp := struct {
1206
1206
Data GetExchangeRatesResp `json:"data"`
1207
1207
}{}
1208
1208
vals := url.Values {}
1209
- vals .Set ("currency" , currency )
1209
+ vals .Set ("currency" , cur )
1210
1210
return & resp .Data , e .SendHTTPRequest (ctx , exchange .RestSpot , v2Path + exchangeRatesPath , vals , & resp )
1211
1211
}
1212
1212
@@ -1494,7 +1494,7 @@ func (e *Exchange) GetJWT(ctx context.Context, uri string) (string, time.Time, e
1494
1494
if block == nil {
1495
1495
return "" , time.Time {}, errCantDecodePrivKey
1496
1496
}
1497
- key , err := x509 .ParseECPrivateKey (block .Bytes )
1497
+ privateKey , err := x509 .ParseECPrivateKey (block .Bytes )
1498
1498
if err != nil {
1499
1499
return "" , time.Time {}, err
1500
1500
}
@@ -1515,7 +1515,7 @@ func (e *Exchange) GetJWT(ctx context.Context, uri string) (string, time.Time, e
1515
1515
tok := jwt .NewWithClaims (jwt .SigningMethodES256 , mapClaims )
1516
1516
tok .Header ["kid" ] = creds .Key
1517
1517
tok .Header ["nonce" ] = nonce
1518
- sign , err := tok .SignedString (key )
1518
+ sign , err := tok .SignedString (privateKey )
1519
1519
return sign , regTime .Add (time .Minute * 2 ), err
1520
1520
// The code below mostly works, but seems to lead to bad results on the signature step. Deferring until later
1521
1521
// head := map[string]any{"kid": creds.Key, "typ": "JWT", "alg": "ES256", "nonce": nonce}
0 commit comments