Skip to main content

Nfts

The nfts module allows obtaining information on the nfts of Alfa services.

Methods

Get the nfts of an account

The getNftsFromAccount method allows you to get the nfts from a specific account.

const nfts = sdk.nfts;

const account = '0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703';
constchainId = 80001;

const assets = await nfts.getNftsFromAccount(account, chainId);

Get the metadata of an nft

The getNftMetadata method allows you to get the metadata of a specific nft.

const nfts = sdk.nfts;

const contractAddress = '0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703';
constchainId = 80001;
const assetId = 1;

const metadata = await nfts.getNftMetadata(contractAddress, chainId, assetId);

Get the nfts of a contract

The getNftFromContractAddress method allows you to obtain the nfts of a specific contract.

const nfts = sdk.nfts;

const contractAddress = '0xa73a3b8ACa335855EeaC2f9Fb505BB0360A1B703';
constchainId = 80001;

const metadata = await nfts.getNftFromContractAddress(contractAddress, chainId);