opensea-js
Version:
TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs and our marketplace data
90 lines • 4.35 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTraitOffersPath = exports.getCancelOrderPath = 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 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;
//# sourceMappingURL=apiPaths.js.map