GithubHelp home page GithubHelp logo

psychedelic / dab-js Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 19.0 739 KB

JS library that wraps necessary methods to integrate DAB and its NFTs.

License: GNU General Public License v3.0

JavaScript 0.75% TypeScript 99.25%

dab-js's People

Contributors

alejo-acevedo-deel avatar b0xtch avatar cancuuu avatar enjatz avatar heldrida avatar michaelmoriarty67 avatar migueltoscano avatar mzibara avatar nicolaspoggi avatar nima-ra avatar ozwaldorf avatar rckprtr avatar rocky-fleek avatar tomiir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dab-js's Issues

extImageUrl is arbitrary and hard-coded.

extImageUrl is arbitrary and hard-coded: DAB should accept a method for EXT tokens to reveal their URIs.

showURL(tokenIdentifier) Text {
  // returns the URL as a text. 
  // EXT does not define what is in the metadata, so it can be anything.
  // The easiest way to get the asset URI is not to hardcode, but to ask the canisters for it.
}

Just like there is a method for canisters to show their logo_url.

const extImageUrl = (canisterId, index, tokenIdentifier) =>

"ReferenceError: global is not defined" when using 'getNFTCollections'

Hello. I am trying to use your 'getNFTCollections' function, but I'm getting a 404-error when running my app locally:

Here is my implementation (Principal removed for privacy):
image

.....dependency versions:
image

.....and the error message I'm getting
image

Is this anything that you've encountered before? Thanks

Some errors with NFTActor.getUserTokens on localhost

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

Some errors with getAllUserNFTs func on localhost

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.