Documentation ¶
Index ¶
- func CreateRequestAndSign(callData []byte, rgap JSONRPCResponseGasAndPaymaster, chainID int64, ...) ([]byte, error)
- func CreateRequestGetUserOperationByHash(operationHash string, id int) ([]byte, error)
- func CreateRequestGetUserOperationReceipt(operationHash string, id int) ([]byte, error)
- func CreateRequestStep2(alchemyRequestId int, signedByUserData []byte, uo UserOperation, ...) ([]byte, error)
- func DecodeResponseSendRequest(response []byte) (opHash string, err error)
- func SendRequest(apiKey string, jsonDATA []byte) ([]byte, error)
- type EntryPointAddress
- type GasAndPaymentStruct
- type JSONRPCRequest
- type JSONRPCRequestGasAndPaymaster
- type JSONRPCRequestGetUserOperationReceipt
- type JSONRPCResponseGasAndPaymaster
- type JSONRPCResponseGetOp
- type JSONRPCResponseGetUserOpByHash
- type JSONRPCResponseUserOpHash
- type UserOperation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRequestAndSign ¶
func CreateRequestAndSign(callData []byte, rgap JSONRPCResponseGasAndPaymaster, chainID int64, entryPointAddr common.Address, sender common.Address, senderScw common.Address, nonce uint64, id int, myPK string, factoryAddr common.Address, appendEntryPoint bool) ([]byte, error)
creates a JSONRPCRequest with "eth_sendUserOperation" formatted data
func CreateRequestGetUserOperationByHash ¶
TODO: test
func CreateRequestGetUserOperationReceipt ¶
creates a JSONRPCRequest with "eth_getUserOperationReceipt" formatted data
func CreateRequestStep2 ¶
func CreateRequestStep2(alchemyRequestId int, signedByUserData []byte, uo UserOperation, entryPointAddr common.Address) ([]byte, error)
adds signature to UserOperation and creates final JSONRPCRequest that can be sent with 'SendRequest'
Types ¶
type EntryPointAddress ¶
type EntryPointAddress interface{}
type GasAndPaymentStruct ¶
type GasAndPaymentStruct struct { PolicyID string `json:"policyId"` EntryPoint string `json:"entryPoint"` UserOperation UserOperation `json:"userOperation"` DummySignature string `json:"dummySignature"` }
type JSONRPCRequest ¶
type JSONRPCRequest struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Params []UserOperation `json:"params"` }
type JSONRPCRequestGasAndPaymaster ¶
type JSONRPCRequestGasAndPaymaster struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Method string `json:"method"` Params []GasAndPaymentStruct `json:"params"` }
func CreateRequestGasAndPaymasterData ¶
func CreateRequestGasAndPaymasterData(callData []byte, sender common.Address, senderScw common.Address, nonce uint64, policyID string, entryPointAddr common.Address, factoryAddr common.Address, id int) (JSONRPCRequestGasAndPaymaster, error)
if factoryAddr is non-null -> will set init code should create a GasAndPaymentStruct
type JSONRPCResponseGasAndPaymaster ¶
type JSONRPCResponseGasAndPaymaster struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Error struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` } `json:"error,omitempty"` Result struct { PreVerificationGas string `json:"preVerificationGas,omitempty"` CallGasLimit string `json:"callGasLimit,omitempty"` VerificationGasLimit string `json:"verificationGasLimit,omitempty"` PaymasterAndData string `json:"paymasterAndData,omitempty"` MaxFeePerGas string `json:"maxFeePerGas,omitempty"` MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas,omitempty"` } `json:"result"` }
type JSONRPCResponseGetOp ¶
type JSONRPCResponseGetOp struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Error struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` } `json:"error,omitempty"` Result struct { UserOpHash string `json:"userOpHash,omitempty"` Success bool `json:"success,omitempty"` } `json:"result"` }
func DecodeResponseGetUserOperationReceipt ¶
func DecodeResponseGetUserOperationReceipt(response []byte) (ret *JSONRPCResponseGetOp, err error)
type JSONRPCResponseGetUserOpByHash ¶
type JSONRPCResponseGetUserOpByHash struct { ID int `json:"id"` JSONRPC string `json:"jsonrpc"` Error struct { Code int `json:"code,omitempty"` Message string `json:"message,omitempty"` } `json:"error,omitempty"` Result struct { UserOperation string `json:"userOperation,omitempty"` BlockNumber string `json:"blockNumber,omitempty"` BlockHash string `json:"blockNumber,omitempty"` TransactionHash string `json:"blockNumber,omitempty"` } `json:"result"` }
func DecodeResponseGetUserOperationByHash ¶
func DecodeResponseGetUserOperationByHash(response []byte) (ret *JSONRPCResponseGetUserOpByHash, err error)
TODO: test
type UserOperation ¶
type UserOperation struct { Sender string `json:"sender,omitempty"` Nonce string `json:"nonce,omitempty"` InitCode string `json:"initCode,omitempty"` CallData string `json:"callData,omitempty"` Signature string `json:"signature,omitempty"` 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,omitempty"` }
func CreateRequestStep1 ¶
func CreateRequestStep1(callData []byte, rgap JSONRPCResponseGasAndPaymaster, chainID int64, entryPointAddr common.Address, sender common.Address, nonce uint64) (dataToSign []byte, uo UserOperation, err error)
creates a UserOperation and data to sign with user's private key
Click to show internal directories.
Click to hide internal directories.