init: 初始化 AssetX 项目仓库
包含 webapp(Next.js 用户端)、webapp-back(Go 后端)、 antdesign(管理后台)、landingpage(营销落地页)、 数据库 SQL 和配置文件。
This commit is contained in:
24
webapp-back/models/yt_swap.go
Normal file
24
webapp-back/models/yt_swap.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// YTSwapRecord records each Swap event emitted by YT Vault contracts.
|
||||
// Swap(address account, address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOut, uint256 feeBasisPoints)
|
||||
// account/tokenIn/tokenOut are indexed (topics), amountIn/amountOut are in data.
|
||||
type YTSwapRecord struct {
|
||||
ID uint `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
TxHash string `gorm:"size:66;uniqueIndex:uk_tx_log" json:"tx_hash"`
|
||||
LogIndex uint `gorm:"uniqueIndex:uk_tx_log" json:"log_index"`
|
||||
ChainID int `gorm:"index" json:"chain_id"`
|
||||
BlockNumber uint64 `json:"block_number"`
|
||||
BlockTime time.Time `gorm:"index" json:"block_time"`
|
||||
VaultAddr string `gorm:"size:42;index" json:"vault_addr"`
|
||||
Account string `gorm:"size:42;index" json:"account"`
|
||||
TokenIn string `gorm:"size:42" json:"token_in"`
|
||||
TokenOut string `gorm:"size:42" json:"token_out"`
|
||||
AmountIn string `gorm:"size:78" json:"amount_in"` // wei string, base units
|
||||
AmountOut string `gorm:"size:78" json:"amount_out"` // wei string, base units
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
func (YTSwapRecord) TableName() string { return "yt_swap_records" }
|
||||
Reference in New Issue
Block a user