@bounded-sh/client 0.0.55 → 0.0.57

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 (68) hide show
  1. package/REACT_NATIVE.md +31 -8
  2. package/dist/auth/bounded-login-widget.d.ts +25 -0
  3. package/dist/auth/bounded-widget-modal.d.ts +33 -0
  4. package/dist/auth/index.d.ts +42 -0
  5. package/dist/auth/oidc-auth.d.ts +18 -0
  6. package/dist/auth/providers/wallet-login-finalize.d.ts +17 -0
  7. package/dist/auth/providers/wallet-standard-discovery.d.ts +23 -0
  8. package/dist/auth/providers/wallet-standard-tx.d.ts +7 -0
  9. package/dist/auth/turnkey-auth.d.ts +17 -0
  10. package/dist/auth/turnkey-signer-bridge.d.ts +32 -0
  11. package/dist/auth/turnkey-wallet-widget.d.ts +17 -0
  12. package/dist/{email-auth-provider-BaZceaov.js → email-auth-provider-8k8iBIQL.js} +2 -2
  13. package/dist/{email-auth-provider-BaZceaov.js.map → email-auth-provider-8k8iBIQL.js.map} +1 -1
  14. package/dist/{email-auth-provider-lVwM8vRR.js → email-auth-provider-BlJI-8w9.js} +2 -2
  15. package/dist/{email-auth-provider-lVwM8vRR.js.map → email-auth-provider-BlJI-8w9.js.map} +1 -1
  16. package/dist/{email-auth-provider-yBbGzH2e.mjs → email-auth-provider-Bmah1GWS.mjs} +2 -2
  17. package/dist/{email-auth-provider-yBbGzH2e.mjs.map → email-auth-provider-Bmah1GWS.mjs.map} +1 -1
  18. package/dist/{email-auth-provider-BKl9GgHV.mjs → email-auth-provider-CfNSS8Du.mjs} +2 -2
  19. package/dist/{email-auth-provider-BKl9GgHV.mjs.map → email-auth-provider-CfNSS8Du.mjs.map} +1 -1
  20. package/dist/{guest-auth-provider-DhN9PoAi.js → guest-auth-provider-BRjJV8Zq.js} +2 -2
  21. package/dist/{guest-auth-provider-DhN9PoAi.js.map → guest-auth-provider-BRjJV8Zq.js.map} +1 -1
  22. package/dist/{guest-auth-provider-DTKczntw.js → guest-auth-provider-BjfjrpdW.js} +2 -2
  23. package/dist/{guest-auth-provider-DTKczntw.js.map → guest-auth-provider-BjfjrpdW.js.map} +1 -1
  24. package/dist/{guest-auth-provider-BnugW3TI.mjs → guest-auth-provider-D6h4eAtx.mjs} +2 -2
  25. package/dist/{guest-auth-provider-Dgs8zcnC.mjs.map → guest-auth-provider-D6h4eAtx.mjs.map} +1 -1
  26. package/dist/{guest-auth-provider-Dgs8zcnC.mjs → guest-auth-provider-DxhZ5sWN.mjs} +2 -2
  27. package/dist/{guest-auth-provider-BnugW3TI.mjs.map → guest-auth-provider-DxhZ5sWN.mjs.map} +1 -1
  28. package/dist/{index.native-aSo8M0A8.mjs → index-C7rOe6B2.mjs} +1745 -24
  29. package/dist/index-C7rOe6B2.mjs.map +1 -0
  30. package/dist/{index.native-CouprxZp.js → index-CnObYQhV.js} +1752 -22
  31. package/dist/index-CnObYQhV.js.map +1 -0
  32. package/dist/index.d.ts +7 -1
  33. package/dist/index.js +6 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +1 -1
  36. package/dist/{index-DkdIADby.mjs → index.native-CQiw9baS.mjs} +29 -94
  37. package/dist/index.native-CQiw9baS.mjs.map +1 -0
  38. package/dist/{index-CXVwyR6_.js → index.native-hu3o3zXU.js} +28 -96
  39. package/dist/index.native-hu3o3zXU.js.map +1 -0
  40. package/dist/index.native.d.ts +2 -0
  41. package/dist/index.native.js +2 -1
  42. package/dist/index.native.js.map +1 -1
  43. package/dist/index.native.mjs +1 -1
  44. package/dist/{injected-evm-wallet-provider-CtrS-gLC.js → injected-evm-wallet-provider-CcwS6p3o.js} +2 -2
  45. package/dist/{injected-evm-wallet-provider-CtrS-gLC.js.map → injected-evm-wallet-provider-CcwS6p3o.js.map} +1 -1
  46. package/dist/{injected-evm-wallet-provider-BgiFW_kf.mjs → injected-evm-wallet-provider-DCGnUedJ.mjs} +2 -2
  47. package/dist/{injected-evm-wallet-provider-BgiFW_kf.mjs.map → injected-evm-wallet-provider-DCGnUedJ.mjs.map} +1 -1
  48. package/dist/{injected-evm-wallet-provider-D7fd42En.mjs → injected-evm-wallet-provider-DIWeWiAN.mjs} +2 -2
  49. package/dist/{injected-evm-wallet-provider-D7fd42En.mjs.map → injected-evm-wallet-provider-DIWeWiAN.mjs.map} +1 -1
  50. package/dist/{injected-evm-wallet-provider-CiCeS1n2.js → injected-evm-wallet-provider-Xbt2CUPi.js} +2 -2
  51. package/dist/{injected-evm-wallet-provider-CiCeS1n2.js.map → injected-evm-wallet-provider-Xbt2CUPi.js.map} +1 -1
  52. package/dist/{injected-wallet-provider-CST-B9EE.js → injected-wallet-provider-7ep-jcal.js} +2 -2
  53. package/dist/{injected-wallet-provider-CST-B9EE.js.map → injected-wallet-provider-7ep-jcal.js.map} +1 -1
  54. package/dist/{injected-wallet-provider-Bic6GpDr.js → injected-wallet-provider-B_jQFifE.js} +2 -2
  55. package/dist/{injected-wallet-provider-Bic6GpDr.js.map → injected-wallet-provider-B_jQFifE.js.map} +1 -1
  56. package/dist/{injected-wallet-provider-CRG9TaA9.mjs → injected-wallet-provider-Bps6a9IP.mjs} +2 -2
  57. package/dist/{injected-wallet-provider-CRG9TaA9.mjs.map → injected-wallet-provider-Bps6a9IP.mjs.map} +1 -1
  58. package/dist/{injected-wallet-provider-BhpwmpgW.mjs → injected-wallet-provider-CFnqSsHy.mjs} +2 -2
  59. package/dist/{injected-wallet-provider-BhpwmpgW.mjs.map → injected-wallet-provider-CFnqSsHy.mjs.map} +1 -1
  60. package/dist/wallet-standard-tx-C1HJFLjC.js +30 -0
  61. package/dist/wallet-standard-tx-C1HJFLjC.js.map +1 -0
  62. package/dist/wallet-standard-tx-DBliTUWH.mjs +27 -0
  63. package/dist/wallet-standard-tx-DBliTUWH.mjs.map +1 -0
  64. package/package.json +9 -3
  65. package/dist/index-CXVwyR6_.js.map +0 -1
  66. package/dist/index-DkdIADby.mjs.map +0 -1
  67. package/dist/index.native-CouprxZp.js.map +0 -1
  68. package/dist/index.native-aSo8M0A8.mjs.map +0 -1
