dab-js-without-registry
Version:
JS adapter for DAB
45 lines (44 loc) • 1.94 kB
TypeScript
import { HttpAgent } from '@dfinity/agent';
import { Principal } from '@dfinity/principal';
import { NFTCollection } from '../interfaces/nft';
import { DABCollection } from '../interfaces/dab_nfts';
import NFT from '../standard_wrappers/nft_standards/default';
import Registry from './standard_registry';
import { FormattedMetadata } from '../utils/registry';
interface GetBatchedNFTsParams {
principal: Principal;
callback?: (collection: NFTCollection) => void;
batchSize?: number;
onFinish?: (collections: NFTCollection[]) => void;
agent?: HttpAgent;
}
interface GetNFTActorParams {
canisterId: string;
standard: string;
agent: HttpAgent;
}
interface GetNFTInfoParams {
nftCanisterId: string;
agent?: HttpAgent;
}
interface GetAllUserNFTsParams {
user: string | Principal;
agent?: HttpAgent;
}
export declare class NFTRegistry extends Registry {
constructor(agent?: HttpAgent);
getAll: () => Promise<FormattedMetadata[]>;
}
export declare const getUserCollectionTokens: (collection: DABCollection, user: Principal, agent?: HttpAgent, callback?: (val?: any) => void) => Promise<NFTCollection>;
export declare const getNFTActor: ({ canisterId, agent, standard }: GetNFTActorParams) => NFT;
export declare const getNFTInfo: ({ nftCanisterId, agent }: GetNFTInfoParams) => Promise<DABCollection | undefined>;
export declare const getAllNFTS: ({ agent }?: {
agent?: HttpAgent | undefined;
}) => Promise<DABCollection[]>;
export declare const getAllUserNFTs: ({ user, agent }: GetAllUserNFTsParams) => Promise<NFTCollection[]>;
export declare const getBatchedNFTs: ({ principal, callback, batchSize, onFinish, agent, }: GetBatchedNFTsParams) => Promise<NFTCollection[]>;
export declare const getCachedUserNFTs: ({ userPID, refresh }: {
userPID: string;
refresh?: boolean | undefined;
}) => Promise<NFTCollection[]>;
export {};