@bounded-sh/client 0.0.1 → 0.0.2
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/auth/providers/phantom-wallet-provider.d.ts +1 -1
- package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
- package/dist/auth/providers/solana-mobile-wallet-provider.d.ts +3 -3
- package/dist/{index-BHTfW8CV.esm.js → index-B2ytfYTB.esm.js} +2 -2
- package/dist/{index-BHTfW8CV.esm.js.map → index-B2ytfYTB.esm.js.map} +1 -1
- package/dist/{index-CT2j1oic.esm.js → index-BFOmV3Pb.esm.js} +2 -2
- package/dist/{index-CT2j1oic.esm.js.map → index-BFOmV3Pb.esm.js.map} +1 -1
- package/dist/{index-VGx-869x.js → index-BL-0ZKBl.js} +76 -76
- package/dist/index-BL-0ZKBl.js.map +1 -0
- package/dist/{index-sKqrgk0t.js → index-BgAygrhE.js} +2 -2
- package/dist/{index-sKqrgk0t.js.map → index-BgAygrhE.js.map} +1 -1
- package/dist/{index-C1VOdmRN.js → index-CqoP9udN.js} +2 -2
- package/dist/{index-C1VOdmRN.js.map → index-CqoP9udN.js.map} +1 -1
- package/dist/{index-o5Hv9pfS.esm.js → index-D986s6w7.esm.js} +76 -76
- package/dist/index-D986s6w7.esm.js.map +1 -0
- package/dist/{index.browser-DaNhOhkQ.esm.js → index.browser-Bd0GwRur.esm.js} +2 -2
- package/dist/{index.browser-DaNhOhkQ.esm.js.map → index.browser-Bd0GwRur.esm.js.map} +1 -1
- package/dist/{index.browser-utVKQsEC.js → index.browser-BeM1bzpe.js} +2 -2
- package/dist/{index.browser-utVKQsEC.js.map → index.browser-BeM1bzpe.js.map} +1 -1
- package/dist/{index.browser-DhAcjdpV.esm.js → index.browser-D2xm-q6N.esm.js} +2 -2
- package/dist/{index.browser-DhAcjdpV.esm.js.map → index.browser-D2xm-q6N.esm.js.map} +1 -1
- package/dist/{index.browser-BJZ7fYwv.js → index.browser-D8u31irV.js} +2 -2
- package/dist/{index.browser-BJZ7fYwv.js.map → index.browser-D8u31irV.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{index.native-JPUkdHJj.esm.js → index.native-B-cLm_BI.esm.js} +50 -50
- package/dist/index.native-B-cLm_BI.esm.js.map +1 -0
- package/dist/{index.native-B5IBOdv_.js → index.native-NgHStPq0.js} +50 -50
- package/dist/index.native-NgHStPq0.js.map +1 -0
- package/dist/index.native.d.ts +1 -1
- package/dist/index.native.esm.js +1 -1
- package/dist/index.native.js +1 -1
- package/dist/{phantom-wallet-provider-DMlaSrAl.esm.js → phantom-wallet-provider-Cy5T9EVd.esm.js} +10 -10
- package/dist/phantom-wallet-provider-Cy5T9EVd.esm.js.map +1 -0
- package/dist/{phantom-wallet-provider-CDLyxrih.js → phantom-wallet-provider-Dy48LSdU.js} +10 -10
- package/dist/phantom-wallet-provider-Dy48LSdU.js.map +1 -0
- package/dist/{privy-wallet-provider-nR52lXzI.esm.js → privy-wallet-provider-BDsrUpk4.esm.js} +5 -5
- package/dist/privy-wallet-provider-BDsrUpk4.esm.js.map +1 -0
- package/dist/{privy-wallet-provider-DiHHTDbZ.js → privy-wallet-provider-CiKtBJ5M.js} +5 -5
- package/dist/privy-wallet-provider-CiKtBJ5M.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-B4CeMMQd.esm.js → solana-mobile-wallet-provider-CSk_FIww.esm.js} +20 -20
- package/dist/solana-mobile-wallet-provider-CSk_FIww.esm.js.map +1 -0
- package/dist/{solana-mobile-wallet-provider-BYMfFjZb.js → solana-mobile-wallet-provider-k_YdrTJZ.js} +20 -20
- package/dist/solana-mobile-wallet-provider-k_YdrTJZ.js.map +1 -0
- package/package.json +2 -2
- package/dist/index-VGx-869x.js.map +0 -1
- package/dist/index-o5Hv9pfS.esm.js.map +0 -1
- package/dist/index.native-B5IBOdv_.js.map +0 -1
- package/dist/index.native-JPUkdHJj.esm.js.map +0 -1
- package/dist/phantom-wallet-provider-CDLyxrih.js.map +0 -1
- package/dist/phantom-wallet-provider-DMlaSrAl.esm.js.map +0 -1
- package/dist/privy-wallet-provider-DiHHTDbZ.js.map +0 -1
- package/dist/privy-wallet-provider-nR52lXzI.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-B4CeMMQd.esm.js.map +0 -1
- package/dist/solana-mobile-wallet-provider-BYMfFjZb.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { getConfig } from "@bounded-sh/core";
|
|
|
4
4
|
export { getAuthProvider, signInAnonymously, sendEmailOtp, verifyEmailOtp, linkEmail, loginWithPrivy } from "./auth";
|
|
5
5
|
export { loginWithRedirect, linkWithRedirect, completeLoginFromRedirect, loginWithPopup, completeLoginInPopup } from "./auth";
|
|
6
6
|
export { get, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, count, aggregate, GetOptions, SearchOptions, SetOptions, CountOptions, AggregateOptions, AggregateOperation, AggregateResult, AggregateSpec, AggregateRow, QueryAggregateOptions, } from "@bounded-sh/core";
|
|
7
|
-
export type { GetOptions as
|
|
7
|
+
export type { GetOptions as BoundedGetOptions } from "@bounded-sh/core";
|
|
8
8
|
export { subscribe } from "@bounded-sh/core";
|
|
9
9
|
export * from "@bounded-sh/core";
|
|
10
10
|
export { useAuth } from "./auth/hooks/useAuth";
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { U as DEFAULT_TEST_ADDRESS, $ as EFFECT_INTENT_ADDRESS, a0 as FunctionInvokeError, a1 as InsufficientBalanceError, a2 as LiveIntentError, T as MockAuthProvider, V as OffchainAuthProvider, S as PhantomWalletProvider, _ as PrivyExpoProvider, Z as PrivyWalletProvider, a3 as ReactNativeSessionManager, a4 as RealtimeStore, a5 as ServerSessionManager, W as SolanaMobileWalletProvider, a6 as WebSessionManager, L as aggregate, a7 as buildSetDocumentsTransaction, a8 as clearCache, a9 as closeAllSubscriptions, r as completeLoginFromRedirect, u as completeLoginInPopup, aa as convertRemainingAccounts, K as count, ab as createSessionWithSignature, ac as defineLiveModule, ad as deriveUserIdentityFromIdToken, O as deserializeTransaction, ae as functions, af as genAuthNonce, ag as genSolanaMessage, w as get, ah as getActiveSessionManager, e as getAuthLoading, j as getAuthProvider, ai as getCachedData, h as getConfig, c as getCurrentUser, A as getFiles, P as getIdToken, aj as getMany, R as getPlatform, ak as getRealtimeStore, al as getWebhookKeysUrl, am as hasActiveConnection, an as increment, i as init, ao as invokeFunction, ap as isEffectResult, X as isMobileWalletAvailable, m as linkEmail, q as linkWithRedirect, aq as live, ar as liveIntent, l as login, t as loginWithPopup, n as loginWithPrivy, p as loginWithRedirect, f as logout, d as onAuthLoadingChanged, o as onAuthStateChanged, C as queryAggregate, as as reconnectWithNewAuth, at as refreshSession, Y as registerMobileWalletAdapter, au as resetRealtimeStore, av as revokeSession, F as runExpression, G as runExpressionMany, D as runQuery, E as runQueryMany, B as search, k as sendEmailOtp, aw as serverTimestamp, x as set, z as setFile, y as setMany, Q as setPlatform, J as signAndSubmitTransaction, s as signInAnonymously, H as signMessage, ax as signSessionCreateMessage, I as signTransaction, M as subscribe, ay as subscribeLiveView, N as useAuth, v as verifyEmailOtp, az as withEffects, aA as wsDelete, aB as wsGet, aC as wsGetMany, aD as wsQuery, aE as wsSet } from './index-
|
|
1
|
+
export { U as DEFAULT_TEST_ADDRESS, $ as EFFECT_INTENT_ADDRESS, a0 as FunctionInvokeError, a1 as InsufficientBalanceError, a2 as LiveIntentError, T as MockAuthProvider, V as OffchainAuthProvider, S as PhantomWalletProvider, _ as PrivyExpoProvider, Z as PrivyWalletProvider, a3 as ReactNativeSessionManager, a4 as RealtimeStore, a5 as ServerSessionManager, W as SolanaMobileWalletProvider, a6 as WebSessionManager, L as aggregate, a7 as buildSetDocumentsTransaction, a8 as clearCache, a9 as closeAllSubscriptions, r as completeLoginFromRedirect, u as completeLoginInPopup, aa as convertRemainingAccounts, K as count, ab as createSessionWithSignature, ac as defineLiveModule, ad as deriveUserIdentityFromIdToken, O as deserializeTransaction, ae as functions, af as genAuthNonce, ag as genSolanaMessage, w as get, ah as getActiveSessionManager, e as getAuthLoading, j as getAuthProvider, ai as getCachedData, h as getConfig, c as getCurrentUser, A as getFiles, P as getIdToken, aj as getMany, R as getPlatform, ak as getRealtimeStore, al as getWebhookKeysUrl, am as hasActiveConnection, an as increment, i as init, ao as invokeFunction, ap as isEffectResult, X as isMobileWalletAvailable, m as linkEmail, q as linkWithRedirect, aq as live, ar as liveIntent, l as login, t as loginWithPopup, n as loginWithPrivy, p as loginWithRedirect, f as logout, d as onAuthLoadingChanged, o as onAuthStateChanged, C as queryAggregate, as as reconnectWithNewAuth, at as refreshSession, Y as registerMobileWalletAdapter, au as resetRealtimeStore, av as revokeSession, F as runExpression, G as runExpressionMany, D as runQuery, E as runQueryMany, B as search, k as sendEmailOtp, aw as serverTimestamp, x as set, z as setFile, y as setMany, Q as setPlatform, J as signAndSubmitTransaction, s as signInAnonymously, H as signMessage, ax as signSessionCreateMessage, I as signTransaction, M as subscribe, ay as subscribeLiveView, N as useAuth, v as verifyEmailOtp, az as withEffects, aA as wsDelete, aB as wsGet, aC as wsGetMany, aD as wsQuery, aE as wsSet } from './index-D986s6w7.esm.js';
|
|
2
2
|
import 'axios';
|
|
3
3
|
import '@solana/web3.js';
|
|
4
4
|
import '@coral-xyz/anchor';
|
package/dist/index.js
CHANGED
|
@@ -6448,7 +6448,7 @@ function getWebhookKeysUrl() {
|
|
|
6448
6448
|
/**
|
|
6449
6449
|
* True when init() configured a Bounded network (the Cloudflare-native stack).
|
|
6450
6450
|
* Synchronous + non-blocking. Used to route reads/writes that behave differently
|
|
6451
|
-
* on Bounded vs the legacy
|
|
6451
|
+
* on Bounded vs the legacy backend (e.g. `count`/`aggregate`, which on
|
|
6452
6452
|
* Bounded must use the deterministic server aggregation, not the legacy AI query).
|
|
6453
6453
|
*/
|
|
6454
6454
|
function isBoundedNetwork() {
|
|
@@ -9303,7 +9303,7 @@ class WebSessionManager {
|
|
|
9303
9303
|
// the RIGHT /session/refresh. Email overrides with humanAuthApiUrl; all
|
|
9304
9304
|
// wallet/guest/signature flows default to authApiUrl (the bounded-auth issuer).
|
|
9305
9305
|
const sessionIssuer = (issuer || config.authApiUrl || "").replace(/\/$/, "");
|
|
9306
|
-
localStorage.setItem(this.
|
|
9306
|
+
localStorage.setItem(this.BOUNDED_SESSION_STORAGE_KEY, JSON.stringify(Object.assign({ address,
|
|
9307
9307
|
accessToken,
|
|
9308
9308
|
idToken,
|
|
9309
9309
|
refreshToken, appId: currentAppId }, (sessionIssuer ? { issuer: sessionIssuer } : {}))));
|
|
@@ -9314,7 +9314,7 @@ class WebSessionManager {
|
|
|
9314
9314
|
static async getSession() {
|
|
9315
9315
|
if (typeof window === "undefined")
|
|
9316
9316
|
return null;
|
|
9317
|
-
const session = localStorage.getItem(this.
|
|
9317
|
+
const session = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9318
9318
|
if (!session)
|
|
9319
9319
|
return null;
|
|
9320
9320
|
const sessionObj = JSON.parse(session);
|
|
@@ -9338,7 +9338,7 @@ class WebSessionManager {
|
|
|
9338
9338
|
// Persist the ROTATED refresh token — the old one is now
|
|
9339
9339
|
// single-use spent; reusing it would revoke the family.
|
|
9340
9340
|
refreshed.refreshToken);
|
|
9341
|
-
const newSession = localStorage.getItem(this.
|
|
9341
|
+
const newSession = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9342
9342
|
if (!newSession)
|
|
9343
9343
|
return null;
|
|
9344
9344
|
const newObj = JSON.parse(newSession);
|
|
@@ -9362,14 +9362,14 @@ class WebSessionManager {
|
|
|
9362
9362
|
static clearSession() {
|
|
9363
9363
|
if (typeof window === "undefined")
|
|
9364
9364
|
return;
|
|
9365
|
-
localStorage.removeItem(this.
|
|
9365
|
+
localStorage.removeItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9366
9366
|
}
|
|
9367
9367
|
/* ------------------------------------------------------------------ */
|
|
9368
9368
|
/* IS-AUTH */
|
|
9369
9369
|
/* ------------------------------------------------------------------ */
|
|
9370
9370
|
static isAuthenticated() {
|
|
9371
9371
|
// NOTE: this remains synchronous to stay backward compatible
|
|
9372
|
-
return !!localStorage.getItem(this.
|
|
9372
|
+
return !!localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9373
9373
|
}
|
|
9374
9374
|
/* ------------------------------------------------------------------ */
|
|
9375
9375
|
/* TOKEN HELPERS */
|
|
@@ -9377,13 +9377,13 @@ class WebSessionManager {
|
|
|
9377
9377
|
static getIdToken() {
|
|
9378
9378
|
if (typeof window === "undefined")
|
|
9379
9379
|
return null;
|
|
9380
|
-
const session = localStorage.getItem(this.
|
|
9380
|
+
const session = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9381
9381
|
return session ? JSON.parse(session).idToken : null;
|
|
9382
9382
|
}
|
|
9383
9383
|
static getRefreshToken() {
|
|
9384
9384
|
if (typeof window === "undefined")
|
|
9385
9385
|
return null;
|
|
9386
|
-
const session = localStorage.getItem(this.
|
|
9386
|
+
const session = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9387
9387
|
return session ? JSON.parse(session).refreshToken : null;
|
|
9388
9388
|
}
|
|
9389
9389
|
/** The issuer base that minted this session (for routing silent refresh). */
|
|
@@ -9391,7 +9391,7 @@ class WebSessionManager {
|
|
|
9391
9391
|
var _a;
|
|
9392
9392
|
if (typeof window === "undefined")
|
|
9393
9393
|
return null;
|
|
9394
|
-
const session = localStorage.getItem(this.
|
|
9394
|
+
const session = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9395
9395
|
return session ? ((_a = JSON.parse(session).issuer) !== null && _a !== void 0 ? _a : null) : null;
|
|
9396
9396
|
}
|
|
9397
9397
|
/* ------------------------------------------------------------------ */
|
|
@@ -9401,7 +9401,7 @@ class WebSessionManager {
|
|
|
9401
9401
|
var _a;
|
|
9402
9402
|
if (typeof window === "undefined")
|
|
9403
9403
|
return;
|
|
9404
|
-
const session = localStorage.getItem(this.
|
|
9404
|
+
const session = localStorage.getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9405
9405
|
if (!session)
|
|
9406
9406
|
return;
|
|
9407
9407
|
const sessionObj = JSON.parse(session);
|
|
@@ -9418,10 +9418,10 @@ class WebSessionManager {
|
|
|
9418
9418
|
sessionObj.refreshToken = refreshToken;
|
|
9419
9419
|
}
|
|
9420
9420
|
(_a = sessionObj.appId) !== null && _a !== void 0 ? _a : (sessionObj.appId = config.appId);
|
|
9421
|
-
localStorage.setItem(this.
|
|
9421
|
+
localStorage.setItem(this.BOUNDED_SESSION_STORAGE_KEY, JSON.stringify(sessionObj));
|
|
9422
9422
|
}
|
|
9423
9423
|
}
|
|
9424
|
-
WebSessionManager.
|
|
9424
|
+
WebSessionManager.BOUNDED_SESSION_STORAGE_KEY = "bounded_session_storage";
|
|
9425
9425
|
|
|
9426
9426
|
let _config = null;
|
|
9427
9427
|
class ReactNativeSessionManager {
|
|
@@ -9514,7 +9514,7 @@ class ReactNativeSessionManager {
|
|
|
9514
9514
|
// Issuer base for silent refresh (email overrides w/ humanAuthApiUrl; wallet/
|
|
9515
9515
|
// guest default to authApiUrl). See WebSessionManager for the rationale.
|
|
9516
9516
|
const sessionIssuer = (issuer || config.authApiUrl || "").replace(/\/$/, "");
|
|
9517
|
-
this.getStorage().setItem(this.
|
|
9517
|
+
this.getStorage().setItem(this.BOUNDED_SESSION_STORAGE_KEY, JSON.stringify(Object.assign({ address,
|
|
9518
9518
|
accessToken,
|
|
9519
9519
|
idToken,
|
|
9520
9520
|
refreshToken, appId: currentAppId }, (sessionIssuer ? { issuer: sessionIssuer } : {}))));
|
|
@@ -9523,7 +9523,7 @@ class ReactNativeSessionManager {
|
|
|
9523
9523
|
/* GET */
|
|
9524
9524
|
/* ------------------------------------------------------------------ */
|
|
9525
9525
|
static async getSession() {
|
|
9526
|
-
const session = this.getStorage().getItem(this.
|
|
9526
|
+
const session = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9527
9527
|
if (!session)
|
|
9528
9528
|
return null;
|
|
9529
9529
|
const sessionObj = JSON.parse(session);
|
|
@@ -9544,7 +9544,7 @@ class ReactNativeSessionManager {
|
|
|
9544
9544
|
const refreshed = await refreshSession(refreshToken, sessionObj.issuer);
|
|
9545
9545
|
if ((refreshed === null || refreshed === void 0 ? void 0 : refreshed.idToken) && (refreshed === null || refreshed === void 0 ? void 0 : refreshed.accessToken)) {
|
|
9546
9546
|
await this.updateIdTokenAndAccessToken(refreshed.idToken, refreshed.accessToken, refreshed.refreshToken);
|
|
9547
|
-
const newSession = this.getStorage().getItem(this.
|
|
9547
|
+
const newSession = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9548
9548
|
if (!newSession)
|
|
9549
9549
|
return null;
|
|
9550
9550
|
const newObj = JSON.parse(newSession);
|
|
@@ -9566,20 +9566,20 @@ class ReactNativeSessionManager {
|
|
|
9566
9566
|
/* CLEAR */
|
|
9567
9567
|
/* ------------------------------------------------------------------ */
|
|
9568
9568
|
static clearSession() {
|
|
9569
|
-
this.getStorage().removeItem(this.
|
|
9569
|
+
this.getStorage().removeItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9570
9570
|
}
|
|
9571
9571
|
/* ------------------------------------------------------------------ */
|
|
9572
9572
|
/* IS-AUTH */
|
|
9573
9573
|
/* ------------------------------------------------------------------ */
|
|
9574
9574
|
static isAuthenticated() {
|
|
9575
|
-
return !!this.getStorage().getItem(this.
|
|
9575
|
+
return !!this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9576
9576
|
}
|
|
9577
9577
|
/* ------------------------------------------------------------------ */
|
|
9578
9578
|
/* TOKEN HELPERS */
|
|
9579
9579
|
/* ------------------------------------------------------------------ */
|
|
9580
9580
|
static getIdToken() {
|
|
9581
9581
|
try {
|
|
9582
|
-
const session = this.getStorage().getItem(this.
|
|
9582
|
+
const session = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9583
9583
|
return session ? JSON.parse(session).idToken : null;
|
|
9584
9584
|
}
|
|
9585
9585
|
catch (_a) {
|
|
@@ -9590,7 +9590,7 @@ class ReactNativeSessionManager {
|
|
|
9590
9590
|
static getIssuer() {
|
|
9591
9591
|
var _a;
|
|
9592
9592
|
try {
|
|
9593
|
-
const session = this.getStorage().getItem(this.
|
|
9593
|
+
const session = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9594
9594
|
return session ? ((_a = JSON.parse(session).issuer) !== null && _a !== void 0 ? _a : null) : null;
|
|
9595
9595
|
}
|
|
9596
9596
|
catch (_b) {
|
|
@@ -9599,7 +9599,7 @@ class ReactNativeSessionManager {
|
|
|
9599
9599
|
}
|
|
9600
9600
|
static getRefreshToken() {
|
|
9601
9601
|
try {
|
|
9602
|
-
const session = this.getStorage().getItem(this.
|
|
9602
|
+
const session = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9603
9603
|
return session ? JSON.parse(session).refreshToken : null;
|
|
9604
9604
|
}
|
|
9605
9605
|
catch (_a) {
|
|
@@ -9611,7 +9611,7 @@ class ReactNativeSessionManager {
|
|
|
9611
9611
|
/* ------------------------------------------------------------------ */
|
|
9612
9612
|
static async updateIdTokenAndAccessToken(idToken, accessToken, refreshToken) {
|
|
9613
9613
|
var _a;
|
|
9614
|
-
const session = this.getStorage().getItem(this.
|
|
9614
|
+
const session = this.getStorage().getItem(this.BOUNDED_SESSION_STORAGE_KEY);
|
|
9615
9615
|
if (!session)
|
|
9616
9616
|
return;
|
|
9617
9617
|
const sessionObj = JSON.parse(session);
|
|
@@ -9627,10 +9627,10 @@ class ReactNativeSessionManager {
|
|
|
9627
9627
|
sessionObj.refreshToken = refreshToken;
|
|
9628
9628
|
}
|
|
9629
9629
|
(_a = sessionObj.appId) !== null && _a !== void 0 ? _a : (sessionObj.appId = config.appId);
|
|
9630
|
-
this.getStorage().setItem(this.
|
|
9630
|
+
this.getStorage().setItem(this.BOUNDED_SESSION_STORAGE_KEY, JSON.stringify(sessionObj));
|
|
9631
9631
|
}
|
|
9632
9632
|
}
|
|
9633
|
-
ReactNativeSessionManager.
|
|
9633
|
+
ReactNativeSessionManager.BOUNDED_SESSION_STORAGE_KEY = "bounded_session_storage";
|
|
9634
9634
|
|
|
9635
9635
|
/**
|
|
9636
9636
|
* Return the active CLIENT session manager for the current runtime.
|
|
@@ -10151,9 +10151,9 @@ async function buildSetDocumentsTransaction(connection, idl, anchorProvider, pay
|
|
|
10151
10151
|
/* ENV helpers */
|
|
10152
10152
|
/* ------------------------------------------------------------------ */
|
|
10153
10153
|
// Canonical `BOUNDED_PRIVATE_KEY` (matches the CLI); legacy
|
|
10154
|
-
// `
|
|
10154
|
+
// `BOUNDED_SOLANA_KEYPAIR` still honored. Only consulted when no explicit
|
|
10155
10155
|
// keypair was provided (createWalletClient passes one).
|
|
10156
|
-
const ENV_KEYPAIRS = ["BOUNDED_PRIVATE_KEY", "
|
|
10156
|
+
const ENV_KEYPAIRS = ["BOUNDED_PRIVATE_KEY", "BOUNDED_SOLANA_KEYPAIR"];
|
|
10157
10157
|
function loadKeypairFromEnv() {
|
|
10158
10158
|
let secret;
|
|
10159
10159
|
let found;
|
|
@@ -10276,7 +10276,7 @@ var serverSessionManager = /*#__PURE__*/Object.freeze({
|
|
|
10276
10276
|
});
|
|
10277
10277
|
|
|
10278
10278
|
/**
|
|
10279
|
-
* Safe base64 helpers for
|
|
10279
|
+
* Safe base64 helpers for bounded-core.
|
|
10280
10280
|
*
|
|
10281
10281
|
* Uses the global atob/btoa when available (browser, RN with polyfill),
|
|
10282
10282
|
* falls back to the 'buffer' package (Node.js / SSR / RN without polyfill).
|
|
@@ -10456,7 +10456,7 @@ axiosRetry(apiClient, {
|
|
|
10456
10456
|
shouldResetTimeout: true,
|
|
10457
10457
|
onRetry: (retryCount, error, requestConfig) => {
|
|
10458
10458
|
var _a;
|
|
10459
|
-
console.warn(`[
|
|
10459
|
+
console.warn(`[bounded-sdk] retry ${retryCount} for ${(_a = requestConfig.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()} ${requestConfig.url} — ${error.code || error.message}`);
|
|
10460
10460
|
},
|
|
10461
10461
|
});
|
|
10462
10462
|
const refreshInFlight = new Map();
|
|
@@ -10515,8 +10515,8 @@ async function makeApiRequest(method, urlPath, data, _overrides) {
|
|
|
10515
10515
|
: await createAuthHeader(config.isServer);
|
|
10516
10516
|
const headers = Object.assign({ "Content-Type": "application/json", "X-Public-App-Id": config.appId, "X-App-Id": config.appId }, authHeader);
|
|
10517
10517
|
if (typeof window !== "undefined" &&
|
|
10518
|
-
window.
|
|
10519
|
-
const customAppId = window.
|
|
10518
|
+
window.CUSTOM_BOUNDED_APP_ID_HEADER) {
|
|
10519
|
+
const customAppId = window.CUSTOM_BOUNDED_APP_ID_HEADER;
|
|
10520
10520
|
if (customAppId) {
|
|
10521
10521
|
headers["X-App-Id"] = customAppId;
|
|
10522
10522
|
}
|
|
@@ -10775,7 +10775,7 @@ function parseAggregateValue(result) {
|
|
|
10775
10775
|
* Count items in a collection path. Returns a numeric result.
|
|
10776
10776
|
*
|
|
10777
10777
|
* This uses the AI query engine with a count-specific prompt prefix,
|
|
10778
|
-
* so
|
|
10778
|
+
* so Bounded will generate a $count aggregation pipeline and return
|
|
10779
10779
|
* just the count rather than full documents.
|
|
10780
10780
|
*
|
|
10781
10781
|
* IMPORTANT: This only works for collections where the read policy is "true".
|
|
@@ -11300,10 +11300,10 @@ async function setMany(many, options) {
|
|
|
11300
11300
|
let documents = [];
|
|
11301
11301
|
const pathsToInvalidate = new Set();
|
|
11302
11302
|
for (const { path, document: documentWithReservedFields } of many) {
|
|
11303
|
-
// for setting, we should remove any pieces of the document that start with '
|
|
11303
|
+
// for setting, we should remove any pieces of the document that start with '_' as they are internal and shouldn't be updated. The API would block it if it is one of the reserved ones
|
|
11304
11304
|
let document = documentWithReservedFields;
|
|
11305
11305
|
if (documentWithReservedFields) {
|
|
11306
|
-
document = Object.fromEntries(Object.entries(documentWithReservedFields).filter(([key]) => !key.startsWith('
|
|
11306
|
+
document = Object.fromEntries(Object.entries(documentWithReservedFields).filter(([key]) => !key.startsWith('_')));
|
|
11307
11307
|
}
|
|
11308
11308
|
const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
|
|
11309
11309
|
pathsToInvalidate.add(normalizedPath);
|
|
@@ -11427,7 +11427,7 @@ async function setMany(many, options) {
|
|
|
11427
11427
|
var _a, _b, _c, _d, _e;
|
|
11428
11428
|
// NOTE (backwards-compat revert): a program-allowlist on server-supplied
|
|
11429
11429
|
// `preInstructions` was tried here for the audit-8 SOL-drain concern, but it
|
|
11430
|
-
// broke legitimate onchain DeFi flows —
|
|
11430
|
+
// broke legitimate onchain DeFi flows — bounded routes Phoenix, Jupiter/swap,
|
|
11431
11431
|
// SPL-Token and ATA-creation instructions through standard-path preInstructions
|
|
11432
11432
|
// (see sol-helper remaining-accounts-extractor). A correct audit-8 fix must be
|
|
11433
11433
|
// DeFi-aware (e.g. block ONLY a raw System Transfer/TransferWithSeed, never a
|
|
@@ -11511,10 +11511,10 @@ async function setMany(many, options) {
|
|
|
11511
11511
|
const transaction = VersionedTransaction.deserialize(txBytes);
|
|
11512
11512
|
// Validate the transaction before signing: ensure only allowed programs
|
|
11513
11513
|
// and no unauthorized System program instructions (e.g., SOL transfers)
|
|
11514
|
-
const
|
|
11514
|
+
const BOUNDED_PROGRAM = 'poof4b5pk1L9tmThvBmaABjcyjfhFGbMbQP5BXk2QZp';
|
|
11515
11515
|
const COMPUTE_BUDGET = 'ComputeBudget111111111111111111111111111111';
|
|
11516
11516
|
const SYSTEM_PROGRAM = '11111111111111111111111111111111';
|
|
11517
|
-
const ALLOWED_PROGRAMS = new Set([
|
|
11517
|
+
const ALLOWED_PROGRAMS = new Set([BOUNDED_PROGRAM, COMPUTE_BUDGET, SYSTEM_PROGRAM]);
|
|
11518
11518
|
// System program instruction discriminators (first 4 bytes, little-endian u32)
|
|
11519
11519
|
const SYSTEM_TRANSFER = 2; // Transfer instruction index
|
|
11520
11520
|
const SYSTEM_TRANSFER_WITH_SEED = 11;
|
|
@@ -12108,8 +12108,8 @@ async function getOrCreateConnection(appId, isServer, routePath, authTokenProvid
|
|
|
12108
12108
|
if (appId && appId !== config.appId) {
|
|
12109
12109
|
wsUrl.searchParams.append('appId', appId);
|
|
12110
12110
|
}
|
|
12111
|
-
else if (typeof window !== 'undefined' && window.
|
|
12112
|
-
wsUrl.searchParams.append('appId', window.
|
|
12111
|
+
else if (typeof window !== 'undefined' && window.CUSTOM_BOUNDED_APP_ID_HEADER) {
|
|
12112
|
+
wsUrl.searchParams.append('appId', window.CUSTOM_BOUNDED_APP_ID_HEADER);
|
|
12113
12113
|
}
|
|
12114
12114
|
else {
|
|
12115
12115
|
wsUrl.searchParams.append('appId', config.appId);
|
|
@@ -12969,7 +12969,7 @@ function serverTimestamp() {
|
|
|
12969
12969
|
// ---------------------------------------------------------------------------
|
|
12970
12970
|
// IDB helpers (lazy-loaded, non-blocking)
|
|
12971
12971
|
// ---------------------------------------------------------------------------
|
|
12972
|
-
const IDB_NAME$1 = '
|
|
12972
|
+
const IDB_NAME$1 = 'bounded-realtime';
|
|
12973
12973
|
const IDB_STORE$1 = 'subscriptions';
|
|
12974
12974
|
const IDB_VERSION = 1;
|
|
12975
12975
|
let idbPromise = null;
|
|
@@ -13407,10 +13407,10 @@ class RealtimeStore {
|
|
|
13407
13407
|
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
13408
13408
|
const collectionPath = this.getCollectionPath(normalizedPath);
|
|
13409
13409
|
const optimisticDoc = Object.assign(Object.assign({ _id: normalizedPath, pathId: normalizedPath }, resolvedDoc), {
|
|
13410
|
-
// System timestamp field name
|
|
13411
|
-
//
|
|
13410
|
+
// System timestamp field name: the Bounded worker stamps the neutral
|
|
13411
|
+
// `_updatedAt`; the underscore-prefixed `_updated_at` metadata mirror.
|
|
13412
13412
|
// Match it so the optimistic doc lines up with the server's confirmation.
|
|
13413
|
-
[isBoundedNetwork() ? '_updatedAt' : '
|
|
13413
|
+
[isBoundedNetwork() ? '_updatedAt' : '_updated_at']: Date.now() });
|
|
13414
13414
|
const sub = this.findSubscriptionByPath(collectionPath);
|
|
13415
13415
|
let prevDoc = null;
|
|
13416
13416
|
if (sub) {
|
|
@@ -18524,7 +18524,7 @@ let currentAuthProvider = null;
|
|
|
18524
18524
|
let currentAuthMethod = null;
|
|
18525
18525
|
let initConfig = null;
|
|
18526
18526
|
// --- localStorage helpers: track which auth method the user last logged in with ---
|
|
18527
|
-
const STORED_AUTH_METHOD_KEY = '
|
|
18527
|
+
const STORED_AUTH_METHOD_KEY = 'bounded_last_auth_method';
|
|
18528
18528
|
function getStoredAuthMethod() {
|
|
18529
18529
|
try {
|
|
18530
18530
|
return getPlatform().storage.getItem(STORED_AUTH_METHOD_KEY);
|
|
@@ -18572,17 +18572,17 @@ function clearIncompatibleSession() {
|
|
|
18572
18572
|
// Lazy loaders for web-only providers.
|
|
18573
18573
|
// Using dynamic import() ensures Metro (RN) never resolves these modules.
|
|
18574
18574
|
async function loadPhantomWalletProvider() {
|
|
18575
|
-
const mod = await import('./phantom-wallet-provider-
|
|
18575
|
+
const mod = await import('./phantom-wallet-provider-Cy5T9EVd.esm.js');
|
|
18576
18576
|
return { PhantomWalletProvider: mod.PhantomWalletProvider };
|
|
18577
18577
|
}
|
|
18578
18578
|
// Web Privy provider (depends on react-dom + @privy-io/react-auth). Lazy so Metro
|
|
18579
18579
|
// never bundles it into the RN build — RN uses the @privy-io/expo provider instead.
|
|
18580
18580
|
async function loadPrivyWalletProvider() {
|
|
18581
|
-
const mod = await import('./privy-wallet-provider-
|
|
18581
|
+
const mod = await import('./privy-wallet-provider-BDsrUpk4.esm.js');
|
|
18582
18582
|
return mod.PrivyWalletProvider;
|
|
18583
18583
|
}
|
|
18584
18584
|
async function loadSolanaMobileWalletProvider() {
|
|
18585
|
-
const mod = await import('./solana-mobile-wallet-provider-
|
|
18585
|
+
const mod = await import('./solana-mobile-wallet-provider-CSk_FIww.esm.js');
|
|
18586
18586
|
return mod.SolanaMobileWalletProvider;
|
|
18587
18587
|
}
|
|
18588
18588
|
async function hotSwapToMWAProvider(config) {
|
|
@@ -19302,7 +19302,7 @@ class PrivyExpoProvider {
|
|
|
19302
19302
|
if (!wallet) {
|
|
19303
19303
|
throw new Error('No embedded Solana wallet found after login. Ensure embeddedWallets.solana.createOnLogin is configured.');
|
|
19304
19304
|
}
|
|
19305
|
-
// Mint a
|
|
19305
|
+
// Mint a Bounded session by having the Privy Solana wallet sign the
|
|
19306
19306
|
// standard SIWS challenge — identical to Phantom/MWA, so the backend mints
|
|
19307
19307
|
// the session via the proven wallet-signature path (no Privy-specific
|
|
19308
19308
|
// token verification needed).
|
|
@@ -19322,8 +19322,8 @@ class PrivyExpoProvider {
|
|
|
19322
19322
|
const connection = new Connection(rpcUrl, 'confirmed');
|
|
19323
19323
|
const remainingAccounts = convertRemainingAccounts(solTransactionData.txArgs[0].remainingAccounts);
|
|
19324
19324
|
let app_id = solTransactionData.appId;
|
|
19325
|
-
if (typeof globalThis !== 'undefined' && globalThis.
|
|
19326
|
-
app_id = globalThis.
|
|
19325
|
+
if (typeof globalThis !== 'undefined' && globalThis.CUSTOM_BOUNDED_APP_ID_HEADER) {
|
|
19326
|
+
app_id = globalThis.CUSTOM_BOUNDED_APP_ID_HEADER;
|
|
19327
19327
|
}
|
|
19328
19328
|
if (!app_id) {
|
|
19329
19329
|
throw new Error('App ID is required');
|
|
@@ -19477,7 +19477,7 @@ class PrivyExpoProvider {
|
|
|
19477
19477
|
// Private helpers
|
|
19478
19478
|
// -------------------------------------------------------------------
|
|
19479
19479
|
/**
|
|
19480
|
-
* Mint a
|
|
19480
|
+
* Mint a Bounded session from a Privy Solana wallet by signing the canonical
|
|
19481
19481
|
* SIWS challenge (nonce -> genSolanaMessage -> wallet.signMessage). This reuses
|
|
19482
19482
|
* createSessionWithSignature — the exact path Phantom, the mobile wallet
|
|
19483
19483
|
* adapter, and the guest device-key use — so the bounded /session issuer mints
|
|
@@ -19562,4 +19562,4 @@ class PrivyExpoProvider {
|
|
|
19562
19562
|
}
|
|
19563
19563
|
|
|
19564
19564
|
export { aggregate as $, signInAnonymously as A, sendEmailOtp as B, verifyEmailOtp as C, linkEmail as D, loginWithPrivy as E, loginWithRedirect as F, linkWithRedirect as G, completeLoginFromRedirect as H, loginWithPopup as I, completeLoginInPopup as J, get as K, set as L, setMany as M, setFile as N, getFiles as O, search as P, queryAggregate as Q, runQuery as R, SOLANA_DEVNET_RPC_URL as S, runQueryMany as T, runExpression as U, runExpressionMany as V, WebSessionManager as W, signMessage as X, signTransaction as Y, signAndSubmitTransaction as Z, count as _, buildSetDocumentsTransaction as a, subscribe as a0, useAuth as a1, deserializeTransaction as a2, getIdToken as a3, setPlatform as a4, MockAuthProvider as a5, DEFAULT_TEST_ADDRESS as a6, OffchainAuthProvider as a7, PrivyExpoProvider as a8, EFFECT_INTENT_ADDRESS as a9, signSessionCreateMessage as aA, subscribeView as aB, withEffects as aC, wsDelete as aD, wsGet as aE, wsGetMany as aF, wsQuery as aG, wsSet as aH, index as aI, FunctionInvokeError as aa, InsufficientBalanceError as ab, LiveIntentError as ac, ReactNativeSessionManager as ad, RealtimeStore as ae, ServerSessionManager as af, clearCache as ag, closeAllSubscriptions as ah, defineLiveModule as ai, deriveUserIdentityFromIdToken as aj, functions as ak, getCachedData as al, getMany as am, getRealtimeStore as an, getWebhookKeysUrl as ao, hasActiveConnection as ap, increment as aq, invoke as ar, isEffectResult as as, live as at, intent as au, reconnectWithNewAuth as av, refreshSession as aw, resetRealtimeStore as ax, revokeSession as ay, serverTimestamp as az, bufferExports as b, convertRemainingAccounts as c, confirmAndCheckTransaction as d, SOLANA_MAINNET_RPC_URL as e, SURFNET_RPC_URL$1 as f, detectMobile as g, detectAndroid as h, getPlatform as i, setAuthLoading as j, genAuthNonce as k, genSolanaMessage as l, createSessionWithSignature as m, getActiveSessionManager as n, base58 as o, getDefaultExportFromCjs$1 as p, init as q, getCurrentUser as r, setCurrentUser as s, onAuthStateChanged as t, onAuthLoadingChanged as u, getAuthLoading as v, login as w, logout as x, getConfig as y, getAuthProvider as z };
|
|
19565
|
-
//# sourceMappingURL=index.native-
|
|
19565
|
+
//# sourceMappingURL=index.native-B-cLm_BI.esm.js.map
|