models

package
v1.1.16-0...-5f6d184 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetIDs

func AssetIDs(assets []Asset) []string

Types

type Asset

type Asset struct {
	CreatedAt time.Time `gorm:"index:,"`
	ID        uint      `gorm:"primary_key; uniqueIndex"`
	Asset     string    `gorm:"type:varchar(128); uniqueIndex"`

	Decimals uint   `gorm:"int(4)"`
	Name     string `gorm:"type:varchar(128)"`
	Symbol   string `gorm:"type:varchar(128)"`
	Type     string `gorm:"type:varchar(12)"`
	Coin     uint
}

func AssetFromNativeTokenTransfer

func AssetFromNativeTokenTransfer(t *types.Tx, transfer *types.NativeTokenTransfer) (a Asset, ok bool)

func AssetFromTokenTransfer

func AssetFromTokenTransfer(t *types.Tx, transfer types.TokenTransfer) (a Asset, ok bool)

func AssetsFrom

func AssetsFrom(t types.Tx) (assets []Asset)

func (*Asset) IsValid

func (asset *Asset) IsValid() error

type Subscription

type Subscription struct {
	ID      uint   `gorm:"primaryKey;"`
	Address string `gorm:"uniqueIndex; type:varchar(256); not null;"`
}

type SubscriptionsAssetAssociation

type SubscriptionsAssetAssociation struct {
	CreatedAt      time.Time    `gorm:"index;"`
	Subscription   Subscription `gorm:"ForeignKey:SubscriptionId; not null"`
	SubscriptionId uint         `gorm:"primary_key; autoIncrement:false; index"`

	Asset   Asset `gorm:"ForeignKey:AssetId; not null"`
	AssetId uint  `gorm:"primary_key; autoIncrement:false; index"`
}

type Tracker

type Tracker struct {
	UpdatedAt time.Time
	Coin      string `gorm:"primary_key:true; type:varchar(64)"`
	Priority  string `gorm:"default:normal"`
	Height    int64
	Enabled   bool `gorm:"default:true" sql:"index"`
}

Jump to

Keyboard shortcuts

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