getTronWeb
Retrieves a TronWeb instance from a wallet account, allowing you to interact with the Tron blockchain using the full TronWeb API.Usage
Parameters
| Parameter | Type | Description |
|---|---|---|
walletAccount | TronWalletAccount | The wallet account to get the TronWeb instance for |
client | DynamicClient (optional) | The Dynamic client instance. Only required when using multiple clients. |
Returns
Promise<TronWeb> - A promise that resolves to a TronWeb instance from the tronweb package.
Errors
| Error | Description |
|---|---|
NotTronProviderError | Thrown if the wallet account’s provider is not a Tron provider |
Related functions
- isTronWalletAccount - Check if a wallet account is a Tron account
- sendTransaction - Send a Tron transaction