provider

package
v0.0.0-...-62a8130 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT_NETWORK = "mainnet"
View Source
var Log = utils.Log

Functions

This section is empty.

Types

type BlockDaemonBlock

type BlockDaemonBlock struct {
	Number           int                           `json:"number"`
	ID               string                        `json:"id"`
	ParentID         string                        `json:"parent_id"`
	Date             int                           `json:"date"`
	Num_Transactions int                           `json:"num_txs"`
	Transactions     []BlockDaemonBlockTransaction `json:"txs"`
}

type BlockDaemonBlockEvent

type BlockDaemonBlockEvent struct {
	ID            string                    `json:"id"`
	TransactionID string                    `json:"transaction_id"`
	Type          string                    `json:"type"`
	Denomination  string                    `json:"denomination"`
	Source        string                    `json:"source"`
	Meta          BlockDaemonBlockEventMeta `json:"meta"`
	Date          int                       `json:"date"`
	Amount        float64                   `json:"amount"`
	Decimals      int                       `json:"decimals"`
}

type BlockDaemonBlockEventMeta

type BlockDaemonBlockEventMeta struct {
	BaseFee   int `json:"base_fee"`
	FeeBurned int `json:"fee_burned"`
	GasLimit  int `json:"gas_limit"`
	GasPrice  int `json:"gas_price"`
	GasUsed   int `json:"gas_used"`
}

type BlockDaemonBlockMeta

type BlockDaemonBlockMeta struct {
	Index int    `json:"index"`
	To    string `json:"to"`
}

type BlockDaemonBlockTransaction

type BlockDaemonBlockTransaction struct {
	ID          string                  `json:"id"`
	BlockID     string                  `json:"block_id"`
	Date        int                     `json:"date"`
	Status      string                  `json:"status"`
	NumEvents   int                     `json:"num_events"`
	Meta        BlockDaemonBlockMeta    `json:"meta"`
	BlockNumber int                     `json:"block_number"`
	Events      []BlockDaemonBlockEvent `json:"events"`
}

type BlockDaemonCallResponse

type BlockDaemonCallResponse[T any] struct {
	JSONRPC string                        `json:"jsonrpc"`
	ID      int                           `json:"id"`
	Result  T                             `json:"result"`
	Error   *BlockDaemonCallResponseError `json:"error"`
}

type BlockDaemonCallResponseError

type BlockDaemonCallResponseError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type BlockDaemonGetBlockNumberBody

type BlockDaemonGetBlockNumberBody struct {
	JSONRPC string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	ID      int           `json:"id"`
	Params  []interface{} `json:"params"`
}

type BlockDaemonProvider

type BlockDaemonProvider struct {
}

func (*BlockDaemonProvider) GetByBlockNumber

func (x *BlockDaemonProvider) GetByBlockNumber(chainType string, blockNumber string) (ChainBlock, error)

get chain type's block by block number

func (*BlockDaemonProvider) GetLatestBlockNumber

func (x *BlockDaemonProvider) GetLatestBlockNumber(chainType string) (string, error)

get chain type's latest block number

func (*BlockDaemonProvider) Ping

func (x *BlockDaemonProvider) Ping() error

health check ping method. Returns error if ping doesn't pass

func (*BlockDaemonProvider) SupportedChains

func (x *BlockDaemonProvider) SupportedChains() []string

type ChainBlock

type ChainBlock = provider.ChainBlock

Jump to

Keyboard shortcuts

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