models

package
v0.0.0-...-0ee7c34 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        uint      `json:"id" gorm:"primaryKey" example:"1"`
	CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime" example:"2021-08-01T00:00:00Z"`
	UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime" example:"2021-08-01T00:00:00Z"`
}

type Pool

type Pool struct {
	Id                string  `json:"id"`
	Name              string  `json:"name"`
	Symbol            string  `json:"symbol"`
	FirstToken        Token   `json:"first_token"`
	SecondToken       Token   `json:"second_token"`
	FirstTokenAmount  float64 `json:"first_token_amount"`
	SecondTokenAmount float64 `json:"second_token_amount"`
	StartDate         string  `json:"start_date"`
	EndDate           string  `json:"end_date"`
	TotalVolume       float64 `json:"total_volume"`
	TotalLiquidity    float64 `json:"total_liquidity"`
	TotalFees         float64 `json:"total_fees"`
	TotalTrades       int     `json:"total_trades"`
	UsersList         []User  `json:"users_list"`
}

Pool struct for a DEX

type ResponseStruct

type ResponseStruct struct {
	Success       bool    `json:"success"`
	Timestamp     int64   `json:"timestamp"`
	AmountOfCoins int     `json:"amount_of_coins"`
	Tokens        []Token `json:"tokens"`
}

type Token

type Token struct {
	Id                        string   `json:"id"`
	Name                      string   `json:"name"`
	Symbol                    string   `json:"symbol"`
	Image                     string   `json:"image"`
	CurrentPrice              float64  `json:"current_price"`
	MarketCap                 float64  `json:"market_cap"`
	MarketCapRank             int      `json:"market_cap_rank"`
	TotalVolume               float64  `json:"total_volume"`
	PriceChange24h            float64  `json:"price_change_24h"`
	PriceChangePercentage24h  float64  `json:"price_change_percentage_24h"`
	MarketCapChange24h        float64  `json:"market_cap_change_24h"`
	MarketCapChangePercentage float64  `json:"market_cap_change_percentage_24h"`
	TotalSupply               *float64 `json:"total_supply"` // Peut être null
	MaxSupply                 *float64 `json:"max_supply"`   // Peut être null
}

type Transaction

type Transaction struct {
	Base
	From        string  `json:"from" example:"0x123abc"`
	To          string  `json:"to" example:"0x456def"`
	Amount      float64 `json:"amount" example:"99.99"`
	Transaction string  `json:"transaction" example:"tx_789ghi"`
}

func (*Transaction) TableName

func (transaction *Transaction) TableName() string

type User

type User struct {
	Base
	Name    string `json:"name" gorm:"not null" example:"John Doe"`
	Address string `json:"address" gorm:"unique" example:"0x123abc" validate:"required"`
}

func (*User) TableName

func (user *User) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL