@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
package/dist/index.mjs CHANGED
@@ -10154,24 +10154,19 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
10154
10154
  /* ------------------------------------------------------------------ */
10155
10155
  /* ENV helpers */
10156
10156
  /* ------------------------------------------------------------------ */
10157
- // Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI); legacy
10158
- // `BOUNDED_SOLANA_KEYPAIR` still honored. Only consulted when no explicit
10159
- // keypair was provided (createWalletClient passes one).
10160
- const ENV_KEYPAIRS = ["BOUNDED_PRIVATE_KEY", "BOUNDED_SOLANA_KEYPAIR"];
10157
+ // Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI). Only consulted when no
10158
+ // explicit keypair was provided (createWalletClient passes one).
10159
+ const ENV_KEYPAIR = "BOUNDED_PRIVATE_KEY";
10160
+ const LEGACY_ENV_KEYPAIR = "BOUNDED_SOLANA_KEYPAIR";
10161
10161
  function loadKeypairFromEnv() {
10162
- let secret;
10163
- let found;
10164
- for (const name of ENV_KEYPAIRS) {
10165
- const v = process.env[name];
10166
- if (v) {
10167
- secret = v;
10168
- found = name;
10169
- break;
10170
- }
10162
+ if (process.env[LEGACY_ENV_KEYPAIR]) {
10163
+ throw new Error(`${LEGACY_ENV_KEYPAIR} is no longer supported. Set ${ENV_KEYPAIR} instead, ` +
10164
+ `or pass an explicit keypair via createWalletClient({ keypair }).`);
10171
10165
  }
10166
+ const secret = process.env[ENV_KEYPAIR];
10172
10167
  if (!secret) {
10173
10168
  throw new Error(`No server keypair for this top-level call. The top-level get/set/subscribe/etc. use an ` +
10174
- `AMBIENT session — set ${ENV_KEYPAIRS[0]} to a base-58 secret key (or JSON array) to provide one. ` +
10169
+ `AMBIENT session — set ${ENV_KEYPAIR} to a base-58 secret key (or JSON array) to provide one. ` +
10175
10170
  `If you already created a wallet with createWalletClient({ keypair }), call ITS methods instead ` +
10176
10171
  `(client.subscribe / client.set / client.get): that client is self-contained and deliberately does ` +
10177
10172
  `not set the ambient session, so the top-level functions can't see it.`);
@@ -10183,7 +10178,7 @@ function loadKeypairFromEnv() {
10183
10178
  return Keypair.fromSecretKey(secretKey);
10184
10179
  }
10185
10180
  catch (err) {
10186
- throw new Error(`Unable to parse ${found}. Ensure it is valid base-58 or JSON.`);
10181
+ throw new Error(`Unable to parse ${ENV_KEYPAIR}. Ensure it is valid base-58 or JSON.`);
10187
10182
  }
10188
10183
  }
10189
10184
  /* ------------------------------------------------------------------ */
@@ -10250,7 +10245,7 @@ class ServerSessionManager {
10250
10245
  this.session = session;
10251
10246
  }
10252
10247
  /* ---------------------------------------------- *
10253
- * CLEAR (e.g. after logout or 401 retry)
10248
+ * CLEAR (e.g. after explicit logout)
10254
10249
  * ---------------------------------------------- */
10255
10250
  clearSession() {
10256
10251
  this.session = null;
@@ -10274,11 +10269,6 @@ class ServerSessionManager {
10274
10269
  /* The default singleton instance (reads keypair from env) */
10275
10270
  ServerSessionManager.instance = new ServerSessionManager();
10276
10271
 
10277
- var serverSessionManager = /*#__PURE__*/Object.freeze({
10278
- __proto__: null,
10279
- ServerSessionManager: ServerSessionManager
10280
- });
10281
-
10282
10272
  /**
10283
10273
  * Safe base64 helpers for bounded-core.
10284
10274
  *
@@ -10503,13 +10493,6 @@ async function refreshAuthSessionOnce(appId, isServer) {
10503
10493
  async function makeApiRequest(method, urlPath, data, _overrides) {
10504
10494
  var _a, _b, _c, _d, _e, _f, _g, _h;
10505
10495
  const config = await getConfig();
10506
- let hasRetriedAfterServerSessionReset = false;
10507
- const clearServerSession = async () => {
10508
- if (!config.isServer)
10509
- return;
10510
- const { ServerSessionManager } = await Promise.resolve().then(function () { return serverSessionManager; });
10511
- ServerSessionManager.instance.clearSession();
10512
- };
10513
10496
  async function executeRequest() {
10514
10497
  var _a;
10515
10498
  // When _getAuthHeaders is provided (wallet client), use it as the sole auth source.
@@ -10559,13 +10542,7 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
10559
10542
  }
10560
10543
  return await executeRequest();
10561
10544
  }
10562
- catch (_refreshError) {
10563
- // Server-side fallback: clear global session and retry once
10564
- if (config.isServer && !hasRetriedAfterServerSessionReset) {
10565
- hasRetriedAfterServerSessionReset = true;
10566
- await clearServerSession();
10567
- return await executeRequest();
10568
- }
10545
+ catch (_j) {
10569
10546
  throw error;
10570
10547
  }
10571
10548
  }