m20210922

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ID = "20210922"

Variables

This section is empty.

Functions

func Migrate

func Migrate(tx *gorm.DB) error

func Rollback

func Rollback(tx *gorm.DB) error

Types

type Account

type Account struct {
	Address   string     `gorm:"primaryKey"`
	Keys      []Storable `gorm:"foreignKey:AccountAddress;references:Address;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
	Type      string     `gorm:"default:custodial"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type AccountToken

type AccountToken struct {
	ID             uint64              `json:"-" gorm:"column:id;primaryKey"`
	AccountAddress string              `json:"-" gorm:"column:account_address;uniqueIndex:addressname;index;not null"`
	Account        Account             `json:"-" gorm:"foreignKey:AccountAddress;references:Address;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	TokenName      string              `json:"name" gorm:"column:token_name;uniqueIndex:addressname;index;not null"`
	TokenAddress   string              `json:"address" gorm:"column:token_address;uniqueIndex:addressname;index;not null"`
	TokenType      templates.TokenType `json:"-" gorm:"column:token_type"`
	CreatedAt      time.Time           `json:"-" gorm:"column:created_at"`
	UpdatedAt      time.Time           `json:"-" gorm:"column:updated_at"`
	DeletedAt      gorm.DeletedAt      `json:"-" gorm:"column:deleted_at;index"`
}

func (AccountToken) TableName

func (AccountToken) TableName() string

type Job

type Job struct {
	ID            uuid.UUID      `gorm:"column:id;primary_key;type:uuid;"`
	Status        int            `gorm:"column:status"`
	Error         string         `gorm:"column:error"`
	Result        string         `gorm:"column:result"`
	TransactionID string         `gorm:"column:transaction_id"`
	CreatedAt     time.Time      `gorm:"column:created_at"`
	UpdatedAt     time.Time      `gorm:"column:updated_at"`
	DeletedAt     gorm.DeletedAt `gorm:"column:deleted_at;index"`
}

type ListenerStatus

type ListenerStatus struct {
	gorm.Model
	LatestHeight uint64
}

func (ListenerStatus) TableName

func (ListenerStatus) TableName() string

type ProposalKey

type ProposalKey struct {
	ID        int `gorm:"primaryKey"`
	KeyIndex  int `gorm:"unique"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

func (ProposalKey) TableName

func (ProposalKey) TableName() string

type Storable

type Storable struct {
	ID             int    `gorm:"primaryKey"`
	AccountAddress string `gorm:"index"`
	Index          int    `gorm:"index"`
	Type           string
	Value          []byte
	SignAlgo       string
	HashAlgo       string
	CreatedAt      time.Time
	UpdatedAt      time.Time
	DeletedAt      gorm.DeletedAt `gorm:"index"`
}

func (Storable) TableName

func (Storable) TableName() string

type Token

type Token struct {
	ID            uint64
	Name          string `gorm:"uniqueIndex;not null"`
	NameLowerCase string
	Address       string `gorm:"not null"`
	Setup         string
	Transfer      string
	Balance       string
	Type          int
}

type TokenTransfer

type TokenTransfer struct {
	ID               uint64         `gorm:"column:id;primaryKey"`
	TransactionId    string         `gorm:"column:transaction_id"`
	Transaction      Transaction    `gorm:"foreignKey:TransactionId;references:TransactionId;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	RecipientAddress string         `gorm:"column:recipient_address;index"`
	SenderAddress    string         `gorm:"column:sender_address;index"`
	FtAmount         string         `gorm:"column:ft_amount"`
	NftID            uint64         `gorm:"column:nft_id"`
	TokenName        string         `gorm:"column:token_name"`
	CreatedAt        time.Time      `gorm:"column:created_at"`
	UpdatedAt        time.Time      `gorm:"column:updated_at"`
	DeletedAt        gorm.DeletedAt `gorm:"column:deleted_at;index"`
}

func (TokenTransfer) TableName

func (TokenTransfer) TableName() string

type Transaction

type Transaction struct {
	TransactionId   string         `gorm:"column:transaction_id;primaryKey"`
	TransactionType int            `gorm:"column:transaction_type;index"`
	ProposerAddress string         `gorm:"column:proposer_address;index"`
	CreatedAt       time.Time      `gorm:"column:created_at"`
	UpdatedAt       time.Time      `gorm:"column:updated_at"`
	DeletedAt       gorm.DeletedAt `gorm:"column:deleted_at;index"`
}

func (Transaction) TableName

func (Transaction) TableName() string

Jump to

Keyboard shortcuts

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