diff --git a/pkg/exchange/max/exchange.go b/pkg/exchange/max/exchange.go index 69e3cb5f9..b7106bc83 100644 --- a/pkg/exchange/max/exchange.go +++ b/pkg/exchange/max/exchange.go @@ -551,7 +551,7 @@ func (e *Exchange) QueryAccount(ctx context.Context) (*types.Account, error) { return nil, err } - vipLevel, err := e.client.AccountService.NewGetVipLevelRequest().Do(ctx) + vipLevel, err := e.client.NewGetVipLevelRequest().Do(ctx) if err != nil { return nil, err } diff --git a/pkg/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go index 26ce9326a..ea92f00e8 100644 --- a/pkg/exchange/max/maxapi/account.go +++ b/pkg/exchange/max/maxapi/account.go @@ -79,8 +79,8 @@ type GetVipLevelRequest struct { client requestgen.AuthenticatedAPIClient } -func (s *AccountService) NewGetVipLevelRequest() *GetVipLevelRequest { - return &GetVipLevelRequest{client: s.client} +func (c *RestClient) NewGetVipLevelRequest() *GetVipLevelRequest { + return &GetVipLevelRequest{client: c} } //go:generate GetRequest -url "v2/members/accounts/:currency" -type GetAccountRequest -responseType .Account @@ -90,8 +90,8 @@ type GetAccountRequest struct { currency string `param:"currency,slug"` } -func (s *AccountService) NewGetAccountRequest() *GetAccountRequest { - return &GetAccountRequest{client: s.client} +func (c *RestClient) NewGetAccountRequest() *GetAccountRequest { + return &GetAccountRequest{client: c} } //go:generate GetRequest -url "v2/members/accounts" -type GetAccountsRequest -responseType []Account diff --git a/pkg/exchange/max/maxapi/account_test.go b/pkg/exchange/max/maxapi/account_test.go index e082586be..804e173b7 100644 --- a/pkg/exchange/max/maxapi/account_test.go +++ b/pkg/exchange/max/maxapi/account_test.go @@ -38,14 +38,14 @@ func TestAccountService_GetAccountRequest(t *testing.T) { client := NewRestClient(ProductionAPIURL) client.Auth(key, secret) - req := client.AccountService.NewGetAccountRequest() + req := client.NewGetAccountRequest() req.Currency("twd") account, err := req.Do(ctx) assert.NoError(t, err) assert.NotNil(t, account) t.Logf("account: %+v", account) - req2 := client.AccountService.NewGetAccountRequest() + req2 := client.NewGetAccountRequest() req2.Currency("usdt") account, err = req.Do(ctx) assert.NoError(t, err) @@ -64,7 +64,7 @@ func TestAccountService_GetVipLevelRequest(t *testing.T) { client := NewRestClient(ProductionAPIURL) client.Auth(key, secret) - req := client.AccountService.NewGetVipLevelRequest() + req := client.NewGetVipLevelRequest() vipLevel, err := req.Do(ctx) assert.NoError(t, err) assert.NotNil(t, vipLevel)