types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KNSTL = ChainType("KNSTL")
	BSC   = ChainType("BSC")
	SOL   = ChainType("SOL")
	ETH   = ChainType("ETH")
)
View Source
const (
	StatusCompleted Status = "completed"
	StatusError     Status = "error"

	TxSend                    TransactionType = "send"
	TxDelegate                TransactionType = "delegate"
	TxBeginRedelegate         TransactionType = "begin_redelegate"
	TxUndelegate              TransactionType = "undelegate"
	TxWithdrawDelegatorReward TransactionType = "withdraw_delegator_reward"
	TxVote                    TransactionType = "vote"
	TxCreateValidator         TransactionType = "create_validator"
	TxContractCall            TransactionType = "contract_call"
)

Variables

View Source
var ChainTypes = map[ChainType]bool{
	KNSTL: true,
	BSC:   true,
	SOL:   true,
	ETH:   true,
}
View Source
var ErrChainNotSupported = errors.New("chain is not supported")

Functions

func IsChainSupported

func IsChainSupported(chain ChainType) bool

Types

type Amount

type Amount string

Transaction fields

type Block

type Block struct {
	Number int64 `json:"number"`
	Txs    []Tx  `json:"txs"`
}

type ChainType

type ChainType string

type ContractCallMetadata added in v0.0.10

type ContractCallMetadata struct {
	Asset   string `json:"asset"`
	Value   Amount `json:"value"`
	Address string `json:"address"`
}

type Fee added in v0.0.5

type Fee struct {
	Asset string `json:"asset"`
	Value Amount `json:"value"`
}

type HexNumber

type HexNumber big.Int

func (HexNumber) MarshalJSON

func (i HexNumber) MarshalJSON() ([]byte, error)

func (*HexNumber) UnmarshalJSON

func (i *HexNumber) UnmarshalJSON(data []byte) error

type Status

type Status string

Transaction fields

type TransactionType

type TransactionType string

Transaction fields

type TransferMetadata added in v0.0.9

type TransferMetadata struct {
	Asset string `json:"asset"`
	Value Amount `json:"value"`
}

type Tx

type Tx struct {
	ID             string          `json:"id" bson:"id"`
	From           string          `json:"from" bson:"from"`
	To             string          `json:"to" bson:"to"`
	BlockCreatedAt int64           `json:"block_created_at" bson:"block_created_at"`
	Block          uint64          `json:"block_num" bson:"block_num"`
	Status         Status          `json:"status" bson:"status"`
	Error          string          `json:"error,omitempty" bson:"error"`
	Type           TransactionType `json:"type" bson:"type"`
	Metadata       interface{}     `json:"metadata" bson:"metadata"`
	GasUsed        string          `json:"gas_used" bson:"gas_used"`
	GasWanted      string          `json:"gas_wanted" bson:"gas_wanted"`
	Memo           string          `json:"memo,omitempty"`
	Fee            Fee             `json:"fee"`
}

type Txs

type Txs []Tx

Jump to

Keyboard shortcuts

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