@@ -3830,6 +3830,11 @@ function appendHostedLoginHints(params, opts) {
3830
3830
  const provider = normalizeMethod(opts.provider);
3831
3831
  if (provider)
3832
3832
  params.set('bounded_provider', provider);
3833
+ // login_hint: an identifier (usually an email) to prefill on the hosted page.
3834
+ // Kept short and free of control chars; the hosted page validates before use.
3835
+ const hint = String(opts.loginHint || '').trim();
3836
+ if (hint && hint.length <= 320 && !/[\s<>"']/.test(hint))
3837
+ params.set('login_hint', hint);
3833
3838
  // Standard OIDC prompt (e.g. 'login' to force a fresh sign-in / account choice).
3834
3839
  const prompt = normalizeMethod(opts.prompt);
3835
3840
  if (prompt)
@@ -4464,7 +4469,7 @@ async function getAuthProvider(config) {
4464
4469
  // manager as legacy email sessions. Human login should be started
4465
4470
  // with loginWithRedirect(); this provider is kept as the restore and
4466
4471
  // logout surface for those sessions.
4467
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-BaZceaov.js'); })).EmailAuthProvider();
4472
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-BlJI-8w9.js'); })).EmailAuthProvider();
4468
4473
  break;
4469
4474
  case "wallet":
4470
4475
  case "phantom": {
@@ -4483,7 +4488,7 @@ async function getAuthProvider(config) {
4483
4488
  if (!isWalletLoginEnabled(config)) {
4484
4489
  throw walletLoginNotEnabledError(authMethod);
4485
4490
  }
4486
- const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-Bic6GpDr.js'); });
4491
+ const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-7ep-jcal.js'); });
4487
4492
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
4488
4493
  break;
4489
4494
  }
@@ -4496,7 +4501,7 @@ async function getAuthProvider(config) {
4496
4501
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
4497
4502
  // to point at a specific wallet or set chainId/domain.
4498
4503
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
4499
- const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-CtrS-gLC.js'); });
4504
+ const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-Xbt2CUPi.js'); });
4500
4505
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
4501
4506
  break;
4502
4507
  }
@@ -4524,7 +4529,7 @@ async function getAuthProvider(config) {
4524
4529
  break;
4525
4530
  case "guest":
4526
4531
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
4527
- currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DTKczntw.js'); })).GuestAuthProvider();
4532
+ currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-BRjJV8Zq.js'); })).GuestAuthProvider();
4528
4533
  break;
4529
4534
  }
4530
4535
  if (!currentAuthProvider) {
@@ -4580,7 +4585,7 @@ async function signInAnonymously() {
4580
4585
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
4581
4586
  // the main bundle for data-only apps. Specifier is a static string literal
4582
4587
  // so bundle-splitting can see it.
4583
- const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-DTKczntw.js'); })).GuestAuthProvider();
4588
+ const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-BRjJV8Zq.js'); })).GuestAuthProvider();
4584
4589
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
4585
4590
  const commit = (user) => {
4586
4591
  // No await/interleaving inside this block: provider/method/config/marker
@@ -5442,9 +5447,11 @@ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
5442
5447
  const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
5443
5448
  const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
5444
5449
 
5450
+ const FAST_POLL_MS = 1000;
5445
5451
  const NORMAL_POLL_MS = 2000;
5446
5452
  const PARKED_POLL_MS = 5000;
5447
5453
  const LONG_RUNNING_POLL_MS = 10000;
5454
+ const THIRTY_SECONDS_MS = 30000;
5448
5455
  const TWO_MINUTES_MS = 2 * 60000;
5449
5456
  const TEN_MINUTES_MS = 10 * 60000;
5450
5457
  const terminalStates = new Set(TERMINAL_STATES);
@@ -5453,6 +5460,10 @@ function pollCadence(state, elapsedMs) {
5453
5460
  return LONG_RUNNING_POLL_MS;
5454
5461
  if ((state === null || state === void 0 ? void 0 : state.startsWith('parked')) || elapsedMs >= TWO_MINUTES_MS)
5455
5462
  return PARKED_POLL_MS;
5463
+ // The first 30s is where the user is staring at "waiting for a build slot" /
5464
+ // "building" and every transition matters most; poll fast, then relax.
5465
+ if (elapsedMs < THIRTY_SECONDS_MS)
5466
+ return FAST_POLL_MS;
5456
5467
  return NORMAL_POLL_MS;
5457
5468
  }
5458
5469
  function retryCadence(error, state, elapsedMs) {
@@ -5538,9 +5549,18 @@ function watch(appId, runId, onUpdate, options = {}) {
5538
5549
  const poll = async () => {
5539
5550
  if (!active)
5540
5551
  return;
5552
+ // Fire the view and the events page concurrently: the events cursor (lastSeq)
5553
+ // does not depend on the run view, so there is no reason to pay two serial
5554
+ // round-trips per tick. Error semantics below are unchanged — the run result
5555
+ // still gates, and a failed events page still publishes the run with no rows.
5556
+ const runPromise = get(appId, runId);
5557
+ const eventsPromise = events(appId, runId, lastSeq);
5558
+ // Keep the in-flight events page from becoming an unhandled rejection if the
5559
+ // run result makes us bail before awaiting it; the real await below still sees it.
5560
+ eventsPromise.catch(() => { });
5541
5561
  let run;
5542
5562
  try {
5543
- const view = await get(appId, runId);
5563
+ const view = await runPromise;
5544
5564
  if (!active)
5545
5565
  return;
5546
5566
  run = view.run;
@@ -5558,7 +5578,7 @@ function watch(appId, runId, onUpdate, options = {}) {
5558
5578
  return;
5559
5579
  }
5560
5580
  try {
5561
- const response = await events(appId, runId, lastSeq);
5581
+ const response = await eventsPromise;
5562
5582
  if (!active)
5563
5583
  return;
5564
5584
  const deduped = newEvents(Array.isArray(response.events) ? response.events : [], lastSeq, seenSeqs);
@@ -6150,91 +6170,6 @@ class PrivyExpoProvider {
6150
6170
  }
6151
6171
  }
6152
6172
 
6153
- /**
6154
- * Default provider discovery: Phantom-first, then any Wallet-Standard
6155
- * `window.solana`. Kept tiny + synchronous (no heavy imports) so it works inside
6156
- * a user gesture and can be eagerly exported from the SDK entry.
6157
- */
6158
- function defaultInjectedProvider() {
6159
- var _a;
6160
- if (typeof window === 'undefined')
6161
- return null;
6162
- const w = window;
6163
- const phantom = (_a = w === null || w === void 0 ? void 0 : w.phantom) === null || _a === void 0 ? void 0 : _a.solana;
6164
- if (phantom && typeof phantom.signMessage === 'function')
6165
- return phantom;
6166
- const generic = w === null || w === void 0 ? void 0 : w.solana;
6167
- if (generic && typeof generic.signMessage === 'function')
6168
- return generic;
6169
- return null;
6170
- }
6171
-
6172
- // injected-evm-wallet-types.ts — tiny, dependency-free surface for the EVM
6173
- // WALLET LOGIN path (BYO wallet via SIWE). The EVM twin of
6174
- // injected-wallet-types.ts: kept separate from injected-evm-wallet-provider.ts
6175
- // so the SDK entry can eagerly export the type surface + the provider-discovery
6176
- // helper WITHOUT dragging the provider class into the default bundle. The
6177
- // provider is lazy-loaded by getAuthProvider() when an app opts into
6178
- // authMethod:'evm-wallet'.
6179
- //
6180
- // It rides the standard EIP-1193 injected provider a browser wallet exposes
6181
- // (MetaMask / Rabby / Coinbase Wallet / any window.ethereum), discovered via
6182
- // EIP-6963 (multi-wallet, collision-free) with a window.ethereum fallback. It
6183
- // needs NO viem/ethers and NO React — EIP-1193 request() + hex strings suffice.
6184
- // EIP-6963 is announcement-based: wallets add an `eip6963:requestProvider`
6185
- // listener and synchronously dispatch `eip6963:announceProvider` in response. We
6186
- // keep a persistent collector so announcements (including late ones) are
6187
- // captured, and re-request on demand.
6188
- const announcedProviders = [];
6189
- let announceListenerAttached = false;
6190
- function attachAnnounceListener() {
6191
- if (announceListenerAttached || typeof window === 'undefined')
6192
- return;
6193
- announceListenerAttached = true;
6194
- window.addEventListener('eip6963:announceProvider', (event) => {
6195
- const detail = event === null || event === void 0 ? void 0 : event.detail;
6196
- if (detail &&
6197
- detail.provider &&
6198
- typeof detail.provider.request === 'function' &&
6199
- !announcedProviders.some((d) => { var _a, _b; return ((_a = d.info) === null || _a === void 0 ? void 0 : _a.uuid) === ((_b = detail.info) === null || _b === void 0 ? void 0 : _b.uuid); })) {
6200
- announcedProviders.push(detail);
6201
- }
6202
- });
6203
- }
6204
- /**
6205
- * Request + collect EIP-6963 providers. Dispatches `eip6963:requestProvider`
6206
- * (synchronous — already-loaded wallets announce in the same tick) and returns
6207
- * every wallet announced so far. Kept synchronous so it works inside a user
6208
- * gesture and can be eagerly exported from the SDK entry.
6209
- */
6210
- function requestEip6963Providers() {
6211
- if (typeof window === 'undefined')
6212
- return [];
6213
- attachAnnounceListener();
6214
- try {
6215
- window.dispatchEvent(new Event('eip6963:requestProvider'));
6216
- }
6217
- catch (_a) {
6218
- /* older browsers without Event constructor — fall through to window.ethereum */
6219
- }
6220
- return announcedProviders.slice();
6221
- }
6222
- /**
6223
- * Default EVM provider discovery: EIP-6963 first (multi-wallet, collision-free),
6224
- * then legacy `window.ethereum`. Returns null when no injected wallet is present.
6225
- */
6226
- function defaultInjectedEvmProvider() {
6227
- if (typeof window === 'undefined')
6228
- return null;
6229
- const details = requestEip6963Providers();
6230
- if (details.length > 0)
6231
- return details[0].provider;
6232
- const eth = window.ethereum;
6233
- if (eth && typeof eth.request === 'function')
6234
- return eth;
6235
- return null;
6236
- }
6237
-
6238
6173
  exports.BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA;
6239
6174
  exports.BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA;
6240
6175
  exports.BUILD_REVIEW_CAPABILITY_SCHEMA = BUILD_REVIEW_CAPABILITY_SCHEMA;
@@ -6254,8 +6189,6 @@ exports.builds = builds;
6254
6189
  exports.completeLoginFromRedirect = completeLoginFromRedirect;
6255
6190
  exports.completeLoginInPopup = completeLoginInPopup;
6256
6191
  exports.confirmAndCheckTransaction = confirmAndCheckTransaction;
6257
- exports.defaultInjectedEvmProvider = defaultInjectedEvmProvider;
6258
- exports.defaultInjectedProvider = defaultInjectedProvider;
6259
6192
  exports.deserializeTransaction = deserializeTransaction;
6260
6193
  exports.embeddedRunEvmTransaction = embeddedRunEvmTransaction;
6261
6194
  exports.embeddedSignAndSubmit = embeddedSignAndSubmit;
@@ -6275,7 +6208,6 @@ exports.logout = logout;
6275
6208
  exports.normalizeSolanaRpcUrl = normalizeSolanaRpcUrl;
6276
6209
  exports.onAuthLoadingChanged = onAuthLoadingChanged;
6277
6210
  exports.onAuthStateChanged = onAuthStateChanged;
6278
- exports.requestEip6963Providers = requestEip6963Providers;
6279
6211
  exports.resolveSolanaRpcUrl = resolveSolanaRpcUrl;
6280
6212
  exports.setAuthLoading = setAuthLoading;
6281
6213
  exports.setCurrentUser = setCurrentUser;
@@ -6284,4 +6216,4 @@ exports.signInAnonymously = signInAnonymously;
6284
6216
  exports.useAuth = useAuth;
6285
6217
  exports.useBuildRun = useBuildRun;
6286
6218
  exports.useQuery = useQuery;
6287
- //# sourceMappingURL=index-CXVwyR6_.js.map
6219
+ //# sourceMappingURL=index.native-hu3o3zXU.js.map