You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constparams=newContractFunctionParameters();params.addAddress(demoToken1.toSolidityAddress());//address tokenparams.addUint256(liquidityAmountDemo1Tiny);//uint amountTokenDesiredparams.addUint256(liquidityAmountDemo1Tiny);//uint amountTokenMinparams.addUint256(liquidityAmountHbar.toTinybars());//uint amountETHMinparams.addAddress(client.operatorAccountId!.toSolidityAddress());//address toparams.addUint256(Math.floor(Date.now()/1000)+20);//uint deadline - 20s from now
uint amountETHMin expects the amount in tinyhbar. So naturally I tried with liquidityAmountHbar.toTinybars() but I got an error: 'Argument of type 'Long' is not assignable to parameter of type 'number | BigNumber'.
So naturally what I did was changed liquidityAmountHbar.toBigNumber() to resolve the error. I also thought toBigNumber() would give me a tinybar in terms of BigNumber but that wasn't the case. It was hbar expressed as a BigNumber()
To avoid the mistake of using toBigNumber() in this context, which would have given incorrect results, for future developers, please add Long support for ContractFunctionParameters parameters such as params.addUint256 so developers can use Hbar.toTinybars()
Steps to reproduce
N/A
Additional context
No response
Hedera network
testnet
Version
2.35.0
Operating system
None
The text was updated successfully, but these errors were encountered:
Description
I have this code:
uint amountETHMin expects the amount in tinyhbar. So naturally I tried with
liquidityAmountHbar.toTinybars()
but I got an error: 'Argument of type 'Long' is not assignable to parameter of type 'number | BigNumber'.So naturally what I did was changed liquidityAmountHbar.toBigNumber() to resolve the error. I also thought toBigNumber() would give me a tinybar in terms of BigNumber but that wasn't the case. It was hbar expressed as a BigNumber()
From Hbar.js
To avoid the mistake of using toBigNumber() in this context, which would have given incorrect results, for future developers, please add Long support for ContractFunctionParameters parameters such as params.addUint256 so developers can use
Hbar.toTinybars()
Steps to reproduce
N/A
Additional context
No response
Hedera network
testnet
Version
2.35.0
Operating system
None
The text was updated successfully, but these errors were encountered: