@pooflabs/web 0.0.89-rc2 → 0.0.89-rc4
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/hooks/usePoofnetWallet.d.ts +28 -0
- package/dist/auth/providers/mock-poofnet-provider.d.ts +10 -25
- package/dist/{index-DQhWZskl.esm.js → index-Bop7HFA-.esm.js} +2 -2
- package/dist/{index-4JUcdcnk.esm.js.map → index-Bop7HFA-.esm.js.map} +1 -1
- package/dist/{index-CXmcQaFm.js → index-CEADZ0na.js} +2 -2
- package/dist/{index-CXmcQaFm.js.map → index-CEADZ0na.js.map} +1 -1
- package/dist/{index-Cgaz8U9W.esm.js → index-DGOP9-5L.esm.js} +132 -87
- package/dist/index-DGOP9-5L.esm.js.map +1 -0
- package/dist/{index-BLiaV7Dz.js → index-DHI02_l_.js} +132 -86
- package/dist/index-DHI02_l_.js.map +1 -0
- package/dist/{index-QJAj_nTx.js → index-DS3Ftep_.js} +2 -2
- package/dist/{index-QJAj_nTx.js.map → index-DS3Ftep_.js.map} +1 -1
- package/dist/{index-4JUcdcnk.esm.js → index-DZhOa-_D.esm.js} +2 -2
- package/dist/{index-DQhWZskl.esm.js.map → index-DZhOa-_D.esm.js.map} +1 -1
- package/dist/{index.browser-kQdoMu7Y.esm.js → index.browser-0dewreQm.esm.js} +2 -2
- package/dist/{index.browser-kQdoMu7Y.esm.js.map → index.browser-0dewreQm.esm.js.map} +1 -1
- package/dist/{index.browser-CG2sQjrd.esm.js → index.browser-B-pUCZgP.esm.js} +2 -2
- package/dist/{index.browser-CG2sQjrd.esm.js.map → index.browser-B-pUCZgP.esm.js.map} +1 -1
- package/dist/{index.browser-B9NfvmrP.js → index.browser-C9AVHEa4.js} +2 -2
- package/dist/{index.browser-B9NfvmrP.js.map → index.browser-C9AVHEa4.js.map} +1 -1
- package/dist/{index.browser-UxB-zDuA.js → index.browser-rhFUHjM1.js} +2 -2
- package/dist/{index.browser-UxB-zDuA.js.map → index.browser-rhFUHjM1.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/{index.native-CwpIbypp.esm.js → index.native-CXtxnE1X.esm.js} +114 -85
- package/dist/index.native-CXtxnE1X.esm.js.map +1 -0
- package/dist/{index.native-Cycwo-3I.js → index.native-DzDWIHgW.js} +114 -84
- package/dist/index.native-DzDWIHgW.js.map +1 -0
- package/dist/index.native.d.ts +2 -0
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +2 -1
- package/dist/index.native.js.map +1 -1
- package/dist/{phantom-wallet-provider-DM-96ILz.esm.js → phantom-wallet-provider-SmsVVBCI.esm.js} +16 -3
- package/dist/phantom-wallet-provider-SmsVVBCI.esm.js.map +1 -0
- package/dist/{phantom-wallet-provider-BgDhrraw.js → phantom-wallet-provider-mA4Yaf-t.js} +16 -3
- package/dist/phantom-wallet-provider-mA4Yaf-t.js.map +1 -0
- package/dist/{privy-wallet-provider-C70AIqHI.esm.js → privy-wallet-provider-BNPm2WEZ.esm.js} +3 -3
- package/dist/{privy-wallet-provider-C70AIqHI.esm.js.map → privy-wallet-provider-BNPm2WEZ.esm.js.map} +1 -1
- package/dist/{privy-wallet-provider-D4IYOUji.js → privy-wallet-provider-CHMc_YjB.js} +3 -3
- package/dist/{privy-wallet-provider-D4IYOUji.js.map → privy-wallet-provider-CHMc_YjB.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-CXXw-pKg.esm.js → solana-mobile-wallet-provider-BMGBQI3W.esm.js} +8 -5
- package/dist/solana-mobile-wallet-provider-BMGBQI3W.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BrjPc7Wd.js → solana-mobile-wallet-provider-DmBKAypM.js} +8 -5
- package/dist/solana-mobile-wallet-provider-DmBKAypM.js.map +1 -0
- package/package.json +1 -1
- package/dist/index-BLiaV7Dz.js.map +0 -1
- package/dist/index-Cgaz8U9W.esm.js.map +0 -1
- package/dist/index.native-CwpIbypp.esm.js.map +0 -1
- package/dist/index.native-Cycwo-3I.js.map +0 -1
- package/dist/phantom-wallet-provider-BgDhrraw.js.map +0 -1
- package/dist/phantom-wallet-provider-DM-96ILz.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BrjPc7Wd.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-CXXw-pKg.esm.js.map +0 -1
|
@@ -16895,13 +16895,19 @@ const AUTH_METHOD = 'poofnet-mock';
|
|
|
16895
16895
|
* wrapped by OffchainAuthProvider so transaction mocking is unchanged. Mainnet
|
|
16896
16896
|
* never touches this class.
|
|
16897
16897
|
*/
|
|
16898
|
+
/**
|
|
16899
|
+
* The active MockPoofnetProvider instance while mock-connected. Exposed so the
|
|
16900
|
+
* usePoofnetWallet() hook (and thus the app's own wallet UI, e.g. WalletButton)
|
|
16901
|
+
* can list/switch/generate mock wallets. Null when not mock-connected.
|
|
16902
|
+
*/
|
|
16903
|
+
let activeMockPoofnetInstance = null;
|
|
16904
|
+
function getActiveMockPoofnetProvider() {
|
|
16905
|
+
return activeMockPoofnetInstance;
|
|
16906
|
+
}
|
|
16898
16907
|
class MockPoofnetProvider {
|
|
16899
16908
|
constructor() {
|
|
16900
16909
|
/** The keypair for the currently-connected mock wallet (re-derived on login/switch/restore). */
|
|
16901
16910
|
this.activeKeypair = null;
|
|
16902
|
-
/** Floating wallet widget root (web only). */
|
|
16903
|
-
this.widgetEl = null;
|
|
16904
|
-
this.widgetExpanded = false;
|
|
16905
16911
|
}
|
|
16906
16912
|
// ============ Identity / derivation ============
|
|
16907
16913
|
getDeviceId() {
|
|
@@ -17000,21 +17006,24 @@ class MockPoofnetProvider {
|
|
|
17000
17006
|
}
|
|
17001
17007
|
const index = Math.min(meta.activeIndex, meta.count - 1);
|
|
17002
17008
|
this.activeKeypair = await this.deriveKeypair(appId, index);
|
|
17009
|
+
// Set the singleton BEFORE mintSession — mintSession calls setCurrentUser,
|
|
17010
|
+
// which fires onAuthStateChanged → usePoofnetWallet.refresh(); that refresh
|
|
17011
|
+
// must see this instance (else isMock is false until a reload).
|
|
17012
|
+
activeMockPoofnetInstance = this;
|
|
17003
17013
|
const user = await this.mintSession(this.activeKeypair);
|
|
17004
|
-
this.showWalletWidget(appId).catch(() => { });
|
|
17005
17014
|
return user;
|
|
17006
17015
|
}
|
|
17007
17016
|
async restoreSession() {
|
|
17008
17017
|
const session = await WebSessionManager.getSession();
|
|
17009
17018
|
if (!session)
|
|
17010
17019
|
return null;
|
|
17011
|
-
// Re-derive the active keypair so signMessage works after a reload
|
|
17012
|
-
//
|
|
17020
|
+
// Re-derive the active keypair so signMessage works after a reload.
|
|
17021
|
+
// Best-effort — the session itself is authoritative.
|
|
17013
17022
|
try {
|
|
17014
17023
|
const appId = await this.getAppId();
|
|
17015
17024
|
const meta = this.getWalletMeta(appId);
|
|
17016
17025
|
this.activeKeypair = await this.deriveKeypair(appId, Math.min(meta.activeIndex, Math.max(0, meta.count - 1)));
|
|
17017
|
-
|
|
17026
|
+
activeMockPoofnetInstance = this;
|
|
17018
17027
|
}
|
|
17019
17028
|
catch ( /* noop */_a) { /* noop */ }
|
|
17020
17029
|
return { provider: this, address: session.address };
|
|
@@ -17023,7 +17032,7 @@ class MockPoofnetProvider {
|
|
|
17023
17032
|
WebSessionManager.clearSession();
|
|
17024
17033
|
setCurrentUser(null);
|
|
17025
17034
|
this.activeKeypair = null;
|
|
17026
|
-
|
|
17035
|
+
activeMockPoofnetInstance = null;
|
|
17027
17036
|
}
|
|
17028
17037
|
// ============ Multi-wallet management ============
|
|
17029
17038
|
/** Switch to (and connect as) an existing mock wallet by index. */
|
|
@@ -17037,8 +17046,10 @@ class MockPoofnetProvider {
|
|
|
17037
17046
|
// Drop the old session, mint a fresh one for the selected wallet.
|
|
17038
17047
|
WebSessionManager.clearSession();
|
|
17039
17048
|
this.activeKeypair = await this.deriveKeypair(appId, index);
|
|
17049
|
+
// Set the singleton before mintSession (see login) so the refresh that
|
|
17050
|
+
// mintSession's setCurrentUser triggers observes the active instance.
|
|
17051
|
+
activeMockPoofnetInstance = this;
|
|
17040
17052
|
const user = await this.mintSession(this.activeKeypair);
|
|
17041
|
-
this.showWalletWidget(appId).catch(() => { });
|
|
17042
17053
|
return user;
|
|
17043
17054
|
}
|
|
17044
17055
|
/** Generate a brand-new mock wallet (next index) and connect as it. */
|
|
@@ -17047,6 +17058,18 @@ class MockPoofnetProvider {
|
|
|
17047
17058
|
const meta = this.getWalletMeta(appId);
|
|
17048
17059
|
return this.switchWallet(meta.count);
|
|
17049
17060
|
}
|
|
17061
|
+
/** Wallet list + active index for the wallet UI (usePoofnetWallet hook). */
|
|
17062
|
+
async getWalletState() {
|
|
17063
|
+
const appId = await this.getAppId();
|
|
17064
|
+
const meta = this.getWalletMeta(appId);
|
|
17065
|
+
const count = Math.max(1, meta.count);
|
|
17066
|
+
const wallets = [];
|
|
17067
|
+
for (let i = 0; i < count; i++) {
|
|
17068
|
+
const kp = await this.deriveKeypair(appId, i);
|
|
17069
|
+
wallets.push({ index: i, label: this.labelFor(meta, i), address: kp.publicKey.toBase58() });
|
|
17070
|
+
}
|
|
17071
|
+
return { wallets, activeIndex: Math.min(meta.activeIndex, count - 1) };
|
|
17072
|
+
}
|
|
17050
17073
|
// ============ AuthProvider interface (offchain-wrapped, mostly inert) ============
|
|
17051
17074
|
async signMessage(message) {
|
|
17052
17075
|
if (!this.activeKeypair)
|
|
@@ -17079,73 +17102,6 @@ class MockPoofnetProvider {
|
|
|
17079
17102
|
async getNativeMethods() {
|
|
17080
17103
|
return {};
|
|
17081
17104
|
}
|
|
17082
|
-
// ============ Floating wallet widget (web only) ============
|
|
17083
|
-
async showWalletWidget(appId) {
|
|
17084
|
-
if (!getPlatform().hasDOM || typeof document === 'undefined')
|
|
17085
|
-
return;
|
|
17086
|
-
const meta = this.getWalletMeta(appId);
|
|
17087
|
-
// Derive addresses for every wallet so the dropdown can show them.
|
|
17088
|
-
const wallets = [];
|
|
17089
|
-
for (let i = 0; i < meta.count; i++) {
|
|
17090
|
-
const kp = await this.deriveKeypair(appId, i);
|
|
17091
|
-
wallets.push({ index: i, label: this.labelFor(meta, i), address: kp.publicKey.toBase58() });
|
|
17092
|
-
}
|
|
17093
|
-
const active = wallets[Math.min(meta.activeIndex, wallets.length - 1)] || wallets[0];
|
|
17094
|
-
if (!active)
|
|
17095
|
-
return;
|
|
17096
|
-
if (!this.widgetEl) {
|
|
17097
|
-
this.widgetEl = document.createElement('div');
|
|
17098
|
-
this.widgetEl.id = 'poofnet-wallet-widget';
|
|
17099
|
-
document.body.appendChild(this.widgetEl);
|
|
17100
|
-
}
|
|
17101
|
-
const short = (a) => `${a.slice(0, 4)}…${a.slice(-4)}`;
|
|
17102
|
-
const rows = wallets.map((w) => `
|
|
17103
|
-
<button data-poofnet-switch="${w.index}" style="display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:8px 10px;background:${w.index === active.index ? 'rgba(153,69,255,0.18)' : 'transparent'};border:none;border-radius:8px;color:#fff;font-size:13px;cursor:pointer;text-align:left;">
|
|
17104
|
-
<span style="display:flex;flex-direction:column;"><span style="font-weight:600;">${w.label}</span><span style="opacity:0.55;font-size:11px;font-family:monospace;">${short(w.address)}</span></span>
|
|
17105
|
-
${w.index === active.index ? '<span style="color:#9945FF;">●</span>' : ''}
|
|
17106
|
-
</button>`).join('');
|
|
17107
|
-
this.widgetEl.innerHTML = `
|
|
17108
|
-
<div style="position:fixed;bottom:16px;right:16px;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;">
|
|
17109
|
-
${this.widgetExpanded ? `
|
|
17110
|
-
<div style="margin-bottom:8px;width:240px;background:#161618;border:1px solid #2a2a2e;border-radius:12px;padding:8px;box-shadow:0 8px 32px rgba(0,0,0,0.5);">
|
|
17111
|
-
<div style="padding:6px 10px 8px;font-size:11px;letter-spacing:0.04em;text-transform:uppercase;color:#9945FF;font-weight:700;">Poofnet · Simulated</div>
|
|
17112
|
-
<div style="max-height:220px;overflow:auto;display:flex;flex-direction:column;gap:2px;">${rows}</div>
|
|
17113
|
-
<button data-poofnet-generate="1" style="margin-top:6px;width:100%;padding:8px 10px;background:rgba(153,69,255,0.12);border:1px dashed #9945FF;border-radius:8px;color:#c8a4ff;font-size:13px;font-weight:600;cursor:pointer;">+ Generate new wallet</button>
|
|
17114
|
-
</div>` : ''}
|
|
17115
|
-
<button data-poofnet-toggle="1" style="display:flex;align-items:center;gap:8px;padding:8px 12px;background:#161618;border:1px solid #2a2a2e;border-radius:999px;color:#fff;font-size:13px;cursor:pointer;box-shadow:0 4px 16px rgba(0,0,0,0.4);">
|
|
17116
|
-
<span style="width:8px;height:8px;border-radius:50%;background:#9945FF;box-shadow:0 0 8px #9945FF;"></span>
|
|
17117
|
-
<span style="font-weight:600;">${active.label}</span>
|
|
17118
|
-
<span style="opacity:0.55;font-family:monospace;font-size:12px;">${short(active.address)}</span>
|
|
17119
|
-
<span style="opacity:0.5;transform:rotate(${this.widgetExpanded ? '180deg' : '0deg'});">▾</span>
|
|
17120
|
-
</button>
|
|
17121
|
-
</div>`;
|
|
17122
|
-
// Wire handlers (re-bound each render).
|
|
17123
|
-
const toggle = this.widgetEl.querySelector('[data-poofnet-toggle]');
|
|
17124
|
-
if (toggle)
|
|
17125
|
-
toggle.onclick = () => { this.widgetExpanded = !this.widgetExpanded; this.showWalletWidget(appId).catch(() => { }); };
|
|
17126
|
-
this.widgetEl.querySelectorAll('[data-poofnet-switch]').forEach((btn) => {
|
|
17127
|
-
btn.onclick = async () => {
|
|
17128
|
-
const idx = parseInt(btn.getAttribute('data-poofnet-switch'), 10);
|
|
17129
|
-
this.widgetExpanded = false;
|
|
17130
|
-
if (idx !== active.index)
|
|
17131
|
-
await this.switchWallet(idx);
|
|
17132
|
-
else
|
|
17133
|
-
this.showWalletWidget(appId).catch(() => { });
|
|
17134
|
-
};
|
|
17135
|
-
});
|
|
17136
|
-
const gen = this.widgetEl.querySelector('[data-poofnet-generate]');
|
|
17137
|
-
if (gen)
|
|
17138
|
-
gen.onclick = async () => { this.widgetExpanded = false; await this.generateWallet(); };
|
|
17139
|
-
}
|
|
17140
|
-
removeWalletWidget() {
|
|
17141
|
-
try {
|
|
17142
|
-
if (this.widgetEl && this.widgetEl.parentNode)
|
|
17143
|
-
this.widgetEl.parentNode.removeChild(this.widgetEl);
|
|
17144
|
-
}
|
|
17145
|
-
catch ( /* noop */_a) { /* noop */ }
|
|
17146
|
-
this.widgetEl = null;
|
|
17147
|
-
this.widgetExpanded = false;
|
|
17148
|
-
}
|
|
17149
17105
|
}
|
|
17150
17106
|
|
|
17151
17107
|
/**
|
|
@@ -18247,17 +18203,17 @@ function setAuthProviderInstance(provider) {
|
|
|
18247
18203
|
authProviderInstance = provider;
|
|
18248
18204
|
}
|
|
18249
18205
|
|
|
18250
|
-
var _a;
|
|
18206
|
+
var _a$1;
|
|
18251
18207
|
// Whether we're in a server-side rendering context (no hooks allowed).
|
|
18252
18208
|
// React Native has no `window` but DOES support hooks.
|
|
18253
18209
|
// We detect Node SSR specifically via process.versions.node to avoid
|
|
18254
18210
|
// false positives from Node 21+ which defines `navigator` globally.
|
|
18255
|
-
const isSSR = typeof window === 'undefined'
|
|
18211
|
+
const isSSR$1 = typeof window === 'undefined'
|
|
18256
18212
|
&& typeof process !== 'undefined'
|
|
18257
|
-
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
18213
|
+
&& !!((_a$1 = process.versions) === null || _a$1 === void 0 ? void 0 : _a$1.node);
|
|
18258
18214
|
function useAuth() {
|
|
18259
18215
|
// Provide a fallback so server render doesn't break
|
|
18260
|
-
if (isSSR) {
|
|
18216
|
+
if (isSSR$1) {
|
|
18261
18217
|
return {
|
|
18262
18218
|
login: async () => undefined,
|
|
18263
18219
|
logout: async () => undefined,
|
|
@@ -18317,6 +18273,79 @@ function useAuth() {
|
|
|
18317
18273
|
};
|
|
18318
18274
|
}
|
|
18319
18275
|
|
|
18276
|
+
var _a;
|
|
18277
|
+
const isSSR = typeof window === 'undefined'
|
|
18278
|
+
&& typeof process !== 'undefined'
|
|
18279
|
+
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
18280
|
+
const EMPTY = {
|
|
18281
|
+
isMock: false,
|
|
18282
|
+
wallets: [],
|
|
18283
|
+
activeIndex: 0,
|
|
18284
|
+
switchWallet: async () => undefined,
|
|
18285
|
+
generateWallet: async () => undefined,
|
|
18286
|
+
refresh: async () => undefined,
|
|
18287
|
+
};
|
|
18288
|
+
/**
|
|
18289
|
+
* Exposes the simulated Poofnet wallet to the app's own wallet UI (e.g. the
|
|
18290
|
+
* template WalletButton). `isMock` is false on mainnet / real-wallet sessions,
|
|
18291
|
+
* so callers can conditionally render the switch/generate controls.
|
|
18292
|
+
*
|
|
18293
|
+
* Reactive: re-reads whenever auth state changes (login / logout / wallet
|
|
18294
|
+
* switch all flow through setCurrentUser → onAuthStateChanged).
|
|
18295
|
+
*/
|
|
18296
|
+
function usePoofnetWallet() {
|
|
18297
|
+
if (isSSR)
|
|
18298
|
+
return EMPTY;
|
|
18299
|
+
const [state, setState] = React__namespace.useState({
|
|
18300
|
+
isMock: false,
|
|
18301
|
+
wallets: [],
|
|
18302
|
+
activeIndex: 0,
|
|
18303
|
+
});
|
|
18304
|
+
const refresh = React__namespace.useCallback(async () => {
|
|
18305
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18306
|
+
if (!provider) {
|
|
18307
|
+
setState({ isMock: false, wallets: [], activeIndex: 0 });
|
|
18308
|
+
return;
|
|
18309
|
+
}
|
|
18310
|
+
try {
|
|
18311
|
+
const { wallets, activeIndex } = await provider.getWalletState();
|
|
18312
|
+
setState({ isMock: true, wallets, activeIndex });
|
|
18313
|
+
}
|
|
18314
|
+
catch (_a) {
|
|
18315
|
+
setState({ isMock: false, wallets: [], activeIndex: 0 });
|
|
18316
|
+
}
|
|
18317
|
+
}, []);
|
|
18318
|
+
React__namespace.useEffect(() => {
|
|
18319
|
+
refresh();
|
|
18320
|
+
// setCurrentUser (login/logout/switch/generate) notifies these listeners.
|
|
18321
|
+
onAuthStateChanged(() => { refresh(); });
|
|
18322
|
+
// Note: onAuthStateChanged has no unsubscribe yet (same as useAuth) — fine
|
|
18323
|
+
// for a wallet button that mounts once.
|
|
18324
|
+
}, [refresh]);
|
|
18325
|
+
const switchWallet = React__namespace.useCallback(async (index) => {
|
|
18326
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18327
|
+
if (provider) {
|
|
18328
|
+
await provider.switchWallet(index);
|
|
18329
|
+
await refresh();
|
|
18330
|
+
}
|
|
18331
|
+
}, [refresh]);
|
|
18332
|
+
const generateWallet = React__namespace.useCallback(async () => {
|
|
18333
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18334
|
+
if (provider) {
|
|
18335
|
+
await provider.generateWallet();
|
|
18336
|
+
await refresh();
|
|
18337
|
+
}
|
|
18338
|
+
}, [refresh]);
|
|
18339
|
+
return {
|
|
18340
|
+
isMock: state.isMock,
|
|
18341
|
+
wallets: state.wallets,
|
|
18342
|
+
activeIndex: state.activeIndex,
|
|
18343
|
+
switchWallet,
|
|
18344
|
+
generateWallet,
|
|
18345
|
+
refresh,
|
|
18346
|
+
};
|
|
18347
|
+
}
|
|
18348
|
+
|
|
18320
18349
|
async function deserializeTransaction(tx) {
|
|
18321
18350
|
const buf = Buffer.isBuffer(tx) ? tx : Buffer.from(tx, 'base64');
|
|
18322
18351
|
if ((buf[0] & 0x80) !== 0) {
|
|
@@ -18448,7 +18477,7 @@ async function loadDependencies() {
|
|
|
18448
18477
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
18449
18478
|
import('react'),
|
|
18450
18479
|
import('react-dom/client'),
|
|
18451
|
-
Promise.resolve().then(function () { return require('./index-
|
|
18480
|
+
Promise.resolve().then(function () { return require('./index-CEADZ0na.js'); })
|
|
18452
18481
|
]);
|
|
18453
18482
|
// Extract default export from ESM module namespace
|
|
18454
18483
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -18899,6 +18928,19 @@ class PhantomWalletProvider {
|
|
|
18899
18928
|
that.awaitTopLevelConnect();
|
|
18900
18929
|
return;
|
|
18901
18930
|
}
|
|
18931
|
+
// C2: pre-warm Chrome's Local Network Access permission inside the
|
|
18932
|
+
// tap gesture, so its prompt appears up-front instead of on return
|
|
18933
|
+
// from the wallet (MWA opens a ws://localhost reflector only after
|
|
18934
|
+
// the app-switch, which is why the prompt currently lands on return).
|
|
18935
|
+
// Best-effort, Android top-level only. DEVICE-TEST: confirm Chrome
|
|
18936
|
+
// grants this per-origin (so MWA's later random-port socket reuses
|
|
18937
|
+
// it). If LNA turns out to be per-port, this won't pre-grant — cut it.
|
|
18938
|
+
if (detectAndroid() && typeof WebSocket !== 'undefined') {
|
|
18939
|
+
try {
|
|
18940
|
+
new WebSocket('ws://localhost:1');
|
|
18941
|
+
}
|
|
18942
|
+
catch ( /* noop */_a) { /* noop */ }
|
|
18943
|
+
}
|
|
18902
18944
|
if (that.onSwitchToMWA) {
|
|
18903
18945
|
try {
|
|
18904
18946
|
const mwaProvider = await that.onSwitchToMWA();
|
|
@@ -24636,7 +24678,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
24636
24678
|
if (typeof window === 'undefined')
|
|
24637
24679
|
return;
|
|
24638
24680
|
try {
|
|
24639
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
24681
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-C9AVHEa4.js'); });
|
|
24640
24682
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
24641
24683
|
if (!registerMwa) {
|
|
24642
24684
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -24775,7 +24817,7 @@ class SolanaMobileWalletProvider {
|
|
|
24775
24817
|
async ensureWallet() {
|
|
24776
24818
|
if (this.wallet)
|
|
24777
24819
|
return this.wallet;
|
|
24778
|
-
const mod = await Promise.resolve().then(function () { return require('./index.browser-
|
|
24820
|
+
const mod = await Promise.resolve().then(function () { return require('./index.browser-C9AVHEa4.js'); });
|
|
24779
24821
|
const chain = mapChainToWalletStandard(this.cluster);
|
|
24780
24822
|
this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
|
|
24781
24823
|
appIdentity: this.appIdentity,
|
|
@@ -24984,8 +25026,6 @@ class SolanaMobileWalletProvider {
|
|
|
24984
25026
|
return user;
|
|
24985
25027
|
}
|
|
24986
25028
|
}
|
|
24987
|
-
// Pre-fetch nonce while the wallet popup is not yet open.
|
|
24988
|
-
const nonce = await genAuthNonce();
|
|
24989
25029
|
// Wallet popup #1: standard:connect performs MWA authorize. This
|
|
24990
25030
|
// is where wallet-standard's checkLocalNetworkAccessPermission()
|
|
24991
25031
|
// fires the three-stage LNA UX (info modal → permission prompt →
|
|
@@ -25028,6 +25068,11 @@ class SolanaMobileWalletProvider {
|
|
|
25028
25068
|
// Insert a Tarobase modal: the user's tap on "Sign in" provides a
|
|
25029
25069
|
// fresh activation, and signMessage is invoked synchronously
|
|
25030
25070
|
// inside the click handler so the activation propagates.
|
|
25071
|
+
// C1: fetch the nonce HERE (after connect), not before — a pre-connect
|
|
25072
|
+
// network round-trip was decaying the Chrome user activation needed for
|
|
25073
|
+
// the connect's solana-wallet: navigation, intermittently causing
|
|
25074
|
+
// ERROR_WALLET_NOT_FOUND. The nonce is only needed for the message below.
|
|
25075
|
+
const nonce = await genAuthNonce();
|
|
25031
25076
|
const messageText = await genSolanaMessage(base58Addr, nonce);
|
|
25032
25077
|
const messageBytes = getPlatform().textEncode(messageText);
|
|
25033
25078
|
const signMessageFeat = getSignMessageFeature(wallet);
|
|
@@ -26022,4 +26067,5 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
26022
26067
|
exports.signTransaction = signTransaction;
|
|
26023
26068
|
exports.subscribe = subscribe;
|
|
26024
26069
|
exports.useAuth = useAuth;
|
|
26025
|
-
|
|
26070
|
+
exports.usePoofnetWallet = usePoofnetWallet;
|
|
26071
|
+
//# sourceMappingURL=index-DHI02_l_.js.map
|