@bounded-sh/client 0.0.14 → 0.0.15

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 (25) hide show
  1. package/dist/index.js +12 -35
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +12 -35
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/{index.native-B4qib0WI.mjs → index.native-CAygEkU7.mjs} +16 -39
  6. package/dist/index.native-CAygEkU7.mjs.map +1 -0
  7. package/dist/{index.native-fDOSSF3W.js → index.native-zD2ZzCLO.js} +16 -39
  8. package/dist/index.native-zD2ZzCLO.js.map +1 -0
  9. package/dist/index.native.js +1 -1
  10. package/dist/index.native.mjs +1 -1
  11. package/dist/{phantom-wallet-provider-DGvW6ecv.mjs → phantom-wallet-provider-DU4WPFPM.mjs} +2 -2
  12. package/dist/{phantom-wallet-provider-DGvW6ecv.mjs.map → phantom-wallet-provider-DU4WPFPM.mjs.map} +1 -1
  13. package/dist/{phantom-wallet-provider-B4iCTaUq.js → phantom-wallet-provider-MW2H0SFY.js} +2 -2
  14. package/dist/{phantom-wallet-provider-B4iCTaUq.js.map → phantom-wallet-provider-MW2H0SFY.js.map} +1 -1
  15. package/dist/{privy-wallet-provider-CpA0SzjA.mjs → privy-wallet-provider-D5Kdp3Qp.mjs} +3 -3
  16. package/dist/{privy-wallet-provider-CpA0SzjA.mjs.map → privy-wallet-provider-D5Kdp3Qp.mjs.map} +1 -1
  17. package/dist/{privy-wallet-provider-B3FEM7RO.js → privy-wallet-provider-dFxuvDf4.js} +3 -3
  18. package/dist/{privy-wallet-provider-B3FEM7RO.js.map → privy-wallet-provider-dFxuvDf4.js.map} +1 -1
  19. package/dist/{solana-mobile-wallet-provider-B-Ue0EG9.mjs → solana-mobile-wallet-provider-CLiflgPj.mjs} +2 -2
  20. package/dist/{solana-mobile-wallet-provider-B-Ue0EG9.mjs.map → solana-mobile-wallet-provider-CLiflgPj.mjs.map} +1 -1
  21. package/dist/{solana-mobile-wallet-provider-CWidNUHT.js → solana-mobile-wallet-provider-DAR0BLTQ.js} +2 -2
  22. package/dist/{solana-mobile-wallet-provider-CWidNUHT.js.map → solana-mobile-wallet-provider-DAR0BLTQ.js.map} +1 -1
  23. package/package.json +2 -2
  24. package/dist/index.native-B4qib0WI.mjs.map +0 -1
  25. package/dist/index.native-fDOSSF3W.js.map +0 -1
@@ -10174,24 +10174,19 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
10174
10174
  /* ------------------------------------------------------------------ */
10175
10175
  /* ENV helpers */
10176
10176
  /* ------------------------------------------------------------------ */
