coinley-test 0.0.60 → 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 +395 -31
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/vanilla/coinley-vanilla.umd.js +3 -3
- package/dist/vanilla/coinley-vanilla.umd.js.map +1 -1
- package/dist/vanilla/style.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1919,12 +1919,24 @@ class UniversalWalletManager {
|
|
|
1919
1919
|
this.connectedWallet = null;
|
|
1920
1920
|
this.walletType = null;
|
|
1921
1921
|
}
|
|
1922
|
-
// Detect all available wallets
|
|
1922
|
+
// Detect all available wallets - VERY INCLUSIVE approach
|
|
1923
1923
|
getAvailableWallets() {
|
|
1924
|
+
var _a;
|
|
1924
1925
|
const wallets = [];
|
|
1925
1926
|
if (!window.ethereum) {
|
|
1927
|
+
console.log("❌ No window.ethereum found");
|
|
1926
1928
|
return wallets;
|
|
1927
1929
|
}
|
|
1930
|
+
console.log("🔍 DEBUGGING: window.ethereum object:", {
|
|
1931
|
+
isMetaMask: window.ethereum.isMetaMask,
|
|
1932
|
+
isRabby: window.ethereum.isRabby,
|
|
1933
|
+
isZerion: window.ethereum.isZerion,
|
|
1934
|
+
hasProviders: !!window.ethereum.providers,
|
|
1935
|
+
providersLength: (_a = window.ethereum.providers) == null ? void 0 : _a.length,
|
|
1936
|
+
hasMetaMaskProperty: !!window.ethereum._metamask,
|
|
1937
|
+
hasRabbyGlobal: !!window.rabby,
|
|
1938
|
+
hasZerionGlobal: !!window.zerion
|
|
1939
|
+
});
|
|
1928
1940
|
if (this.isMetaMaskAvailable()) {
|
|
1929
1941
|
wallets.push({
|
|
1930
1942
|
type: "metamask",
|
|
@@ -1934,6 +1946,9 @@ class UniversalWalletManager {
|
|
|
1934
1946
|
color: "orange",
|
|
1935
1947
|
isInstalled: true
|
|
1936
1948
|
});
|
|
1949
|
+
console.log("✅ MetaMask detected and added");
|
|
1950
|
+
} else {
|
|
1951
|
+
console.log("❌ MetaMask NOT detected");
|
|
1937
1952
|
}
|
|
1938
1953
|
if (this.isRabbyAvailable()) {
|
|
1939
1954
|
wallets.push({
|
|
@@ -1944,75 +1959,297 @@ class UniversalWalletManager {
|
|
|
1944
1959
|
color: "blue",
|
|
1945
1960
|
isInstalled: true
|
|
1946
1961
|
});
|
|
1962
|
+
console.log("✅ Rabby detected and added");
|
|
1963
|
+
} else {
|
|
1964
|
+
console.log("❌ Rabby NOT detected");
|
|
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
|
+
}
|
|
1979
|
+
if (wallets.length === 0 && window.ethereum) {
|
|
1980
|
+
console.log("🚨 EMERGENCY: No wallets detected but ethereum exists, showing all three wallets");
|
|
1981
|
+
wallets.push(
|
|
1982
|
+
{
|
|
1983
|
+
type: "metamask",
|
|
1984
|
+
name: "MetaMask",
|
|
1985
|
+
icon: "🦊",
|
|
1986
|
+
description: "Connect using MetaMask wallet (fallback)",
|
|
1987
|
+
color: "orange",
|
|
1988
|
+
isInstalled: true
|
|
1989
|
+
},
|
|
1990
|
+
{
|
|
1991
|
+
type: "rabby",
|
|
1992
|
+
name: "Rabby",
|
|
1993
|
+
icon: "🐰",
|
|
1994
|
+
description: "Connect using Rabby wallet (fallback)",
|
|
1995
|
+
color: "blue",
|
|
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
|
|
2005
|
+
}
|
|
2006
|
+
);
|
|
1947
2007
|
}
|
|
1948
|
-
console.log("🔍
|
|
2008
|
+
console.log("🔍 Final available wallets:", wallets.map((w) => w.name));
|
|
1949
2009
|
return wallets;
|
|
1950
2010
|
}
|
|
1951
|
-
//
|
|
2011
|
+
// VERY INCLUSIVE MetaMask detection
|
|
1952
2012
|
isMetaMaskAvailable() {
|
|
1953
|
-
|
|
1954
|
-
if (
|
|
2013
|
+
var _a, _b, _c;
|
|
2014
|
+
if (!window.ethereum) {
|
|
2015
|
+
console.log("❌ MetaMask check: No window.ethereum");
|
|
2016
|
+
return false;
|
|
2017
|
+
}
|
|
2018
|
+
if (window.ethereum.isMetaMask === true) {
|
|
2019
|
+
console.log("✅ MetaMask detected: Direct isMetaMask property");
|
|
1955
2020
|
return true;
|
|
1956
2021
|
}
|
|
1957
2022
|
if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2023
|
+
console.log("🔍 MetaMask check: Searching in providers array...");
|
|
2024
|
+
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2025
|
+
const provider = window.ethereum.providers[i];
|
|
2026
|
+
console.log(`Provider ${i}:`, {
|
|
2027
|
+
isMetaMask: provider.isMetaMask,
|
|
2028
|
+
isRabby: provider.isRabby,
|
|
2029
|
+
hasMetaMask: !!provider._metamask,
|
|
2030
|
+
constructor: (_a = provider.constructor) == null ? void 0 : _a.name
|
|
2031
|
+
});
|
|
2032
|
+
if (provider.isMetaMask === true) {
|
|
2033
|
+
console.log("✅ MetaMask found in providers array");
|
|
2034
|
+
return true;
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
1961
2037
|
}
|
|
1962
|
-
if (window.ethereum._metamask
|
|
2038
|
+
if (window.ethereum._metamask) {
|
|
2039
|
+
console.log("✅ MetaMask detected: _metamask property found");
|
|
1963
2040
|
return true;
|
|
1964
2041
|
}
|
|
2042
|
+
if ((_c = (_b = window.ethereum.constructor) == null ? void 0 : _b.name) == null ? void 0 : _c.includes("MetaMask")) {
|
|
2043
|
+
console.log("✅ MetaMask detected: Constructor name contains MetaMask");
|
|
2044
|
+
return true;
|
|
2045
|
+
}
|
|
2046
|
+
if (window.ethereum && !window.ethereum.isRabby && !window.rabby) {
|
|
2047
|
+
console.log("✅ MetaMask detected: Permissive fallback (ethereum exists, no clear Rabby)");
|
|
2048
|
+
return true;
|
|
2049
|
+
}
|
|
2050
|
+
console.log("❌ MetaMask not detected through any method");
|
|
1965
2051
|
return false;
|
|
1966
2052
|
}
|
|
1967
|
-
//
|
|
2053
|
+
// VERY INCLUSIVE Rabby detection
|
|
1968
2054
|
isRabbyAvailable() {
|
|
1969
|
-
|
|
1970
|
-
if (window.ethereum
|
|
2055
|
+
var _a, _b, _c, _d, _e;
|
|
2056
|
+
if (!window.ethereum && !window.rabby) {
|
|
2057
|
+
console.log("❌ Rabby check: No window.ethereum or window.rabby");
|
|
2058
|
+
return false;
|
|
2059
|
+
}
|
|
2060
|
+
if (((_a = window.ethereum) == null ? void 0 : _a.isRabby) === true) {
|
|
2061
|
+
console.log("✅ Rabby detected: Direct isRabby property");
|
|
1971
2062
|
return true;
|
|
1972
2063
|
}
|
|
1973
|
-
if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
|
|
1974
|
-
|
|
2064
|
+
if (((_b = window.ethereum) == null ? void 0 : _b.providers) && Array.isArray(window.ethereum.providers)) {
|
|
2065
|
+
console.log("🔍 Rabby check: Searching in providers array...");
|
|
2066
|
+
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2067
|
+
const provider = window.ethereum.providers[i];
|
|
2068
|
+
if (provider.isRabby === true) {
|
|
2069
|
+
console.log("✅ Rabby found in providers array");
|
|
2070
|
+
return true;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
1975
2073
|
}
|
|
1976
2074
|
if (window.rabby) {
|
|
2075
|
+
console.log("✅ Rabby detected: Global window.rabby object found");
|
|
2076
|
+
return true;
|
|
2077
|
+
}
|
|
2078
|
+
if ((_e = (_d = (_c = window.ethereum) == null ? void 0 : _c.constructor) == null ? void 0 : _d.name) == null ? void 0 : _e.includes("Rabby")) {
|
|
2079
|
+
console.log("✅ Rabby detected: Constructor name contains Rabby");
|
|
2080
|
+
return true;
|
|
2081
|
+
}
|
|
2082
|
+
console.log("❌ Rabby not detected through any method");
|
|
2083
|
+
return false;
|
|
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");
|
|
1977
2124
|
return true;
|
|
1978
2125
|
}
|
|
2126
|
+
console.log("❌ Zerion not detected through any method");
|
|
1979
2127
|
return false;
|
|
1980
2128
|
}
|
|
1981
|
-
// Get the correct provider for a specific wallet
|
|
2129
|
+
// Get the correct provider for a specific wallet - VERY AGGRESSIVE approach
|
|
1982
2130
|
getProviderForWallet(walletType) {
|
|
2131
|
+
var _a;
|
|
1983
2132
|
if (!window.ethereum) {
|
|
1984
2133
|
throw new Error("No Ethereum wallet found");
|
|
1985
2134
|
}
|
|
2135
|
+
console.log(`🔍 Getting provider for ${walletType}...`);
|
|
1986
2136
|
let targetProvider = null;
|
|
1987
2137
|
if (walletType === "metamask") {
|
|
2138
|
+
console.log("🦊 Searching for MetaMask provider...");
|
|
1988
2139
|
if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
2140
|
+
console.log("🔍 Searching MetaMask in providers array...");
|
|
2141
|
+
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2142
|
+
const provider = window.ethereum.providers[i];
|
|
2143
|
+
console.log(`Provider ${i} details:`, {
|
|
2144
|
+
isMetaMask: provider.isMetaMask,
|
|
2145
|
+
isRabby: provider.isRabby,
|
|
2146
|
+
hasMetaMask: !!provider._metamask
|
|
2147
|
+
});
|
|
2148
|
+
if (provider.isMetaMask === true || provider._metamask) {
|
|
2149
|
+
console.log("✅ Found MetaMask provider in array!");
|
|
2150
|
+
targetProvider = provider;
|
|
2151
|
+
break;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
1992
2154
|
}
|
|
1993
|
-
if (!targetProvider
|
|
1994
|
-
|
|
2155
|
+
if (!targetProvider) {
|
|
2156
|
+
console.log("🔍 Checking main ethereum provider for MetaMask...");
|
|
2157
|
+
if (window.ethereum.isMetaMask === true || window.ethereum._metamask) {
|
|
2158
|
+
console.log("✅ Using main ethereum provider as MetaMask!");
|
|
2159
|
+
targetProvider = window.ethereum;
|
|
2160
|
+
}
|
|
1995
2161
|
}
|
|
1996
|
-
if (!targetProvider
|
|
2162
|
+
if (!targetProvider) {
|
|
2163
|
+
console.log("🚨 AGGRESSIVE FALLBACK: Using main ethereum provider for MetaMask");
|
|
1997
2164
|
targetProvider = window.ethereum;
|
|
1998
2165
|
}
|
|
1999
2166
|
if (!targetProvider) {
|
|
2000
2167
|
throw new Error("MetaMask not found. Please install MetaMask extension.");
|
|
2001
2168
|
}
|
|
2002
2169
|
} else if (walletType === "rabby") {
|
|
2170
|
+
console.log("🐰 Searching for Rabby provider...");
|
|
2003
2171
|
if (window.ethereum.providers && Array.isArray(window.ethereum.providers)) {
|
|
2004
|
-
|
|
2172
|
+
console.log("🔍 Searching Rabby in providers array...");
|
|
2173
|
+
for (let i = 0; i < window.ethereum.providers.length; i++) {
|
|
2174
|
+
const provider = window.ethereum.providers[i];
|
|
2175
|
+
if (provider.isRabby === true) {
|
|
2176
|
+
console.log("✅ Found Rabby provider in array!");
|
|
2177
|
+
targetProvider = provider;
|
|
2178
|
+
break;
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2005
2181
|
}
|
|
2006
|
-
if (!targetProvider
|
|
2007
|
-
|
|
2182
|
+
if (!targetProvider) {
|
|
2183
|
+
console.log("🔍 Checking main ethereum provider for Rabby...");
|
|
2184
|
+
if (window.ethereum.isRabby === true) {
|
|
2185
|
+
console.log("✅ Using main ethereum provider as Rabby!");
|
|
2186
|
+
targetProvider = window.ethereum;
|
|
2187
|
+
}
|
|
2008
2188
|
}
|
|
2009
2189
|
if (!targetProvider && window.rabby) {
|
|
2010
|
-
|
|
2190
|
+
console.log("🔍 Found window.rabby object...");
|
|
2191
|
+
if (window.rabby.ethereum) {
|
|
2192
|
+
targetProvider = window.rabby.ethereum;
|
|
2193
|
+
console.log("✅ Using window.rabby.ethereum!");
|
|
2194
|
+
} else {
|
|
2195
|
+
targetProvider = window.rabby;
|
|
2196
|
+
console.log("✅ Using window.rabby directly!");
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
if (!targetProvider && window.ethereum.isRabby) {
|
|
2200
|
+
console.log("🚨 AGGRESSIVE FALLBACK: Using main ethereum provider for Rabby");
|
|
2201
|
+
targetProvider = window.ethereum;
|
|
2011
2202
|
}
|
|
2012
2203
|
if (!targetProvider) {
|
|
2013
2204
|
throw new Error("Rabby wallet not found. Please install Rabby extension.");
|
|
2014
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
|
+
}
|
|
2015
2247
|
}
|
|
2248
|
+
console.log(`✅ Provider found for ${walletType}:`, {
|
|
2249
|
+
isMetaMask: targetProvider.isMetaMask,
|
|
2250
|
+
isRabby: targetProvider.isRabby,
|
|
2251
|
+
hasMetaMask: !!targetProvider._metamask
|
|
2252
|
+
});
|
|
2016
2253
|
return targetProvider;
|
|
2017
2254
|
}
|
|
2018
2255
|
// Connect to a specific wallet
|
|
@@ -2453,17 +2690,96 @@ const WalletSelector = ({
|
|
|
2453
2690
|
connectedWallet,
|
|
2454
2691
|
loading
|
|
2455
2692
|
}) => {
|
|
2456
|
-
var _a, _b;
|
|
2693
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2457
2694
|
const [selectedWalletType, setSelectedWalletType] = useState(null);
|
|
2458
2695
|
const walletManager = useRef(new UniversalWalletManager());
|
|
2459
2696
|
const getAvailableWallets = () => {
|
|
2460
2697
|
if (!selectedNetwork) return [];
|
|
2461
2698
|
if (["ethereum", "bsc", "polygon", "arbitrum", "optimism", "avalanche", "solana"].includes(selectedNetwork.shortName)) {
|
|
2462
|
-
|
|
2699
|
+
const detectedWallets = walletManager.current.getAvailableWallets();
|
|
2700
|
+
if (detectedWallets.length === 0 && window.ethereum) {
|
|
2701
|
+
console.log("🚨 EMERGENCY OVERRIDE: No wallets detected but ethereum exists, forcing all three wallets to show");
|
|
2702
|
+
return [
|
|
2703
|
+
{
|
|
2704
|
+
type: "metamask",
|
|
2705
|
+
name: "MetaMask",
|
|
2706
|
+
icon: "🦊",
|
|
2707
|
+
description: "Connect using MetaMask wallet",
|
|
2708
|
+
color: "orange",
|
|
2709
|
+
isInstalled: true
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
type: "rabby",
|
|
2713
|
+
name: "Rabby",
|
|
2714
|
+
icon: "🐰",
|
|
2715
|
+
description: "Connect using Rabby wallet",
|
|
2716
|
+
color: "blue",
|
|
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
|
|
2726
|
+
}
|
|
2727
|
+
];
|
|
2728
|
+
}
|
|
2729
|
+
if (detectedWallets.length < 3 && window.ethereum) {
|
|
2730
|
+
console.log("🚨 SAFETY CHECK: Adding missing wallets");
|
|
2731
|
+
const allWallets = [
|
|
2732
|
+
{
|
|
2733
|
+
type: "metamask",
|
|
2734
|
+
name: "MetaMask",
|
|
2735
|
+
icon: "🦊",
|
|
2736
|
+
description: "Connect using MetaMask wallet",
|
|
2737
|
+
color: "orange",
|
|
2738
|
+
isInstalled: true
|
|
2739
|
+
},
|
|
2740
|
+
{
|
|
2741
|
+
type: "rabby",
|
|
2742
|
+
name: "Rabby",
|
|
2743
|
+
icon: "🐰",
|
|
2744
|
+
description: "Connect using Rabby wallet",
|
|
2745
|
+
color: "blue",
|
|
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
|
|
2755
|
+
}
|
|
2756
|
+
];
|
|
2757
|
+
const combinedWallets = [];
|
|
2758
|
+
const addedTypes = /* @__PURE__ */ new Set();
|
|
2759
|
+
detectedWallets.forEach((wallet) => {
|
|
2760
|
+
if (!addedTypes.has(wallet.type)) {
|
|
2761
|
+
combinedWallets.push(wallet);
|
|
2762
|
+
addedTypes.add(wallet.type);
|
|
2763
|
+
}
|
|
2764
|
+
});
|
|
2765
|
+
allWallets.forEach((wallet) => {
|
|
2766
|
+
if (!addedTypes.has(wallet.type)) {
|
|
2767
|
+
combinedWallets.push(wallet);
|
|
2768
|
+
addedTypes.add(wallet.type);
|
|
2769
|
+
}
|
|
2770
|
+
});
|
|
2771
|
+
return combinedWallets;
|
|
2772
|
+
}
|
|
2773
|
+
return detectedWallets;
|
|
2463
2774
|
}
|
|
2464
2775
|
return [];
|
|
2465
2776
|
};
|
|
2466
2777
|
const availableWallets = getAvailableWallets();
|
|
2778
|
+
console.log("💡 WALLET SELECTOR: Showing wallets:", availableWallets.map((w) => w.name));
|
|
2779
|
+
console.log("💡 WALLET SELECTOR: window.ethereum exists:", !!window.ethereum);
|
|
2780
|
+
console.log("💡 WALLET SELECTOR: window.ethereum.isMetaMask:", (_a = window.ethereum) == null ? void 0 : _a.isMetaMask);
|
|
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);
|
|
2467
2783
|
const handleWalletClick = async (walletType) => {
|
|
2468
2784
|
setSelectedWalletType(walletType);
|
|
2469
2785
|
onWalletSelect(walletType);
|
|
@@ -2488,6 +2804,10 @@ const WalletSelector = ({
|
|
|
2488
2804
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2489
2805
|
"• ",
|
|
2490
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" })
|
|
2491
2811
|
] })
|
|
2492
2812
|
] })
|
|
2493
2813
|
] }) })
|
|
@@ -2499,6 +2819,12 @@ const WalletSelector = ({
|
|
|
2499
2819
|
selectedNetwork.name,
|
|
2500
2820
|
":"
|
|
2501
2821
|
] }),
|
|
2822
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-gray-500 mb-2", style: { fontFamily: "Bricolage Grotesque, sans-serif" }, children: [
|
|
2823
|
+
"Debug: Found ",
|
|
2824
|
+
availableWallets.length,
|
|
2825
|
+
" wallet(s) - ",
|
|
2826
|
+
availableWallets.map((w) => w.name).join(", ")
|
|
2827
|
+
] }),
|
|
2502
2828
|
availableWallets.map((wallet) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2503
2829
|
"button",
|
|
2504
2830
|
{
|
|
@@ -2511,7 +2837,8 @@ const WalletSelector = ({
|
|
|
2511
2837
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
2512
2838
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "font-semibold text-gray-800 flex items-center", children: [
|
|
2513
2839
|
wallet.name,
|
|
2514
|
-
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" })
|
|
2515
2842
|
] }),
|
|
2516
2843
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm text-gray-500", children: (connectedWallet == null ? void 0 : connectedWallet.walletType) === wallet.type ? "✅ Connected" : wallet.description })
|
|
2517
2844
|
] }),
|
|
@@ -2523,13 +2850,50 @@ const WalletSelector = ({
|
|
|
2523
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: [
|
|
2524
2851
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium", children: "✅ Wallet Connected" }),
|
|
2525
2852
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs mt-1", children: [
|
|
2526
|
-
(
|
|
2853
|
+
(_d = connectedWallet.account) == null ? void 0 : _d.slice(0, 6),
|
|
2527
2854
|
"...",
|
|
2528
|
-
(
|
|
2855
|
+
(_e = connectedWallet.account) == null ? void 0 : _e.slice(-4),
|
|
2529
2856
|
" (",
|
|
2530
2857
|
connectedWallet.walletType,
|
|
2531
2858
|
")"
|
|
2532
2859
|
] })
|
|
2860
|
+
] }) }),
|
|
2861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-4 p-2 bg-yellow-50 rounded-lg border border-yellow-200", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-yellow-800", style: { fontFamily: "Bricolage Grotesque, sans-serif" }, children: [
|
|
2862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium mb-1", children: "🔧 Wallet Debug Info:" }),
|
|
2863
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2864
|
+
"• window.ethereum exists: ",
|
|
2865
|
+
window.ethereum ? "✅" : "❌"
|
|
2866
|
+
] }),
|
|
2867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2868
|
+
"• window.ethereum.isMetaMask: ",
|
|
2869
|
+
((_f = window.ethereum) == null ? void 0 : _f.isMetaMask) ? "✅" : "❌"
|
|
2870
|
+
] }),
|
|
2871
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2872
|
+
"• window.ethereum.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) ? "✅" : "❌"
|
|
2878
|
+
] }),
|
|
2879
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2880
|
+
"• window.ethereum.providers: ",
|
|
2881
|
+
((_j = (_i = window.ethereum) == null ? void 0 : _i.providers) == null ? void 0 : _j.length) || 0,
|
|
2882
|
+
" provider(s)"
|
|
2883
|
+
] }),
|
|
2884
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2885
|
+
"• window.rabby exists: ",
|
|
2886
|
+
window.rabby ? "✅" : "❌"
|
|
2887
|
+
] }),
|
|
2888
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2889
|
+
"• window.zerion exists: ",
|
|
2890
|
+
window.zerion ? "✅" : "❌"
|
|
2891
|
+
] }),
|
|
2892
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
2893
|
+
"• Showing ",
|
|
2894
|
+
availableWallets.length,
|
|
2895
|
+
" wallet options"
|
|
2896
|
+
] })
|
|
2533
2897
|
] }) })
|
|
2534
2898
|
] });
|
|
2535
2899
|
};
|
|
@@ -2976,7 +3340,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2976
3340
|
}
|
|
2977
3341
|
console.log(`🔄 Preparing ${selectedWalletType} transaction to:`, recipientAddress);
|
|
2978
3342
|
let txParams;
|
|
2979
|
-
if (["metamask", "rabby"].includes(selectedWalletType)) {
|
|
3343
|
+
if (["metamask", "rabby", "zerion"].includes(selectedWalletType)) {
|
|
2980
3344
|
if (selectedToken.contractAddress) {
|
|
2981
3345
|
const decimals = selectedToken.decimals || 6;
|
|
2982
3346
|
const amount = Math.floor(paymentData.totalAmount * Math.pow(10, decimals));
|