asset

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssetTableName = `asset`

	StatusActive   uint32 = 0
	StatusInactive uint32 = 1

	IsGasAsset = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	gorm.Model
	AssetId     uint32 `gorm:"uniqueIndex"`
	AssetName   string
	AssetSymbol string
	L1Address   string
	Decimals    uint32
	Status      uint32
	IsGasAsset  uint32
}

func (*Asset) TableName

func (*Asset) TableName() string

type AssetModel

type AssetModel interface {
	CreateAssetTable() error
	DropAssetTable() error
	CreateAssets(assets []*Asset) (rowsAffected int64, err error)
	GetAssetsTotalCount() (count int64, err error)
	GetAssets(limit int64, offset int64) (assets []*Asset, err error)
	GetAssetById(assetId int64) (asset *Asset, err error)
	GetAssetBySymbol(symbol string) (asset *Asset, err error)
	GetAssetByAddress(address string) (asset *Asset, err error)
	GetGasAssets() (assets []*Asset, err error)
	GetMaxAssetId() (max int64, err error)
	CreateAssetsInTransact(tx *gorm.DB, assets []*Asset) error
	UpdateAssetsInTransact(tx *gorm.DB, assets []*Asset) error
}

func NewAssetModel

func NewAssetModel(db *gorm.DB) AssetModel

Jump to

Keyboard shortcuts

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