@bounded-sh/client 0.0.112-ux-audit.2 → 0.0.113
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/bounded-widget-modal.d.ts +24 -2
- package/dist/auth/providers/injected-wallet-provider.d.ts +7 -0
- package/dist/auth/providers/injected-wallet-types.d.ts +2 -0
- package/dist/auth/providers/solana-mobile-registration.d.ts +18 -0
- package/dist/{email-auth-provider-BfCH7K6N.mjs → email-auth-provider-Bk5GSpYT.mjs} +2 -2
- package/dist/{email-auth-provider-C7RXLVd9.mjs.map → email-auth-provider-Bk5GSpYT.mjs.map} +1 -1
- package/dist/{email-auth-provider-DTrCfOJd.js → email-auth-provider-Cr66GaKw.js} +2 -2
- package/dist/{email-auth-provider-DTrCfOJd.js.map → email-auth-provider-Cr66GaKw.js.map} +1 -1
- package/dist/{email-auth-provider-53sA5_i2.js → email-auth-provider-DeORQbTK.js} +2 -2
- package/dist/{email-auth-provider-53sA5_i2.js.map → email-auth-provider-DeORQbTK.js.map} +1 -1
- package/dist/{email-auth-provider-C7RXLVd9.mjs → email-auth-provider-nDZjRDpj.mjs} +2 -2
- package/dist/{email-auth-provider-BfCH7K6N.mjs.map → email-auth-provider-nDZjRDpj.mjs.map} +1 -1
- package/dist/{guest-auth-provider-00KkSNpE.js → guest-auth-provider-5bX-xt6K.js} +2 -2
- package/dist/{guest-auth-provider-00KkSNpE.js.map → guest-auth-provider-5bX-xt6K.js.map} +1 -1
- package/dist/{guest-auth-provider-Tndt6tzJ.js → guest-auth-provider-CUNkZVFK.js} +2 -2
- package/dist/{guest-auth-provider-Tndt6tzJ.js.map → guest-auth-provider-CUNkZVFK.js.map} +1 -1
- package/dist/{guest-auth-provider-DjOFjtnk.mjs → guest-auth-provider-DDudqqxY.mjs} +2 -2
- package/dist/{guest-auth-provider-DjOFjtnk.mjs.map → guest-auth-provider-DDudqqxY.mjs.map} +1 -1
- package/dist/{guest-auth-provider-2J4fnTX5.mjs → guest-auth-provider-ejUTbjCC.mjs} +2 -2
- package/dist/{guest-auth-provider-2J4fnTX5.mjs.map → guest-auth-provider-ejUTbjCC.mjs.map} +1 -1
- package/dist/{index-D3kdhCpH.mjs → index-BAiLpNEQ.mjs} +190 -53
- package/dist/index-BAiLpNEQ.mjs.map +1 -0
- package/dist/{index-DJeEMevo.js → index-BZ0X1Z9X.js} +190 -53
- package/dist/index-BZ0X1Z9X.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-ingNhWPw.js → index.native-DJSOqyKQ.js} +101 -14
- package/dist/index.native-DJSOqyKQ.js.map +1 -0
- package/dist/{index.native-CAH_ks0s.mjs → index.native-DcW2klyn.mjs} +100 -15
- package/dist/index.native-DcW2klyn.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-Cao1U0NZ.js → injected-evm-wallet-provider-BDYWjIOQ.js} +2 -2
- package/dist/{injected-evm-wallet-provider-Cao1U0NZ.js.map → injected-evm-wallet-provider-BDYWjIOQ.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-DXjwPjLW.mjs → injected-evm-wallet-provider-BQ_kG1vI.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-DXjwPjLW.mjs.map → injected-evm-wallet-provider-BQ_kG1vI.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BtyG1HOX.mjs → injected-evm-wallet-provider-C4aKa2v1.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BtyG1HOX.mjs.map → injected-evm-wallet-provider-C4aKa2v1.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-IlkuKffc.js → injected-evm-wallet-provider-D06arDQD.js} +2 -2
- package/dist/{injected-evm-wallet-provider-IlkuKffc.js.map → injected-evm-wallet-provider-D06arDQD.js.map} +1 -1
- package/dist/{injected-wallet-provider-BEYwsn6M.js → injected-wallet-provider-B9jvzDM5.js} +51 -22
- package/dist/{injected-wallet-provider-BEYwsn6M.js.map → injected-wallet-provider-B9jvzDM5.js.map} +1 -1
- package/dist/{injected-wallet-provider-0SSONh1d.mjs → injected-wallet-provider-Dj-F69gb.mjs} +51 -22
- package/dist/{injected-wallet-provider-0SSONh1d.mjs.map → injected-wallet-provider-Dj-F69gb.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DSlHfgMU.js → injected-wallet-provider-Dqmk-m4V.js} +67 -26
- package/dist/{injected-wallet-provider-DSlHfgMU.js.map → injected-wallet-provider-Dqmk-m4V.js.map} +1 -1
- package/dist/{injected-wallet-provider-CfYNIIHd.mjs → injected-wallet-provider-DxPcYxP-.mjs} +67 -26
- package/dist/{injected-wallet-provider-CfYNIIHd.mjs.map → injected-wallet-provider-DxPcYxP-.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index-D3kdhCpH.mjs.map +0 -1
- package/dist/index-DJeEMevo.js.map +0 -1
- package/dist/index.native-CAH_ks0s.mjs.map +0 -1
- package/dist/index.native-ingNhWPw.js.map +0 -1
|
@@ -3739,6 +3739,46 @@ function isSolanaMobileWallet(wallet) {
|
|
|
3739
3739
|
function solanaMobileWalletLeavesPage(name) {
|
|
3740
3740
|
return name === LOCAL_MOBILE_WALLET_NAME;
|
|
3741
3741
|
}
|
|
3742
|
+
/**
|
|
3743
|
+
* Whether this wallet answers a sign-in from its authorization cache, so the
|
|
3744
|
+
* cached record must be dropped before asking it to sign in.
|
|
3745
|
+
*
|
|
3746
|
+
* Both Mobile Wallet Adapter transports consult their persisted authorization
|
|
3747
|
+
* before EVERY authorize call, including the one that carries the Sign In With
|
|
3748
|
+
* Solana payload (@solana-mobile/wallet-standard-mobile 0.5.3
|
|
3749
|
+
* lib/esm/index.browser.js:1291). A record left by a plain connect holds no
|
|
3750
|
+
* sign-in result, so that sign-in fails with "no sign in result returned by
|
|
3751
|
+
* wallet" without the wallet app ever being asked; a record left by an earlier
|
|
3752
|
+
* sign-in holds that OLD proof, so a later sign-in replays a spent nonce. The
|
|
3753
|
+
* wallet's own `standard:disconnect` clears the record locally - it opens
|
|
3754
|
+
* nothing - and the sign-in that follows then authorizes afresh, with its
|
|
3755
|
+
* payload, in the wallet app. A name check, like leavesPage: this describes the
|
|
3756
|
+
* transport, and the same adapter registered by another SDK behaves the same.
|
|
3757
|
+
*/
|
|
3758
|
+
function solanaMobileWalletAnswersSignInFromCache(name) {
|
|
3759
|
+
return mobileWalletNames.has(name);
|
|
3760
|
+
}
|
|
3761
|
+
/**
|
|
3762
|
+
* The Wallet Standard name of a feature a Mobile Wallet Adapter account reports.
|
|
3763
|
+
*
|
|
3764
|
+
* The adapter copies a wallet app's per-account `features` into the Wallet
|
|
3765
|
+
* Standard account untranslated (0.5.3 lib/esm/index.browser.js:1421), and the
|
|
3766
|
+
* MWA protocol names them differently from the Wallet Standard (spec feature
|
|
3767
|
+
* identifiers: `solana:signMessages`, `solana:signInWithSolana`,
|
|
3768
|
+
* `solana:signTransactions`). Filtered by the Wallet Standard names, such an
|
|
3769
|
+
* account looks unable to sign a message or sign in, and the page sees no
|
|
3770
|
+
* connected account after a successful authorization. Wallet Standard names pass
|
|
3771
|
+
* through unchanged, so this applies to every account.
|
|
3772
|
+
*/
|
|
3773
|
+
const MWA_FEATURE_NAMES = {
|
|
3774
|
+
'solana:signMessages': 'solana:signMessage',
|
|
3775
|
+
'solana:signInWithSolana': 'solana:signIn',
|
|
3776
|
+
'solana:signTransactions': 'solana:signTransaction',
|
|
3777
|
+
};
|
|
3778
|
+
function walletStandardFeatureName(feature) {
|
|
3779
|
+
var _a;
|
|
3780
|
+
return (_a = MWA_FEATURE_NAMES[feature]) !== null && _a !== void 0 ? _a : feature;
|
|
3781
|
+
}
|
|
3742
3782
|
/**
|
|
3743
3783
|
* Register Solana Mobile's MWA wallet with the Wallet Standard registry so
|
|
3744
3784
|
* wallet discovery surfaces it. Idempotent - the first wallet-lane activation
|
|
@@ -3819,9 +3859,13 @@ async function ensureSolanaMobileWalletRegistered(config, network) {
|
|
|
3819
3859
|
}
|
|
3820
3860
|
catch (_e) {
|
|
3821
3861
|
throw new WalletConfigError(`Bounded: Solana Mobile wallet support needs the optional peer dependency ` +
|
|
3822
|
-
`'@solana-mobile/wallet-standard-mobile', which is not installed.
|
|
3823
|
-
`
|
|
3824
|
-
`
|
|
3862
|
+
`'@solana-mobile/wallet-standard-mobile', which is not installed. Until it is, ` +
|
|
3863
|
+
`Android users (Seeker, Saga, any phone browser) get NO wallet to connect: ` +
|
|
3864
|
+
`installed wallet apps are never injected into a page there, the mobile adapter ` +
|
|
3865
|
+
`is the only route. Fix: npm install @solana-mobile/wallet-standard-mobile ` +
|
|
3866
|
+
`(a web app also needs legacy-peer-deps=true in its .npmrc, because the adapter's ` +
|
|
3867
|
+
`protocol package declares react-native as a peer). Or leave the Solana Mobile ` +
|
|
3868
|
+
`wallet out of this app's wallet configuration on purpose.`);
|
|
3825
3869
|
}
|
|
3826
3870
|
const { registerMwa, createDefaultChainSelector, SolanaMobileWalletAdapterWalletName, SolanaMobileWalletAdapterRemoteWalletName, } = mwa;
|
|
3827
3871
|
const before = new Set(getWallets().get());
|
|
@@ -3908,7 +3952,7 @@ const OVERLAY_CSS = `
|
|
|
3908
3952
|
:host{all:initial}
|
|
3909
3953
|
*{box-sizing:border-box}
|
|
3910
3954
|
.bw-ov{position:fixed;inset:0;z-index:2147483647;display:none;
|
|
3911
|
-
font-family:"Schibsted Grotesk","Helvetica Neue",Arial,sans-serif}
|
|
3955
|
+
font-family:"Bounded Schibsted Grotesk","Schibsted Grotesk","Helvetica Neue",Arial,sans-serif}
|
|
3912
3956
|
.bw-ov.mounted{display:block}
|
|
3913
3957
|
.bw-back{position:fixed;inset:0;background:rgba(4,4,5,.62);opacity:0;
|
|
3914
3958
|
transition:opacity .24s ease;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
|
|
@@ -3941,6 +3985,29 @@ const OVERLAY_CSS = `
|
|
|
3941
3985
|
}
|
|
3942
3986
|
@media(prefers-reduced-motion:reduce){.bw-back,.bw-panel{transition:opacity .12s linear!important}}
|
|
3943
3987
|
`;
|
|
3988
|
+
/**
|
|
3989
|
+
* Style the shadow tree with `css` as constructed stylesheets, and say whether it could. A host
|
|
3990
|
+
* CSP whose style-src lacks 'unsafe-inline' refuses an inline <style> even inside a shadow root,
|
|
3991
|
+
* which left the widget unstyled (the Bounded router compiles exactly `style-src 'self'` for an
|
|
3992
|
+
* app that declares browser boundaries and names no style sources); CSP does not govern
|
|
3993
|
+
* constructed sheets. A browser without them (they shipped with adoptedStyleSheets everywhere)
|
|
3994
|
+
* gets <style> elements instead (styleTag).
|
|
3995
|
+
*/
|
|
3996
|
+
function adoptStyles(shadow, css) {
|
|
3997
|
+
if (!("adoptedStyleSheets" in shadow))
|
|
3998
|
+
return false;
|
|
3999
|
+
shadow.adoptedStyleSheets = css.map((text) => {
|
|
4000
|
+
const sheet = new CSSStyleSheet();
|
|
4001
|
+
sheet.replaceSync(text);
|
|
4002
|
+
return sheet;
|
|
4003
|
+
});
|
|
4004
|
+
return true;
|
|
4005
|
+
}
|
|
4006
|
+
function styleTag(css) {
|
|
4007
|
+
const style = document.createElement("style");
|
|
4008
|
+
style.textContent = css;
|
|
4009
|
+
return style;
|
|
4010
|
+
}
|
|
3944
4011
|
let modal = null;
|
|
3945
4012
|
function getModal() {
|
|
3946
4013
|
if (modal)
|
|
@@ -3948,9 +4015,8 @@ function getModal() {
|
|
|
3948
4015
|
const root = document.createElement("div");
|
|
3949
4016
|
root.setAttribute("data-bounded-widget", "");
|
|
3950
4017
|
const shadow = root.attachShadow({ mode: "open" });
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
shadow.appendChild(style);
|
|
4018
|
+
if (!adoptStyles(shadow, [OVERLAY_CSS]))
|
|
4019
|
+
shadow.appendChild(styleTag(OVERLAY_CSS));
|
|
3954
4020
|
const overlay = document.createElement("div");
|
|
3955
4021
|
overlay.className = "bw-ov";
|
|
3956
4022
|
const back = document.createElement("div");
|
|
@@ -5949,7 +6015,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
5949
6015
|
// manager as legacy email sessions. Human login should be started
|
|
5950
6016
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
5951
6017
|
// logout surface for those sessions.
|
|
5952
|
-
currentAuthProvider = new (await import('./email-auth-provider-
|
|
6018
|
+
currentAuthProvider = new (await import('./email-auth-provider-Bk5GSpYT.mjs')).EmailAuthProvider();
|
|
5953
6019
|
break;
|
|
5954
6020
|
case "phantom": {
|
|
5955
6021
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -5991,7 +6057,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
5991
6057
|
// (bounded-login-widget.ts), so registration never counts as
|
|
5992
6058
|
// evidence the user has a wallet.
|
|
5993
6059
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
5994
|
-
const { InjectedWalletProvider } = await import('./injected-wallet-provider-
|
|
6060
|
+
const { InjectedWalletProvider } = await import('./injected-wallet-provider-DxPcYxP-.mjs');
|
|
5995
6061
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
5996
6062
|
break;
|
|
5997
6063
|
}
|
|
@@ -6004,7 +6070,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6004
6070
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6005
6071
|
// to point at a specific wallet or set chainId/domain.
|
|
6006
6072
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6007
|
-
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-
|
|
6073
|
+
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-BQ_kG1vI.mjs');
|
|
6008
6074
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6009
6075
|
break;
|
|
6010
6076
|
}
|
|
@@ -6029,7 +6095,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6029
6095
|
break;
|
|
6030
6096
|
case "guest":
|
|
6031
6097
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6032
|
-
currentAuthProvider = new (await import('./guest-auth-provider-
|
|
6098
|
+
currentAuthProvider = new (await import('./guest-auth-provider-DDudqqxY.mjs')).GuestAuthProvider();
|
|
6033
6099
|
break;
|
|
6034
6100
|
}
|
|
6035
6101
|
if (!currentAuthProvider) {
|
|
@@ -6091,7 +6157,7 @@ async function signInAnonymously() {
|
|
|
6091
6157
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6092
6158
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6093
6159
|
// so bundle-splitting can see it.
|
|
6094
|
-
const provider = new (await import('./guest-auth-provider-
|
|
6160
|
+
const provider = new (await import('./guest-auth-provider-DDudqqxY.mjs')).GuestAuthProvider();
|
|
6095
6161
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6096
6162
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6097
6163
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6262,7 +6328,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6262
6328
|
if (!sharedWalletReady) {
|
|
6263
6329
|
sharedWalletReady = (async () => {
|
|
6264
6330
|
await getConfig();
|
|
6265
|
-
await import('./injected-wallet-provider-
|
|
6331
|
+
await import('./injected-wallet-provider-DxPcYxP-.mjs');
|
|
6266
6332
|
})().catch((error) => {
|
|
6267
6333
|
sharedWalletReady = null;
|
|
6268
6334
|
throw error;
|
|
@@ -6574,6 +6640,13 @@ function registerStorageBridge() {
|
|
|
6574
6640
|
void syncStoredSession().catch((error) => console.warn('Bounded session synchronization failed:', error));
|
|
6575
6641
|
});
|
|
6576
6642
|
}
|
|
6643
|
+
function sameSessionIdentity(next, previous) {
|
|
6644
|
+
if (!next || !previous)
|
|
6645
|
+
return false;
|
|
6646
|
+
const a = deriveUserIdentityFromIdToken(next);
|
|
6647
|
+
const b = deriveUserIdentityFromIdToken(previous);
|
|
6648
|
+
return !!a.id && a.id === b.id && a.address === b.address && a.email === b.email && a.evmAddress === b.evmAddress;
|
|
6649
|
+
}
|
|
6577
6650
|
async function syncStoredSession() {
|
|
6578
6651
|
const config = initializedConfig;
|
|
6579
6652
|
if (!config)
|
|
@@ -6582,6 +6655,18 @@ async function syncStoredSession() {
|
|
|
6582
6655
|
const issuer = WebSessionManager.getIssuer();
|
|
6583
6656
|
if (token === observedIdToken && issuer === observedIssuer)
|
|
6584
6657
|
return;
|
|
6658
|
+
// Another tab refreshed this same session (tokens rotate every few minutes):
|
|
6659
|
+
// who is signed in did not change, so keep the user and its live reads, whose
|
|
6660
|
+
// sockets take the new token on their own, instead of hiding and restoring it.
|
|
6661
|
+
if (currentUser && issuer === observedIssuer && sameSessionIdentity(token, observedIdToken)) {
|
|
6662
|
+
const record = await WebSessionManager.readSessionWithGeneration();
|
|
6663
|
+
if (config !== initializedConfig || WebSessionManager.getIdToken() !== token)
|
|
6664
|
+
return;
|
|
6665
|
+
if ((record === null || record === void 0 ? void 0 : record.idToken) === token && (!record.appId || record.appId === config.appId)) {
|
|
6666
|
+
observedIdToken = token;
|
|
6667
|
+
return;
|
|
6668
|
+
}
|
|
6669
|
+
}
|
|
6585
6670
|
observedIdToken = token;
|
|
6586
6671
|
observedIssuer = issuer;
|
|
6587
6672
|
const generation = ++initializationGeneration;
|
|
@@ -8741,5 +8826,5 @@ class PrivyExpoProvider {
|
|
|
8741
8826
|
}
|
|
8742
8827
|
}
|
|
8743
8828
|
|
|
8744
|
-
export {
|
|
8745
|
-
//# sourceMappingURL=index.native-
|
|
8829
|
+
export { PARK_REASONS as $, waitForAuthReady as A, login as B, logout as C, getAuthProvider as D, signInAnonymously as E, loginWithPrivy as F, loginWithRedirect as G, completeLoginFromRedirect as H, getLoginReturnError as I, loginWithPopup as J, useAuth as K, useQuery as L, useBuildRun as M, apps as N, getIdToken as O, onramp as P, onrampQuote as Q, onrampStatus as R, setPlatform as S, OffchainAuthProvider as T, PrivyExpoProvider as U, builds as V, BuildsApiError as W, mediaAgentTools as X, NON_TERMINAL_STATES as Y, TERMINAL_STATES as Z, RUN_STATES as _, signMessageWithTurnkey as a, FAILURE_REASONS as a0, BUILD_REVIEW_CAPABILITY_SCHEMA as a1, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as a2, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as a3, signTransactionWithTurnkey as b, signTransactionV1WithTurnkey as c, signAndSubmitTransactionWithTurnkey as d, bs58 as e, getWallets as f, getPlatform as g, hasTurnkeyWallet as h, isSolanaMobileWallet as i, solanaMobileWalletLeavesPage as j, solanaMobileWalletAnswersSignInFromCache as k, setAuthLoading as l, bufferExports as m, normalizeSolanaRpcUrl as n, setStoredAuthMethod as o, confirmAndCheckTransaction as p, resolveSolanaRpcUrl as q, resolveSolanaWalletStandardChain as r, setCurrentUser as s, transactionHasSignature as t, init as u, getCurrentUser as v, walletStandardFeatureName as w, onAuthStateChanged as x, onAuthLoadingChanged as y, getAuthLoading as z };
|
|
8830
|
+
//# sourceMappingURL=index.native-DcW2klyn.mjs.map
|