types

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockMeta

type BlockMeta struct {
	PreviousHash string            `json:"previous_hash"`
	Height       int64             `json:"height"`
	BlockHash    string            `json:"block_hash"`
	Transactions []TransactionMeta `json:"transactions"`
}

BlockMeta is a structure to store the blocks bifrost scanned

func NewBlockMeta

func NewBlockMeta(block *types.Header, txIn stypes.TxIn) *BlockMeta

NewBlockMeta create a new instance of BlockMeta

type ChainID

type ChainID int

ChainID represent Ethereum chain id type

const (
	// Mainnet - mainnet
	Mainnet ChainID = iota + 1

	Ropsten
	Rinkeby
	Localnet = iota + 11
)

type TokenMeta

type TokenMeta struct {
	Symbol  string `json:"symbol"`
	Address string `json:"address"`
	Decimal uint64 `json:"decimal"` // Decimal means the number of decimals https://docs.openzeppelin.com/contracts/3.x/api/token/erc20#ERC20-decimals--
}

TokenMeta is a struct to store token meta data

func NewTokenMeta

func NewTokenMeta(symbol, address string, decimal uint64) TokenMeta

NewTokenMeta create a new instance of TokenMeta

func (TokenMeta) IsEmpty

func (tm TokenMeta) IsEmpty() bool

IsEmpty return true when both symbol and address are empty

type TransactionMeta

type TransactionMeta struct {
	Hash        string `json:"hash"`
	BlockHeight int64  `json:"block_height"`
}

TransactionMeta transaction meta data

Jump to

Keyboard shortcuts

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