types

package
v0.0.0-...-5fc2af4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Number            int64
	BlockHash         string
	ParentBlockHash   string
	BlockCreationTime int64

	Txs Txs
}

type ByteArray

type ByteArray string

ByteArray is a custom type that maps to a the database `bytea` fields

func (*ByteArray) Scan

func (val *ByteArray) Scan(value interface{}) error

func (ByteArray) String

func (val ByteArray) String() string

func (ByteArray) Value

func (val ByteArray) Value() (driver.Value, error)

type DatetimeToJSONUnix

type DatetimeToJSONUnix time.Time

DatetimeToJSONUnix binds a time.Time to a `timestamp` database field when marshaled to JSON, outputs a unix timestamp

func (DatetimeToJSONUnix) MarshalJSON

func (t DatetimeToJSONUnix) MarshalJSON() ([]byte, error)

func (*DatetimeToJSONUnix) Scan

func (t *DatetimeToJSONUnix) Scan(value interface{}) error

func (DatetimeToJSONUnix) String

func (t DatetimeToJSONUnix) String() string

func (*DatetimeToJSONUnix) UnmarshalJSON

func (t *DatetimeToJSONUnix) UnmarshalJSON(data []byte) error

func (DatetimeToJSONUnix) Value

func (t DatetimeToJSONUnix) Value() (driver.Value, error)

type ERC20Transfer

type ERC20Transfer struct {
	TokenAddress     string
	From             string
	To               string
	Value            *big.Int
	TransactionHash  string
	TransactionIndex int64
	LogIndex         int64
}

type JSONObject

type JSONObject map[string]interface{}

JSONObject binds a map[string]interface{} to a `jsonb` database field

func (*JSONObject) Scan

func (obj *JSONObject) Scan(value interface{}) error

func (JSONObject) Value

func (obj JSONObject) Value() (driver.Value, error)

type JSONStringArray

type JSONStringArray []string

JSONStringArray binds a slice of strings to a `jsonb` database field

func (*JSONStringArray) Scan

func (j *JSONStringArray) Scan(value interface{}) error

func (JSONStringArray) Value

func (j JSONStringArray) Value() (driver.Value, error)

type LogEntries

type LogEntries []gethtypes.Log

func (LogEntries) Len

func (l LogEntries) Len() int

func (LogEntries) Less

func (l LogEntries) Less(i, j int) bool

func (LogEntries) Swap

func (l LogEntries) Swap(i, j int)

type LogEntry

type LogEntry struct {
	TxHash          string
	LogIndex        int32
	LogData         ByteArray
	LoggedBy        string
	Topic0          string
	Topic1          string
	Topic2          string
	Topic3          string
	IncludedInBlock int64
}

type Price

type Price struct {
	StartAtBlock int64           `json:"startAtBlock"`
	Quote        string          `json:"quote"`
	Provider     string          `json:"provider"`
	Path         []PriceProvider `json:"path"`
}

type PriceProvider

type PriceProvider struct {
	Address  string `json:"address"`
	Reverse  bool   `json:"reverse"`
	Decimals int64  `json:"decimals"`
}

type RawData

type RawData struct {
	Block    web3types.Block
	Receipts RawReceipts
}

type RawReceipts

type RawReceipts []web3types.Receipt

func (RawReceipts) Len

func (a RawReceipts) Len() int

func (RawReceipts) Less

func (a RawReceipts) Less(i, j int) bool

func (RawReceipts) Swap

func (a RawReceipts) Swap(i, j int)

type RewardPool

type RewardPool struct {
	PoolType             RewardPoolType
	PoolAddress          string
	PoolTokenAddress     string
	RewardTokenAddresses []string
	StartAtBlock         int64
}

type RewardPoolType

type RewardPoolType string
const (
	PoolTypeSingle RewardPoolType = "SINGLE"
	PoolTypeMulti  RewardPoolType = "MULTI"
)

type Storable

type Storable interface {
	Execute(ctx context.Context) error
	Rollback(ctx context.Context, pgx pgx.Tx) error
	SaveToDatabase(ctx context.Context, tx pgx.Tx) error
	Result() interface{}
	ID() string
}

Storable role: a Storable serves as a means of transforming raw data and inserting it into the database input: raw Ethereum data + a database transaction output: processed/derived/enhanced data stored directly to the db

type Token

type Token struct {
	Address  string  `json:"address"`
	Symbol   string  `json:"symbol"`
	Decimals int64   `json:"decimals"`
	Prices   []Price `json:"prices"`
}

type Tx

type Tx struct {
	TxHash            string
	IncludedInBlock   int64
	TxIndex           int64
	From              string
	To                string
	Value             string
	TxNonce           int64
	MsgGasLimit       string
	TxGasUsed         string
	TxGasPrice        string
	CumulativeGasUsed string
	MsgPayload        ByteArray
	MsgStatus         string
	Creates           string
	TxLogsBloom       ByteArray
	BlockCreationTime int64

	LogEntries LogEntries
}

type Txs

type Txs []Tx

func (Txs) Len

func (t Txs) Len() int

func (Txs) Less

func (t Txs) Less(i, j int) bool

func (Txs) Swap

func (t Txs) Swap(i, j int)

Jump to

Keyboard shortcuts

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