isInstantWithdrawalAllowed function
Implementation
Future<bool?> isInstantWithdrawalAllowed(double amount, Token token) async {
final hermezContract = await ContractParser.fromAssets(
'HermezABI.json',
getCurrentEnvironment()!.contracts[ContractName.hermez]!,
ContractName.hermez);
final instantWithdrawalCall = await HermezSDK.currentWeb3Client!.call(
contract: hermezContract,
function: _instantWithdrawalViewer(hermezContract),
params: [
EthereumAddress.fromHex(token.ethereumAddress!),
BigInt.from(amount),
]);
final allowed = instantWithdrawalCall.first as bool?;
return allowed;
}