nft

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 (
	L2NftHistoryTableName = `l2_nft_history`
)
View Source
const (
	L2NftTableName = `l2_nft`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type L2Nft

type L2Nft struct {
	gorm.Model
	NftIndex            int64 `gorm:"uniqueIndex"`
	CreatorAccountIndex int64
	OwnerAccountIndex   int64
	NftContentHash      string
	NftL1Address        string
	NftL1TokenId        string
	CreatorTreasuryRate int64
	CollectionId        int64
}

func (*L2Nft) TableName

func (*L2Nft) TableName() string

type L2NftHistory

type L2NftHistory struct {
	gorm.Model
	NftIndex            int64
	CreatorAccountIndex int64
	OwnerAccountIndex   int64
	NftContentHash      string
	NftL1Address        string
	NftL1TokenId        string
	CreatorTreasuryRate int64
	CollectionId        int64
	Status              int
	L2BlockHeight       int64
}

func (*L2NftHistory) TableName

func (*L2NftHistory) TableName() string

type L2NftHistoryModel

type L2NftHistoryModel interface {
	CreateL2NftHistoryTable() error
	DropL2NftHistoryTable() error
	GetLatestNftsCountByBlockHeight(height int64) (count int64, err error)
	GetLatestNftsByBlockHeight(height int64, limit int, offset int) (
		rowsAffected int64, nftAssets []*L2NftHistory, err error,
	)
	CreateNftHistoriesInTransact(tx *gorm.DB, histories []*L2NftHistory) error
}

func NewL2NftHistoryModel

func NewL2NftHistoryModel(db *gorm.DB) L2NftHistoryModel

type L2NftModel

type L2NftModel interface {
	CreateL2NftTable() error
	DropL2NftTable() error
	GetNft(nftIndex int64) (nftAsset *L2Nft, err error)
	GetLatestNftIndex() (nftIndex int64, err error)
	GetNftsByAccountIndex(accountIndex, limit, offset int64) (nfts []*L2Nft, err error)
	GetNftsCountByAccountIndex(accountIndex int64) (int64, error)
	UpdateNftsInTransact(tx *gorm.DB, nfts []*L2Nft) error
}

func NewL2NftModel

func NewL2NftModel(db *gorm.DB) L2NftModel

Jump to

Keyboard shortcuts

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