tron

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SignatureTransferMethod = "a9059cbb"

SignatureTransferMethod is the TRC20 transfer(address,uint256) method selector.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockData

type BlockData struct {
	Number         uint64 `json:"number"`
	TxTrieRoot     string `json:"txTrieRoot"`
	WitnessAddress string `json:"witness_address"`
	ParentHash     string `json:"parentHash"`
	Version        int    `json:"version"`
	Timestamp      int64  `json:"timestamp"`
}

types

type Handler

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

func NewHandler

func NewHandler(rpcUrl 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) GetAddressFee

func (h *Handler) GetAddressFee(ctx context.Context, address string) (wallettron.FreeGas, 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 {
	BlockId     string `json:"blockID"`
	Txs         []Tx   `json:"transactions"`
	BlockHeader struct {
		Data BlockData `json:"raw_data"`
	} `json:"block_header"`
}

types

type Tx

type Tx struct {
	Ret       []_TxRet `json:"ret,omitempty"`
	Signature []string `json:"signature,omitempty"`
	ID        string   `json:"txID,omitempty"`
	BlockTime int64    `json:"block_timestamp,omitempty"`
	Data      _TxData  `json:"raw_data,omitempty"`
	Visible   bool     `json:"visible,omitempty"`
}

types

Jump to

Keyboard shortcuts

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