coinley-checkout 0.3.7 → 0.3.8
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.
@@ -182,10 +182,62 @@ const detectWallets = () => {
|
|
182
182
|
return wallets;
|
183
183
|
}
|
184
184
|
try {
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
185
|
+
console.log("=== WALLET DETECTION DEBUG ===");
|
186
|
+
console.log("window.ethereum:", window.ethereum);
|
187
|
+
console.log("window.tronWeb:", window.tronWeb);
|
188
|
+
console.log("window.tronLink:", window.tronLink);
|
189
|
+
console.log("window.algorand:", window.algorand);
|
190
|
+
if (window.ethereum) {
|
191
|
+
if (window.ethereum.isMetaMask) {
|
192
|
+
wallets[WALLET_TYPES.METAMASK] = true;
|
193
|
+
console.log("✅ MetaMask detected via isMetaMask");
|
194
|
+
} else if (window.ethereum.providers) {
|
195
|
+
const metamaskProvider = window.ethereum.providers.find((p2) => p2.isMetaMask);
|
196
|
+
if (metamaskProvider) {
|
197
|
+
wallets[WALLET_TYPES.METAMASK] = true;
|
198
|
+
console.log("✅ MetaMask detected via providers array");
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
if (window.ethereum) {
|
203
|
+
if (window.ethereum.isTrust) {
|
204
|
+
wallets[WALLET_TYPES.TRUST_WALLET] = true;
|
205
|
+
console.log("✅ Trust Wallet detected via isTrust");
|
206
|
+
} else if (window.ethereum.isTrustWallet) {
|
207
|
+
wallets[WALLET_TYPES.TRUST_WALLET] = true;
|
208
|
+
console.log("✅ Trust Wallet detected via isTrustWallet");
|
209
|
+
} else if (window.trustwallet) {
|
210
|
+
wallets[WALLET_TYPES.TRUST_WALLET] = true;
|
211
|
+
console.log("✅ Trust Wallet detected via window.trustwallet");
|
212
|
+
} else if (window.ethereum.providers) {
|
213
|
+
const trustProvider = window.ethereum.providers.find((p2) => p2.isTrust || p2.isTrustWallet);
|
214
|
+
if (trustProvider) {
|
215
|
+
wallets[WALLET_TYPES.TRUST_WALLET] = true;
|
216
|
+
console.log("✅ Trust Wallet detected via providers array");
|
217
|
+
}
|
218
|
+
}
|
219
|
+
}
|
220
|
+
if (window.tronWeb) {
|
221
|
+
wallets[WALLET_TYPES.TRONLINK] = true;
|
222
|
+
console.log("✅ TronLink detected via tronWeb");
|
223
|
+
} else if (window.tronLink) {
|
224
|
+
wallets[WALLET_TYPES.TRONLINK] = true;
|
225
|
+
console.log("✅ TronLink detected via tronLink");
|
226
|
+
} else if (window.tron) {
|
227
|
+
wallets[WALLET_TYPES.TRONLINK] = true;
|
228
|
+
console.log("✅ TronLink detected via tron");
|
229
|
+
}
|
230
|
+
if (window.algorand) {
|
231
|
+
if (window.algorand.isLute) {
|
232
|
+
wallets[WALLET_TYPES.LUTE] = true;
|
233
|
+
console.log("✅ Lute Wallet detected via algorand.isLute");
|
234
|
+
} else {
|
235
|
+
wallets[WALLET_TYPES.LUTE] = true;
|
236
|
+
console.log("✅ Algorand wallet detected (assuming Lute)");
|
237
|
+
}
|
238
|
+
}
|
239
|
+
console.log("Final wallet detection results:", wallets);
|
240
|
+
console.log("=== END WALLET DETECTION DEBUG ===");
|
189
241
|
} catch (error) {
|
190
242
|
console.warn("Error detecting wallets:", error);
|
191
243
|
}
|