coinley-test 0.0.61 → 0.0.62

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
@@ -1930,10 +1930,12 @@ class UniversalWalletManager {
1930
1930
  console.log("🔍 DEBUGGING: window.ethereum object:", {
1931
1931
  isMetaMask: window.ethereum.isMetaMask,
1932
1932
  isRabby: window.ethereum.isRabby,
1933
+ isZerion: window.ethereum.isZerion,
1933
1934
  hasProviders: !!window.ethereum.providers,
1934
1935
  providersLength: (_a = window.ethereum.providers) == null ? void 0 : _a.length,
1935
1936
  hasMetaMaskProperty: !!window.ethereum._metamask,
1936
- hasRabbyGlobal: !!window.rabby
1937
+ hasRabbyGlobal: !!window.rabby,
1938
+ hasZerionGlobal: !!window.zerion
1937
1939
  });
1938
1940
  if (this.isMetaMaskAvailable()) {
1939
1941
  wallets.push({
@@ -1961,8 +1963,21 @@ class UniversalWalletManager {
1961
1963
  } else {
1962
1964
  console.log("❌ Rabby NOT detected");
1963
1965
  }
1966
+ if (this.isZerionAvailable()) {
1967
+ wallets.push({
1968
+ type: "zerion",
1969
+ name: "Zerion",
1970
+ icon: "🔷",
1971
+ description: "Connect using Zerion wallet",
1972
+ color: "purple",
1973
+ isInstalled: true
1974
+ });
1975
+ console.log("✅ Zerion detected and added");
1976
+ } else {
1977
+ console.log("❌ Zerion NOT detected");
1978
+ }
1964
1979
  if (wallets.length === 0 && window.ethereum) {
1965
- console.log("🚨 EMERGENCY: No wallets detected but ethereum exists, showing both MetaMask and Rabby");
1980
+ console.log("🚨 EMERGENCY: No wallets detected but ethereum exists, showing all three wallets");
1966
1981
  wallets.push(
1967
1982
  {
1968
1983
  type: "metamask",
@@ -1979,6 +1994,14 @@ class UniversalWalletManager {
1979
1994
  description: "Connect using Rabby wallet (fallback)",
1980
1995
  color: "blue",
1981
1996
  isInstalled: true
1997
+ },
1998
+ {
1999
+ type: "zerion",
2000
+ name: "Zerion",
2001
+ icon: "🔷",
2002
+ description: "Connect using Zerion wallet (fallback)",
2003
+ color: "purple",
2004
+ isInstalled: true
1982
2005
  }
1983
2006
  );
1984
2007
  }
@@ -2059,8 +2082,53 @@ class UniversalWalletManager {
2059
2082
  console.log("❌ Rabby not detected through any method");
2060
2083
  return false;
2061
2084
  }
2085
+ // NEW: VERY INCLUSIVE Zerion detection
2086
+ isZerionAvailable() {
2087
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2088
+ if (!window.ethereum && !window.zerion) {
2089
+ console.log("❌ Zerion check: No window.ethereum or window.zerion");
2090
+ return false;
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)) {
2097
+ console.log("🔍 Zerion check: Searching in providers array...");
2098
+ for (let i = 0; i < window.ethereum.providers.length; i++) {
2099
+ const provider = window.ethereum.providers[i];
2100
+ console.log(`Provider ${i} Zerion check:`, {
2101
+ isZerion: provider.isZerion,
2102
+ constructor: (_c = provider.constructor) == null ? void 0 : _c.name
2103
+ });
2104
+ if (provider.isZerion === true) {
2105
+ console.log("✅ Zerion found in providers array");
2106
+ return true;
2107
+ }
2108
+ }
2109
+ }
2110
+ if (window.zerion) {
2111
+ console.log("✅ Zerion detected: Global window.zerion object found");
2112
+ return true;
2113
+ }
2114
+ if ((_d = window.ethereum) == null ? void 0 : _d.isZerion) {
2115
+ console.log("✅ Zerion detected: isZerion property found");
2116
+ return true;
2117
+ }
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");
2120
+ return true;
2121
+ }
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;
2125
+ }
2126
+ console.log("❌ Zerion not detected through any method");
2127
+ return false;
2128
+ }
2062
2129
  // Get the correct provider for a specific wallet - VERY AGGRESSIVE approach
2063
2130
  getProviderForWallet(walletType) {
2131
+ var _a;
2064
2132
  if (!window.ethereum) {
2065
2133
  throw new Error("No Ethereum wallet found");
2066
2134
  }
@@ -2135,6 +2203,47 @@ class UniversalWalletManager {
2135
2203
  if (!targetProvider) {
2136
2204
  throw new Error("Rabby wallet not found. Please install Rabby extension.");
2137
2205
  }
2206
+ } else if (walletType === "zerion") {
2207
+ console.log("🔷 Searching for Zerion provider...");
2208
+ if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
2209
+ console.log("🔍 Searching Zerion in providers array...");
2210
+ for (let i = 0; i < window.ethereum.providers.length; i++) {
2211
+ const provider = window.ethereum.providers[i];
2212
+ console.log(`Provider ${i} Zerion details:`, {
2213
+ isZerion: provider.isZerion,
2214
+ constructor: (_a = provider.constructor) == null ? void 0 : _a.name
2215
+ });
2216
+ if (provider.isZerion === true) {
2217
+ console.log("✅ Found Zerion provider in array!");
2218
+ targetProvider = provider;
2219
+ break;
2220
+ }
2221
+ }
2222
+ }
2223
+ if (!targetProvider) {
2224
+ console.log("🔍 Checking main ethereum provider for Zerion...");
2225
+ if (window.ethereum.isZerion === true) {
2226
+ console.log("✅ Using main ethereum provider as Zerion!");
2227
+ targetProvider = window.ethereum;
2228
+ }
2229
+ }
2230
+ if (!targetProvider && window.zerion) {
2231
+ console.log("🔍 Found window.zerion object...");
2232
+ if (window.zerion.ethereum) {
2233
+ targetProvider = window.zerion.ethereum;
2234
+ console.log("✅ Using window.zerion.ethereum!");
2235
+ } else {
2236
+ targetProvider = window.zerion;
2237
+ console.log("✅ Using window.zerion directly!");
2238
+ }
2239
+ }
2240
+ if (!targetProvider) {
2241
+ console.log("🚨 AGGRESSIVE FALLBACK: Using main ethereum provider for Zerion");
2242
+ targetProvider = window.ethereum;
2243
+ }
2244
+ if (!targetProvider) {
2245
+ throw new Error("Zerion wallet not found. Please install Zerion extension.");
2246
+ }
2138
2247
  }
2139
2248
  console.log(`✅ Provider found for ${walletType}:`, {
2140
2249
  isMetaMask: targetProvider.isMetaMask,
@@ -2581,7 +2690,7 @@ const WalletSelector = ({
2581
2690
  connectedWallet,
2582
2691
  loading
2583
2692
  }) => {
2584
- var _a, _b, _c, _d, _e, _f, _g, _h;
2693
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2585
2694
  const [selectedWalletType, setSelectedWalletType] = useState(null);
2586
2695
  const walletManager = useRef(new UniversalWalletManager());
2587
2696
  const getAvailableWallets = () => {
@@ -2589,7 +2698,7 @@ const WalletSelector = ({
2589
2698
  if (["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche", "solana"].includes(selectedNetwork.shortName)) {
2590
2699
  const detectedWallets = walletManager.current.getAvailableWallets();
2591
2700
  if (detectedWallets.length === 0 && window.ethereum) {
2592
- console.log("🚨 EMERGENCY OVERRIDE: No wallets detected but ethereum exists, forcing both wallets to show");
2701
+ console.log("🚨 EMERGENCY OVERRIDE: No wallets detected but ethereum exists, forcing all three wallets to show");
2593
2702
  return [
2594
2703
  {
2595
2704
  type: "metamask",
@@ -2606,10 +2715,18 @@ const WalletSelector = ({
2606
2715
  description: "Connect using Rabby wallet",
2607
2716
  color: "blue",
2608
2717
  isInstalled: true
2718
+ },
2719
+ {
2720
+ type: "zerion",
2721
+ name: "Zerion",
2722
+ icon: "🔷",
2723
+ description: "Connect using Zerion wallet",
2724
+ color: "purple",
2725
+ isInstalled: true
2609
2726
  }
2610
2727
  ];
2611
2728
  }
2612
- if (detectedWallets.length < 2 && window.ethereum) {
2729
+ if (detectedWallets.length < 3 && window.ethereum) {
2613
2730
  console.log("🚨 SAFETY CHECK: Adding missing wallets");
2614
2731
  const allWallets = [
2615
2732
  {
@@ -2627,6 +2744,14 @@ const WalletSelector = ({
2627
2744
  description: "Connect using Rabby wallet",
2628
2745
  color: "blue",
2629
2746
  isInstalled: true
2747
+ },
2748
+ {
2749
+ type: "zerion",
2750
+ name: "Zerion",
2751
+ icon: "🔷",
2752
+ description: "Connect using Zerion wallet",
2753
+ color: "purple",
2754
+ isInstalled: true
2630
2755
  }
2631
2756
  ];
2632
2757
  const combinedWallets = [];
@@ -2654,6 +2779,7 @@ const WalletSelector = ({
2654
2779
  console.log("💡 WALLET SELECTOR: window.ethereum exists:", !!window.ethereum);
2655
2780
  console.log("💡 WALLET SELECTOR: window.ethereum.isMetaMask:", (_a = window.ethereum) == null ? void 0 : _a.isMetaMask);
2656
2781
  console.log("💡 WALLET SELECTOR: window.ethereum.isRabby:", (_b = window.ethereum) == null ? void 0 : _b.isRabby);
2782
+ console.log("💡 WALLET SELECTOR: window.ethereum.isZerion:", (_c = window.ethereum) == null ? void 0 : _c.isZerion);
2657
2783
  const handleWalletClick = async (walletType) => {
2658
2784
  setSelectedWalletType(walletType);
2659
2785
  onWalletSelect(walletType);
@@ -2678,6 +2804,10 @@ const WalletSelector = ({
2678
2804
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2679
2805
  "• ",
2680
2806
  /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://rabby.io", target: "_blank", rel: "noopener noreferrer", className: "text-amber-700 underline hover:text-amber-900", children: "Install Rabby Wallet" })
2807
+ ] }),
2808
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2809
+ "• ",
2810
+ /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://zerion.io", target: "_blank", rel: "noopener noreferrer", className: "text-amber-700 underline hover:text-amber-900", children: "Install Zerion Wallet" })
2681
2811
  ] })
2682
2812
  ] })
2683
2813
  ] }) })
@@ -2707,7 +2837,8 @@ const WalletSelector = ({
2707
2837
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
2708
2838
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-semibold text-gray-800 flex items-center", children: [
2709
2839
  wallet.name,
2710
- wallet.type === "rabby" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 px-2 py-1 bg-blue-100 text-blue-700 text-xs rounded-full", children: "NEW" })
2840
+ wallet.type === "rabby" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 px-2 py-1 bg-blue-100 text-blue-700 text-xs rounded-full", children: "NEW" }),
2841
+ wallet.type === "zerion" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 px-2 py-1 bg-purple-100 text-purple-700 text-xs rounded-full", children: "HOT" })
2711
2842
  ] }),
2712
2843
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-500", children: (connectedWallet == null ? void 0 : connectedWallet.walletType) === wallet.type ? "✅ Connected" : wallet.description })
2713
2844
  ] }),
@@ -2719,9 +2850,9 @@ const WalletSelector = ({
2719
2850
  connectedWallet && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 p-3 bg-green-50 rounded-lg border border-green-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-green-800 text-center", style: { fontFamily: "Bricolage Grotesque, sans-serif" }, children: [
2720
2851
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium", children: "✅ Wallet Connected" }),
2721
2852
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs mt-1", children: [
2722
- (_c = connectedWallet.account) == null ? void 0 : _c.slice(0, 6),
2853
+ (_d = connectedWallet.account) == null ? void 0 : _d.slice(0, 6),
2723
2854
  "...",
2724
- (_d = connectedWallet.account) == null ? void 0 : _d.slice(-4),
2855
+ (_e = connectedWallet.account) == null ? void 0 : _e.slice(-4),
2725
2856
  " (",
2726
2857
  connectedWallet.walletType,
2727
2858
  ")"
@@ -2735,21 +2866,29 @@ const WalletSelector = ({
2735
2866
  ] }),
2736
2867
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2737
2868
  "• window.ethereum.isMetaMask: ",
2738
- ((_e = window.ethereum) == null ? void 0 : _e.isMetaMask) ? "✅" : "❌"
2869
+ ((_f = window.ethereum) == null ? void 0 : _f.isMetaMask) ? "✅" : "❌"
2739
2870
  ] }),
