Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isolatedSymbol parameter to GetMaxBorrowableService #231

Merged
merged 3 commits into from Dec 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions v2/margin_service.go
Expand Up @@ -708,8 +708,9 @@ func (s *ListMarginTradesService) Do(ctx context.Context, opts ...RequestOption)

// GetMaxBorrowableService get max borrowable of asset
type GetMaxBorrowableService struct {
c *Client
asset string
c *Client
asset string
isolatedSymbol string
}

// Asset set asset
Expand All @@ -718,6 +719,12 @@ func (s *GetMaxBorrowableService) Asset(asset string) *GetMaxBorrowableService {
return s
}

// IsolatedSymbol set isolatedSymbol
func (s *GetMaxBorrowableService) IsolatedSymbol(isolatedSymbol string) *GetMaxBorrowableService {
s.isolatedSymbol = isolatedSymbol
return s
}

// Do send request
func (s *GetMaxBorrowableService) Do(ctx context.Context, opts ...RequestOption) (res *MaxBorrowable, err error) {
r := &request{
Expand All @@ -726,6 +733,7 @@ func (s *GetMaxBorrowableService) Do(ctx context.Context, opts ...RequestOption)
secType: secTypeSigned,
}
r.setParam("asset", s.asset)
r.setParam("isolatedSymbol", s.isolatedSymbol)
beansgum marked this conversation as resolved.
Show resolved Hide resolved
data, err := s.c.callAPI(ctx, r, opts...)
if err != nil {
return nil, err
Expand Down