rpc

package
v0.0.0-...-4c8f420 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package rpc provides high level access to the Fantom Opera blockchain node through RPC interface.

Package rpc provides high level access to the Fantom Opera blockchain node through RPC interface.

Index

Constants

View Source
const (
	BlockTypeLatest = "latest"
)

BlockTypeLatest represents the latest available block in blockchain.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rpc

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

Rpc represents the implementation of the Blockchain interface for Fantom Opera node.

func New

func New(rpcCfg *config.Rpc, gmCfg *config.GasMonetization, log *logger.AppLogger) *Rpc

New creates a new instance of the RPC client.

func (*Rpc) Block

func (rpc *Rpc) Block(numTag *string) (*types.Block, error)

Block returns information about a blockchain block by encoded hex number, or by a type tag. For tag based loading use predefined BlockType contacts.

func (*Rpc) BlockByHash

func (rpc *Rpc) BlockByHash(hash *string) (*types.Block, error)

BlockByHash returns information about a blockchain block by hash.

func (*Rpc) BlockHeight

func (rpc *Rpc) BlockHeight() (*hexutil.Big, error)

BlockHeight returns the current block height of the Opera blockchain.

func (*Rpc) CompleteWithdrawal

func (rpc *Rpc) CompleteWithdrawal(projectId uint64, epoch uint64, amount *big.Int) error

CompleteWithdrawal completes withdrawal of the given amount from the given project.

func (*Rpc) GasMonetizationAbi

func (rpc *Rpc) GasMonetizationAbi() *abi.ABI

GasMonetizationAbi provides access to decoded ABI of Fantom Gas Monetization contract.

func (*Rpc) GasMonetizationAddress

func (rpc *Rpc) GasMonetizationAddress() common.Address

GasMonetizationAddress returns the address of the gas monetization contract.

func (*Rpc) HasPendingWithdrawal

func (rpc *Rpc) HasPendingWithdrawal(projectId uint64, epoch uint64) (bool, error)

HasPendingWithdrawal returns true if there is a pending withdrawal for the given project.

func (*Rpc) SetDataProviderSession

func (rpc *Rpc) SetDataProviderSession(session *contracts.GasMonetizationSession)

SetDataProviderSession sets the data provider session. This is intended to be used only for testing purposes.

func (*Rpc) SetGasMonetizationAddress

func (rpc *Rpc) SetGasMonetizationAddress(addr common.Address)

SetGasMonetizationAddress sets the address of the gas monetization contract. This is used for testing purposes only.

func (*Rpc) StartFromBlock

func (rpc *Rpc) StartFromBlock() uint64

StartFromBlock returns the block number from which the processing should start.

func (*Rpc) Transaction

func (rpc *Rpc) Transaction(hash *common.Hash) (*types.Transaction, error)

Transaction returns information about a blockchain transaction by hash.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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