@coinbase/wallet-sdk
Advanced tools
Comparing version 4.0.3 to 4.0.4
@@ -71,4 +71,7 @@ "use strict"; | ||
this.waitForPopupLoaded = async () => { | ||
if (this.popup && !this.popup.closed) | ||
if (this.popup && !this.popup.closed) { | ||
// In case the user un-focused the popup between requests, focus it again | ||
this.popup.focus(); | ||
return this.popup; | ||
} | ||
this.popup = (0, util_1.openPopup)(this.url); | ||
@@ -75,0 +78,0 @@ this.onMessage(({ event }) => event === 'PopupUnload') |
@@ -25,5 +25,18 @@ "use strict"; | ||
exports.getCoinbaseInjectedSigner = getCoinbaseInjectedSigner; | ||
function getCoinbaseInjectedLegacyProvider() { | ||
const window = globalThis; | ||
return window.coinbaseWalletExtension; | ||
} | ||
function getInjectedEthereum() { | ||
var _a, _b; | ||
try { | ||
const window = globalThis; | ||
return (_a = window.ethereum) !== null && _a !== void 0 ? _a : (_b = window.top) === null || _b === void 0 ? void 0 : _b.ethereum; | ||
} | ||
catch (_c) { | ||
return undefined; | ||
} | ||
} | ||
function getCoinbaseInjectedProvider({ metadata, preference, }) { | ||
var _a, _b, _c; | ||
const window = globalThis; | ||
var _a; | ||
if (preference.options !== 'smartWalletOnly') { | ||
@@ -33,3 +46,3 @@ const signer = getCoinbaseInjectedSigner(); | ||
return undefined; // use signer instead | ||
const extension = window.coinbaseWalletExtension; | ||
const extension = getCoinbaseInjectedLegacyProvider(); | ||
if (extension) { | ||
@@ -41,3 +54,3 @@ const { appName, appLogoUrl, appChainIds } = metadata; | ||
} | ||
const ethereum = (_b = window.ethereum) !== null && _b !== void 0 ? _b : (_c = window.top) === null || _c === void 0 ? void 0 : _c.ethereum; | ||
const ethereum = getInjectedEthereum(); | ||
if (ethereum === null || ethereum === void 0 ? void 0 : ethereum.isCoinbaseBrowser) { | ||
@@ -44,0 +57,0 @@ return ethereum; |
@@ -1,1 +0,1 @@ | ||
export declare const LIB_VERSION = "4.0.3"; | ||
export declare const LIB_VERSION = "4.0.4"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LIB_VERSION = void 0; | ||
exports.LIB_VERSION = '4.0.3'; | ||
exports.LIB_VERSION = '4.0.4'; |
{ | ||
"name": "@coinbase/wallet-sdk", | ||
"version": "4.0.3", | ||
"version": "4.0.4", | ||
"description": "Coinbase Wallet JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
255157
6041