models

package
v0.0.0-...-dee77e4 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time
}

type LiquidityPool

type LiquidityPool struct {
	BaseModel
	Address        string `gorm:"primary_key"`
	FactoryAddress string
	Name           string
	Symbol         string
	Description    string
	Exchange       string
	Token0Address  string
	Token1Address  string
	Token0Weight   int
	Token1Weight   int
	Token0         Token
	Token1         Token
	Reserve0       *utils.BigInt `gorm:"type:bytea"`
	Reserve1       *utils.BigInt `gorm:"type:bytea"`
	Token0Price    float64       `gorm:"-"`
	Token1Price    float64       `gorm:"-"`
}

func (*LiquidityPool) GetTokens

func (p *LiquidityPool) GetTokens(db *gorm.DB) error

func (LiquidityPool) LpToken

func (l LiquidityPool) LpToken() *tokens.LpToken

type LiquidityPools

type LiquidityPools []LiquidityPool

func (*LiquidityPools) LoadSupportedPools

func (l *LiquidityPools) LoadSupportedPools(db *gorm.DB) error

type Token

type Token struct {
	BaseModel
	Address     string `gorm:"primary_key"`
	Name        string
	Symbol      string
	LogoUrl     string
	Decimals    int
	TotalSupply int64
	LoanAmount  int64 //`gorm:"-"`
}

func NewTokenFromERC20

func NewTokenFromERC20(t tokens.Erc20) *Token

func (Token) FormattedTotalSupply

func (t Token) FormattedTotalSupply() float64

type Tokens

type Tokens []Token

func (*Tokens) GetAll

func (t *Tokens) GetAll(db *gorm.DB) error

type Transaction

type Transaction struct {
	BaseModel
}

Jump to

Keyboard shortcuts

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