@poprank/sdk
Version:
PopRank API client and types
87 lines • 3.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CHAIN_EXPLORER_MAP = exports.CHAIN_MARKETPLACE_MAP = exports.CHAIN_TERM_LABELS = exports.MAGICEDEN_BASE_NFTS_URL = exports.MAGICEDEN_BASE_COLLECTIONS_URL = exports.MAGICEDEN_BASE_URL = exports.OPENSEA_BASE_NFTS_URL = exports.OPENSEA_BASE_COLLECTIONS_URL = exports.OPENSEA_BASE_URL = exports.API_BASE_URL = void 0;
exports.API_BASE_URL = 'https://api.poprank.io';
exports.OPENSEA_BASE_URL = 'https://opensea.io';
exports.OPENSEA_BASE_COLLECTIONS_URL = exports.OPENSEA_BASE_URL;
exports.OPENSEA_BASE_NFTS_URL = "".concat(exports.OPENSEA_BASE_URL, "/assets");
exports.MAGICEDEN_BASE_URL = 'https://magiceden.io';
exports.MAGICEDEN_BASE_COLLECTIONS_URL = "".concat(exports.MAGICEDEN_BASE_URL, "/marketplace");
exports.MAGICEDEN_BASE_NFTS_URL = "".concat(exports.MAGICEDEN_BASE_URL, "/item-details");
var EVM_LABELS = {
collectionId: "Contract Address",
tokenId: "Token ID",
};
/**
* Labels for collection, token, and token standards per-chain.
* eg: on EVM chains, we have a "Contract Address", but on Solana that's
* referred to as an "On-chain Collection"
*/
exports.CHAIN_TERM_LABELS = {
ethereum: EVM_LABELS,
polygon: EVM_LABELS,
solana: {
collectionId: "On-chain Collection",
tokenId: "Mint Account"
}
};
/**
* A mapping of all PopRank supported chains to all
* of our supported marketplaces.
*
* The first marketplace under a chain is considered the default.
*/
exports.CHAIN_MARKETPLACE_MAP = {
ethereum: {
opensea: {
name: "OpenSea",
nftUrlFormatter: function (id, address) { return "".concat(exports.OPENSEA_BASE_NFTS_URL, "/").concat(address, "/").concat(id); },
collectionUrlFormatter: function (address) { return "".concat(exports.OPENSEA_BASE_COLLECTIONS_URL, "/").concat(address); }
}
},
polygon: {
opensea: {
name: "OpenSea",
nftUrlFormatter: function (id, address) { return "".concat(exports.OPENSEA_BASE_NFTS_URL, "/matic/").concat(address, "/").concat(id); },
collectionUrlFormatter: function (address) { return "".concat(exports.OPENSEA_BASE_COLLECTIONS_URL, "/").concat(address); }
}
},
solana: {
magiceden: {
name: "MagicEden",
nftUrlFormatter: function (id, _address) { return "".concat(exports.MAGICEDEN_BASE_NFTS_URL, "/").concat(id); },
collectionUrlFormatter: function (address) { return "".concat(exports.MAGICEDEN_BASE_COLLECTIONS_URL, "/").concat(address); }
},
opensea: {
name: "OpenSea",
nftUrlFormatter: function (id, address) { return "".concat(exports.OPENSEA_BASE_NFTS_URL, "/solana/").concat(address, "/").concat(id); },
collectionUrlFormatter: function (address) { return "".concat(exports.OPENSEA_BASE_COLLECTIONS_URL, "/").concat(address); }
}
},
};
/**
* Mapping of all PopRank supported block explorers, per-chain.
*
* The first explorer for a given chain is the default.
*/
exports.CHAIN_EXPLORER_MAP = {
ethereum: {
etherscan: {
name: "Etherscan",
addressUrlFormatter: function (address) { return "https://etherscan.io/address/".concat(address); }
}
},
polygon: {
polygonscan: {
name: "PolygonScan",
addressUrlFormatter: function (address) { return "https://polygonscan.io/address/".concat(address); }
}
},
solana: {
solscan: {
name: "Solscan",
addressUrlFormatter: function (address) { return "https://solscan.io/token/".concat(address); }
}
}
};
//# sourceMappingURL=constants.js.map