opensea-js
Version:
TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data
36 lines (35 loc) • 1.39 kB
TypeScript
import { ListNFTsResponse, GetNFTResponse, GetContractResponse } from "./types";
import { Chain } from "../types";
import { Fetcher } from "./fetcher";
/**
* NFT-related API operations
*/
export declare class NFTsAPI {
private fetcher;
private chain;
constructor(fetcher: Fetcher, chain: Chain);
/**
* Fetch multiple NFTs for a collection.
*/
getNFTsByCollection(slug: string, limit?: number | undefined, next?: string | undefined): Promise<ListNFTsResponse>;
/**
* Fetch multiple NFTs for a contract.
*/
getNFTsByContract(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise<ListNFTsResponse>;
/**
* Fetch NFTs owned by an account.
*/
getNFTsByAccount(address: string, limit?: number | undefined, next?: string | undefined, chain?: Chain): Promise<ListNFTsResponse>;
/**
* Fetch metadata, traits, ownership information, and rarity for a single NFT.
*/
getNFT(address: string, identifier: string, chain?: Chain): Promise<GetNFTResponse>;
/**
* Force refresh the metadata for an NFT.
*/
refreshNFTMetadata(address: string, identifier: string, chain?: Chain): Promise<Response>;
/**
* Fetch smart contract information for a given chain and address.
*/
getContract(address: string, chain?: Chain): Promise<GetContractResponse>;
}