how to create Tether wallet on Tron network (TRC20) and Binance network (bep20) in flutter?

98 Views Asked by At

I want to create Tether on the wallet in the form of TRC20 and BEP20.

I didn't find any dependencies for this in Flutter and I didn't find a suitable solution either.

I want to be able to import my wallet from other wallets.

Also, I want to transfer my usdts.

I read in some issues that we need to have a contract. How should we find or create the required contract?

1

There are 1 best solutions below

0
Asad ur Rehman Khan On

while you are having issue regarding the TRC20 token I can guide you in this regard.

To create the TRC20 Wallet you can use the following package

https://pub.dev/packages/wallet

Code to wallet creation is

String phrase = "glad rear ridge tear pyramid ignore brick flag daring cliff upgrade shed";
var seed =  bip39.mnemonicToSeed(phrase);
final master = wallet.ExtendedPrivateKey.master(seed, wallet.xprv);
final root = master.forPath("m/44'/195'/0'/0/0");

final privateKey = wallet.PrivateKey((root as wallet.ExtendedPrivateKey).key);
final publicKey = wallet.tron.createPublicKey(privateKey);
final address = wallet.tron.createAddress(publicKey);

Now for transactions, unlike ERC20 you can not use web3Dart package instead you have to use tron web for this purpose you have to go through

https://developers.tron.network/docs/tronweb-1

https://pub.dev/packages/tron