types

package
v0.0.1-rc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2025 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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 indicates that the user is not authorized to perform the action
	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

func RenderJSON(ctx *gin.Context, errCode int, err error, data interface{})

RenderJSON renders response with json

func RenderSuccess

func RenderSuccess(ctx *gin.Context, data interface{})

RenderSuccess renders success response with json

func SendError

func SendError(c *gin.Context, id interface{}, code int, message string)

SendError sends a JSON-RPC error response

func SendSuccess

func SendSuccess(c *gin.Context, id interface{}, result interface{})

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.

type RPCError

type RPCError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

RPCError represents a JSON-RPC error object.

type Response

type Response struct {
	ErrCode int         `json:"errcode"`
	ErrMsg  string      `json:"errmsg"`
	Data    interface{} `json:"data"`
}

Response the response schema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL