'use strict';

var chunkEESC6JDT_cjs = require('./chunk-EESC6JDT.cjs');
var react = require('@chakra-ui/react');
var jsxRuntime = require('react/jsx-runtime');
var picasso = require('@vechain/picasso');
var bignumber_js = require('bignumber.js');
var accounts = require('viem/accounts');
var thorDevkit = require('thor-devkit');
require('crypto');

var VOT3Logo = ({ ...props }) => {
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Icon, { viewBox: "0 0 1684.56 1684.56", ...props, children: [
    /* @__PURE__ */ jsxRuntime.jsx(
      "rect",
      {
        fill: "#b1f16c",
        width: "1684.56",
        height: "1684.56",
        rx: "157.74",
        ry: "157.74"
      }
    ),
    /* @__PURE__ */ jsxRuntime.jsx(
      "path",
      {
        fill: "#1d1d1d",
        d: "M844.98,1386.28c-41.46,0-75.1-33.9-75.1-75.67,0-142.78-86.35-274.05-158.8-359.01-89.72-105.25-197.89-186.19-265.28-219.75-37.18-18.54-52.43-63.88-34.09-101.35,18.39-37.47,63.39-52.83,100.58-34.35,75.09,37.41,202.11,127.08,312.7,256.82,32.24,37.81,66.77,83.5,97.66,135.35,34.2-108.83,79.98-205.07,121.61-280.12,91.8-165.56,214.37-317.13,319.84-395.63,33.36-24.83,80.39-17.68,105.02,15.93,24.64,33.61,17.55,81-15.81,105.82-88.03,65.47-197.1,201.95-277.93,347.68-70.82,127.7-155.25,323.08-155.25,528.6,0,41.78-33.64,75.67-75.1,75.67h-.06Z"
      }
    )
  ] });
};
var TOKEN_LOGOS = {
  VET: "https://cryptologos.cc/logos/vechain-vet-logo.png",
  VTHO: "https://s2.coinmarketcap.com/static/img/coins/64x64/3012.png",
  B3TR: "https://vechain.github.io/token-registry/assets/3d55edb42b09a634f7f2f26756a02571de901a5b.png",
  VOT3: "https://vechain.github.io/token-registry/assets/17ff70aa1d898bc97ad690dbfad1a3b5643f7e0b.png",
  veDelegate: "https://vechain.github.io/token-registry/assets/1c641b86096d56bf13d49f38388accd6db8b8b2e.png",
  USDGLO: "https://raw.githubusercontent.com/vechain/app-hub/439fba60c80ba2521d435981102d88c4aec050d6/apps/org.glodollar.app/logo.png"
};
var TOKEN_LOGO_COMPONENTS = {
  VET: /* @__PURE__ */ jsxRuntime.jsx(chunkEESC6JDT_cjs.VETLogo, {}),
  VTHO: /* @__PURE__ */ jsxRuntime.jsx(chunkEESC6JDT_cjs.VTHOLogo, {}),
  B3TR: /* @__PURE__ */ jsxRuntime.jsx(chunkEESC6JDT_cjs.VeBetterIcon, {}),
  VOT3: /* @__PURE__ */ jsxRuntime.jsx(VOT3Logo, {})
};
var VECHAIN_PRIVY_APP_ID = "cm4wxxujb022fyujl7g0thb21";
var notFoundImage = "https://upload.wikimedia.org/wikipedia/commons/a/a3/Image-not-found.png";
var TogglePassportCheck = /* @__PURE__ */ ((TogglePassportCheck2) => {
  TogglePassportCheck2[TogglePassportCheck2["WhitelistCheck"] = 1] = "WhitelistCheck";
  TogglePassportCheck2[TogglePassportCheck2["BlacklistCheck"] = 2] = "BlacklistCheck";
  TogglePassportCheck2[TogglePassportCheck2["SignalingCheck"] = 3] = "SignalingCheck";
  TogglePassportCheck2[TogglePassportCheck2["ParticipationScoreCheck"] = 4] = "ParticipationScoreCheck";
  TogglePassportCheck2[TogglePassportCheck2["GmOwnershipCheck"] = 5] = "GmOwnershipCheck";
  return TogglePassportCheck2;
})(TogglePassportCheck || {});
var VECHAIN_KIT_STORAGE_KEYS = {
  NETWORK: "vechain-kit:network"
};
var ENV = {
  isDevelopment: localStorage.getItem(VECHAIN_KIT_STORAGE_KEYS.NETWORK) === "test",
  isProduction: localStorage.getItem(VECHAIN_KIT_STORAGE_KEYS.NETWORK) === "main"
};
var VECHAIN_KIT_MIXPANEL_TOKENS = {
  development: "e9627dff3f9ac07c28c28615fa86b181",
  production: "2c9e0d4c8a37e9f31e3d59361f48b0dc"
};
var VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN = ENV.isProduction ? VECHAIN_KIT_MIXPANEL_TOKENS.production : VECHAIN_KIT_MIXPANEL_TOKENS.development;
var VECHAIN_KIT_MIXPANEL_PROJECT_NAME = "vechain-kit";
var DEFAULT_PRIVY_ECOSYSTEM_APPS = [
  {
    id: "clz41gcg00e4ay75dmq3uzzgr",
    name: "Cleanify",
    website: "https://app.cleanify.vet"
  },
  {
    id: "cm153hrup0817axti38avlfyg",
    name: "GreenCart",
    website: "https://greencart.ai"
  },
  {
    id: "clv9sfos20j6x1431ga80d95f",
    name: "Mughsot",
    website: "https://mugshot.vet/"
  },
  {
    id: "cm4l8tiai070i108zo17oieyc",
    name: "EVearn",
    website: "https://evearn.io"
  }
];
var VECHAIN_KIT_TERMS_CONFIG = {
  url: "https://vechainkit.vechain.org/terms",
  version: 1,
  required: true,
  displayName: "Vechain Kit Terms"
};
var VECHAIN_KIT_COOKIES_CONFIG = {
  url: "https://vechainkit.vechain.org/cookies",
  version: 1,
  required: false,
  displayName: "Vechain Kit Cookies"
};
var humanAddress = (address2, charAtStart = 6, charAtEnd = 4) => `${address2.slice(0, charAtStart)}\u2022\u2022\u2022${address2.slice(-charAtEnd)}`;
var humanDomain = (domain, lengthBefore = 8, lengthAfter = 6) => {
  if (domain.length <= lengthBefore + lengthAfter) return domain;
  const before = domain.substring(0, lengthBefore);
  const after = domain.substring(domain.length - lengthAfter);
  return `${before}\u2022\u2022\u2022${after}`;
};
var humanNumber = (formattedValue, originalValue, symbol = null) => {
  const suffix = symbol ? " " + symbol : "";
  originalValue = originalValue || formattedValue;
  const formatter = new Intl.NumberFormat("en-US", {
    style: "decimal",
    minimumFractionDigits: Number.parseFloat(formattedValue.toString()) % 1 === 0 ? 0 : 2
  });
  let value = formatter.format(
    roundDownSignificantDigits(Number(formattedValue), 2)
  );
  if (!isZero(originalValue) && isZero(value)) {
    value = "< 0.01";
  }
  return value + suffix;
};
var isZero = (value) => {
  if (!value && value !== 0) return false;
  return new bignumber_js.BigNumber(value).isZero();
};
var getPicassoImage = (address2, base64 = false) => {
  const image = picasso.picasso(address2.toLowerCase());
  if (base64) {
    const base64data = Buffer.from(image, "utf8").toString("base64");
    return `data:image/svg+xml;base64,${base64data}`;
  }
  return `data:image/svg+xml;utf8,${image}`;
};
function roundDownSignificantDigits(numbers, decimals = 0) {
  if (typeof numbers !== "number" || typeof decimals !== "number") {
    throw new Error(
      "Invalid input: number and decimals must be of type number"
    );
  }
  const significantDigits = parseInt(
    numbers.toExponential().split("e-")[1] || "0",
    10
  );
  const effectiveDecimals = Math.max(0, decimals + significantDigits);
  const scaleFactor = Math.pow(10, effectiveDecimals);
  return Math.floor(numbers * scaleFactor) / scaleFactor;
}
var randomTransactionUser = (() => {
  const privateKey = accounts.generatePrivateKey();
  const account = accounts.privateKeyToAccount(privateKey);
  return {
    privateKey,
    account,
    address: account.address
  };
})();
var PREFIX = "0x";
var PREFIX_REGEX = /^0[xX]/;
var HEX_REGEX = /^(0[xX])?[a-fA-F0-9]+$/;
var addPrefix = (hex) => {
  validate(hex);
  return PREFIX_REGEX.test(hex) ? hex.replace(PREFIX_REGEX, PREFIX) : `${PREFIX}${hex}`;
};
var validate = (hex) => {
  if (!isValid(hex)) throw Error("Provided hex value is not valid");
};
var isValid = (hex) => {
  return !!hex && HEX_REGEX.test(hex);
};
var normalize = (hex) => {
  return addPrefix(hex.toLowerCase().trim());
};

