encode method
encode MetadataV2Body
to bytes
Implementation
List<int> encode() {
assert(body != null, 'Error: the body cant be empty.');
if (body is MetadataV2_3Wrapper) {
return _encodeMetadataV2_3(body as MetadataV2_3Wrapper);
} else if (body is MetadataV2_4Wrapper) {
return _encodeMetadataV2_4(body as MetadataV2_4Wrapper);
}
return [];
}