Fetch a Sui object with JSON-decoded contents.
This is the most common way to fetch object data when you need to read the object's fields as JavaScript objects.
The Sui object address
Promise resolving to object with JSON contents
const result = await getObjectWithJson("0x123...");const json = result.data?.object?.asMoveObject?.contents?.json;console.log(json); // { id: "...", name: "...", ... } Copy
const result = await getObjectWithJson("0x123...");const json = result.data?.object?.asMoveObject?.contents?.json;console.log(json); // { id: "...", name: "...", ... }
Fetch a Sui object with JSON-decoded contents.
This is the most common way to fetch object data when you need to read the object's fields as JavaScript objects.