coinley-test 0.0.72 → 0.0.74
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,12 +1930,10 @@ 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,
|
|
1934
1933
|
hasProviders: !!window.ethereum.providers,
|
|
1935
1934
|
providersLength: (_a = window.ethereum.providers) == null ? void 0 : _a.length,
|
|
1936
1935
|
hasMetaMaskProperty: !!window.ethereum._metamask,
|
|
1937
|
-
hasRabbyGlobal: !!window.rabby
|
|
1938
|
-
hasZerionGlobal: !!window.zerion
|
|
1936
|
+
hasRabbyGlobal: !!window.rabby
|
|
1939
1937
|
});
|
|
1940
1938
|
if (this.isMetaMaskAvailable()) {
|
|
1941
1939
|
wallets.push({
|
|
@@ -1963,21 +1961,8 @@ class UniversalWalletManager {
|
|
|
1963
1961
|
} else {
|
|
1964
1962
|
console.log("❌ Rabby NOT detected");
|
|
1965
1963
|
}
|
|
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
|
-
}
|
|
1979
1964
|
if (wallets.length === 0 && window.ethereum) {
|
|
1980
|
-
console.log("🚨 EMERGENCY: No wallets detected but ethereum exists, showing
|
|
1965
|
+
console.log("🚨 EMERGENCY: No wallets detected but ethereum exists, showing both MetaMask and Rabby");
|
|
1981
1966
|
wallets.push(
|
|
1982
1967
|
{
|
|
1983
1968
|
type: "metamask",
|
|
@@ -1994,14 +1979,6 @@ class UniversalWalletManager {
|
|
|
1994
1979
|
description: "Connect using Rabby wallet (fallback)",
|
|
1995
1980
|
color: "blue",
|
|
1996
1981
|
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
|
|
2005
1982
|
}
|
|
2006
1983
|
);
|
|
2007
1984
|
}
|
|
@@ -2082,61 +2059,8 @@ class UniversalWalletManager {
|
|
|
2082
2059
|
console.log("❌ Rabby not detected through any method");
|
|
2083
2060
|
return false;
|
|
2084
2061
|
}
|
|
2085
|
-
// NEW: VERY STRICT Zerion detection - must distinguish from MetaMask
|
|
2086
|
-
isZerionAvailable() {
|
|
2087
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
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.providers) && Array.isArray(window.ethereum.providers)) {
|
|
2093
|
-
console.log("🔍 Zerion check: Searching in providers array...");
|
|
2094
|
-
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2095
|
-
const provider = window.ethereum.providers[i];
|
|
2096
|
-
console.log(`Provider ${i} Zerion check:`, {
|
|
2097
|
-
isZerion: provider.isZerion,
|
|
2098
|
-
isZerionWallet: provider.isZerionWallet,
|
|
2099
|
-
isMetaMask: provider.isMetaMask,
|
|
2100
|
-
constructor: (_b = provider.constructor) == null ? void 0 : _b.name,
|
|
2101
|
-
zerion: !!provider.zerion
|
|
2102
|
-
});
|
|
2103
|
-
if ((provider.isZerion === true || provider.isZerionWallet === true || provider.zerion) && provider.isMetaMask !== true) {
|
|
2104
|
-
console.log("✅ Zerion found in providers array (not MetaMask)");
|
|
2105
|
-
return true;
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
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
|
-
}
|
|
2115
|
-
if (window.zerion) {
|
|
2116
|
-
console.log("✅ Zerion detected: Global window.zerion object found");
|
|
2117
|
-
return true;
|
|
2118
|
-
}
|
|
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)");
|
|
2121
|
-
return true;
|
|
2122
|
-
}
|
|
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)");
|
|
2125
|
-
return true;
|
|
2126
|
-
}
|
|
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
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
console.log("❌ Zerion not detected through any method (or conflicts with MetaMask)");
|
|
2135
|
-
return false;
|
|
2136
|
-
}
|
|
2137
2062
|
// Get the correct provider for a specific wallet - VERY AGGRESSIVE approach
|
|
2138
2063
|
getProviderForWallet(walletType) {
|
|
2139
|
-
var _a;
|
|
2140
2064
|
if (!window.ethereum) {
|
|
2141
2065
|
throw new Error("No Ethereum wallet found");
|
|
2142
2066
|
}
|
|
@@ -2211,47 +2135,6 @@ class UniversalWalletManager {
|
|
|
2211
2135
|
if (!targetProvider) {
|
|
2212
2136
|
throw new Error("Rabby wallet not found. Please install Rabby extension.");
|
|
2213
2137
|
}
|
|
2214
|
-
} else if (walletType === "zerion") {
|
|
2215
|
-
console.log("🔷 Searching for Zerion provider...");
|
|
2216
|
-
if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
|
|
2217
|
-
console.log("🔍 Searching Zerion in providers array...");
|
|
2218
|
-
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2219
|
-
const provider = window.ethereum.providers[i];
|
|
2220
|
-
console.log(`Provider ${i} Zerion details:`, {
|
|
2221
|
-
isZerion: provider.isZerion,
|
|
2222
|
-
constructor: (_a = provider.constructor) == null ? void 0 : _a.name
|
|
2223
|
-
});
|
|
2224
|
-
if (provider.isZerion === true) {
|
|
2225
|
-
console.log("✅ Found Zerion provider in array!");
|
|
2226
|
-
targetProvider = provider;
|
|
2227
|
-
break;
|
|
2228
|
-
}
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
if (!targetProvider) {
|
|
2232
|
-
console.log("🔍 Checking main ethereum provider for Zerion...");
|
|
2233
|
-
if (window.ethereum.isZerion === true) {
|
|
2234
|
-
console.log("✅ Using main ethereum provider as Zerion!");
|
|
2235
|
-
targetProvider = window.ethereum;
|
|
2236
|
-
}
|
|
2237
|
-
}
|
|
2238
|
-
if (!targetProvider && window.zerion) {
|
|
2239
|
-
console.log("🔍 Found window.zerion object...");
|
|
2240
|
-
if (window.zerion.ethereum) {
|
|
2241
|
-
targetProvider = window.zerion.ethereum;
|
|
2242
|
-
console.log("✅ Using window.zerion.ethereum!");
|
|
2243
|
-
} else {
|
|
2244
|
-
targetProvider = window.zerion;
|
|
2245
|
-
console.log("✅ Using window.zerion directly!");
|
|
2246
|
-
}
|
|
2247
|
-
}
|
|
2248
|
-
if (!targetProvider) {
|
|
2249
|
-
console.log("🚨 AGGRESSIVE FALLBACK: Using main ethereum provider for Zerion");
|
|
2250
|
-
targetProvider = window.ethereum;
|
|
2251
|
-
}
|
|
2252
|
-
if (!targetProvider) {
|
|
2253
|
-
throw new Error("Zerion wallet not found. Please install Zerion extension.");
|
|
2254
|
-
}
|
|
2255
2138
|
}
|
|
2256
2139
|
console.log(`✅ Provider found for ${walletType}:`, {
|
|
2257
2140
|
isMetaMask: targetProvider.isMetaMask,
|
|
@@ -2706,7 +2589,7 @@ const WalletSelector = ({
|
|
|
2706
2589
|
if (["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche", "solana"].includes(selectedNetwork.shortName)) {
|
|
2707
2590
|
const detectedWallets = walletManager.current.getAvailableWallets();
|
|
2708
2591
|
if (detectedWallets.length === 0 && window.ethereum) {
|
|
2709
|
-
console.log("🚨 EMERGENCY OVERRIDE: No wallets detected but ethereum exists, forcing all
|
|
2592
|
+
console.log("🚨 EMERGENCY OVERRIDE: No wallets detected but ethereum exists, forcing all wallets to show");
|
|
2710
2593
|
return [
|
|
2711
2594
|
{
|
|
2712
2595
|
type: "metamask",
|
|
@@ -2725,11 +2608,11 @@ const WalletSelector = ({
|
|
|
2725
2608
|
isInstalled: true
|
|
2726
2609
|
},
|
|
2727
2610
|
{
|
|
2728
|
-
type: "
|
|
2729
|
-
name: "
|
|
2730
|
-
icon: "
|
|
2731
|
-
description: "Connect using
|
|
2732
|
-
color: "
|
|
2611
|
+
type: "cryptocom",
|
|
2612
|
+
name: "Crypto.com",
|
|
2613
|
+
icon: "💎",
|
|
2614
|
+
description: "Connect using Crypto.com DeFi Wallet",
|
|
2615
|
+
color: "blue",
|
|
2733
2616
|
isInstalled: true
|
|
2734
2617
|
}
|
|
2735
2618
|
];
|
|
@@ -2754,11 +2637,11 @@ const WalletSelector = ({
|
|
|
2754
2637
|
isInstalled: true
|
|
2755
2638
|
},
|
|
2756
2639
|
{
|
|
2757
|
-
type: "
|
|
2758
|
-
name: "
|
|
2759
|
-
icon: "
|
|
2760
|
-
description: "Connect using
|
|
2761
|
-
color: "
|
|
2640
|
+
type: "cryptocom",
|
|
2641
|
+
name: "Crypto.com",
|
|
2642
|
+
icon: "💎",
|
|
2643
|
+
description: "Connect using Crypto.com DeFi Wallet",
|
|
2644
|
+
color: "blue",
|
|
2762
2645
|
isInstalled: true
|
|
2763
2646
|
}
|
|
2764
2647
|
];
|
|
@@ -2787,7 +2670,7 @@ const WalletSelector = ({
|
|
|
2787
2670
|
console.log("💡 WALLET SELECTOR: window.ethereum exists:", !!window.ethereum);
|
|
2788
2671
|
console.log("💡 WALLET SELECTOR: window.ethereum.isMetaMask:", (_a = window.ethereum) == null ? void 0 : _a.isMetaMask);
|
|
2789
2672
|
console.log("💡 WALLET SELECTOR: window.ethereum.isRabby:", (_b = window.ethereum) == null ? void 0 : _b.isRabby);
|
|
2790
|
-
console.log("💡 WALLET SELECTOR: window.ethereum.
|
|
2673
|
+
console.log("💡 WALLET SELECTOR: window.ethereum.isCryptoCom:", (_c = window.ethereum) == null ? void 0 : _c.isCryptoCom);
|
|
2791
2674
|
const handleWalletClick = async (walletType) => {
|
|
2792
2675
|
setSelectedWalletType(walletType);
|
|
2793
2676
|
onWalletSelect(walletType);
|
|
@@ -2815,7 +2698,7 @@ const WalletSelector = ({
|
|
|
2815
2698
|
] }),
|
|
2816
2699
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2817
2700
|
"• ",
|
|
2818
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://
|
|
2701
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "https://crypto.com/defi-wallet", target: "_blank", rel: "noopener noreferrer", className: "text-amber-700 underline hover:text-amber-900", children: "Install Crypto.com DeFi Wallet" })
|
|
2819
2702
|
] })
|
|
2820
2703
|
] })
|
|
2821
2704
|
] }) })
|
|
@@ -2846,7 +2729,7 @@ const WalletSelector = ({
|
|
|
2846
2729
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-semibold text-gray-800 flex items-center", children: [
|
|
2847
2730
|
wallet.name,
|
|
2848
2731
|
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" }),
|
|
2849
|
-
wallet.type === "
|
|
2732
|
+
wallet.type === "cryptocom" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-2 px-2 py-1 bg-purple-100 text-purple-700 text-xs rounded-full", children: "DeFi" })
|
|
2850
2733
|
] }),
|
|
2851
2734
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-500", children: (connectedWallet == null ? void 0 : connectedWallet.walletType) === wallet.type ? "✅ Connected" : wallet.description })
|
|
2852
2735
|
] }),
|
|
@@ -2881,8 +2764,8 @@ const WalletSelector = ({
|
|
|
2881
2764
|
((_g = window.ethereum) == null ? void 0 : _g.isRabby) ? "✅" : "❌"
|
|
2882
2765
|
] }),
|
|
2883
2766
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2884
|
-
"• window.ethereum.
|
|
2885
|
-
((_h = window.ethereum) == null ? void 0 : _h.
|
|
2767
|
+
"• window.ethereum.isCryptoCom: ",
|
|
2768
|
+
((_h = window.ethereum) == null ? void 0 : _h.isCryptoCom) ? "✅" : "❌"
|
|
2886
2769
|
] }),
|
|
2887
2770
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2888
2771
|
"• window.ethereum.providers: ",
|
|
@@ -2894,8 +2777,8 @@ const WalletSelector = ({
|
|
|
2894
2777
|
window.rabby ? "✅" : "❌"
|
|
2895
2778
|
] }),
|
|
2896
2779
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2897
|
-
"• window.
|
|
2898
|
-
window.
|
|
2780
|
+
"• window.cryptoCom exists: ",
|
|
2781
|
+
window.cryptoCom ? "✅" : "❌"
|
|
2899
2782
|
] }),
|
|
2900
2783
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2901
2784
|
"• Showing ",
|
|
@@ -3348,7 +3231,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3348
3231
|
}
|
|
3349
3232
|
console.log(`🔄 Preparing ${selectedWalletType} transaction to:`, recipientAddress);
|
|
3350
3233
|
let txParams;
|
|
3351
|
-
if (["metamask", "rabby"
|
|
3234
|
+
if (["metamask", "rabby"].includes(selectedWalletType)) {
|
|
3352
3235
|
if (selectedToken.contractAddress) {
|
|
3353
3236
|
const decimals = selectedToken.decimals || 6;
|
|
3354
3237
|
const amount = Math.floor(paymentData.totalAmount * Math.pow(10, decimals));
|