tron

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 5 Imported by: 0

README

TRON API implementation written in Go

Demo

github.com/jnsand/go-tron-demo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressableSigner

type AddressableSigner interface {
	Address() address.Address
	Signer
}

type Block

type Block struct {
	Id           string        `json:"blockId"`
	BlockHeader  BlockHeader   `json:"block_header"`
	Transactions []Transaction `json:"transactions"`
}

type BlockHeader

type BlockHeader struct {
	RawData struct {
		Number              uint64 `json:"number"`
		TransactionTrieRoot string `json:"txTrieRoot"`
		WitnessAddress      string `json:"witness_address"`
		ParentHash          string `json:"parentHash"`
		Version             uint64 `json:"version"`
		Timestamp           uint64 `json:"timestamp"`
	} `json:"raw_data"`
	WitnessSignature string `json:"witness_signature"`
}

type Signable

type Signable interface {
	Sign(key *ecdsa.PrivateKey) error
}

Signable is an interface for implementations of signable objects. Implementations may choose if it accepts one or many signatures.

type Signer

type Signer interface {
	Sign(signable Signable) error
}

Signer is an interface for implementations of objects that append signatures to signable objects.

type Transaction

type Transaction struct {
	Id              string           `json:"txID"`
	Signatures      []string         `json:"signature"`
	Results         *json.RawMessage `json:"ret"`
	ConstantResults *json.RawMessage `json:"constant_result"`
	Visible         *json.RawMessage `json:"visible"`
	RawData         *json.RawMessage `json:"raw_data"`
	RawDataHex      *json.RawMessage `json:"raw_data_hex"`
	ContractAddress *json.RawMessage `json:"contract_address"`
}

func (*Transaction) Sign

func (tx *Transaction) Sign(key *ecdsa.PrivateKey) error

Directories

Path Synopsis
Package account provides functionality for managing Tron network accounts.
Package account provides functionality for managing Tron network accounts.
Package address provides functionality for parsing and manipulating Tron addresses.
Package address provides functionality for parsing and manipulating Tron addresses.
Package client provides functionality for interacting with the Tron node RESTful APIs.
Package client provides functionality for interacting with the Tron node RESTful APIs.

Jump to

Keyboard shortcuts

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