parseRustTransaction function
Transaction
parseRustTransaction(
- Transaction rustTransaction
)
Implementation
Transaction parseRustTransaction(fuels.Transaction rustTransaction) {
final inputs = rustTransaction.inputs.map(parseRustInput).toList();
final outputs = rustTransaction.outputs.map(parseRustOutput).toList();
final witnesses = rustTransaction.witnesses.map(parseRustWitness).toList();
switch (rustTransaction.txType) {
case 0:
return TransactionScript(
inputs: inputs,
outputs: outputs,
witnesses: witnesses,
);
case 1:
return TransactionCreate(
inputs: inputs,
outputs: outputs,
witnesses: witnesses,
);
case 2:
return TransactionMint(
outputs: outputs,
);
default:
return UnknownTransaction(raw: Map.identity());
}
}