trx

package
v0.0.0-...-96919c3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAddress

func DecodeAddress(addr string) ([]byte, error)

func DeployContract

func DeployContract(w *wallet.TrxWallet, client *client.GrpcClient, contractName string,
	jsonAbi string, bytecode string,
	feeLimit, consumeUserResourcePercent, originEnergyLimit int64) (string, error)

func EncodeAddress

func EncodeAddress(a []byte) string

func FreezeBandwidthBalance

func FreezeBandwidthBalance(w *wallet.TrxWallet, client *client.GrpcClient, delegateTo string, frozenBalance int64) (string, error)

func FreezeEnergyBalance

func FreezeEnergyBalance(w *wallet.TrxWallet, client *client.GrpcClient, delegateTo string, frozenBalance int64) (string, error)

func GetContractAddress

func GetContractAddress(client *client.GrpcClient, txId string) (string, error)

func SignAndSendTx

func SignAndSendTx(w *wallet.TrxWallet, client *client.GrpcClient, txExt *api.TransactionExtention) (string, error)

func SunToTrx

func SunToTrx(v int64) float64

func TransferTrx

func TransferTrx(w *wallet.TrxWallet, client *client.GrpcClient, toAddr string, amount int64) (string, error)

func TrxToSun

func TrxToSun(v float64) int64

func UnfreezeBandwidthBalance

func UnfreezeBandwidthBalance(w *wallet.TrxWallet, client *client.GrpcClient, delegateTo string) (string, error)

func UnfreezeEnergyBalance

func UnfreezeEnergyBalance(w *wallet.TrxWallet, client *client.GrpcClient, delegateTo string) (string, error)

Types

type Trc20Contract

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

func NewErc20Contract

func NewErc20Contract(address string, client *client.GrpcClient) *Trc20Contract

func (*Trc20Contract) BalanceOf

func (this *Trc20Contract) BalanceOf(tokenOwner string) (*big.Int, error)

func (*Trc20Contract) Decimals

func (this *Trc20Contract) Decimals() (int, error)

func (*Trc20Contract) Name

func (this *Trc20Contract) Name() (string, error)

func (*Trc20Contract) Symbol

func (this *Trc20Contract) Symbol() (string, error)

func (*Trc20Contract) Transfer

func (this *Trc20Contract) Transfer(w *wallet.TrxWallet, toAddr string, amount *big.Int, feeLimit int64) (string, error)

type TrxClient

type TrxClient struct {
	RpcClient *client.GrpcClient
}

func NewTrxClient

func NewTrxClient(grpcHost string, apiKey string) (*TrxClient, error)

func (*TrxClient) GetBlockHeight

func (this *TrxClient) GetBlockHeight() (int64, error)

type TrxTransaction

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

func NewTransaction

func NewTransaction(txExt *api.TransactionExtention) (*TrxTransaction, error)

func (*TrxTransaction) Send

func (this *TrxTransaction) Send(client *client.GrpcClient) (string, error)

func (*TrxTransaction) Sign

func (this *TrxTransaction) Sign(w *wallet.TrxWallet) error

func (*TrxTransaction) TxHash

func (this *TrxTransaction) TxHash() ([]byte, error)

Jump to

Keyboard shortcuts

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