// src/utils/AddressUtils.ts
var compareAddresses = (address1, address2) => {
  if (!address1 || !address2) return false;
  if (address2 === address1) {
    return true;
  }
  try {
    return normalize(address1) === normalize(address2);
  } catch (e) {
    return false;
  }
};
var compareListOfAddresses = (add1, add2) => {
  if (add1.length !== add2.length) return false;
  const sortedAdd1 = [...add1].map((e) => e.toLowerCase()).sort((a, b) => a.localeCompare(b));
  const sortedAdd2 = [...add2].map((e) => e.toLowerCase()).sort((a, b) => a.localeCompare(b));
  for (let i = 0; i < sortedAdd1.length; i++) {
    if (!compareAddresses(sortedAdd1[i], sortedAdd2[i])) return false;
  }
  return true;
};
var regexPattern = () => {
  return /^0x[a-fA-F0-9]{40}$/;
};
var isValidAddress = (addr) => {
  try {
    if (typeof addr !== "string") return false;
    thorDevkit.address.toChecksumed(addPrefix(addr));
    return true;
  } catch (e) {
    return false;
  }
};
var leftPadWithZeros = (str, length) => {
  const cleanStr = str.startsWith("0x") ? str.slice(2) : str;
  if (cleanStr.length > length) {
    throw new Error("Input string is longer than the specified length");
  }
  const paddedStr = cleanStr.padStart(length, "0");
  return `0x${paddedStr}`;
};

