Documentation ¶
Index ¶
- Constants
- Variables
- type AccountStatsRes
- type ArNFT
- type Collect
- type CollectStats
- type FailureRecord
- type InfoRes
- type LpClientInfo
- type LpMsg
- type LpMsgAdd
- type LpMsgAddResponse
- type LpMsgOrder
- type LpMsgRegister
- type LpMsgReject
- type LpMsgRemove
- type LpMsgRemoveResponse
- type LpMsgResponse
- type LpMsgSalt
- type LpMsgSign
- type LpRewardsRes
- type LpsRes
- type NFTRes
- type NFTWhiteList
- type OrderMsgStatus
- type OrdersRes
- type PenaltyRes
- type PermaLpReward
- type PermaLpsSnapshot
- type PermaOrder
- type PermaVolume
- type PoolRes
- type PoolStatsRes
- type ResNFT
- type SumPermaVolumeRes
- type TVL
- type UserMsg
- type UserMsgOrder
- type UserMsgQuery
- type UserMsgResponse
- type UserMsgSubmit
- type Volume
Constants ¶
View Source
const ( // msg from lp LpMsgEventRegister = "register" LpMsgEventAdd = "add" LpMsgEventRemove = "remove" LpMsgEventSign = "sign" LpMsgEventReject = "reject" // msg to lp LpMsgEventResponse = "response" LpMsgEventSalt = "salt" // salt for register LpMsgEventOrder = "order" LpMsgEventAddResponse = "addResponse" // response to add lp LpMsgEventRemoveResponse = "removeResponse" // response to remove lp )
View Source
const ( OrderStatusPending = "pending" OrderStatusSuccess = "success" OrderStatusFailed = "failed" OrderStatusExpired = "expired" OrderMsgEventStatus = "status" OrderExpire = 10 * time.Second // order life cycle )
View Source
const ( LpPenaltyForNoSign = "lp_no_sign" LpPenaltyForNoEnoughBalance = "lp_no_enough_balance" UserPenaltyForNoEnoughBalance = "user_no_enough_balance" )
View Source
const ( // msg from user UserMsgEventQuery = "query" UserMsgEventSubmit = "submit" // msg to user UserMsgEventResponse = "response" UserMsgEventOrder = "order" )
Variables ¶
View Source
var ( // response msg LpMsgOk = LpMsgResponse{Event: LpMsgEventResponse, Msg: "ok"} )
Functions ¶
This section is empty.
Types ¶
type AccountStatsRes ¶
type AccountStatsRes struct { Address string `json:"address"` Volumes []Volume `json:"volumes"` Rewards []PermaLpReward `json:"rewards"` TVLs []TVL `json:"tvls"` }
type Collect ¶
type Collect struct { Slug string `json:"slug"` Name string `json:"name"` ImageUrl string `json:"image_url"` CreateTime string `json:"created_date"` Stats CollectStats `json:"stats"` }
type CollectStats ¶
type FailureRecord ¶
type LpClientInfo ¶
type LpMsgAdd ¶
type LpMsgAdd struct { ID string `json:"id"` Event string `json:"event"` TokenX string `json:"tokenX"` TokenY string `json:"tokenY"` FeeRatio *apd.Decimal `json:"feeRatio"` CurrentSqrtPrice *apd.Decimal `json:"currentSqrtPrice"` LowSqrtPrice *apd.Decimal `json:"lowSqrtPrice"` HighSqrtPrice *apd.Decimal `json:"highSqrtPrice"` Liquidity string `json:"liquidity"` PriceDirection string `json:"priceDirection"` }
type LpMsgAddResponse ¶
type LpMsgAddResponse struct { Event string `json:"event"` LpID string `json:"lpID"` Msg string `json:"msg"` // "ok" or "failed" Error string `json:"error"` }
func (LpMsgAddResponse) Marshal ¶
func (l LpMsgAddResponse) Marshal() []byte
type LpMsgOrder ¶
type LpMsgOrder struct { Event string `json:"event"` UserAddr string `json:"userAddr"` Bundle everSchema.Bundle `json:"bundle"` Paths []coreSchema.Path `json:"paths"` }
func (LpMsgOrder) Marshal ¶
func (l LpMsgOrder) Marshal() []byte
type LpMsgRegister ¶
type LpMsgRegister struct { ID string `json:"id"` Event string `json:"event"` Address string `json:"address"` Sig string `json:"sig"` LpClientName string `json:"lpClientName"` LpClientVersion string `json:"lpClientVerison"` }
func (LpMsgRegister) Marshal ¶
func (l LpMsgRegister) Marshal() []byte
type LpMsgReject ¶
type LpMsgReject struct { ID string `json:"id"` Event string `json:"event"` Address string `json:"address"` OrderHash string `json:"orderHash"` }
func (LpMsgReject) Marshal ¶
func (l LpMsgReject) Marshal() []byte
type LpMsgRemove ¶
type LpMsgRemove struct { ID string `json:"id"` Event string `json:"event"` TokenX string `json:"tokenX"` TokenY string `json:"tokenY"` FeeRatio *apd.Decimal `json:"feeRatio"` LowSqrtPrice *apd.Decimal `json:"lowSqrtPrice"` HighSqrtPrice *apd.Decimal `json:"highSqrtPrice"` PriceDirection string `json:"priceDirection"` }
func (LpMsgRemove) Marshal ¶
func (l LpMsgRemove) Marshal() []byte
type LpMsgRemoveResponse ¶
type LpMsgRemoveResponse struct { Event string `json:"event"` LpID string `json:"lpID"` Msg string `json:"msg"` // "ok" or "failed" Error string `json:"error"` }
func (LpMsgRemoveResponse) Marshal ¶
func (l LpMsgRemoveResponse) Marshal() []byte
type LpMsgResponse ¶
func (LpMsgResponse) Marshal ¶
func (l LpMsgResponse) Marshal() []byte
type LpMsgSign ¶
type LpMsgSign struct { ID string `json:"id"` Event string `json:"event"` Address string `json:"address"` Bundle everSchema.BundleWithSigs `json:"bundle"` }
type LpRewardsRes ¶
type LpRewardsRes struct { Address string `json:"address"` LpID string `json:"lpID"` Rewards []*PermaLpReward `json:"rewards"` }
type NFTWhiteList ¶
type OrderMsgStatus ¶
type OrderMsgStatus struct { Event string `json:"event" default:"status"` OrderHash string `json:"orderHash"` EverHash string `json:"everHash"` Status string `json:"status"` }
func (OrderMsgStatus) Marshal ¶
func (o OrderMsgStatus) Marshal() []byte
type OrdersRes ¶
type OrdersRes struct { //Total int64 `json:"total"` Orders []*PermaOrder `json:"orders"` }
type PenaltyRes ¶
type PermaLpReward ¶
type PermaLpReward struct { ID int64 `gorm:"primary_key;auto_increment" json:"id"` CreatedAt *time.Time `gorm:"ASSOCIATION_AUTOCREATE" json:"-"` LpID string `gorm:"index:plrindex1,unique" json:"lpID"` PoolID string `json:"poolID"` AccID string `json:"accID"` RewardX float64 `json:"rewardX"` RewardY float64 `json:"rewardY"` }
type PermaLpsSnapshot ¶
type PermaOrder ¶
type PermaOrder struct { ID int64 `gorm:"primary_key;auto_increment" json:"id"` UpdatedAt *time.Time `gorm:"ASSOCIATION_AUTOUPDATE" json:"-"` CreatedAt *time.Time `gorm:"ASSOCIATION_AUTOCREATE" json:"-"` UserAddr string `gorm:"index:poindex1" json:"address"` EverHash string `gorm:"index:poindex2" json:"everHash"` TokenInTag string `json:"tokenInTag"` TokenOutTag string `json:"tokenOutTag"` TokenInAmount string `json:"tokenInAmount"` TokenOutAmount string `json:"tokenOutAmount"` Price string `json:"price"` OrderStatus string `json:"status"` OrderTimestamp int64 `json:"timestamp"` // nonce }
type PermaVolume ¶
type PermaVolume struct { ID int64 `gorm:"primary_key;auto_increment" json:"id"` CreatedAt *time.Time `gorm:"ASSOCIATION_AUTOCREATE" json:"-"` OrderID int64 `json:"orderId"` EverHash string `json:"everHash"` PoolID string `json:"poolID"` AccID string `json:"accID"` LpID string `json:"lpID"` TokenXIsTokenIN bool `json:"tokenXIsTokenIn"` AmountX float64 `json:"amountX"` AmountY float64 `json:"amountY"` RewardX float64 `json:"rewardX"` RewardY float64 `json:"rewardY"` }
type PoolStatsRes ¶
type ResNFT ¶
type ResNFT struct { ContractAddr string `json:"contractAddr"` TokenId string `json:"tokenId"` PermaLink string `json:"permaLink"` Collection Collect `json:"collection"` ImageUrl string `json:"imageUrl"` Name string `json:"name"` NameDes string `json:"nameDes"` Price string `json:"price"` PriceSymbol string `json:"priceSymbol"` TopOffer string `json:"topOffer"` TopOfferSymbol string `json:"topOfferSymbol"` MinOffer string `json:"minOffer"` MinOfferSymbol string `json:"minOfferSymbol"` AuctionType string `json:"auctionType"` Owner string `json:"owner"` OwnerLink string `json:"ownerLink"` CollectionName string `json:"collectionName"` CollectionNameDes string `json:"collectionNameDes"` Timestamp int64 `json:"timestamp"` }
type SumPermaVolumeRes ¶
type UserMsgOrder ¶
type UserMsgOrder struct { Event string `json:"event" default:"order"` UserAddr string `json:"userAddr"` TokenIn string `json:"tokenIn"` TokenOut string `json:"tokenOut"` Price string `json:"price"` PriceImpact string `json:"priceImpact"` Bundle everSchema.Bundle `json:"bundle"` Paths []coreSchema.Path `json:"paths"` }
func (UserMsgOrder) Marshal ¶
func (u UserMsgOrder) Marshal() []byte
type UserMsgQuery ¶
type UserMsgQuery struct { ID string `json:"id"` Event string `json:"event"` Address string `json:"address"` TokenIn string `json:"tokenIn"` TokenOut string `json:"tokenOut"` AmountIn string `json:"amountIn"` }
{"event":"query","address":"123","tokenIn":"ethereum-eth-0x0000000000000000000000000000000000000000","tokenOut":"ethereum-usdc-0xb7a4f3e9097c08da09517b5ab877f7a917224ede", "amountIn":"4000000000000000"}
func (UserMsgQuery) Marshal ¶
func (l UserMsgQuery) Marshal() []byte
type UserMsgResponse ¶
func (UserMsgResponse) Marshal ¶
func (l UserMsgResponse) Marshal() []byte
type UserMsgSubmit ¶
type UserMsgSubmit struct { ID string `json:"id"` Event string `json:"event"` Address string `json:"address"` TokenIn string `json:"tokenIn"` TokenOut string `json:"tokenOut"` Bundle everSchema.BundleWithSigs `json:"bundle"` Paths []coreSchema.Path `json:"paths"` }
func (UserMsgSubmit) Marshal ¶
func (l UserMsgSubmit) Marshal() []byte
type Volume ¶
type Volume struct { //Duration int64 `json:"duration"` // in minutes Timestamp int64 `json:"timestamp"` PoolID string `json:"poolID"` AccID string `json:"accID"` LpID string `json:"lpID"` TokenX string `json:"tokenX"` TokenY string `json:"tokenY"` X float64 `json:"volumeX"` Y float64 `json:"volumeY"` USD float64 `json:"volumeInUSD"` RewardX float64 `json:"rewardX"` RewardY float64 `json:"rewardY"` RewardUSD float64 `json:"rewardInUSD"` }
Click to show internal directories.
Click to hide internal directories.