mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
max: fix max v3 order cancel
This commit is contained in:
parent
aeae2d58c9
commit
470e003867
19
pkg/exchange/max/maxapi/v3/cancel_order_request.go
Normal file
19
pkg/exchange/max/maxapi/v3/cancel_order_request.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package v3
|
||||
|
||||
//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"
|
||||
|
||||
func (s *OrderService) NewCancelOrderRequest() *CancelOrderRequest {
|
||||
return &CancelOrderRequest{client: s.Client}
|
||||
}
|
||||
|
||||
//go:generate DeleteRequest -url "/api/v3/order" -type CancelOrderRequest -responseType .Order
|
||||
type CancelOrderRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
id *uint64 `param:"id,omitempty"`
|
||||
clientOrderID *string `param:"client_oid,omitempty"`
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
// Code generated by "requestgen -method POST -url /api/v3/order -type CancelOrderRequest -responseType .Order"; DO NOT EDIT.
|
||||
// Code generated by "requestgen -method DELETE -url /api/v3/order -type CancelOrderRequest -responseType .Order"; DO NOT EDIT.
|
||||
|
||||
package v3
|
||||
|
||||
|
@ -146,7 +146,7 @@ func (c *CancelOrderRequest) Do(ctx context.Context) (*max.Order, error) {
|
|||
|
||||
apiURL := "/api/v3/order"
|
||||
|
||||
req, err := c.client.NewAuthenticatedRequest(ctx, "POST", apiURL, query, params)
|
||||
req, err := c.client.NewAuthenticatedRequest(ctx, "DELETE", apiURL, query, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
19
pkg/exchange/max/maxapi/v3/get_order_request.go
Normal file
19
pkg/exchange/max/maxapi/v3/get_order_request.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package v3
|
||||
|
||||
//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"
|
||||
|
||||
func (s *OrderService) NewGetOrderRequest() *GetOrderRequest {
|
||||
return &GetOrderRequest{client: s.Client}
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v3/order" -type GetOrderRequest -responseType .Order
|
||||
type GetOrderRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
id *uint64 `param:"id,omitempty"`
|
||||
clientOrderID *string `param:"client_oid,omitempty"`
|
||||
}
|
28
pkg/exchange/max/maxapi/v3/get_wallet_trades_request.go
Normal file
28
pkg/exchange/max/maxapi/v3/get_wallet_trades_request.go
Normal file
|
@ -0,0 +1,28 @@
|
|||
package v3
|
||||
|
||||
//go:generate -command GetRequest requestgen -method GET
|
||||
//go:generate -command PostRequest requestgen -method POST
|
||||
//go:generate -command DeleteRequest requestgen -method DELETE
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/c9s/requestgen"
|
||||
)
|
||||
|
||||
func (s *OrderService) NewGetWalletTradesRequest(walletType WalletType) *GetWalletTradesRequest {
|
||||
return &GetWalletTradesRequest{client: s.Client, walletType: walletType}
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v3/wallet/:walletType/trades" -type GetWalletTradesRequest -responseType []Trade
|
||||
type GetWalletTradesRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
walletType WalletType `param:"walletType,slug,required"`
|
||||
|
||||
market string `param:"market,required"`
|
||||
from *uint64 `param:"from_id"`
|
||||
startTime *time.Time `param:"start_time,milliseconds"`
|
||||
endTime *time.Time `param:"end_time,milliseconds"`
|
||||
limit *uint64 `param:"limit"`
|
||||
}
|
|
@ -5,8 +5,6 @@ package v3
|
|||
//go:generate -command DeleteRequest requestgen -method DELETE
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/c9s/requestgen"
|
||||
|
||||
maxapi "github.com/c9s/bbgo/pkg/exchange/max/maxapi"
|
||||
|
@ -43,18 +41,6 @@ func (s *OrderService) NewCancelWalletOrderAllRequest(walletType WalletType) *Ca
|
|||
return &CancelWalletOrderAllRequest{client: s.Client, walletType: walletType}
|
||||
}
|
||||
|
||||
func (s *OrderService) NewGetWalletTradesRequest(walletType WalletType) *GetWalletTradesRequest {
|
||||
return &GetWalletTradesRequest{client: s.Client, walletType: walletType}
|
||||
}
|
||||
|
||||
func (s *OrderService) NewCancelOrderRequest() *CancelOrderRequest {
|
||||
return &CancelOrderRequest{client: s.Client}
|
||||
}
|
||||
|
||||
func (s *OrderService) NewGetOrderRequest() *GetOrderRequest {
|
||||
return &GetOrderRequest{client: s.Client}
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v3/wallet/:walletType/accounts" -type GetWalletAccountsRequest -responseType []Account
|
||||
type GetWalletAccountsRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
@ -107,31 +93,3 @@ type CancelWalletOrderAllRequest struct {
|
|||
groupID *uint32 `param:"groupID"`
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v3/wallet/:walletType/trades" -type GetWalletTradesRequest -responseType []Trade
|
||||
type GetWalletTradesRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
walletType WalletType `param:"walletType,slug,required"`
|
||||
|
||||
market string `param:"market,required"`
|
||||
from *uint64 `param:"from_id"`
|
||||
startTime *time.Time `param:"start_time,milliseconds"`
|
||||
endTime *time.Time `param:"end_time,milliseconds"`
|
||||
limit *uint64 `param:"limit"`
|
||||
}
|
||||
|
||||
//go:generate PostRequest -url "/api/v3/order" -type CancelOrderRequest -responseType .Order
|
||||
type CancelOrderRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
id *uint64 `param:"id,omitempty"`
|
||||
clientOrderID *string `param:"client_oid,omitempty"`
|
||||
}
|
||||
|
||||
//go:generate GetRequest -url "/api/v3/order" -type GetOrderRequest -responseType .Order
|
||||
type GetOrderRequest struct {
|
||||
client requestgen.AuthenticatedAPIClient
|
||||
|
||||
id *uint64 `param:"id,omitempty"`
|
||||
clientOrderID *string `param:"client_oid,omitempty"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user