// src/config/solo.ts
var config = {
  ipfsFetchingService: "https://api.dev.gateway-proxy.vechain.org/ipfs",
  ipfsPinningService: "https://api.dev.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
  vthoContractAddress: "0x0000000000000000000000000000456E65726779",
  b3trContractAddress: "0xd31A6f2DBa8785cE41AB68Ea192791B5175309F4",
  vot3ContractAddress: "0x028Af33230576c1e073C8245F72a7A4aa53564E4",
  b3trGovernorAddress: "0x36E0e9b46D56dF12Dd69fD560e41954C73cE9ded",
  timelockContractAddress: "0x125389845c93Efcf6471BA8BE1AC19c11e128603",
  xAllocationPoolContractAddress: "0xC8232c91E2f744E533322B99F95f809b9f7ec446",
  xAllocationVotingContractAddress: "0x074F093f4C534a16cDD09cb4b2669713218A762a",
  emissionsContractAddress: "0x6a084E85f38400790043788FcCee39595616aa3A",
  voterRewardsContractAddress: "0xbAb852081C459c0060960287aDcf9a0C2c1dc4b8",
  galaxyMemberContractAddress: "0xbdA1cff75d2D43AB9186Ada41fECF79e25c49Ba3",
  treasuryContractAddress: "0xe9414513Fe0e3b9bf7a61eC5c1AC7Df943fB3e77",
  x2EarnAppsContractAddress: "0x432C46476f4970575C43B19588A170D237dC4929",
  x2EarnRewardsPoolContractAddress: "0x134E4Fce6761f660401808CF86aE0e62cE52a81E",
  nodeManagementContractAddress: "0xa96B5057171D797298A71178b48449A7bC615D8E",
  veBetterPassportContractAddress: "0x8db6D14452fE36ba86C341AfEFaC0f90A0Db2bcb",
  x2EarnCreatorContractAddress: "0x4e5f7eb452e9ecd75c0B29e3540014cBe01bBF52",
  veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
  veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
  veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
  oracleContractAddress: "0x49eC7192BF804Abc289645ca86F1eD01a6C17713",
  accountFactoryAddress: "0xC06Ad8573022e2BE416CA89DA47E8c592971679A",
  cleanifyCampaignsContractAddress: "0x7a11D63338576aE8c038868433ea199d7E5319A6",
  cleanifyChallengesContractAddress: "0xa58681692AdDD2e8E37f9113D40Bb9253C03F65e",
  veWorldSubdomainClaimerContractAddress: "0x0000000000000000000000000000000000000000",
  vetDomainsContractAddress: "0x0000000000000000000000000000000000000000",
  vetDomainsPublicResolverAddress: "0x0000000000000000000000000000000000000000",
  vetDomainsReverseRegistrarAddress: "0x5c970901a587BA3932C835D4ae5FAE2BEa7e78Bc",
  vnsResolverAddress: "0x0000000000000000000000000000000000000000",
  gloDollarContractAddress: "0x0000000000000000000000000000000000000000",
  vetDomainAvatarUrl: "https://testnet.vet.domains/api/avatar",
  indexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
  b3trIndexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
  graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
  nodeUrl: "http://localhost:8669",
  network: {
    id: "solo",
    name: "solo",
    type: "solo",
    defaultNet: true,
    urls: ["http://localhost:8669"],
    explorerUrl: "https://explore-testnet.vechain.org",
    blockTime: 1e4,
    genesis: {
      number: 0,
      id: "0x00000000c05a20fbca2bf6ae3affba6af4a74b800b585bf7a4988aba7aea69f6",
      size: 170,
      parentID: "0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
      timestamp: 1530316800,
      gasLimit: 1e7,
      beneficiary: "0x0000000000000000000000000000000000000000",
      gasUsed: 0,
      totalScore: 0,
      txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      txsFeatures: 0,
      stateRoot: "0x93de0ffb1f33bc0af053abc2a87c4af44594f5dcb1cb879dd823686a15d68550",
      receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      signer: "0x0000000000000000000000000000000000000000",
      isTrunk: true,
      transactions: []
    }
  },
  explorerUrl: "https://explore-testnet.vechain.org"
};
var solo_default = config;

