V2 is all about simplicity! I'm revamping the package to be as easy to use as possible.
Avaiable functions related to private key
GeneratePrivateKey() (*ecdsa.PrivateKey, error)
PrivateKeyToHex(privateKey *ecdsa.PrivateKey) string
PrivateKeyToBytes(privateKey *ecdsa.PrivateKey) []byte
PrivateKeyFromHex(privateKeyHex string) (*ecdsa.PrivateKey, error)
PrivateKeyFromBytes(privateKeyBytes []byte) (*ecdsa.PrivateKey, error)
PrivateKeyToPublicKey(privateKey *ecdsa.PrivateKey) (*ecdsa.PublicKey, error)
Avaiable functions related to address
PublicKeyToAddressHex(publicKey *ecdsa.PublicKey) string
PublicKeyToAddressBase58(publicKey *ecdsa.PublicKey) string
Avaiable functions related to transaction
you can create any transaction from github.com/fbsobreira
and sign and broadcast it using SignTransaction
and BroadcastTransaction
CreateTransferTransaction(client *client.GrpcClient, from, to string, amount *big.Int) (*api.TransactionExtention, error)
CreateTRC20TransferTransaction(client *client.GrpcClient, from, to, contract string, amount *big.Int, feeLimit int64) (*api.TransactionExtention, error)
CreateFreezTransaction(client *client.GrpcClient, address string, resource core.ResourceCode, amount *big.Int) (*api.TransactionExtention, error)
CreateUnfreezeTransaction(client *client.GrpcClient, address string, resource core.ResourceCode, amount *big.Int) (*api.TransactionExtention, error)
SignTransaction(transaction *api.TransactionExtention, privateKey *ecdsa.PrivateKey) (*api.TransactionExtention, error)
BroadcastTransaction(client *client.GrpcClient, transaction *api.TransactionExtention) (*api.Return, error)
-
estimating trc20 and trc10 fee
-
contract api calls, deploy, get name, decimals and ...
-
block and transaction crawl calls
-
delegate resource transaction
-
writing test
Follow TronTestnet Twitter account @TronTest2 . Write your address in your tweet and @TronTest2 . They will transfer 10,000 test TRX (usually within five minutes). Each address can only be obtained once a day. If you need TRX for the nile testnet, please add "NILE" in your tweet.
Go to https://developers.tron.network/ and connect to the discord community. You can than ask for usdt in #faucet channel. Just type !shasta_usdt YOUR_WALLET_ADDRESS and send. TronFAQ bot will send you 5000 USDT (SASHTA) soon.
I simplified this repository https://github.com/fbsobreira repository to create this package You can check go tron sdk for better examples and functionalities.
Address TUE66D1BT79FQcJE7fwf5vdfu3BYM4ph9Y