Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some errors with getAllUserNFTs func on localhost #53

Open
progforyou opened this issue Jan 13, 2022 · 2 comments
Open

Some errors with getAllUserNFTs func on localhost #53

progforyou opened this issue Jan 13, 2022 · 2 comments

Comments

@progforyou
Copy link

progforyou commented Jan 13, 2022

Hello, dab 0.4.4 has some errors with getAllUserNFTs func. In your file nfts_refistry.js this principal not work with plug principal. But if call with string, it work with errors.
const userPrincipal = user instanceof principal_1.Principal ? user : principal_1.Principal.fromText(user);
50 errors stack

please, help with this problem

const result = await window.ic.plug.getPrincipal();
const collections = await getAllUserNFTs(
            {user: principal.toString()}
        );

"@psychedelic/dab-js": "^0.4.4",
p.s. with stoic same error

but func getUserNFTs work only with plug, with stoic error

StoicIdentity.load().then(async identity => {
            if (identity !== false) {
                //ID is a already connected wallet!
            } else {
                //No existing connection, lets make one!
                identity = await StoicIdentity.connect();
            }

            //Lets display the connected principal!
            console.log(identity.getPrincipal().toText());
            console.log(identity);
            const standard = 'EXT';

            const agent = new HttpAgent({
                identity
            });
            console.log(agent);
            const NFTActor = getNFTActor({canisterId: canisterId, agent: agent, standard: standard});
            const collections = await NFTActor.getUserTokens(identity.getPrincipal());
            console.log(collections);
            //Disconnect after
            StoicIdentity.disconnect();
        })

error stoic

@alejo-acevedo-deel
Copy link
Contributor

Hey @progforyou thanks for bring this to our attention. We really appreciate the time you take for this.

About the principal, we recommend u all use text because there is some breaking changes in the last Principal library published by dfinity and we cannot update it right now without break other things.

About the other errors, those errors are from the canister, except for the DIP721 error which is fixed in the next release. For example, No Token errors is the way that EXT collections say to us that the principal doesn't have any NFT of that collection. It is not the best way but we cannot do anything

About last error, probably the problem here is again the version of agent u are using, please use version 0.9.3 of any dfinity library. It works with plug because Plug use that version of library and u use agent provided by us.

Thanks again.

@arkanine1000
Copy link

@aleacevedo I'm having the same issue, even when using version 0.9.3 of all dfinity libraries. Code is pretty much identical to progforyou's. Plug works fine as well. Any advice?
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants