@pooflabs/web 0.0.81-rc5 → 0.0.81
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/auth/index.d.ts +10 -1
- package/dist/auth/providers/phantom-wallet-provider.d.ts +20 -21
- package/dist/global.d.ts +3 -1
- package/dist/{index-Fjyk5jYL.js → index-B2WGCssJ.js} +346 -490
- package/dist/index-B2WGCssJ.js.map +1 -0
- package/dist/{index-DB9nDInp.esm.js → index-CjHbp7Dq.esm.js} +3697 -562
- package/dist/index-CjHbp7Dq.esm.js.map +1 -0
- package/dist/{index-D_ta2S2c.js → index-DXPkkq81.js} +3698 -563
- package/dist/index-DXPkkq81.js.map +1 -0
- package/dist/{index-Bg_ApFIo.js → index-D_DiP8XQ.js} +3698 -563
- package/dist/index-D_DiP8XQ.js.map +1 -0
- package/dist/{index-CZhJBWap.esm.js → index-dcJIjFrs.esm.js} +3697 -562
- package/dist/index-dcJIjFrs.esm.js.map +1 -0
- package/dist/{index-Bkr4BRoP.esm.js → index-nt_HQVrk.esm.js} +344 -490
- package/dist/index-nt_HQVrk.esm.js.map +1 -0
- package/dist/{index.browser-iqs5DlRU.esm.js → index.browser-BNdFfyIg.esm.js} +1571 -1368
- package/dist/index.browser-BNdFfyIg.esm.js.map +1 -0
- package/dist/{index.browser-DHi7UhqF.js → index.browser-CT6PUv9G.js} +1571 -1368
- package/dist/index.browser-CT6PUv9G.js.map +1 -0
- package/dist/index.browser-Cy21yaX0.esm.js +1096 -0
- package/dist/index.browser-Cy21yaX0.esm.js.map +1 -0
- package/dist/index.browser-OvGNsMPu.esm.js +1002 -0
- package/dist/index.browser-OvGNsMPu.esm.js.map +1 -0
- package/dist/index.browser-ZD7Tz2bn.js +1099 -0
- package/dist/index.browser-ZD7Tz2bn.js.map +1 -0
- package/dist/index.browser-d0PlOXpF.js +105 -0
- package/dist/index.browser-d0PlOXpF.js.map +1 -0
- package/dist/index.browser-pE1s68e9.esm.js +102 -0
- package/dist/index.browser-pE1s68e9.esm.js.map +1 -0
- package/dist/index.browser-vuTr40so.js +1008 -0
- package/dist/index.browser-vuTr40so.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-DYgJWWY4.esm.js → index.native-BqYr--vb.esm.js} +202 -178
- package/dist/index.native-BqYr--vb.esm.js.map +1 -0
- package/dist/{index.native-DJWuqJTZ.js → index.native-CyA-RdvW.js} +204 -178
- package/dist/index.native-CyA-RdvW.js.map +1 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-fofd8BMo.js → phantom-wallet-provider-DWCaMkyz.js} +147 -238
- package/dist/phantom-wallet-provider-DWCaMkyz.js.map +1 -0
- package/dist/{phantom-wallet-provider-DSFGWSOJ.esm.js → phantom-wallet-provider-K2V96G-G.esm.js} +147 -238
- package/dist/phantom-wallet-provider-K2V96G-G.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-Csv34Kcc.js → privy-wallet-provider-BMg_S_d0.js} +4 -4
- package/dist/privy-wallet-provider-BMg_S_d0.js.map +1 -0
- package/dist/{privy-wallet-provider-TRToDe4Q.esm.js → privy-wallet-provider-DoX8q99w.esm.js} +4 -4
- package/dist/privy-wallet-provider-DoX8q99w.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-L7nRuxhv.esm.js → solana-mobile-wallet-provider-Cmphb3oB.esm.js} +3 -82
- package/dist/solana-mobile-wallet-provider-Cmphb3oB.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-Cp65LfNb.js → solana-mobile-wallet-provider-t22Ie8lY.js} +3 -82
- package/dist/solana-mobile-wallet-provider-t22Ie8lY.js.map +1 -0
- package/package.json +3 -3
- package/dist/index-Bg_ApFIo.js.map +0 -1
- package/dist/index-Bkr4BRoP.esm.js.map +0 -1
- package/dist/index-CZhJBWap.esm.js.map +0 -1
- package/dist/index-DB9nDInp.esm.js.map +0 -1
- package/dist/index-D_ta2S2c.js.map +0 -1
- package/dist/index-Fjyk5jYL.js.map +0 -1
- package/dist/index.browser-BTlliHCf.esm.js +0 -119
- package/dist/index.browser-BTlliHCf.esm.js.map +0 -1
- package/dist/index.browser-C-_FEr5M.esm.js +0 -1134
- package/dist/index.browser-C-_FEr5M.esm.js.map +0 -1
- package/dist/index.browser-DHi7UhqF.js.map +0 -1
- package/dist/index.browser-DRTQuf0J.js +0 -1253
- package/dist/index.browser-DRTQuf0J.js.map +0 -1
- package/dist/index.browser-Disp7Kcb.esm.js +0 -1250
- package/dist/index.browser-Disp7Kcb.esm.js.map +0 -1
- package/dist/index.browser-DjEZSiqI.js +0 -1137
- package/dist/index.browser-DjEZSiqI.js.map +0 -1
- package/dist/index.browser-DvTeEO2r.js +0 -122
- package/dist/index.browser-DvTeEO2r.js.map +0 -1
- package/dist/index.browser-iqs5DlRU.esm.js.map +0 -1
- package/dist/index.native-DJWuqJTZ.js.map +0 -1
- package/dist/index.native-DYgJWWY4.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-DSFGWSOJ.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-fofd8BMo.js.map +0 -1
- package/dist/privy-wallet-provider-Csv34Kcc.js.map +0 -1
- package/dist/privy-wallet-provider-TRToDe4Q.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-Cp65LfNb.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-L7nRuxhv.esm.js.map +0 -1
|
@@ -4,6 +4,21 @@ import * as anchor from '@coral-xyz/anchor';
|
|
|
4
4
|
import { Program } from '@coral-xyz/anchor';
|
|
5
5
|
import * as React$2 from 'react';
|
|
6
6
|
|
|
7
|
+
function _mergeNamespaces(n, m) {
|
|
8
|
+
m.forEach(function (e) {
|
|
9
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !(k in n)) {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
|
|
7
22
|
function getDefaultExportFromCjs$1 (x) {
|
|
8
23
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
9
24
|
}
|
|
@@ -9447,11 +9462,11 @@ function requireSrc () {
|
|
|
9447
9462
|
}
|
|
9448
9463
|
|
|
9449
9464
|
var bs58$1;
|
|
9450
|
-
var hasRequiredBs58;
|
|
9465
|
+
var hasRequiredBs58$1;
|
|
9451
9466
|
|
|
9452
|
-
function requireBs58 () {
|
|
9453
|
-
if (hasRequiredBs58) return bs58$1;
|
|
9454
|
-
hasRequiredBs58 = 1;
|
|
9467
|
+
function requireBs58$1 () {
|
|
9468
|
+
if (hasRequiredBs58$1) return bs58$1;
|
|
9469
|
+
hasRequiredBs58$1 = 1;
|
|
9455
9470
|
var basex = requireSrc();
|
|
9456
9471
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
9457
9472
|
|
|
@@ -9459,8 +9474,8 @@ function requireBs58 () {
|
|
|
9459
9474
|
return bs58$1;
|
|
9460
9475
|
}
|
|
9461
9476
|
|
|
9462
|
-
var bs58Exports = requireBs58();
|
|
9463
|
-
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports);
|
|
9477
|
+
var bs58Exports$1 = requireBs58$1();
|
|
9478
|
+
var bs58$2 = /*@__PURE__*/getDefaultExportFromCjs(bs58Exports$1);
|
|
9464
9479
|
|
|
9465
9480
|
// ─────────────────────────────────────────────────────────────
|
|
9466
9481
|
// Local implementation of getSimulationComputeUnits
|
|
@@ -10106,40 +10121,17 @@ async function getConfig() {
|
|
|
10106
10121
|
return clientConfig;
|
|
10107
10122
|
}
|
|
10108
10123
|
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
10120
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
10121
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
10122
|
-
***************************************************************************** */
|
|
10123
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
function __rest(s, e) {
|
|
10127
|
-
var t = {};
|
|
10128
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
10129
|
-
t[p] = s[p];
|
|
10130
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
10131
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10132
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
10133
|
-
t[p[i]] = s[p[i]];
|
|
10134
|
-
}
|
|
10135
|
-
return t;
|
|
10136
|
-
}
|
|
10137
|
-
|
|
10138
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
10139
|
-
var e = new Error(message);
|
|
10140
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
10124
|
+
var __rest = function (s, e) {
|
|
10125
|
+
var t = {};
|
|
10126
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
10127
|
+
t[p] = s[p];
|
|
10128
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
10129
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
10130
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
10131
|
+
t[p[i]] = s[p[i]];
|
|
10132
|
+
}
|
|
10133
|
+
return t;
|
|
10141
10134
|
};
|
|
10142
|
-
|
|
10143
10135
|
/**
|
|
10144
10136
|
* Thrown when a user's wallet doesn't have enough SOL to cover the transaction.
|
|
10145
10137
|
* Apps can catch this to trigger an onramp/funding flow.
|
|
@@ -12960,7 +12952,7 @@ async function getAuthProvider(config) {
|
|
|
12960
12952
|
}
|
|
12961
12953
|
return currentAuthProvider;
|
|
12962
12954
|
}
|
|
12963
|
-
async function login$1() {
|
|
12955
|
+
async function login$1(options) {
|
|
12964
12956
|
// Re-initialize provider if it was cleared by logout
|
|
12965
12957
|
if (!currentAuthProvider && initConfig) {
|
|
12966
12958
|
currentAuthProvider = await getAuthProvider(initConfig);
|
|
@@ -12973,6 +12965,14 @@ async function login$1() {
|
|
|
12973
12965
|
if (!currentAuthProvider) {
|
|
12974
12966
|
throw new Error("Auth provider not initialized. Please call init() first.");
|
|
12975
12967
|
}
|
|
12968
|
+
// Forward per-call overrides to providers that support them (duck-typed to stay
|
|
12969
|
+
// lazy-load safe — no direct import of PhantomWalletProvider here).
|
|
12970
|
+
// Always call (even with null) so previous overrides are cleared when this
|
|
12971
|
+
// login() is invoked without options — early-return paths inside the provider
|
|
12972
|
+
// bypass the .finally() cleanup, so we reset here too.
|
|
12973
|
+
if (typeof currentAuthProvider.setLoginOverrides === 'function') {
|
|
12974
|
+
currentAuthProvider.setLoginOverrides(options !== null && options !== void 0 ? options : null);
|
|
12975
|
+
}
|
|
12976
12976
|
const loginResult = await currentAuthProvider.login();
|
|
12977
12977
|
if (loginResult) {
|
|
12978
12978
|
// Store which auth method was used so we restore the right provider on reload
|
|
@@ -13055,11 +13055,11 @@ function setAuthLoading(loading) {
|
|
|
13055
13055
|
function getAuthLoading() {
|
|
13056
13056
|
return isAuthLoading;
|
|
13057
13057
|
}
|
|
13058
|
-
async function login() {
|
|
13058
|
+
async function login(options) {
|
|
13059
13059
|
if (!authProviderInstance) {
|
|
13060
13060
|
throw new Error('SDK not initialized. Please call init() first.');
|
|
13061
13061
|
}
|
|
13062
|
-
const loggedInUser = await login$1();
|
|
13062
|
+
const loggedInUser = await login$1(options);
|
|
13063
13063
|
setCurrentUser(loggedInUser);
|
|
13064
13064
|
return currentUser;
|
|
13065
13065
|
}
|
|
@@ -15648,7 +15648,7 @@ async function loadDependencies() {
|
|
|
15648
15648
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
15649
15649
|
import('react'),
|
|
15650
15650
|
import('react-dom/client'),
|
|
15651
|
-
import('./index-
|
|
15651
|
+
import('./index-dcJIjFrs.esm.js')
|
|
15652
15652
|
]);
|
|
15653
15653
|
// Extract default export from ESM module namespace
|
|
15654
15654
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -15660,6 +15660,10 @@ async function loadDependencies() {
|
|
|
15660
15660
|
return loadingPromise;
|
|
15661
15661
|
}
|
|
15662
15662
|
class PhantomWalletProvider {
|
|
15663
|
+
/** Temporarily override modal appearance for a single login() call. Cleared automatically after login settles. */
|
|
15664
|
+
setLoginOverrides(opts) {
|
|
15665
|
+
this.loginOverrides = opts;
|
|
15666
|
+
}
|
|
15663
15667
|
constructor(networkUrl = null, config = {}) {
|
|
15664
15668
|
this.containerElement = null;
|
|
15665
15669
|
this.root = null;
|
|
@@ -15669,6 +15673,7 @@ class PhantomWalletProvider {
|
|
|
15669
15673
|
this.loginInProgress = false;
|
|
15670
15674
|
this.autoLoginInProgress = false;
|
|
15671
15675
|
this.initPromise = null;
|
|
15676
|
+
this.loginOverrides = null;
|
|
15672
15677
|
/** Callback to swap to a Privy provider when the user clicks "Log in with email" */
|
|
15673
15678
|
this.onSwitchToPrivy = null;
|
|
15674
15679
|
/** Callback to swap to a Mobile Wallet Adapter provider when the user clicks "Connect Mobile Wallet" */
|
|
@@ -15691,13 +15696,8 @@ class PhantomWalletProvider {
|
|
|
15691
15696
|
async initializeAsync() {
|
|
15692
15697
|
// Lazy load dependencies only when actually instantiating
|
|
15693
15698
|
await loadDependencies();
|
|
15694
|
-
// Initialize React component
|
|
15695
|
-
|
|
15696
|
-
// or non-Android). Otherwise defer until ensureReady() is reached from
|
|
15697
|
-
// a user-gesture flow. See shouldMountEagerly() for the rationale.
|
|
15698
|
-
if (this.shouldMountEagerly()) {
|
|
15699
|
-
this.initialize();
|
|
15700
|
-
}
|
|
15699
|
+
// Initialize React component
|
|
15700
|
+
this.initialize();
|
|
15701
15701
|
}
|
|
15702
15702
|
/**
|
|
15703
15703
|
* Check if social login providers are configured (non-injected providers).
|
|
@@ -15705,69 +15705,6 @@ class PhantomWalletProvider {
|
|
|
15705
15705
|
hasSocialProviders() {
|
|
15706
15706
|
return this.resolvedProviders.some(p => p !== 'injected');
|
|
15707
15707
|
}
|
|
15708
|
-
/**
|
|
15709
|
-
* Decide whether to mount the @phantom/react-sdk <PhantomProvider> tree
|
|
15710
|
-
* eagerly during init() or defer until the first user-triggered call
|
|
15711
|
-
* (login / sign / etc.) reaches ensureReady().
|
|
15712
|
-
*
|
|
15713
|
-
* Mounting the React tree synchronously constructs BrowserSDK, which runs
|
|
15714
|
-
* wallet-standard discovery in its constructor and fires sdk.autoConnect()
|
|
15715
|
-
* in a useEffect on mount. On Solana Seeker (Android Chrome PWA), both
|
|
15716
|
-
* pathways probe the Android intent surface to discover the Phantom mobile
|
|
15717
|
-
* app, which surfaces Chrome's system "wants to access other apps and
|
|
15718
|
-
* services" permission dialog *before* the PWA activity has window focus.
|
|
15719
|
-
* The dialog renders with grayed-out buttons until the user backgrounds
|
|
15720
|
-
* and resumes the app.
|
|
15721
|
-
*
|
|
15722
|
-
* Returns true when eager mount is needed (callback to handle, prior
|
|
15723
|
-
* session, in-page wallet present, or non-Android). Otherwise returns
|
|
15724
|
-
* false — the React tree is mounted lazily inside ensureReady() once a
|
|
15725
|
-
* user gesture brings us there.
|
|
15726
|
-
*/
|
|
15727
|
-
shouldMountEagerly() {
|
|
15728
|
-
if (typeof window === 'undefined')
|
|
15729
|
-
return false;
|
|
15730
|
-
// Preserve desktop behavior: always mount eagerly.
|
|
15731
|
-
if (!detectAndroid())
|
|
15732
|
-
return true;
|
|
15733
|
-
// In-page wallet present (Phantom in-app browser / desktop extension on
|
|
15734
|
-
// a desktop-mode Android UA): no Android intent probe needed, mount free.
|
|
15735
|
-
// Tighten beyond truthy `window.phantom` since arbitrary stubs can land
|
|
15736
|
-
// on that key — require a wallet-shaped surface.
|
|
15737
|
-
const ph = window.phantom;
|
|
15738
|
-
if (ph && (ph.solana || ph.ethereum || ph.app))
|
|
15739
|
-
return true;
|
|
15740
|
-
// Returning from a Phantom redirect (OAuth or deeplink hop). SDK must
|
|
15741
|
-
// be live to read these URL params via urlParamsAccessor.
|
|
15742
|
-
const callbackKeys = ['session_id', 'wallet_id', 'selected_account_index', 'error', 'error_description'];
|
|
15743
|
-
try {
|
|
15744
|
-
const params = new URLSearchParams(window.location.search);
|
|
15745
|
-
if (callbackKeys.some(k => params.has(k)))
|
|
15746
|
-
return true;
|
|
15747
|
-
}
|
|
15748
|
-
catch (_a) {
|
|
15749
|
-
return true; // conservative on URL access failure
|
|
15750
|
-
}
|
|
15751
|
-
// Returning user with a stored Phantom session. They've already
|
|
15752
|
-
// approved the Android intent permission for this origin on first
|
|
15753
|
-
// login, so the dialog is typically pre-granted by Chrome — eager
|
|
15754
|
-
// mount lets autoConnect silently restore the wallet handshake.
|
|
15755
|
-
// Require BOTH the marker AND a session storage entry so a stale
|
|
15756
|
-
// orphaned marker doesn't keep eager-mounting forever. Note
|
|
15757
|
-
// isAuthenticated() is a raw key-existence check, not a validity
|
|
15758
|
-
// check — restoreSession() above clears the marker on the next load
|
|
15759
|
-
// if the session is unusable, so the bug self-corrects after at
|
|
15760
|
-
// most one further cold start.
|
|
15761
|
-
try {
|
|
15762
|
-
const stored = getPlatform().storage.getItem('tarobase_last_auth_method');
|
|
15763
|
-
if (stored === 'phantom' && WebSessionManager.isAuthenticated())
|
|
15764
|
-
return true;
|
|
15765
|
-
}
|
|
15766
|
-
catch (_b) {
|
|
15767
|
-
return true;
|
|
15768
|
-
}
|
|
15769
|
-
return false;
|
|
15770
|
-
}
|
|
15771
15708
|
static getInstance(networkUrl, config) {
|
|
15772
15709
|
if (!PhantomWalletProvider.instance) {
|
|
15773
15710
|
new PhantomWalletProvider(networkUrl, config);
|
|
@@ -15843,7 +15780,7 @@ class PhantomWalletProvider {
|
|
|
15843
15780
|
const sdkProviders = this.resolvedProviders.length > 0 ? [...this.resolvedProviders] : ['injected'];
|
|
15844
15781
|
// Inner component that uses hooks
|
|
15845
15782
|
const PhantomHooksComponent = () => {
|
|
15846
|
-
var _a, _b;
|
|
15783
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
15847
15784
|
const phantom = usePhantom();
|
|
15848
15785
|
const { connect, error: connectError } = useConnect();
|
|
15849
15786
|
const { disconnect, isDisconnecting } = useDisconnect();
|
|
@@ -16126,63 +16063,13 @@ class PhantomWalletProvider {
|
|
|
16126
16063
|
}
|
|
16127
16064
|
};
|
|
16128
16065
|
const handleMobileWalletClick = async () => {
|
|
16129
|
-
var _a;
|
|
16130
|
-
console.log('[MWA-DEBUG] handleMobileWalletClick: entered', {
|
|
16131
|
-
documentHasFocus: typeof document !== 'undefined' ? document.hasFocus() : 'n/a',
|
|
16132
|
-
visibilityState: typeof document !== 'undefined' ? document.visibilityState : 'n/a',
|
|
16133
|
-
displayMode: typeof window !== 'undefined' && window.matchMedia
|
|
16134
|
-
? (window.matchMedia('(display-mode: standalone)').matches ? 'standalone' : 'browser')
|
|
16135
|
-
: 'n/a',
|
|
16136
|
-
userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : 'n/a',
|
|
16137
|
-
timestamp: Date.now(),
|
|
16138
|
-
});
|
|
16139
16066
|
that.loginInProgress = false;
|
|
16140
16067
|
walletClickedRef.current = true;
|
|
16141
16068
|
setShowWalletModal(false);
|
|
16142
|
-
// Hide the Phantom provider container while MWA's transact()
|
|
16143
|
-
// is opening the localhost WebSocket and Chrome surfaces the
|
|
16144
|
-
// "Apps on Device" / Local Network Access permission dialog.
|
|
16145
|
-
//
|
|
16146
|
-
// The container is a singleton fixed full-viewport <div> with
|
|
16147
|
-
// z-index 2147483647 + pointer-events: none parked on body.
|
|
16148
|
-
// Even though pointer-events: none should let touches pass
|
|
16149
|
-
// through, on Android Chrome (both PWA and regular browser)
|
|
16150
|
-
// the system permission dialog rendered during MWA's
|
|
16151
|
-
// handshake comes up with disabled-looking buttons until the
|
|
16152
|
-
// activity is forced to re-composite (the user's
|
|
16153
|
-
// background+reopen workaround).
|
|
16154
|
-
//
|
|
16155
|
-
// Display:none-ing the container during MWA login removes it
|
|
16156
|
-
// from the layout tree entirely so there's nothing for the
|
|
16157
|
-
// dialog hit-testing / compositor to get confused by. It's
|
|
16158
|
-
// restored after MWA login resolves or rejects.
|
|
16159
|
-
const containerEl = that.containerElement;
|
|
16160
|
-
const previousDisplay = (_a = containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.display) !== null && _a !== void 0 ? _a : '';
|
|
16161
|
-
console.log('[MWA-DEBUG] container before hide', {
|
|
16162
|
-
hasContainer: !!containerEl,
|
|
16163
|
-
previousDisplay,
|
|
16164
|
-
inDom: containerEl ? document.body.contains(containerEl) : false,
|
|
16165
|
-
zIndex: containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.zIndex,
|
|
16166
|
-
pointerEvents: containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.pointerEvents,
|
|
16167
|
-
});
|
|
16168
|
-
if (containerEl) {
|
|
16169
|
-
containerEl.style.display = 'none';
|
|
16170
|
-
}
|
|
16171
|
-
console.log('[MWA-DEBUG] container hidden, computed display now:', containerEl ? getComputedStyle(containerEl).display : 'n/a');
|
|
16172
|
-
const restoreContainer = () => {
|
|
16173
|
-
if (containerEl) {
|
|
16174
|
-
containerEl.style.display = previousDisplay;
|
|
16175
|
-
console.log('[MWA-DEBUG] container restored, display:', containerEl.style.display);
|
|
16176
|
-
}
|
|
16177
|
-
};
|
|
16178
16069
|
if (that.onSwitchToMWA) {
|
|
16179
16070
|
try {
|
|
16180
|
-
console.log('[MWA-DEBUG] calling onSwitchToMWA');
|
|
16181
16071
|
const mwaProvider = await that.onSwitchToMWA();
|
|
16182
|
-
console.log('[MWA-DEBUG] onSwitchToMWA resolved, calling mwaProvider.login()');
|
|
16183
16072
|
const user = await mwaProvider.login();
|
|
16184
|
-
console.log('[MWA-DEBUG] mwaProvider.login() resolved', { hasUser: !!user });
|
|
16185
|
-
restoreContainer();
|
|
16186
16073
|
if (that.pendingLogin && user) {
|
|
16187
16074
|
that.pendingLogin.resolve(user);
|
|
16188
16075
|
that.pendingLogin = null;
|
|
@@ -16193,22 +16080,12 @@ class PhantomWalletProvider {
|
|
|
16193
16080
|
}
|
|
16194
16081
|
}
|
|
16195
16082
|
catch (error) {
|
|
16196
|
-
console.log('[MWA-DEBUG] mwaProvider.login() threw', {
|
|
16197
|
-
errorName: error === null || error === void 0 ? void 0 : error.name,
|
|
16198
|
-
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
16199
|
-
errorCode: error === null || error === void 0 ? void 0 : error.code,
|
|
16200
|
-
});
|
|
16201
|
-
restoreContainer();
|
|
16202
16083
|
if (that.pendingLogin) {
|
|
16203
16084
|
that.pendingLogin.reject(error);
|
|
16204
16085
|
that.pendingLogin = null;
|
|
16205
16086
|
}
|
|
16206
16087
|
}
|
|
16207
16088
|
}
|
|
16208
|
-
else {
|
|
16209
|
-
console.log('[MWA-DEBUG] no onSwitchToMWA configured');
|
|
16210
|
-
restoreContainer();
|
|
16211
|
-
}
|
|
16212
16089
|
};
|
|
16213
16090
|
const handleCloseModal = () => {
|
|
16214
16091
|
setShowWalletModal(false);
|
|
@@ -16222,31 +16099,59 @@ class PhantomWalletProvider {
|
|
|
16222
16099
|
if (!showWalletModal) {
|
|
16223
16100
|
return null;
|
|
16224
16101
|
}
|
|
16225
|
-
const
|
|
16226
|
-
const
|
|
16227
|
-
const
|
|
16228
|
-
const
|
|
16229
|
-
const
|
|
16102
|
+
const effectiveTheme = (_c = (_b = (_a = that.loginOverrides) === null || _a === void 0 ? void 0 : _a.theme) !== null && _b !== void 0 ? _b : that.config.theme) !== null && _c !== void 0 ? _c : 'dark';
|
|
16103
|
+
const isLight = effectiveTheme === 'light';
|
|
16104
|
+
const bgColor = isLight ? '#FFFFFF' : '#111113';
|
|
16105
|
+
const cardBorder = isLight ? '1px solid rgba(0,0,0,0.08)' : '1px solid rgba(255,255,255,0.07)';
|
|
16106
|
+
const textColor = isLight ? '#0f0f0f' : '#f5f5f5';
|
|
16107
|
+
const subTextColor = isLight ? 'rgba(0,0,0,0.45)' : 'rgba(255,255,255,0.4)';
|
|
16108
|
+
const btnBg = isLight ? 'rgba(0,0,0,0.04)' : 'rgba(255,255,255,0.05)';
|
|
16109
|
+
const btnHoverBg = isLight ? 'rgba(0,0,0,0.08)' : 'rgba(255,255,255,0.09)';
|
|
16110
|
+
const btnBorder = isLight ? '1px solid rgba(0,0,0,0.10)' : '1px solid rgba(255,255,255,0.09)';
|
|
16111
|
+
const dividerColor = isLight ? 'rgba(0,0,0,0.10)' : 'rgba(255,255,255,0.08)';
|
|
16230
16112
|
const fontFamily = '"SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif';
|
|
16231
16113
|
const buttonStyle = (id) => ({
|
|
16232
16114
|
display: 'flex',
|
|
16233
16115
|
alignItems: 'center',
|
|
16234
16116
|
justifyContent: 'center',
|
|
16235
|
-
gap: '
|
|
16117
|
+
gap: '10px',
|
|
16236
16118
|
width: '100%',
|
|
16237
|
-
height: '
|
|
16238
|
-
padding: '
|
|
16239
|
-
border:
|
|
16240
|
-
borderRadius: '
|
|
16119
|
+
height: '52px',
|
|
16120
|
+
padding: '0 20px',
|
|
16121
|
+
border: btnBorder,
|
|
16122
|
+
borderRadius: '12px',
|
|
16241
16123
|
backgroundColor: hoveredBtn === id ? btnHoverBg : btnBg,
|
|
16242
16124
|
color: textColor,
|
|
16243
16125
|
fontFamily,
|
|
16244
16126
|
fontSize: '14px',
|
|
16245
|
-
fontWeight: '
|
|
16246
|
-
lineHeight: '
|
|
16247
|
-
letterSpacing: '
|
|
16127
|
+
fontWeight: '500',
|
|
16128
|
+
lineHeight: '1',
|
|
16129
|
+
letterSpacing: '0',
|
|
16130
|
+
cursor: 'pointer',
|
|
16131
|
+
transition: 'background-color 0.15s, border-color 0.15s',
|
|
16132
|
+
boxSizing: 'border-box',
|
|
16133
|
+
});
|
|
16134
|
+
const emailButtonStyle = (id) => ({
|
|
16135
|
+
display: 'flex',
|
|
16136
|
+
alignItems: 'center',
|
|
16137
|
+
justifyContent: 'center',
|
|
16138
|
+
gap: '10px',
|
|
16139
|
+
width: '100%',
|
|
16140
|
+
height: '52px',
|
|
16141
|
+
padding: '0 20px',
|
|
16142
|
+
border: isLight ? '1px solid rgba(0,0,0,0.15)' : '1px solid rgba(255,255,255,0.15)',
|
|
16143
|
+
borderRadius: '12px',
|
|
16144
|
+
backgroundColor: hoveredBtn === id
|
|
16145
|
+
? (isLight ? 'rgba(0,0,0,0.06)' : 'rgba(255,255,255,0.12)')
|
|
16146
|
+
: (isLight ? 'rgba(0,0,0,0.03)' : 'rgba(255,255,255,0.08)'),
|
|
16147
|
+
color: textColor,
|
|
16148
|
+
fontFamily,
|
|
16149
|
+
fontSize: '14px',
|
|
16150
|
+
fontWeight: '500',
|
|
16151
|
+
lineHeight: '1',
|
|
16248
16152
|
cursor: 'pointer',
|
|
16249
|
-
transition: 'background-color 0.
|
|
16153
|
+
transition: 'background-color 0.15s, border-color 0.15s',
|
|
16154
|
+
boxSizing: 'border-box',
|
|
16250
16155
|
});
|
|
16251
16156
|
const walletButtons = [];
|
|
16252
16157
|
// Google OAuth button — shown when 'google' is in resolved providers
|
|
@@ -16258,7 +16163,7 @@ class PhantomWalletProvider {
|
|
|
16258
16163
|
onMouseEnter: () => setHoveredBtn('google-oauth'),
|
|
16259
16164
|
onMouseLeave: () => setHoveredBtn(null),
|
|
16260
16165
|
}, React$1.createElement('svg', {
|
|
16261
|
-
width: '
|
|
16166
|
+
width: '18', height: '18', viewBox: '0 0 24 24',
|
|
16262
16167
|
style: { flexShrink: '0' },
|
|
16263
16168
|
}, React$1.createElement('path', {
|
|
16264
16169
|
d: 'M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z',
|
|
@@ -16283,7 +16188,7 @@ class PhantomWalletProvider {
|
|
|
16283
16188
|
onMouseEnter: () => setHoveredBtn('apple-oauth'),
|
|
16284
16189
|
onMouseLeave: () => setHoveredBtn(null),
|
|
16285
16190
|
}, React$1.createElement('svg', {
|
|
16286
|
-
width: '
|
|
16191
|
+
width: '18', height: '18', viewBox: '0 0 24 24',
|
|
16287
16192
|
fill: textColor,
|
|
16288
16193
|
style: { flexShrink: '0' },
|
|
16289
16194
|
}, React$1.createElement('path', {
|
|
@@ -16335,11 +16240,9 @@ class PhantomWalletProvider {
|
|
|
16335
16240
|
onClick: handleMobileWalletClick,
|
|
16336
16241
|
onMouseEnter: () => setHoveredBtn('mobile-wallet'),
|
|
16337
16242
|
onMouseLeave: () => setHoveredBtn(null),
|
|
16338
|
-
},
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
width: '20', height: '20', viewBox: '0 0 24 24', fill: 'none',
|
|
16342
|
-
style: { flexShrink: '0' },
|
|
16243
|
+
}, React$1.createElement('svg', {
|
|
16244
|
+
width: '18', height: '18', viewBox: '0 0 24 24', fill: 'none',
|
|
16245
|
+
style: { flexShrink: '0', opacity: '0.85' },
|
|
16343
16246
|
},
|
|
16344
16247
|
// Phone outline
|
|
16345
16248
|
React$1.createElement('rect', {
|
|
@@ -16361,23 +16264,51 @@ class PhantomWalletProvider {
|
|
|
16361
16264
|
if (that.config.enablePrivyFallback) {
|
|
16362
16265
|
walletButtons.push(React$1.createElement('button', {
|
|
16363
16266
|
key: 'email-login',
|
|
16364
|
-
style:
|
|
16267
|
+
style: emailButtonStyle('email-login'),
|
|
16365
16268
|
onClick: handleEmailClick,
|
|
16366
16269
|
onMouseEnter: () => setHoveredBtn('email-login'),
|
|
16367
16270
|
onMouseLeave: () => setHoveredBtn(null),
|
|
16368
|
-
},
|
|
16369
|
-
|
|
16370
|
-
|
|
16371
|
-
width: '20', height: '20', viewBox: '0 0 24 24', fill: 'none',
|
|
16372
|
-
style: { flexShrink: '0' },
|
|
16271
|
+
}, React$1.createElement('svg', {
|
|
16272
|
+
width: '18', height: '18', viewBox: '0 0 24 24', fill: 'none',
|
|
16273
|
+
style: { flexShrink: '0', opacity: '0.7' },
|
|
16373
16274
|
}, React$1.createElement('path', {
|
|
16374
16275
|
d: 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z',
|
|
16375
|
-
stroke: textColor, strokeWidth: '
|
|
16276
|
+
stroke: textColor, strokeWidth: '1.75', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
|
|
16376
16277
|
}), React$1.createElement('path', {
|
|
16377
16278
|
d: 'M22 6l-10 7L2 6',
|
|
16378
|
-
stroke: textColor, strokeWidth: '
|
|
16379
|
-
})), '
|
|
16279
|
+
stroke: textColor, strokeWidth: '1.75', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
|
|
16280
|
+
})), 'Continue with email'));
|
|
16380
16281
|
}
|
|
16282
|
+
// Split email button from the rest to insert OR divider
|
|
16283
|
+
const emailBtnIndex = walletButtons.findIndex((b) => b && b.key === 'email-login');
|
|
16284
|
+
const mainButtons = emailBtnIndex >= 0 ? walletButtons.slice(0, emailBtnIndex) : walletButtons;
|
|
16285
|
+
const emailButton = emailBtnIndex >= 0 ? walletButtons[emailBtnIndex] : null;
|
|
16286
|
+
// OR divider — shown when there are both wallet/social buttons and an email button
|
|
16287
|
+
const orDivider = (mainButtons.length > 0 && emailButton)
|
|
16288
|
+
? React$1.createElement('div', {
|
|
16289
|
+
key: 'or-divider',
|
|
16290
|
+
style: {
|
|
16291
|
+
display: 'flex',
|
|
16292
|
+
alignItems: 'center',
|
|
16293
|
+
gap: '12px',
|
|
16294
|
+
margin: '4px 0',
|
|
16295
|
+
},
|
|
16296
|
+
}, React$1.createElement('div', {
|
|
16297
|
+
style: { flex: '1', height: '1px', backgroundColor: dividerColor },
|
|
16298
|
+
}), React$1.createElement('span', {
|
|
16299
|
+
style: {
|
|
16300
|
+
color: subTextColor,
|
|
16301
|
+
fontFamily,
|
|
16302
|
+
fontSize: '12px',
|
|
16303
|
+
fontWeight: '500',
|
|
16304
|
+
letterSpacing: '0.02em',
|
|
16305
|
+
textTransform: 'uppercase',
|
|
16306
|
+
userSelect: 'none',
|
|
16307
|
+
},
|
|
16308
|
+
}, 'or'), React$1.createElement('div', {
|
|
16309
|
+
style: { flex: '1', height: '1px', backgroundColor: dividerColor },
|
|
16310
|
+
}))
|
|
16311
|
+
: null;
|
|
16381
16312
|
// Render custom modal
|
|
16382
16313
|
return React$1.createElement('div', {
|
|
16383
16314
|
// Overlay
|
|
@@ -16387,12 +16318,14 @@ class PhantomWalletProvider {
|
|
|
16387
16318
|
left: '0',
|
|
16388
16319
|
right: '0',
|
|
16389
16320
|
bottom: '0',
|
|
16390
|
-
backgroundColor: 'rgba(0,0,0,0.
|
|
16321
|
+
backgroundColor: isLight ? 'rgba(0,0,0,0.35)' : 'rgba(0,0,0,0.65)',
|
|
16391
16322
|
display: 'flex',
|
|
16392
16323
|
alignItems: 'center',
|
|
16393
16324
|
justifyContent: 'center',
|
|
16394
16325
|
zIndex: 2147483647,
|
|
16395
16326
|
pointerEvents: 'auto',
|
|
16327
|
+
backdropFilter: 'blur(4px)',
|
|
16328
|
+
WebkitBackdropFilter: 'blur(4px)',
|
|
16396
16329
|
},
|
|
16397
16330
|
onClick: (e) => {
|
|
16398
16331
|
if (e.target === e.currentTarget)
|
|
@@ -16409,13 +16342,17 @@ class PhantomWalletProvider {
|
|
|
16409
16342
|
React$1.createElement('div', {
|
|
16410
16343
|
style: {
|
|
16411
16344
|
backgroundColor: bgColor,
|
|
16412
|
-
|
|
16413
|
-
|
|
16414
|
-
|
|
16415
|
-
|
|
16345
|
+
border: cardBorder,
|
|
16346
|
+
borderRadius: '20px',
|
|
16347
|
+
width: '380px',
|
|
16348
|
+
maxWidth: 'calc(100vw - 32px)',
|
|
16349
|
+
padding: '28px 24px 24px',
|
|
16416
16350
|
position: 'relative',
|
|
16417
|
-
boxShadow:
|
|
16351
|
+
boxShadow: isLight
|
|
16352
|
+
? '0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)'
|
|
16353
|
+
: '0 8px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.3)',
|
|
16418
16354
|
pointerEvents: 'auto',
|
|
16355
|
+
boxSizing: 'border-box',
|
|
16419
16356
|
},
|
|
16420
16357
|
onMouseDown: (e) => {
|
|
16421
16358
|
e.stopPropagation();
|
|
@@ -16424,26 +16361,30 @@ class PhantomWalletProvider {
|
|
|
16424
16361
|
e.stopPropagation();
|
|
16425
16362
|
},
|
|
16426
16363
|
},
|
|
16427
|
-
// Close button
|
|
16364
|
+
// Close button
|
|
16428
16365
|
React$1.createElement('button', {
|
|
16429
16366
|
onClick: handleCloseModal,
|
|
16430
16367
|
style: {
|
|
16431
16368
|
position: 'absolute',
|
|
16432
|
-
top: '
|
|
16433
|
-
right: '
|
|
16434
|
-
background: '
|
|
16435
|
-
border: '
|
|
16369
|
+
top: '14px',
|
|
16370
|
+
right: '14px',
|
|
16371
|
+
background: isLight ? 'rgba(0,0,0,0.05)' : 'rgba(255,255,255,0.07)',
|
|
16372
|
+
border: isLight ? '1px solid rgba(0,0,0,0.08)' : '1px solid rgba(255,255,255,0.08)',
|
|
16373
|
+
borderRadius: '50%',
|
|
16374
|
+
width: '28px',
|
|
16375
|
+
height: '28px',
|
|
16436
16376
|
cursor: 'pointer',
|
|
16437
|
-
padding: '4px',
|
|
16438
16377
|
display: 'flex',
|
|
16439
16378
|
alignItems: 'center',
|
|
16440
16379
|
justifyContent: 'center',
|
|
16380
|
+
padding: '0',
|
|
16381
|
+
flexShrink: '0',
|
|
16441
16382
|
},
|
|
16442
16383
|
}, React$1.createElement('svg', {
|
|
16443
|
-
width: '
|
|
16384
|
+
width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none',
|
|
16444
16385
|
}, React$1.createElement('path', {
|
|
16445
|
-
d: '
|
|
16446
|
-
stroke:
|
|
16386
|
+
d: 'M11 1L1 11M1 1l10 10',
|
|
16387
|
+
stroke: subTextColor, strokeWidth: '1.75', strokeLinecap: 'round',
|
|
16447
16388
|
}))),
|
|
16448
16389
|
// App icon (if provided)
|
|
16449
16390
|
that.config.appIcon ? React$1.createElement('div', {
|
|
@@ -16451,27 +16392,40 @@ class PhantomWalletProvider {
|
|
|
16451
16392
|
}, React$1.createElement('img', {
|
|
16452
16393
|
src: that.config.appIcon,
|
|
16453
16394
|
alt: that.config.appName || 'App',
|
|
16454
|
-
style: { width: '
|
|
16395
|
+
style: { width: '44px', height: '44px', borderRadius: '10px' },
|
|
16455
16396
|
})) : null,
|
|
16456
16397
|
// Title
|
|
16457
16398
|
React$1.createElement('div', {
|
|
16458
16399
|
style: {
|
|
16459
16400
|
color: textColor,
|
|
16460
16401
|
fontFamily,
|
|
16461
|
-
fontSize: '
|
|
16402
|
+
fontSize: '17px',
|
|
16462
16403
|
fontWeight: '600',
|
|
16463
16404
|
textAlign: 'center',
|
|
16405
|
+
marginBottom: '6px',
|
|
16406
|
+
letterSpacing: '-0.2px',
|
|
16407
|
+
},
|
|
16408
|
+
}, (_f = (_e = (_d = that.loginOverrides) === null || _d === void 0 ? void 0 : _d.modalTitle) !== null && _e !== void 0 ? _e : that.config.modalTitle) !== null && _f !== void 0 ? _f : (that.config.appName ? `Log in to ${that.config.appName}` : 'Log in to your account')),
|
|
16409
|
+
// Subtitle
|
|
16410
|
+
React$1.createElement('div', {
|
|
16411
|
+
style: {
|
|
16412
|
+
color: subTextColor,
|
|
16413
|
+
fontFamily,
|
|
16414
|
+
fontSize: '13px',
|
|
16415
|
+
fontWeight: '400',
|
|
16416
|
+
textAlign: 'center',
|
|
16464
16417
|
marginBottom: '24px',
|
|
16418
|
+
lineHeight: '1.4',
|
|
16465
16419
|
},
|
|
16466
|
-
}, '
|
|
16467
|
-
//
|
|
16420
|
+
}, (_j = (_h = (_g = that.loginOverrides) === null || _g === void 0 ? void 0 : _g.modalSubtitle) !== null && _h !== void 0 ? _h : that.config.modalSubtitle) !== null && _j !== void 0 ? _j : 'Choose how you\'d like to continue'),
|
|
16421
|
+
// Main buttons + OR divider + email button
|
|
16468
16422
|
React$1.createElement('div', {
|
|
16469
16423
|
style: {
|
|
16470
16424
|
display: 'flex',
|
|
16471
16425
|
flexDirection: 'column',
|
|
16472
16426
|
gap: '8px',
|
|
16473
16427
|
},
|
|
16474
|
-
}, ...
|
|
16428
|
+
}, ...mainButtons, orDivider, emailButton)));
|
|
16475
16429
|
};
|
|
16476
16430
|
// Wrapper component with PhantomProvider
|
|
16477
16431
|
const PhantomProviderWrapper = () => {
|
|
@@ -16504,13 +16458,6 @@ class PhantomWalletProvider {
|
|
|
16504
16458
|
if (this.initPromise) {
|
|
16505
16459
|
await this.initPromise;
|
|
16506
16460
|
}
|
|
16507
|
-
// Lazy-mount path: if initializeAsync deferred the React mount (e.g.
|
|
16508
|
-
// first-time visitor on Android Chrome PWA), do it now. We're being
|
|
16509
|
-
// called from a user-gesture flow like login(), so any Android intent
|
|
16510
|
-
// dialog that surfaces will appear with the activity already focused.
|
|
16511
|
-
if (!this.containerElement) {
|
|
16512
|
-
this.initialize();
|
|
16513
|
-
}
|
|
16514
16461
|
// Wait for SDK to be ready
|
|
16515
16462
|
await new Promise((resolve) => {
|
|
16516
16463
|
const check = () => {
|
|
@@ -16604,7 +16551,7 @@ class PhantomWalletProvider {
|
|
|
16604
16551
|
this.pendingLogin.reject = reject;
|
|
16605
16552
|
});
|
|
16606
16553
|
}
|
|
16607
|
-
|
|
16554
|
+
const loginPromise = new Promise((resolve, reject) => {
|
|
16608
16555
|
this.pendingLogin = { resolve, reject };
|
|
16609
16556
|
this.loginInProgress = true;
|
|
16610
16557
|
// Always use our custom wallet modal
|
|
@@ -16618,55 +16565,17 @@ class PhantomWalletProvider {
|
|
|
16618
16565
|
}
|
|
16619
16566
|
}, 180000);
|
|
16620
16567
|
});
|
|
16568
|
+
return loginPromise.finally(() => {
|
|
16569
|
+
this.loginOverrides = null;
|
|
16570
|
+
});
|
|
16621
16571
|
}
|
|
16622
16572
|
async restoreSession() {
|
|
16623
|
-
|
|
16624
|
-
|
|
16625
|
-
|
|
16626
|
-
|
|
16627
|
-
// before the PWA activity has window focus on Solana Seeker. The
|
|
16628
|
-
// resulting "access other apps and services" system dialog renders
|
|
16629
|
-
// with grayed-out buttons.
|
|
16630
|
-
//
|
|
16631
|
-
// Wrap getSession() in try/catch: WebSessionManager.getSession() runs
|
|
16632
|
-
// JSON.parse on the stored session *outside* its internal try/catch,
|
|
16633
|
-
// so genuinely malformed JSON in localStorage would propagate through
|
|
16634
|
-
// restoreSession() and break init() entirely. Treat any throw as
|
|
16635
|
-
// "no session" and fall through to the cleanup path so corrupted
|
|
16636
|
-
// storage is recoverable on next load.
|
|
16637
|
-
let session;
|
|
16638
|
-
try {
|
|
16639
|
-
session = await WebSessionManager.getSession();
|
|
16640
|
-
}
|
|
16641
|
-
catch (_a) {
|
|
16642
|
-
session = null;
|
|
16643
|
-
}
|
|
16644
|
-
if (!session) {
|
|
16645
|
-
// Tidy up storage so we don't leave junk behind:
|
|
16646
|
-
// (a) clearSession() removes any stale or unparseable session
|
|
16647
|
-
// storage entry. WebSessionManager.getSession() can't reach
|
|
16648
|
-
// its own clearSession() if JSON.parse threw. Idempotent —
|
|
16649
|
-
// safe to call unconditionally here.
|
|
16650
|
-
// (b) Drop the auth-method marker if it's stale.
|
|
16651
|
-
// WebSessionManager.clearSession() only removes the session
|
|
16652
|
-
// storage key, not the marker — so without this cleanup
|
|
16653
|
-
// shouldMountEagerly() would keep eager-mounting on every
|
|
16654
|
-
// future cold start.
|
|
16655
|
-
try {
|
|
16656
|
-
WebSessionManager.clearSession();
|
|
16657
|
-
}
|
|
16658
|
-
catch ( /* best-effort */_b) { /* best-effort */ }
|
|
16659
|
-
try {
|
|
16660
|
-
if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'phantom') {
|
|
16661
|
-
getPlatform().storage.removeItem('tarobase_last_auth_method');
|
|
16662
|
-
}
|
|
16663
|
-
}
|
|
16664
|
-
catch (_c) {
|
|
16665
|
-
// storage unavailable — best-effort cleanup
|
|
16666
|
-
}
|
|
16667
|
-
return null;
|
|
16573
|
+
await this.ensureReady();
|
|
16574
|
+
const session = await WebSessionManager.getSession();
|
|
16575
|
+
if (session) {
|
|
16576
|
+
return { provider: this, address: session.address };
|
|
16668
16577
|
}
|
|
16669
|
-
return
|
|
16578
|
+
return null;
|
|
16670
16579
|
}
|
|
16671
16580
|
async address() {
|
|
16672
16581
|
var _a, _b, _c, _d;
|
|
@@ -20157,137 +20066,161 @@ function createSolanaRpcSubscriptionsFromTransport(transport) {
|
|
|
20157
20066
|
});
|
|
20158
20067
|
}
|
|
20159
20068
|
|
|
20160
|
-
|
|
20161
|
-
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
-
|
|
20165
|
-
|
|
20166
|
-
|
|
20167
|
-
|
|
20168
|
-
|
|
20169
|
-
|
|
20170
|
-
|
|
20171
|
-
|
|
20172
|
-
|
|
20173
|
-
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
|
|
20177
|
-
|
|
20178
|
-
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20182
|
-
|
|
20183
|
-
|
|
20184
|
-
|
|
20185
|
-
|
|
20186
|
-
|
|
20187
|
-
|
|
20188
|
-
|
|
20189
|
-
|
|
20190
|
-
|
|
20191
|
-
|
|
20192
|
-
|
|
20193
|
-
|
|
20194
|
-
|
|
20195
|
-
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20199
|
-
|
|
20200
|
-
|
|
20201
|
-
|
|
20202
|
-
|
|
20203
|
-
|
|
20204
|
-
|
|
20205
|
-
|
|
20206
|
-
|
|
20207
|
-
|
|
20208
|
-
|
|
20209
|
-
|
|
20210
|
-
|
|
20211
|
-
|
|
20212
|
-
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
|
|
20216
|
-
|
|
20217
|
-
|
|
20218
|
-
|
|
20219
|
-
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20223
|
-
|
|
20224
|
-
|
|
20225
|
-
|
|
20226
|
-
|
|
20227
|
-
|
|
20228
|
-
|
|
20229
|
-
|
|
20230
|
-
|
|
20231
|
-
|
|
20232
|
-
|
|
20233
|
-
|
|
20234
|
-
|
|
20235
|
-
|
|
20236
|
-
|
|
20237
|
-
|
|
20238
|
-
|
|
20239
|
-
|
|
20240
|
-
|
|
20241
|
-
|
|
20242
|
-
|
|
20243
|
-
|
|
20244
|
-
|
|
20245
|
-
|
|
20246
|
-
|
|
20247
|
-
|
|
20248
|
-
|
|
20249
|
-
|
|
20250
|
-
|
|
20251
|
-
|
|
20252
|
-
|
|
20253
|
-
|
|
20254
|
-
|
|
20255
|
-
|
|
20256
|
-
|
|
20257
|
-
|
|
20258
|
-
|
|
20259
|
-
|
|
20260
|
-
|
|
20261
|
-
|
|
20262
|
-
|
|
20263
|
-
|
|
20264
|
-
|
|
20265
|
-
|
|
20266
|
-
|
|
20267
|
-
|
|
20268
|
-
|
|
20269
|
-
|
|
20270
|
-
|
|
20271
|
-
|
|
20272
|
-
|
|
20273
|
-
|
|
20274
|
-
|
|
20275
|
-
|
|
20276
|
-
|
|
20277
|
-
|
|
20278
|
-
|
|
20279
|
-
|
|
20280
|
-
|
|
20281
|
-
|
|
20069
|
+
var cjs = {};
|
|
20070
|
+
|
|
20071
|
+
var hasRequiredCjs;
|
|
20072
|
+
|
|
20073
|
+
function requireCjs () {
|
|
20074
|
+
if (hasRequiredCjs) return cjs;
|
|
20075
|
+
hasRequiredCjs = 1;
|
|
20076
|
+
// base-x encoding / decoding
|
|
20077
|
+
// Copyright (c) 2018 base-x contributors
|
|
20078
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
20079
|
+
// Distributed under the MIT software license, see the accompanying
|
|
20080
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
20081
|
+
Object.defineProperty(cjs, '__esModule', { value: true });
|
|
20082
|
+
function base (ALPHABET) {
|
|
20083
|
+
if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }
|
|
20084
|
+
const BASE_MAP = new Uint8Array(256);
|
|
20085
|
+
for (let j = 0; j < BASE_MAP.length; j++) {
|
|
20086
|
+
BASE_MAP[j] = 255;
|
|
20087
|
+
}
|
|
20088
|
+
for (let i = 0; i < ALPHABET.length; i++) {
|
|
20089
|
+
const x = ALPHABET.charAt(i);
|
|
20090
|
+
const xc = x.charCodeAt(0);
|
|
20091
|
+
if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }
|
|
20092
|
+
BASE_MAP[xc] = i;
|
|
20093
|
+
}
|
|
20094
|
+
const BASE = ALPHABET.length;
|
|
20095
|
+
const LEADER = ALPHABET.charAt(0);
|
|
20096
|
+
const FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
20097
|
+
const iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
20098
|
+
function encode (source) {
|
|
20099
|
+
// eslint-disable-next-line no-empty
|
|
20100
|
+
if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {
|
|
20101
|
+
source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);
|
|
20102
|
+
} else if (Array.isArray(source)) {
|
|
20103
|
+
source = Uint8Array.from(source);
|
|
20104
|
+
}
|
|
20105
|
+
if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }
|
|
20106
|
+
if (source.length === 0) { return '' }
|
|
20107
|
+
// Skip & count leading zeroes.
|
|
20108
|
+
let zeroes = 0;
|
|
20109
|
+
let length = 0;
|
|
20110
|
+
let pbegin = 0;
|
|
20111
|
+
const pend = source.length;
|
|
20112
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
20113
|
+
pbegin++;
|
|
20114
|
+
zeroes++;
|
|
20115
|
+
}
|
|
20116
|
+
// Allocate enough space in big-endian base58 representation.
|
|
20117
|
+
const size = ((pend - pbegin) * iFACTOR + 1) >>> 0;
|
|
20118
|
+
const b58 = new Uint8Array(size);
|
|
20119
|
+
// Process the bytes.
|
|
20120
|
+
while (pbegin !== pend) {
|
|
20121
|
+
let carry = source[pbegin];
|
|
20122
|
+
// Apply "b58 = b58 * 256 + ch".
|
|
20123
|
+
let i = 0;
|
|
20124
|
+
for (let it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {
|
|
20125
|
+
carry += (256 * b58[it1]) >>> 0;
|
|
20126
|
+
b58[it1] = (carry % BASE) >>> 0;
|
|
20127
|
+
carry = (carry / BASE) >>> 0;
|
|
20128
|
+
}
|
|
20129
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20130
|
+
length = i;
|
|
20131
|
+
pbegin++;
|
|
20132
|
+
}
|
|
20133
|
+
// Skip leading zeroes in base58 result.
|
|
20134
|
+
let it2 = size - length;
|
|
20135
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
20136
|
+
it2++;
|
|
20137
|
+
}
|
|
20138
|
+
// Translate the result into a string.
|
|
20139
|
+
let str = LEADER.repeat(zeroes);
|
|
20140
|
+
for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }
|
|
20141
|
+
return str
|
|
20142
|
+
}
|
|
20143
|
+
function decodeUnsafe (source) {
|
|
20144
|
+
if (typeof source !== 'string') { throw new TypeError('Expected String') }
|
|
20145
|
+
if (source.length === 0) { return new Uint8Array() }
|
|
20146
|
+
let psz = 0;
|
|
20147
|
+
// Skip and count leading '1's.
|
|
20148
|
+
let zeroes = 0;
|
|
20149
|
+
let length = 0;
|
|
20150
|
+
while (source[psz] === LEADER) {
|
|
20151
|
+
zeroes++;
|
|
20152
|
+
psz++;
|
|
20153
|
+
}
|
|
20154
|
+
// Allocate enough space in big-endian base256 representation.
|
|
20155
|
+
const size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.
|
|
20156
|
+
const b256 = new Uint8Array(size);
|
|
20157
|
+
// Process the characters.
|
|
20158
|
+
while (psz < source.length) {
|
|
20159
|
+
// Find code of next character
|
|
20160
|
+
const charCode = source.charCodeAt(psz);
|
|
20161
|
+
// Base map can not be indexed using char code
|
|
20162
|
+
if (charCode > 255) { return }
|
|
20163
|
+
// Decode character
|
|
20164
|
+
let carry = BASE_MAP[charCode];
|
|
20165
|
+
// Invalid character
|
|
20166
|
+
if (carry === 255) { return }
|
|
20167
|
+
let i = 0;
|
|
20168
|
+
for (let it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {
|
|
20169
|
+
carry += (BASE * b256[it3]) >>> 0;
|
|
20170
|
+
b256[it3] = (carry % 256) >>> 0;
|
|
20171
|
+
carry = (carry / 256) >>> 0;
|
|
20172
|
+
}
|
|
20173
|
+
if (carry !== 0) { throw new Error('Non-zero carry') }
|
|
20174
|
+
length = i;
|
|
20175
|
+
psz++;
|
|
20176
|
+
}
|
|
20177
|
+
// Skip leading zeroes in b256.
|
|
20178
|
+
let it4 = size - length;
|
|
20179
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
20180
|
+
it4++;
|
|
20181
|
+
}
|
|
20182
|
+
const vch = new Uint8Array(zeroes + (size - it4));
|
|
20183
|
+
let j = zeroes;
|
|
20184
|
+
while (it4 !== size) {
|
|
20185
|
+
vch[j++] = b256[it4++];
|
|
20186
|
+
}
|
|
20187
|
+
return vch
|
|
20188
|
+
}
|
|
20189
|
+
function decode (string) {
|
|
20190
|
+
const buffer = decodeUnsafe(string);
|
|
20191
|
+
if (buffer) { return buffer }
|
|
20192
|
+
throw new Error('Non-base' + BASE + ' character')
|
|
20193
|
+
}
|
|
20194
|
+
return {
|
|
20195
|
+
encode,
|
|
20196
|
+
decodeUnsafe,
|
|
20197
|
+
decode
|
|
20198
|
+
}
|
|
20199
|
+
}
|
|
20200
|
+
cjs.default = base;
|
|
20201
|
+
return cjs;
|
|
20282
20202
|
}
|
|
20283
20203
|
|
|
20284
|
-
var
|
|
20285
|
-
var
|
|
20204
|
+
var bs58;
|
|
20205
|
+
var hasRequiredBs58;
|
|
20206
|
+
|
|
20207
|
+
function requireBs58 () {
|
|
20208
|
+
if (hasRequiredBs58) return bs58;
|
|
20209
|
+
hasRequiredBs58 = 1;
|
|
20210
|
+
var basex = requireCjs();
|
|
20211
|
+
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
20212
|
+
|
|
20213
|
+
bs58 = basex(ALPHABET);
|
|
20214
|
+
return bs58;
|
|
20215
|
+
}
|
|
20286
20216
|
|
|
20287
|
-
var
|
|
20217
|
+
var bs58Exports = requireBs58();
|
|
20218
|
+
var base58 = /*@__PURE__*/getDefaultExportFromCjs$1(bs58Exports);
|
|
20219
|
+
|
|
20220
|
+
var index = /*#__PURE__*/_mergeNamespaces({
|
|
20288
20221
|
__proto__: null,
|
|
20289
|
-
default:
|
|
20290
|
-
});
|
|
20222
|
+
default: base58
|
|
20223
|
+
}, [bs58Exports]);
|
|
20291
20224
|
|
|
20292
20225
|
const SURFNET_RPC_URL$1 = "https://surfpool.fly.dev";
|
|
20293
20226
|
let React;
|
|
@@ -21021,7 +20954,7 @@ class PrivyWalletProvider {
|
|
|
21021
20954
|
// Handle case where signature might be bytes instead of string
|
|
21022
20955
|
const rawSig = result.signature;
|
|
21023
20956
|
if (rawSig instanceof Uint8Array || Array.isArray(rawSig)) {
|
|
21024
|
-
signature =
|
|
20957
|
+
signature = base58.encode(rawSig instanceof Uint8Array ? rawSig : new Uint8Array(rawSig));
|
|
21025
20958
|
}
|
|
21026
20959
|
else {
|
|
21027
20960
|
signature = rawSig;
|
|
@@ -21189,63 +21122,6 @@ function isMobileWalletAvailable() {
|
|
|
21189
21122
|
return detectAndroid();
|
|
21190
21123
|
}
|
|
21191
21124
|
const ED25519_SIGNATURE_LENGTH = 64;
|
|
21192
|
-
/**
|
|
21193
|
-
* On Android Chrome PWA (e.g. Solana Seeker in standalone mode), MWA's
|
|
21194
|
-
* transact() opens a WebSocket to ws://localhost:<port>/solana-wallet to
|
|
21195
|
-
* handshake with the wallet app on the device. Chrome guards localhost
|
|
21196
|
-
* connections behind the Local Network Access ("Apps on Device") permission
|
|
21197
|
-
* dialog. The dialog inherits the activity's window-focus state at spawn
|
|
21198
|
-
* time — so if focus is in transit (e.g. just after a Phantom-modal close
|
|
21199
|
-
* triggers a React commit), the dialog renders with grayed-out Allow/Block
|
|
21200
|
-
* buttons and only becomes interactive after a manual background→resume
|
|
21201
|
-
* (which forces an onPause→onResume cycle on the activity).
|
|
21202
|
-
*
|
|
21203
|
-
* Wait for window focus to settle, then yield one frame, before opening
|
|
21204
|
-
* the WebSocket. This makes the system dialog spawn into a focused activity
|
|
21205
|
-
* so its buttons are immediately tappable.
|
|
21206
|
-
*/
|
|
21207
|
-
async function awaitActivityFocus() {
|
|
21208
|
-
var _a;
|
|
21209
|
-
if (typeof document === 'undefined' || typeof window === 'undefined')
|
|
21210
|
-
return;
|
|
21211
|
-
const t0 = Date.now();
|
|
21212
|
-
const initialHasFocus = document.hasFocus();
|
|
21213
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: enter', {
|
|
21214
|
-
hasFocus: initialHasFocus,
|
|
21215
|
-
visibilityState: document.visibilityState,
|
|
21216
|
-
activeElement: (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.tagName,
|
|
21217
|
-
});
|
|
21218
|
-
if (!initialHasFocus) {
|
|
21219
|
-
let resolvedBy = 'pending';
|
|
21220
|
-
await new Promise((resolve) => {
|
|
21221
|
-
const onFocus = () => {
|
|
21222
|
-
window.removeEventListener('focus', onFocus);
|
|
21223
|
-
resolvedBy = 'focus-event';
|
|
21224
|
-
resolve();
|
|
21225
|
-
};
|
|
21226
|
-
window.addEventListener('focus', onFocus);
|
|
21227
|
-
// Fallback in case the focus event never fires (e.g. activity
|
|
21228
|
-
// already focused but document.hasFocus() momentarily lies during
|
|
21229
|
-
// a React commit). 600ms is a perceptual ceiling — beyond this
|
|
21230
|
-
// the user notices a stall, so we'd rather take the focus race
|
|
21231
|
-
// than block forever.
|
|
21232
|
-
setTimeout(() => {
|
|
21233
|
-
window.removeEventListener('focus', onFocus);
|
|
21234
|
-
if (resolvedBy === 'pending')
|
|
21235
|
-
resolvedBy = 'timeout';
|
|
21236
|
-
resolve();
|
|
21237
|
-
}, 600);
|
|
21238
|
-
});
|
|
21239
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: wait resolved', { resolvedBy, waitedMs: Date.now() - t0 });
|
|
21240
|
-
}
|
|
21241
|
-
// Yield to next paint so any pending React commits / focus changes have
|
|
21242
|
-
// flushed before the WebSocket open spawns the system dialog.
|
|
21243
|
-
await new Promise((r) => requestAnimationFrame(() => r()));
|
|
21244
|
-
console.log('[MWA-DEBUG] awaitActivityFocus: exit', {
|
|
21245
|
-
hasFocus: document.hasFocus(),
|
|
21246
|
-
totalMs: Date.now() - t0,
|
|
21247
|
-
});
|
|
21248
|
-
}
|
|
21249
21125
|
// Dynamically imported MWA protocol module
|
|
21250
21126
|
let mwaProtocolModule = null;
|
|
21251
21127
|
let mwaProtocolLoadPromise = null;
|
|
@@ -21258,7 +21134,7 @@ async function loadMwaProtocol() {
|
|
|
21258
21134
|
return mwaProtocolLoadPromise;
|
|
21259
21135
|
mwaProtocolLoadPromise = (async () => {
|
|
21260
21136
|
try {
|
|
21261
|
-
mwaProtocolModule = await import('./index.browser-
|
|
21137
|
+
mwaProtocolModule = await import('./index.browser-pE1s68e9.esm.js');
|
|
21262
21138
|
}
|
|
21263
21139
|
catch (e) {
|
|
21264
21140
|
console.warn('[SolanaMobileWallet] @solana-mobile/mobile-wallet-adapter-protocol-web3js not installed. Install it to enable Seeker wallet support.');
|
|
@@ -21280,7 +21156,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
21280
21156
|
if (typeof window === 'undefined')
|
|
21281
21157
|
return;
|
|
21282
21158
|
try {
|
|
21283
|
-
const walletStandardMobile = await import('./index.browser-
|
|
21159
|
+
const walletStandardMobile = await import('./index.browser-BNdFfyIg.esm.js');
|
|
21284
21160
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
21285
21161
|
if (!registerMwa) {
|
|
21286
21162
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -21409,17 +21285,14 @@ class SolanaMobileWalletProvider {
|
|
|
21409
21285
|
}
|
|
21410
21286
|
async login() {
|
|
21411
21287
|
var _a, _b, _c, _d, _e;
|
|
21412
|
-
console.log('[MWA-DEBUG] SolanaMobileWalletProvider.login: enter');
|
|
21413
21288
|
setAuthLoading(true);
|
|
21414
21289
|
try {
|
|
21415
21290
|
await loadMwaProtocol();
|
|
21416
|
-
console.log('[MWA-DEBUG] loadMwaProtocol resolved');
|
|
21417
21291
|
const { transact } = mwaProtocolModule;
|
|
21418
21292
|
// Quick check: if we already have auth state and a valid session, skip
|
|
21419
21293
|
if (this.authorizedPublicKey) {
|
|
21420
21294
|
const existingSession = await WebSessionManager.getSession();
|
|
21421
21295
|
if (existingSession && existingSession.address === this.authorizedPublicKey) {
|
|
21422
|
-
console.log('[MWA-DEBUG] login: returning existing session, no transact');
|
|
21423
21296
|
const user = { provider: this, address: this.authorizedPublicKey };
|
|
21424
21297
|
setCurrentUser(user);
|
|
21425
21298
|
return user;
|
|
@@ -21427,12 +21300,8 @@ class SolanaMobileWalletProvider {
|
|
|
21427
21300
|
}
|
|
21428
21301
|
// Pre-fetch nonce from server while wallet is not yet connected
|
|
21429
21302
|
const nonce = await genAuthNonce();
|
|
21430
|
-
console.log('[MWA-DEBUG] login: nonce fetched, awaiting activity focus');
|
|
21431
|
-
await awaitActivityFocus();
|
|
21432
|
-
console.log('[MWA-DEBUG] login: about to call transact() — WebSocket to localhost will open now');
|
|
21433
21303
|
// Single transact() call: authorize + signMessages — one wallet popup
|
|
21434
21304
|
const result = await transact(async (wallet) => {
|
|
21435
|
-
console.log('[MWA-DEBUG] transact callback running — WebSocket connected, calling wallet.authorize');
|
|
21436
21305
|
// Step 1: Authorize — user approves the dApp
|
|
21437
21306
|
const authResult = await wallet.authorize({
|
|
21438
21307
|
identity: this.appIdentity,
|
|
@@ -21462,7 +21331,6 @@ class SolanaMobileWalletProvider {
|
|
|
21462
21331
|
walletUriBase: authResult.wallet_uri_base,
|
|
21463
21332
|
};
|
|
21464
21333
|
}, this.getAssociationConfig());
|
|
21465
|
-
console.log('[MWA-DEBUG] login: transact() resolved successfully');
|
|
21466
21334
|
// Store MWA auth state for reauthorization in subsequent transact() calls
|
|
21467
21335
|
this.authToken = result.authToken;
|
|
21468
21336
|
this.walletUriBase = result.walletUriBase;
|
|
@@ -21489,12 +21357,6 @@ class SolanaMobileWalletProvider {
|
|
|
21489
21357
|
return user;
|
|
21490
21358
|
}
|
|
21491
21359
|
catch (error) {
|
|
21492
|
-
console.log('[MWA-DEBUG] login caught error', {
|
|
21493
|
-
errorName: error === null || error === void 0 ? void 0 : error.name,
|
|
21494
|
-
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
21495
|
-
errorCode: error === null || error === void 0 ? void 0 : error.code,
|
|
21496
|
-
hasFocus: typeof document !== 'undefined' ? document.hasFocus() : 'n/a',
|
|
21497
|
-
});
|
|
21498
21360
|
const isUserRejection = (error === null || error === void 0 ? void 0 : error.code) === 4001 ||
|
|
21499
21361
|
((_a = error === null || error === void 0 ? void 0 : error.message) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('user rejected')) ||
|
|
21500
21362
|
((_b = error === null || error === void 0 ? void 0 : error.message) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes('user denied')) ||
|
|
@@ -21526,7 +21388,6 @@ class SolanaMobileWalletProvider {
|
|
|
21526
21388
|
await loadMwaProtocol();
|
|
21527
21389
|
const { transact } = mwaProtocolModule;
|
|
21528
21390
|
const authToken = this.authToken;
|
|
21529
|
-
await awaitActivityFocus();
|
|
21530
21391
|
await transact(async (wallet) => {
|
|
21531
21392
|
await wallet.deauthorize({ auth_token: authToken });
|
|
21532
21393
|
}, this.getAssociationConfig());
|
|
@@ -21552,7 +21413,6 @@ class SolanaMobileWalletProvider {
|
|
|
21552
21413
|
const { transact } = mwaProtocolModule;
|
|
21553
21414
|
const base64Addr = this.base64Address;
|
|
21554
21415
|
try {
|
|
21555
|
-
await awaitActivityFocus();
|
|
21556
21416
|
const signedMessages = await transact(async (wallet) => {
|
|
21557
21417
|
await this.reauthorizeWallet(wallet);
|
|
21558
21418
|
const messageBytes = getPlatform().textEncode(message);
|
|
@@ -21606,7 +21466,6 @@ class SolanaMobileWalletProvider {
|
|
|
21606
21466
|
}
|
|
21607
21467
|
}
|
|
21608
21468
|
try {
|
|
21609
|
-
await awaitActivityFocus();
|
|
21610
21469
|
const signedTransactions = await transact(async (wallet) => {
|
|
21611
21470
|
await this.reauthorizeWallet(wallet);
|
|
21612
21471
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -21654,7 +21513,6 @@ class SolanaMobileWalletProvider {
|
|
|
21654
21513
|
}
|
|
21655
21514
|
if (isSurfnet) {
|
|
21656
21515
|
// Surfnet: sign-only, then submit to our specific RPC
|
|
21657
|
-
await awaitActivityFocus();
|
|
21658
21516
|
const signedTransactions = await transact(async (wallet) => {
|
|
21659
21517
|
await this.reauthorizeWallet(wallet);
|
|
21660
21518
|
return wallet.signTransactions({ transactions: [transaction] });
|
|
@@ -21674,7 +21532,6 @@ class SolanaMobileWalletProvider {
|
|
|
21674
21532
|
return signature;
|
|
21675
21533
|
}
|
|
21676
21534
|
// Non-surfnet: use signAndSendTransactions for wallet-optimized submission
|
|
21677
|
-
await awaitActivityFocus();
|
|
21678
21535
|
const signatures = await transact(async (wallet) => {
|
|
21679
21536
|
await this.reauthorizeWallet(wallet);
|
|
21680
21537
|
return wallet.signAndSendTransactions({
|
|
@@ -21758,7 +21615,6 @@ class SolanaMobileWalletProvider {
|
|
|
21758
21615
|
tx = result.tx;
|
|
21759
21616
|
}
|
|
21760
21617
|
if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false) {
|
|
21761
|
-
await awaitActivityFocus();
|
|
21762
21618
|
const [signedTx] = await transact(async (wallet) => {
|
|
21763
21619
|
await this.reauthorizeWallet(wallet);
|
|
21764
21620
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -21772,7 +21628,6 @@ class SolanaMobileWalletProvider {
|
|
|
21772
21628
|
}
|
|
21773
21629
|
if (isSurfnet) {
|
|
21774
21630
|
// Surfnet: sign then submit manually to our RPC
|
|
21775
|
-
await awaitActivityFocus();
|
|
21776
21631
|
const [signedTx] = await transact(async (wallet) => {
|
|
21777
21632
|
await this.reauthorizeWallet(wallet);
|
|
21778
21633
|
return wallet.signTransactions({ transactions: [tx] });
|
|
@@ -21801,7 +21656,6 @@ class SolanaMobileWalletProvider {
|
|
|
21801
21656
|
};
|
|
21802
21657
|
}
|
|
21803
21658
|
// Non-surfnet: use signAndSendTransactions
|
|
21804
|
-
await awaitActivityFocus();
|
|
21805
21659
|
const signatures = await transact(async (wallet) => {
|
|
21806
21660
|
await this.reauthorizeWallet(wallet);
|
|
21807
21661
|
return wallet.signAndSendTransactions({
|
|
@@ -22055,7 +21909,7 @@ class PrivyExpoProvider {
|
|
|
22055
21909
|
const wallet = await this.getWalletOrThrow();
|
|
22056
21910
|
const messageBytes = getPlatform().textEncode(message);
|
|
22057
21911
|
const result = await wallet.signMessage(messageBytes);
|
|
22058
|
-
return
|
|
21912
|
+
return base58.encode(result.signature);
|
|
22059
21913
|
}
|
|
22060
21914
|
async signTransaction(transaction) {
|
|
22061
21915
|
await this.ensureReady();
|
|
@@ -22210,5 +22064,5 @@ class PrivyExpoProvider {
|
|
|
22210
22064
|
}
|
|
22211
22065
|
}
|
|
22212
22066
|
|
|
22213
|
-
export {
|
|
22214
|
-
//# sourceMappingURL=index-
|
|
22067
|
+
export { genAuthNonce as $, count as A, aggregate as B, subscribe as C, useAuth as D, deserializeTransaction as E, getIdToken as F, setPlatform as G, getPlatform as H, PrivyWalletProvider as I, DEFAULT_TEST_ADDRESS as J, isMobileWalletAvailable as K, registerMobileWalletAdapter as L, MockAuthProvider as M, PrivyExpoProvider as N, OffchainAuthProvider as O, PhantomWalletProvider as P, InsufficientBalanceError as Q, ReactNativeSessionManager as R, SolanaMobileWalletProvider as S, ServerSessionManager as T, buildSetDocumentsTransaction as U, clearCache as V, WebSessionManager as W, closeAllSubscriptions as X, convertRemainingAccounts as Y, createSessionWithPrivy as Z, createSessionWithSignature as _, base58 as a, genSolanaMessage as a0, getCachedData as a1, getMany as a2, reconnectWithNewAuth as a3, refreshSession as a4, signSessionCreateMessage as a5, bufferExports as b, commonjsRequire as c, getCurrentUser as d, onAuthLoadingChanged as e, getAuthLoading as f, getDefaultExportFromCjs$1 as g, logout as h, init as i, getConfig as j, getAuthProvider as k, login as l, get as m, setMany as n, onAuthStateChanged as o, setFile as p, getFiles as q, require$$0 as r, set as s, runQuery as t, runQueryMany as u, runExpression as v, runExpressionMany as w, signMessage as x, signTransaction as y, signAndSubmitTransaction as z };
|
|
22068
|
+
//# sourceMappingURL=index-nt_HQVrk.esm.js.map
|