@bounded-sh/client 0.0.48 → 0.0.51
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/README.md +21 -0
- package/dist/auth/index.d.ts +8 -1
- package/dist/auth/providers/guest-auth-provider.d.ts +7 -0
- package/dist/auth/providers/guest-keystore.d.ts +2 -0
- package/dist/builds/apps.d.ts +32 -0
- package/dist/builds/client.d.ts +74 -0
- package/dist/builds/index.d.ts +20 -0
- package/dist/builds/types.d.ts +127 -0
- package/dist/builds/watch.d.ts +20 -0
- package/dist/{email-auth-provider-GRj8IOg2.mjs → email-auth-provider-Bh2fDYcb.mjs} +2 -2
- package/dist/{email-auth-provider-GRj8IOg2.mjs.map → email-auth-provider-Bh2fDYcb.mjs.map} +1 -1
- package/dist/{email-auth-provider-DyxZTpx6.js → email-auth-provider-Bm6vmoy3.js} +2 -2
- package/dist/{email-auth-provider-DyxZTpx6.js.map → email-auth-provider-Bm6vmoy3.js.map} +1 -1
- package/dist/{email-auth-provider-CTyjwhLb.mjs → email-auth-provider-CdbhqElf.mjs} +2 -2
- package/dist/{email-auth-provider-CTyjwhLb.mjs.map → email-auth-provider-CdbhqElf.mjs.map} +1 -1
- package/dist/{email-auth-provider-CmunfauO.js → email-auth-provider-CnHsY8U-.js} +2 -2
- package/dist/{email-auth-provider-CmunfauO.js.map → email-auth-provider-CnHsY8U-.js.map} +1 -1
- package/dist/global.d.ts +6 -4
- package/dist/{guest-auth-provider-D54uHbov.js → guest-auth-provider-CHqB_uN0.js} +98 -14
- package/dist/guest-auth-provider-CHqB_uN0.js.map +1 -0
- package/dist/{guest-auth-provider-Dk_km5tF.mjs → guest-auth-provider-Dgmr7e0Z.mjs} +98 -14
- package/dist/guest-auth-provider-Dgmr7e0Z.mjs.map +1 -0
- package/dist/{guest-auth-provider-C4BuTNIa.mjs → guest-auth-provider-Xir8zyfZ.mjs} +98 -14
- package/dist/guest-auth-provider-Xir8zyfZ.mjs.map +1 -0
- package/dist/{guest-auth-provider-B68XT2lU.js → guest-auth-provider-fjOMwfpW.js} +98 -14
- package/dist/guest-auth-provider-fjOMwfpW.js.map +1 -0
- package/dist/hooks/useBuildRun.d.ts +13 -0
- package/dist/{index.native-BZCc0gO-.js → index-BsrZb496.js} +918 -29
- package/dist/index-BsrZb496.js.map +1 -0
- package/dist/{index.native-CytJPNQV.mjs → index-Cy0IRs6U.mjs} +907 -31
- package/dist/index-Cy0IRs6U.mjs.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{index-C0pR5b7j.mjs → index.native-B29WKXlr.mjs} +725 -151
- package/dist/index.native-B29WKXlr.mjs.map +1 -0
- package/dist/{index-JBeYYsGm.js → index.native-BaEZwiWd.js} +732 -153
- package/dist/index.native-BaEZwiWd.js.map +1 -0
- package/dist/index.native.d.ts +5 -0
- package/dist/index.native.js +10 -1
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-_eeYB1ww.js → injected-evm-wallet-provider-CEWIg-_U.js} +2 -2
- package/dist/{injected-evm-wallet-provider-_eeYB1ww.js.map → injected-evm-wallet-provider-CEWIg-_U.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-T-EF9C3W.js → injected-evm-wallet-provider-DUyX7Xj9.js} +2 -2
- package/dist/{injected-evm-wallet-provider-T-EF9C3W.js.map → injected-evm-wallet-provider-DUyX7Xj9.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BOMLGGHM.mjs → injected-evm-wallet-provider-DWnpa6Yx.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BOMLGGHM.mjs.map → injected-evm-wallet-provider-DWnpa6Yx.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-CxAiNN7R.mjs → injected-evm-wallet-provider-DkyIMRce.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-CxAiNN7R.mjs.map → injected-evm-wallet-provider-DkyIMRce.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-BBZym7YQ.js → injected-wallet-provider-C65NiItg.js} +2 -2
- package/dist/{injected-wallet-provider-BBZym7YQ.js.map → injected-wallet-provider-C65NiItg.js.map} +1 -1
- package/dist/{injected-wallet-provider-B2T7JEvn.js → injected-wallet-provider-DpJvuK73.js} +2 -2
- package/dist/{injected-wallet-provider-B2T7JEvn.js.map → injected-wallet-provider-DpJvuK73.js.map} +1 -1
- package/dist/{injected-wallet-provider-B1uq3r4r.mjs → injected-wallet-provider-DqBpuASt.mjs} +2 -2
- package/dist/{injected-wallet-provider-B1uq3r4r.mjs.map → injected-wallet-provider-DqBpuASt.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DCwygA3j.mjs → injected-wallet-provider-DsesEVnZ.mjs} +2 -2
- package/dist/{injected-wallet-provider-DCwygA3j.mjs.map → injected-wallet-provider-DsesEVnZ.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/guest-auth-provider-B68XT2lU.js.map +0 -1
- package/dist/guest-auth-provider-C4BuTNIa.mjs.map +0 -1
- package/dist/guest-auth-provider-D54uHbov.js.map +0 -1
- package/dist/guest-auth-provider-Dk_km5tF.mjs.map +0 -1
- package/dist/index-C0pR5b7j.mjs.map +0 -1
- package/dist/index-JBeYYsGm.js.map +0 -1
- package/dist/index.native-BZCc0gO-.js.map +0 -1
- package/dist/index.native-CytJPNQV.mjs.map +0 -1
|
@@ -4247,6 +4247,41 @@ function setStoredAuthMethod(method) {
|
|
|
4247
4247
|
// storage might not be available
|
|
4248
4248
|
}
|
|
4249
4249
|
}
|
|
4250
|
+
function getStoredIdToken() {
|
|
4251
|
+
try {
|
|
4252
|
+
return core.getActiveSessionManager().getIdToken();
|
|
4253
|
+
}
|
|
4254
|
+
catch (_a) {
|
|
4255
|
+
return null;
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
function idTokenIsGuest(idToken, expectedAddress) {
|
|
4259
|
+
var _a;
|
|
4260
|
+
try {
|
|
4261
|
+
if (!idToken)
|
|
4262
|
+
return false;
|
|
4263
|
+
let b64 = (_a = idToken.split('.')[1]) === null || _a === void 0 ? void 0 : _a.replace(/-/g, '+').replace(/_/g, '/');
|
|
4264
|
+
if (!b64)
|
|
4265
|
+
return false;
|
|
4266
|
+
const pad = b64.length % 4;
|
|
4267
|
+
if (pad === 2)
|
|
4268
|
+
b64 += '==';
|
|
4269
|
+
else if (pad === 3)
|
|
4270
|
+
b64 += '=';
|
|
4271
|
+
const claims = JSON.parse(getPlatform().atob(b64));
|
|
4272
|
+
if ((claims === null || claims === void 0 ? void 0 : claims.is_anonymous) !== true)
|
|
4273
|
+
return false;
|
|
4274
|
+
if (expectedAddress && (claims === null || claims === void 0 ? void 0 : claims['custom:walletAddress']) !== expectedAddress)
|
|
4275
|
+
return false;
|
|
4276
|
+
return true;
|
|
4277
|
+
}
|
|
4278
|
+
catch (_b) {
|
|
4279
|
+
return false;
|
|
4280
|
+
}
|
|
4281
|
+
}
|
|
4282
|
+
function storedSessionIsGuest() {
|
|
4283
|
+
return idTokenIsGuest(getStoredIdToken());
|
|
4284
|
+
}
|
|
4250
4285
|
/**
|
|
4251
4286
|
* Pick the provider used for an ordinary `init({ appId })` restore.
|
|
4252
4287
|
*
|
|
@@ -4257,7 +4292,16 @@ function setStoredAuthMethod(method) {
|
|
|
4257
4292
|
function authMethodForInit(config) {
|
|
4258
4293
|
if (config.authMethod != null)
|
|
4259
4294
|
return config.authMethod;
|
|
4260
|
-
|
|
4295
|
+
if (getStoredAuthMethod() !== 'guest')
|
|
4296
|
+
return 'email';
|
|
4297
|
+
if (storedSessionIsGuest())
|
|
4298
|
+
return 'guest';
|
|
4299
|
+
// A marker is only a restore hint; the bearer is authoritative. Repair a
|
|
4300
|
+
// stale marker (for example, a crash/failed switch while a human session was
|
|
4301
|
+
// still active) instead of relabelling that human bearer as a guest.
|
|
4302
|
+
const hasSession = !!getStoredIdToken();
|
|
4303
|
+
setStoredAuthMethod(hasSession ? 'email' : null);
|
|
4304
|
+
return 'email';
|
|
4261
4305
|
}
|
|
4262
4306
|
function objectIdentityKey(value) {
|
|
4263
4307
|
if (!value || (typeof value !== 'object' && typeof value !== 'function'))
|
|
@@ -4422,7 +4466,7 @@ async function getAuthProvider(config) {
|
|
|
4422
4466
|
// manager as legacy email sessions. Human login should be started
|
|
4423
4467
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
4424
4468
|
// logout surface for those sessions.
|
|
4425
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
4469
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-Bm6vmoy3.js'); })).EmailAuthProvider();
|
|
4426
4470
|
break;
|
|
4427
4471
|
case "wallet":
|
|
4428
4472
|
case "phantom": {
|
|
@@ -4441,7 +4485,7 @@ async function getAuthProvider(config) {
|
|
|
4441
4485
|
if (!isWalletLoginEnabled(config)) {
|
|
4442
4486
|
throw walletLoginNotEnabledError(authMethod);
|
|
4443
4487
|
}
|
|
4444
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
4488
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-DpJvuK73.js'); });
|
|
4445
4489
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
4446
4490
|
break;
|
|
4447
4491
|
}
|
|
@@ -4454,7 +4498,7 @@ async function getAuthProvider(config) {
|
|
|
4454
4498
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
4455
4499
|
// to point at a specific wallet or set chainId/domain.
|
|
4456
4500
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
4457
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
4501
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-CEWIg-_U.js'); });
|
|
4458
4502
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
4459
4503
|
break;
|
|
4460
4504
|
}
|
|
@@ -4482,7 +4526,7 @@ async function getAuthProvider(config) {
|
|
|
4482
4526
|
break;
|
|
4483
4527
|
case "guest":
|
|
4484
4528
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
4485
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
4529
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-CHqB_uN0.js'); })).GuestAuthProvider();
|
|
4486
4530
|
break;
|
|
4487
4531
|
}
|
|
4488
4532
|
if (!currentAuthProvider) {
|
|
@@ -4519,19 +4563,108 @@ function assertBrowserAuthEnv(method) {
|
|
|
4519
4563
|
* ownership-as-data pattern. `init()` must have run first. Browser/RN only.
|
|
4520
4564
|
*/
|
|
4521
4565
|
async function signInAnonymously() {
|
|
4566
|
+
var _a;
|
|
4522
4567
|
assertBrowserAuthEnv('signInAnonymously');
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4568
|
+
// Resolve configuration before taking the transaction snapshot. Although
|
|
4569
|
+
// getConfig is normally already resolved after init(), it is asynchronous;
|
|
4570
|
+
// another login that finishes during that await must be part of the prior
|
|
4571
|
+
// state we preserve, not accidentally split across old/new snapshots.
|
|
4527
4572
|
const coreConfig = await core.getConfig();
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4573
|
+
const previousAuthProvider = currentAuthProvider;
|
|
4574
|
+
const previousAuthMethod = currentAuthMethod;
|
|
4575
|
+
const previousProviderConfigKey = currentAuthProviderConfigKey;
|
|
4576
|
+
const previousStoredAuthMethod = getStoredAuthMethod();
|
|
4577
|
+
const previousGlobalProvider = getAuthProviderInstance();
|
|
4578
|
+
const previousUser = getCurrentUser();
|
|
4579
|
+
const previousCoreProvider = coreConfig.authProvider;
|
|
4580
|
+
const previousCoreAuthMethod = coreConfig.authMethod;
|
|
4581
|
+
const previousIdToken = getStoredIdToken();
|
|
4582
|
+
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
4583
|
+
// the main bundle for data-only apps. Specifier is a static string literal
|
|
4584
|
+
// so bundle-splitting can see it.
|
|
4585
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-CHqB_uN0.js'); })).GuestAuthProvider();
|
|
4532
4586
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
4587
|
+
const commit = (user) => {
|
|
4588
|
+
// No await/interleaving inside this block: provider/method/config/marker
|
|
4589
|
+
// become guest before the user notification fires, so listeners and
|
|
4590
|
+
// concurrent imperative calls can never observe a mixed identity.
|
|
4591
|
+
currentAuthProvider = provider;
|
|
4592
|
+
currentAuthMethod = 'guest';
|
|
4593
|
+
currentAuthProviderConfigKey = 'direct:guest';
|
|
4594
|
+
coreConfig.authProvider = provider;
|
|
4595
|
+
coreConfig.authMethod = 'guest';
|
|
4596
|
+
setAuthProviderInstance(provider);
|
|
4597
|
+
setStoredAuthMethod('guest');
|
|
4598
|
+
setCurrentUser(user);
|
|
4599
|
+
};
|
|
4533
4600
|
try {
|
|
4534
|
-
|
|
4601
|
+
// Mint/store first while every shared provider surface remains on the
|
|
4602
|
+
// previous identity. The provider also withholds setCurrentUser here.
|
|
4603
|
+
const user = await provider.loginForProviderSwitch();
|
|
4604
|
+
if (!user)
|
|
4605
|
+
return null;
|
|
4606
|
+
// A human login may have completed after the guest request persisted but
|
|
4607
|
+
// before its promise resumed here. Re-check the live bearer immediately
|
|
4608
|
+
// before commit so a late guest result cannot overwrite that newer user.
|
|
4609
|
+
if (!user.address || !idTokenIsGuest(getStoredIdToken(), user.address)) {
|
|
4610
|
+
throw new Error('Anonymous sign-in was superseded by another session.');
|
|
4611
|
+
}
|
|
4612
|
+
commit(user);
|
|
4613
|
+
return user;
|
|
4614
|
+
}
|
|
4615
|
+
catch (error) {
|
|
4616
|
+
const currentIdToken = getStoredIdToken();
|
|
4617
|
+
if (currentIdToken !== previousIdToken && idTokenIsGuest(currentIdToken)) {
|
|
4618
|
+
// Defensive applied-yet-error reconciliation: if storage contains a
|
|
4619
|
+
// valid guest bearer/key despite the thrown write, commit that truth
|
|
4620
|
+
// instead of restoring a human UI over a guest token.
|
|
4621
|
+
let recovered = null;
|
|
4622
|
+
try {
|
|
4623
|
+
recovered = await provider.restoreSessionForProviderSwitch();
|
|
4624
|
+
}
|
|
4625
|
+
catch (_b) {
|
|
4626
|
+
try {
|
|
4627
|
+
core.getActiveSessionManager().clearSession();
|
|
4628
|
+
}
|
|
4629
|
+
catch ( /* fail closed below */_c) { /* fail closed below */ }
|
|
4630
|
+
}
|
|
4631
|
+
if (recovered) {
|
|
4632
|
+
commit(recovered);
|
|
4633
|
+
return recovered;
|
|
4634
|
+
}
|
|
4635
|
+
// restoreSessionForProviderSwitch fails closed and clears a split
|
|
4636
|
+
// bearer. Do not resurrect a user object that no longer has its token.
|
|
4637
|
+
setCurrentUser(null);
|
|
4638
|
+
}
|
|
4639
|
+
else if (currentIdToken === previousIdToken) {
|
|
4640
|
+
// The staged attempt never changed the bearer; every shared provider
|
|
4641
|
+
// surface stayed untouched, so restore the exact prior user/marker.
|
|
4642
|
+
currentAuthProvider = previousAuthProvider;
|
|
4643
|
+
currentAuthMethod = previousAuthMethod;
|
|
4644
|
+
currentAuthProviderConfigKey = previousProviderConfigKey;
|
|
4645
|
+
coreConfig.authProvider = previousCoreProvider;
|
|
4646
|
+
coreConfig.authMethod = previousCoreAuthMethod;
|
|
4647
|
+
setAuthProviderInstance(previousGlobalProvider);
|
|
4648
|
+
setStoredAuthMethod(previousStoredAuthMethod);
|
|
4649
|
+
if (getCurrentUser() !== previousUser)
|
|
4650
|
+
setCurrentUser(previousUser);
|
|
4651
|
+
}
|
|
4652
|
+
else {
|
|
4653
|
+
// A different non-guest token won while this staged guest mint was in
|
|
4654
|
+
// flight (another tab/popup/login). The guest attempt never mutated
|
|
4655
|
+
// shared provider state, so preserve that winner exactly. Align only
|
|
4656
|
+
// this module's private registry to the provider the winner installed;
|
|
4657
|
+
// never overwrite its core/global provider, marker, or user snapshot.
|
|
4658
|
+
const concurrentProvider = (_a = getAuthProviderInstance()) !== null && _a !== void 0 ? _a : coreConfig.authProvider;
|
|
4659
|
+
if (concurrentProvider)
|
|
4660
|
+
currentAuthProvider = concurrentProvider;
|
|
4661
|
+
const concurrentStoredMethod = getStoredAuthMethod();
|
|
4662
|
+
currentAuthMethod = concurrentStoredMethod && concurrentStoredMethod !== 'guest'
|
|
4663
|
+
? concurrentStoredMethod
|
|
4664
|
+
: (previousAuthMethod && previousAuthMethod !== 'guest' ? previousAuthMethod : 'email');
|
|
4665
|
+
currentAuthProviderConfigKey = previousProviderConfigKey;
|
|
4666
|
+
}
|
|
4667
|
+
throw error;
|
|
4535
4668
|
}
|
|
4536
4669
|
finally {
|
|
4537
4670
|
setAuthLoading(false);
|
|
@@ -4625,8 +4758,45 @@ async function login$1(options) {
|
|
|
4625
4758
|
function getCurrentAuthMethod() {
|
|
4626
4759
|
return currentAuthMethod;
|
|
4627
4760
|
}
|
|
4628
|
-
|
|
4629
|
-
|
|
4761
|
+
// The hosted issuer keeps its OWN browser session (the Better Auth cookie on
|
|
4762
|
+
// auth.bounded.sh) — clearing the app-local session alone leaves it alive, so
|
|
4763
|
+
// the next loginWithRedirect() silently re-signs the user in as the SAME
|
|
4764
|
+
// account: "sign out" that never lets you re-choose. The issuer ships
|
|
4765
|
+
// GET /logout for exactly this — it expires the session cookies and bounces
|
|
4766
|
+
// back — but it only redirects to https origins it trusts. Mirror that
|
|
4767
|
+
// allowlist here: on a trusted origin we end the issuer session with a
|
|
4768
|
+
// top-level bounce; anywhere else (custom domains, http dev) we keep the
|
|
4769
|
+
// local-only logout instead of stranding the user on the issuer origin.
|
|
4770
|
+
function issuerLogoutBounceUrl(issuerBase) {
|
|
4771
|
+
if (typeof window === 'undefined' || typeof document === 'undefined')
|
|
4772
|
+
return null; // RN/Node: no shared cookie jar to clear this way
|
|
4773
|
+
try {
|
|
4774
|
+
if (window.top !== window.self)
|
|
4775
|
+
return null; // framed: SameSite=Lax cookies don't ride iframe navigations
|
|
4776
|
+
}
|
|
4777
|
+
catch (_a) {
|
|
4778
|
+
return null;
|
|
4779
|
+
}
|
|
4780
|
+
try {
|
|
4781
|
+
const here = new URL(window.location.href);
|
|
4782
|
+
const host = here.hostname;
|
|
4783
|
+
const isLocalhost = host === 'localhost' || host === '127.0.0.1' || host.endsWith('.localhost');
|
|
4784
|
+
const trusted = here.protocol === 'https:' &&
|
|
4785
|
+
(host === 'bounded.sh' ||
|
|
4786
|
+
host.endsWith('.bounded.sh') ||
|
|
4787
|
+
host.endsWith('.bounded.page') ||
|
|
4788
|
+
host.endsWith('.oapps.fun') ||
|
|
4789
|
+
isLocalhost);
|
|
4790
|
+
if (!trusted)
|
|
4791
|
+
return null;
|
|
4792
|
+
const base = issuerBase.replace(/\/$/, '');
|
|
4793
|
+
return `${base}/logout?redirect_uri=${encodeURIComponent(here.href)}`;
|
|
4794
|
+
}
|
|
4795
|
+
catch (_b) {
|
|
4796
|
+
return null;
|
|
4797
|
+
}
|
|
4798
|
+
}
|
|
4799
|
+
async function logout$1(options) {
|
|
4630
4800
|
// Re-initialize the provider if it was cleared by a prior logout — the exact mirror
|
|
4631
4801
|
// of login()'s self-heal above. A hosted popup/redirect login (loginWithPopup /
|
|
4632
4802
|
// completeLoginFromRedirect) establishes a session WITHOUT touching the provider
|
|
@@ -4649,13 +4819,28 @@ async function logout$1() {
|
|
|
4649
4819
|
// mistake a local-only logout for server revocation.
|
|
4650
4820
|
const sm = core.getActiveSessionManager();
|
|
4651
4821
|
const refreshToken = sm.getRefreshToken();
|
|
4822
|
+
const sessionIssuer = sm.getIssuer();
|
|
4652
4823
|
if (refreshToken)
|
|
4653
|
-
await core.revokeSession(refreshToken,
|
|
4824
|
+
await core.revokeSession(refreshToken, sessionIssuer !== null && sessionIssuer !== void 0 ? sessionIssuer : undefined);
|
|
4825
|
+
// Hosted sessions ('email' covers the whole hosted surface: email OTP +
|
|
4826
|
+
// social + the OIDC redirect/popup flows) are the ones with an issuer
|
|
4827
|
+
// cookie; wallet and guest sessions have nothing hosted to end.
|
|
4828
|
+
const wasHosted = (currentAuthMethod !== null && currentAuthMethod !== void 0 ? currentAuthMethod : getStoredAuthMethod()) === 'email';
|
|
4654
4829
|
await currentAuthProvider.logout();
|
|
4655
4830
|
setStoredAuthMethod(null);
|
|
4656
4831
|
currentAuthProvider = null;
|
|
4657
4832
|
currentAuthMethod = null;
|
|
4658
4833
|
currentAuthProviderConfigKey = null;
|
|
4834
|
+
if (wasHosted && !(options === null || options === void 0 ? void 0 : options.keepIssuerSession)) {
|
|
4835
|
+
const issuerBase = sessionIssuer
|
|
4836
|
+
|| (await core.getConfig()).humanAuthApiUrl
|
|
4837
|
+
|| 'https://auth.bounded.sh';
|
|
4838
|
+
const bounce = issuerLogoutBounceUrl(issuerBase);
|
|
4839
|
+
// Local state is already cleared, so even if the navigation is stopped
|
|
4840
|
+
// (tab close, extension) the app-side logout has fully happened.
|
|
4841
|
+
if (bounce)
|
|
4842
|
+
window.location.href = bounce;
|
|
4843
|
+
}
|
|
4659
4844
|
}
|
|
4660
4845
|
|
|
4661
4846
|
/**
|
|
@@ -4785,11 +4970,11 @@ async function login(options) {
|
|
|
4785
4970
|
setCurrentUser(loggedInUser);
|
|
4786
4971
|
return currentUser;
|
|
4787
4972
|
}
|
|
4788
|
-
async function logout() {
|
|
4973
|
+
async function logout(options) {
|
|
4789
4974
|
if (!authProviderInstance) {
|
|
4790
4975
|
throw new Error('SDK not initialized. Please call init() first.');
|
|
4791
4976
|
}
|
|
4792
|
-
await logout$1();
|
|
4977
|
+
await logout$1(options);
|
|
4793
4978
|
setCurrentUser(null);
|
|
4794
4979
|
}
|
|
4795
4980
|
var hasRunFirstTime = false;
|
|
@@ -4828,21 +5013,25 @@ function setCurrentUser(user) {
|
|
|
4828
5013
|
function getCurrentUser() {
|
|
4829
5014
|
return currentUser;
|
|
4830
5015
|
}
|
|
5016
|
+
/** @internal Snapshot/restore surface for transactional auth-provider switches. */
|
|
5017
|
+
function getAuthProviderInstance() {
|
|
5018
|
+
return authProviderInstance;
|
|
5019
|
+
}
|
|
4831
5020
|
function setAuthProviderInstance(provider) {
|
|
4832
5021
|
authProviderInstance = provider;
|
|
4833
5022
|
}
|
|
4834
5023
|
|
|
4835
|
-
var _a;
|
|
5024
|
+
var _a$2;
|
|
4836
5025
|
// Whether we're in a server-side rendering context (no hooks allowed).
|
|
4837
5026
|
// React Native has no `window` but DOES support hooks.
|
|
4838
5027
|
// We detect Node SSR specifically via process.versions.node to avoid
|
|
4839
5028
|
// false positives from Node 21+ which defines `navigator` globally.
|
|
4840
|
-
const isSSR = typeof window === 'undefined'
|
|
5029
|
+
const isSSR$2 = typeof window === 'undefined'
|
|
4841
5030
|
&& typeof process !== 'undefined'
|
|
4842
|
-
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
5031
|
+
&& !!((_a$2 = process.versions) === null || _a$2 === void 0 ? void 0 : _a$2.node);
|
|
4843
5032
|
function useAuth() {
|
|
4844
5033
|
// Provide a fallback so server render doesn't break
|
|
4845
|
-
if (isSSR) {
|
|
5034
|
+
if (isSSR$2) {
|
|
4846
5035
|
return {
|
|
4847
5036
|
login: async (_options) => undefined,
|
|
4848
5037
|
logout: async () => undefined,
|
|
@@ -4904,6 +5093,613 @@ function useAuth() {
|
|
|
4904
5093
|
};
|
|
4905
5094
|
}
|
|
4906
5095
|
|
|
5096
|
+
var _a$1;
|
|
5097
|
+
// SSR guard (mirrors useAuth): no hooks/subscriptions during Node server render.
|
|
5098
|
+
// React Native has no `window` but DOES support hooks, so detect Node SSR
|
|
5099
|
+
// specifically via process.versions.node.
|
|
5100
|
+
const isSSR$1 = typeof window === 'undefined'
|
|
5101
|
+
&& typeof process !== 'undefined'
|
|
5102
|
+
&& !!((_a$1 = process.versions) === null || _a$1 === void 0 ? void 0 : _a$1.node);
|
|
5103
|
+
function useQuery(path, options) {
|
|
5104
|
+
if (isSSR$1) {
|
|
5105
|
+
return { data: undefined, loading: true, error: null };
|
|
5106
|
+
}
|
|
5107
|
+
const [data, setData] = React__namespace.useState(undefined);
|
|
5108
|
+
const [loading, setLoading] = React__namespace.useState(true);
|
|
5109
|
+
const [error, setError] = React__namespace.useState(null);
|
|
5110
|
+
// Re-subscribe only when the query actually changes (not on every render).
|
|
5111
|
+
const optionsKey = options ? JSON.stringify(options) : '';
|
|
5112
|
+
React__namespace.useEffect(() => {
|
|
5113
|
+
if (!path) {
|
|
5114
|
+
setData(undefined);
|
|
5115
|
+
setLoading(false);
|
|
5116
|
+
setError(null);
|
|
5117
|
+
return;
|
|
5118
|
+
}
|
|
5119
|
+
let active = true;
|
|
5120
|
+
let unsubscribe;
|
|
5121
|
+
setLoading(true);
|
|
5122
|
+
setError(null);
|
|
5123
|
+
core.subscribe(path, Object.assign(Object.assign({}, options), { onData: (d) => {
|
|
5124
|
+
if (!active)
|
|
5125
|
+
return;
|
|
5126
|
+
// A reconnect can legitimately surface a transport error before the
|
|
5127
|
+
// socket re-authenticates and sends a new authorized snapshot. That
|
|
5128
|
+
// fresh snapshot is the recovery boundary: keep the error visible
|
|
5129
|
+
// until data arrives, then clear it so React does not remain stuck on
|
|
5130
|
+
// a failure page after realtime has recovered.
|
|
5131
|
+
setError(null);
|
|
5132
|
+
setData(d);
|
|
5133
|
+
setLoading(false);
|
|
5134
|
+
}, onError: (e) => {
|
|
5135
|
+
if (!active)
|
|
5136
|
+
return;
|
|
5137
|
+
setError(e instanceof Error ? e : new Error(String(e)));
|
|
5138
|
+
setLoading(false);
|
|
5139
|
+
} }))
|
|
5140
|
+
.then((unsub) => {
|
|
5141
|
+
if (active)
|
|
5142
|
+
unsubscribe = unsub;
|
|
5143
|
+
else
|
|
5144
|
+
void unsub(); // unmounted before subscribe resolved
|
|
5145
|
+
})
|
|
5146
|
+
.catch((e) => {
|
|
5147
|
+
if (!active)
|
|
5148
|
+
return;
|
|
5149
|
+
setError(e instanceof Error ? e : new Error(String(e)));
|
|
5150
|
+
setLoading(false);
|
|
5151
|
+
});
|
|
5152
|
+
return () => {
|
|
5153
|
+
active = false;
|
|
5154
|
+
void (unsubscribe === null || unsubscribe === void 0 ? void 0 : unsubscribe());
|
|
5155
|
+
};
|
|
5156
|
+
// optionsKey captures the option object's contents; path is the other input.
|
|
5157
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5158
|
+
}, [path, optionsKey]);
|
|
5159
|
+
return { data, loading, error };
|
|
5160
|
+
}
|
|
5161
|
+
|
|
5162
|
+
// Wrapper for getIdToken - passes isServer=false for client-side usage
|
|
5163
|
+
async function getIdToken() {
|
|
5164
|
+
return core.getIdToken(false);
|
|
5165
|
+
}
|
|
5166
|
+
|
|
5167
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
5168
|
+
var t = {};
|
|
5169
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5170
|
+
t[p] = s[p];
|
|
5171
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
5172
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5173
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
5174
|
+
t[p[i]] = s[p[i]];
|
|
5175
|
+
}
|
|
5176
|
+
return t;
|
|
5177
|
+
};
|
|
5178
|
+
/** A structured non-2xx response from the developer API. */
|
|
5179
|
+
class BuildsApiError extends Error {
|
|
5180
|
+
constructor(init) {
|
|
5181
|
+
super(init.message);
|
|
5182
|
+
this.name = 'BuildsApiError';
|
|
5183
|
+
this.code = init.code;
|
|
5184
|
+
this.retryable = init.retryable;
|
|
5185
|
+
this.status = init.status;
|
|
5186
|
+
this.details = init.details;
|
|
5187
|
+
this.retryAfterMs = init.retryAfterMs;
|
|
5188
|
+
}
|
|
5189
|
+
}
|
|
5190
|
+
const memoryIdempotencyKeys = new Map();
|
|
5191
|
+
const IDEMPOTENCY_STORAGE_PREFIX = 'bounded:build:idempotency:';
|
|
5192
|
+
function retryAfterMs(response) {
|
|
5193
|
+
var _a, _b;
|
|
5194
|
+
const value = (_b = (_a = response.headers) === null || _a === void 0 ? void 0 : _a.get) === null || _b === void 0 ? void 0 : _b.call(_a, 'Retry-After');
|
|
5195
|
+
if (!value)
|
|
5196
|
+
return undefined;
|
|
5197
|
+
const seconds = Number(value);
|
|
5198
|
+
if (Number.isFinite(seconds) && seconds >= 0)
|
|
5199
|
+
return Math.ceil(seconds * 1000);
|
|
5200
|
+
const at = Date.parse(value);
|
|
5201
|
+
if (!Number.isFinite(at))
|
|
5202
|
+
return undefined;
|
|
5203
|
+
return Math.max(0, at - Date.now());
|
|
5204
|
+
}
|
|
5205
|
+
async function responseBody(response) {
|
|
5206
|
+
const text = await response.text();
|
|
5207
|
+
if (!text)
|
|
5208
|
+
return {};
|
|
5209
|
+
try {
|
|
5210
|
+
return JSON.parse(text);
|
|
5211
|
+
}
|
|
5212
|
+
catch (_a) {
|
|
5213
|
+
return { raw: text };
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
function apiError(response, body) {
|
|
5217
|
+
const envelope = body;
|
|
5218
|
+
const nested = (envelope === null || envelope === void 0 ? void 0 : envelope.error) && typeof envelope.error === 'object'
|
|
5219
|
+
? envelope.error
|
|
5220
|
+
: undefined;
|
|
5221
|
+
const hasNestedDetails = !!nested && Object.prototype.hasOwnProperty.call(nested, 'details');
|
|
5222
|
+
const hasTopLevelDetails = !!body
|
|
5223
|
+
&& typeof body === 'object'
|
|
5224
|
+
&& Object.prototype.hasOwnProperty.call(body, 'details');
|
|
5225
|
+
const legacyCode = typeof (body === null || body === void 0 ? void 0 : body.error) === 'string' ? body.error : undefined;
|
|
5226
|
+
const code = typeof (nested === null || nested === void 0 ? void 0 : nested.code) === 'string'
|
|
5227
|
+
? nested.code
|
|
5228
|
+
: legacyCode !== null && legacyCode !== void 0 ? legacyCode : `http_${response.status}`;
|
|
5229
|
+
const message = typeof (nested === null || nested === void 0 ? void 0 : nested.message) === 'string'
|
|
5230
|
+
? nested.message
|
|
5231
|
+
: typeof (body === null || body === void 0 ? void 0 : body.message) === 'string'
|
|
5232
|
+
? body.message
|
|
5233
|
+
: `Developer API request failed with HTTP ${response.status}`;
|
|
5234
|
+
const retryable = typeof (nested === null || nested === void 0 ? void 0 : nested.retryable) === 'boolean'
|
|
5235
|
+
? nested.retryable
|
|
5236
|
+
: response.status === 429 || response.status >= 500;
|
|
5237
|
+
return new BuildsApiError(Object.assign(Object.assign({ code,
|
|
5238
|
+
message,
|
|
5239
|
+
retryable, status: response.status }, (hasNestedDetails
|
|
5240
|
+
? { details: nested === null || nested === void 0 ? void 0 : nested.details }
|
|
5241
|
+
: hasTopLevelDetails
|
|
5242
|
+
? { details: body.details }
|
|
5243
|
+
: {})), (response.status === 429 ? { retryAfterMs: retryAfterMs(response) } : {})));
|
|
5244
|
+
}
|
|
5245
|
+
/** @internal Shared authenticated developer-api transport for builds and apps. */
|
|
5246
|
+
async function requestDevApi(path, request = {}) {
|
|
5247
|
+
var _a, _b;
|
|
5248
|
+
const config = await core.getConfig();
|
|
5249
|
+
const base = (_a = config.devApiUrl) === null || _a === void 0 ? void 0 : _a.replace(/\/$/, '');
|
|
5250
|
+
if (!base) {
|
|
5251
|
+
throw new Error('Bounded developer API is not configured. Pass devApiUrl or a Bounded network to init().');
|
|
5252
|
+
}
|
|
5253
|
+
// Reuse the exact accessor exposed publicly as getIdToken().
|
|
5254
|
+
const token = await getIdToken();
|
|
5255
|
+
if (!token) {
|
|
5256
|
+
throw new BuildsApiError({
|
|
5257
|
+
code: 'auth_required',
|
|
5258
|
+
message: 'Sign in before calling the Bounded developer API.',
|
|
5259
|
+
retryable: false,
|
|
5260
|
+
status: 401,
|
|
5261
|
+
});
|
|
5262
|
+
}
|
|
5263
|
+
const hasBody = request.body !== undefined;
|
|
5264
|
+
const response = await fetch(`${base}${path}`, Object.assign({ method: (_b = request.method) !== null && _b !== void 0 ? _b : 'GET', headers: Object.assign({ Authorization: `Bearer ${token}` }, (hasBody ? { 'Content-Type': 'application/json' } : {})) }, (hasBody ? { body: JSON.stringify(request.body) } : {})));
|
|
5265
|
+
const body = await responseBody(response);
|
|
5266
|
+
if (!response.ok)
|
|
5267
|
+
throw apiError(response, body);
|
|
5268
|
+
return body;
|
|
5269
|
+
}
|
|
5270
|
+
function intentStorageKey(intentKey) {
|
|
5271
|
+
return `${IDEMPOTENCY_STORAGE_PREFIX}${intentKey}`;
|
|
5272
|
+
}
|
|
5273
|
+
function isValidIdempotencyKey(value) {
|
|
5274
|
+
return typeof value === 'string' && value.length > 0 && value.length <= 256;
|
|
5275
|
+
}
|
|
5276
|
+
function readPersistedIdempotencyKey(intentKey) {
|
|
5277
|
+
var _a;
|
|
5278
|
+
const storageKey = intentStorageKey(intentKey);
|
|
5279
|
+
try {
|
|
5280
|
+
const stored = (_a = globalThis.sessionStorage) === null || _a === void 0 ? void 0 : _a.getItem(storageKey);
|
|
5281
|
+
if (isValidIdempotencyKey(stored))
|
|
5282
|
+
return stored;
|
|
5283
|
+
}
|
|
5284
|
+
catch (_b) {
|
|
5285
|
+
// Storage can be disabled by browser privacy policy; use module memory.
|
|
5286
|
+
}
|
|
5287
|
+
const inMemory = memoryIdempotencyKeys.get(storageKey);
|
|
5288
|
+
return isValidIdempotencyKey(inMemory) ? inMemory : undefined;
|
|
5289
|
+
}
|
|
5290
|
+
function persistIdempotencyKey(intentKey, idempotencyKey) {
|
|
5291
|
+
var _a;
|
|
5292
|
+
const storageKey = intentStorageKey(intentKey);
|
|
5293
|
+
memoryIdempotencyKeys.set(storageKey, idempotencyKey);
|
|
5294
|
+
try {
|
|
5295
|
+
(_a = globalThis.sessionStorage) === null || _a === void 0 ? void 0 : _a.setItem(storageKey, idempotencyKey);
|
|
5296
|
+
}
|
|
5297
|
+
catch (_b) {
|
|
5298
|
+
// The in-memory write above is the React Native / disabled-storage fallback.
|
|
5299
|
+
}
|
|
5300
|
+
}
|
|
5301
|
+
function randomHex(bytes) {
|
|
5302
|
+
const cryptoObject = globalThis.crypto;
|
|
5303
|
+
if (cryptoObject === null || cryptoObject === void 0 ? void 0 : cryptoObject.getRandomValues) {
|
|
5304
|
+
const values = new Uint8Array(bytes);
|
|
5305
|
+
cryptoObject.getRandomValues(values);
|
|
5306
|
+
return Array.from(values, (value) => value.toString(16).padStart(2, '0')).join('');
|
|
5307
|
+
}
|
|
5308
|
+
let value = '';
|
|
5309
|
+
for (let index = 0; index < bytes; index += 1) {
|
|
5310
|
+
value += Math.floor(Math.random() * 256).toString(16).padStart(2, '0');
|
|
5311
|
+
}
|
|
5312
|
+
return value;
|
|
5313
|
+
}
|
|
5314
|
+
function mintIdempotencyKey() {
|
|
5315
|
+
const cryptoObject = globalThis.crypto;
|
|
5316
|
+
if (typeof (cryptoObject === null || cryptoObject === void 0 ? void 0 : cryptoObject.randomUUID) === 'function') {
|
|
5317
|
+
return `build_${cryptoObject.randomUUID()}`;
|
|
5318
|
+
}
|
|
5319
|
+
return `build_${Date.now().toString(36)}_${randomHex(16)}`;
|
|
5320
|
+
}
|
|
5321
|
+
function actionIdempotencyKey(options, action) {
|
|
5322
|
+
const supplied = options.idempotencyKey;
|
|
5323
|
+
if (supplied !== undefined) {
|
|
5324
|
+
if (!isValidIdempotencyKey(supplied)) {
|
|
5325
|
+
throw new TypeError('idempotencyKey must be between 1 and 256 characters.');
|
|
5326
|
+
}
|
|
5327
|
+
if (options.intentKey)
|
|
5328
|
+
persistIdempotencyKey(options.intentKey, supplied);
|
|
5329
|
+
return supplied;
|
|
5330
|
+
}
|
|
5331
|
+
if (!options.intentKey) {
|
|
5332
|
+
throw new TypeError(`intentKey is required when ${action} auto-mints an idempotency key.`);
|
|
5333
|
+
}
|
|
5334
|
+
const existing = readPersistedIdempotencyKey(options.intentKey);
|
|
5335
|
+
if (existing)
|
|
5336
|
+
return existing;
|
|
5337
|
+
const minted = mintIdempotencyKey();
|
|
5338
|
+
// This is deliberately synchronous and happens before requestDevApi can fetch.
|
|
5339
|
+
persistIdempotencyKey(options.intentKey, minted);
|
|
5340
|
+
return minted;
|
|
5341
|
+
}
|
|
5342
|
+
function appPath(appId) {
|
|
5343
|
+
return `/app/${encodeURIComponent(appId)}/builds`;
|
|
5344
|
+
}
|
|
5345
|
+
async function submit(appId, options) {
|
|
5346
|
+
const idempotencyKey = actionIdempotencyKey(options, 'submit()');
|
|
5347
|
+
const { intentKey: _intentKey, idempotencyKey: _suppliedKey } = options, submission = __rest(options, ["intentKey", "idempotencyKey"]);
|
|
5348
|
+
return requestDevApi(appPath(appId), {
|
|
5349
|
+
method: 'POST',
|
|
5350
|
+
body: Object.assign(Object.assign({}, submission), { idempotencyKey }),
|
|
5351
|
+
});
|
|
5352
|
+
}
|
|
5353
|
+
async function get(appId, runId) {
|
|
5354
|
+
return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}`);
|
|
5355
|
+
}
|
|
5356
|
+
async function events(appId, runId, after = 0) {
|
|
5357
|
+
const cursor = Number.isFinite(after) ? Math.max(0, Math.floor(after)) : 0;
|
|
5358
|
+
return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/events?after=${cursor}`);
|
|
5359
|
+
}
|
|
5360
|
+
async function cancel(appId, runId) {
|
|
5361
|
+
return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/cancel`, { method: 'POST' });
|
|
5362
|
+
}
|
|
5363
|
+
async function decideGate(appId, runId, gateId, options) {
|
|
5364
|
+
const idempotencyKey = actionIdempotencyKey(options, 'decideGate()');
|
|
5365
|
+
const { intentKey: _intentKey, idempotencyKey: _suppliedKey } = options, decision = __rest(options, ["intentKey", "idempotencyKey"]);
|
|
5366
|
+
return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/gates/${encodeURIComponent(gateId)}/decision`, { method: 'POST', body: Object.assign(Object.assign({}, decision), { idempotencyKey }) });
|
|
5367
|
+
}
|
|
5368
|
+
async function topup(appId, runId, options) {
|
|
5369
|
+
return requestDevApi(`${appPath(appId)}/${encodeURIComponent(runId)}/topup`, { method: 'POST', body: options });
|
|
5370
|
+
}
|
|
5371
|
+
async function list$1(appId, limit = 20) {
|
|
5372
|
+
const requestedLimit = Number.isFinite(limit) ? Math.max(1, Math.floor(limit)) : 20;
|
|
5373
|
+
return requestDevApi(`${appPath(appId)}?limit=${requestedLimit}`);
|
|
5374
|
+
}
|
|
5375
|
+
|
|
5376
|
+
// Source of truth for these strings:
|
|
5377
|
+
// packages/cdk/cloudflare/bounded-build/src/types.ts. Keep them string-pinned;
|
|
5378
|
+
// wire:1 remains additive and callers must tolerate unknown response strings.
|
|
5379
|
+
const NON_TERMINAL_STATES = [
|
|
5380
|
+
'queued',
|
|
5381
|
+
'admitted',
|
|
5382
|
+
'executing',
|
|
5383
|
+
'preview_ready',
|
|
5384
|
+
'parked',
|
|
5385
|
+
'resuming',
|
|
5386
|
+
'promoting',
|
|
5387
|
+
'quarantined',
|
|
5388
|
+
];
|
|
5389
|
+
const TERMINAL_STATES = [
|
|
5390
|
+
'promoted',
|
|
5391
|
+
'failed',
|
|
5392
|
+
'canceled',
|
|
5393
|
+
'rejected',
|
|
5394
|
+
'expired',
|
|
5395
|
+
'rebase_required',
|
|
5396
|
+
'reported',
|
|
5397
|
+
];
|
|
5398
|
+
const RUN_STATES = [
|
|
5399
|
+
...NON_TERMINAL_STATES,
|
|
5400
|
+
...TERMINAL_STATES,
|
|
5401
|
+
];
|
|
5402
|
+
const PARK_REASONS = ['gate', 'funding'];
|
|
5403
|
+
const FAILURE_REASONS = [
|
|
5404
|
+
'admission_rejected',
|
|
5405
|
+
'dispatch_timeout',
|
|
5406
|
+
'auth_revoked',
|
|
5407
|
+
'owner_changed',
|
|
5408
|
+
'policy_changed',
|
|
5409
|
+
'quarantine_forced',
|
|
5410
|
+
'bind_failed',
|
|
5411
|
+
'internal_error',
|
|
5412
|
+
];
|
|
5413
|
+
|
|
5414
|
+
const NORMAL_POLL_MS = 2000;
|
|
5415
|
+
const PARKED_POLL_MS = 5000;
|
|
5416
|
+
const LONG_RUNNING_POLL_MS = 10000;
|
|
5417
|
+
const TWO_MINUTES_MS = 2 * 60000;
|
|
5418
|
+
const TEN_MINUTES_MS = 10 * 60000;
|
|
5419
|
+
const terminalStates = new Set(TERMINAL_STATES);
|
|
5420
|
+
function pollCadence(state, elapsedMs) {
|
|
5421
|
+
if (elapsedMs >= TEN_MINUTES_MS)
|
|
5422
|
+
return LONG_RUNNING_POLL_MS;
|
|
5423
|
+
if ((state === null || state === void 0 ? void 0 : state.startsWith('parked')) || elapsedMs >= TWO_MINUTES_MS)
|
|
5424
|
+
return PARKED_POLL_MS;
|
|
5425
|
+
return NORMAL_POLL_MS;
|
|
5426
|
+
}
|
|
5427
|
+
function retryCadence(error, state, elapsedMs) {
|
|
5428
|
+
const cadence = pollCadence(state, elapsedMs);
|
|
5429
|
+
if (error instanceof BuildsApiError && error.status === 429 && error.retryAfterMs !== undefined) {
|
|
5430
|
+
return Math.max(cadence, error.retryAfterMs);
|
|
5431
|
+
}
|
|
5432
|
+
return cadence;
|
|
5433
|
+
}
|
|
5434
|
+
function hasRetryAfter(error) {
|
|
5435
|
+
return error instanceof BuildsApiError
|
|
5436
|
+
&& error.status === 429
|
|
5437
|
+
&& error.retryAfterMs !== undefined;
|
|
5438
|
+
}
|
|
5439
|
+
// A permanent API refusal (expired session, revoked access, unknown run) will
|
|
5440
|
+
// never heal by re-polling; the loop must stop and surface it instead of
|
|
5441
|
+
// retrying forever. 429 stays retryable regardless of the server envelope.
|
|
5442
|
+
function isPermanentError(error) {
|
|
5443
|
+
return error instanceof BuildsApiError
|
|
5444
|
+
&& error.status !== 429
|
|
5445
|
+
&& error.retryable === false;
|
|
5446
|
+
}
|
|
5447
|
+
function newEvents(rows, lastSeq, seen) {
|
|
5448
|
+
const cursorBeforePoll = lastSeq;
|
|
5449
|
+
const fresh = [];
|
|
5450
|
+
let nextCursor = lastSeq;
|
|
5451
|
+
for (const event of rows) {
|
|
5452
|
+
if (!Number.isFinite(event === null || event === void 0 ? void 0 : event.seq))
|
|
5453
|
+
continue;
|
|
5454
|
+
nextCursor = Math.max(nextCursor, event.seq);
|
|
5455
|
+
if (event.seq <= cursorBeforePoll || seen.has(event.seq))
|
|
5456
|
+
continue;
|
|
5457
|
+
seen.add(event.seq);
|
|
5458
|
+
fresh.push(event);
|
|
5459
|
+
}
|
|
5460
|
+
return { events: fresh, lastSeq: nextCursor };
|
|
5461
|
+
}
|
|
5462
|
+
/**
|
|
5463
|
+
* Poll a build view and its event cursor until stopped or the run reaches a
|
|
5464
|
+
* known terminal state. Unknown state strings remain untouched and nonterminal.
|
|
5465
|
+
*/
|
|
5466
|
+
function watch(appId, runId, onUpdate, options = {}) {
|
|
5467
|
+
const startedAt = Date.now();
|
|
5468
|
+
const seenSeqs = new Set();
|
|
5469
|
+
let lastSeq = Number.isFinite(options.after)
|
|
5470
|
+
? Math.max(0, Math.floor(options.after))
|
|
5471
|
+
: 0;
|
|
5472
|
+
let timer;
|
|
5473
|
+
let active = true;
|
|
5474
|
+
let lastState;
|
|
5475
|
+
const stop = () => {
|
|
5476
|
+
active = false;
|
|
5477
|
+
if (timer !== undefined) {
|
|
5478
|
+
clearTimeout(timer);
|
|
5479
|
+
timer = undefined;
|
|
5480
|
+
}
|
|
5481
|
+
};
|
|
5482
|
+
const schedule = (delayMs) => {
|
|
5483
|
+
if (!active)
|
|
5484
|
+
return;
|
|
5485
|
+
timer = setTimeout(() => {
|
|
5486
|
+
timer = undefined;
|
|
5487
|
+
void poll();
|
|
5488
|
+
}, delayMs);
|
|
5489
|
+
};
|
|
5490
|
+
const reportError = (error) => {
|
|
5491
|
+
var _a;
|
|
5492
|
+
try {
|
|
5493
|
+
(_a = options.onError) === null || _a === void 0 ? void 0 : _a.call(options, error);
|
|
5494
|
+
}
|
|
5495
|
+
catch (_b) {
|
|
5496
|
+
// A consumer error callback must not break the transport loop.
|
|
5497
|
+
}
|
|
5498
|
+
};
|
|
5499
|
+
const publish = (run, events) => {
|
|
5500
|
+
try {
|
|
5501
|
+
onUpdate({ run, events });
|
|
5502
|
+
}
|
|
5503
|
+
catch (_a) {
|
|
5504
|
+
// Polling is transport state; consumer render errors must not strand it.
|
|
5505
|
+
}
|
|
5506
|
+
};
|
|
5507
|
+
const poll = async () => {
|
|
5508
|
+
if (!active)
|
|
5509
|
+
return;
|
|
5510
|
+
let run;
|
|
5511
|
+
try {
|
|
5512
|
+
const view = await get(appId, runId);
|
|
5513
|
+
if (!active)
|
|
5514
|
+
return;
|
|
5515
|
+
run = view.run;
|
|
5516
|
+
lastState = run.state;
|
|
5517
|
+
}
|
|
5518
|
+
catch (error) {
|
|
5519
|
+
if (!active)
|
|
5520
|
+
return;
|
|
5521
|
+
reportError(error);
|
|
5522
|
+
if (isPermanentError(error)) {
|
|
5523
|
+
stop();
|
|
5524
|
+
return;
|
|
5525
|
+
}
|
|
5526
|
+
schedule(retryCadence(error, lastState, Date.now() - startedAt));
|
|
5527
|
+
return;
|
|
5528
|
+
}
|
|
5529
|
+
try {
|
|
5530
|
+
const response = await events(appId, runId, lastSeq);
|
|
5531
|
+
if (!active)
|
|
5532
|
+
return;
|
|
5533
|
+
const deduped = newEvents(Array.isArray(response.events) ? response.events : [], lastSeq, seenSeqs);
|
|
5534
|
+
lastSeq = deduped.lastSeq;
|
|
5535
|
+
publish(run, deduped.events);
|
|
5536
|
+
}
|
|
5537
|
+
catch (error) {
|
|
5538
|
+
if (!active)
|
|
5539
|
+
return;
|
|
5540
|
+
// The view still advances UI state even when event replay is rate-limited.
|
|
5541
|
+
publish(run, []);
|
|
5542
|
+
reportError(error);
|
|
5543
|
+
if (terminalStates.has(run.state)) {
|
|
5544
|
+
// The run itself is done, but a rate-limited final event replay still
|
|
5545
|
+
// owes the caller its unseen seq rows. Honor Retry-After, retry the
|
|
5546
|
+
// piggyback once the limiter permits it, then stop after a successful
|
|
5547
|
+
// replay. Other terminal replay failures stop normally.
|
|
5548
|
+
if (hasRetryAfter(error)) {
|
|
5549
|
+
schedule(retryCadence(error, run.state, Date.now() - startedAt));
|
|
5550
|
+
return;
|
|
5551
|
+
}
|
|
5552
|
+
stop();
|
|
5553
|
+
return;
|
|
5554
|
+
}
|
|
5555
|
+
if (isPermanentError(error)) {
|
|
5556
|
+
stop();
|
|
5557
|
+
return;
|
|
5558
|
+
}
|
|
5559
|
+
schedule(retryCadence(error, run.state, Date.now() - startedAt));
|
|
5560
|
+
return;
|
|
5561
|
+
}
|
|
5562
|
+
if (!active)
|
|
5563
|
+
return;
|
|
5564
|
+
if (terminalStates.has(run.state)) {
|
|
5565
|
+
// Drain the remaining event pages before stopping: a resumed terminal
|
|
5566
|
+
// watch may owe the caller more rows than one page returns. Each page
|
|
5567
|
+
// advances the cursor, so the loop terminates; the cap is a backstop.
|
|
5568
|
+
for (let page = 0; page < 50 && active; page += 1) {
|
|
5569
|
+
let drained;
|
|
5570
|
+
try {
|
|
5571
|
+
const response = await events(appId, runId, lastSeq);
|
|
5572
|
+
if (!active)
|
|
5573
|
+
return;
|
|
5574
|
+
drained = newEvents(Array.isArray(response.events) ? response.events : [], lastSeq, seenSeqs);
|
|
5575
|
+
}
|
|
5576
|
+
catch (error) {
|
|
5577
|
+
reportError(error);
|
|
5578
|
+
break;
|
|
5579
|
+
}
|
|
5580
|
+
if (drained.events.length === 0)
|
|
5581
|
+
break;
|
|
5582
|
+
lastSeq = drained.lastSeq;
|
|
5583
|
+
publish(run, drained.events);
|
|
5584
|
+
}
|
|
5585
|
+
stop();
|
|
5586
|
+
return;
|
|
5587
|
+
}
|
|
5588
|
+
schedule(pollCadence(run.state, Date.now() - startedAt));
|
|
5589
|
+
};
|
|
5590
|
+
void poll();
|
|
5591
|
+
return { stop };
|
|
5592
|
+
}
|
|
5593
|
+
|
|
5594
|
+
var _a;
|
|
5595
|
+
// SSR guard (mirrors useAuth): no hooks/subscriptions during Node server render.
|
|
5596
|
+
// React Native has no `window` but DOES support hooks, so detect Node SSR
|
|
5597
|
+
// specifically via process.versions.node.
|
|
5598
|
+
const isSSR = typeof window === 'undefined'
|
|
5599
|
+
&& typeof process !== 'undefined'
|
|
5600
|
+
&& !!((_a = process.versions) === null || _a === void 0 ? void 0 : _a.node);
|
|
5601
|
+
function useBuildRun(appId, runId, options) {
|
|
5602
|
+
if (isSSR) {
|
|
5603
|
+
return { run: null, events: [], loading: true, error: null };
|
|
5604
|
+
}
|
|
5605
|
+
const [run, setRun] = React__namespace.useState(null);
|
|
5606
|
+
const [events, setEvents] = React__namespace.useState([]);
|
|
5607
|
+
const [loading, setLoading] = React__namespace.useState(true);
|
|
5608
|
+
const [error, setError] = React__namespace.useState(null);
|
|
5609
|
+
const optionsKey = options ? JSON.stringify(options) : '';
|
|
5610
|
+
React__namespace.useEffect(() => {
|
|
5611
|
+
setRun(null);
|
|
5612
|
+
setEvents([]);
|
|
5613
|
+
setError(null);
|
|
5614
|
+
if (!appId || !runId) {
|
|
5615
|
+
setLoading(false);
|
|
5616
|
+
return;
|
|
5617
|
+
}
|
|
5618
|
+
let active = true;
|
|
5619
|
+
setLoading(true);
|
|
5620
|
+
const handle = watch(appId, runId, ({ run: nextRun, events: nextEvents }) => {
|
|
5621
|
+
if (!active)
|
|
5622
|
+
return;
|
|
5623
|
+
setRun(nextRun);
|
|
5624
|
+
if (nextEvents.length > 0) {
|
|
5625
|
+
setEvents((current) => {
|
|
5626
|
+
const seen = new Set(current.map((event) => event.seq));
|
|
5627
|
+
return [...current, ...nextEvents.filter((event) => !seen.has(event.seq))];
|
|
5628
|
+
});
|
|
5629
|
+
}
|
|
5630
|
+
setError(null);
|
|
5631
|
+
setLoading(false);
|
|
5632
|
+
}, Object.assign(Object.assign({}, options), { onError: (value) => {
|
|
5633
|
+
if (!active)
|
|
5634
|
+
return;
|
|
5635
|
+
setError(value instanceof Error ? value : new Error(String(value)));
|
|
5636
|
+
setLoading(false);
|
|
5637
|
+
} }));
|
|
5638
|
+
return () => {
|
|
5639
|
+
active = false;
|
|
5640
|
+
handle.stop();
|
|
5641
|
+
};
|
|
5642
|
+
// optionsKey captures the option object's contents; ids are the other inputs.
|
|
5643
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
5644
|
+
}, [appId, runId, optionsKey]);
|
|
5645
|
+
return { run, events, loading, error };
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5648
|
+
/**
|
|
5649
|
+
* Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
|
|
5650
|
+
* dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
|
|
5651
|
+
*/
|
|
5652
|
+
const builds = {
|
|
5653
|
+
submit,
|
|
5654
|
+
get,
|
|
5655
|
+
events,
|
|
5656
|
+
cancel,
|
|
5657
|
+
decideGate,
|
|
5658
|
+
topup,
|
|
5659
|
+
list: list$1,
|
|
5660
|
+
watch,
|
|
5661
|
+
};
|
|
5662
|
+
|
|
5663
|
+
async function create(options = {}) {
|
|
5664
|
+
const body = Object.assign(Object.assign(Object.assign(Object.assign({}, (options.name !== undefined ? { name: options.name } : {})), (options.prompt !== undefined ? { prompt: options.prompt } : {})), (options.clientToken !== undefined ? { clientToken: options.clientToken } : {})), (options.intent !== undefined ? { intent: options.intent } : {}));
|
|
5665
|
+
const app = await requestDevApi('/apps/new', {
|
|
5666
|
+
method: 'POST',
|
|
5667
|
+
body,
|
|
5668
|
+
});
|
|
5669
|
+
return Object.assign(Object.assign({ appId: app.appId }, (typeof app.slug === 'string' && app.slug ? { slug: app.slug } : {})), { url: app.url,
|
|
5670
|
+
// Fail closed against an older server response that omitted this field.
|
|
5671
|
+
policySeeded: app.policySeeded === true });
|
|
5672
|
+
}
|
|
5673
|
+
async function list() {
|
|
5674
|
+
// This legacy-compatible action shape is also used by oapps.fun listMyApps.
|
|
5675
|
+
const response = await requestDevApi('/', {
|
|
5676
|
+
method: 'POST',
|
|
5677
|
+
body: { action: 'listApps' },
|
|
5678
|
+
});
|
|
5679
|
+
const rows = Array.isArray(response.apps) ? response.apps : [];
|
|
5680
|
+
return rows
|
|
5681
|
+
.map((value) => {
|
|
5682
|
+
var _a, _b, _c, _d;
|
|
5683
|
+
const row = value && typeof value === 'object'
|
|
5684
|
+
? value
|
|
5685
|
+
: {};
|
|
5686
|
+
const appId = String((_c = (_b = (_a = row._id) !== null && _a !== void 0 ? _a : row.id) !== null && _b !== void 0 ? _b : row.appId) !== null && _c !== void 0 ? _c : '');
|
|
5687
|
+
if (!/^[a-f0-9]{24}$/i.test(appId))
|
|
5688
|
+
return null;
|
|
5689
|
+
const name = String((_d = row.name) !== null && _d !== void 0 ? _d : '').trim() || '(unnamed app)';
|
|
5690
|
+
const slug = typeof row.slug === 'string' && row.slug ? row.slug : undefined;
|
|
5691
|
+
const url = typeof row.url === 'string' && row.url.trim() ? row.url.trim() : undefined;
|
|
5692
|
+
return Object.assign(Object.assign({ appId,
|
|
5693
|
+
name }, (slug ? { slug } : {})), (url ? { url } : {}));
|
|
5694
|
+
})
|
|
5695
|
+
.filter((app) => app !== null);
|
|
5696
|
+
}
|
|
5697
|
+
/**
|
|
5698
|
+
* Platform first-party surfaces only (bounded.sh, oapps.fun, localhost) —
|
|
5699
|
+
* dev-api CORS blocks calls from generated-app origins. Server-side callers unaffected.
|
|
5700
|
+
*/
|
|
5701
|
+
const apps = { create, list };
|
|
5702
|
+
|
|
4907
5703
|
async function deserializeTransaction(tx) {
|
|
4908
5704
|
// Literal specifier so bundlers can code-split the lazy chunk.
|
|
4909
5705
|
const { Transaction, VersionedTransaction } = await import('@solana/web3.js');
|
|
@@ -4916,11 +5712,6 @@ async function deserializeTransaction(tx) {
|
|
|
4916
5712
|
}
|
|
4917
5713
|
}
|
|
4918
5714
|
|
|
4919
|
-
// Wrapper for getIdToken - passes isServer=false for client-side usage
|
|
4920
|
-
async function getIdToken() {
|
|
4921
|
-
return core.getIdToken(false);
|
|
4922
|
-
}
|
|
4923
|
-
|
|
4924
5715
|
/**
|
|
4925
5716
|
* Extracts a human-readable error message from Solana transaction logs.
|
|
4926
5717
|
*/
|
|
@@ -5316,15 +6107,110 @@ class PrivyExpoProvider {
|
|
|
5316
6107
|
}
|
|
5317
6108
|
}
|
|
5318
6109
|
|
|
6110
|
+
/**
|
|
6111
|
+
* Default provider discovery: Phantom-first, then any Wallet-Standard
|
|
6112
|
+
* `window.solana`. Kept tiny + synchronous (no heavy imports) so it works inside
|
|
6113
|
+
* a user gesture and can be eagerly exported from the SDK entry.
|
|
6114
|
+
*/
|
|
6115
|
+
function defaultInjectedProvider() {
|
|
6116
|
+
var _a;
|
|
6117
|
+
if (typeof window === 'undefined')
|
|
6118
|
+
return null;
|
|
6119
|
+
const w = window;
|
|
6120
|
+
const phantom = (_a = w === null || w === void 0 ? void 0 : w.phantom) === null || _a === void 0 ? void 0 : _a.solana;
|
|
6121
|
+
if (phantom && typeof phantom.signMessage === 'function')
|
|
6122
|
+
return phantom;
|
|
6123
|
+
const generic = w === null || w === void 0 ? void 0 : w.solana;
|
|
6124
|
+
if (generic && typeof generic.signMessage === 'function')
|
|
6125
|
+
return generic;
|
|
6126
|
+
return null;
|
|
6127
|
+
}
|
|
6128
|
+
|
|
6129
|
+
// injected-evm-wallet-types.ts — tiny, dependency-free surface for the EVM
|
|
6130
|
+
// WALLET LOGIN path (BYO wallet via SIWE). The EVM twin of
|
|
6131
|
+
// injected-wallet-types.ts: kept separate from injected-evm-wallet-provider.ts
|
|
6132
|
+
// so the SDK entry can eagerly export the type surface + the provider-discovery
|
|
6133
|
+
// helper WITHOUT dragging the provider class into the default bundle. The
|
|
6134
|
+
// provider is lazy-loaded by getAuthProvider() when an app opts into
|
|
6135
|
+
// authMethod:'evm-wallet'.
|
|
6136
|
+
//
|
|
6137
|
+
// It rides the standard EIP-1193 injected provider a browser wallet exposes
|
|
6138
|
+
// (MetaMask / Rabby / Coinbase Wallet / any window.ethereum), discovered via
|
|
6139
|
+
// EIP-6963 (multi-wallet, collision-free) with a window.ethereum fallback. It
|
|
6140
|
+
// needs NO viem/ethers and NO React — EIP-1193 request() + hex strings suffice.
|
|
6141
|
+
// EIP-6963 is announcement-based: wallets add an `eip6963:requestProvider`
|
|
6142
|
+
// listener and synchronously dispatch `eip6963:announceProvider` in response. We
|
|
6143
|
+
// keep a persistent collector so announcements (including late ones) are
|
|
6144
|
+
// captured, and re-request on demand.
|
|
6145
|
+
const announcedProviders = [];
|
|
6146
|
+
let announceListenerAttached = false;
|
|
6147
|
+
function attachAnnounceListener() {
|
|
6148
|
+
if (announceListenerAttached || typeof window === 'undefined')
|
|
6149
|
+
return;
|
|
6150
|
+
announceListenerAttached = true;
|
|
6151
|
+
window.addEventListener('eip6963:announceProvider', (event) => {
|
|
6152
|
+
const detail = event === null || event === void 0 ? void 0 : event.detail;
|
|
6153
|
+
if (detail &&
|
|
6154
|
+
detail.provider &&
|
|
6155
|
+
typeof detail.provider.request === 'function' &&
|
|
6156
|
+
!announcedProviders.some((d) => { var _a, _b; return ((_a = d.info) === null || _a === void 0 ? void 0 : _a.uuid) === ((_b = detail.info) === null || _b === void 0 ? void 0 : _b.uuid); })) {
|
|
6157
|
+
announcedProviders.push(detail);
|
|
6158
|
+
}
|
|
6159
|
+
});
|
|
6160
|
+
}
|
|
6161
|
+
/**
|
|
6162
|
+
* Request + collect EIP-6963 providers. Dispatches `eip6963:requestProvider`
|
|
6163
|
+
* (synchronous — already-loaded wallets announce in the same tick) and returns
|
|
6164
|
+
* every wallet announced so far. Kept synchronous so it works inside a user
|
|
6165
|
+
* gesture and can be eagerly exported from the SDK entry.
|
|
6166
|
+
*/
|
|
6167
|
+
function requestEip6963Providers() {
|
|
6168
|
+
if (typeof window === 'undefined')
|
|
6169
|
+
return [];
|
|
6170
|
+
attachAnnounceListener();
|
|
6171
|
+
try {
|
|
6172
|
+
window.dispatchEvent(new Event('eip6963:requestProvider'));
|
|
6173
|
+
}
|
|
6174
|
+
catch (_a) {
|
|
6175
|
+
/* older browsers without Event constructor — fall through to window.ethereum */
|
|
6176
|
+
}
|
|
6177
|
+
return announcedProviders.slice();
|
|
6178
|
+
}
|
|
6179
|
+
/**
|
|
6180
|
+
* Default EVM provider discovery: EIP-6963 first (multi-wallet, collision-free),
|
|
6181
|
+
* then legacy `window.ethereum`. Returns null when no injected wallet is present.
|
|
6182
|
+
*/
|
|
6183
|
+
function defaultInjectedEvmProvider() {
|
|
6184
|
+
if (typeof window === 'undefined')
|
|
6185
|
+
return null;
|
|
6186
|
+
const details = requestEip6963Providers();
|
|
6187
|
+
if (details.length > 0)
|
|
6188
|
+
return details[0].provider;
|
|
6189
|
+
const eth = window.ethereum;
|
|
6190
|
+
if (eth && typeof eth.request === 'function')
|
|
6191
|
+
return eth;
|
|
6192
|
+
return null;
|
|
6193
|
+
}
|
|
6194
|
+
|
|
6195
|
+
exports.BuildsApiError = BuildsApiError;
|
|
5319
6196
|
exports.EMBEDDED_WALLET_UNSUPPORTED = EMBEDDED_WALLET_UNSUPPORTED;
|
|
6197
|
+
exports.FAILURE_REASONS = FAILURE_REASONS;
|
|
6198
|
+
exports.NON_TERMINAL_STATES = NON_TERMINAL_STATES;
|
|
5320
6199
|
exports.OffchainAuthProvider = OffchainAuthProvider;
|
|
6200
|
+
exports.PARK_REASONS = PARK_REASONS;
|
|
5321
6201
|
exports.PrivyExpoProvider = PrivyExpoProvider;
|
|
6202
|
+
exports.RUN_STATES = RUN_STATES;
|
|
5322
6203
|
exports.SURFNET_RPC_URL = SURFNET_RPC_URL;
|
|
6204
|
+
exports.TERMINAL_STATES = TERMINAL_STATES;
|
|
6205
|
+
exports.apps = apps;
|
|
5323
6206
|
exports.bs58 = bs58;
|
|
5324
6207
|
exports.bufferExports = bufferExports;
|
|
6208
|
+
exports.builds = builds;
|
|
5325
6209
|
exports.completeLoginFromRedirect = completeLoginFromRedirect;
|
|
5326
6210
|
exports.completeLoginInPopup = completeLoginInPopup;
|
|
5327
6211
|
exports.confirmAndCheckTransaction = confirmAndCheckTransaction;
|
|
6212
|
+
exports.defaultInjectedEvmProvider = defaultInjectedEvmProvider;
|
|
6213
|
+
exports.defaultInjectedProvider = defaultInjectedProvider;
|
|
5328
6214
|
exports.deserializeTransaction = deserializeTransaction;
|
|
5329
6215
|
exports.embeddedRunEvmTransaction = embeddedRunEvmTransaction;
|
|
5330
6216
|
exports.embeddedSignAndSubmit = embeddedSignAndSubmit;
|
|
@@ -5344,10 +6230,13 @@ exports.logout = logout;
|
|
|
5344
6230
|
exports.normalizeSolanaRpcUrl = normalizeSolanaRpcUrl;
|
|
5345
6231
|
exports.onAuthLoadingChanged = onAuthLoadingChanged;
|
|
5346
6232
|
exports.onAuthStateChanged = onAuthStateChanged;
|
|
6233
|
+
exports.requestEip6963Providers = requestEip6963Providers;
|
|
5347
6234
|
exports.resolveSolanaRpcUrl = resolveSolanaRpcUrl;
|
|
5348
6235
|
exports.setAuthLoading = setAuthLoading;
|
|
5349
6236
|
exports.setCurrentUser = setCurrentUser;
|
|
5350
6237
|
exports.setPlatform = setPlatform;
|
|
5351
6238
|
exports.signInAnonymously = signInAnonymously;
|
|
5352
6239
|
exports.useAuth = useAuth;
|
|
5353
|
-
|
|
6240
|
+
exports.useBuildRun = useBuildRun;
|
|
6241
|
+
exports.useQuery = useQuery;
|
|
6242
|
+
//# sourceMappingURL=index-BsrZb496.js.map
|