i have nestjs typescript Apps in which connecting with tronweb and try to calculate estimated Gas.
const estimatedEnergy = await tronWeb.transactionBuilder.estimateEnergy(
USDTContractAddress,
'balanceOf(address)',
null,
abi,
address,
);
this is my function but this error was returned:
[Nest] 26120 - 26/03/2024, 4:23:09 pm ERROR [ExceptionsHandler] Cannot set properties of null (setting 'estimateEnergy')
TypeError: Cannot set properties of null (setting 'estimateEnergy')
at e.value (C:\app\node_modules\tronweb\dist\webpack:\tronweb\src\lib\transactionBuilder.js:1277:19)
enter code here
at Object.getEstimateGasFee (C:\app\src\tronweb\index.ts:108:62)
at estimateGasFee (C:\app\src\controller.ts:48:41)
at C:\app\node_modules\@nestjs\core\router\router-execution-context.js:38:29
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at C:\app\node_modules\@nestjs\core\router\router-execution-context.js:46:28
at C:\app\node_modules\@nestjs\core\router\router-proxy.js:9:17
how do i overcome this issues? i've make sure the versions also the latest