Documentation
¶
Index ¶
Constants ¶
View Source
const ( Swap = "swap" Buy = "buy" Sell = "sell" )
Variables ¶
This section is empty.
Functions ¶
func NewValidator ¶
func NewValidator() error
Types ¶
type Intent ¶
type Intent struct {
Sender string `json:"sender" binding:"required,eth_addr"` // filled by ui
Kind string `json:"kind" binding:"required"` // ui
Hash string `json:"hash"` // ui or bundler
SellToken string `json:"sellToken"` // optional for limit orders, ui
BuyToken string `json:"buyToken"` // ui
SellAmount float64 `json:"sellAmount"` // optional for limit orders, ui
BuyAmount float64 `json:"buyAmount"` // ui
PartiallyFillable bool `json:"partiallyFillable"` // ui
CallData string `json:"callData"` // UI, Bundler, Solver
Status ProcessingStatus `json:"status" binding:"status"` // ui or bundler
CreatedAt int64 `json:"createdAt" binding:"opt_int"` // ui or bundler
ExpirationAt int64 `json:"expirationAt" binding:"opt_int"` // ui or bundler for default expiration (TTL: 100 seconds)
}
func (*Intent) ValidateKind ¶
ValidateKind this function is manually, and it's not bound to Gin's validation. Should be called before posting or responding to a request. Investigate if it can be bound to Gin's validation.
type ProcessingStatus ¶
type ProcessingStatus string
const ( Received ProcessingStatus = "Received" SentToSolver ProcessingStatus = "SentToSolver" Solved ProcessingStatus = "Solved" Unsolved ProcessingStatus = "Unsolved" Expired ProcessingStatus = "Expired" OnChain ProcessingStatus = "OnChain" Invalid ProcessingStatus = "Invalid" )
Click to show internal directories.
Click to hide internal directories.