10177
- // Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI); legacy
10178
- // `BOUNDED_SOLANA_KEYPAIR` still honored. Only consulted when no explicit
10179
- // keypair was provided (createWalletClient passes one).
10180
- const ENV_KEYPAIRS = ["BOUNDED_PRIVATE_KEY", "BOUNDED_SOLANA_KEYPAIR"];
10177
+ // Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI). Only consulted when no
10178
+ // explicit keypair was provided (createWalletClient passes one).
10179
+ const ENV_KEYPAIR = "BOUNDED_PRIVATE_KEY";
10180
+ const LEGACY_ENV_KEYPAIR = "BOUNDED_SOLANA_KEYPAIR";
10181
10181
  function loadKeypairFromEnv() {
10182
- let secret;
10183
- let found;
10184
- for (const name of ENV_KEYPAIRS) {
10185
- const v = process.env[name];
10186
- if (v) {
10187
- secret = v;
10188
- found = name;
10189
- break;
10190
- }
10182
+ if (process.env[LEGACY_ENV_KEYPAIR]) {
10183
+ throw new Error(`${LEGACY_ENV_KEYPAIR} is no longer supported. Set ${ENV_KEYPAIR} instead, ` +
10184
+ `or pass an explicit keypair via createWalletClient({ keypair }).`);
10191
10185
  }
10186
+ const secret = process.env[ENV_KEYPAIR];
10192
10187
  if (!secret) {
10193
10188
  throw new Error(`No server keypair for this top-level call. The top-level get/set/subscribe/etc. use an ` +
10194
- `AMBIENT session — set ${ENV_KEYPAIRS[0]} to a base-58 secret key (or JSON array) to provide one. ` +
10189
+ `AMBIENT session — set ${ENV_KEYPAIR} to a base-58 secret key (or JSON array) to provide one. ` +
10195
10190
  `If you already created a wallet with createWalletClient({ keypair }), call ITS methods instead ` +
10196
10191
  `(client.subscribe / client.set / client.get): that client is self-contained and deliberately does ` +
10197
10192
  `not set the ambient session, so the top-level functions can't see it.`);
@@ -10203,7 +10198,7 @@ function loadKeypairFromEnv() {
10203
10198
  return web3_js.Keypair.fromSecretKey(secretKey);
10204
10199
  }
10205
10200
  catch (err) {
10206
- throw new Error(`Unable to parse ${found}. Ensure it is valid base-58 or JSON.`);
10201
+ throw new Error(`Unable to parse ${ENV_KEYPAIR}. Ensure it is valid base-58 or JSON.`);
10207
10202
  }
10208
10203
  }
10209
10204
  /* ------------------------------------------------------------------ */
@@ -10270,7 +10265,7 @@ class ServerSessionManager {
10270
10265
  this.session = session;
10271
10266
  }
10272
10267
  /* ---------------------------------------------- *
10273
- * CLEAR (e.g. after logout or 401 retry)
10268
+ * CLEAR (e.g. after explicit logout)
10274
10269
  * ---------------------------------------------- */
10275
10270
  clearSession() {
10276
10271
  this.session = null;
@@ -10294,11 +10289,6 @@ class ServerSessionManager {
10294
10289
  /* The default singleton instance (reads keypair from env) */
10295
10290
  ServerSessionManager.instance = new ServerSessionManager();
10296
10291
 
10297
- var serverSessionManager = /*#__PURE__*/Object.freeze({
10298
- __proto__: null,
10299
- ServerSessionManager: ServerSessionManager
10300
- });
10301
-
10302
10292
  /**
10303
10293
  * Safe base64 helpers for bounded-core.
10304
10294
  *
@@ -10523,13 +10513,6 @@ async function refreshAuthSessionOnce(appId, isServer) {
10523
10513
  async function makeApiRequest(method, urlPath, data, _overrides) {
10524
10514
  var _a, _b, _c, _d, _e, _f, _g, _h;
10525
10515
  const config = await getConfig();
10526
- let hasRetriedAfterServerSessionReset = false;
10527
- const clearServerSession = async () => {
10528
- if (!config.isServer)
10529
- return;
10530
- const { ServerSessionManager } = await Promise.resolve().then(function () { return serverSessionManager; });
10531
- ServerSessionManager.instance.clearSession();
10532
- };
10533
10516
  async function executeRequest() {
10534
10517
  var _a;
10535
10518
  // When _getAuthHeaders is provided (wallet client), use it as the sole auth source.
@@ -10579,13 +10562,7 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
10579
10562
  }
10580
10563
  return await executeRequest();
10581
10564
  }
10582
- catch (_refreshError) {
10583
- // Server-side fallback: clear global session and retry once
10584
- if (config.isServer && !hasRetriedAfterServerSessionReset) {
10585
- hasRetriedAfterServerSessionReset = true;
10586
- await clearServerSession();
10587
- return await executeRequest();
10588
- }
10565
+ catch (_j) {
10589
10566
  throw error;
10590
10567
  }
10591
10568
  }
@@ -19040,17 +19017,17 @@ function clearIncompatibleSession() {
19040
19017
  // Lazy loaders for web-only providers.
19041
19018
  // Using dynamic import() ensures Metro (RN) never resolves these modules.
19042
19019
  async function loadPhantomWalletProvider() {
19043
- const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-B4iCTaUq.js'); });
19020
+ const mod = await Promise.resolve().then(function () { return require('./phantom-wallet-provider-MW2H0SFY.js'); });
19044
19021
  return { PhantomWalletProvider: mod.PhantomWalletProvider };
19045
19022
  }
19046
19023
  // Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
19047
19024
  // never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
19048
19025
  async function loadPrivyWalletProvider() {
19049
- const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-B3FEM7RO.js'); });
19026
+ const mod = await Promise.resolve().then(function () { return require('./privy-wallet-provider-dFxuvDf4.js'); });
19050
19027
  return mod.PrivyWalletProvider;
19051
19028
  }
19052
19029
  async function loadSolanaMobileWalletProvider() {
19053
- const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-CWidNUHT.js'); });
19030
+ const mod = await Promise.resolve().then(function () { return require('./solana-mobile-wallet-provider-DAR0BLTQ.js'); });
19054
19031
  return mod.SolanaMobileWalletProvider;
19055
19032
  }
19056
19033
  async function hotSwapToMWAProvider(config) {
@@ -20157,4 +20134,4 @@ exports.wsGet = wsGet;
20157
20134
  exports.wsGetMany = wsGetMany;
20158
20135
  exports.wsQuery = wsQuery;
20159
20136
  exports.wsSet = wsSet;
20160
- //# sourceMappingURL=index.native-fDOSSF3W.js.map
20137
+ //# sourceMappingURL=index.native-zD2ZzCLO.js.map