@samudai_xyz/web3-sdk
Version:
## All in one web3 integrations for Samudai
22 lines (21 loc) • 714 B
JavaScript
import { getNftsForOwner, initializeAlchemy, } from '@alch/alchemy-sdk';
import { NFTNetworks } from '../utils/network';
export class NFTProfile {
constructor(chainId) {
this.getNFTProfilePPs = async (userAddress) => {
try {
const res = await getNftsForOwner(this.alchemy, userAddress);
return res;
}
catch (err) {
throw err;
}
};
const network = NFTNetworks.find((network) => network.chainId === chainId);
if (!network) {
throw new Error('Invalid chainId');
}
this.config = network.config;
this.alchemy = initializeAlchemy(this.config);
}
}