compactToBn function
Implementation
BigInt compactToBn(Map<String, dynamic> value) {
var toBnTrue = value.containsKey("toBn") && isFunction(value['toBn']);
var toBigIntTrue =
value.containsKey("toBigInt") && isFunction(value['toBigInt']);
if (toBnTrue && !toBigIntTrue) {
return (value["toBn"] as Function).call();
}
if (!toBnTrue && toBigIntTrue) {
return (value["toBigInt"] as Function).call();
}
throw "toBn or toBigInt function not found";
}