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 NFTActor.getUserTokens on localhost #84

Open
icpxy opened this issue May 8, 2022 · 3 comments
Open

Some errors with NFTActor.getUserTokens on localhost #84

icpxy opened this issue May 8, 2022 · 3 comments

Comments

@icpxy
Copy link

icpxy commented May 8, 2022

Hello team,

I am trying to get the pxy nfts using dabjs. I am able to get actor with the call getNFTActor. However, getUserTokens is failing with the error as pasted in the screenshot below. Is there something I am missing? Please help. Thank you for your time and contribution to the dev community :-)

    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());

        const canisterId = '46sy3-aiaaa-aaaah-qczza-cai';
        const standard = 'EXT';
        
        const agent = new HttpAgent({identity});
        console.log('agent: ' + agent);
        
        const NFTActor = getNFTActor({ canisterId, agent, standard });
        console.log('actor: ' + NFTActor);
        
        const userTokens = await NFTActor.getUserTokens(identity.getPrincipal());
        console.log('tokens: ' + userTokens);
        
       //Disconnect after
        StoicIdentity.disconnect();
      })

image

@icpxy
Copy link
Author

icpxy commented May 8, 2022

And if I specify the host-url,

        const agent = new HttpAgent({host: 'https://boundary.ic0.app', identity});

it throws new error below on the getUserTokens call...

(BLS DER-encoded public key must be 133 bytes long....)

image

@icpxy
Copy link
Author

icpxy commented May 8, 2022

I added agent.fetchRootKey().catch(console.error); but to no avail. It times out after 3 mins or 30 mins (i dont exactly remember).

Sorry to flood the channel...

@ozwaldorf
Copy link
Contributor

host should just be https://ic0.app for mainnet, might fix this issue

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

2 participants