Documentation
¶
Index ¶
- Constants
- func EncodeExecuteCall(msg *ethereum.CallMsg) (*[]byte, error)
- type BundlerClient
- func (b *BundlerClient) Close()
- func (b *BundlerClient) GetChainID() *big.Int
- func (b *BundlerClient) GetClient() *rpc.Client
- func (b *BundlerClient) GetEntryPoint() Entrypoint
- func (b *BundlerClient) GetURL() *url.URL
- func (b *BundlerClient) GetUserOperationGasPrice() (*GetUserOperationGasPriceResponse, error)
- func (b *BundlerClient) SendUserOperation(op *UserOperation) (*[]byte, error)
- type Client
- type ClientConfig
- type Entrypoint
- type EntrypointClient07
- func (e *EntrypointClient07) Close()
- func (e *EntrypointClient07) GetAddress() *common.Address
- func (e *EntrypointClient07) GetNonce(account *common.Address) (*big.Int, error)
- func (e *EntrypointClient07) GetUserOperationHash(op *UserOperation) (*common.Hash, error)
- func (*EntrypointClient07) PackUserOperation(op *UserOperation) ([]byte, error)
- type GasPriceSpecification
- type GasPriceSpecificationHex
- type GetUserOperationGasPriceResponse
- type PaymasterClient
- func (p *PaymasterClient) Close()
- func (p *PaymasterClient) GetChainID() *big.Int
- func (p *PaymasterClient) GetClient() *rpc.Client
- func (p *PaymasterClient) GetEntryPoint() Entrypoint
- func (p *PaymasterClient) GetURL() *url.URL
- func (p *PaymasterClient) SponsorUserOperation(op *UserOperation) (*SponsorUserOperationResponse, error)
- type PrivateKeySigner
- type SendUserOperationRequest
- type SendUserOperationResponse
- type Signer
- type SponsorUserOperationRequest
- type SponsorUserOperationResponse
- type SponsorUserOperationResponseHex
- type UserOperation
- type UserOperationHex
- type UserOperationResult
Constants ¶
View Source
const ( ChainPolygon = int64(137) ChainPolygonAmoy = int64(80_002) )
ChainPolygon Polygon ChainID ChainPolygonAmoy Polygon Amoy Testnet ChainID
View Source
const (
AddressZero = "0x0000000000000000000000000000000000000000"
)
Addresses
View Source
const (
EntryPointVersion07 = "0.7"
)
View Source
const (
SignatureDummy = "" /* 132-byte string literal not displayed */
)
SignatureDummy Signature used in interaction with paymaster to calculate fees
Variables ¶
This section is empty.
Functions ¶
func EncodeExecuteCall ¶
Types ¶
type BundlerClient ¶
type BundlerClient struct {
URL *url.URL
Client *rpc.Client
EntryPoint Entrypoint
ChainID *big.Int
}
func NewBundlerClient ¶
func NewBundlerClient(url *url.URL, entrypoint Entrypoint, chainID *big.Int) (*BundlerClient, error)
func (*BundlerClient) Close ¶
func (b *BundlerClient) Close()
func (*BundlerClient) GetChainID ¶
func (b *BundlerClient) GetChainID() *big.Int
func (*BundlerClient) GetClient ¶
func (b *BundlerClient) GetClient() *rpc.Client
func (*BundlerClient) GetEntryPoint ¶
func (b *BundlerClient) GetEntryPoint() Entrypoint
func (*BundlerClient) GetURL ¶
func (b *BundlerClient) GetURL() *url.URL
func (*BundlerClient) GetUserOperationGasPrice ¶
func (b *BundlerClient) GetUserOperationGasPrice() (*GetUserOperationGasPriceResponse, error)
func (*BundlerClient) SendUserOperation ¶
func (b *BundlerClient) SendUserOperation(op *UserOperation) (*[]byte, error)
type Client ¶
type Client struct {
Signer Signer
EntryPoint Entrypoint
PaymasterClient *PaymasterClient
BundlerClient *BundlerClient
ChainID *big.Int
}
func NewClient ¶
func NewClient(config *ClientConfig) (*Client, error)
func (*Client) SendUserOperation ¶
type ClientConfig ¶
type Entrypoint ¶
type EntrypointClient07 ¶
type EntrypointClient07 struct {
Client *rpc.Client
Address *common.Address
Abi *abi.ABI
ChainID *big.Int
}
func NewEntrypoint07 ¶
func (*EntrypointClient07) Close ¶
func (e *EntrypointClient07) Close()
func (*EntrypointClient07) GetAddress ¶
func (e *EntrypointClient07) GetAddress() *common.Address
func (*EntrypointClient07) GetUserOperationHash ¶
func (e *EntrypointClient07) GetUserOperationHash(op *UserOperation) (*common.Hash, error)
func (*EntrypointClient07) PackUserOperation ¶
func (*EntrypointClient07) PackUserOperation(op *UserOperation) ([]byte, error)
type GasPriceSpecification ¶
type GasPriceSpecification struct {
MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"`
MaxFeePerGas *big.Int `json:"maxFeePerGas"`
}
func (*GasPriceSpecification) UnmarshalJSON ¶
func (g *GasPriceSpecification) UnmarshalJSON(b []byte) error
type GetUserOperationGasPriceResponse ¶
type GetUserOperationGasPriceResponse struct {
Slow *GasPriceSpecification `json:"slow"`
Standard *GasPriceSpecification `json:"standard"`
Fast *GasPriceSpecification `json:"fast"`
}
type PaymasterClient ¶
type PaymasterClient struct {
URL *url.URL
Client *rpc.Client
EntryPoint Entrypoint
ChainID *big.Int
}
func NewPaymasterClient ¶
func NewPaymasterClient(url *url.URL, entrypoint Entrypoint, chainID *big.Int) (*PaymasterClient, error)
func (*PaymasterClient) Close ¶
func (p *PaymasterClient) Close()
func (*PaymasterClient) GetChainID ¶
func (p *PaymasterClient) GetChainID() *big.Int
func (*PaymasterClient) GetClient ¶
func (p *PaymasterClient) GetClient() *rpc.Client
func (*PaymasterClient) GetEntryPoint ¶
func (p *PaymasterClient) GetEntryPoint() Entrypoint
func (*PaymasterClient) GetURL ¶
func (p *PaymasterClient) GetURL() *url.URL
func (*PaymasterClient) SponsorUserOperation ¶
func (p *PaymasterClient) SponsorUserOperation(op *UserOperation) (*SponsorUserOperationResponse, error)
type PrivateKeySigner ¶
type PrivateKeySigner struct {
PrivateKey *ecdsa.PrivateKey
}
func (*PrivateKeySigner) SignHash ¶
func (s *PrivateKeySigner) SignHash(hash common.Hash) ([]byte, error)
func (*PrivateKeySigner) SignMessage ¶
func (s *PrivateKeySigner) SignMessage(message []byte) ([]byte, error)
func (*PrivateKeySigner) SignTypedData ¶
func (s *PrivateKeySigner) SignTypedData(typedData *signer.TypedData) ([]byte, error)
type SendUserOperationRequest ¶
type SendUserOperationRequest struct {
ChainID *uint64 `json:"chainId"`
Operation *UserOperation `json:"userOp"`
EntryPointAddress *common.Address `json:"entryPointAddress"`
GasToken *common.Address `json:"gasToken,omitempty"`
ShouldOverrideFee bool `json:"shouldOverrideFee"`
ShouldConsume bool `json:"shouldConsume"`
}
type Signer ¶
type Signer interface {
SignMessage(message []byte) ([]byte, error)
SignTypedData(typedData *signer.TypedData) ([]byte, error)
SignHash(hash common.Hash) ([]byte, error)
}
func NewPrivateKeySigner ¶
func NewPrivateKeySigner(privateKey *ecdsa.PrivateKey) Signer
type SponsorUserOperationRequest ¶
type SponsorUserOperationRequest struct {
ChainID *big.Int `json:"chainId"`
Operation *UserOperation `json:"userOp"`
EntryPointAddress *common.Address `json:"entryPointAddress"`
GasToken *common.Address `json:"gasToken,omitempty"`
ShouldOverrideFee bool `json:"shouldOverrideFee"`
ShouldConsume bool `json:"shouldConsume"`
}
type SponsorUserOperationResponse ¶
type SponsorUserOperationResponse struct {
CallGasLimit *big.Int `json:"callGasLimit"`
PaymasterVerificationGasLimit *big.Int `json:"paymasterVerificationGasLimit"`
PaymasterPostOpGasLimit *big.Int `json:"paymasterPostOpGasLimit"`
VerificationGasLimit *big.Int `json:"verificationGasLimit"`
MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"`
Paymaster []byte `json:"paymaster"`
MaxFeePerGas *big.Int `json:"maxFeePerGas"`
PaymasterData []byte `json:"paymasterData"`
PreVerificationGas *big.Int `json:"preVerificationGas"`
}
func (*SponsorUserOperationResponse) MarshalJSON ¶
func (r *SponsorUserOperationResponse) MarshalJSON() ([]byte, error)
func (*SponsorUserOperationResponse) UnmarshalJSON ¶
func (r *SponsorUserOperationResponse) UnmarshalJSON(b []byte) error
type SponsorUserOperationResponseHex ¶
type SponsorUserOperationResponseHex struct {
CallGasLimit string `json:"callGasLimit"`
PaymasterVerificationGasLimit string `json:"paymasterVerificationGasLimit"`
PaymasterPostOpGasLimit string `json:"paymasterPostOpGasLimit"`
VerificationGasLimit string `json:"verificationGasLimit"`
MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
Paymaster string `json:"paymaster"`
MaxFeePerGas string `json:"maxFeePerGas"`
PaymasterData string `json:"paymasterData"`
PreVerificationGas string `json:"preVerificationGas"`
}
type UserOperation ¶
type UserOperation struct {
Sender *common.Address `json:"sender"`
Nonce *big.Int `json:"nonce"`
CallData []byte `json:"callData"`
CallGasLimit *big.Int `json:"callGasLimit,omitempty"`
VerificationGasLimit *big.Int `json:"verificationGasLimit,omitempty"`
PreVerificationGas *big.Int `json:"preVerificationGas,omitempty"`
MaxFeePerGas *big.Int `json:"maxFeePerGas"`
MaxPriorityFeePerGas *big.Int `json:"maxPriorityFeePerGas"`
Paymaster []byte `json:"paymaster,omitempty"`
PaymasterData []byte `json:"paymasterData,omitempty"`
PaymasterVerificationGasLimit *big.Int `json:"paymasterVerificationGasLimit,omitempty"`
PaymasterPostOpGasLimit *big.Int `json:"paymasterPostOpGasLimit,omitempty"`
Signature []byte `json:"signature,omitempty"`
}
func (*UserOperation) MarshalJSON ¶
func (op *UserOperation) MarshalJSON() ([]byte, error)
type UserOperationHex ¶
type UserOperationHex struct {
Sender string `json:"sender"`
Nonce string `json:"nonce"`
CallData string `json:"callData"`
CallGasLimit string `json:"callGasLimit,omitempty"`
VerificationGasLimit string `json:"verificationGasLimit,omitempty"`
PreVerificationGas string `json:"preVerificationGas,omitempty"`
MaxFeePerGas string `json:"maxFeePerGas"`
MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
Paymaster string `json:"paymaster,omitempty"`
PaymasterData string `json:"paymasterData,omitempty"`
PaymasterVerificationGasLimit string `json:"paymasterVerificationGasLimit,omitempty"`
PaymasterPostOpGasLimit string `json:"paymasterPostOpGasLimit,omitempty"`
Signature string `json:"signature,omitempty"`
}
type UserOperationResult ¶
type UserOperationResult struct {
TxHash *[]byte `json:"txHash"`
}
Click to show internal directories.
Click to hide internal directories.