PHP WebShell
Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@iota/iota-sdk/dist/cjs/client
Просмотр файла: network.js
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var network_exports = {};
__export(network_exports, {
Network: () => Network,
getAllNetworks: () => getAllNetworks,
getDefaultNetwork: () => getDefaultNetwork,
getFullnodeUrl: () => getFullnodeUrl,
getGraphQLUrl: () => getGraphQLUrl,
getNetwork: () => getNetwork
});
module.exports = __toCommonJS(network_exports);
var Network = /* @__PURE__ */ ((Network2) => {
Network2["Mainnet"] = "mainnet";
Network2["Devnet"] = "devnet";
Network2["Testnet"] = "testnet";
Network2["Localnet"] = "localnet";
Network2["Custom"] = "custom";
return Network2;
})(Network || {});
function getAllNetworks() {
const networksStringified = '{\n "mainnet": {\n "id": "mainnet",\n "name": "Mainnet",\n "url": "https://api.mainnet.iota.cafe",\n "graphql": "https://graphql.mainnet.iota.cafe",\n "explorer": "https://explorer.rebased.iota.org",\n "chain": "iota:mainnet"\n },\n "testnet": {\n "id": "testnet",\n "name": "Testnet",\n "url": "https://api.testnet.iota.cafe",\n "graphql": "https://graphql.testnet.iota.cafe",\n "explorer": "https://explorer.rebased.iota.org",\n "chain": "iota:testnet",\n "faucet": "https://faucet.testnet.iota.cafe",\n "kiosk": {\n "royaltyRulePackageId": "0x975f749f57701209454e4b9b9e33825ccb6a9abf57de2ce86979e5fa86c343f2",\n "kioskLockRulePackageId": "0x975f749f57701209454e4b9b9e33825ccb6a9abf57de2ce86979e5fa86c343f2",\n "floorPriceRulePackageId": "0x975f749f57701209454e4b9b9e33825ccb6a9abf57de2ce86979e5fa86c343f2",\n "personalKioskRulePackageId": "0x975f749f57701209454e4b9b9e33825ccb6a9abf57de2ce86979e5fa86c343f2"\n }\n },\n "devnet": {\n "id": "devnet",\n "name": "Devnet",\n "url": "https://api.devnet.iota.cafe",\n "graphql": "https://graphql.devnet.iota.cafe",\n "explorer": "https://explorer.rebased.iota.org",\n "chain": "iota:devnet",\n "faucet": "https://faucet.devnet.iota.cafe"\n },\n "localnet": {\n "id": "localnet",\n "name": "Localnet",\n "url": "http://localhost:9000",\n "graphql": "http://localhost:9125",\n "explorer": "http://localhost:3000",\n "chain": "iota:local",\n "faucet": "http://localhost:9123"\n }\n}';
if (!networksStringified) {
throw new Error('"IOTA_NETWORKS" env var is not set.');
}
let networks;
try {
networks = JSON.parse(networksStringified);
} catch {
throw new Error('Failed to parse env var "IOTA_NETWORKS".');
}
return networks;
}
function getNetwork(network) {
const networks = getAllNetworks();
const requestedNetwork = networks[network] ?? network;
return requestedNetwork;
}
function getDefaultNetwork() {
return "mainnet";
}
function getFullnodeUrl(network) {
return getNetwork(network).url;
}
function getGraphQLUrl(network) {
return getNetwork(network).graphql;
}
//# sourceMappingURL=network.js.map
Выполнить команду
Для локальной разработки. Не используйте в интернете!