// src/config/testnet.ts
var config2 = {
  ipfsFetchingService: "https://api.dev.gateway-proxy.vechain.org/ipfs",
  ipfsPinningService: "https://api.dev.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
  vthoContractAddress: "0x0000000000000000000000000000456E65726779",
  b3trContractAddress: "0xbf64cf86894Ee0877C4e7d03936e35Ee8D8b864F",
  vot3ContractAddress: "0xa704c45971995467696EE9544Da77DD42Bc9706E",
  b3trGovernorAddress: "0xDF5E114D391CAC840529802fe8D01f6bdeBE41eC",
  timelockContractAddress: "0x30ee94F303643902a68aD8A7A6456cA69d763192",
  xAllocationPoolContractAddress: "0x9B9CA9D0C41Add1d204f90BA0E9a6844f1843A84",
  xAllocationVotingContractAddress: "0x5859ff910d8b0c127364c98E24233b0af7443c1c",
  emissionsContractAddress: "0x3D7616213191a10460e49CfdB7edBf88D6a10942",
  voterRewardsContractAddress: "0x2E47fc4aabB3403037fB5E1f38995E7a91Ce8Ed2",
  galaxyMemberContractAddress: "0xa9aC49C030c1148b95F056E86f2531f8F3d5bf27",
  x2EarnCreatorContractAddress: "",
  nodeManagementContractAddress: "",
  x2EarnAppsContractAddress: "0xcB23Eb1bBD5c07553795b9538b1061D0f4ABA153",
  treasuryContractAddress: "0x039893EBe092A2D22B08E2b029735D211bfF7F50",
  x2EarnRewardsPoolContractAddress: "0x5F8f86B8D0Fa93cdaE20936d150175dF0205fB38",
  veBetterPassportContractAddress: "0x63c061a2753e84635a22ff05954e1687f104f002",
  veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
  veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
  veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
  oracleContractAddress: "0xdcCAaBd81B38e0dEEf4c202bC7F1261A4D9192C6",
  accountFactoryAddress: "0x713b908Bcf77f3E00EFEf328E50b657a1A23AeaF",
  cleanifyCampaignsContractAddress: "0x22d19ACBD2cBf6b2B6C546395c26B9Cb448248BF",
  cleanifyChallengesContractAddress: "0x8Cc885DC3e5c376632CCEA0e8e1a51F1B3572442",
  veWorldSubdomainClaimerContractAddress: "0xe5af50e7ad1aaab4fbe4efbb2b30f764013918b3",
  vetDomainsContractAddress: "0xcBFB30c1F267914816668d53AcBA7bA7c9806D13",
  vetDomainsPublicResolverAddress: "0xA6eFd130085a127D090ACb0b100294aD1079EA6f",
  vetDomainsReverseRegistrarAddress: "0x6878f1aD5e3015310CfE5B38d7B7071C5D8818Ca",
  vnsResolverAddress: "0xc403b8EA53F707d7d4de095f0A20bC491Cf2bc94",
  gloDollarContractAddress: "0x0000000000000000000000000000000000000000",
  vetDomainAvatarUrl: "https://testnet.vet.domains/api/avatar",
  indexerUrl: "https://indexer.testnet.vechain.org/api/v1",
  b3trIndexerUrl: "https://b3tr.testnet.vechain.org/api/v1",
  graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
  nodeUrl: "https://testnet.vechain.org",
  network: {
    id: "testnet",
    name: "testnet",
    type: "test",
    defaultNet: true,
    urls: [
      "https://testnet.vechain.org",
      "https://vethor-node-test.vechaindev.com",
      "https://sync-testnet.veblocks.net",
      "https://testnet.vecha.in"
    ],
    explorerUrl: "https://insight.vecha.in/#/test",
    blockTime: 1e4,
    genesis: {
      number: 0,
      id: "0x000000000b2bce3c70bc649a02749e8687721b09ed2e15997f466536b20bb127",
      size: 170,
      parentID: "0xffffffff00000000000000000000000000000000000000000000000000000000",
      timestamp: 1530014400,
      gasLimit: 1e7,
      beneficiary: "0x0000000000000000000000000000000000000000",
      gasUsed: 0,
      totalScore: 0,
      txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      txsFeatures: 0,
      stateRoot: "0x4ec3af0acbad1ae467ad569337d2fe8576fe303928d35b8cdd91de47e9ac84bb",
      receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      signer: "0x0000000000000000000000000000000000000000",
      isTrunk: true,
      transactions: []
    }
  },
  explorerUrl: "https://explore-testnet.vechain.org/transactions"
};
var testnet_default = config2;

