I am trying to decode the metadata account data for an NFT in a react app. The metaplex SDK makes use of the connection object, which is fine for public nodes, but my front end connects to my quicknode end point via a backend so that the actual address of the endpoint is hidden from users.
Is there any way to access the metaplex account data via a curl/get request directly, or alternatively, does anyone know how to decode the metadata using borsh directly following a simple getAccountData request?
My attempt at using getAccountInfo using the following approach has so far failed with the error Error: Expected buffer length 73237764 isn't within bounds
const creator_scheme = new Map([
[NFT_Creator, { kind: 'struct',
fields: [
["address", [32]],
["verified", "u8"],
["share", "u8"],
],
}]
]);
const collection_scheme = new Map([
[NFT_Collection, { kind: 'struct',
fields: [
["verified", "u8"],
["key", [32]]
],
}]
]);
const uses_scheme = new Map([
[NFT_Uses, { kind: 'struct',
fields: [
["use_method", "u8"],
["remaining", "u64"],
["total", "u64"],
],
}]
]);
const metadata_scheme = new Map([
[NFT_MetaData, { kind: 'struct',
fields: [
["name", "string"],
["symbol", "string"],
["uri", "string"],
["sellerFeeBasisPoints", "u16"],
["creators", { kind: "option", type: [creator_scheme] }],
["collection", { kind: "option", type: [collection_scheme] }],
["uses", { kind: "option", type: [uses_scheme] }],
],
}]
]);
Many Thanks