cmd

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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 Check

func Check(address string, rpcURL string, debug bool) error

Check performs the check command

func Clear

func Clear(rpcURL string, gasLimit uint64) error

Clear performs the clear command

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.

func Set added in v0.0.3

func Set(contractAddress string, rpcURL string, gasLimit uint64) error

Set performs the set command to authorize a specific contract address

Types

type CallTuple

type CallTuple struct {
	To    common.Address
	Value *big.Int
	Data  []byte
}

CallTuple defines the parameters for each batched asset collection call.

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

Jump to

Keyboard shortcuts

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