Closed edgework closed 1 year ago
Hi there, this is because strings on Token Metadata are stored using a fixed amount of bytes are therefore you are likely to get null characters at the end (used as padding). The Token Metadata Umi library (available at @metaplex-foundation/mpl-token-metadata@alpha
) already abstracts this away from you but not the Solita-generated library you are using.
If you wish to continue using the Solita-generated library, you can remove these null characters using the following function:
export const removeNullCharacters = (value: string) =>
// eslint-disable-next-line no-control-regex
value.replace(/\u0000/g, '');
Using
"@metaplex-foundation/mpl-token-metadata": "^2.12.0",
returns
Notice all the \x00 in the string values. This happens for any mint value token