@bounded-sh/client 0.0.119 → 0.0.120
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/oidc-auth.d.ts +2 -1
- package/dist/{email-auth-provider-wOISnCic.js → email-auth-provider-Bb_0mHJ_.js} +2 -2
- package/dist/{email-auth-provider-wOISnCic.js.map → email-auth-provider-Bb_0mHJ_.js.map} +1 -1
- package/dist/{email-auth-provider-DyzhiN9Y.js → email-auth-provider-IsiArtx0.js} +2 -2
- package/dist/{email-auth-provider-DyzhiN9Y.js.map → email-auth-provider-IsiArtx0.js.map} +1 -1
- package/dist/{email-auth-provider-DHq5_wtn.mjs → email-auth-provider-TA2AbU5Y.mjs} +2 -2
- package/dist/{email-auth-provider-DHq5_wtn.mjs.map → email-auth-provider-TA2AbU5Y.mjs.map} +1 -1
- package/dist/{email-auth-provider-DOI-4lPC.mjs → email-auth-provider-ao5ce_SN.mjs} +2 -2
- package/dist/{email-auth-provider-DOI-4lPC.mjs.map → email-auth-provider-ao5ce_SN.mjs.map} +1 -1
- package/dist/{guest-auth-provider-xap-VQBP.js → guest-auth-provider-CJUbifdu.js} +2 -2
- package/dist/{guest-auth-provider-xap-VQBP.js.map → guest-auth-provider-CJUbifdu.js.map} +1 -1
- package/dist/{guest-auth-provider-Br3iM3O3.js → guest-auth-provider-DTEwf7qP.js} +2 -2
- package/dist/{guest-auth-provider-Br3iM3O3.js.map → guest-auth-provider-DTEwf7qP.js.map} +1 -1
- package/dist/{guest-auth-provider-DyP5UUg6.mjs → guest-auth-provider-Dw-bF10B.mjs} +2 -2
- package/dist/{guest-auth-provider-ZOBNFoeC.mjs.map → guest-auth-provider-Dw-bF10B.mjs.map} +1 -1
- package/dist/{guest-auth-provider-ZOBNFoeC.mjs → guest-auth-provider-DxQG3JvU.mjs} +2 -2
- package/dist/{guest-auth-provider-DyP5UUg6.mjs.map → guest-auth-provider-DxQG3JvU.mjs.map} +1 -1
- package/dist/{index-BaXUWG8Q.mjs → index-BdzGX8fS.mjs} +36 -14
- package/dist/index-BdzGX8fS.mjs.map +1 -0
- package/dist/{index-B4_eKphx.js → index-KUBcQdTX.js} +36 -14
- package/dist/index-KUBcQdTX.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-B-pjNetI.js → index.native-CZSRvIAb.js} +35 -13
- package/dist/index.native-CZSRvIAb.js.map +1 -0
- package/dist/{index.native-B4yI0BqT.mjs → index.native-N5zxPEYK.mjs} +35 -13
- package/dist/index.native-N5zxPEYK.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js → injected-evm-wallet-provider--XJFh-7d.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CKAv4Qxh.js.map → injected-evm-wallet-provider--XJFh-7d.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-DQMYqPus.js → injected-evm-wallet-provider-4T_-2UQI.js} +2 -2
- package/dist/{injected-evm-wallet-provider-DQMYqPus.js.map → injected-evm-wallet-provider-4T_-2UQI.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs → injected-evm-wallet-provider-BlSFIzEA.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-B4Kr6lnK.mjs.map → injected-evm-wallet-provider-BlSFIzEA.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs → injected-evm-wallet-provider-CtPPhtMh.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-Vw-Puwxh.mjs.map → injected-evm-wallet-provider-CtPPhtMh.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-jj9dqm2Z.mjs → injected-wallet-provider-Bnsfazum.mjs} +2 -2
- package/dist/{injected-wallet-provider-jj9dqm2Z.mjs.map → injected-wallet-provider-Bnsfazum.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-B8QTPxf6.js → injected-wallet-provider-CJ0v5Sgn.js} +2 -2
- package/dist/{injected-wallet-provider-B8QTPxf6.js.map → injected-wallet-provider-CJ0v5Sgn.js.map} +1 -1
- package/dist/{injected-wallet-provider-BsTfBAD4.js → injected-wallet-provider-Ckljhcbu.js} +2 -2
- package/dist/{injected-wallet-provider-BsTfBAD4.js.map → injected-wallet-provider-Ckljhcbu.js.map} +1 -1
- package/dist/{injected-wallet-provider-CQxGVYja.mjs → injected-wallet-provider-yyJfuVgv.mjs} +2 -2
- package/dist/{injected-wallet-provider-CQxGVYja.mjs.map → injected-wallet-provider-yyJfuVgv.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index-B4_eKphx.js.map +0 -1
- package/dist/index-BaXUWG8Q.mjs.map +0 -1
- package/dist/index.native-B-pjNetI.js.map +0 -1
- package/dist/index.native-B4yI0BqT.mjs.map +0 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { as as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, ar as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, aq as BUILD_REVIEW_CAPABILITY_SCHEMA, aj as BuildsApiError, a7 as ConnectionError, ap as FAILURE_REASONS, al as NON_TERMINAL_STATES, ad as OffchainAuthProvider, ao as PARK_REASONS, ae as PrivyExpoProvider, an as RUN_STATES, am as TERMINAL_STATES, ab as VenueEscrowError, W as WalletConfigError, T as apps, ai as builds, a4 as completeConnection, K as completeLoginFromRedirect, a3 as connect, ag as connectBroadcast, ah as connectServiceSession, q as defaultInjectedEvmProvider, i as defaultInjectedProvider, a6 as disconnect, a9 as disputeVenueEscrow, H as ensureSharedWalletLoginReady, O as ensureSignedIn, G as ensureWalletLoginReady, a8 as fundVenueEscrow, y as getAuthLoading, C as getAuthProvider, a5 as getConnections, v as getCurrentUser, $ as getIdToken, L as getLoginReturnError, V as getOrCreateTurnkeyWallet, g as getPlatform, Z as getTurnkeyWalletRecoveryUrl, Y as getTurnkeyWalletSessionState, aa as getVenueEscrow, u as init, A as login, M as loginWithPopup, E as loginWithPrivy, J as loginWithRedirect, F as loginWithWallet, B as logout, ak as mediaAgentTools, x as onAuthLoadingChanged, w as onAuthStateChanged, a0 as onramp, a1 as onrampQuote, a2 as onrampStatus, N as openBoundedWidget, X as openTurnkeyKeyExport, I as preloadWalletLogin, af as requestEip6963Providers, ac as setPlatform, D as signInAnonymously, U as signSolanaMessageViaTurnkey, _ as startTurnkeyEmailLogin, l as supportsWalletSignIn, P as useAuth, R as useBuildRun, Q as useQuery, z as waitForAuthReady } from './index-
|
|
1
|
+
export { as as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, ar as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, aq as BUILD_REVIEW_CAPABILITY_SCHEMA, aj as BuildsApiError, a7 as ConnectionError, ap as FAILURE_REASONS, al as NON_TERMINAL_STATES, ad as OffchainAuthProvider, ao as PARK_REASONS, ae as PrivyExpoProvider, an as RUN_STATES, am as TERMINAL_STATES, ab as VenueEscrowError, W as WalletConfigError, T as apps, ai as builds, a4 as completeConnection, K as completeLoginFromRedirect, a3 as connect, ag as connectBroadcast, ah as connectServiceSession, q as defaultInjectedEvmProvider, i as defaultInjectedProvider, a6 as disconnect, a9 as disputeVenueEscrow, H as ensureSharedWalletLoginReady, O as ensureSignedIn, G as ensureWalletLoginReady, a8 as fundVenueEscrow, y as getAuthLoading, C as getAuthProvider, a5 as getConnections, v as getCurrentUser, $ as getIdToken, L as getLoginReturnError, V as getOrCreateTurnkeyWallet, g as getPlatform, Z as getTurnkeyWalletRecoveryUrl, Y as getTurnkeyWalletSessionState, aa as getVenueEscrow, u as init, A as login, M as loginWithPopup, E as loginWithPrivy, J as loginWithRedirect, F as loginWithWallet, B as logout, ak as mediaAgentTools, x as onAuthLoadingChanged, w as onAuthStateChanged, a0 as onramp, a1 as onrampQuote, a2 as onrampStatus, N as openBoundedWidget, X as openTurnkeyKeyExport, I as preloadWalletLogin, af as requestEip6963Providers, ac as setPlatform, D as signInAnonymously, U as signSolanaMessageViaTurnkey, _ as startTurnkeyEmailLogin, l as supportsWalletSignIn, P as useAuth, R as useBuildRun, Q as useQuery, z as waitForAuthReady } from './index-BdzGX8fS.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
3
|
export { AppTokenExchangeError, BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, ScopedClientReadOnlyError, aggregate, clearAppTokenCache, count, createAppTokenAuthHeaders, createClient, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, exchangeAppToken, get, getConfig, getFiles, getMany, prepareToSign, queryAggregate, reconcileSetResult, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe, waitForSetResult } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -151,8 +151,17 @@ function createWebPlatform() {
|
|
|
151
151
|
// bundlers do not externalize or preload a Node-only module in the
|
|
152
152
|
// email/guest graph; this branch is unreachable when WebCrypto is
|
|
153
153
|
// available (all supported browsers and current Node releases).
|
|
154
|
+
// The try makes it an optional dependency for Metro, whose production
|
|
155
|
+
// constant folding turns the specifier back into a literal: a React Native
|
|
156
|
+
// app with no node:crypto mapping still bundles (it passes setPlatform({ sha256 })).
|
|
154
157
|
const nodeCryptoSpecifier = 'node:crypto';
|
|
155
|
-
|
|
158
|
+
let createHash;
|
|
159
|
+
try {
|
|
160
|
+
({ createHash } = await import(/* @vite-ignore */ nodeCryptoSpecifier));
|
|
161
|
+
}
|
|
162
|
+
catch (_b) {
|
|
163
|
+
throw new Error('SHA-256 needs WebCrypto here: pass setPlatform({ sha256 }) (e.g. expo-crypto digest).');
|
|
164
|
+
}
|
|
156
165
|
const hash = createHash('sha256').update(data).digest();
|
|
157
166
|
return hash.buffer.slice(hash.byteOffset, hash.byteOffset + hash.byteLength);
|
|
158
167
|
},
|
|
@@ -5189,6 +5198,14 @@ function cleanCallbackUrl(url) {
|
|
|
5189
5198
|
clean.searchParams.delete(key);
|
|
5190
5199
|
return clean;
|
|
5191
5200
|
}
|
|
5201
|
+
// The address a code returned to, without the fragment. The issuer never sets one
|
|
5202
|
+
// (redirectUri may not carry one), but a browser can keep one across the redirect
|
|
5203
|
+
// chain: iOS lands a Google sign-in on `<redirectUri>?code=...#`.
|
|
5204
|
+
function returnAddress(url) {
|
|
5205
|
+
const clean = cleanCallbackUrl(url);
|
|
5206
|
+
clean.hash = '';
|
|
5207
|
+
return clean.href;
|
|
5208
|
+
}
|
|
5192
5209
|
async function validateAttempt(pkce, callback) {
|
|
5193
5210
|
const cfg = await core.getConfig();
|
|
5194
5211
|
if (!pkce || typeof pkce.verifier !== 'string' || !pkce.verifier ||
|
|
@@ -5198,7 +5215,7 @@ async function validateAttempt(pkce, callback) {
|
|
|
5198
5215
|
if (!Number.isFinite(pkce.createdAt) || Date.now() - pkce.createdAt > LOGIN_TIMEOUT_MS || pkce.createdAt > Date.now()) {
|
|
5199
5216
|
throw new Error('Login expired. Start sign-in again.');
|
|
5200
5217
|
}
|
|
5201
|
-
if (callback && (
|
|
5218
|
+
if (callback && (returnAddress(callback) !== returnAddress(new URL(pkce.redirectUri)) ||
|
|
5202
5219
|
(callback.searchParams.has('iss') && callback.searchParams.get('iss') !== pkce.issuer))) {
|
|
5203
5220
|
throw new Error('Login returned to a different address or from a different auth server. Start sign-in again.');
|
|
5204
5221
|
}
|
|
@@ -5451,7 +5468,7 @@ function parseCallbackParams(callbackUrl) {
|
|
|
5451
5468
|
// universal-link callback, verify state, and run the SAME PKCE code→token exchange
|
|
5452
5469
|
// as web. Returns the signed-in User inline; web redirects complete on the next init().
|
|
5453
5470
|
async function runNativeLogin(opts) {
|
|
5454
|
-
var _a, _b;
|
|
5471
|
+
var _a, _b, _c, _d;
|
|
5455
5472
|
const { url, pkce } = await buildAuthorize(opts);
|
|
5456
5473
|
const WebBrowser = await loadExpoWebBrowser();
|
|
5457
5474
|
const openAuthSession = WebBrowser.openAuthSessionAsync || ((_a = WebBrowser.default) === null || _a === void 0 ? void 0 : _a.openAuthSessionAsync);
|
|
@@ -5463,12 +5480,16 @@ async function runNativeLogin(opts) {
|
|
|
5463
5480
|
// openAuthSessionAsync keeps JS alive while the system browser is shown, then
|
|
5464
5481
|
// resolves with the callback URL once the universal link fires — so `pkce`
|
|
5465
5482
|
// stays in scope and never needs to be persisted.
|
|
5466
|
-
|
|
5483
|
+
// iOS (17.4+) only returns an https callback to the app when asked to; without it the
|
|
5484
|
+
// sheet treats "https" as a custom scheme and never completes. A custom scheme callback
|
|
5485
|
+
// (an Expo Go preview's exps://) is caught by its scheme either way.
|
|
5486
|
+
const preferUniversalLinks = (_c = (_b = opts.redirectUri) === null || _b === void 0 ? void 0 : _b.startsWith('https:')) !== null && _c !== void 0 ? _c : false;
|
|
5487
|
+
const result = await openAuthSession(url, opts.redirectUri, { preferUniversalLinks });
|
|
5467
5488
|
if (!result || result.type === 'cancel' || result.type === 'dismiss') {
|
|
5468
5489
|
throw new Error('Login cancelled');
|
|
5469
5490
|
}
|
|
5470
5491
|
if (result.type !== 'success' || typeof result.url !== 'string') {
|
|
5471
|
-
throw new Error(`Hosted login did not complete (result: ${(
|
|
5492
|
+
throw new Error(`Hosted login did not complete (result: ${(_d = result === null || result === void 0 ? void 0 : result.type) !== null && _d !== void 0 ? _d : 'unknown'})`);
|
|
5472
5493
|
}
|
|
5473
5494
|
const { code, state: returnedState } = parseCallbackParams(result.url);
|
|
5474
5495
|
if (!code)
|
|
@@ -5491,7 +5512,8 @@ async function runNativeLogin(opts) {
|
|
|
5491
5512
|
* callback, runs the PKCE exchange INLINE, and resolves with the signed-in User. No
|
|
5492
5513
|
* completeLoginFromRedirect() call is needed on native. Requires `redirectUri` to be an
|
|
5493
5514
|
* https UNIVERSAL LINK whose origin the app owner registered in the app's allowedOrigins
|
|
5494
|
-
* (custom `myapp://` schemes are rejected by the issuer
|
|
5515
|
+
* (custom `myapp://` schemes are rejected by the issuer; an app preview opened in Expo Go
|
|
5516
|
+
* uses `exps://<preview host>/--/<path>`). Needs the optional peer deps
|
|
5495
5517
|
* expo-web-browser + (expo-crypto or react-native-get-random-values). */
|
|
5496
5518
|
async function loginWithRedirect(opts) {
|
|
5497
5519
|
if (isNative())
|
|
@@ -6170,7 +6192,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6170
6192
|
// manager as legacy email sessions. Human login should be started
|
|
6171
6193
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
6172
6194
|
// logout surface for those sessions.
|
|
6173
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
6195
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-Bb_0mHJ_.js'); })).EmailAuthProvider();
|
|
6174
6196
|
break;
|
|
6175
6197
|
case "phantom": {
|
|
6176
6198
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6212,7 +6234,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6212
6234
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6213
6235
|
// evidence the user has a wallet.
|
|
6214
6236
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6215
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6237
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-Ckljhcbu.js'); });
|
|
6216
6238
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6217
6239
|
break;
|
|
6218
6240
|
}
|
|
@@ -6225,7 +6247,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6225
6247
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6226
6248
|
// to point at a specific wallet or set chainId/domain.
|
|
6227
6249
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6228
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
6250
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-4T_-2UQI.js'); });
|
|
6229
6251
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6230
6252
|
break;
|
|
6231
6253
|
}
|
|
@@ -6250,7 +6272,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6250
6272
|
break;
|
|
6251
6273
|
case "guest":
|
|
6252
6274
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6253
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6275
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-CJUbifdu.js'); })).GuestAuthProvider();
|
|
6254
6276
|
break;
|
|
6255
6277
|
}
|
|
6256
6278
|
if (!currentAuthProvider) {
|
|
@@ -6312,7 +6334,7 @@ async function signInAnonymously() {
|
|
|
6312
6334
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6313
6335
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6314
6336
|
// so bundle-splitting can see it.
|
|
6315
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6337
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-CJUbifdu.js'); })).GuestAuthProvider();
|
|
6316
6338
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6317
6339
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6318
6340
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6483,7 +6505,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6483
6505
|
if (!sharedWalletReady) {
|
|
6484
6506
|
sharedWalletReady = (async () => {
|
|
6485
6507
|
await core.getConfig();
|
|
6486
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6508
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-Ckljhcbu.js'); });
|
|
6487
6509
|
})().catch((error) => {
|
|
6488
6510
|
sharedWalletReady = null;
|
|
6489
6511
|
throw error;
|
|
@@ -9048,4 +9070,4 @@ exports.useBuildRun = useBuildRun;
|
|
|
9048
9070
|
exports.useQuery = useQuery;
|
|
9049
9071
|
exports.waitForAuthReady = waitForAuthReady;
|
|
9050
9072
|
exports.walletStandardFeatureName = walletStandardFeatureName;
|
|
9051
|
-
//# sourceMappingURL=index.native-
|
|
9073
|
+
//# sourceMappingURL=index.native-CZSRvIAb.js.map
|