// src/config/mainnet.ts
var config3 = {
  ipfsFetchingService: "https://api.gateway-proxy.vechain.org/ipfs",
  indexerUrl: "https://indexer.mainnet.vechain.org/api/v1",
  ipfsPinningService: "https://api.gateway-proxy.vechain.org/api/v1/pinning/pinFileToIPFS",
  b3trIndexerUrl: "https://b3tr.mainnet.vechain.org/api/v1",
  graphQlIndexerUrl: "https://graph.vet/subgraphs/name/vns",
  nodeUrl: "https://mainnet.vechain.org",
  network: {
    id: "main",
    name: "main",
    type: "main",
    defaultNet: true,
    urls: [
      "https://mainnet.vechain.org",
      "https://vethor-node.vechain.com",
      "https://mainnet.veblocks.net",
      "https://mainnet.vecha.in"
    ],
    explorerUrl: "https://vechainstats.com",
    blockTime: 1e4,
    genesis: {
      number: 0,
      id: "0x00000000851caf3cfdb6e899cf5958bfb1ac3413d346d43539627e6be7ec1b4a",
      size: 170,
      parentID: "0xffffffff53616c757465202620526573706563742c20457468657265756d2100",
      timestamp: 1530316800,
      gasLimit: 1e7,
      beneficiary: "0x0000000000000000000000000000000000000000",
      gasUsed: 0,
      totalScore: 0,
      txsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      txsFeatures: 0,
      stateRoot: "0x09bfdf9e24dd5cd5b63f3c1b5d58b97ff02ca0490214a021ed7d99b93867839c",
      receiptsRoot: "0x45b0cfc220ceec5b7c1c62c4d4193d38e4eba48e8815729ce75f9c0ab0e4c1c0",
      signer: "0x0000000000000000000000000000000000000000",
      isTrunk: true,
      transactions: []
    }
  },
  explorerUrl: "https://vechainstats.com/transaction",
  // general
  vthoContractAddress: "0x0000000000000000000000000000456E65726779",
  //VeBetterDAO
  b3trContractAddress: "0x5ef79995FE8a89e0812330E4378eB2660ceDe699",
  vot3ContractAddress: "0x76Ca782B59C74d088C7D2Cce2f211BC00836c602",
  b3trGovernorAddress: "0x1c65C25fABe2fc1bCb82f253fA0C916a322f777C",
  timelockContractAddress: "0x7B7EaF620d88E38782c6491D7Ce0B8D8cF3227e4",
  xAllocationPoolContractAddress: "0x4191776F05f4bE4848d3f4d587345078B439C7d3",
  xAllocationVotingContractAddress: "0x89A00Bb0947a30FF95BEeF77a66AEdE3842Fe5B7",
  emissionsContractAddress: "0xDf94739bd169C84fe6478D8420Bb807F1f47b135",
  voterRewardsContractAddress: "0x838A33AF756a6366f93e201423E1425f67eC0Fa7",
  galaxyMemberContractAddress: "0x93B8cD34A7Fc4f53271b9011161F7A2B5fEA9D1F",
  treasuryContractAddress: "0xD5903BCc66e439c753e525F8AF2FeC7be2429593",
  x2EarnAppsContractAddress: "0x8392B7CCc763dB03b47afcD8E8f5e24F9cf0554D",
  x2EarnRewardsPoolContractAddress: "0x6Bee7DDab6c99d5B2Af0554EaEA484CE18F52631",
  x2EarnCreatorContractAddress: "0xe8e96a768ffd00417d4bd985bec9EcfC6F732a7f",
  nodeManagementContractAddress: "0xB0EF9D89C6b49CbA6BBF86Bf2FDf0Eee4968c6AB",
  veBetterPassportContractAddress: "0x35a267671d8EDD607B2056A9a13E7ba7CF53c8b3",
  //veDelegate
  veDelegate: "0xfc32a9895C78CE00A1047d602Bd81Ea8134CC32b",
  veDelegateVotes: "0xeb71148c9B3cd57e228c2152d79f6e78F5F1ef9a",
  veDelegateTokenContractAddress: "0xD3f7b82Df5705D34f64C634d2dEf6B1cB3116950",
  //utility
  oracleContractAddress: "0x49eC7192BF804Abc289645ca86F1eD01a6C17713",
  accountFactoryAddress: "0xC06Ad8573022e2BE416CA89DA47E8c592971679A",
  //cleanify
  cleanifyCampaignsContractAddress: "0x7a11D63338576aE8c038868433ea199d7E5319A6",
  cleanifyChallengesContractAddress: "0xa58681692AdDD2e8E37f9113D40Bb9253C03F65e",
  veWorldSubdomainClaimerContractAddress: "0xa4173c32fe8a61a8fd0d0234675b559fc360446a",
  vetDomainsContractAddress: "0xa9231da8BF8D10e2df3f6E03Dd5449caD600129b",
  vetDomainsPublicResolverAddress: "0xabac49445584C8b6c1472b030B1076Ac3901D7cf",
  vetDomainsReverseRegistrarAddress: "0x5c970901a587BA3932C835D4ae5FAE2BEa7e78Bc",
  vnsResolverAddress: "0xA11413086e163e41901bb81fdc5617c975Fa5a1A",
  vetDomainAvatarUrl: "https://vet.domains/api/avatar",
  gloDollarContractAddress: "0x29c630cce4ddb23900f5fe66ab55e488c15b9f5e"
};
var mainnet_default = config3;

