@pooflabs/web 0.0.89-rc2 → 0.0.89-rc3
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-Cgaz8U9W.esm.js → index-2wcE74zV.esm.js} +127 -87
- package/dist/index-2wcE74zV.esm.js.map +1 -0
- package/dist/{index-BLiaV7Dz.js → index-BbyEdrbT.js} +127 -86
- package/dist/index-BbyEdrbT.js.map +1 -0
- package/dist/{index-CXmcQaFm.js → index-BdtzCA9I.js} +2 -2
- package/dist/{index-CXmcQaFm.js.map → index-BdtzCA9I.js.map} +1 -1
- package/dist/{index-4JUcdcnk.esm.js → index-BosINgjL.esm.js} +2 -2
- package/dist/{index-4JUcdcnk.esm.js.map → index-BosINgjL.esm.js.map} +1 -1
- package/dist/{index-QJAj_nTx.js → index-D5KlQpzj.js} +2 -2
- package/dist/{index-QJAj_nTx.js.map → index-D5KlQpzj.js.map} +1 -1
- package/dist/{index-DQhWZskl.esm.js → index-TCh-Tz3A.esm.js} +2 -2
- package/dist/{index-DQhWZskl.esm.js.map → index-TCh-Tz3A.esm.js.map} +1 -1
- package/dist/{index.browser-CG2sQjrd.esm.js → index.browser-CQxdFuE2.esm.js} +2 -2
- package/dist/{index.browser-CG2sQjrd.esm.js.map → index.browser-CQxdFuE2.esm.js.map} +1 -1
- package/dist/{index.browser-kQdoMu7Y.esm.js → index.browser-CkaOa5gJ.esm.js} +2 -2
- package/dist/{index.browser-kQdoMu7Y.esm.js.map → index.browser-CkaOa5gJ.esm.js.map} +1 -1
- package/dist/{index.browser-B9NfvmrP.js → index.browser-DxjCzf2n.js} +2 -2
- package/dist/{index.browser-B9NfvmrP.js.map → index.browser-DxjCzf2n.js.map} +1 -1
- package/dist/{index.browser-UxB-zDuA.js → index.browser-dTW8LCID.js} +2 -2
- package/dist/{index.browser-UxB-zDuA.js.map → index.browser-dTW8LCID.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-Ch6gsAP_.esm.js} +109 -85
- package/dist/index.native-Ch6gsAP_.esm.js.map +1 -0
- package/dist/{index.native-Cycwo-3I.js → index.native-K4hpch3o.js} +109 -84
- package/dist/index.native-K4hpch3o.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-BgDhrraw.js → phantom-wallet-provider-BOz9oPsO.js} +16 -3
- package/dist/phantom-wallet-provider-BOz9oPsO.js.map +1 -0
- package/dist/{phantom-wallet-provider-DM-96ILz.esm.js → phantom-wallet-provider-ieVw9iZ_.esm.js} +16 -3
- package/dist/phantom-wallet-provider-ieVw9iZ_.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-D4IYOUji.js → privy-wallet-provider-BlWvz1R6.js} +3 -3
- package/dist/{privy-wallet-provider-D4IYOUji.js.map → privy-wallet-provider-BlWvz1R6.js.map} +1 -1
- package/dist/{privy-wallet-provider-C70AIqHI.esm.js → privy-wallet-provider-CVVhV2RP.esm.js} +3 -3
- package/dist/{privy-wallet-provider-C70AIqHI.esm.js.map → privy-wallet-provider-CVVhV2RP.esm.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-BrjPc7Wd.js → solana-mobile-wallet-provider-C8QDeO6I.js} +8 -5
- package/dist/solana-mobile-wallet-provider-C8QDeO6I.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-CXXw-pKg.esm.js → solana-mobile-wallet-provider-CHMZajIq.esm.js} +8 -5
- package/dist/solana-mobile-wallet-provider-CHMZajIq.esm.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() {
|
|
@@ -17001,20 +17007,20 @@ class MockPoofnetProvider {
|
|
|
17001
17007
|
const index = Math.min(meta.activeIndex, meta.count - 1);
|
|
17002
17008
|
this.activeKeypair = await this.deriveKeypair(appId, index);
|
|
17003
17009
|
const user = await this.mintSession(this.activeKeypair);
|
|
17004
|
-
|
|
17010
|
+
activeMockPoofnetInstance = this;
|
|
17005
17011
|
return user;
|
|
17006
17012
|
}
|
|
17007
17013
|
async restoreSession() {
|
|
17008
17014
|
const session = await WebSessionManager.getSession();
|
|
17009
17015
|
if (!session)
|
|
17010
17016
|
return null;
|
|
17011
|
-
// Re-derive the active keypair so signMessage works after a reload
|
|
17012
|
-
//
|
|
17017
|
+
// Re-derive the active keypair so signMessage works after a reload.
|
|
17018
|
+
// Best-effort — the session itself is authoritative.
|
|
17013
17019
|
try {
|
|
17014
17020
|
const appId = await this.getAppId();
|
|
17015
17021
|
const meta = this.getWalletMeta(appId);
|
|
17016
17022
|
this.activeKeypair = await this.deriveKeypair(appId, Math.min(meta.activeIndex, Math.max(0, meta.count - 1)));
|
|
17017
|
-
|
|
17023
|
+
activeMockPoofnetInstance = this;
|
|
17018
17024
|
}
|
|
17019
17025
|
catch ( /* noop */_a) { /* noop */ }
|
|
17020
17026
|
return { provider: this, address: session.address };
|
|
@@ -17023,7 +17029,7 @@ class MockPoofnetProvider {
|
|
|
17023
17029
|
WebSessionManager.clearSession();
|
|
17024
17030
|
setCurrentUser(null);
|
|
17025
17031
|
this.activeKeypair = null;
|
|
17026
|
-
|
|
17032
|
+
activeMockPoofnetInstance = null;
|
|
17027
17033
|
}
|
|
17028
17034
|
// ============ Multi-wallet management ============
|
|
17029
17035
|
/** Switch to (and connect as) an existing mock wallet by index. */
|
|
@@ -17038,7 +17044,7 @@ class MockPoofnetProvider {
|
|
|
17038
17044
|
WebSessionManager.clearSession();
|
|
17039
17045
|
this.activeKeypair = await this.deriveKeypair(appId, index);
|
|
17040
17046
|
const user = await this.mintSession(this.activeKeypair);
|
|
17041
|
-
|
|
17047
|
+
activeMockPoofnetInstance = this;
|
|
17042
17048
|
return user;
|
|
17043
17049
|
}
|
|
17044
17050
|
/** Generate a brand-new mock wallet (next index) and connect as it. */
|
|
@@ -17047,6 +17053,18 @@ class MockPoofnetProvider {
|
|
|
17047
17053
|
const meta = this.getWalletMeta(appId);
|
|
17048
17054
|
return this.switchWallet(meta.count);
|
|
17049
17055
|
}
|
|
17056
|
+
/** Wallet list + active index for the wallet UI (usePoofnetWallet hook). */
|
|
17057
|
+
async getWalletState() {
|
|
17058
|
+
const appId = await this.getAppId();
|
|
17059
|
+
const meta = this.getWalletMeta(appId);
|
|
17060
|
+
const count = Math.max(1, meta.count);
|
|
17061
|
+
const wallets = [];
|
|
17062
|
+
for (let i = 0; i < count; i++) {
|
|
17063
|
+
const kp = await this.deriveKeypair(appId, i);
|
|
17064
|
+
wallets.push({ index: i, label: this.labelFor(meta, i), address: kp.publicKey.toBase58() });
|
|
17065
|
+
}
|
|
17066
|
+
return { wallets, activeIndex: Math.min(meta.activeIndex, count - 1) };
|
|
17067
|
+
}
|
|
17050
17068
|
// ============ AuthProvider interface (offchain-wrapped, mostly inert) ============
|
|
17051
17069
|
async signMessage(message) {
|
|
17052
17070
|
if (!this.activeKeypair)
|
|
@@ -17079,73 +17097,6 @@ class MockPoofnetProvider {
|
|
|
17079
17097
|
async getNativeMethods() {
|
|
17080
17098
|
return {};
|
|
17081
17099
|
}
|
|
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
17100
|
}
|
|
17150
17101
|
|
|
17151
17102
|
/**
|
|
@@ -18247,17 +18198,17 @@ function setAuthProviderInstance(provider) {
|
|
|
18247
18198
|
authProviderInstance = provider;
|
|
18248
18199
|
}
|
|
18249
18200
|
|
|
18250
|
-
var _a;
|
|
18201
|
+
var _a$1;
|
|
18251
18202
|
// Whether we're in a server-side rendering context (no hooks allowed).
|
|
18252
18203
|
// React Native has no `window` but DOES support hooks.
|
|
18253
18204
|
// We detect Node SSR specifically via process.versions.node to avoid
|
|
18254
18205
|
// false positives from Node 21+ which defines `navigator` globally.
|
|
18255
|
-
const isSSR = typeof window === 'undefined'
|
|
18206
|
+
const isSSR$1 = typeof window === 'undefined'
|
|
18256
18207
|
&& typeof process !== 'undefined'
|
|
18257
|
-
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
18208
|
+
&& !!((_a$1 = process.versions) === null || _a$1 === void 0 ? void 0 : _a$1.node);
|
|
18258
18209
|
function useAuth() {
|
|
18259
18210
|
// Provide a fallback so server render doesn't break
|
|
18260
|
-
if (isSSR) {
|
|
18211
|
+
if (isSSR$1) {
|
|
18261
18212
|
return {
|
|
18262
18213
|
login: async () => undefined,
|
|
18263
18214
|
logout: async () => undefined,
|
|
@@ -18317,6 +18268,79 @@ function useAuth() {
|
|
|
18317
18268
|
};
|
|
18318
18269
|
}
|
|
18319
18270
|
|
|
18271
|
+
var _a;
|
|
18272
|
+
const isSSR = typeof window === 'undefined'
|
|
18273
|
+
&& typeof process !== 'undefined'
|
|
18274
|
+
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
18275
|
+
const EMPTY = {
|
|
18276
|
+
isMock: false,
|
|
18277
|
+
wallets: [],
|
|
18278
|
+
activeIndex: 0,
|
|
18279
|
+
switchWallet: async () => undefined,
|
|
18280
|
+
generateWallet: async () => undefined,
|
|
18281
|
+
refresh: async () => undefined,
|
|
18282
|
+
};
|
|
18283
|
+
/**
|
|
18284
|
+
* Exposes the simulated Poofnet wallet to the app's own wallet UI (e.g. the
|
|
18285
|
+
* template WalletButton). `isMock` is false on mainnet / real-wallet sessions,
|
|
18286
|
+
* so callers can conditionally render the switch/generate controls.
|
|
18287
|
+
*
|
|
18288
|
+
* Reactive: re-reads whenever auth state changes (login / logout / wallet
|
|
18289
|
+
* switch all flow through setCurrentUser → onAuthStateChanged).
|
|
18290
|
+
*/
|
|
18291
|
+
function usePoofnetWallet() {
|
|
18292
|
+
if (isSSR)
|
|
18293
|
+
return EMPTY;
|
|
18294
|
+
const [state, setState] = React__namespace.useState({
|
|
18295
|
+
isMock: false,
|
|
18296
|
+
wallets: [],
|
|
18297
|
+
activeIndex: 0,
|
|
18298
|
+
});
|
|
18299
|
+
const refresh = React__namespace.useCallback(async () => {
|
|
18300
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18301
|
+
if (!provider) {
|
|
18302
|
+
setState({ isMock: false, wallets: [], activeIndex: 0 });
|
|
18303
|
+
return;
|
|
18304
|
+
}
|
|
18305
|
+
try {
|
|
18306
|
+
const { wallets, activeIndex } = await provider.getWalletState();
|
|
18307
|
+
setState({ isMock: true, wallets, activeIndex });
|
|
18308
|
+
}
|
|
18309
|
+
catch (_a) {
|
|
18310
|
+
setState({ isMock: false, wallets: [], activeIndex: 0 });
|
|
18311
|
+
}
|
|
18312
|
+
}, []);
|
|
18313
|
+
React__namespace.useEffect(() => {
|
|
18314
|
+
refresh();
|
|
18315
|
+
// setCurrentUser (login/logout/switch/generate) notifies these listeners.
|
|
18316
|
+
onAuthStateChanged(() => { refresh(); });
|
|
18317
|
+
// Note: onAuthStateChanged has no unsubscribe yet (same as useAuth) — fine
|
|
18318
|
+
// for a wallet button that mounts once.
|
|
18319
|
+
}, [refresh]);
|
|
18320
|
+
const switchWallet = React__namespace.useCallback(async (index) => {
|
|
18321
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18322
|
+
if (provider) {
|
|
18323
|
+
await provider.switchWallet(index);
|
|
18324
|
+
await refresh();
|
|
18325
|
+
}
|
|
18326
|
+
}, [refresh]);
|
|
18327
|
+
const generateWallet = React__namespace.useCallback(async () => {
|
|
18328
|
+
const provider = getActiveMockPoofnetProvider();
|
|
18329
|
+
if (provider) {
|
|
18330
|
+
await provider.generateWallet();
|
|
18331
|
+
await refresh();
|
|
18332
|
+
}
|
|
18333
|
+
}, [refresh]);
|
|
18334
|
+
return {
|
|
18335
|
+
isMock: state.isMock,
|
|
18336
|
+
wallets: state.wallets,
|
|
18337
|
+
activeIndex: state.activeIndex,
|
|
18338
|
+
switchWallet,
|
|
18339
|
+
generateWallet,
|
|
18340
|
+
refresh,
|
|
18341
|
+
};
|
|
18342
|
+
}
|
|
18343
|
+
|
|
18320
18344
|
async function deserializeTransaction(tx) {
|
|
18321
18345
|
const buf = Buffer.isBuffer(tx) ? tx : Buffer.from(tx, 'base64');
|
|
18322
18346
|
if ((buf[0] & 0x80) !== 0) {
|
|
@@ -18448,7 +18472,7 @@ async function loadDependencies() {
|
|
|
18448
18472
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
18449
18473
|
import('react'),
|
|
18450
18474
|
import('react-dom/client'),
|
|
18451
|
-
Promise.resolve().then(function () { return require('./index-
|
|
18475
|
+
Promise.resolve().then(function () { return require('./index-BdtzCA9I.js'); })
|
|
18452
18476
|
]);
|
|
18453
18477
|
// Extract default export from ESM module namespace
|
|
18454
18478
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -18899,6 +18923,19 @@ class PhantomWalletProvider {
|
|
|
18899
18923
|
that.awaitTopLevelConnect();
|
|
18900
18924
|
return;
|
|
18901
18925
|
}
|
|
18926
|
+
// C2: pre-warm Chrome's Local Network Access permission inside the
|
|
18927
|
+
// tap gesture, so its prompt appears up-front instead of on return
|
|
18928
|
+
// from the wallet (MWA opens a ws://localhost reflector only after
|
|
18929
|
+
// the app-switch, which is why the prompt currently lands on return).
|
|
18930
|
+
// Best-effort, Android top-level only. DEVICE-TEST: confirm Chrome
|
|
18931
|
+
// grants this per-origin (so MWA's later random-port socket reuses
|
|
18932
|
+
// it). If LNA turns out to be per-port, this won't pre-grant — cut it.
|
|
18933
|
+
if (detectAndroid() && typeof WebSocket !== 'undefined') {
|
|
18934
|
+
try {
|
|
18935
|
+
new WebSocket('ws://localhost:1');
|
|
18936
|
+
}
|
|
18937
|
+
catch ( /* noop */_a) { /* noop */ }
|
|
18938
|
+
}
|
|
18902
18939
|
if (that.onSwitchToMWA) {
|
|
18903
18940
|
try {
|
|
18904
18941
|
const mwaProvider = await that.onSwitchToMWA();
|
|
@@ -24636,7 +24673,7 @@ async function registerMobileWalletAdapter(config) {
|
|
|
24636
24673
|
if (typeof window === 'undefined')
|
|
24637
24674
|
return;
|
|
24638
24675
|
try {
|
|
24639
|
-
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-
|
|
24676
|
+
const walletStandardMobile = await Promise.resolve().then(function () { return require('./index.browser-DxjCzf2n.js'); });
|
|
24640
24677
|
const registerMwa = walletStandardMobile.registerMwa || ((_a = walletStandardMobile.default) === null || _a === void 0 ? void 0 : _a.registerMwa);
|
|
24641
24678
|
if (!registerMwa) {
|
|
24642
24679
|
console.warn('[SolanaMobileWallet] registerMwa not found in @solana-mobile/wallet-standard-mobile');
|
|
@@ -24775,7 +24812,7 @@ class SolanaMobileWalletProvider {
|
|
|
24775
24812
|
async ensureWallet() {
|
|
24776
24813
|
if (this.wallet)
|
|
24777
24814
|
return this.wallet;
|
|
24778
|
-
const mod = await Promise.resolve().then(function () { return require('./index.browser-
|
|
24815
|
+
const mod = await Promise.resolve().then(function () { return require('./index.browser-DxjCzf2n.js'); });
|
|
24779
24816
|
const chain = mapChainToWalletStandard(this.cluster);
|
|
24780
24817
|
this.wallet = new mod.LocalSolanaMobileWalletAdapterWallet({
|
|
24781
24818
|
appIdentity: this.appIdentity,
|
|
@@ -24984,8 +25021,6 @@ class SolanaMobileWalletProvider {
|
|
|
24984
25021
|
return user;
|
|
24985
25022
|
}
|
|
24986
25023
|
}
|
|
24987
|
-
// Pre-fetch nonce while the wallet popup is not yet open.
|
|
24988
|
-
const nonce = await genAuthNonce();
|
|
24989
25024
|
// Wallet popup #1: standard:connect performs MWA authorize. This
|
|
24990
25025
|
// is where wallet-standard's checkLocalNetworkAccessPermission()
|
|
24991
25026
|
// fires the three-stage LNA UX (info modal → permission prompt →
|
|
@@ -25028,6 +25063,11 @@ class SolanaMobileWalletProvider {
|
|
|
25028
25063
|
// Insert a Tarobase modal: the user's tap on "Sign in" provides a
|
|
25029
25064
|
// fresh activation, and signMessage is invoked synchronously
|
|
25030
25065
|
// inside the click handler so the activation propagates.
|
|
25066
|
+
// C1: fetch the nonce HERE (after connect), not before — a pre-connect
|
|
25067
|
+
// network round-trip was decaying the Chrome user activation needed for
|
|
25068
|
+
// the connect's solana-wallet: navigation, intermittently causing
|
|
25069
|
+
// ERROR_WALLET_NOT_FOUND. The nonce is only needed for the message below.
|
|
25070
|
+
const nonce = await genAuthNonce();
|
|
25031
25071
|
const messageText = await genSolanaMessage(base58Addr, nonce);
|
|
25032
25072
|
const messageBytes = getPlatform().textEncode(messageText);
|
|
25033
25073
|
const signMessageFeat = getSignMessageFeature(wallet);
|
|
@@ -26022,4 +26062,5 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
26022
26062
|
exports.signTransaction = signTransaction;
|
|
26023
26063
|
exports.subscribe = subscribe;
|
|
26024
26064
|
exports.useAuth = useAuth;
|
|
26025
|
-
|
|
26065
|
+
exports.usePoofnetWallet = usePoofnetWallet;
|
|
26066
|
+
//# sourceMappingURL=index-BbyEdrbT.js.map
|