psychedelic / dab-js Goto Github PK
View Code? Open in Web Editor NEWJS library that wraps necessary methods to integrate DAB and its NFTs.
License: GNU General Public License v3.0
JS library that wraps necessary methods to integrate DAB and its NFTs.
License: GNU General Public License v3.0
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.
'@psychedelic/dab-js@latest' is not in the npm registry.
Tried to pull 1.1.1 and the latest. States it is not in the registry.
Setting up a token worked.
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();
})
Line 54 in 6737f7f
My .npmrc
was case sensitive and causing an installation issue. By manual editing my '.npmrcfile to be lowercase
p` I was able to successfully install the package.
Mac OSX Monterey
npm 6.14.4
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);
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();
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.