Documentation
¶
Index ¶
- Constants
- func New() app.Component
- type AlchemyAAService
- type EntryPointAddress
- type GasAndPaymentStruct
- type JSONRPCRequest
- type JSONRPCRequestGasAndPaymaster
- type JSONRPCRequestGetUserOperationReceipt
- type JSONRPCResponseGasAndPaymaster
- type JSONRPCResponseGetOp
- type JSONRPCResponseGetUserOpByHash
- type JSONRPCResponseUserOpHash
- type UserOperation
Constants ¶
View Source
const CName = "any-ns.alchemysdk"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlchemyAAService ¶
type AlchemyAAService interface {
// if factoryAddr is non-null -> will set init code
CreateRequestGasAndPaymasterData(callData []byte, sender common.Address, senderScw common.Address, nonce uint64, policyID string, entryPointAddr common.Address, factoryAddr common.Address, id int) (JSONRPCRequestGasAndPaymaster, error)
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)
// can be used to send any type of request to Alchemy
SendRequest(apiKey string, jsonDATA []byte) ([]byte, error)
DecodeResponseSendRequest(response []byte) (opHash string, err error)
CreateRequestGetUserOperationReceipt(operationHash string, id int) ([]byte, error)
DecodeResponseGetUserOperationReceipt(response []byte) (ret *JSONRPCResponseGetOp, err error)
// creates a UserOperation and data to sign with user's private key
CreateRequestStep1(callData []byte, rgap JSONRPCResponseGasAndPaymaster, chainID int64, entryPointAddr common.Address, sender common.Address, nonce uint64) (dataToSign []byte, uo UserOperation, err error)
// adds signature to UserOperation and creates final JSONRPCRequest that can be sent with 'SendRequest'
CreateRequestStep2(alchemyRequestId int, signedByUserData []byte, uo UserOperation, entryPointAddr common.Address) ([]byte, error)
app.Component
}
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"`
}
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"`
}
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"`
}
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"`
}
Click to show internal directories.
Click to hide internal directories.