Documentation
¶
Index ¶
- type ChainAPIBackend
- type ChainClient
- type ContractAPIbcakend
- type RptApiClient
- func (cc *RptApiClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (cc *RptApiClient) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error)
- func (cc *RptApiClient) CallContract(ctx context.Context, call cpchain.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (cc *RptApiClient) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (cc *RptApiClient) EstimateGas(ctx context.Context, call cpchain.CallMsg) (gas uint64, err error)
- func (cc *RptApiClient) FilterLogs(ctx context.Context, query cpchain.FilterQuery) ([]types.Log, error)
- func (cc *RptApiClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
- func (cc *RptApiClient) NonceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (uint64, error)
- func (cc *RptApiClient) PendingCallContract(ctx context.Context, call cpchain.CallMsg) ([]byte, error)
- func (cc *RptApiClient) PendingCodeAt(ctx context.Context, contract common.Address) ([]byte, error)
- func (cc *RptApiClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (cc *RptApiClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (cc *RptApiClient) SubscribeFilterLogs(ctx context.Context, q cpchain.FilterQuery, ch chan<- types.Log) (cpchain.Subscription, error)
- func (cc *RptApiClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- type RptBackendHolder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainAPIBackend ¶
type ChainAPIBackend interface {
StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber, isPrivate bool) (*state.StateDB, *types.Header, error)
BlockByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Block, error)
HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error)
}
type ChainClient ¶
type ChainClient struct {
ChainAPIBackend
}
type ContractAPIbcakend ¶
type RptApiClient ¶
type RptApiClient struct {
ChainBackend ChainAPIBackend
ContractBackend ContractAPIbcakend
}
func (*RptApiClient) BalanceAt ¶
func (cc *RptApiClient) BalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
BalanceAt returns the wei balance of the given account. The block number can be nil, in which case the balance is taken from the latest known block.
func (*RptApiClient) BlockByNumber ¶
BlockByNumber returns a block from the current canonical chain. If number is nil, the latest known block is returned.
func (*RptApiClient) CallContract ¶
func (*RptApiClient) EstimateGas ¶
func (*RptApiClient) FilterLogs ¶
func (cc *RptApiClient) FilterLogs(ctx context.Context, query cpchain.FilterQuery) ([]types.Log, error)
func (*RptApiClient) HeaderByNumber ¶
HeaderByNumber returns a block header from the current canonical chain. If number is nil, the latest known header is returned.
func (*RptApiClient) PendingCallContract ¶
func (*RptApiClient) PendingCodeAt ¶
func (*RptApiClient) PendingNonceAt ¶
func (*RptApiClient) SendTransaction ¶
func (cc *RptApiClient) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*RptApiClient) SubscribeFilterLogs ¶
func (cc *RptApiClient) SubscribeFilterLogs(ctx context.Context, q cpchain.FilterQuery, ch chan<- types.Log) (cpchain.Subscription, error)
func (*RptApiClient) SuggestGasPrice ¶
type RptBackendHolder ¶
type RptBackendHolder struct {
ChainBackend ChainAPIBackend
ContractBackend ContractAPIbcakend
}
used to hold *APIBackend
func GetApiBackendHolderInstance ¶
func GetApiBackendHolderInstance() *RptBackendHolder
func (*RptBackendHolder) Init ¶
func (rb *RptBackendHolder) Init(chainBackend ChainAPIBackend, contractBackend ContractAPIbcakend)
Click to show internal directories.
Click to hide internal directories.