@bounded-sh/client 0.0.119 → 0.0.120-expo.0

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.
Files changed (50) hide show
  1. package/dist/auth/oidc-auth.d.ts +2 -1
  2. package/dist/{email-auth-provider-wOISnCic.js → email-auth-provider-Bb_0mHJ_.js} +2 -2
  3. package/dist/{email-auth-provider-wOISnCic.js.map → email-auth-provider-Bb_0mHJ_.js.map} +1 -1
  4. package/dist/{email-auth-provider-DyzhiN9Y.js → email-auth-provider-IsiArtx0.js} +2 -2
  5. package/dist/{email-auth-provider-DyzhiN9Y.js.map → email-auth-provider-IsiArtx0.js.map} +1 -1
  6. package/dist/{email-auth-provider-DHq5_wtn.mjs → email-auth-provider-TA2AbU5Y.mjs} +2 -2
  7. package/dist/{email-auth-provider-DHq5_wtn.mjs.map → email-auth-provider-TA2AbU5Y.mjs.map} +1 -1
  8. package/dist/{email-auth-provider-DOI-4lPC.mjs → email-auth-provider-ao5ce_SN.mjs} +2 -2
  9. package/dist/{email-auth-provider-DOI-4lPC.mjs.map → email-auth-provider-ao5ce_SN.mjs.map} +1 -1
  10. package/dist/{guest-auth-provider-xap-VQBP.js → guest-auth-provider-CJUbifdu.js} +2 -2
  11. package/dist/{guest-auth-provider-xap-VQBP.js.map → guest-auth-provider-CJUbifdu.js.map} +1 -1
  12. package/dist/{guest-auth-provider-Br3iM3O3.js → guest-auth-provider-DTEwf7qP.js} +2 -2
  13. package/dist/{guest-auth-provider-Br3iM3O3.js.map → guest-auth-provider-DTEwf7qP.js.map} +1 -1
  14. package/dist/{guest-auth-provider-DyP5UUg6.mjs → guest-auth-provider-Dw-bF10B.mjs} +2 -2
  15. package/dist/{guest-auth-provider-ZOBNFoeC.mjs.map → guest-auth-provider-Dw-bF10B.mjs.map} +1 -1
  16. package/dist/{guest-auth-provider-ZOBNFoeC.mjs → guest-auth-provider-DxQG3JvU.mjs} +2 -2
  17. package/dist/{guest-auth-provider-DyP5UUg6.mjs.map → guest-auth-provider-DxQG3JvU.mjs.map} +1 -1
  18. package/dist/{index-BaXUWG8Q.mjs → index-BdzGX8fS.mjs} +36 -14
  19. package/dist/index-BdzGX8fS.mjs.map +1 -0
  20. package/dist/{index-B4_eKphx.js → index-KUBcQdTX.js} +36 -14
  21. package/dist/index-KUBcQdTX.js.map +1 -0
  22. package/dist/index.js +1 -1
  23. package/dist/index.mjs +1 -1
  24. package/dist/{index.native-B-pjNetI.js → index.native-CZSRvIAb.js} +35 -13
  25. package/dist/index.native-CZSRvIAb.js.map +1 -0
  26. package/dist/{index.native-B4yI0BqT.mjs → index.native-N5zxPEYK.mjs} +35 -13
  27. package/dist/index.native-N5zxPEYK.mjs.map +1 -0
  28. package/dist/index.native.js +1 -1
  29. package/dist/index.native.mjs +1 -1
  30. package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js → injected-evm-wallet-provider--XJFh-7d.js} +2 -2
  31. package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js.map → injected-evm-wallet-provider--XJFh-7d.js.map} +1 -1
  32. package/dist/{injected-evm-wallet-provider-DQMYqPus.js → injected-evm-wallet-provider-4T_-2UQI.js} +2 -2
  33. package/dist/{injected-evm-wallet-provider-DQMYqPus.js.map → injected-evm-wallet-provider-4T_-2UQI.js.map} +1 -1
  34. package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs → injected-evm-wallet-provider-BlSFIzEA.mjs} +2 -2
  35. package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs.map → injected-evm-wallet-provider-BlSFIzEA.mjs.map} +1 -1
  36. package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs → injected-evm-wallet-provider-CtPPhtMh.mjs} +2 -2
  37. package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs.map → injected-evm-wallet-provider-CtPPhtMh.mjs.map} +1 -1
  38. package/dist/{injected-wallet-provider-jj9dqm2Z.mjs → injected-wallet-provider-Bnsfazum.mjs} +2 -2
  39. package/dist/{injected-wallet-provider-jj9dqm2Z.mjs.map → injected-wallet-provider-Bnsfazum.mjs.map} +1 -1
  40. package/dist/{injected-wallet-provider-B8QTPxf6.js → injected-wallet-provider-CJ0v5Sgn.js} +2 -2
  41. package/dist/{injected-wallet-provider-B8QTPxf6.js.map → injected-wallet-provider-CJ0v5Sgn.js.map} +1 -1
  42. package/dist/{injected-wallet-provider-BsTfBAD4.js → injected-wallet-provider-Ckljhcbu.js} +2 -2
  43. package/dist/{injected-wallet-provider-BsTfBAD4.js.map → injected-wallet-provider-Ckljhcbu.js.map} +1 -1
  44. package/dist/{injected-wallet-provider-CQxGVYja.mjs → injected-wallet-provider-yyJfuVgv.mjs} +2 -2
  45. package/dist/{injected-wallet-provider-CQxGVYja.mjs.map → injected-wallet-provider-yyJfuVgv.mjs.map} +1 -1
  46. package/package.json +2 -2
  47. package/dist/index-B4_eKphx.js.map +0 -1
  48. package/dist/index-BaXUWG8Q.mjs.map +0 -1
  49. package/dist/index.native-B-pjNetI.js.map +0 -1
  50. package/dist/index.native-B4yI0BqT.mjs.map +0 -1