// src/config/index.ts
var getConfig = (env) => {
  if (env === "solo") return solo_default;
  if (env === "test") return testnet_default;
  if (env === "main") return mainnet_default;
  throw new Error(`Unsupported NETWORK_TYPE ${env}`);
};

// src/utils/ipfs.ts
var validateIpfsUri = (uri) => {
  const trimmedUri = uri.trim();
  return /^ipfs:\/\/[a-zA-Z0-9]+(\/[^/]+)*\/?$/.test(trimmedUri);
};
function toIPFSURL(cid, fileName) {
  return `ipfs://${cid}/${fileName ?? ""}`;
}
async function uploadBlobToIPFS(blob, filename, networkType) {
  try {
    const form = new FormData();
    form.append("file", blob, filename);
    const response = await fetch(
      getConfig(networkType).ipfsPinningService,
      {
        method: "POST",
        headers: {
          "X-Project-Id": "vechain-kit"
        },
        body: form
      }
    );
    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }
    const data = await response.json();
    return data.IpfsHash;
  } catch (error) {
    console.error("Error uploading blob:", error);
    throw new Error("Failed to upload blob to IPFS");
  }
}

// src/types/Types.ts
var NFTMediaType = /* @__PURE__ */ ((NFTMediaType2) => {
  NFTMediaType2["IMAGE"] = "image";
  NFTMediaType2["VIDEO"] = "video";
  NFTMediaType2["UNKNOWN"] = "unknown";
  NFTMediaType2["TEXT"] = "text";
  return NFTMediaType2;
})(NFTMediaType || {});
var VePassportUserStatus = /* @__PURE__ */ ((VePassportUserStatus2) => {
  VePassportUserStatus2["NONE"] = "NONE";
  VePassportUserStatus2["WHITELIST"] = "WHITELIST";
  VePassportUserStatus2["BLACKLIST"] = "BLACKLIST";
  return VePassportUserStatus2;
})(VePassportUserStatus || {});
var CURRENCY_SYMBOLS = {
  usd: "$",
  gbp: "\xA3",
  eur: "\u20AC"
};

