Documentation ¶
Index ¶
- func Unpack(s reflect.Value, unpackProfile reflect.Type) (out []interface{})
- type AgentOperator
- type BlockchainContext
- type BoundContract
- func CreateContract(opts *bind.TransactOpts, abi abi.ABI, bytecode []byte, ...) (common.Address, *types.Transaction, *BoundContract, error)
- func CreateContractHelper(client bind.ContractBackend, hexKey, rawABI, contractBin string, ...) (common.Address, *types.Transaction, *BoundContract, error)
- func DeployContract(opts *bind.TransactOpts, abi abi.ABI, bytecode []byte, ...) (common.Address, *types.Transaction, *BoundContract, error)
- func NewBoundContract(address common.Address, abi abi.ABI, caller bind.ContractCaller, ...) *BoundContract
- func (c *BoundContract) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error
- func (c *BoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
- func (c *BoundContract) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)
- type ChanMsg
- type ClientConnector
- func (ec *ClientConnector) Close()
- func (ec *ClientConnector) Dial() error
- func (ec *ClientConnector) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
- func (ec *ClientConnector) TransactionByHashFull(ctx context.Context, hash common.Hash) (tx *types.Transaction, blockhash *common.Hash, err error)
- type EventManager
- type NodeConnector
- func (nc *NodeConnector) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (ec *NodeConnector) Close()
- func (nc *NodeConnector) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (nc *NodeConnector) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
- func (nc *NodeConnector) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)
- func (nc *NodeConnector) GetBalanceAt(ctx context.Context, account common.Address, blockNumber *big.Int) (*big.Int, error)
- func (nc *NodeConnector) GetClient(ctx context.Context) (*ethclient.Client, error)
- func (nc *NodeConnector) GetTransaction(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
- func (nc *NodeConnector) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (nc *NodeConnector) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
- func (nc *NodeConnector) SendTransaction(ctx context.Context, tx *types.Transaction) error
- func (nc *NodeConnector) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
- func (nc *NodeConnector) SubscribeToEvents(ctx context.Context, addr common.Address, evt_mgr EventManager) chan ChanMsg
- func (nc *NodeConnector) SuggestGasPrice(ctx context.Context) (*big.Int, error)
- func (nc *NodeConnector) WaitForFundOrCodeAt(account common.Address, blockNumber *big.Int, duration time.Duration) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AgentOperator ¶
type AgentOperator struct { Address common.Address Transactor *bind.TransactOpts // contains filtered or unexported fields }
func NewAgentOperator ¶
func NewAgentOperator(privateKey *ecdsa.PrivateKey) (*AgentOperator, error)
func (*AgentOperator) Sign ¶
func (ao *AgentOperator) Sign(rawTx *types.Transaction) (*types.Transaction, error)
type BlockchainContext ¶
type BlockchainContext struct { NC *NodeConnector AO *AgentOperator }
func NewBlockchainContext ¶
func NewBlockchainContext(raw_url, pkey_hex string, retry int) (*BlockchainContext, error)
type BoundContract ¶
type BoundContract struct {
// contains filtered or unexported fields
}
BoundContract is the base wrapper object that reflects a contract on the Ethereum network. It contains a collection of methods that are used by the higher level contract bindings to operate.
func CreateContract ¶
func CreateContract(opts *bind.TransactOpts, abi abi.ABI, bytecode []byte, backend bind.ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error)
CreateContract deploys a contract onto the Ethereum blockchain and binds the deployment address with a Go wrapper.
func CreateContractHelper ¶
func CreateContractHelper(client bind.ContractBackend, hexKey, rawABI, contractBin string, cacheNonce *big.Int, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error)
func DeployContract ¶
func DeployContract(opts *bind.TransactOpts, abi abi.ABI, bytecode []byte, backend bind.ContractBackend, params ...interface{}) (common.Address, *types.Transaction, *BoundContract, error)
DeployContract deploys a contract onto the Ethereum blockchain and binds the deployment address with a Go wrapper.
func NewBoundContract ¶
func NewBoundContract(address common.Address, abi abi.ABI, caller bind.ContractCaller, transactor bind.ContractTransactor) *BoundContract
NewBoundContract creates a low level contract interface through which calls and transactions may be made through.
func (*BoundContract) Call ¶
func (c *BoundContract) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error
Call invokes the (constant) contract method with params as input values and sets the output to result. The result type might be a single field for simple returns, a slice of interfaces for anonymous returns and a struct for named returns.
func (*BoundContract) Transact ¶
func (c *BoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
Transact invokes the (paid) contract method with params as input values.
func (*BoundContract) Transfer ¶
func (c *BoundContract) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)
Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.
type ClientConnector ¶
type ClientConnector struct {
// contains filtered or unexported fields
}
ClientConnector defines typed wrappers for the Ethereum RPC API.
func NewClientConnector ¶
func NewClientConnector(rawurl string, try_max int) (*ClientConnector, error)
NewClientConnector creates a client that uses the given RPC client.
func (*ClientConnector) Dial ¶
func (ec *ClientConnector) Dial() error
Dial connects a client to the given URL.
func (*ClientConnector) HeaderByHash ¶
func (ec *ClientConnector) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error)
HeaderByHash returns the block header with the given hash.
func (*ClientConnector) TransactionByHashFull ¶
func (ec *ClientConnector) TransactionByHashFull(ctx context.Context, hash common.Hash) (tx *types.Transaction, blockhash *common.Hash, err error)
TransactionByHash returns the transaction with the given hash.
type NodeConnector ¶
type NodeConnector struct {
// contains filtered or unexported fields
}
func NewNodeConnector ¶
func NewNodeConnector(rawurl string, try_max int) (*NodeConnector, error)
func (*NodeConnector) CallContract ¶
func (*NodeConnector) EstimateGas ¶
func (nc *NodeConnector) EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
func (*NodeConnector) FilterLogs ¶
func (*NodeConnector) GetBalanceAt ¶
func (*NodeConnector) GetTransaction ¶
func (nc *NodeConnector) GetTransaction(ctx context.Context, hash common.Hash) (tx *types.Transaction, isPending bool, err error)
TransactionByHash returns the transaction with the given hash.
func (*NodeConnector) PendingCodeAt ¶
func (*NodeConnector) PendingNonceAt ¶
func (*NodeConnector) SendTransaction ¶
func (nc *NodeConnector) SendTransaction(ctx context.Context, tx *types.Transaction) error
func (*NodeConnector) SubscribeFilterLogs ¶
func (*NodeConnector) SubscribeToEvents ¶
func (nc *NodeConnector) SubscribeToEvents(ctx context.Context, addr common.Address, evt_mgr EventManager) chan ChanMsg