Documentation
¶
Index ¶
- Constants
- type Account
- type BlockNumber
- type Eth
- func (e *Eth) BlockNumber() (argUint64, error)
- func (e *Eth) Call(arg *txnArgs, number BlockNumber) (interface{}, error)
- func (e *Eth) ChainId() (interface{}, error)
- func (e *Eth) EstimateGas(arg *txnArgs, rawNum *BlockNumber) (interface{}, error)
- func (e *Eth) GasPrice() (interface{}, error)
- func (e *Eth) GetBalance(address ethgo.Address, number BlockNumber) (*argBig, error)
- func (e *Eth) GetBlockByHash(hash ethgo.Hash, full bool) (*ethgo.Block, error)
- func (e *Eth) GetBlockByNumber(number BlockNumber, full bool) (*ethgo.Block, error)
- func (e *Eth) GetCode(address ethgo.Address, number BlockNumber) (argBytes, error)
- func (e *Eth) GetFilterChanges(id string) (interface{}, error)
- func (e *Eth) GetLogs(filterOptions *LogFilter) ([]*ethgo.Log, error)
- func (e *Eth) GetStorageAt(address ethgo.Address, index ethgo.Hash, number BlockNumber) (interface{}, error)
- func (e *Eth) GetTransactionByHash(hash ethgo.Hash) (interface{}, error)
- func (e *Eth) GetTransactionCount(address ethgo.Address, number BlockNumber) (interface{}, error)
- func (e *Eth) GetTransactionReceipt(hash ethgo.Hash) (interface{}, error)
- func (e *Eth) NewBlockFilter() (interface{}, error)
- func (e *Eth) NewFilter(filter *LogFilter) (interface{}, error)
- func (e *Eth) SendRawTransaction(input argBytes) (argBytes, error)
- func (e *Eth) UninstallFilter(id string) (bool, error)
- func (e *Eth) Unsubscribe(id string) (bool, error)
- type EthBackend
- type Event
- type EventType
- type Filter
- type FilterManager
- func (f *FilterManager) Close()
- func (f *FilterManager) Exists(id string) bool
- func (f *FilterManager) GetFilterChanges(id string) (string, error)
- func (f *FilterManager) NewBlockFilter(stream jsonrpc.Stream) string
- func (f *FilterManager) NewLogFilter(logFilter *LogFilter, stream jsonrpc.Stream) string
- func (f *FilterManager) Run()
- func (f *FilterManager) Uninstall(id string) bool
- type GetLogsInput
- type LogFilter
- type MockSubscription
- type Subscription
- type TransactionResult
Constants ¶
const ( PendingBlockNumber = BlockNumber(-3) LatestBlockNumber = BlockNumber(-2) EarliestBlockNumber = BlockNumber(-1) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockNumber ¶
type BlockNumber int64
func (*BlockNumber) UnmarshalJSON ¶
func (b *BlockNumber) UnmarshalJSON(buffer []byte) error
UnmarshalJSON automatically decodes the user input for the block number, when a JSON RPC method is called
type Eth ¶
type Eth struct {
// contains filtered or unexported fields
}
Eth is the eth jsonrpc endpoint
func NewEth ¶
func NewEth(b EthBackend) *Eth
func (*Eth) BlockNumber ¶
BlockNumber returns current block number
func (*Eth) Call ¶
func (e *Eth) Call(arg *txnArgs, number BlockNumber) (interface{}, error)
Call executes a smart contract call using the transaction object data
func (*Eth) EstimateGas ¶
func (e *Eth) EstimateGas(arg *txnArgs, rawNum *BlockNumber) (interface{}, error)
EstimateGas estimates the gas needed to execute a transaction
func (*Eth) GetBalance ¶
func (e *Eth) GetBalance(address ethgo.Address, number BlockNumber) (*argBig, error)
GetBalance returns the account's balance at the referenced block
func (*Eth) GetBlockByHash ¶
GetBlockByHash returns information about a block by hash
func (*Eth) GetBlockByNumber ¶
GetBlockByNumber returns information about a block by block number
func (*Eth) GetCode ¶
func (e *Eth) GetCode(address ethgo.Address, number BlockNumber) (argBytes, error)
GetCode returns account code at given block number
func (*Eth) GetFilterChanges ¶
GetFilterChanges is a polling method for a filter, which returns an array of logs which occurred since last poll.
func (*Eth) GetStorageAt ¶
func (e *Eth) GetStorageAt(address ethgo.Address, index ethgo.Hash, number BlockNumber) (interface{}, error)
GetStorageAt returns the contract storage at the index position
func (*Eth) GetTransactionByHash ¶
GetTransactionByHash returns a transaction by his hash
func (*Eth) GetTransactionCount ¶
func (e *Eth) GetTransactionCount(address ethgo.Address, number BlockNumber) (interface{}, error)
GetTransactionCount returns account nonce
func (*Eth) GetTransactionReceipt ¶
GetTransactionReceipt returns a transaction receipt by his hash
func (*Eth) NewBlockFilter ¶
NewBlockFilter creates a filter in the node, to notify when a new block arrives
func (*Eth) NewFilter ¶
NewFilter creates a filter object, based on filter options, to notify when the state changes (logs).
func (*Eth) SendRawTransaction ¶
SendRawTransaction sends a raw transaction
func (*Eth) UninstallFilter ¶
UninstallFilter uninstalls a filter with given ID
type EthBackend ¶
type EthBackend interface {
// contains filtered or unexported methods
}
type Event ¶
type Event struct {
// Old chain (removed headers) if there was a reorg
OldChain []*ethgo.Block
// New part of the chain (or a fork)
NewChain []*ethgo.Block
// Type is the type of event
Type EventType
}
Event is the blockchain event that gets passed to the listeners
type FilterManager ¶
type FilterManager struct {
// contains filtered or unexported fields
}
func NewFilterManager ¶
func NewFilterManager(logger *log.Logger, store blockchainInterface) *FilterManager
func (*FilterManager) Close ¶
func (f *FilterManager) Close()
func (*FilterManager) Exists ¶
func (f *FilterManager) Exists(id string) bool
func (*FilterManager) GetFilterChanges ¶
func (f *FilterManager) GetFilterChanges(id string) (string, error)
func (*FilterManager) NewBlockFilter ¶
func (f *FilterManager) NewBlockFilter(stream jsonrpc.Stream) string
func (*FilterManager) NewLogFilter ¶
func (f *FilterManager) NewLogFilter(logFilter *LogFilter, stream jsonrpc.Stream) string
func (*FilterManager) Run ¶
func (f *FilterManager) Run()
func (*FilterManager) Uninstall ¶
func (f *FilterManager) Uninstall(id string) bool
type GetLogsInput ¶
type LogFilter ¶
type LogFilter struct {
BlockHash *ethgo.Hash
Addresses []ethgo.Address
Topics [][]ethgo.Hash
// contains filtered or unexported fields
}
LogFilter is a filter for logs
func (*LogFilter) UnmarshalJSON ¶
UnmarshalJSON decodes a json object
type MockSubscription ¶
type MockSubscription struct {
// contains filtered or unexported fields
}
func NewMockSubscription ¶
func NewMockSubscription() *MockSubscription
func (*MockSubscription) Close ¶
func (m *MockSubscription) Close()
func (*MockSubscription) GetEvent ¶
func (m *MockSubscription) GetEvent() *Event
func (*MockSubscription) GetEventCh ¶
func (m *MockSubscription) GetEventCh() chan *Event
func (*MockSubscription) Push ¶
func (m *MockSubscription) Push(e *Event)
type Subscription ¶
type Subscription interface {
GetEvent() *Event
Close()
}
Subscription is the blockchain subscription interface
type TransactionResult ¶
type TransactionResult struct {
Transaction *ethgo.Transaction
Receipt *ethgo.Receipt
}