Skip to content

Instantly share code, notes, and snippets.

@c9s
Created January 2, 2022 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c9s/cebf64aa6a60d0e3ed2a48e64d68db61 to your computer and use it in GitHub Desktop.
Save c9s/cebf64aa6a60d0e3ed2a48e64d68db61 to your computer and use it in GitHub Desktop.
package api
import "github.com/c9s/requestgen"
//go:generate requestgen -type PlaceOrderRequest -method POST -url /v1/orders -responseType .Response
type PlaceOrderRequest struct {
client requestgen.AuthenticatedAPIClient
// A combination of case-sensitive alphanumerics, all numbers, or all letters of up to 32 characters.
clientOrderID *string `param:"clientOid,required" defaultValuer:"uuid()"`
symbol string `param:"symbol,required"`
side SideType `param:"side,required" validValues:"buy,sell"`
ordType OrderType `param:"ordType,required" validValues:"limit,market" default:"limit"`
size string `param:"size"`
// limit order parameters
price *string `param:"price,omitempty"`
timeInForce *TimeInForceType `param:"timeInForce,omitempty" validValues:"GTC,GTT,FOK"`
startTime *time.Time `param:"startTime,milliseconds" defaultValuer:"now()"`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment