@bounded-sh/client 0.0.14 → 0.0.16
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.
- package/dist/index.js +12 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -35
- package/dist/index.mjs.map +1 -1
- package/dist/{index.native-B4qib0WI.mjs → index.native-CAygEkU7.mjs} +16 -39
- package/dist/index.native-CAygEkU7.mjs.map +1 -0
- package/dist/{index.native-fDOSSF3W.js → index.native-zD2ZzCLO.js} +16 -39
- package/dist/index.native-zD2ZzCLO.js.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{phantom-wallet-provider-DGvW6ecv.mjs → phantom-wallet-provider-DU4WPFPM.mjs} +2 -2
- package/dist/{phantom-wallet-provider-DGvW6ecv.mjs.map → phantom-wallet-provider-DU4WPFPM.mjs.map} +1 -1
- package/dist/{phantom-wallet-provider-B4iCTaUq.js → phantom-wallet-provider-MW2H0SFY.js} +2 -2
- package/dist/{phantom-wallet-provider-B4iCTaUq.js.map → phantom-wallet-provider-MW2H0SFY.js.map} +1 -1
- package/dist/{privy-wallet-provider-CpA0SzjA.mjs → privy-wallet-provider-D5Kdp3Qp.mjs} +3 -3
- package/dist/{privy-wallet-provider-CpA0SzjA.mjs.map → privy-wallet-provider-D5Kdp3Qp.mjs.map} +1 -1
- package/dist/{privy-wallet-provider-B3FEM7RO.js → privy-wallet-provider-dFxuvDf4.js} +3 -3
- package/dist/{privy-wallet-provider-B3FEM7RO.js.map → privy-wallet-provider-dFxuvDf4.js.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-B-Ue0EG9.mjs → solana-mobile-wallet-provider-CLiflgPj.mjs} +2 -2
- package/dist/{solana-mobile-wallet-provider-B-Ue0EG9.mjs.map → solana-mobile-wallet-provider-CLiflgPj.mjs.map} +1 -1
- package/dist/{solana-mobile-wallet-provider-CWidNUHT.js → solana-mobile-wallet-provider-DAR0BLTQ.js} +2 -2
- package/dist/{solana-mobile-wallet-provider-CWidNUHT.js.map → solana-mobile-wallet-provider-DAR0BLTQ.js.map} +1 -1
- package/package.json +11 -11
- package/dist/index.native-B4qib0WI.mjs.map +0 -1
- package/dist/index.native-fDOSSF3W.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -10176,24 +10176,19 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
10176
10176
|
/* ------------------------------------------------------------------ */
|
|
10177
10177
|
/* ENV helpers */
|
|
10178
10178
|
/* ------------------------------------------------------------------ */
|
|
10179
|
-
// Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI)
|
|
10180
|
-
//
|
|
10181
|
-
|
|
10182
|
-
const
|
|
10179
|
+
// Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI). Only consulted when no
|
|
10180
|
+
// explicit keypair was provided (createWalletClient passes one).
|
|
10181
|
+
const ENV_KEYPAIR = "BOUNDED_PRIVATE_KEY";
|
|
10182
|
+
const LEGACY_ENV_KEYPAIR = "BOUNDED_SOLANA_KEYPAIR";
|
|
10183
10183
|
function loadKeypairFromEnv() {
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
const v = process.env[name];
|
|
10188
|
-
if (v) {
|
|
10189
|
-
secret = v;
|
|
10190
|
-
found = name;
|
|
10191
|
-
break;
|
|
10192
|
-
}
|
|
10184
|
+
if (process.env[LEGACY_ENV_KEYPAIR]) {
|
|
10185
|
+
throw new Error(`${LEGACY_ENV_KEYPAIR} is no longer supported. Set ${ENV_KEYPAIR} instead, ` +
|
|
10186
|
+
`or pass an explicit keypair via createWalletClient({ keypair }).`);
|
|
10193
10187
|
}
|
|
10188
|
+
const secret = process.env[ENV_KEYPAIR];
|
|
10194
10189
|
if (!secret) {
|
|
10195
10190
|
throw new Error(`No server keypair for this top-level call. The top-level get/set/subscribe/etc. use an ` +
|
|
10196
|
-
`AMBIENT session — set ${
|
|
10191
|
+
`AMBIENT session — set ${ENV_KEYPAIR} to a base-58 secret key (or JSON array) to provide one. ` +
|
|
10197
10192
|
`If you already created a wallet with createWalletClient({ keypair }), call ITS methods instead ` +
|
|
10198
10193
|
`(client.subscribe / client.set / client.get): that client is self-contained and deliberately does ` +
|
|
10199
10194
|
`not set the ambient session, so the top-level functions can't see it.`);
|
|
@@ -10205,7 +10200,7 @@ function loadKeypairFromEnv() {
|
|
|
10205
10200
|
return web3_js.Keypair.fromSecretKey(secretKey);
|
|
10206
10201
|
}
|
|
10207
10202
|
catch (err) {
|
|
10208
|
-
throw new Error(`Unable to parse ${
|
|
10203
|
+
throw new Error(`Unable to parse ${ENV_KEYPAIR}. Ensure it is valid base-58 or JSON.`);
|
|
10209
10204
|
}
|
|
10210
10205
|
}
|
|
10211
10206
|
/* ------------------------------------------------------------------ */
|
|
@@ -10272,7 +10267,7 @@ class ServerSessionManager {
|
|
|
10272
10267
|
this.session = session;
|
|
10273
10268
|
}
|
|
10274
10269
|
/* ---------------------------------------------- *
|
|
10275
|
-
* CLEAR (e.g. after logout
|
|
10270
|
+
* CLEAR (e.g. after explicit logout)
|
|
10276
10271
|
* ---------------------------------------------- */
|
|
10277
10272
|
clearSession() {
|
|
10278
10273
|
this.session = null;
|
|
@@ -10296,11 +10291,6 @@ class ServerSessionManager {
|
|
|
10296
10291
|
/* The default singleton instance (reads keypair from env) */
|
|
10297
10292
|
ServerSessionManager.instance = new ServerSessionManager();
|
|
10298
10293
|
|
|
10299
|
-
var serverSessionManager = /*#__PURE__*/Object.freeze({
|
|
10300
|
-
__proto__: null,
|
|
10301
|
-
ServerSessionManager: ServerSessionManager
|
|
10302
|
-
});
|
|
10303
|
-
|
|
10304
10294
|
/**
|
|
10305
10295
|
* Safe base64 helpers for bounded-core.
|
|
10306
10296
|
*
|
|
@@ -10525,13 +10515,6 @@ async function refreshAuthSessionOnce(appId, isServer) {
|
|
|
10525
10515
|
async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
10526
10516
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10527
10517
|
const config = await getConfig();
|
|
10528
|
-
let hasRetriedAfterServerSessionReset = false;
|
|
10529
|
-
const clearServerSession = async () => {
|
|
10530
|
-
if (!config.isServer)
|
|
10531
|
-
return;
|
|
10532
|
-
const { ServerSessionManager } = await Promise.resolve().then(function () { return serverSessionManager; });
|
|
10533
|
-
ServerSessionManager.instance.clearSession();
|
|
10534
|
-
};
|
|
10535
10518
|
async function executeRequest() {
|
|
10536
10519
|
var _a;
|
|
10537
10520
|
// When _getAuthHeaders is provided (wallet client), use it as the sole auth source.
|
|
@@ -10581,13 +10564,7 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
10581
10564
|
}
|
|
10582
10565
|
return await executeRequest();
|
|
10583
10566
|
}
|
|
10584
|
-
catch (
|
|
10585
|
-
// Server-side fallback: clear global session and retry once
|
|
10586
|
-
if (config.isServer && !hasRetriedAfterServerSessionReset) {
|
|
10587
|
-
hasRetriedAfterServerSessionReset = true;
|
|
10588
|
-
await clearServerSession();
|
|
10589
|
-
return await executeRequest();
|
|
10590
|
-
}
|
|
10567
|
+
catch (_j) {
|
|
10591
10568
|
throw error;
|
|
10592
10569
|
}
|
|
10593
10570
|
}
|