metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

LoadNft() error #173

Closed arthurbolsoni closed 2 years ago

arthurbolsoni commented 2 years ago

hi, i'm trying use the new method LoadNft() and have getting a error in toOriginalOrPrintEditionAccount.

await mx.nfts().loadNft(nftLazy, {commitment: "finalized"}); image

i'm did try rewrite me method and the error come from toOriginalOrPrintEditionAccount(), later it i lost me on the code.

Using: reactjs

blockiosaurus commented 2 years ago

I believe this is an error in the index passed in here https://github.com/metaplex-foundation/js/blob/52e698df76518113dce9e3155ae6b7b5239db484/packages/js/src/plugins/nftModule/loadNft.ts#L44 The accounts are constructed as an array of 2 but the index of 2 is being used to retrieve the edition account. Changing this to an index of 1 locally at least prevents a failure, but I haven't checked the edition info for accuracy.

lorisleiva commented 2 years ago

Well, that's embarrassing. I promise I know how to count. 😅

I'll fix this asap.

lorisleiva commented 2 years ago

Fixed and published as 0.12.5. 🚀