Documentation
¶
Index ¶
- func GetAddress(publicKey *btcec.PublicKey) string
- func GetAddressByPublicKey(pubKey string) (string, error)
- func GetAddressHash(address string) ([]byte, error)
- func GetNetWork() []byte
- func NewTRC20TokenTransfer(fromAddress string, toAddress string, contractAddress string, amount *big.Int, ...) (string, error)
- func NewTransfer(fromAddress string, toAddress string, amount int64, refBlockBytes string, ...) (string, error)
- func ParseTxStr(txStr string) (pb.Transaction, error)
- func Sign(data string, privateKey *btcec.PrivateKey) (string, error)
- func SignEnd(txStr string, txSignStr string) (string, error)
- func SignStart(txStr string) (string, error)
- func ValidateAddress(address string) bool
- type Transaction
- type TronTokenTransaction
- type TronTransaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddress ¶
func GetAddress(publicKey *btcec.PublicKey) string
func GetAddressByPublicKey ¶
func GetAddressHash ¶
func GetNetWork ¶
func GetNetWork() []byte
func NewTRC20TokenTransfer ¶
func NewTRC20TokenTransfer(fromAddress string, toAddress string, contractAddress string, amount *big.Int, feeLimit int64, refBlockBytes string, refBlockHash string, expiration int64, timestamp int64) (string, error)
create a TRC20 transfer transaction
func NewTransfer ¶
func NewTransfer(fromAddress string, toAddress string, amount int64, refBlockBytes string, refBlockHash string, expiration int64, timestamp int64) (string, error)
create a TRC transfer transaction refBlockBytes - transaction reference block height (take 6-7 2 bytes) refBlockHash - block hash referenced by the transaction (take 8-15 8 bytes) expiration - transaction expiration time, beyond this time the transaction will not be packed timestamp - transaction creation time fee_limit - the maximum energy consumption of smart contract transactions, only need to be set when deploying or calling smart contracts
func ParseTxStr ¶
func ParseTxStr(txStr string) (pb.Transaction, error)
func ValidateAddress ¶
Types ¶
type Transaction ¶
type TronTokenTransaction ¶
type TronTokenTransaction struct { TronTransaction AssetName string `json:"asset"` ContractAddress string `json:"contractAddress"` FeeLimit int64 `json:"feelimit"` Trc string `json:"trc"` }
Click to show internal directories.
Click to hide internal directories.