ebellocchia/py_crypto_hd_wallet

Tether USDT suppot

sech444 opened this issue · 6 comments

Will there be Tether(usdt) support?

Hi,
USDT is a token, so it's already supported. You just have to generate a wallet of the proper blockchain (e.g. Ethereum, BSC, AVAX, ...).

Emanuele

Hi,
Thanks for your time and the reply, please I have try and it was giving me some error but I dont what Im doing wrong, can you please help me with some example

There are multiple examples in the readme, what problem do you have?

Create factory

hd_wallet_fact = HdWalletBipFactory(HdWalletBip44Coins.USDT)
# Create random
hd_wallet = hd_wallet_fact.CreateRandom('wallet_name',   HdWalletSubstrateWordsNum.WORDS_NUM_12,)

Generate with default parameters
hd_wallet.Generate(addr_num=1)
# Specify parameters (it'll generate addresses from index 10 to 15)
#hd_wallet.Generate()
wallet_data = hd_wallet.ToJson()
print(wallet_data)
# After generated, you can check if the wallet is watch-only with the IsWatchOnly method
is_wo = hd_wallet.IsWatchOnly()

then i get this error

hd_wallet_fact = HdWalletBipFactory(HdWalletBip44Coins.USDT)
File "/usr/lib/python3.9/enum.py", line 405, in getattr
raise AttributeError(name) from None
AttributeError: USDT

Hi,
as I wrote you, USDT is not a coin so you cannot use it as a coin. USDT is a token, so you shall use the coin of the blockchain on which you are using it.
For example:

  • if you are using USDT ERC20, you shall use Ethereum: HdWalletBip44Coins.ETHEREUM
  • if you are using USDT BEP20, you shall use Binance Smart Chain: HdWalletBip44Coins.BINANCE_SMART_CHAIN

And so on.
I hope it's clearer.

Emanuele

Hi,
Thanks for your time and the reply. Thanks is very clearer now.