@bounded-sh/client 0.0.118 → 0.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/providers/email-auth-provider.d.ts +2 -1
- package/dist/auth/providers/offchain-auth-provider.d.ts +2 -1
- package/dist/auth/turnkey-signer-bridge.d.ts +16 -0
- package/dist/auth/turnkey-wallet-widget.d.ts +4 -0
- package/dist/{email-auth-provider-B9cZ-puM.mjs → email-auth-provider-DHq5_wtn.mjs} +7 -2
- package/dist/email-auth-provider-DHq5_wtn.mjs.map +1 -0
- package/dist/{email-auth-provider-DFHalX9c.mjs → email-auth-provider-DOI-4lPC.mjs} +7 -2
- package/dist/email-auth-provider-DOI-4lPC.mjs.map +1 -0
- package/dist/{email-auth-provider-BYiK3ZCv.js → email-auth-provider-DyzhiN9Y.js} +7 -2
- package/dist/email-auth-provider-DyzhiN9Y.js.map +1 -0
- package/dist/{email-auth-provider-C-qQ46kD.js → email-auth-provider-wOISnCic.js} +7 -2
- package/dist/email-auth-provider-wOISnCic.js.map +1 -0
- package/dist/{guest-auth-provider-D1q3C5uC.js → guest-auth-provider-Br3iM3O3.js} +2 -2
- package/dist/{guest-auth-provider-D1q3C5uC.js.map → guest-auth-provider-Br3iM3O3.js.map} +1 -1
- package/dist/{guest-auth-provider-i8-RL0js.mjs → guest-auth-provider-DyP5UUg6.mjs} +2 -2
- package/dist/{guest-auth-provider-BRq3JB0_.mjs.map → guest-auth-provider-DyP5UUg6.mjs.map} +1 -1
- package/dist/{guest-auth-provider-BRq3JB0_.mjs → guest-auth-provider-ZOBNFoeC.mjs} +2 -2
- package/dist/{guest-auth-provider-i8-RL0js.mjs.map → guest-auth-provider-ZOBNFoeC.mjs.map} +1 -1
- package/dist/{guest-auth-provider-g5-T58yA.js → guest-auth-provider-xap-VQBP.js} +2 -2
- package/dist/{guest-auth-provider-g5-T58yA.js.map → guest-auth-provider-xap-VQBP.js.map} +1 -1
- package/dist/{index-eMCWYiRe.js → index-B4_eKphx.js} +85 -16
- package/dist/index-B4_eKphx.js.map +1 -0
- package/dist/{index-xNGb1ROp.mjs → index-BaXUWG8Q.mjs} +85 -17
- package/dist/index-BaXUWG8Q.mjs.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{index.native-ByI3rRu4.js → index.native-B-pjNetI.js} +102 -17
- package/dist/index.native-B-pjNetI.js.map +1 -0
- package/dist/{index.native-YmmnwqEw.mjs → index.native-B4yI0BqT.mjs} +102 -18
- package/dist/index.native-B4yI0BqT.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider--x3yWNps.mjs → injected-evm-wallet-provider-B4Kr6lnK.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider--x3yWNps.mjs.map → injected-evm-wallet-provider-B4Kr6lnK.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BIYAL_NZ.js → injected-evm-wallet-provider-CKAv4Qxh.js} +2 -2
- package/dist/{injected-evm-wallet-provider-BIYAL_NZ.js.map → injected-evm-wallet-provider-CKAv4Qxh.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BMjQaUiB.js → injected-evm-wallet-provider-DQMYqPus.js} +2 -2
- package/dist/{injected-evm-wallet-provider-BMjQaUiB.js.map → injected-evm-wallet-provider-DQMYqPus.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BoLGCVqD.mjs → injected-evm-wallet-provider-Vw-Puwxh.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BoLGCVqD.mjs.map → injected-evm-wallet-provider-Vw-Puwxh.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-D3fVFadN.js → injected-wallet-provider-B8QTPxf6.js} +2 -2
- package/dist/{injected-wallet-provider-D3fVFadN.js.map → injected-wallet-provider-B8QTPxf6.js.map} +1 -1
- package/dist/{injected-wallet-provider-zXw__lyf.js → injected-wallet-provider-BsTfBAD4.js} +2 -2
- package/dist/{injected-wallet-provider-zXw__lyf.js.map → injected-wallet-provider-BsTfBAD4.js.map} +1 -1
- package/dist/{injected-wallet-provider-DSOjJP3u.mjs → injected-wallet-provider-CQxGVYja.mjs} +2 -2
- package/dist/{injected-wallet-provider-DSOjJP3u.mjs.map → injected-wallet-provider-CQxGVYja.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DuWTw-fM.mjs → injected-wallet-provider-jj9dqm2Z.mjs} +2 -2
- package/dist/{injected-wallet-provider-DuWTw-fM.mjs.map → injected-wallet-provider-jj9dqm2Z.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/email-auth-provider-B9cZ-puM.mjs.map +0 -1
- package/dist/email-auth-provider-BYiK3ZCv.js.map +0 -1
- package/dist/email-auth-provider-C-qQ46kD.js.map +0 -1
- package/dist/email-auth-provider-DFHalX9c.mjs.map +0 -1
- package/dist/index-eMCWYiRe.js.map +0 -1
- package/dist/index-xNGb1ROp.mjs.map +0 -1
- package/dist/index.native-ByI3rRu4.js.map +0 -1
- package/dist/index.native-YmmnwqEw.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,9 @@ export type { HostedAuthMethod, OidcLoginOptions, PopupLoginOptions } from "./au
|
|
|
17
17
|
export { openBoundedWidget } from "./auth/bounded-login-widget";
|
|
18
18
|
export type { BoundedWidgetOptions } from "./auth/bounded-login-widget";
|
|
19
19
|
export { ensureSignedIn } from "./auth/ensure-signed-in";
|
|
20
|
-
export { get, getMany, docId, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, count, aggregate, type GetOptions, type SearchOptions, type SetOptions, type CountOptions, type AggregateOptions, type AggregateOperation, type AggregateResult, type AggregateSpec, type AggregateRow, type QueryAggregateOptions, } from "@bounded-sh/core";
|
|
20
|
+
export { get, getMany, docId, set, setMany, setFile, getFiles, search, queryAggregate, runQuery, runQueryMany, runExpression, runExpressionMany, signMessage, signTransaction, signAndSubmitTransaction, prepareToSign, count, aggregate, type GetOptions, type SearchOptions, type SetOptions, type CountOptions, type AggregateOptions, type AggregateOperation, type AggregateResult, type AggregateSpec, type AggregateRow, type QueryAggregateOptions, } from "@bounded-sh/core";
|
|
21
21
|
export type { GetOptions as BoundedGetOptions } from "@bounded-sh/core";
|
|
22
|
+
export type { SignerReadiness } from "@bounded-sh/core";
|
|
22
23
|
export { reconcileSetResult, waitForSetResult } from "@bounded-sh/core";
|
|
23
24
|
export type { SetResult, SetEntry, SetDocuments, MirrorSync, SolanaFence, ChainTag, SolanaChainTag, CommittedSetResult, ConfirmedSetResult, SolanaConfirmedSetResult, SubmittedSetResult, SolanaSubmittedSetResult, SolanaExpiredNotLandedSetResult, SolanaSignedSetResult, TransactionResult, TransactionReconciliation, ReconcileSetResultOptions, WaitForSetResultOptions, FileUploadResult, FileDeleteResult, } from "@bounded-sh/core";
|
|
24
25
|
export { subscribe } from "@bounded-sh/core";
|
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-B4_eKphx.js');
|
|
4
4
|
var core = require('@bounded-sh/core');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -148,6 +148,10 @@ Object.defineProperty(exports, "getMany", {
|
|
|
148
148
|
enumerable: true,
|
|
149
149
|
get: function () { return core.getMany; }
|
|
150
150
|
});
|
|
151
|
+
Object.defineProperty(exports, "prepareToSign", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
get: function () { return core.prepareToSign; }
|
|
154
|
+
});
|
|
151
155
|
Object.defineProperty(exports, "queryAggregate", {
|
|
152
156
|
enumerable: true,
|
|
153
157
|
get: function () { return core.queryAggregate; }
|
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,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
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-BaXUWG8Q.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
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, queryAggregate, reconcileSetResult, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe, waitForSetResult } from '@bounded-sh/core';
|
|
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';
|
|
5
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -56,7 +56,18 @@ function walletOperationGuard() {
|
|
|
56
56
|
throw new Error('wallet_session_changed');
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
// This realm owns one active SDK session and one retained signer frame.
|
|
60
|
+
let activeWalletState;
|
|
61
|
+
function setWalletSessionState(key, state) { activeWalletState = { key, state }; }
|
|
62
|
+
function walletSessionState(key) {
|
|
63
|
+
if ((activeWalletState === null || activeWalletState === void 0 ? void 0 : activeWalletState.key) !== key)
|
|
64
|
+
return { status: 'verification-required' };
|
|
65
|
+
const state = activeWalletState.state;
|
|
66
|
+
if (state.status === 'ready' && (!Number.isFinite(state.expiresAt) || state.expiresAt <= Date.now())) {
|
|
67
|
+
return { status: 'verification-required', reason: 'wallet_session_expired' };
|
|
68
|
+
}
|
|
69
|
+
return state;
|
|
70
|
+
}
|
|
60
71
|
|
|
61
72
|
/**
|
|
62
73
|
* Platform abstraction layer for React Native compatibility.
|
|
@@ -247,6 +258,10 @@ class OffchainAuthProvider {
|
|
|
247
258
|
async signTransaction(tx) {
|
|
248
259
|
return this.wrappedProvider.signTransaction(tx);
|
|
249
260
|
}
|
|
261
|
+
async prepareToSign() {
|
|
262
|
+
var _a, _b, _c;
|
|
263
|
+
return (_c = (await ((_b = (_a = this.wrappedProvider).prepareToSign) === null || _b === void 0 ? void 0 : _b.call(_a)))) !== null && _c !== void 0 ? _c : 'ready';
|
|
264
|
+
}
|
|
250
265
|
/**
|
|
251
266
|
* Sign and submit transaction - not supported in poofnet environment.
|
|
252
267
|
* See the real providers (PhantomWalletProvider, SolanaKeypairProvider)
|
|
@@ -4164,6 +4179,11 @@ function detachWarmSignerIframe(origin) {
|
|
|
4164
4179
|
detachIframe(modal);
|
|
4165
4180
|
return true;
|
|
4166
4181
|
}
|
|
4182
|
+
/** A removed frame cannot still supply its in-memory signing session. */
|
|
4183
|
+
function hasWarmSignerFrame(context) {
|
|
4184
|
+
var _a;
|
|
4185
|
+
return Boolean(((_a = modal === null || modal === void 0 ? void 0 : modal.iframe) === null || _a === void 0 ? void 0 : _a.isConnected) && modal.iframeContext === context);
|
|
4186
|
+
}
|
|
4167
4187
|
function detachIframe(m) {
|
|
4168
4188
|
if (m.iframe) {
|
|
4169
4189
|
try {
|
|
@@ -4205,7 +4225,7 @@ async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
|
4205
4225
|
const requestId = String(ex.request.requestId);
|
|
4206
4226
|
// Serialize: the approve card is modal, and one warm frame handles one request at a time.
|
|
4207
4227
|
const run = m.chain.then(() => new Promise((resolve, reject) => {
|
|
4208
|
-
var _a;
|
|
4228
|
+
var _a, _b;
|
|
4209
4229
|
let settled = false;
|
|
4210
4230
|
let usedFallback = false;
|
|
4211
4231
|
(_a = ex.assertCurrent) === null || _a === void 0 ? void 0 : _a.call(ex);
|
|
@@ -4248,16 +4268,20 @@ async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
|
4248
4268
|
/* frame gone */
|
|
4249
4269
|
}
|
|
4250
4270
|
};
|
|
4271
|
+
const dismiss = () => {
|
|
4272
|
+
if (!ex.silent)
|
|
4273
|
+
hideModal(m);
|
|
4274
|
+
};
|
|
4251
4275
|
const goFallback = () => {
|
|
4252
4276
|
if (usedFallback || settled)
|
|
4253
4277
|
return;
|
|
4254
4278
|
usedFallback = true;
|
|
4255
|
-
|
|
4279
|
+
dismiss();
|
|
4256
4280
|
finish(() => popupFallback().then(resolve, reject));
|
|
4257
4281
|
};
|
|
4258
4282
|
m.onBackdrop = () => {
|
|
4259
4283
|
cancelInFrame();
|
|
4260
|
-
|
|
4284
|
+
dismiss();
|
|
4261
4285
|
finish(() => reject(new Error("cancelled")));
|
|
4262
4286
|
};
|
|
4263
4287
|
m.onIframeMessage = (d) => {
|
|
@@ -4272,17 +4296,18 @@ async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
|
4272
4296
|
if (d.type === "bounded:turnkey:result" && d.requestId === requestId) {
|
|
4273
4297
|
const outcome = ex.onResult(d);
|
|
4274
4298
|
if ("error" in outcome) {
|
|
4275
|
-
|
|
4299
|
+
dismiss();
|
|
4276
4300
|
finish(() => reject(new Error(outcome.error)));
|
|
4277
4301
|
return;
|
|
4278
4302
|
}
|
|
4279
4303
|
if (outcome.done) {
|
|
4280
|
-
|
|
4304
|
+
dismiss();
|
|
4281
4305
|
finish(() => resolve(outcome.value));
|
|
4282
4306
|
}
|
|
4283
4307
|
}
|
|
4284
4308
|
};
|
|
4285
|
-
|
|
4309
|
+
if (!ex.silent)
|
|
4310
|
+
showModal(m);
|
|
4286
4311
|
if (m.iframeReady)
|
|
4287
4312
|
send();
|
|
4288
4313
|
// If the frame never loads, degrade to the popup (best-effort - a post-load
|
|
@@ -4295,10 +4320,10 @@ async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
|
4295
4320
|
ceilingTimer = window.setTimeout(() => {
|
|
4296
4321
|
if (!settled) {
|
|
4297
4322
|
cancelInFrame();
|
|
4298
|
-
|
|
4323
|
+
dismiss();
|
|
4299
4324
|
finish(() => reject(new Error("Wallet approval timed out.")));
|
|
4300
4325
|
}
|
|
4301
|
-
}, 5 * 60 * 1000);
|
|
4326
|
+
}, (_b = ex.ceilingMs) !== null && _b !== void 0 ? _b : 5 * 60 * 1000);
|
|
4302
4327
|
}));
|
|
4303
4328
|
m.chain = run.then(() => undefined, () => undefined);
|
|
4304
4329
|
return run;
|
|
@@ -4800,6 +4825,59 @@ async function clearTurnkeySigningSession(idToken) {
|
|
|
4800
4825
|
function hasTurnkeyWallet() {
|
|
4801
4826
|
return activeTurnkeyAddress() !== null;
|
|
4802
4827
|
}
|
|
4828
|
+
/** The signer frame could not take the exchange: it never loaded, or a page from before the request existed stays silent. */
|
|
4829
|
+
class SignerFrameUnavailable extends Error {
|
|
4830
|
+
constructor() { super('The Bounded signer frame did not answer.'); }
|
|
4831
|
+
}
|
|
4832
|
+
/** How long a silent session probe may wait for the frame before the write goes on without it. */
|
|
4833
|
+
const SESSION_PROBE_MS = 8000;
|
|
4834
|
+
/**
|
|
4835
|
+
* Make the wallet's 24-hour signing session live BEFORE a transaction exists. Without one the
|
|
4836
|
+
* approve card must first collect an emailed code, which takes longer than a transaction's
|
|
4837
|
+
* blockhash lifetime (about 33 seconds on mainnet in late 2026), so a transaction built before
|
|
4838
|
+
* the code is dead by the time it is signed. A live session is found with nothing shown: the
|
|
4839
|
+
* warm frame answers a silent probe, and it holds the session even where the browser blocks its
|
|
4840
|
+
* storage. Only a lapsed session opens the card, which runs the code ceremony and closes without
|
|
4841
|
+
* signing anything. Resolves `'established'` when that ceremony ran, else `'ready'`.
|
|
4842
|
+
*
|
|
4843
|
+
* Both exchanges run in the warm frame only, since it is the frame that signs next and a popup
|
|
4844
|
+
* keeps its session to itself. Where the frame cannot answer (an embedder that blocks it, or a
|
|
4845
|
+
* signer page from before this request existed), the write goes on the way it always did: the
|
|
4846
|
+
* approve card collects the code itself, and an expired build is built again.
|
|
4847
|
+
*/
|
|
4848
|
+
async function ensureTurnkeySigningSession() {
|
|
4849
|
+
if (!hasDOM$2())
|
|
4850
|
+
throw new Error('Turnkey embedded-wallet signing is only available in the browser (trusted wallet UI).');
|
|
4851
|
+
const context = await turnkeySignerPage();
|
|
4852
|
+
context.assertCurrent();
|
|
4853
|
+
if (hasWarmSignerFrame(context.key) && walletSessionState(context.key).status === 'ready')
|
|
4854
|
+
return 'ready';
|
|
4855
|
+
const { url, origin } = context;
|
|
4856
|
+
const authorization = await fetchActionAuthorization('createWallet', context);
|
|
4857
|
+
const frameOnly = () => Promise.reject(new SignerFrameUnavailable());
|
|
4858
|
+
const exchange = (probeOnly) => ({
|
|
4859
|
+
context: context.key, assertCurrent: context.assertCurrent,
|
|
4860
|
+
request: Object.assign({ type: 'bounded:turnkey:session', requestId: `tksession_${Date.now()}_${++requestSeq}`, authorization }, (probeOnly ? { probeOnly: true } : {})),
|
|
4861
|
+
onResult: (d) => d.ok ? { done: true, value: d } : { error: String(d.error || 'The signing session could not be established') },
|
|
4862
|
+
});
|
|
4863
|
+
const probed = await runWidget(url, origin, Object.assign(Object.assign({}, exchange(true)), { silent: true, ceilingMs: SESSION_PROBE_MS }), frameOnly)
|
|
4864
|
+
.catch(() => null);
|
|
4865
|
+
if (!probed)
|
|
4866
|
+
return 'ready';
|
|
4867
|
+
let result = probed;
|
|
4868
|
+
if (result.ready !== true) {
|
|
4869
|
+
try {
|
|
4870
|
+
result = await runWidget(url, origin, exchange(false), frameOnly);
|
|
4871
|
+
}
|
|
4872
|
+
catch (error) {
|
|
4873
|
+
if (error instanceof SignerFrameUnavailable)
|
|
4874
|
+
return 'ready';
|
|
4875
|
+
throw error;
|
|
4876
|
+
}
|
|
4877
|
+
}
|
|
4878
|
+
setWalletSessionState(context.key, { status: 'ready', expiresAt: Number(result.signingSessionExpiresAt) });
|
|
4879
|
+
return result.established === true ? 'established' : 'ready';
|
|
4880
|
+
}
|
|
4803
4881
|
/**
|
|
4804
4882
|
* Open the Bounded Turnkey approval card and sign `message` (raw bytes) with the
|
|
4805
4883
|
* user's Turnkey wallet, resolving with the ed25519 signature and wallet address.
|
|
@@ -4836,7 +4914,7 @@ async function signSolanaMessageViaTurnkey(message) {
|
|
|
4836
4914
|
// A top-level popup keeps its signing session in the signer origin's own storage, which the
|
|
4837
4915
|
// warm in-app frame (a partitioned context) cannot see, so it says nothing about that frame.
|
|
4838
4916
|
if (transport !== 'popup')
|
|
4839
|
-
setWalletSessionState(context.key, { expiresAt: Number(d.signingSessionExpiresAt) });
|
|
4917
|
+
setWalletSessionState(context.key, { status: 'ready', expiresAt: Number(d.signingSessionExpiresAt) });
|
|
4840
4918
|
return { done: true, value: { signature: fromHex(d.signatureHex), address: d.address, subOrgId: String(d.subOrgId || '') } };
|
|
4841
4919
|
}
|
|
4842
4920
|
// The hosted signer refuses a cross-app signature inside a frame. Never retry it from here:
|
|
@@ -4952,6 +5030,7 @@ async function signAndSubmitTransactionWithTurnkey(transaction, feePayer) {
|
|
|
4952
5030
|
var turnkeySignerBridge = /*#__PURE__*/Object.freeze({
|
|
4953
5031
|
__proto__: null,
|
|
4954
5032
|
clearTurnkeySigningSession: clearTurnkeySigningSession,
|
|
5033
|
+
ensureTurnkeySigningSession: ensureTurnkeySigningSession,
|
|
4955
5034
|
hasTurnkeyWallet: hasTurnkeyWallet,
|
|
4956
5035
|
signAndSubmitTransactionWithTurnkey: signAndSubmitTransactionWithTurnkey,
|
|
4957
5036
|
signMessageWithTurnkey: signMessageWithTurnkey,
|
|
@@ -5031,6 +5110,11 @@ const oidcProviderSingleton = {
|
|
|
5031
5110
|
throw new Error(OIDC_NO_WALLET);
|
|
5032
5111
|
return signTransactionV1WithTurnkey(transaction);
|
|
5033
5112
|
},
|
|
5113
|
+
async prepareToSign() {
|
|
5114
|
+
if (!hasTurnkeyWallet())
|
|
5115
|
+
throw new Error(OIDC_NO_WALLET);
|
|
5116
|
+
return ensureTurnkeySigningSession();
|
|
5117
|
+
},
|
|
5034
5118
|
supportedTransactionVersions() {
|
|
5035
5119
|
return hasTurnkeyWallet() ? ['legacy', 0, 1] : ['legacy', 0];
|
|
5036
5120
|
},
|
|
@@ -6086,7 +6170,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6086
6170
|
// manager as legacy email sessions. Human login should be started
|
|
6087
6171
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
6088
6172
|
// logout surface for those sessions.
|
|
6089
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
6173
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-wOISnCic.js'); })).EmailAuthProvider();
|
|
6090
6174
|
break;
|
|
6091
6175
|
case "phantom": {
|
|
6092
6176
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6128,7 +6212,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6128
6212
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6129
6213
|
// evidence the user has a wallet.
|
|
6130
6214
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6131
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6215
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-BsTfBAD4.js'); });
|
|
6132
6216
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6133
6217
|
break;
|
|
6134
6218
|
}
|
|
@@ -6141,7 +6225,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6141
6225
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6142
6226
|
// to point at a specific wallet or set chainId/domain.
|
|
6143
6227
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6144
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
6228
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-DQMYqPus.js'); });
|
|
6145
6229
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6146
6230
|
break;
|
|
6147
6231
|
}
|
|
@@ -6166,7 +6250,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6166
6250
|
break;
|
|
6167
6251
|
case "guest":
|
|
6168
6252
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6169
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6253
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-xap-VQBP.js'); })).GuestAuthProvider();
|
|
6170
6254
|
break;
|
|
6171
6255
|
}
|
|
6172
6256
|
if (!currentAuthProvider) {
|
|
@@ -6228,7 +6312,7 @@ async function signInAnonymously() {
|
|
|
6228
6312
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6229
6313
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6230
6314
|
// so bundle-splitting can see it.
|
|
6231
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6315
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-xap-VQBP.js'); })).GuestAuthProvider();
|
|
6232
6316
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6233
6317
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6234
6318
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6399,7 +6483,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6399
6483
|
if (!sharedWalletReady) {
|
|
6400
6484
|
sharedWalletReady = (async () => {
|
|
6401
6485
|
await core.getConfig();
|
|
6402
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6486
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-BsTfBAD4.js'); });
|
|
6403
6487
|
})().catch((error) => {
|
|
6404
6488
|
sharedWalletReady = null;
|
|
6405
6489
|
throw error;
|
|
@@ -8922,6 +9006,7 @@ exports.bufferExports = bufferExports;
|
|
|
8922
9006
|
exports.builds = builds;
|
|
8923
9007
|
exports.completeLoginFromRedirect = completeLoginFromRedirect;
|
|
8924
9008
|
exports.confirmAndCheckTransaction = confirmAndCheckTransaction;
|
|
9009
|
+
exports.ensureTurnkeySigningSession = ensureTurnkeySigningSession;
|
|
8925
9010
|
exports.getAuthLoading = getAuthLoading;
|
|
8926
9011
|
exports.getAuthProvider = getAuthProvider;
|
|
8927
9012
|
exports.getCurrentUser = getCurrentUser;
|
|
@@ -8963,4 +9048,4 @@ exports.useBuildRun = useBuildRun;
|
|
|
8963
9048
|
exports.useQuery = useQuery;
|
|
8964
9049
|
exports.waitForAuthReady = waitForAuthReady;
|
|
8965
9050
|
exports.walletStandardFeatureName = walletStandardFeatureName;
|
|
8966
|
-
//# sourceMappingURL=index.native-
|
|
9051
|
+
//# sourceMappingURL=index.native-B-pjNetI.js.map
|