Metadata.fromBinary constructor

Metadata.fromBinary(
  1. List<int> sourceBytes
)

Implementation

factory Metadata.fromBinary(List<int> sourceBytes) {
  final bytes = Int8List.fromList(sourceBytes);
  final reader = _StructReader(bytes.buffer)..skip(1);
  final updateAuthority = base58encode(reader.nextBytes(32));
  final mint = base58encode(reader.nextBytes(32));

  final name = reader.nextString();
  final symbol = reader.nextString();
  final uri = reader.nextString();

  return Metadata(
    name: name,
    symbol: symbol,
    uri: uri,
    updateAuthority: updateAuthority,
    mint: mint,
  );
}