tron

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BalanceFuncSelector string = "70a08231"
)

Variables

View Source
var (
	Contracts = map[string]ContractInfo{
		"usdt": {
			Address: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
			Fee:     decimal.NewFromInt(28),
		},
	}
)

Functions

func FromMnemonicSeedAndPassphrase

func FromMnemonicSeedAndPassphrase(mnemonic, passphrase string, index int) (*btcec.PrivateKey, *btcec.PublicKey)

func New

func New(fullNodeUrl, solidityNodeURL string) *trc20

Types

type ContractInfo

type ContractInfo struct {
	Address string
	Fee     decimal.Decimal
}

type RawData

type RawData struct {
	Contract []struct {
		Parameter struct {
			Value struct {
				Data            string `json:"data"`
				Amount          int    `json:"amount"`
				OwnerAddress    string `json:"owner_address"`
				ContractAddress string `json:"contract_address"`
				ToAddress       string `json:"to_address"`
			} `json:"value"`
			TypeURL string `json:"type_url"`
		} `json:"parameter"`
		Type string `json:"type"`
	} `json:"contract"`
	RefBlockBytes string `json:"ref_block_bytes"`
	RefBlockHash  string `json:"ref_block_hash"`
	Expiration    int64  `json:"expiration"`
	Timestamp     int64  `json:"timestamp"`
	FeeLimit      int64  `json:"fee_limit"`
}

type RawTransaction

type RawTransaction struct {
	Visible    bool    `json:"visible"`
	TxID       string  `json:"txID"`
	RawData    RawData `json:"raw_data"`
	RawDataHex string  `json:"raw_data_hex"`
}

type SignedTransaction

type SignedTransaction struct {
	Visible    bool     `json:"visible"`
	TxID       string   `json:"txID"`
	RawData    string   `json:"raw_data"`
	RawDataHex string   `json:"raw_data_hex"`
	Signature  []string `json:"signature,omitempty"`
}

Jump to

Keyboard shortcuts

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