8000 GitHub - ranjbar-dev/tron-wallet: Tron wallet package for generating Tron wallet, transferring TRX and Tron Tokens, fetching wallet balance live and crawling blockchain blocks to extract wallet transactions
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tron wallet package for generating Tron wallet, transferring TRX and Tron Tokens, fetching wallet balance live and crawling blockchain blocks to extract wallet transactions

Notifications You must be signed in to change notification settings

ranjbar-dev/tron-wallet

Repository files navigation

Tron wallet v2

image

V2 is all about simplicity! I'm revamping the package to be as easy to use as possible.

private_key.go

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)

address.go

Avaiable functions related to address


PublicKeyToAddressHex(publicKey *ecdsa.PublicKey) string

PublicKeyToAddressBase58(publicKey *ecdsa.PublicKey) string

transaction.go

Avaiable functions related to transaction

you can create any transaction from github.com/fbsobreira/gotron-sdk 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)

Fee explanation

  • TRX transfer: if account has enough bandwidth to covert trasaction fee it is free( 5000 points ), if not it will cost 0.1 TRX.

  • TRC20 transfer: consume Energy and Bandwidth, if insufficient, TRX is burned as fee.

Fee ≈ Energy Used × Energy Unit Price (in TRX)

Example

check test files for examples and usage of this package

TRX Faucet

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.

TRC20 Faucet

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.

Important

I simplified this repository https://github.com/fbsobreira repository to create this package You can check go tron sdk for better examples and functionalities.

TODOS

  • estimating trc20 and trc10 fee

  • contract api calls, deploy, get name, decimals and ...

  • block and transaction crawl calls

  • delegate resource transaction

Donation

Address TUE66D1BT79FQcJE7fwf5vdfu3BYM4ph9Y

About

Tron wallet package for generating Tron wallet, transferring TRX and Tron Tokens, fetching wallet balance live and crawling blockchain blocks to extract wallet transactions

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages

0