// src/types/ensTextRecords.ts
var ENS_TEXT_RECORDS = [
  "display",
  "avatar",
  "description",
  "keywords",
  "email",
  "url",
  "header",
  "notice",
  "location",
  "phone",
  "com.x"
];

// src/types/index.ts
var LegalDocumentType = /* @__PURE__ */ ((LegalDocumentType2) => {
  LegalDocumentType2["TERMS"] = "terms";
  LegalDocumentType2["PRIVACY"] = "privacy";
  LegalDocumentType2["COOKIES"] = "cookies";
  return LegalDocumentType2;
})(LegalDocumentType || {});
var LegalDocumentSource = /* @__PURE__ */ ((LegalDocumentSource2) => {
  LegalDocumentSource2["VECHAIN_KIT"] = "vechain-kit";
  LegalDocumentSource2["APPLICATION"] = "application";
  return LegalDocumentSource2;
})(LegalDocumentSource || {});

// src/utils/media.ts
var isValidMimeType = (mime, type) => {
  const found = type.find((t) => {
    if (mime?.split("/")[0] === t) {
      return true;
    }
  });
  return !!found;
};
var resolveMediaTypeFromMimeType = (mimeType) => {
  if (isValidMimeType(mimeType, ["image" /* IMAGE */])) return "image" /* IMAGE */;
  else if (isValidMimeType(mimeType, ["video" /* VIDEO */])) return "video" /* VIDEO */;
  return "unknown" /* UNKNOWN */;
};

// src/utils/uri.ts
var convertUriToUrl = (uri, networkType) => {
  if (uri.startsWith("data:")) return uri;
  const splitUri = uri?.split("://");
  if (splitUri.length !== 2) return null;
  const protocol = splitUri?.[0]?.trim();
  const uriWithoutProtocol = splitUri[1];
  switch (protocol) {
    case "ipfs":
      if (!validateIpfsUri(uri))
        throw new Error(`Invalid IPFS URI ${uri}`);
      return `${getConfig(networkType).ipfsFetchingService}/${uriWithoutProtocol}`;
    case "ar":
      return `https://arweave.net/${uriWithoutProtocol}`;
    default:
      return uri;
  }
};

// src/utils/gmNfts.ts
var gmNfts = [
  {
    level: "1",
    name: "Earth",
    image: "/images/nft-levels/0.png",
    multiplier: 1,
    b3trToUpgrade: 0
  },
  {
    level: "2",
    name: "Moon",
    image: "/images/nft-levels/1.png",
    multiplier: 1.1,
    b3trToUpgrade: 1e4
  },
  {
    level: "3",
    name: "Mercury",
    image: "/images/nft-levels/2.png",
    multiplier: 1.2,
    b3trToUpgrade: 25e3
  },
  {
    level: "4",
    name: "Venus",
    image: "/images/nft-levels/3.png",
    multiplier: 1.5,
    b3trToUpgrade: 5e4
  },
  {
    level: "5",
    name: "Mars",
    image: "/images/nft-levels/4.png",
    multiplier: 2,
    b3trToUpgrade: 1e5
  },
  {
    level: "6",
    name: "Jupiter",
    image: "/images/nft-levels/5.png",
    multiplier: 2.5,
    b3trToUpgrade: 25e4
  },
  {
    level: "7",
    name: "Saturn",
    image: "/images/nft-levels/6.png",
    multiplier: 3,
    b3trToUpgrade: 5e5
  },
  {
    level: "8",
    name: "Uranus",
    image: "/images/nft-levels/7.png",
    multiplier: 5,
    b3trToUpgrade: 25e5
  },
  {
    level: "9",
    name: "Neptune",
    image: "/images/nft-levels/8.png",
    multiplier: 10,
    b3trToUpgrade: 5e6
  },
  {
    level: "10",
    name: "Galaxy",
    image: "/images/nft-levels/9.png",
    multiplier: 25,
    b3trToUpgrade: 25e6
  }
];
var xNodeToGMstartingLevel = {
  1: 2,
  2: 4,
  3: 6,
  4: 2,
  5: 4,
  6: 6,
  7: 7
};

// src/utils/buildQueryString.ts
var buildQueryString = (params) => {
  const searchParams = new URLSearchParams();
  Object.keys(params).forEach((key) => {
    const value = params[key];
    if (value !== void 0 && value !== null) {
      searchParams.append(key, String(value));
    }
  });
  return searchParams.toString();
};

