network

package
v0.86.7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainClient

type ChainClient struct {
	ChainID uint64
	// contains filtered or unexported fields
}

func (*ChainClient) BalanceAt

func (cc *ChainClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)

func (*ChainClient) BlockByHash

func (cc *ChainClient) BlockByHash(ctx context.Context, hash common.Hash) (*types.Block, error)

func (*ChainClient) BlockByNumber

func (cc *ChainClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)

func (*ChainClient) CallContract

func (cc *ChainClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*ChainClient) CodeAt

func (cc *ChainClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

func (*ChainClient) FilterLogs

func (cc *ChainClient) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]types.Log, error)

func (*ChainClient) HeaderByHash

func (cc *ChainClient) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)

func (*ChainClient) HeaderByNumber

func (cc *ChainClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

func (*ChainClient) NonceAt

func (cc *ChainClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)

func (*ChainClient) ToBigInt

func (cc *ChainClient) ToBigInt() *big.Int

func (*ChainClient) TransactionByHash

func (cc *ChainClient) TransactionByHash(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)

func (*ChainClient) TransactionReceipt

func (cc *ChainClient) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(db *sql.DB, legacyChainID uint64, legacyClient *ethclient.Client) *Manager

func (*Manager) Delete

func (nm *Manager) Delete(chainID uint64) error

func (*Manager) Find

func (nm *Manager) Find(chainID uint64) *Network

func (*Manager) Get

func (nm *Manager) Get(onlyEnabled bool) ([]*Network, error)

func (*Manager) GetChainClient

func (nm *Manager) GetChainClient(chainID uint64) (*ChainClient, error)

func (*Manager) GetChainClients

func (nm *Manager) GetChainClients(chainIDs []uint64) (res []*ChainClient, err error)

func (*Manager) Init

func (nm *Manager) Init(networks []Network) error

func (*Manager) Upsert

func (nm *Manager) Upsert(network *Network) error

type Network

type Network struct {
	ChainID                uint64 `json:"chainId"`
	ChainName              string `json:"chainName"`
	RPCURL                 string `json:"rpcUrl"`
	BlockExplorerURL       string `json:"blockExplorerUrl,omitempty"`
	IconURL                string `json:"iconUrl,omitempty"`
	NativeCurrencyName     string `json:"nativeCurrencyName,omitempty"`
	NativeCurrencySymbol   string `json:"nativeCurrencySymbol,omitempty"`
	NativeCurrencyDecimals uint64 `json:"nativeCurrencyDecimals"`
	IsTest                 bool   `json:"isTest"`
	Layer                  uint64 `json:"layer"`
	Enabled                bool   `json:"enabled"`
}

Jump to

Keyboard shortcuts

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