import { Result, Try } from '~/shared'; import { DasApi } from '~/das-api'; import { Pubkey } from '~/types/account'; import { Metadata, NftMetadata } from '~/types/nft'; import { FindOptions } from '~/types/find'; export namespace RegularNft { /** * Find nft by owner address * * @param {Pubkey} owner * @param {Partial} options * @return Promise> */ export const findByOwner = async ( owner: Pubkey, options: Partial = {}, ): Promise> => { return Try(async () => { return await DasApi.findByOwner(owner, false, options); }); }; /** * Find nft by mint address * * @param {Pubkey} mint * @return Promise> */ export const findByMint = async ( mint: Pubkey, ): Promise, Error>> => { return Try(async () => { return await DasApi.findByMint(mint, false); }); }; /** * Find nft by collection mint * * @param {Pubkey} collectionMint * @param {Partial} options * @return Promise> */ export const findByCollection = async ( collectionMint: Pubkey, options: Partial = {}, ): Promise> => { return Try(async () => { return DasApi.findByCollection(collectionMint, false, options); }); }; }