Documentation ¶
Overview ¶
Package client provides the mediator for processing incoming UserOperations to the bundler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client controls the end to end process of adding incoming UserOperations to the mempool. It also implements the required RPC methods as specified in EIP-4337.
func New ¶
New initializes a new ERC-4337 client which can be extended with modules for validating UserOperations that are allowed to be added to the mempool.
func (*Client) ChainID ¶
ChainID implements the method call for eth_chainId. It returns the current chainID used by the client. This method is used to validate that the client's chainID is in sync with the caller.
func (*Client) SendUserOperation ¶
SendUserOperation implements the method call for eth_sendUserOperation. It returns true if userOp was accepted otherwise returns an error.
func (*Client) SupportedEntryPoints ¶
SupportedEntryPoints implements the method call for eth_supportedEntryPoints. It returns the array of EntryPoint addresses that is supported by the client. The first address in the array is the preferred EntryPoint.
func (*Client) UseLogger ¶
UseLogger defines the logger object used by the Client instance based on the go-logr/logr interface.
func (*Client) UseModules ¶
func (i *Client) UseModules(handlers ...modules.UserOpHandlerFunc)
UseModules defines the UserOpHandlers to process a userOp after it has gone through the standard checks.
type RpcAdapter ¶
type RpcAdapter struct {
// contains filtered or unexported fields
}
RpcAdapter is an adapter for routing JSON-RPC method calls to the correct client functions.
func NewRpcAdapter ¶
func NewRpcAdapter(client *Client) *RpcAdapter
NewRpcAdapter initializes a new RpcAdapter which can be used with a JSON-RPC server.
func (*RpcAdapter) Eth_chainId ¶
func (r *RpcAdapter) Eth_chainId() (string, error)
Eth_chainId routes eth_chainId method calls to *Client.ChainID.
func (*RpcAdapter) Eth_sendUserOperation ¶
Eth_sendUserOperation routes eth_sendUserOperation method calls to *Client.SendUserOperation.
func (*RpcAdapter) Eth_supportedEntryPoints ¶
func (r *RpcAdapter) Eth_supportedEntryPoints() ([]string, error)
Eth_supportedEntryPoints routes eth_supportedEntryPoints method calls to *Client.SupportedEntryPoints.