2740
2871
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2741
2872
  "• window.ethereum.isRabby: ",
2742
- ((_f = window.ethereum) == null ? void 0 : _f.isRabby) ? "✅" : "❌"
2873
+ ((_g = window.ethereum) == null ? void 0 : _g.isRabby) ? "✅" : "❌"
2874
+ ] }),
2875
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2876
+ "• window.ethereum.isZerion: ",
2877
+ ((_h = window.ethereum) == null ? void 0 : _h.isZerion) ? "✅" : "❌"
2743
2878
  ] }),
2744
2879
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2745
2880
  "• window.ethereum.providers: ",
2746
- ((_h = (_g = window.ethereum) == null ? void 0 : _g.providers) == null ? void 0 : _h.length) || 0,
2881
+ ((_j = (_i = window.ethereum) == null ? void 0 : _i.providers) == null ? void 0 : _j.length) || 0,
2747
2882
  " provider(s)"
2748
2883
  ] }),
2749
2884
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2750
2885
  "• window.rabby exists: ",
2751
2886
  window.rabby ? "✅" : "❌"
2752
2887
  ] }),
2888
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2889
+ "• window.zerion exists: ",
2890
+ window.zerion ? "✅" : "❌"
2891
+ ] }),
2753
2892
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
2754
2893
  "• Showing ",
2755
2894
  availableWallets.length,
@@ -3201,7 +3340,7 @@ const EnhancedSimpleCoinleyPayment = ({
3201
3340
  }
3202
3341
  console.log(`🔄 Preparing ${selectedWalletType} transaction to:`, recipientAddress);
3203
3342
  let txParams;
3204
- if (["metamask", "rabby"].includes(selectedWalletType)) {
3343
+ if (["metamask", "rabby", "zerion"].includes(selectedWalletType)) {
3205
3344
  if (selectedToken.contractAddress) {
3206
3345
  const decimals = selectedToken.decimals || 6;
3207
3346
  const amount = Math.floor(paymentData.totalAmount * Math.pow(10, decimals));