Before we get started we need to make sure that all of the required dependencies are installed.
yarn add @protokol/client
import { ProtokolConnection } from "@protokol/client";const connection = new ProtokolConnection("https://api.protokol.com/api");
const response = connection.NFTBaseApi("collections").all();>>> Promise<ApiResponseWithPagination<CollectionsResource[]>>
const response = connection.NFTBaseApi("collections").get("VALID_ID");>>> Promise<ApiResponse<CollectionsResource>>
const response = connection.NFTBaseApi("collections").getSchema("VALID_ID");>>> Promise<ApiResponse<Schema>>
const response = connection.NFTBaseApi("collections").wallet("VALID_ID");>>> Promise<ApiResponse<CollectionsWallet>>
const response = connection.NFTBaseApi("collections").searchByCollections({jsonSchema: {"VALID_JSON_OBJECT"},});>>> Promise<ApiResponseWithPagination<CollectionsResource[]>>
const response = connection.NFTBaseApi("collections").assetByCollectionId("VALID_ID");>>> Promise<ApiResponseWithPagination<CollectionsAsset[]>>
const response = connection.NFTBaseApi("assets").all();>>> Promise<ApiResponseWithPagination<AssetsResource[]>>
const response = connection.NFTBaseApi("assets").get("VALID_ID");>>> Promise<ApiResponse<AssetsResource>>
const response = connection.NFTBaseApi("assets").wallet("VALID_ID");>>> Promise<ApiResponse<AssetsWallet>>
const response = connection.NFTBaseApi("assets").searchByAsset({"VALID_JSON_OBJECT"});>>> Promise<ApiResponseWithPagination<AssetsResource[]>>
const response = connection.NFTBaseApi("transfers").all();>>> Promise<ApiResponseWithPagination<TransfersResource[]>>
const response = connection.NFTBaseApi("transfers").get("VALID_ID");>>> Promise<ApiResponse<TransfersResource>>
const response = connection.NFTBaseApi("burns").all();>>> Promise<ApiResponseWithPagination<BurnsResource[]>>
const response = connection.NFTBaseApi("burns").get("VALID_ID");>>> Promise<ApiResponse<BurnsResource>>
const response = connection.NFTBaseApi("configurations").index();>>> Promise<ApiResponse<ConfigurationsResource>>
const response = connection.NFTExchangeApi("auctions").getAllAuctions();>>> Promise<ApiResponseWithPagination<AuctionsResource[]>>
const response = connection.NFTExchangeApi("auctions").getAuctionById("VALID_ID");>>> Promise<ApiResponse<AuctionsResource>>
const response = connection.NFTExchangeApi("auctions").getAuctionsWallets("VALID_ID");>>> Promise<ApiResponse<AuctionsWallet>>
const response = connection.NFTExchangeApi("auctions").searchByAsset({nftIds: ["VALID_NFT_IDS"],senderPublicKey: "VALID_SENDER_PUBLIC_KEY",startAmount: "START_AMOUNT",expiration: {blockHeight: BLOCK_HEIGHT,},});>>> Promise<ApiResponseWithPagination<AuctionsResource[]>>
const response = connection.NFTExchangeApi("auctions").getAllCanceledAuctions();>>> Promise<ApiResponseWithPagination<AuctionCanceled[]>>
const response = connection.NFTExchangeApi("auctions").getCanceledAuctionById("VALID_ID");>>> Promise<ApiResponse<AuctionCanceled>>
const response = connection.NFTExchangeApi("bids").getAllBids();>>> Promise<ApiResponse<BidsResource>>
const response = connection.NFTExchangeApi("bids").getBidById("VALID_ID");>>> Promise<ApiResponse<BidsResource>>
const response = connection.NFTExchangeApi("bids").getBidsWallets("VALID_ID");>>> Promise<ApiResponse<BidsWallet>>
const response = connection.NFTExchangeApi("bids").searchByBid({auctionId: "VALID_AUCTION_ID",senderPublicKey: "VALID_SENDER_PUBLIC_KEY",bidAmount: "BID_AMOUNT",});>>> Promise<ApiResponse<BidCanceled>>
const response = connection.NFTExchangeApi("bids").getCanceledBidById("VALID_ID");>>> Promise<ApiResponse<BidCanceled>>
const response = connection.NFTExchangeApi("trades").all();>>> Promise<ApiResponse<TradesResource>>
const response = connection.NFTExchangeApi("trades").get("VALID_ID");>>> Promise<ApiResponse<TradeById>>
const response = connection.NFTExchangeApi("trades").search({auctionId: "VALID_AUCTION_ID",bidId: "VALID_BID_ID",senderPublicKey: "VALID_SENDER_PUBLIC_KEY",});>>> Promise<ApiResponseWithPagination<TradesResource[]>>
const response = connection.NFTExchangeApi("configurations").index();>>> Promise<ApiResponse<ConfigurationsResource>>