@@ -130,8 +130,17 @@ function createWebPlatform() {
130
130
  // bundlers do not externalize or preload a Node-only module in the
131
131
  // email/guest graph; this branch is unreachable when WebCrypto is
132
132
  // available (all supported browsers and current Node releases).
133
+ // The try makes it an optional dependency for Metro, whose production
134
+ // constant folding turns the specifier back into a literal: a React Native
135
+ // app with no node:crypto mapping still bundles (it passes setPlatform({ sha256 })).
133
136
  const nodeCryptoSpecifier = 'node:crypto';
134
- const { createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier);
137
+ let createHash;
138
+ try {
139
+ ({ createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier));
140
+ }
141
+ catch (_b) {
142
+ throw new Error('SHA-256 needs WebCrypto here: pass setPlatform({ sha256 }) (e.g. expo-crypto digest).');
143
+ }
135
144
  const hash = createHash('sha256').update(data).digest();
136
145
  return hash.buffer.slice(hash.byteOffset, hash.byteOffset + hash.byteLength);
137
146
  },
@@ -5168,6 +5177,14 @@ function cleanCallbackUrl(url) {
5168
5177
  clean.searchParams.delete(key);
5169
5178
  return clean;
5170
5179
  }
5180
+ // The address a code returned to, without the fragment. The issuer never sets one
5181
+ // (redirectUri may not carry one), but a browser can keep one across the redirect
5182
+ // chain: iOS lands a Google sign-in on `<redirectUri>?code=...#`.
5183
+ function returnAddress(url) {
5184
+ const clean = cleanCallbackUrl(url);
5185
+ clean.hash = '';
5186
+ return clean.href;
5187
+ }
5171
5188
  async function validateAttempt(pkce, callback) {
5172
5189
  const cfg = await getConfig();
5173
5190
  if (!pkce || typeof pkce.verifier !== 'string' || !pkce.verifier ||
@@ -5177,7 +5194,7 @@ async function validateAttempt(pkce, callback) {
5177
5194
  if (!Number.isFinite(pkce.createdAt) || Date.now() - pkce.createdAt > LOGIN_TIMEOUT_MS || pkce.createdAt > Date.now()) {
5178
5195
  throw new Error('Login expired. Start sign-in again.');
5179
5196
  }
5180
- if (callback && (cleanCallbackUrl(callback).href !== cleanCallbackUrl(new URL(pkce.redirectUri)).href ||
5197
+ if (callback && (returnAddress(callback) !== returnAddress(new URL(pkce.redirectUri)) ||
5181
5198
  (callback.searchParams.has('iss') && callback.searchParams.get('iss') !== pkce.issuer))) {
5182
5199
  throw new Error('Login returned to a different address or from a different auth server. Start sign-in again.');
5183
5200
  }
@@ -5430,7 +5447,7 @@ function parseCallbackParams(callbackUrl) {
5430
5447
  // universal-link callback, verify state, and run the SAME PKCE code→token exchange
5431
5448
  // as web. Returns the signed-in User inline; web redirects complete on the next init().
5432
5449
  async function runNativeLogin(opts) {
5433
- var _a, _b;
5450
+ var _a, _b, _c, _d;
5434
5451
  const { url, pkce } = await buildAuthorize(opts);
5435
5452
  const WebBrowser = await loadExpoWebBrowser();
5436
5453
  const openAuthSession = WebBrowser.openAuthSessionAsync || ((_a = WebBrowser.default) === null || _a === void 0 ? void 0 : _a.openAuthSessionAsync);
@@ -5442,12 +5459,16 @@ async function runNativeLogin(opts) {
5442
5459
  // openAuthSessionAsync keeps JS alive while the system browser is shown, then
5443
5460
  // resolves with the callback URL once the universal link fires — so `pkce`
5444
5461
  // stays in scope and never needs to be persisted.
5445
- const result = await openAuthSession(url, opts.redirectUri);
5462
+ // iOS (17.4+) only returns an https callback to the app when asked to; without it the
5463
+ // sheet treats "https" as a custom scheme and never completes. A custom scheme callback
5464
+ // (an Expo Go preview's exps://) is caught by its scheme either way.
5465
+ const preferUniversalLinks = (_c = (_b = opts.redirectUri) === null || _b === void 0 ? void 0 : _b.startsWith('https:')) !== null && _c !== void 0 ? _c : false;
5466
+ const result = await openAuthSession(url, opts.redirectUri, { preferUniversalLinks });
5446
5467
  if (!result || result.type === 'cancel' || result.type === 'dismiss') {
5447
5468
  throw new Error('Login cancelled');
5448
5469
  }
5449
5470
  if (result.type !== 'success' || typeof result.url !== 'string') {
5450
- throw new Error(`Hosted login did not complete (result: ${(_b = result === null || result === void 0 ? void 0 : result.type) !== null && _b !== void 0 ? _b : 'unknown'})`);
5471
+ throw new Error(`Hosted login did not complete (result: ${(_d = result === null || result === void 0 ? void 0 : result.type) !== null && _d !== void 0 ? _d : 'unknown'})`);
5451
5472
  }
5452
5473
  const { code, state: returnedState } = parseCallbackParams(result.url);
5453
5474
  if (!code)
@@ -5470,7 +5491,8 @@ async function runNativeLogin(opts) {
5470
5491
  * callback, runs the PKCE exchange INLINE, and resolves with the signed-in User. No
5471
5492
  * completeLoginFromRedirect() call is needed on native. Requires `redirectUri` to be an
5472
5493
  * https UNIVERSAL LINK whose origin the app owner registered in the app's allowedOrigins
5473
- * (custom `myapp://` schemes are rejected by the issuer). Needs the optional peer deps
5494
+ * (custom `myapp://` schemes are rejected by the issuer; an app preview opened in Expo Go
5495
+ * uses `exps://<preview host>/--/<path>`). Needs the optional peer deps
5474
5496
  * expo-web-browser + (expo-crypto or react-native-get-random-values). */
5475
5497
  async function loginWithRedirect(opts) {
5476
5498
  if (isNative())
@@ -6149,7 +6171,7 @@ async function getAuthProvider(config, fromStorage = false) {
6149
6171
  // manager as legacy email sessions. Human login should be started
6150
6172
  // with loginWithRedirect(); this provider is kept as the restore and
6151
6173
  // logout surface for those sessions.
6152
- currentAuthProvider = new (await import('./email-auth-provider-DOI-4lPC.mjs')).EmailAuthProvider();
6174
+ currentAuthProvider = new (await import('./email-auth-provider-ao5ce_SN.mjs')).EmailAuthProvider();
6153
6175
  break;
6154
6176
  case "phantom": {
6155
6177
  // First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
@@ -6191,7 +6213,7 @@ async function getAuthProvider(config, fromStorage = false) {
6191
6213
  // (bounded-login-widget.ts), so registration never counts as
6192
6214
  // evidence the user has a wallet.
6193
6215
  await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
6194
- const { InjectedWalletProvider } = await import('./injected-wallet-provider-CQxGVYja.mjs');
6216
+ const { InjectedWalletProvider } = await import('./injected-wallet-provider-yyJfuVgv.mjs');
6195
6217
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
6196
6218
  break;
6197
6219
  }
@@ -6204,7 +6226,7 @@ async function getAuthProvider(config, fromStorage = false) {
6204
6226
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
6205
6227
  // to point at a specific wallet or set chainId/domain.
6206
6228
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
6207
- const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-Vw-Puwxh.mjs');
6229
+ const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-CtPPhtMh.mjs');
6208
6230
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
6209
6231
  break;
6210
6232
  }
@@ -6229,7 +6251,7 @@ async function getAuthProvider(config, fromStorage = false) {
6229
6251
  break;
6230
6252
  case "guest":
6231
6253
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
6232
- currentAuthProvider = new (await import('./guest-auth-provider-ZOBNFoeC.mjs')).GuestAuthProvider();
6254
+ currentAuthProvider = new (await import('./guest-auth-provider-DxQG3JvU.mjs')).GuestAuthProvider();
6233
6255
  break;
6234
6256
  }
6235
6257
  if (!currentAuthProvider) {
@@ -6291,7 +6313,7 @@ async function signInAnonymously() {
6291
6313
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
6292
6314
  // the main bundle for data-only apps. Specifier is a static string literal
6293
6315
  // so bundle-splitting can see it.
6294
- const provider = new (await import('./guest-auth-provider-ZOBNFoeC.mjs')).GuestAuthProvider();
6316
+ const provider = new (await import('./guest-auth-provider-DxQG3JvU.mjs')).GuestAuthProvider();
6295
6317
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
6296
6318
  // adoptSessionProvider awaits only getConfig() (already resolved here) and then
6297
6319
  // runs every write - provider/method/config/marker/user - in one synchronous
@@ -6462,7 +6484,7 @@ function ensureSharedWalletLoginReady() {
6462
6484
  if (!sharedWalletReady) {
6463
6485
  sharedWalletReady = (async () => {
6464
6486
  await getConfig();
6465
- await import('./injected-wallet-provider-CQxGVYja.mjs');
6487
+ await import('./injected-wallet-provider-yyJfuVgv.mjs');
6466
6488
  })().catch((error) => {
6467
6489
  sharedWalletReady = null;
6468
6490
  throw error;
@@ -8969,4 +8991,4 @@ class PrivyExpoProvider {
8969
8991
  }
8970
8992
 
8971
8993
  export { RUN_STATES as $, getAuthLoading as A, waitForAuthReady as B, login as C, logout as D, getAuthProvider as E, signInAnonymously as F, loginWithPrivy as G, loginWithRedirect as H, completeLoginFromRedirect as I, getLoginReturnError as J, loginWithPopup as K, useAuth as L, useQuery as M, useBuildRun as N, apps as O, getIdToken as P, onramp as Q, onrampQuote as R, onrampStatus as S, setPlatform as T, OffchainAuthProvider as U, PrivyExpoProvider as V, builds as W, BuildsApiError as X, mediaAgentTools as Y, NON_TERMINAL_STATES as Z, TERMINAL_STATES as _, signMessageWithTurnkey as a, PARK_REASONS as a0, FAILURE_REASONS as a1, BUILD_REVIEW_CAPABILITY_SCHEMA as a2, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as a3, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as a4, signTransactionWithTurnkey as b, signTransactionV1WithTurnkey as c, signAndSubmitTransactionWithTurnkey as d, ensureTurnkeySigningSession as e, bs58 as f, getPlatform as g, hasTurnkeyWallet as h, getWallets as i, solanaMobileWalletLeavesPage as j, solanaMobileWalletAnswersSignInFromCache as k, isSolanaMobileWallet as l, setAuthLoading as m, normalizeSolanaRpcUrl as n, bufferExports as o, setStoredAuthMethod as p, confirmAndCheckTransaction as q, resolveSolanaWalletStandardChain as r, setCurrentUser as s, transactionHasSignature as t, resolveSolanaRpcUrl as u, init as v, walletStandardFeatureName as w, getCurrentUser as x, onAuthStateChanged as y, onAuthLoadingChanged as z };
8972
- //# sourceMappingURL=index.native-B4yI0BqT.mjs.map
8994
+ //# sourceMappingURL=index.native-N5zxPEYK.mjs.map