Documentation ¶
Index ¶
- type AggregatedCallables
- func (a *AggregatedCallables) Address() types.Address
- func (a *AggregatedCallables) AllowFail() *AggregatedCallables
- func (a *AggregatedCallables) Call(ctx context.Context, number types.BlockNumber, res any) error
- func (a *AggregatedCallables) CallData() ([]byte, error)
- func (a *AggregatedCallables) Client() rpc.RPC
- func (a *AggregatedCallables) DecodeTo(data []byte, res any) error
- func (a *AggregatedCallables) Gas(ctx context.Context, number types.BlockNumber) (uint64, error)
- func (a *AggregatedCallables) SendTransaction(ctx context.Context) (*types.Hash, *types.Transaction, error)
- type Call
- type Multicall
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedCallables ¶
type AggregatedCallables struct {
// contains filtered or unexported fields
}
AggregatedCallables is a Callable that aggregates multiple Callables into a single call.
The AggregatedCallables will call the multicall contract to aggregate the calls. If only a single call is aggregated, the call will be called directly.
The AggregatedCallables will decode the result of the multicall contract and decode the result of the individual calls if they implement the Decoder interface.
There is a special case for Callables that returns a zero address as their address. In this case, the Callable will not be included in the aggregated call, but the AggregatedCallables will try to decode the result of the Callable providing nil as the call result. This is useful mostly for testing purposes.
func AggregateCallables ¶
func AggregateCallables(client rpc.RPC, calls ...contract.Callable) *AggregatedCallables
AggregateCallables creates a new AggregatedCallables instance.
func (*AggregatedCallables) Address ¶
func (a *AggregatedCallables) Address() types.Address
Address implements the contract.Callable interface.
func (*AggregatedCallables) AllowFail ¶
func (a *AggregatedCallables) AllowFail() *AggregatedCallables
AllowFail allows the aggregated call to partially fail. If a call fails, the rest of the calls will still be executed.
func (*AggregatedCallables) Call ¶
func (a *AggregatedCallables) Call(ctx context.Context, number types.BlockNumber, res any) error
Call implements the contract.Caller interface.
func (*AggregatedCallables) CallData ¶
func (a *AggregatedCallables) CallData() ([]byte, error)
CallData implements the contract.Callable interface.
func (*AggregatedCallables) Client ¶
func (a *AggregatedCallables) Client() rpc.RPC
Client implements the contract.Caller interface.
func (*AggregatedCallables) DecodeTo ¶
func (a *AggregatedCallables) DecodeTo(data []byte, res any) error
DecodeTo implements the contract.Decoder interface.
func (*AggregatedCallables) Gas ¶
func (a *AggregatedCallables) Gas(ctx context.Context, number types.BlockNumber) (uint64, error)
Gas implements the contract.Caller interface.
func (*AggregatedCallables) SendTransaction ¶
func (a *AggregatedCallables) SendTransaction(ctx context.Context) (*types.Hash, *types.Transaction, error)
SendTransaction implements the contract.Transactor interface.
type Multicall ¶
type Multicall struct {
// contains filtered or unexported fields
}
func NewMulticall ¶
func (*Multicall) Aggregate3 ¶
func (m *Multicall) Aggregate3(calls []Call) contract.TypedSelfTransactableCaller[[]Result]