Documentation
¶
Index ¶
- Constants
- Variables
- func Check(address string, rpcURL string, debug bool) error
- func Clear(rpcURL string, gasLimit uint64) error
- func GenerateSet7702AuthTx(req SetAuthorizationRequest) (string, error)
- func Set(contractAddress string, rpcURL string, gasLimit uint64) error
- type CallTuple
- type RPCRequest
- type RPCResponse
- type SetAuthorizationRequest
- type TransactionReceipt
Constants ¶
View Source
const ( SET_CODE_TX_TYPE = 0x04 MAGIC = 0x05 )
EIP-7702 constants
View Source
const DefaultRPCURL = "https://ethereum-rpc.publicnode.com"
DefaultRPCURL is the default RPC URL if not specified
Variables ¶
View Source
var Version = "dev"
Version holds the current version of the application This will be set at build time via LDFLAGS in the Makefile
Functions ¶
func GenerateSet7702AuthTx ¶
func GenerateSet7702AuthTx(req SetAuthorizationRequest) (string, error)
GenerateSet7702AuthTx generates an EIP-7702 authorization transaction. Returns a hex string of the signed transaction ready for broadcast.
Types ¶
type RPCRequest ¶
type RPCRequest struct {
JSONRPC string `json:"jsonrpc"`
Method string `json:"method"`
Params []interface{} `json:"params"`
ID int `json:"id"`
}
RPCRequest represents a JSON-RPC request
type RPCResponse ¶
type RPCResponse struct {
JSONRPC string `json:"jsonrpc"`
ID int `json:"id"`
Result string `json:"result"`
Error interface{} `json:"error,omitempty"`
}
RPCResponse represents a JSON-RPC response
type SetAuthorizationRequest ¶
type SetAuthorizationRequest struct {
UserEOAPrivateKey *ecdsa.PrivateKey
UserEOANonce uint64
RelayerEOAPrivateKey *ecdsa.PrivateKey
RelayerNonce uint64
TemplateAddress common.Address
ChainId *big.Int
GasTip *big.Int // Optional, will use suggestion if nil
GasFeeCap *big.Int // Optional, will use suggestion if nil
GasLimit uint64 // Optional, will use suggestion if 0
}
SetAuthorizationRequest holds the request parameters for EIP-7702 authorization.
type TransactionReceipt ¶
type TransactionReceipt struct {
TransactionHash string `json:"transactionHash"`
TransactionIndex string `json:"transactionIndex"`
BlockHash string `json:"blockHash"`
BlockNumber string `json:"blockNumber"`
Status string `json:"status"`
GasUsed string `json:"gasUsed"`
CumulativeGasUsed string `json:"cumulativeGasUsed"`
}
TransactionReceipt represents the structure of an Ethereum transaction receipt
Click to show internal directories.
Click to hide internal directories.