Metadat read fail

I am trying to read metadata in TS from the NFT contract.

error:-

Screenshot from 2024-02-07 19-34-01

    const contract = await getContract();
    const metadata: MetadataInput = { String: "https://bafkreidhmmldn6o5nxyfqf65x5jz7f66qcj4xy2axv2onefkzdbv4i7yta.ipfs.w3s.link" };
    const id = { value: "0xa74dcc2789f5643a27750d6f0f2dfb2b6d5d39bb74c0911e4d8114f8d66fa2d1" };
    const res = await contract.functions.set_metadata(id, "0", metadata).txParams({ gasPrice: 100, gasLimit: 10000 }).call();
    console.log(res);
  };```

reading metadata

```const getmetadata = async () => {
    const contract = await getContract();
    const wallet = await getWallet();
    const id = { value: "0xa74dcc2789f5643a27750d6f0f2dfb2b6d5d39bb74c0911e4d8114f8d66fa2d1" };
    const res = await contract.functions.metadata(id, "0").txParams({ gasLimit: 10000 }).simulate();

    console.log(res);
  }

Hi @chappie1998, could you please share which version of the TypeScript SDK you’re currently using? Also, I’m interested in knowing the version of Sway you’re working with. Thank you!

I am on beta5 toolchain. all the SDKs and sway is latest version.

forc 0.49.1
“fuels”: “^0.73.0”,

@nedsalk, @Torres-ssf any idea about this?

@chappie1998 hey I’m looking into this. Could you share your Forc.toml file?

1 Like

If you have a repo that you could share that would be awesome too. Would allow me to reproduce this error easily and then work on a fix :slight_smile:

1 Like