How to add any data to metadata nft?

Hi all, I am writing a contract for a Sway hackathon, can you tell me how to add any data to metadata nft. I found the metadata in the rep
, but the documentation there is not enough for me.

This is roughly how I see using this in my contract, but I don’t understand how to do the set_metadata and get_metadata functions

struct MyMetadata{
  num: u64
mint(1, buyer);
set_metadata(MyMetadata{num: 1})

let metadata = get_metadata(nft_id);
assert(metadata.num == 1);

Hey @PaulZhemanov it looks almost correct you just need to add the token_id to the function if you are importing the sway-libs metadata function