Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Some errors with getAllUserNFTs func on localhost #53

Description

@progforyou

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions