fromJson static method
Implementation
static Transaction fromJson(Map<String, dynamic> jsonTransaction) {
try {
int txType = jsonTransaction['type'];
switch (txType) {
case 0:
return TransactionScript.fromJson(jsonTransaction);
case 1:
return TransactionCreate.fromJson(jsonTransaction);
case 2:
return TransactionMint.fromJson(jsonTransaction);
default:
return UnknownTransaction(raw: jsonTransaction);
}
} catch (e) {
return UnparsedTransaction(raw: jsonTransaction, err: e);
}
}