mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-08 15:11:07 +00:00
bybit: Add protected subtype for account checking to reduce outbound requests (#1739)
* bybit: Add protected sub type for account checking to reduce outbound requests * add type and string method plus fix linter with comment * linter: fix * whoops * Update exchanges/bybit/bybit.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * Update exchanges/bybit/bybit.go Co-authored-by: Scott <gloriousCode@users.noreply.github.com> * glorious: nits --------- Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io> Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
This commit is contained in:
@@ -562,7 +562,7 @@ func (by *Bybit) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (a
|
||||
var acc account.SubAccount
|
||||
var accountType string
|
||||
info.Exchange = by.Name
|
||||
err := by.RetrieveAndSetAccountType(ctx)
|
||||
at, err := by.FetchAccountType(ctx)
|
||||
if err != nil {
|
||||
return info, err
|
||||
}
|
||||
@@ -570,7 +570,7 @@ func (by *Bybit) UpdateAccountInfo(ctx context.Context, assetType asset.Item) (a
|
||||
case asset.Spot, asset.Options,
|
||||
asset.USDCMarginedFutures,
|
||||
asset.USDTMarginedFutures:
|
||||
switch by.AccountType {
|
||||
switch at {
|
||||
case accountTypeUnified:
|
||||
accountType = "UNIFIED"
|
||||
case accountTypeNormal:
|
||||
|
||||
Reference in New Issue
Block a user