{"version":3,"sources":["../../src/api/nft.ts"],"sourcesContent":["// Copyright © Endless\n// Copyright © Aptos Foundation\n// SPDX-License-Identifier: Apache-2.0\n\nimport { EndlessConfig } from \"./endlessConfig\";\nimport { AccountAddressInput } from \"../core\";\nimport {\n  CollectionResponse,\n  NftMetrics,\n  NftTokenResponse,\n  PageableCollectionResponse,\n  PageableHoldersItem,\n  PageableNftCollectionHistoryRecord,\n  PageableNftTokenHistoryRecord,\n  PageableNftTokenResponse,\n  PaginationArgsOfIndexer,\n} from \"../types\";\nimport {\n  getCollections,\n  batchGetCollections,\n  getCollection,\n  getCollectionHistory,\n  getCollectionHolders,\n  getCollectionTokens,\n  getNft,\n  getNftHistory,\n  getNftMetrics,\n} from \"../internal/nft\";\n\n/**\n * A class to query all `NFT` related queries on Endless.\n */\nexport class NFT {\n  constructor(readonly config: EndlessConfig) {}\n\n  /**\n   * Get all collections\n   *\n   * @param args.options.page The page number to retrieve\n   * @param args.options.pageSize The number of items to retrieve per page\n   * @returns The collections\n   */\n  async getCollections(args?: {\n    options?: PaginationArgsOfIndexer;\n  }): Promise<PageableCollectionResponse> {\n    return getCollections({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Batch get collections by IDs\n   *\n   * @param args.ids The IDs of the collections to retrieve\n   * @returns The collections\n   */\n  async batchGetCollections(args: {\n    ids: AccountAddressInput[];\n  }): Promise<CollectionResponse[]> {\n    return batchGetCollections({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get a collection by ID\n   *\n   * @param args.id The ID of the collection to retrieve\n   * @returns The collection\n   */\n  async getCollection(args: {\n    id: AccountAddressInput;\n  }): Promise<CollectionResponse> {\n    return getCollection({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get collection history by ID\n   *\n   * @param args.id The ID of the collection to retrieve history for\n   * @param args.options.page The page number to retrieve\n   * @param args.options.pageSize The number of items to retrieve per page\n   * @returns The collection history\n   */\n  async getCollectionHistory(args: {\n    id: AccountAddressInput;\n    options?: PaginationArgsOfIndexer;\n  }): Promise<PageableNftCollectionHistoryRecord> {\n    return getCollectionHistory({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get collection holders by ID\n   *\n   * @param args.id The ID of the collection to retrieve holders for\n   * @param args.options.page The page number to retrieve\n   * @param args.options.pageSize The number of items to retrieve per page\n   * @returns The collection holders\n   */\n  async getCollectionHolders(args: {\n    id: AccountAddressInput;\n    options?: PaginationArgsOfIndexer;\n  }): Promise<PageableHoldersItem> {\n    return getCollectionHolders({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get collection tokens by ID\n   *\n   * @param args.id The ID of the collection to retrieve tokens for\n   * @param args.options.page The page number to retrieve\n   * @param args.options.pageSize The number of items to retrieve per page\n   * @returns The collection tokens\n   */\n  async getCollectionTokens(args: {\n    id: AccountAddressInput;\n    options?: PaginationArgsOfIndexer;\n  }): Promise<PageableNftTokenResponse> {\n    return getCollectionTokens({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get an NFT by ID\n   *\n   * @param args.id The ID of the NFT to retrieve\n   * @returns The NFT\n   */\n  async getNft(args: {\n    id: AccountAddressInput;\n  }): Promise<NftTokenResponse> {\n    return getNft({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get NFT history by ID\n   *\n   * @param args.id The ID of the NFT to retrieve history for\n   * @param args.options.page The page number to retrieve\n   * @param args.options.pageSize The number of items to retrieve per page\n   * @returns The NFT history\n   */\n  async getNftHistory(args: {\n    id: AccountAddressInput;\n    options?: PaginationArgsOfIndexer;\n  }): Promise<PageableNftTokenHistoryRecord> {\n    return getNftHistory({ endlessConfig: this.config, ...args });\n  }\n\n  /**\n   * Get NFT metrics\n   *\n   * @returns The NFT metrics\n   */\n  async getNftMetrics(): Promise<NftMetrics> {\n    return getNftMetrics({ endlessConfig: this.config });\n  }\n}\n"],"mappings":"iGAgCO,IAAMA,EAAN,KAAU,CACf,YAAqBC,EAAuB,CAAvB,YAAAA,CAAwB,CAS7C,MAAM,eAAeC,EAEmB,CACtC,OAAOC,EAAe,CAAE,cAAe,KAAK,OAAQ,GAAGD,CAAK,CAAC,CAC/D,CAQA,MAAM,oBAAoBA,EAEQ,CAChC,OAAOE,EAAoB,CAAE,cAAe,KAAK,OAAQ,GAAGF,CAAK,CAAC,CACpE,CAQA,MAAM,cAAcA,EAEY,CAC9B,OAAOG,EAAc,CAAE,cAAe,KAAK,OAAQ,GAAGH,CAAK,CAAC,CAC9D,CAUA,MAAM,qBAAqBA,EAGqB,CAC9C,OAAOI,EAAqB,CAAE,cAAe,KAAK,OAAQ,GAAGJ,CAAK,CAAC,CACrE,CAUA,MAAM,qBAAqBA,EAGM,CAC/B,OAAOK,EAAqB,CAAE,cAAe,KAAK,OAAQ,GAAGL,CAAK,CAAC,CACrE,CAUA,MAAM,oBAAoBA,EAGY,CACpC,OAAOM,EAAoB,CAAE,cAAe,KAAK,OAAQ,GAAGN,CAAK,CAAC,CACpE,CAQA,MAAM,OAAOA,EAEiB,CAC5B,OAAOO,EAAO,CAAE,cAAe,KAAK,OAAQ,GAAGP,CAAK,CAAC,CACvD,CAUA,MAAM,cAAcA,EAGuB,CACzC,OAAOQ,EAAc,CAAE,cAAe,KAAK,OAAQ,GAAGR,CAAK,CAAC,CAC9D,CAOA,MAAM,eAAqC,CACzC,OAAOS,EAAc,CAAE,cAAe,KAAK,MAAO,CAAC,CACrD,CACF","names":["NFT","config","args","getCollections","batchGetCollections","getCollection","getCollectionHistory","getCollectionHolders","getCollectionTokens","getNft","getNftHistory","getNftMetrics"]}