fromRaw static method
Implementation
static (TxOutput, int) fromRaw(
{required String raw, required int cursor, bool hasSegwit = false}) {
final txoutputraw = hexToBytes(raw);
int value = ByteData.sublistView(txoutputraw, cursor, cursor + 8)
.getInt64(0, Endian.little);
cursor += 8;
final vi = viToInt(txoutputraw.sublist(cursor, cursor + 9));
cursor += vi.$2;
Uint8List lockScript = txoutputraw.sublist(cursor, cursor + vi.$1);
cursor += vi.$1;
return (
TxOutput(
amount: BigInt.from(value),
scriptPubKey: Script.fromRaw(
hexData: bytesToHex(lockScript), hasSegwit: hasSegwit)),
cursor
);
}