Documentation ¶
Overview ¶
Package models contains teh database models TODO: move back to db
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllModels ¶
func GetAllModels() (allModels []interface{})
GetAllModels gets all models to migrate.
Types ¶
type Quote ¶
type Quote struct { ID uint `gorm:"primaryKey" json:"id" uri:"id"` Relayer string `json:"relayer" binding:"required"` OriginChainID uint `json:"origin_chain_id" binding:"required"` DestChainID uint `json:"dest_chain_id" binding:"required"` OriginToken string `json:"origin_token" binding:"required"` DestToken string `json:"dest_token" binding:"required"` OriginAmount decimal.Decimal `json:"origin_amount" binding:"required" gorm:"type:numeric"` DestAmount decimal.Decimal `json:"dest_amount" binding:"required" gorm:"type:numeric"` Price decimal.Decimal `json:"price" gorm:"type:numeric"` // price = destAmount <quote> / originAmount <base> CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` }
Quote represents bindings/FastBridge.go::IFastBridgeBridgeTransaction.
func (*Quote) BeforeCreate ¶
BeforeCreate hook to set price on insert.
func (*Quote) BeforeSave ¶
BeforeSave hook to set price on update.
type Request ¶
type Request struct { OriginChainID uint `form:"origin_chain_id"` DestChainID uint `form:"dest_chain_id"` OriginToken string `form:"origin_token"` DestToken string `form:"dest_token"` OriginAmount decimal.Decimal `form:"origin_amount" gorm:"type:numeric"` UpdatedAtLast time.Time `form:"updated_at_last"` // for liveness checks on q.UpdatedAt }
Request is the request to get a quote.
Click to show internal directories.
Click to hide internal directories.