diff --git a/pkg/exchange/max/maxapi/account.go b/pkg/exchange/max/maxapi/account.go index b1c4d4d13..51e12ceab 100644 --- a/pkg/exchange/max/maxapi/account.go +++ b/pkg/exchange/max/maxapi/account.go @@ -2,6 +2,7 @@ package max //go:generate -command GetRequest requestgen -method GET //go:generate -command PostRequest requestgen -method POST +//go:generate -command DeleteRequest requestgen -method DELETE import ( "github.com/c9s/requestgen" diff --git a/pkg/exchange/max/maxapi/v3/order.go b/pkg/exchange/max/maxapi/v3/order.go index 9ebc8bebf..ddcbc7217 100644 --- a/pkg/exchange/max/maxapi/v3/order.go +++ b/pkg/exchange/max/maxapi/v3/order.go @@ -13,8 +13,8 @@ import ( type WalletType string const ( - WalletTypeSpot = WalletType("spot") - WalletTypeMargin = WalletType("m") + WalletTypeSpot WalletType = "spot" + WalletTypeMargin WalletType = "m" ) type Order = maxapi.Order diff --git a/pkg/exchange/max/maxapi/v3/wallet_create_order_request_requestgen.go b/pkg/exchange/max/maxapi/v3/wallet_create_order_request_requestgen.go index b6d1535ca..477c8ea9e 100644 --- a/pkg/exchange/max/maxapi/v3/wallet_create_order_request_requestgen.go +++ b/pkg/exchange/max/maxapi/v3/wallet_create_order_request_requestgen.go @@ -190,6 +190,17 @@ func (w *WalletCreateOrderRequest) GetSlugParameters() (map[string]interface{}, } // END TEMPLATE check-required + // TEMPLATE check-valid-values + switch walletType { + case WalletTypeSpot, WalletTypeMargin: + params["walletType"] = walletType + + default: + return nil, fmt.Errorf("walletType value %v is invalid", walletType) + + } + // END TEMPLATE check-valid-values + // assign parameter of walletType params["walletType"] = walletType diff --git a/pkg/exchange/max/maxapi/v3/wallet_get_order_request_requestgen.go b/pkg/exchange/max/maxapi/v3/wallet_get_order_request_requestgen.go index 71c501206..181dae703 100644 --- a/pkg/exchange/max/maxapi/v3/wallet_get_order_request_requestgen.go +++ b/pkg/exchange/max/maxapi/v3/wallet_get_order_request_requestgen.go @@ -190,6 +190,17 @@ func (w *WalletGetOrderRequest) GetSlugParameters() (map[string]interface{}, err } // END TEMPLATE check-required + // TEMPLATE check-valid-values + switch walletType { + case WalletTypeSpot, WalletTypeMargin: + params["walletType"] = walletType + + default: + return nil, fmt.Errorf("walletType value %v is invalid", walletType) + + } + // END TEMPLATE check-valid-values + // assign parameter of walletType params["walletType"] = walletType diff --git a/pkg/exchange/max/maxapi/v3/wallet_order_cancel_all_request_requestgen.go b/pkg/exchange/max/maxapi/v3/wallet_order_cancel_all_request_requestgen.go index 373320a4c..8f7e071be 100644 --- a/pkg/exchange/max/maxapi/v3/wallet_order_cancel_all_request_requestgen.go +++ b/pkg/exchange/max/maxapi/v3/wallet_order_cancel_all_request_requestgen.go @@ -119,6 +119,17 @@ func (w *WalletOrderCancelAllRequest) GetSlugParameters() (map[string]interface{ } // END TEMPLATE check-required + // TEMPLATE check-valid-values + switch walletType { + case WalletTypeSpot, WalletTypeMargin: + params["walletType"] = walletType + + default: + return nil, fmt.Errorf("walletType value %v is invalid", walletType) + + } + // END TEMPLATE check-valid-values + // assign parameter of walletType params["walletType"] = walletType