coinley-test 0.0.62 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -2082,48 +2082,56 @@ class UniversalWalletManager {
2082
2082
  console.log("❌ Rabby not detected through any method");
2083
2083
  return false;
2084
2084
  }
2085
- // NEW: VERY INCLUSIVE Zerion detection
2085
+ // NEW: VERY STRICT Zerion detection - must distinguish from MetaMask
2086
2086
  isZerionAvailable() {
2087
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2087
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
2088
2088
  if (!window.ethereum && !window.zerion) {
2089
2089
  console.log("❌ Zerion check: No window.ethereum or window.zerion");
2090
2090
  return false;
2091
2091
  }
2092
- if (((_a = window.ethereum) == null ? void 0 : _a.isZerion) === true) {
2093
- console.log("✅ Zerion detected: Direct isZerion property");
2094
- return true;
2095
- }
2096
- if (((_b = window.ethereum) == null ? void 0 : _b.providers) && Array.isArray(window.ethereum.providers)) {
2092
+ if (((_a = window.ethereum) == null ? void 0 : _a.providers) && Array.isArray(window.ethereum.providers)) {
2097
2093
  console.log("🔍 Zerion check: Searching in providers array...");
2098
2094
  for (let i = 0; i < window.ethereum.providers.length; i++) {
2099
2095
  const provider = window.ethereum.providers[i];
2100
2096
  console.log(`Provider ${i} Zerion check:`, {
2101
2097
  isZerion: provider.isZerion,
2102
- constructor: (_c = provider.constructor) == null ? void 0 : _c.name
2098
+ isZerionWallet: provider.isZerionWallet,
2099
+ isMetaMask: provider.isMetaMask,
2100
+ constructor: (_b = provider.constructor) == null ? void 0 : _b.name,
2101
+ zerion: !!provider.zerion
2103
2102
  });
2104
- if (provider.isZerion === true) {
2105
- console.log("✅ Zerion found in providers array");
2103
+ if ((provider.isZerion === true || provider.isZerionWallet === true || provider.zerion) && provider.isMetaMask !== true) {
2104
+ console.log("✅ Zerion found in providers array (not MetaMask)");
2106
2105
  return true;
2107
2106
  }
2108
2107
  }
2109
2108
  }
2109
+ if (window.ethereum) {
2110
+ if ((window.ethereum.isZerion === true || window.ethereum.isZerionWallet === true) && window.ethereum.isMetaMask !== true) {
2111
+ console.log("✅ Zerion detected: Direct isZerion property (not MetaMask)");
2112
+ return true;
2113
+ }
2114
+ }
2110
2115
  if (window.zerion) {
2111
2116
  console.log("✅ Zerion detected: Global window.zerion object found");
2112
2117
  return true;
2113
2118
  }
2114
- if ((_d = window.ethereum) == null ? void 0 : _d.isZerion) {
2115
- console.log("✅ Zerion detected: isZerion property found");
2119
+ if (((_e = (_d = (_c = window.ethereum) == null ? void 0 : _c.constructor) == null ? void 0 : _d.name) == null ? void 0 : _e.toLowerCase().includes("zerion")) && !((_g = (_f = window.ethereum.constructor) == null ? void 0 : _f.name) == null ? void 0 : _g.toLowerCase().includes("metamask"))) {
2120
+ console.log("✅ Zerion detected: Constructor name contains Zerion (not MetaMask)");
2116
2121
  return true;
2117
2122
  }
2118
- if ((_g = (_f = (_e = window.ethereum) == null ? void 0 : _e.constructor) == null ? void 0 : _f.name) == null ? void 0 : _g.includes("Zerion")) {
2119
- console.log("✅ Zerion detected: Constructor name contains Zerion");
2123
+ if (typeof window !== "undefined" && ((_i = (_h = window.navigator) == null ? void 0 : _h.userAgent) == null ? void 0 : _i.includes("Zerion")) && !((_k = (_j = window.navigator) == null ? void 0 : _j.userAgent) == null ? void 0 : _k.includes("MetaMask"))) {
2124
+ console.log("✅ Zerion detected: User agent contains Zerion (not MetaMask)");
2120
2125
  return true;
2121
2126
  }
2122
- if (typeof window !== "undefined" && ((_i = (_h = window.navigator) == null ? void 0 : _h.userAgent) == null ? void 0 : _i.includes("Zerion"))) {
2123
- console.log(" Zerion detected: User agent contains Zerion");
2124
- return true;
2127
+ if (typeof document !== "undefined") {
2128
+ const zerionMeta = document.querySelector('meta[name="zerion"]') || document.querySelector('meta[content*="zerion"]');
2129
+ if (zerionMeta && !document.querySelector('meta[content*="metamask"]')) {
2130
+ console.log("✅ Zerion detected: DOM meta tags (not MetaMask)");
2131
+ return true;
2132
+ }
2125
2133
  }
2126
- console.log("❌ Zerion not detected through any method");
2134
+ console.log("❌ Zerion not detected through any method (or conflicts with MetaMask)");
2127
2135
  return false;
2128
2136
  }
2129
2137
  // Get the correct provider for a specific wallet - VERY AGGRESSIVE approach