@bounded-sh/client 0.0.51 → 0.0.53-next.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 (64) hide show
  1. package/dist/auth/index.d.ts +1 -1
  2. package/dist/auth/providers/injected-wallet-types.d.ts +1 -1
  3. package/dist/auth/providers/phantom-wallet-provider.d.ts +0 -2
  4. package/dist/auth/providers/privy-wallet-provider.d.ts +3 -5
  5. package/dist/auth/solana-rpc.d.ts +1 -2
  6. package/dist/builds/apps.d.ts +2 -0
  7. package/dist/builds/client.d.ts +23 -1
  8. package/dist/builds/index.d.ts +7 -4
  9. package/dist/builds/types.d.ts +66 -0
  10. package/dist/{email-auth-provider-Bm6vmoy3.js → email-auth-provider-BQ-DTX3z.js} +2 -2
  11. package/dist/{email-auth-provider-Bm6vmoy3.js.map → email-auth-provider-BQ-DTX3z.js.map} +1 -1
  12. package/dist/{email-auth-provider-Bh2fDYcb.mjs → email-auth-provider-CR7B2pob.mjs} +2 -2
  13. package/dist/{email-auth-provider-CdbhqElf.mjs.map → email-auth-provider-CR7B2pob.mjs.map} +1 -1
  14. package/dist/{email-auth-provider-CdbhqElf.mjs → email-auth-provider-CRFJd5Rp.mjs} +2 -2
  15. package/dist/{email-auth-provider-Bh2fDYcb.mjs.map → email-auth-provider-CRFJd5Rp.mjs.map} +1 -1
  16. package/dist/{email-auth-provider-CnHsY8U-.js → email-auth-provider-CyEhOnGQ.js} +2 -2
  17. package/dist/{email-auth-provider-CnHsY8U-.js.map → email-auth-provider-CyEhOnGQ.js.map} +1 -1
  18. package/dist/{guest-auth-provider-Xir8zyfZ.mjs → guest-auth-provider-1GGM1eWA.mjs} +2 -2
  19. package/dist/{guest-auth-provider-Xir8zyfZ.mjs.map → guest-auth-provider-1GGM1eWA.mjs.map} +1 -1
  20. package/dist/{guest-auth-provider-CHqB_uN0.js → guest-auth-provider-3cWfAi5V.js} +2 -2
  21. package/dist/{guest-auth-provider-CHqB_uN0.js.map → guest-auth-provider-3cWfAi5V.js.map} +1 -1
  22. package/dist/{guest-auth-provider-Dgmr7e0Z.mjs → guest-auth-provider-BLzLLs7u.mjs} +2 -2
  23. package/dist/{guest-auth-provider-Dgmr7e0Z.mjs.map → guest-auth-provider-BLzLLs7u.mjs.map} +1 -1
  24. package/dist/{guest-auth-provider-fjOMwfpW.js → guest-auth-provider-DkUngKob.js} +2 -2
  25. package/dist/{guest-auth-provider-fjOMwfpW.js.map → guest-auth-provider-DkUngKob.js.map} +1 -1
  26. package/dist/{index-BsrZb496.js → index-C6p_-77w.js} +56 -32
  27. package/dist/index-C6p_-77w.js.map +1 -0
  28. package/dist/{index-Cy0IRs6U.mjs → index-Co7IqxVo.mjs} +54 -32
  29. package/dist/index-Co7IqxVo.mjs.map +1 -0
  30. package/dist/index.js +4 -1
  31. package/dist/index.js.map +1 -1
  32. package/dist/index.mjs +1 -1
  33. package/dist/{index.native-BaEZwiWd.js → index.native-BTPOnWux.js} +56 -32
  34. package/dist/index.native-BTPOnWux.js.map +1 -0
  35. package/dist/{index.native-B29WKXlr.mjs → index.native-BoKkzObx.mjs} +54 -32
  36. package/dist/index.native-BoKkzObx.mjs.map +1 -0
  37. package/dist/index.native.js +4 -1
  38. package/dist/index.native.js.map +1 -1
  39. package/dist/index.native.mjs +1 -1
  40. package/dist/{injected-evm-wallet-provider-DkyIMRce.mjs → injected-evm-wallet-provider-Bsh00akg.mjs} +2 -2
  41. package/dist/{injected-evm-wallet-provider-DkyIMRce.mjs.map → injected-evm-wallet-provider-Bsh00akg.mjs.map} +1 -1
  42. package/dist/{injected-evm-wallet-provider-DWnpa6Yx.mjs → injected-evm-wallet-provider-CA9ENSN4.mjs} +2 -2
  43. package/dist/{injected-evm-wallet-provider-DWnpa6Yx.mjs.map → injected-evm-wallet-provider-CA9ENSN4.mjs.map} +1 -1
  44. package/dist/{injected-evm-wallet-provider-DUyX7Xj9.js → injected-evm-wallet-provider-Cjs3K7fU.js} +2 -2
  45. package/dist/{injected-evm-wallet-provider-DUyX7Xj9.js.map → injected-evm-wallet-provider-Cjs3K7fU.js.map} +1 -1
  46. package/dist/{injected-evm-wallet-provider-CEWIg-_U.js → injected-evm-wallet-provider-DCqeV702.js} +2 -2
  47. package/dist/{injected-evm-wallet-provider-CEWIg-_U.js.map → injected-evm-wallet-provider-DCqeV702.js.map} +1 -1
  48. package/dist/{injected-wallet-provider-DsesEVnZ.mjs → injected-wallet-provider-BwHOxPAR.mjs} +6 -8
  49. package/dist/injected-wallet-provider-BwHOxPAR.mjs.map +1 -0
  50. package/dist/{injected-wallet-provider-DpJvuK73.js → injected-wallet-provider-CfzCTdM5.js} +6 -8
  51. package/dist/injected-wallet-provider-CfzCTdM5.js.map +1 -0
  52. package/dist/{injected-wallet-provider-C65NiItg.js → injected-wallet-provider-CmhZtf9E.js} +6 -8
  53. package/dist/injected-wallet-provider-CmhZtf9E.js.map +1 -0
  54. package/dist/{injected-wallet-provider-DqBpuASt.mjs → injected-wallet-provider-uF4yZt8l.mjs} +6 -8
  55. package/dist/injected-wallet-provider-uF4yZt8l.mjs.map +1 -0
  56. package/package.json +2 -2
  57. package/dist/index-BsrZb496.js.map +0 -1
  58. package/dist/index-Cy0IRs6U.mjs.map +0 -1
  59. package/dist/index.native-B29WKXlr.mjs.map +0 -1
  60. package/dist/index.native-BaEZwiWd.js.map +0 -1
  61. package/dist/injected-wallet-provider-C65NiItg.js.map +0 -1
  62. package/dist/injected-wallet-provider-DpJvuK73.js.map +0 -1
  63. package/dist/injected-wallet-provider-DqBpuASt.mjs.map +0 -1
  64. package/dist/injected-wallet-provider-DsesEVnZ.mjs.map +0 -1
