@samudai_xyz/web3-sdk
Version:
## All in one web3 integrations for Samudai
26 lines (25 loc) • 872 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NFTProfile = void 0;
const alchemy_sdk_1 = require("@alch/alchemy-sdk");
const network_1 = require("../utils/network");
class NFTProfile {
constructor(chainId) {
this.getNFTProfilePPs = async (userAddress) => {
try {
const res = await (0, alchemy_sdk_1.getNftsForOwner)(this.alchemy, userAddress);
return res;
}
catch (err) {
throw err;
}
};
const network = network_1.NFTNetworks.find((network) => network.chainId === chainId);
if (!network) {
throw new Error('Invalid chainId');
}
this.config = network.config;
this.alchemy = (0, alchemy_sdk_1.initializeAlchemy)(this.config);
}
}
exports.NFTProfile = NFTProfile;