convertTransactionArgument function
dynamic
convertTransactionArgument(
- dynamic arg,
- dynamic inputs
Implementation
dynamic convertTransactionArgument(dynamic arg, dynamic inputs) {
if (arg["\$kind"] == 'GasCoin' || arg["GasCoin"] != null) {
return { "kind": 'GasCoin' };
}
if (arg["\$kind"] == 'Result' || arg["Result"] != null) {
return { "kind": 'Result', "index": arg["Result"] };
}
if (arg["\$kind"] == 'NestedResult' || arg["NestedResult"] != null) {
return { "kind": 'NestedResult', "index": arg["NestedResult"][0], "resultIndex": arg["NestedResult"][1] };
}
if (arg["\$kind"] == 'Input' || arg["Input"] != null) {
return inputs[arg["Input"]];
}
throw ArgumentError("Invalid argument $arg");
}