@@ -819,11 +819,9 @@ class OffchainAuthProvider {
819
819
  }
820
820
  }
821
821
 
822
- const SURFNET_RPC_URL = "https://surfpool.fly.dev";
823
822
  const SUPPORTED_SOLANA_NETWORKS = new Set([
824
823
  "solana_devnet",
825
824
  "solana_mainnet",
826
- "surfnet",
827
825
  ]);
828
826
  function normalizeSolanaRpcUrl(rpcUrl) {
829
827
  if (typeof rpcUrl !== "string")
@@ -837,7 +835,7 @@ function isSupportedSolanaRpcNetwork(network) {
837
835
  function resolveSolanaRpcUrl(explicitRpcUrl, network, context) {
838
836
  if (network != null && network !== "" && !isSupportedSolanaRpcNetwork(network)) {
839
837
  throw new Error(`${context} does not support Solana network "${network}". ` +
840
- `Expected one of: solana_devnet, solana_mainnet, surfnet.`);
838
+ `Expected one of: solana_devnet, solana_mainnet.`);
841
839
  }
842
840
  const rpcUrl = normalizeSolanaRpcUrl(explicitRpcUrl);
843
841
  if (rpcUrl)
@@ -4445,7 +4443,7 @@ async function getAuthProvider(config) {
4445
4443
  // manager as legacy email sessions. Human login should be started
4446
4444
  // with loginWithRedirect(); this provider is kept as the restore and
4447
4445
  // logout surface for those sessions.
4448
- currentAuthProvider = new (await import('./email-auth-provider-Bh2fDYcb.mjs')).EmailAuthProvider();
4446
+ currentAuthProvider = new (await import('./email-auth-provider-CR7B2pob.mjs')).EmailAuthProvider();
4449
4447
  break;
4450
4448
  case "wallet":
4451
4449
  case "phantom": {
@@ -4464,7 +4462,7 @@ async function getAuthProvider(config) {
4464
4462
  if (!isWalletLoginEnabled(config)) {
4465
4463
  throw walletLoginNotEnabledError(authMethod);
4466
4464
  }
4467
- const { InjectedWalletProvider } = await import('./injected-wallet-provider-DsesEVnZ.mjs');
4465
+ const { InjectedWalletProvider } = await import('./injected-wallet-provider-BwHOxPAR.mjs');
4468
4466
  currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
4469
4467
  break;
4470
4468
  }
@@ -4477,7 +4475,7 @@ async function getAuthProvider(config) {
4477
4475
  // Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
4478
4476
  // to point at a specific wallet or set chainId/domain.
4479
4477
  const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
4480
- const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-DWnpa6Yx.mjs');
4478
+ const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-CA9ENSN4.mjs');
4481
4479
  currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
4482
4480
  break;
4483
4481
  }
@@ -4505,7 +4503,7 @@ async function getAuthProvider(config) {
4505
4503
  break;
4506
4504
  case "guest":
4507
4505
  // Anonymous auth: a device-local ed25519 keypair signs the challenge.
4508
- currentAuthProvider = new (await import('./guest-auth-provider-Xir8zyfZ.mjs')).GuestAuthProvider();
4506
+ currentAuthProvider = new (await import('./guest-auth-provider-1GGM1eWA.mjs')).GuestAuthProvider();
4509
4507
  break;
4510
4508
  }
4511
4509
  if (!currentAuthProvider) {
@@ -4561,7 +4559,7 @@ async function signInAnonymously() {
4561
4559
  // Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
4562
4560
  // the main bundle for data-only apps. Specifier is a static string literal
4563
4561
  // so bundle-splitting can see it.
4564
- const provider = new (await import('./guest-auth-provider-Xir8zyfZ.mjs')).GuestAuthProvider();
4562
+ const provider = new (await import('./guest-auth-provider-1GGM1eWA.mjs')).GuestAuthProvider();
4565
4563
  setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
4566
4564
  const commit = (user) => {
4567
4565
  // No await/interleaving inside this block: provider/method/config/marker
@@ -4804,7 +4802,12 @@ async function logout$1(options) {
4804
4802
  // Hosted sessions ('email' covers the whole hosted surface: email OTP +
4805
4803
  // social + the OIDC redirect/popup flows) are the ones with an issuer
4806
4804
  // cookie; wallet and guest sessions have nothing hosted to end.
4807
- const wasHosted = (currentAuthMethod !== null && currentAuthMethod !== void 0 ? currentAuthMethod : getStoredAuthMethod()) === 'email';
4805
+ // Check the STORED marker as well as the in-memory method: the hosted
4806
+ // OIDC flows (loginWithPopup / completeLoginFromRedirect) write the
4807
+ // 'email' marker via exchangeCode() but never touch currentAuthMethod,
4808
+ // which stays 'guest'/explicit even after a hosted upgrade. Worst case of
4809
+ // a false positive is a harmless idempotent issuer bounce.
4810
+ const wasHosted = currentAuthMethod === 'email' || getStoredAuthMethod() === 'email';
4808
4811
  await currentAuthProvider.logout();
4809
4812
  setStoredAuthMethod(null);
4810
4813
  currentAuthProvider = null;
@@ -5278,6 +5281,31 @@ async function decideGate(appId, runId, gateId, options) {
5278
5281
  const { intentKey: _intentKey, idempotencyKey: _suppliedKey } = options, decision = __rest(options, ["intentKey", "idempotencyKey"]);
5279
5282
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/decision`, { method: 'POST', body: Object.assign(Object.assign({}, decision), { idempotencyKey }) });
5280
5283
  }
5284
+ async function refreshReviewCapability(appId, runId, gateId, options) {
5285
+ const idempotencyKey = actionIdempotencyKey(options, 'refreshReviewCapability()');
5286
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability/refresh`, {
5287
+ method: 'POST',
5288
+ body: {
5289
+ expectedGeneration: options.expectedGeneration,
5290
+ expectedExpiresAtMs: options.expectedExpiresAtMs,
5291
+ expectedRecoveryUntilMs: options.expectedRecoveryUntilMs,
5292
+ expectedAudience: options.expectedAudience,
5293
+ expectedReviewerBindingHash: options.expectedReviewerBindingHash,
5294
+ idempotencyKey,
5295
+ },
5296
+ });
5297
+ }
5298
+ /**
5299
+ * Read one exact delegated-review capability and its narrow lifecycle result.
5300
+ * This does not refresh or extend the window and exposes no generic run-view
5301
+ * authority.
5302
+ */
5303
+ async function getReviewCapability(appId, runId, gateId, options) {
5304
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability`, {
5305
+ method: 'POST',
5306
+ body: { expectedPreviewUrl: options.expectedPreviewUrl },
5307
+ });
5308
+ }
5281
5309
  async function topup(appId, runId, options) {
5282
5310
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/topup`, { method: 'POST', body: options });
5283
5311
  }
@@ -5323,6 +5351,9 @@ const FAILURE_REASONS = [
5323
5351
  'bind_failed',
5324
5352
  'internal_error',
5325
5353
  ];
5354
+ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
5355
+ const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
5356
+ const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
5326
5357
 
5327
5358
  const NORMAL_POLL_MS = 2000;
5328
5359
  const PARKED_POLL_MS = 5000;
@@ -5559,22 +5590,25 @@ function useBuildRun(appId, runId, options) {
5559
5590
  }
5560
5591
 
5561
5592
  /**
5562
- * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
5563
- * dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
5593
+ * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost), with
5594
+ * one exact Drafted exception for delegated review/decision routes. Other
5595
+ * generated-app origins remain blocked; server-side callers are unaffected.
5564
5596
  */
5565
5597
  const builds = {
5566
5598
  submit,
5567
5599
  get,
5600
+ getReviewCapability,
5568
5601
  events,
5569
5602
  cancel,
5570
5603
  decideGate,
5604
+ refreshReviewCapability,
5571
5605
  topup,
5572
5606
  list: list$1,
5573
5607
  watch,
5574
5608
  };
5575
5609
 
5576
5610
  async function create(options = {}) {
5577
- const body = Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {}));
5611
+ const body = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {})), (options.oapp === true ? { oapp: true } : {}));
5578
5612
  const app = await requestDevApi('/apps/new', {
5579
5613
  method: 'POST',
5580
5614
  body,
@@ -5840,7 +5874,7 @@ class PrivyExpoProvider {
5840
5874
  };
5841
5875
  }
5842
5876
  // Sign and submit
5843
- const { signature, txInfo } = await this.signAndSubmitInternal(tx, wallet, rpcUrl, connection);
5877
+ const { signature, txInfo } = await this.signAndSubmitInternal(tx, wallet, connection);
5844
5878
  return {
5845
5879
  transactionSignature: signature,
5846
5880
  blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
@@ -5920,7 +5954,7 @@ class PrivyExpoProvider {
5920
5954
  const { blockhash } = await connection.getLatestBlockhash('confirmed');
5921
5955
  versionedTx.message.recentBlockhash = blockhash;
5922
5956
  }
5923
- const { signature } = await this.signAndSubmitInternal(transaction, wallet, rpcUrl, connection);
5957
+ const { signature } = await this.signAndSubmitInternal(transaction, wallet, connection);
5924
5958
  return signature;
5925
5959
  }
5926
5960
  async restoreSession() {
@@ -5972,22 +6006,10 @@ class PrivyExpoProvider {
5972
6006
  }
5973
6007
  return wallet;
5974
6008
  }
5975
- async signAndSubmitInternal(transaction, wallet, rpcUrl, connection) {
5976
- let signature;
5977
- if (rpcUrl.includes('surfpool') || rpcUrl === SURFNET_RPC_URL) {
5978
- // Surfnet: sign locally, then submit raw
5979
- const signed = await wallet.signTransaction(transaction);
5980
- const txSig = await connection.sendRawTransaction(signed.signedTransaction, {
5981
- skipPreflight: true,
5982
- maxRetries: 3,
5983
- });
5984
- signature = txSig;
5985
- }
5986
- else {
5987
- // Non-Surfnet: use Privy's combined sign+send
5988
- const result = await wallet.signAndSendTransaction(transaction, connection);
5989
- signature = result.signature;
5990
- }
6009
+ async signAndSubmitInternal(transaction, wallet, connection) {
6010
+ // Use Privy's combined sign+send
6011
+ const result = await wallet.signAndSendTransaction(transaction, connection);
6012
+ const signature = result.signature;
5991
6013
  const txInfo = await confirmAndCheckTransaction(connection, signature);
5992
6014
  return { signature, txInfo };
5993
6015
  }
@@ -6020,5 +6042,5 @@ class PrivyExpoProvider {
6020
6042
  }
6021
6043
  }
6022
6044
 
6023
- export { useAuth as A, useBuildRun as B, apps as C, deserializeTransaction as D, EMBEDDED_WALLET_UNSUPPORTED as E, getIdToken as F, setPlatform as G, builds as H, BuildsApiError as I, PARK_REASONS as J, FAILURE_REASONS as K, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, RUN_STATES as R, SURFNET_RPC_URL as S, TERMINAL_STATES as T, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, bufferExports as d, embeddedRunEvmTransaction as e, bs58 as f, getPlatform as g, hasEmbeddedWallet as h, confirmAndCheckTransaction as i, init as j, getCurrentUser as k, onAuthLoadingChanged as l, getAuthLoading as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, login as p, logout as q, resolveSolanaRpcUrl as r, setCurrentUser as s, getAuthProvider as t, signInAnonymously as u, loginWithPrivy as v, loginWithRedirect as w, completeLoginFromRedirect as x, loginWithPopup as y, completeLoginInPopup as z };
6024
- //# sourceMappingURL=index.native-B29WKXlr.mjs.map
6045
+ export { useAuth as A, useBuildRun as B, apps as C, deserializeTransaction as D, EMBEDDED_WALLET_UNSUPPORTED as E, getIdToken as F, setPlatform as G, builds as H, BuildsApiError as I, PARK_REASONS as J, FAILURE_REASONS as K, BUILD_REVIEW_CAPABILITY_SCHEMA as L, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as Q, RUN_STATES as R, TERMINAL_STATES as T, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, bufferExports as d, embeddedRunEvmTransaction as e, bs58 as f, getPlatform as g, hasEmbeddedWallet as h, confirmAndCheckTransaction as i, init as j, getCurrentUser as k, onAuthLoadingChanged as l, getAuthLoading as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, login as p, logout as q, resolveSolanaRpcUrl as r, setCurrentUser as s, getAuthProvider as t, signInAnonymously as u, loginWithPrivy as v, loginWithRedirect as w, completeLoginFromRedirect as x, loginWithPopup as y, completeLoginInPopup as z };
6046
+ //# sourceMappingURL=index.native-BoKkzObx.mjs.map