evm

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERC20TransferEvent      = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
	SignatureTransferMethod = "a9059cbb"
	SignatureBalanceOf      = "70a08231"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(rpcUrl string, network string) (*Handler, error)

func (*Handler) CallContract

func (h *Handler) CallContract(ctx context.Context, contractAddress, params, blockNumber string) ([]byte, error)

func (*Handler) CheckTx

func (h *Handler) CheckTx(ctx context.Context, hash string) (*chainrpc.TxResult, error)

func (*Handler) GetBalance

func (h *Handler) GetBalance(ctx context.Context, address, contractAddress, blockNumber string) (string, error)

func (*Handler) GetHeight

func (h *Handler) GetHeight(ctx context.Context) (string, error)

func (*Handler) GetTransfersByHash

func (h *Handler) GetTransfersByHash(ctx context.Context, hash string, confirmation uint64,
	withInternal bool) (*chainrpc.TxTransfers, error)

func (*Handler) InquireChain

func (h *Handler) InquireChain(ctx context.Context, instruction, params string) (string, error)

func (*Handler) SendTx

func (h *Handler) SendTx(ctx context.Context, signedHex string) (string, error)

type RpcBlock

type RpcBlock struct {
	RpcBlockHeader `json:"blockHeader"`
	RpcBlockBody   `json:"blockBody"`
}

type RpcBlockBody

type RpcBlockBody struct {
	Transactions []RpcTransaction `json:"transactions"`
}

type RpcBlockHeader

type RpcBlockHeader struct {
	Hash       string `json:"hash"`
	ParentHash string `json:"parentHash"`
	Difficulty string `json:"difficulty"`
	Number     string `json:"number"`
	Time       string `json:"timestamp"`
	Size       string `json:"size"`
	Nonce      string `json:"nonce"`
	Miner      string `json:"miner"`
}

type RpcInternalTx

type RpcInternalTx struct {
	Action *struct {
		CallType string `json:"callType"`
		From     string `json:"from"`
		To       string `json:"to"`
		Value    string `json:"value"`
	} `json:"action"`
	Result *struct {
		GasUsed string `json:"gasUsed"`
		Output  string `json:"output"`
	} `json:"result"`
	Type string `json:"type"`
}

type RpcLog

type RpcLog struct {
	Address string   `json:"address"`
	Topics  []string `json:"topics"`
	Data    string   `json:"data"`
}

type RpcReceipt

type RpcReceipt struct {
	BlockNumber     string    `json:"blockNumber"`
	ContractAddress string    `json:"contractAddress"`
	GasUsed         string    `json:"gasUsed"`
	Status          string    `json:"status"`
	Logs            []*RpcLog `json:"logs"`
}

type RpcTransaction

type RpcTransaction struct {
	Hash        string `json:"hash"`
	BlockNumber string `json:"blockNumber"`
	From        string `json:"from"`
	To          string `json:"to"`
	Nonce       string `json:"nonce"`
	GasPrice    string `json:"gasPrice"`
	GasLimit    string `json:"gas"`
	Value       string `json:"value"`
	Payload     string `json:"input"`
	BlockHash   string `json:"blockHash,omitempty"`
}

Jump to

Keyboard shortcuts

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