// src/utils/XNode.ts
var NodeStrengthLevelToImage = {
  "0": "/images/vnt/00-noNode.webp",
  "1": "/images/vnt/01-strength.webp",
  "2": "/images/vnt/02-thunder.webp",
  "3": "/images/vnt/03-mjolnir.webp",
  "4": "/images/vnt/04-vethorX.webp",
  "5": "/images/vnt/05-strengthX.webp",
  "6": "/images/vnt/06-thunderX.webp",
  "7": "/images/vnt/07-mjolnirX.webp"
};
var MinXNodeLevel = 4;
var EconomicNodeStrengthLevelToName = {
  "1": "Strength",
  "2": "Thunder",
  "3": "Mjolnir"
};
var XNodeStrengthLevelToName = {
  "4": "VeThorX",
  "5": "StrengthX",
  "6": "ThunderX",
  "7": "MjolnirX"
};
var allNodeStrengthLevelToName = {
  ...EconomicNodeStrengthLevelToName,
  ...XNodeStrengthLevelToName
};

// src/utils/url.ts
var isValidUrl = (value) => {
  try {
    new URL(value);
    return true;
  } catch {
    return false;
  }
};

exports.CURRENCY_SYMBOLS = CURRENCY_SYMBOLS;
exports.DEFAULT_PRIVY_ECOSYSTEM_APPS = DEFAULT_PRIVY_ECOSYSTEM_APPS;
exports.ENS_TEXT_RECORDS = ENS_TEXT_RECORDS;
exports.ENV = ENV;
exports.EconomicNodeStrengthLevelToName = EconomicNodeStrengthLevelToName;
exports.LegalDocumentSource = LegalDocumentSource;
exports.LegalDocumentType = LegalDocumentType;
exports.MinXNodeLevel = MinXNodeLevel;
exports.NFTMediaType = NFTMediaType;
exports.NodeStrengthLevelToImage = NodeStrengthLevelToImage;
exports.TOKEN_LOGOS = TOKEN_LOGOS;
exports.TOKEN_LOGO_COMPONENTS = TOKEN_LOGO_COMPONENTS;
exports.TogglePassportCheck = TogglePassportCheck;
exports.VECHAIN_KIT_COOKIES_CONFIG = VECHAIN_KIT_COOKIES_CONFIG;
exports.VECHAIN_KIT_MIXPANEL_PROJECT_NAME = VECHAIN_KIT_MIXPANEL_PROJECT_NAME;
exports.VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN = VECHAIN_KIT_MIXPANEL_PROJECT_TOKEN;
exports.VECHAIN_KIT_MIXPANEL_TOKENS = VECHAIN_KIT_MIXPANEL_TOKENS;
exports.VECHAIN_KIT_STORAGE_KEYS = VECHAIN_KIT_STORAGE_KEYS;
exports.VECHAIN_KIT_TERMS_CONFIG = VECHAIN_KIT_TERMS_CONFIG;
exports.VECHAIN_PRIVY_APP_ID = VECHAIN_PRIVY_APP_ID;
exports.VePassportUserStatus = VePassportUserStatus;
exports.XNodeStrengthLevelToName = XNodeStrengthLevelToName;
exports.allNodeStrengthLevelToName = allNodeStrengthLevelToName;
exports.buildQueryString = buildQueryString;
exports.compareAddresses = compareAddresses;
exports.compareListOfAddresses = compareListOfAddresses;
exports.convertUriToUrl = convertUriToUrl;
exports.getConfig = getConfig;
exports.getPicassoImage = getPicassoImage;
exports.gmNfts = gmNfts;
exports.humanAddress = humanAddress;
exports.humanDomain = humanDomain;
exports.humanNumber = humanNumber;
exports.isValidAddress = isValidAddress;
exports.isValidUrl = isValidUrl;
exports.isZero = isZero;
exports.leftPadWithZeros = leftPadWithZeros;
exports.notFoundImage = notFoundImage;
exports.randomTransactionUser = randomTransactionUser;
exports.regexPattern = regexPattern;
exports.resolveMediaTypeFromMimeType = resolveMediaTypeFromMimeType;
exports.toIPFSURL = toIPFSURL;
exports.uploadBlobToIPFS = uploadBlobToIPFS;
exports.validateIpfsUri = validateIpfsUri;
exports.xNodeToGMstartingLevel = xNodeToGMstartingLevel;
//# sourceMappingURL=chunk-ZZOAVX47.cjs.map
//# sourceMappingURL=chunk-ZZOAVX47.cjs.map