index.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. exports.chains = exports._getInitializedChains = void 0;
  7. const mainnet_json_1 = __importDefault(require("./mainnet.json"));
  8. const ropsten_json_1 = __importDefault(require("./ropsten.json"));
  9. const rinkeby_json_1 = __importDefault(require("./rinkeby.json"));
  10. const kovan_json_1 = __importDefault(require("./kovan.json"));
  11. const goerli_json_1 = __importDefault(require("./goerli.json"));
  12. /**
  13. * @hidden
  14. */
  15. function _getInitializedChains(customChains) {
  16. const names = {
  17. '1': 'mainnet',
  18. '3': 'ropsten',
  19. '4': 'rinkeby',
  20. '42': 'kovan',
  21. '5': 'goerli',
  22. };
  23. const chains = {
  24. mainnet: mainnet_json_1.default,
  25. ropsten: ropsten_json_1.default,
  26. rinkeby: rinkeby_json_1.default,
  27. kovan: kovan_json_1.default,
  28. goerli: goerli_json_1.default,
  29. };
  30. if (customChains) {
  31. for (const chain of customChains) {
  32. const name = chain.name;
  33. names[chain.chainId.toString()] = name;
  34. chains[name] = chain;
  35. }
  36. }
  37. chains['names'] = names;
  38. return chains;
  39. }
  40. exports._getInitializedChains = _getInitializedChains;
  41. /**
  42. * @deprecated this constant will be internalized (removed)
  43. * on next major version update
  44. */
  45. exports.chains = _getInitializedChains();
  46. //# sourceMappingURL=index.js.map