Documentation
¶
Index ¶
- Constants
- func RenderJSON(ctx *gin.Context, errCode int, err error, data interface{})
- func RenderSuccess(ctx *gin.Context, data interface{})
- func SendError(c *gin.Context, id interface{}, code int, message string)
- func SendSuccess(c *gin.Context, id interface{}, result interface{})
- type GetPaymasterDataResultV7
- type GetPaymasterStubDataResultV7
- type PaymasterJSONRPCRequest
- type PaymasterJSONRPCResponse
- type PaymasterUserOperationV7
- type RPCError
- type Response
Constants ¶
View Source
const ( // Success shows OK. Success = 0 // InternalServerError shows a fatal error in the server InternalServerError = 500 // ParseErrorCode indicates a JSON parsing error ParseErrorCode = -32700 // InvalidRequestCode indicates an invalid JSON-RPC request InvalidRequestCode = -32600 // MethodNotFoundCode indicates that the requested method does not exist MethodNotFoundCode = -32601 // InvalidParamsCode indicates that the parameters provided to the method are invalid InvalidParamsCode = -32602 UnauthorizedErrorCode = -32000 // UnsupportedChainIDCode indicates that the chain ID is not supported by the paymaster UnsupportedChainIDCode = -32001 // UnsupportedEntryPointCode indicates that the entry point is not supported by the paymaster UnsupportedEntryPointCode = -32002 // PaymasterDataGenErrorCode indicates an error in generating paymaster data PaymasterDataGenErrorCode = -32003 // UnsupportedTokenErrorCode indicates that the token is not supported by the paymaster UnsupportedTokenErrorCode = -32004 // JSONRPCVersion is the version of JSON-RPC used JSONRPCVersion = "2.0" )
Variables ¶
This section is empty.
Functions ¶
func RenderJSON ¶
RenderJSON renders response with json
func RenderSuccess ¶
RenderSuccess renders success response with json
func SendSuccess ¶
SendSuccess sends a JSON-RPC success response
Types ¶
type GetPaymasterDataResultV7 ¶
type GetPaymasterDataResultV7 struct {
Paymaster common.Address `json:"paymaster"`
PaymasterData string `json:"paymasterData"`
}
GetPaymasterDataResultV7 is the result for pm_getPaymasterData (EntryPoint v0.7).
type GetPaymasterStubDataResultV7 ¶
type GetPaymasterStubDataResultV7 struct {
Paymaster common.Address `json:"paymaster"`
PaymasterData string `json:"paymasterData"`
PaymasterVerificationGasLimit string `json:"paymasterVerificationGasLimit,omitempty"` // Optional for v0.7
PaymasterPostOpGasLimit string `json:"paymasterPostOpGasLimit"` // Required for v0.7, because paymaster cannot trust the wallet side to provide it
}
GetPaymasterStubDataResultV7 is the result for pm_getPaymasterStubData (EntryPoint v0.7).
type PaymasterJSONRPCRequest ¶
type PaymasterJSONRPCRequest struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params json.RawMessage `json:"params"` // Method parameters, an array for ERC-7677.
ID interface{} `json:"id,omitempty"`
APIKey string `json:"apiKey"`
}
PaymasterJSONRPCRequest represents a JSON-RPC request specific to the paymaster service.
type PaymasterJSONRPCResponse ¶
type PaymasterJSONRPCResponse struct {
JSONRPC string `json:"jsonrpc"`
Result interface{} `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"` // Using the same RPCError struct
ID interface{} `json:"id"`
}
PaymasterJSONRPCResponse represents a JSON-RPC response specific to the paymaster service.
type PaymasterUserOperationV7 ¶
type PaymasterUserOperationV7 struct {
Sender common.Address `json:"sender"`
Nonce hexutil.Big `json:"nonce"`
InitCode string `json:"initCode"`
CallData string `json:"callData"`
CallGasLimit hexutil.Big `json:"callGasLimit"`
VerificationGasLimit hexutil.Big `json:"verificationGasLimit"`
PreVerificationGas hexutil.Big `json:"preVerificationGas"`
MaxFeePerGas hexutil.Big `json:"maxFeePerGas"`
MaxPriorityFeePerGas hexutil.Big `json:"maxPriorityFeePerGas"`
}
PaymasterUserOperationV7 defines the UserOperation structure sent to paymaster methods (unsigned), when the context implies an EntryPoint v0.7 interaction.
Click to show internal directories.
Click to hide internal directories.