@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-CdbhqElf.mjs')).EmailAuthProvider();
4446
+ currentAuthProvider = new (await import('./email-auth-provider-CRFJd5Rp.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-DqBpuASt.mjs');
4465
+ const { InjectedWalletProvider } = await import('./injected-wallet-provider-uF4yZt8l.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-DkyIMRce.mjs');
4478
+ const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-Bsh00akg.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-Dgmr7e0Z.mjs')).GuestAuthProvider();
4506
+ currentAuthProvider = new (await import('./guest-auth-provider-BLzLLs7u.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-Dgmr7e0Z.mjs')).GuestAuthProvider();
4562
+ const provider = new (await import('./guest-auth-provider-BLzLLs7u.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;
@@ -5344,6 +5347,31 @@ async function decideGate(appId, runId, gateId, options) {
5344
5347
  const { intentKey: _intentKey, idempotencyKey: _suppliedKey } = options, decision = __rest(options, ["intentKey", "idempotencyKey"]);
5345
5348
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/decision`, { method: 'POST', body: Object.assign(Object.assign({}, decision), { idempotencyKey }) });
5346
5349
  }
5350
+ async function refreshReviewCapability(appId, runId, gateId, options) {
5351
+ const idempotencyKey = actionIdempotencyKey(options, 'refreshReviewCapability()');
5352
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability/refresh`, {
5353
+ method: 'POST',
5354
+ body: {
5355
+ expectedGeneration: options.expectedGeneration,
5356
+ expectedExpiresAtMs: options.expectedExpiresAtMs,
5357
+ expectedRecoveryUntilMs: options.expectedRecoveryUntilMs,
5358
+ expectedAudience: options.expectedAudience,
5359
+ expectedReviewerBindingHash: options.expectedReviewerBindingHash,
5360
+ idempotencyKey,
5361
+ },
5362
+ });
5363
+ }
5364
+ /**
5365
+ * Read one exact delegated-review capability and its narrow lifecycle result.
5366
+ * This does not refresh or extend the window and exposes no generic run-view
5367
+ * authority.
5368
+ */
5369
+ async function getReviewCapability(appId, runId, gateId, options) {
5370
+ return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/review-capability`, {
5371
+ method: 'POST',
5372
+ body: { expectedPreviewUrl: options.expectedPreviewUrl },
5373
+ });
5374
+ }
5347
5375
  async function topup(appId, runId, options) {
5348
5376
  return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/topup`, { method: 'POST', body: options });
5349
5377
  }
@@ -5389,6 +5417,9 @@ const FAILURE_REASONS = [
5389
5417
  'bind_failed',
5390
5418
  'internal_error',
5391
5419
  ];
5420
+ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
5421
+ const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
5422
+ const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
5392
5423
 
5393
5424
  const NORMAL_POLL_MS = 2000;
5394
5425
  const PARKED_POLL_MS = 5000;
@@ -5625,22 +5656,25 @@ function useBuildRun(appId, runId, options) {
5625
5656
  }
5626
5657
 
5627
5658
  /**
5628
- * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
5629
- * dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
5659
+ * Platform first-party surfaces only (bounded.sh, oapps.fun, localhost), with
5660
+ * one exact Drafted exception for delegated review/decision routes. Other
5661
+ * generated-app origins remain blocked; server-side callers are unaffected.
5630
5662
  */
5631
5663
  const builds = {
5632
5664
  submit,
5633
5665
  get,
5666
+ getReviewCapability,
5634
5667
  events,
5635
5668
  cancel,
5636
5669
  decideGate,
5670
+ refreshReviewCapability,
5637
5671
  topup,
5638
5672
  list: list$1,
5639
5673
  watch,
5640
5674
  };
5641
5675
 
5642
5676
  async function create(options = {}) {
5643
- 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 } : {}));
5677
+ 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 } : {}));
5644
5678
  const app = await requestDevApi('/apps/new', {
5645
5679
  method: 'POST',
5646
5680
  body,
@@ -5906,7 +5940,7 @@ class PrivyExpoProvider {
5906
5940
  };
5907
5941
  }
5908
5942
  // Sign and submit
5909
- const { signature, txInfo } = await this.signAndSubmitInternal(tx, wallet, rpcUrl, connection);
5943
+ const { signature, txInfo } = await this.signAndSubmitInternal(tx, wallet, connection);
5910
5944
  return {
5911
5945
  transactionSignature: signature,
5912
5946
  blockNumber: (txInfo === null || txInfo === void 0 ? void 0 : txInfo.slot) || 0,
@@ -5986,7 +6020,7 @@ class PrivyExpoProvider {
5986
6020
  const { blockhash } = await connection.getLatestBlockhash('confirmed');
5987
6021
  versionedTx.message.recentBlockhash = blockhash;
5988
6022
  }
5989
- const { signature } = await this.signAndSubmitInternal(transaction, wallet, rpcUrl, connection);
6023
+ const { signature } = await this.signAndSubmitInternal(transaction, wallet, connection);
5990
6024
  return signature;
5991
6025
  }
5992
6026
  async restoreSession() {
@@ -6038,22 +6072,10 @@ class PrivyExpoProvider {
6038
6072
  }
6039
6073
  return wallet;
6040
6074
  }
6041
- async signAndSubmitInternal(transaction, wallet, rpcUrl, connection) {
6042
- let signature;
6043
- if (rpcUrl.includes('surfpool') || rpcUrl === SURFNET_RPC_URL) {
6044
- // Surfnet: sign locally, then submit raw
6045
- const signed = await wallet.signTransaction(transaction);
6046
- const txSig = await connection.sendRawTransaction(signed.signedTransaction, {
6047
- skipPreflight: true,
6048
- maxRetries: 3,
6049
- });
6050
- signature = txSig;
6051
- }
6052
- else {
6053
- // Non-Surfnet: use Privy's combined sign+send
6054
- const result = await wallet.signAndSendTransaction(transaction, connection);
6055
- signature = result.signature;
6056
- }
6075
+ async signAndSubmitInternal(transaction, wallet, connection) {
6076
+ // Use Privy's combined sign+send
6077
+ const result = await wallet.signAndSendTransaction(transaction, connection);
6078
+ const signature = result.signature;
6057
6079
  const txInfo = await confirmAndCheckTransaction(connection, signature);
6058
6080
  return { signature, txInfo };
6059
6081
  }
@@ -6171,5 +6193,5 @@ function defaultInjectedEvmProvider() {
6171
6193
  return null;
6172
6194
  }
6173
6195
 
6174
- export { loginWithPopup as A, completeLoginInPopup as B, useAuth as C, useQuery as D, EMBEDDED_WALLET_UNSUPPORTED as E, useBuildRun as F, apps as G, deserializeTransaction as H, getIdToken as I, setPlatform as J, requestEip6963Providers as K, builds as L, BuildsApiError as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, PARK_REASONS as Q, RUN_STATES as R, SURFNET_RPC_URL as S, TERMINAL_STATES as T, FAILURE_REASONS as U, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, defaultInjectedProvider as d, embeddedRunEvmTransaction as e, bufferExports as f, getPlatform as g, hasEmbeddedWallet as h, bs58 as i, confirmAndCheckTransaction as j, defaultInjectedEvmProvider as k, init as l, getCurrentUser as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, onAuthLoadingChanged as p, getAuthLoading as q, resolveSolanaRpcUrl as r, setCurrentUser as s, login as t, logout as u, getAuthProvider as v, signInAnonymously as w, loginWithPrivy as x, loginWithRedirect as y, completeLoginFromRedirect as z };
6175
- //# sourceMappingURL=index-Cy0IRs6U.mjs.map
6196
+ export { loginWithPopup as A, completeLoginInPopup as B, useAuth as C, useQuery as D, EMBEDDED_WALLET_UNSUPPORTED as E, useBuildRun as F, apps as G, deserializeTransaction as H, getIdToken as I, setPlatform as J, requestEip6963Providers as K, builds as L, BuildsApiError as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, PARK_REASONS as Q, RUN_STATES as R, FAILURE_REASONS as S, TERMINAL_STATES as T, BUILD_REVIEW_CAPABILITY_SCHEMA as U, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as V, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as W, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, defaultInjectedProvider as d, embeddedRunEvmTransaction as e, bufferExports as f, getPlatform as g, hasEmbeddedWallet as h, bs58 as i, confirmAndCheckTransaction as j, defaultInjectedEvmProvider as k, init as l, getCurrentUser as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, onAuthLoadingChanged as p, getAuthLoading as q, resolveSolanaRpcUrl as r, setCurrentUser as s, login as t, logout as u, getAuthProvider as v, signInAnonymously as w, loginWithPrivy as x, loginWithRedirect as y, completeLoginFromRedirect as z };
6197
+ //# sourceMappingURL=index-Co7IqxVo.mjs.map