Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #871 from c9s/improvements/maxapi
improve: improve maxapi, add v2 order api back
- Loading branch information
Showing
18 changed files
with
750 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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" | ||
|
||
func (s *OrderService) NewCancelOrderRequest() *CancelOrderRequest { | ||
return &CancelOrderRequest{client: s.client} | ||
} | ||
|
||
//go:generate PostRequest -url "/api/v2/order/delete" -type CancelOrderRequest -responseType .Order | ||
type CancelOrderRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
id *uint64 `param:"id,omitempty"` | ||
clientOrderID *string `param:"client_oid,omitempty"` | ||
} |
163 changes: 163 additions & 0 deletions
163
pkg/exchange/max/maxapi/cancel_order_request_requestgen.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package max | ||
|
||
import "github.com/c9s/requestgen" | ||
|
||
//go:generate -command GetRequest requestgen -method GET | ||
//go:generate -command PostRequest requestgen -method POST | ||
//go:generate -command DeleteRequest requestgen -method DELETE | ||
|
||
//go:generate PostRequest -url "/api/v2/orders" -type CreateOrderRequest -responseType .Order | ||
type CreateOrderRequest struct { | ||
client requestgen.AuthenticatedAPIClient | ||
|
||
market string `param:"market,required"` | ||
side string `param:"side,required"` | ||
volume string `param:"volume,required"` | ||
orderType OrderType `param:"ord_type"` | ||
|
||
price *string `param:"price"` | ||
stopPrice *string `param:"stop_price"` | ||
clientOrderID *string `param:"client_oid"` | ||
groupID *string `param:"group_id"` | ||
} | ||
|
||
func (s *OrderService) NewCreateOrderRequest() *CreateOrderRequest { | ||
return &CreateOrderRequest{client: s.client} | ||
} |
Oops, something went wrong.