@bounded-sh/client 0.0.55 → 0.0.57
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/REACT_NATIVE.md +31 -8
- package/dist/auth/bounded-login-widget.d.ts +25 -0
- package/dist/auth/bounded-widget-modal.d.ts +33 -0
- package/dist/auth/index.d.ts +42 -0
- package/dist/auth/oidc-auth.d.ts +18 -0
- package/dist/auth/providers/wallet-login-finalize.d.ts +17 -0
- package/dist/auth/providers/wallet-standard-discovery.d.ts +23 -0
- package/dist/auth/providers/wallet-standard-tx.d.ts +7 -0
- package/dist/auth/turnkey-auth.d.ts +17 -0
- package/dist/auth/turnkey-signer-bridge.d.ts +32 -0
- package/dist/auth/turnkey-wallet-widget.d.ts +17 -0
- package/dist/{email-auth-provider-BaZceaov.js → email-auth-provider-8k8iBIQL.js} +2 -2
- package/dist/{email-auth-provider-BaZceaov.js.map → email-auth-provider-8k8iBIQL.js.map} +1 -1
- package/dist/{email-auth-provider-lVwM8vRR.js → email-auth-provider-BlJI-8w9.js} +2 -2
- package/dist/{email-auth-provider-lVwM8vRR.js.map → email-auth-provider-BlJI-8w9.js.map} +1 -1
- package/dist/{email-auth-provider-yBbGzH2e.mjs → email-auth-provider-Bmah1GWS.mjs} +2 -2
- package/dist/{email-auth-provider-yBbGzH2e.mjs.map → email-auth-provider-Bmah1GWS.mjs.map} +1 -1
- package/dist/{email-auth-provider-BKl9GgHV.mjs → email-auth-provider-CfNSS8Du.mjs} +2 -2
- package/dist/{email-auth-provider-BKl9GgHV.mjs.map → email-auth-provider-CfNSS8Du.mjs.map} +1 -1
- package/dist/{guest-auth-provider-DhN9PoAi.js → guest-auth-provider-BRjJV8Zq.js} +2 -2
- package/dist/{guest-auth-provider-DhN9PoAi.js.map → guest-auth-provider-BRjJV8Zq.js.map} +1 -1
- package/dist/{guest-auth-provider-DTKczntw.js → guest-auth-provider-BjfjrpdW.js} +2 -2
- package/dist/{guest-auth-provider-DTKczntw.js.map → guest-auth-provider-BjfjrpdW.js.map} +1 -1
- package/dist/{guest-auth-provider-BnugW3TI.mjs → guest-auth-provider-D6h4eAtx.mjs} +2 -2
- package/dist/{guest-auth-provider-Dgs8zcnC.mjs.map → guest-auth-provider-D6h4eAtx.mjs.map} +1 -1
- package/dist/{guest-auth-provider-Dgs8zcnC.mjs → guest-auth-provider-DxhZ5sWN.mjs} +2 -2
- package/dist/{guest-auth-provider-BnugW3TI.mjs.map → guest-auth-provider-DxhZ5sWN.mjs.map} +1 -1
- package/dist/{index.native-aSo8M0A8.mjs → index-C7rOe6B2.mjs} +1745 -24
- package/dist/index-C7rOe6B2.mjs.map +1 -0
- package/dist/{index.native-CouprxZp.js → index-CnObYQhV.js} +1752 -22
- package/dist/index-CnObYQhV.js.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index-DkdIADby.mjs → index.native-CQiw9baS.mjs} +29 -94
- package/dist/index.native-CQiw9baS.mjs.map +1 -0
- package/dist/{index-CXVwyR6_.js → index.native-hu3o3zXU.js} +28 -96
- package/dist/index.native-hu3o3zXU.js.map +1 -0
- package/dist/index.native.d.ts +2 -0
- package/dist/index.native.js +2 -1
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-CtrS-gLC.js → injected-evm-wallet-provider-CcwS6p3o.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CtrS-gLC.js.map → injected-evm-wallet-provider-CcwS6p3o.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BgiFW_kf.mjs → injected-evm-wallet-provider-DCGnUedJ.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BgiFW_kf.mjs.map → injected-evm-wallet-provider-DCGnUedJ.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-D7fd42En.mjs → injected-evm-wallet-provider-DIWeWiAN.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-D7fd42En.mjs.map → injected-evm-wallet-provider-DIWeWiAN.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-CiCeS1n2.js → injected-evm-wallet-provider-Xbt2CUPi.js} +2 -2
- package/dist/{injected-evm-wallet-provider-CiCeS1n2.js.map → injected-evm-wallet-provider-Xbt2CUPi.js.map} +1 -1
- package/dist/{injected-wallet-provider-CST-B9EE.js → injected-wallet-provider-7ep-jcal.js} +2 -2
- package/dist/{injected-wallet-provider-CST-B9EE.js.map → injected-wallet-provider-7ep-jcal.js.map} +1 -1
- package/dist/{injected-wallet-provider-Bic6GpDr.js → injected-wallet-provider-B_jQFifE.js} +2 -2
- package/dist/{injected-wallet-provider-Bic6GpDr.js.map → injected-wallet-provider-B_jQFifE.js.map} +1 -1
- package/dist/{injected-wallet-provider-CRG9TaA9.mjs → injected-wallet-provider-Bps6a9IP.mjs} +2 -2
- package/dist/{injected-wallet-provider-CRG9TaA9.mjs.map → injected-wallet-provider-Bps6a9IP.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-BhpwmpgW.mjs → injected-wallet-provider-CFnqSsHy.mjs} +2 -2
- package/dist/{injected-wallet-provider-BhpwmpgW.mjs.map → injected-wallet-provider-CFnqSsHy.mjs.map} +1 -1
- package/dist/wallet-standard-tx-C1HJFLjC.js +30 -0
- package/dist/wallet-standard-tx-C1HJFLjC.js.map +1 -0
- package/dist/wallet-standard-tx-DBliTUWH.mjs +27 -0
- package/dist/wallet-standard-tx-DBliTUWH.mjs.map +1 -0
- package/package.json +9 -3
- package/dist/index-CXVwyR6_.js.map +0 -1
- package/dist/index-DkdIADby.mjs.map +0 -1
- package/dist/index.native-CouprxZp.js.map +0 -1
- package/dist/index.native-aSo8M0A8.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export { init, getCurrentUser, onAuthStateChanged, onAuthLoadingChanged, getAuthLoading, login, logout, } from "./global";
|
|
2
2
|
export type { LoginOptions, LogoutOptions } from "./global";
|
|
3
3
|
export { getConfig } from "@bounded-sh/core";
|
|
4
|
-
export { getAuthProvider, signInAnonymously, loginWithPrivy } from "./auth";
|
|
4
|
+
export { getAuthProvider, signInAnonymously, loginWithPrivy, loginWithWallet } from "./auth";
|
|
5
5
|
export { loginWithRedirect, completeLoginFromRedirect, loginWithPopup, completeLoginInPopup } from "./auth";
|
|
6
6
|
export type { HostedAuthMethod, OidcLoginOptions, PopupLoginOptions } from "./auth";
|
|
7
|
+
export { openBoundedWidget } from "./auth/bounded-login-widget";
|
|
8
|
+
export type { BoundedWidgetOptions } from "./auth/bounded-login-widget";
|
|
7
9
|
export { get, getMany, docId, 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";
|
|
8
10
|
export type { GetOptions as BoundedGetOptions } from "@bounded-sh/core";
|
|
9
11
|
export { subscribe } from "@bounded-sh/core";
|
|
@@ -23,6 +25,10 @@ export * from "./builds";
|
|
|
23
25
|
export { apps } from "./builds/apps";
|
|
24
26
|
export type { AppListItem, CreatedApp, CreateAppOptions } from "./builds/apps";
|
|
25
27
|
export { deserializeTransaction } from "./auth/providers/sol/sol-utils";
|
|
28
|
+
export { signSolanaMessageViaTurnkey, getOrCreateTurnkeyWallet } from "./auth/turnkey-signer-bridge";
|
|
29
|
+
export type { TurnkeySignResult, TurnkeyWallet } from "./auth/turnkey-signer-bridge";
|
|
30
|
+
export { startTurnkeyEmailLogin } from "./auth/turnkey-auth";
|
|
31
|
+
export type { TurnkeyEmailLoginHandle } from "./auth/turnkey-auth";
|
|
26
32
|
export { getIdToken } from "./utils";
|
|
27
33
|
export { setPlatform, getPlatform } from "./platform";
|
|
28
34
|
export type { PlatformAdapter, StorageAdapter } from "./platform";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-CnObYQhV.js');
|
|
4
4
|
var core = require('@bounded-sh/core');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -28,18 +28,23 @@ exports.getAuthLoading = index.getAuthLoading;
|
|
|
28
28
|
exports.getAuthProvider = index.getAuthProvider;
|
|
29
29
|
exports.getCurrentUser = index.getCurrentUser;
|
|
30
30
|
exports.getIdToken = index.getIdToken;
|
|
31
|
+
exports.getOrCreateTurnkeyWallet = index.getOrCreateTurnkeyWallet;
|
|
31
32
|
exports.getPlatform = index.getPlatform;
|
|
32
33
|
exports.init = index.init;
|
|
33
34
|
exports.login = index.login;
|
|
34
35
|
exports.loginWithPopup = index.loginWithPopup;
|
|
35
36
|
exports.loginWithPrivy = index.loginWithPrivy;
|
|
36
37
|
exports.loginWithRedirect = index.loginWithRedirect;
|
|
38
|
+
exports.loginWithWallet = index.loginWithWallet;
|
|
37
39
|
exports.logout = index.logout;
|
|
38
40
|
exports.onAuthLoadingChanged = index.onAuthLoadingChanged;
|
|
39
41
|
exports.onAuthStateChanged = index.onAuthStateChanged;
|
|
42
|
+
exports.openBoundedWidget = index.openBoundedWidget;
|
|
40
43
|
exports.requestEip6963Providers = index.requestEip6963Providers;
|
|
41
44
|
exports.setPlatform = index.setPlatform;
|
|
42
45
|
exports.signInAnonymously = index.signInAnonymously;
|
|
46
|
+
exports.signSolanaMessageViaTurnkey = index.signSolanaMessageViaTurnkey;
|
|
47
|
+
exports.startTurnkeyEmailLogin = index.startTurnkeyEmailLogin;
|
|
43
48
|
exports.useAuth = index.useAuth;
|
|
44
49
|
exports.useBuildRun = index.useBuildRun;
|
|
45
50
|
exports.useQuery = index.useQuery;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { $ as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, _ as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, Z as BUILD_REVIEW_CAPABILITY_SCHEMA, T as BuildsApiError, Y as FAILURE_REASONS, U as NON_TERMINAL_STATES, P as OffchainAuthProvider, X as PARK_REASONS, Q as PrivyExpoProvider, W as RUN_STATES, V as TERMINAL_STATES, I as apps, S as builds, A as completeLoginFromRedirect, C as completeLoginInPopup, k as defaultInjectedEvmProvider, d as defaultInjectedProvider, J as deserializeTransaction, q as getAuthLoading, v as getAuthProvider, m as getCurrentUser, N as getIdToken, L as getOrCreateTurnkeyWallet, g as getPlatform, l as init, t as login, B as loginWithPopup, x as loginWithPrivy, z as loginWithRedirect, y as loginWithWallet, u as logout, p as onAuthLoadingChanged, o as onAuthStateChanged, D as openBoundedWidget, R as requestEip6963Providers, O as setPlatform, w as signInAnonymously, K as signSolanaMessageViaTurnkey, M as startTurnkeyEmailLogin, F as useAuth, H as useBuildRun, G as useQuery } from './index-C7rOe6B2.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
3
|
export { BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, ScopedClientReadOnlyError, aggregate, count, createClient, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, get, getConfig, getFiles, getMany, queryAggregate, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -3809,6 +3809,11 @@ function appendHostedLoginHints(params, opts) {
|
|
|
3809
3809
|
const provider = normalizeMethod(opts.provider);
|
|
3810
3810
|
if (provider)
|
|
3811
3811
|
params.set('bounded_provider', provider);
|
|
3812
|
+
// login_hint: an identifier (usually an email) to prefill on the hosted page.
|
|
3813
|
+
// Kept short and free of control chars; the hosted page validates before use.
|
|
3814
|
+
const hint = String(opts.loginHint || '').trim();
|
|
3815
|
+
if (hint && hint.length <= 320 && !/[\s<>"']/.test(hint))
|
|
3816
|
+
params.set('login_hint', hint);
|
|
3812
3817
|
// Standard OIDC prompt (e.g. 'login' to force a fresh sign-in / account choice).
|
|
3813
3818
|
const prompt = normalizeMethod(opts.prompt);
|
|
3814
3819
|
if (prompt)
|
|
@@ -4443,7 +4448,7 @@ async function getAuthProvider(config) {
|
|
|
4443
4448
|
// manager as legacy email sessions. Human login should be started
|
|
4444
4449
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
4445
4450
|
// logout surface for those sessions.
|
|
4446
|
-
currentAuthProvider = new (await import('./email-auth-provider-
|
|
4451
|
+
currentAuthProvider = new (await import('./email-auth-provider-CfNSS8Du.mjs')).EmailAuthProvider();
|
|
4447
4452
|
break;
|
|
4448
4453
|
case "wallet":
|
|
4449
4454
|
case "phantom": {
|
|
@@ -4462,7 +4467,7 @@ async function getAuthProvider(config) {
|
|
|
4462
4467
|
if (!isWalletLoginEnabled(config)) {
|
|
4463
4468
|
throw walletLoginNotEnabledError(authMethod);
|
|
4464
4469
|
}
|
|
4465
|
-
const { InjectedWalletProvider } = await import('./injected-wallet-provider-
|
|
4470
|
+
const { InjectedWalletProvider } = await import('./injected-wallet-provider-Bps6a9IP.mjs');
|
|
4466
4471
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
4467
4472
|
break;
|
|
4468
4473
|
}
|
|
@@ -4475,7 +4480,7 @@ async function getAuthProvider(config) {
|
|
|
4475
4480
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
4476
4481
|
// to point at a specific wallet or set chainId/domain.
|
|
4477
4482
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
4478
|
-
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-
|
|
4483
|
+
const { InjectedEvmWalletProvider } = await import('./injected-evm-wallet-provider-DCGnUedJ.mjs');
|
|
4479
4484
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
4480
4485
|
break;
|
|
4481
4486
|
}
|
|
@@ -4503,7 +4508,7 @@ async function getAuthProvider(config) {
|
|
|
4503
4508
|
break;
|
|
4504
4509
|
case "guest":
|
|
4505
4510
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
4506
|
-
currentAuthProvider = new (await import('./guest-auth-provider-
|
|
4511
|
+
currentAuthProvider = new (await import('./guest-auth-provider-DxhZ5sWN.mjs')).GuestAuthProvider();
|
|
4507
4512
|
break;
|
|
4508
4513
|
}
|
|
4509
4514
|
if (!currentAuthProvider) {
|
|
@@ -4559,7 +4564,7 @@ async function signInAnonymously() {
|
|
|
4559
4564
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
4560
4565
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
4561
4566
|
// so bundle-splitting can see it.
|
|
4562
|
-
const provider = new (await import('./guest-auth-provider-
|
|
4567
|
+
const provider = new (await import('./guest-auth-provider-DxhZ5sWN.mjs')).GuestAuthProvider();
|
|
4563
4568
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
4564
4569
|
const commit = (user) => {
|
|
4565
4570
|
// No await/interleaving inside this block: provider/method/config/marker
|
|
@@ -5421,9 +5426,11 @@ const BUILD_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-review-capability.v1';
|
|
|
5421
5426
|
const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA = 'bounded.build-review-capability-refresh.v1';
|
|
5422
5427
|
const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA = 'bounded.build-delegated-review-capability.v1';
|
|
5423
5428
|
|
|
5429
|
+
const FAST_POLL_MS = 1000;
|
|
5424
5430
|
const NORMAL_POLL_MS = 2000;
|
|
5425
5431
|
const PARKED_POLL_MS = 5000;
|
|
5426
5432
|
const LONG_RUNNING_POLL_MS = 10000;
|
|
5433
|
+
const THIRTY_SECONDS_MS = 30000;
|
|
5427
5434
|
const TWO_MINUTES_MS = 2 * 60000;
|
|
5428
5435
|
const TEN_MINUTES_MS = 10 * 60000;
|
|
5429
5436
|
const terminalStates = new Set(TERMINAL_STATES);
|
|
@@ -5432,6 +5439,10 @@ function pollCadence(state, elapsedMs) {
|
|
|
5432
5439
|
return LONG_RUNNING_POLL_MS;
|
|
5433
5440
|
if ((state === null || state === void 0 ? void 0 : state.startsWith('parked')) || elapsedMs >= TWO_MINUTES_MS)
|
|
5434
5441
|
return PARKED_POLL_MS;
|
|
5442
|
+
// The first 30s is where the user is staring at "waiting for a build slot" /
|
|
5443
|
+
// "building" and every transition matters most; poll fast, then relax.
|
|
5444
|
+
if (elapsedMs < THIRTY_SECONDS_MS)
|
|
5445
|
+
return FAST_POLL_MS;
|
|
5435
5446
|
return NORMAL_POLL_MS;
|
|
5436
5447
|
}
|
|
5437
5448
|
function retryCadence(error, state, elapsedMs) {
|
|
@@ -5517,9 +5528,18 @@ function watch(appId, runId, onUpdate, options = {}) {
|
|
|
5517
5528
|
const poll = async () => {
|
|
5518
5529
|
if (!active)
|
|
5519
5530
|
return;
|
|
5531
|
+
// Fire the view and the events page concurrently: the events cursor (lastSeq)
|
|
5532
|
+
// does not depend on the run view, so there is no reason to pay two serial
|
|
5533
|
+
// round-trips per tick. Error semantics below are unchanged — the run result
|
|
5534
|
+
// still gates, and a failed events page still publishes the run with no rows.
|
|
5535
|
+
const runPromise = get(appId, runId);
|
|
5536
|
+
const eventsPromise = events(appId, runId, lastSeq);
|
|
5537
|
+
// Keep the in-flight events page from becoming an unhandled rejection if the
|
|
5538
|
+
// run result makes us bail before awaiting it; the real await below still sees it.
|
|
5539
|
+
eventsPromise.catch(() => { });
|
|
5520
5540
|
let run;
|
|
5521
5541
|
try {
|
|
5522
|
-
const view = await
|
|
5542
|
+
const view = await runPromise;
|
|
5523
5543
|
if (!active)
|
|
5524
5544
|
return;
|
|
5525
5545
|
run = view.run;
|
|
@@ -5537,7 +5557,7 @@ function watch(appId, runId, onUpdate, options = {}) {
|
|
|
5537
5557
|
return;
|
|
5538
5558
|
}
|
|
5539
5559
|
try {
|
|
5540
|
-
const response = await
|
|
5560
|
+
const response = await eventsPromise;
|
|
5541
5561
|
if (!active)
|
|
5542
5562
|
return;
|
|
5543
5563
|
const deduped = newEvents(Array.isArray(response.events) ? response.events : [], lastSeq, seenSeqs);
|
|
@@ -6129,90 +6149,5 @@ class PrivyExpoProvider {
|
|
|
6129
6149
|
}
|
|
6130
6150
|
}
|
|
6131
6151
|
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
* `window.solana`. Kept tiny + synchronous (no heavy imports) so it works inside
|
|
6135
|
-
* a user gesture and can be eagerly exported from the SDK entry.
|
|
6136
|
-
*/
|
|
6137
|
-
function defaultInjectedProvider() {
|
|
6138
|
-
var _a;
|
|
6139
|
-
if (typeof window === 'undefined')
|
|
6140
|
-
return null;
|
|
6141
|
-
const w = window;
|
|
6142
|
-
const phantom = (_a = w === null || w === void 0 ? void 0 : w.phantom) === null || _a === void 0 ? void 0 : _a.solana;
|
|
6143
|
-
if (phantom && typeof phantom.signMessage === 'function')
|
|
6144
|
-
return phantom;
|
|
6145
|
-
const generic = w === null || w === void 0 ? void 0 : w.solana;
|
|
6146
|
-
if (generic && typeof generic.signMessage === 'function')
|
|
6147
|
-
return generic;
|
|
6148
|
-
return null;
|
|
6149
|
-
}
|
|
6150
|
-
|
|
6151
|
-
// injected-evm-wallet-types.ts — tiny, dependency-free surface for the EVM
|
|
6152
|
-
// WALLET LOGIN path (BYO wallet via SIWE). The EVM twin of
|
|
6153
|
-
// injected-wallet-types.ts: kept separate from injected-evm-wallet-provider.ts
|
|
6154
|
-
// so the SDK entry can eagerly export the type surface + the provider-discovery
|
|
6155
|
-
// helper WITHOUT dragging the provider class into the default bundle. The
|
|
6156
|
-
// provider is lazy-loaded by getAuthProvider() when an app opts into
|
|
6157
|
-
// authMethod:'evm-wallet'.
|
|
6158
|
-
//
|
|
6159
|
-
// It rides the standard EIP-1193 injected provider a browser wallet exposes
|
|
6160
|
-
// (MetaMask / Rabby / Coinbase Wallet / any window.ethereum), discovered via
|
|
6161
|
-
// EIP-6963 (multi-wallet, collision-free) with a window.ethereum fallback. It
|
|
6162
|
-
// needs NO viem/ethers and NO React — EIP-1193 request() + hex strings suffice.
|
|
6163
|
-
// EIP-6963 is announcement-based: wallets add an `eip6963:requestProvider`
|
|
6164
|
-
// listener and synchronously dispatch `eip6963:announceProvider` in response. We
|
|
6165
|
-
// keep a persistent collector so announcements (including late ones) are
|
|
6166
|
-
// captured, and re-request on demand.
|
|
6167
|
-
const announcedProviders = [];
|
|
6168
|
-
let announceListenerAttached = false;
|
|
6169
|
-
function attachAnnounceListener() {
|
|
6170
|
-
if (announceListenerAttached || typeof window === 'undefined')
|
|
6171
|
-
return;
|
|
6172
|
-
announceListenerAttached = true;
|
|
6173
|
-
window.addEventListener('eip6963:announceProvider', (event) => {
|
|
6174
|
-
const detail = event === null || event === void 0 ? void 0 : event.detail;
|
|
6175
|
-
if (detail &&
|
|
6176
|
-
detail.provider &&
|
|
6177
|
-
typeof detail.provider.request === 'function' &&
|
|
6178
|
-
!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); })) {
|
|
6179
|
-
announcedProviders.push(detail);
|
|
6180
|
-
}
|
|
6181
|
-
});
|
|
6182
|
-
}
|
|
6183
|
-
/**
|
|
6184
|
-
* Request + collect EIP-6963 providers. Dispatches `eip6963:requestProvider`
|
|
6185
|
-
* (synchronous — already-loaded wallets announce in the same tick) and returns
|
|
6186
|
-
* every wallet announced so far. Kept synchronous so it works inside a user
|
|
6187
|
-
* gesture and can be eagerly exported from the SDK entry.
|
|
6188
|
-
*/
|
|
6189
|
-
function requestEip6963Providers() {
|
|
6190
|
-
if (typeof window === 'undefined')
|
|
6191
|
-
return [];
|
|
6192
|
-
attachAnnounceListener();
|
|
6193
|
-
try {
|
|
6194
|
-
window.dispatchEvent(new Event('eip6963:requestProvider'));
|
|
6195
|
-
}
|
|
6196
|
-
catch (_a) {
|
|
6197
|
-
/* older browsers without Event constructor — fall through to window.ethereum */
|
|
6198
|
-
}
|
|
6199
|
-
return announcedProviders.slice();
|
|
6200
|
-
}
|
|
6201
|
-
/**
|
|
6202
|
-
* Default EVM provider discovery: EIP-6963 first (multi-wallet, collision-free),
|
|
6203
|
-
* then legacy `window.ethereum`. Returns null when no injected wallet is present.
|
|
6204
|
-
*/
|
|
6205
|
-
function defaultInjectedEvmProvider() {
|
|
6206
|
-
if (typeof window === 'undefined')
|
|
6207
|
-
return null;
|
|
6208
|
-
const details = requestEip6963Providers();
|
|
6209
|
-
if (details.length > 0)
|
|
6210
|
-
return details[0].provider;
|
|
6211
|
-
const eth = window.ethereum;
|
|
6212
|
-
if (eth && typeof eth.request === 'function')
|
|
6213
|
-
return eth;
|
|
6214
|
-
return null;
|
|
6215
|
-
}
|
|
6216
|
-
|
|
6217
|
-
export { loginWithPopup as A, completeLoginInPopup as B, useAuth as C, useQuery as D, EMBEDDED_WALLET_UNSUPPORTED as E, useBuildRun as F, apps as G, deserializeTransaction as H, getIdToken as I, setPlatform as J, requestEip6963Providers as K, builds as L, BuildsApiError as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, PARK_REASONS as Q, RUN_STATES as R, FAILURE_REASONS as S, TERMINAL_STATES as T, BUILD_REVIEW_CAPABILITY_SCHEMA as U, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as V, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as W, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, defaultInjectedProvider as d, embeddedRunEvmTransaction as e, bufferExports as f, getPlatform as g, hasEmbeddedWallet as h, bs58 as i, confirmAndCheckTransaction as j, defaultInjectedEvmProvider as k, init as l, getCurrentUser as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, onAuthLoadingChanged as p, getAuthLoading as q, resolveSolanaRpcUrl as r, setCurrentUser as s, login as t, logout as u, getAuthProvider as v, signInAnonymously as w, loginWithPrivy as x, loginWithRedirect as y, completeLoginFromRedirect as z };
|
|
6218
|
-
//# sourceMappingURL=index-DkdIADby.mjs.map
|
|
6152
|
+
export { useAuth as A, useQuery as B, useBuildRun as C, apps as D, EMBEDDED_WALLET_UNSUPPORTED as E, deserializeTransaction as F, getIdToken as G, setPlatform as H, builds as I, BuildsApiError as J, PARK_REASONS as K, FAILURE_REASONS as L, BUILD_REVIEW_CAPABILITY_SCHEMA as M, NON_TERMINAL_STATES as N, OffchainAuthProvider as O, PrivyExpoProvider as P, BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA as Q, RUN_STATES as R, BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA as S, TERMINAL_STATES as T, hasEmbeddedEvmWallet as a, embeddedSignAndSubmit as b, setAuthLoading as c, bufferExports as d, embeddedRunEvmTransaction as e, bs58 as f, getPlatform as g, hasEmbeddedWallet as h, confirmAndCheckTransaction as i, init as j, getCurrentUser as k, onAuthLoadingChanged as l, getAuthLoading as m, normalizeSolanaRpcUrl as n, onAuthStateChanged as o, login as p, logout as q, resolveSolanaRpcUrl as r, setCurrentUser as s, getAuthProvider as t, signInAnonymously as u, loginWithPrivy as v, loginWithRedirect as w, completeLoginFromRedirect as x, loginWithPopup as y, completeLoginInPopup as z };
|
|
6153
|
+
//# sourceMappingURL=index.native-CQiw9baS.mjs.map
|