UNPKG

opensea-js

Version:

TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data

118 lines 5.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTraitsPath = exports.getContractPath = exports.getEventsByNFTAPIPath = exports.getEventsByCollectionAPIPath = exports.getEventsByAccountAPIPath = exports.getEventsAPIPath = exports.getTraitOffersPath = exports.getCancelOrderPath = exports.getOrderByHashPath = exports.getRefreshMetadataPath = exports.getNFTPath = exports.getListNFTsByAccountPath = exports.getListNFTsByContractPath = exports.getListNFTsByCollectionPath = exports.getCollectionOffersPath = exports.getPostCollectionOfferPath = exports.getBuildOfferPath = exports.getAccountPath = exports.getPaymentTokenPath = exports.getCollectionStatsPath = exports.getCollectionsPath = exports.getCollectionPath = exports.getBestListingsAPIPath = exports.getBestListingAPIPath = exports.getBestOfferAPIPath = exports.getAllListingsAPIPath = exports.getAllOffersAPIPath = exports.getOrdersAPIPath = void 0; const types_1 = require("../types"); const getOrdersAPIPath = (chain, protocol, side) => { const sidePath = side === types_1.OrderSide.LISTING ? "listings" : "offers"; return `/api/v2/orders/${chain}/${protocol}/${sidePath}`; }; exports.getOrdersAPIPath = getOrdersAPIPath; const getAllOffersAPIPath = (collectionSlug) => { return `/api/v2/offers/collection/${collectionSlug}/all`; }; exports.getAllOffersAPIPath = getAllOffersAPIPath; const getAllListingsAPIPath = (collectionSlug) => { return `/api/v2/listings/collection/${collectionSlug}/all`; }; exports.getAllListingsAPIPath = getAllListingsAPIPath; const getBestOfferAPIPath = (collectionSlug, tokenId) => { return `/api/v2/offers/collection/${collectionSlug}/nfts/${tokenId}/best`; }; exports.getBestOfferAPIPath = getBestOfferAPIPath; const getBestListingAPIPath = (collectionSlug, tokenId) => { return `/api/v2/listings/collection/${collectionSlug}/nfts/${tokenId}/best`; }; exports.getBestListingAPIPath = getBestListingAPIPath; const getBestListingsAPIPath = (collectionSlug) => { return `/api/v2/listings/collection/${collectionSlug}/best`; }; exports.getBestListingsAPIPath = getBestListingsAPIPath; const getCollectionPath = (slug) => { return `/api/v2/collections/${slug}`; }; exports.getCollectionPath = getCollectionPath; const getCollectionsPath = () => { return "/api/v2/collections"; }; exports.getCollectionsPath = getCollectionsPath; const getCollectionStatsPath = (slug) => { return `/api/v2/collections/${slug}/stats`; }; exports.getCollectionStatsPath = getCollectionStatsPath; const getPaymentTokenPath = (chain, address) => { return `/api/v2/chain/${chain}/payment_token/${address}`; }; exports.getPaymentTokenPath = getPaymentTokenPath; const getAccountPath = (address) => { return `/api/v2/accounts/${address}`; }; exports.getAccountPath = getAccountPath; const getBuildOfferPath = () => { return `/api/v2/offers/build`; }; exports.getBuildOfferPath = getBuildOfferPath; const getPostCollectionOfferPath = () => { return `/api/v2/offers`; }; exports.getPostCollectionOfferPath = getPostCollectionOfferPath; const getCollectionOffersPath = (slug) => { return `/api/v2/offers/collection/${slug}`; }; exports.getCollectionOffersPath = getCollectionOffersPath; const getListNFTsByCollectionPath = (slug) => { return `/api/v2/collection/${slug}/nfts`; }; exports.getListNFTsByCollectionPath = getListNFTsByCollectionPath; const getListNFTsByContractPath = (chain, address) => { return `/api/v2/chain/${chain}/contract/${address}/nfts`; }; exports.getListNFTsByContractPath = getListNFTsByContractPath; const getListNFTsByAccountPath = (chain, address) => { return `/api/v2/chain/${chain}/account/${address}/nfts`; }; exports.getListNFTsByAccountPath = getListNFTsByAccountPath; const getNFTPath = (chain, address, identifier) => { return `/api/v2/chain/${chain}/contract/${address}/nfts/${identifier}`; }; exports.getNFTPath = getNFTPath; const getRefreshMetadataPath = (chain, address, identifier) => { return `/api/v2/chain/${chain}/contract/${address}/nfts/${identifier}/refresh`; }; exports.getRefreshMetadataPath = getRefreshMetadataPath; const getOrderByHashPath = (chain, protocolAddress, orderHash) => { return `/api/v2/orders/chain/${chain}/protocol/${protocolAddress}/${orderHash}`; }; exports.getOrderByHashPath = getOrderByHashPath; const getCancelOrderPath = (chain, protocolAddress, orderHash) => { return `/api/v2/orders/chain/${chain}/protocol/${protocolAddress}/${orderHash}/cancel`; }; exports.getCancelOrderPath = getCancelOrderPath; const getTraitOffersPath = (collectionSlug) => { return `/api/v2/offers/collection/${collectionSlug}/traits`; }; exports.getTraitOffersPath = getTraitOffersPath; const getEventsAPIPath = () => { return "/api/v2/events"; }; exports.getEventsAPIPath = getEventsAPIPath; const getEventsByAccountAPIPath = (address) => { return `/api/v2/events/accounts/${address}`; }; exports.getEventsByAccountAPIPath = getEventsByAccountAPIPath; const getEventsByCollectionAPIPath = (collectionSlug) => { return `/api/v2/events/collection/${collectionSlug}`; }; exports.getEventsByCollectionAPIPath = getEventsByCollectionAPIPath; const getEventsByNFTAPIPath = (chain, address, identifier) => { return `/api/v2/events/chain/${chain}/contract/${address}/nfts/${identifier}`; }; exports.getEventsByNFTAPIPath = getEventsByNFTAPIPath; const getContractPath = (chain, address) => { return `/api/v2/chain/${chain}/contract/${address}`; }; exports.getContractPath = getContractPath; const getTraitsPath = (collectionSlug) => { return `/api/v2/traits/${collectionSlug}`; }; exports.getTraitsPath = getTraitsPath; //# sourceMappingURL=apiPaths.js.map