Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AggregatedCallables ¶
type AggregatedCallables struct {
// contains filtered or unexported fields
}
AggregatedCallables aggregates multiple Callables into a single call or transaction.
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.
To decode a result, a slice or a pointer to a slice must be provided. If the slice is empty, a new slice will be created with the same length as the number of calls. If the slice is not empty, the result will be decoded into the existing slice elements.
If the slice contains nil interfaces (e.g. nil values in []any), the corresponding slice elements will be skipped.
To avoid decoding a result, provide nil as the result argument.
func AggregateCallables ¶
func AggregateCallables(calls ...contract.Callable) *AggregatedCallables
AggregateCallables creates a new AggregatedCallables instance.
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) NewCall ¶
func (a *AggregatedCallables) NewCall(client rpc.RPC, chainID uint64) contract.SelfCaller
NewCall creates a new SelfCaller instance.
func (*AggregatedCallables) NewTransaction ¶
func (a *AggregatedCallables) NewTransaction(client rpc.RPC, chainID uint64) contract.SelfTransactableCaller
NewTransaction creates a new SelfTransactableCaller instance.
type Multicall ¶
type Multicall struct {
// contains filtered or unexported fields
}