Documentation ¶
Index ¶
- Variables
- func AbiEncode(args ...[]byte) []byte
- func AbiEncodePacked(args ...[]byte) []byte
- func ComputeCounterfactualAddress(sender, salt, initCode []byte) string
- func DecodeResult[T Decoder](r interface{}, dest T) error
- func GetUserOperationHash(request *PackedUserOp, chainID int64, entryPointAddress common.Address) ([]byte, error)
- func PackUserOperation(request *PackedUserOp) ([]byte, error)
- func PrepareRPCCall(endpoint, method string, params interface{}) (*http.Request, error)
- func SignDataWithEthereumPrivateKey(data []byte, privKey *ecdsa.PrivateKey) ([]byte, error)
- func SignUserOp()
- type Adapter
- type AdapterArgs
- type AddressArrayEntryPoints
- type Bundler
- func (b *Bundler) Debug_clearState()
- func (b *Bundler) Debug_dumpMempool()
- func (b *Bundler) Debug_dumpReputation()
- func (b *Bundler) Debug_sendBundleNow()
- func (b *Bundler) Debug_setBundlingMode()
- func (b *Bundler) Debug_setReputation()
- func (b *Bundler) Eth_chainId() (*RpcResponse, error)
- func (b *Bundler) Eth_estimateUserOperationGas(userOp *PackedUserOp, entrypoint *common.Address, ...) (*RpcResponse, error)
- func (b *Bundler) Eth_estimateUserOperationGas_v070(userOp *v070.RpcUnpackedUserOperation, entrypoint *common.Address, ...) (*RpcResponse, *Eth_estimateUserOperationGasResponse, error)
- func (b *Bundler) Eth_getUserOperationByHash(userOpHash string) (*RpcResponse, error)
- func (b *Bundler) Eth_getUserOperationReceipt(userOpHash string) (*RpcResponse, error)
- func (b *Bundler) Eth_sendUserOperation(userOp *PackedUserOp, entrypoint *common.Address) (*RpcResponse, error)
- func (b *Bundler) Eth_sendUserOperation_v070(userOp *v070.RpcUnpackedUserOperation, entrypoint *common.Address) (*RpcResponse, error)
- func (b *Bundler) Eth_supportedEntryPoints() (*RpcResponse, error)
- func (b *Bundler) Init(rpcUri string, client *ethclient.Client) error
- func (b *Bundler) Pimlico_getUserOperationGasPrice() (*RpcResponse, *Pimlico_getUserOperationGasPriceResponse, error)
- func (b *Bundler) Rundler_maxPriorityFeePerGas() (*RpcResponse, error)
- type Config
- type Decoder
- type Eth_estimateUserOperationGasResponse
- type Int64ChainId
- type OperationBuilder
- func (ob *OperationBuilder) Adapt(adapter Adapter, val interface{}, args ...interface{}) string
- func (ob *OperationBuilder) Build() *PackedUserOp
- func (ob *OperationBuilder) BuildWithOperationHash(chainId *big.Int, entryPoint common.Address) (*PackedUserOp, []byte, error)
- func (ob *OperationBuilder) BuildWithSignature(chainId *big.Int, entryPoint common.Address, privKey *ecdsa.PrivateKey) (*PackedUserOp, error)
- func (ob *OperationBuilder) CallData(callData []byte) *OperationBuilder
- func (ob *OperationBuilder) CallGasLimit(callGasLimit *big.Int) *OperationBuilder
- func (ob *OperationBuilder) Factory(factory *common.Address) *OperationBuilder
- func (ob *OperationBuilder) FactoryAndData(factory *common.Address, factoryCallData []byte) *OperationBuilder
- func (ob *OperationBuilder) FactoryData(factoryCallData []byte) *OperationBuilder
- func (ob *OperationBuilder) MaxFeePerGas(maxFeePerGas *big.Int) *OperationBuilder
- func (ob *OperationBuilder) MaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) *OperationBuilder
- func (ob *OperationBuilder) Nonce(nonce *big.Int) *OperationBuilder
- func (ob *OperationBuilder) Paymaster(paymaster *common.Address) *OperationBuilder
- func (ob *OperationBuilder) PaymasterAndData(paymaster *common.Address, paymasterCallData []byte) *OperationBuilder
- func (ob *OperationBuilder) PaymasterData(paymasterCallData []byte) *OperationBuilder
- func (ob *OperationBuilder) PaymasterPostOpGasLimit(paymasterPostOpGasLimit *big.Int) *OperationBuilder
- func (ob *OperationBuilder) PaymasterVerificationGasLimit(paymasterVerificationGasLimit *big.Int) *OperationBuilder
- func (ob *OperationBuilder) PreVerificationGas(preVerificationGas *big.Int) *OperationBuilder
- func (ob *OperationBuilder) Sender(sender *common.Address) *OperationBuilder
- func (ob *OperationBuilder) Signature(sig string) *OperationBuilder
- func (ob *OperationBuilder) VerificationGasLimit(verificationGasLimit *big.Int) *OperationBuilder
- type PackedUserOp
- type Pimlico_getUserOperationGasPriceResponse
- type Pimlico_getUserOperationGasPriceValues
- type RpcError
- type RpcRequest
- type RpcResponse
- type UserOp
Constants ¶
This section is empty.
Variables ¶
View Source
var Client *http.Client = &http.Client{}
View Source
var ErrRequestCreationFailed = errors.New("request object failure")
Functions ¶
func AbiEncodePacked ¶
TODO: input type ...interface{} output ([]byte, error)
func ComputeCounterfactualAddress ¶
initCode = creationCode + packed(constructorArguments)
func DecodeResult ¶
func GetUserOperationHash ¶
func PackUserOperation ¶
func PackUserOperation(request *PackedUserOp) ([]byte, error)
func PrepareRPCCall ¶
func SignDataWithEthereumPrivateKey ¶
func SignDataWithEthereumPrivateKey(data []byte, privKey *ecdsa.PrivateKey) ([]byte, error)
func SignUserOp ¶
func SignUserOp()
Types ¶
type Adapter ¶
type Adapter func(...AdapterArgs) string
var ADDRESS_PACKED_DATA_ADAPTER Adapter = func(aa ...AdapterArgs) string { factoryAddress, ok := aa[0].(*common.Address) if !ok || factoryAddress == nil { return "0x" } factoryHex := factoryAddress.Hex() if len(aa) != 2 { return factoryHex } args, ok := aa[1].([]interface{}) if !ok || len(args) != 1 { return factoryHex } factoryAddressData, ok := args[0].([]byte) if !ok || len(factoryAddressData) == 0 { return factoryHex } return strings.Join([]string{factoryHex, hex.EncodeToString(factoryAddressData)}, "") }
var PACKED_DATA_ADAPTER Adapter = func(aa ...AdapterArgs) string { callData, ok := aa[0].([]byte) if !ok || len(callData) == 0 { return "0x" } return strings.Join([]string{"0x", hex.EncodeToString(callData)}, "") }
type AdapterArgs ¶
type AdapterArgs interface{}
type AddressArrayEntryPoints ¶
func (*AddressArrayEntryPoints) Decode ¶
func (i *AddressArrayEntryPoints) Decode(rawResult interface{}) error
type Bundler ¶
type Bundler struct { RpcUri string ChainId *big.Int EntryPoints []common.Address EthClient *ethclient.Client }
func NewBundler ¶
func NewBundler() *Bundler
func (*Bundler) Debug_clearState ¶
func (b *Bundler) Debug_clearState()
func (*Bundler) Debug_dumpMempool ¶
func (b *Bundler) Debug_dumpMempool()
func (*Bundler) Debug_dumpReputation ¶
func (b *Bundler) Debug_dumpReputation()
func (*Bundler) Debug_sendBundleNow ¶
func (b *Bundler) Debug_sendBundleNow()
func (*Bundler) Debug_setBundlingMode ¶
func (b *Bundler) Debug_setBundlingMode()
func (*Bundler) Debug_setReputation ¶
func (b *Bundler) Debug_setReputation()
func (*Bundler) Eth_chainId ¶
func (b *Bundler) Eth_chainId() (*RpcResponse, error)
func (*Bundler) Eth_estimateUserOperationGas ¶
func (b *Bundler) Eth_estimateUserOperationGas(userOp *PackedUserOp, entrypoint *common.Address, stateOverrideSet map[common.Address]gethclient.OverrideAccount) (*RpcResponse, error)
func (*Bundler) Eth_estimateUserOperationGas_v070 ¶
func (b *Bundler) Eth_estimateUserOperationGas_v070(userOp *v070.RpcUnpackedUserOperation, entrypoint *common.Address, stateOverrideSet map[common.Address]gethclient.OverrideAccount) (*RpcResponse, *Eth_estimateUserOperationGasResponse, error)
func (*Bundler) Eth_getUserOperationByHash ¶
func (b *Bundler) Eth_getUserOperationByHash(userOpHash string) (*RpcResponse, error)
func (*Bundler) Eth_getUserOperationReceipt ¶
func (b *Bundler) Eth_getUserOperationReceipt(userOpHash string) (*RpcResponse, error)
func (*Bundler) Eth_sendUserOperation ¶
func (b *Bundler) Eth_sendUserOperation(userOp *PackedUserOp, entrypoint *common.Address) (*RpcResponse, error)
func (*Bundler) Eth_sendUserOperation_v070 ¶
func (b *Bundler) Eth_sendUserOperation_v070(userOp *v070.RpcUnpackedUserOperation, entrypoint *common.Address) (*RpcResponse, error)
func (*Bundler) Eth_supportedEntryPoints ¶
func (b *Bundler) Eth_supportedEntryPoints() (*RpcResponse, error)
func (*Bundler) Pimlico_getUserOperationGasPrice ¶
func (b *Bundler) Pimlico_getUserOperationGasPrice() (*RpcResponse, *Pimlico_getUserOperationGasPriceResponse, error)
func (*Bundler) Rundler_maxPriorityFeePerGas ¶
func (b *Bundler) Rundler_maxPriorityFeePerGas() (*RpcResponse, error)
type Eth_estimateUserOperationGasResponse ¶
type Eth_estimateUserOperationGasResponse struct { CallGasLimit *big.Int `json:"callGasLimit` PaymasterPostOpGasLimit *big.Int `json:"paymasterPostOpGasLimit"` PaymasterVerificationGasLimit *big.Int `json:"paymasterVerificationGasLimit"` PreVerificationGas *big.Int `json:"preVerificationGas"` VerificationGasLimit *big.Int `json:"preVerificationGas"` }
map[callGasLimit:0x78fb paymasterPostOpGasLimit:0x0 paymasterVerificationGasLimit:0x0 preVerificationGas:0xc870 verificationGasLimit:0x10cd9]
type Int64ChainId ¶
type Int64ChainId struct {
Value int64
}
func (*Int64ChainId) Decode ¶
func (i *Int64ChainId) Decode(rawResult interface{}) error
type OperationBuilder ¶
type OperationBuilder struct {
Operation UserOp
}
func NewOperationBuilder ¶
func NewOperationBuilder() *OperationBuilder
func (*OperationBuilder) Adapt ¶
func (ob *OperationBuilder) Adapt(adapter Adapter, val interface{}, args ...interface{}) string
func (*OperationBuilder) Build ¶
func (ob *OperationBuilder) Build() *PackedUserOp
func (*OperationBuilder) BuildWithOperationHash ¶
func (ob *OperationBuilder) BuildWithOperationHash(chainId *big.Int, entryPoint common.Address) (*PackedUserOp, []byte, error)
func (*OperationBuilder) BuildWithSignature ¶
func (ob *OperationBuilder) BuildWithSignature(chainId *big.Int, entryPoint common.Address, privKey *ecdsa.PrivateKey) (*PackedUserOp, error)
func (*OperationBuilder) CallData ¶
func (ob *OperationBuilder) CallData(callData []byte) *OperationBuilder
func (*OperationBuilder) CallGasLimit ¶
func (ob *OperationBuilder) CallGasLimit(callGasLimit *big.Int) *OperationBuilder
func (*OperationBuilder) Factory ¶
func (ob *OperationBuilder) Factory(factory *common.Address) *OperationBuilder
func (*OperationBuilder) FactoryAndData ¶
func (ob *OperationBuilder) FactoryAndData(factory *common.Address, factoryCallData []byte) *OperationBuilder
func (*OperationBuilder) FactoryData ¶
func (ob *OperationBuilder) FactoryData(factoryCallData []byte) *OperationBuilder
func (*OperationBuilder) MaxFeePerGas ¶
func (ob *OperationBuilder) MaxFeePerGas(maxFeePerGas *big.Int) *OperationBuilder
func (*OperationBuilder) MaxPriorityFeePerGas ¶
func (ob *OperationBuilder) MaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) *OperationBuilder
func (*OperationBuilder) Nonce ¶
func (ob *OperationBuilder) Nonce(nonce *big.Int) *OperationBuilder
func (*OperationBuilder) Paymaster ¶
func (ob *OperationBuilder) Paymaster(paymaster *common.Address) *OperationBuilder
func (*OperationBuilder) PaymasterAndData ¶
func (ob *OperationBuilder) PaymasterAndData(paymaster *common.Address, paymasterCallData []byte) *OperationBuilder
func (*OperationBuilder) PaymasterData ¶
func (ob *OperationBuilder) PaymasterData(paymasterCallData []byte) *OperationBuilder
func (*OperationBuilder) PaymasterPostOpGasLimit ¶
func (ob *OperationBuilder) PaymasterPostOpGasLimit(paymasterPostOpGasLimit *big.Int) *OperationBuilder
func (*OperationBuilder) PaymasterVerificationGasLimit ¶
func (ob *OperationBuilder) PaymasterVerificationGasLimit(paymasterVerificationGasLimit *big.Int) *OperationBuilder
func (*OperationBuilder) PreVerificationGas ¶
func (ob *OperationBuilder) PreVerificationGas(preVerificationGas *big.Int) *OperationBuilder
func (*OperationBuilder) Sender ¶
func (ob *OperationBuilder) Sender(sender *common.Address) *OperationBuilder
func (*OperationBuilder) Signature ¶
func (ob *OperationBuilder) Signature(sig string) *OperationBuilder
func (*OperationBuilder) VerificationGasLimit ¶
func (ob *OperationBuilder) VerificationGasLimit(verificationGasLimit *big.Int) *OperationBuilder
type PackedUserOp ¶
type PackedUserOp struct { Sender string `json:"sender"` Nonce string `json:"nonce"` InitCode string `json:"initCode"` CallData string `json:"callData"` CallGasLimit string `json:"callGasLimit,omitempty"` VerificationGasLimit string `json:"verificationGasLimit,omitempty"` PreVerificationGas string `json:"preVerificationGas,omitempty"` MaxFeePerGas string `json:"maxFeePerGas,omitempty"` MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas,omitempty"` PaymasterAndData string `json:"paymasterAndData"` Signature string `json:"signature"` }
type Pimlico_getUserOperationGasPriceResponse ¶
type Pimlico_getUserOperationGasPriceResponse struct { Slow Pimlico_getUserOperationGasPriceValues `json:"slow"` Standard Pimlico_getUserOperationGasPriceValues `json:"standard"` Fast Pimlico_getUserOperationGasPriceValues `json:"fast"` }
map[fast:map[maxFeePerGas:0x3c063a21 maxPriorityFeePerGas:0x3b9aca00] slow:map[maxFeePerGas:0x3c063a21 maxPriorityFeePerGas:0x3b9aca00] standard:map[maxFeePerGas:0x3c063a21 maxPriorityFeePerGas:0x3b9aca00
type RpcRequest ¶
type RpcResponse ¶
type RpcResponse struct { Jsonrpc string `json:"jsonrpc"` Result interface{} `json:"result"` Error interface{} `json:"error"` Id int `json:"id"` }
func HandleRpcRequest ¶
type UserOp ¶
type UserOp struct { Sender *common.Address Nonce *big.Int Factory *common.Address FactoryData []byte CallData []byte CallGasLimit *big.Int VerificationGasLimit *big.Int PreVerificationGas *big.Int MaxFeePerGas *big.Int MaxPriorityFeePerGas *big.Int Paymaster *common.Address PaymasterVerificationGasLimit *big.Int PaymasterPostOpGasLimit *big.Int PaymasterData []byte Signature string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.