@bounded-sh/client 0.0.113 → 0.0.115
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/injected-wallet-types.d.ts +11 -2
- package/dist/auth/providers/wallet-standard-discovery.d.ts +2 -0
- package/dist/auth/turnkey-signer-window.d.ts +19 -0
- package/dist/auth/turnkey-signing-capability.d.ts +5 -1
- package/dist/{email-auth-provider-nDZjRDpj.mjs → email-auth-provider-ByNBWdfi.mjs} +2 -2
- package/dist/{email-auth-provider-Bk5GSpYT.mjs.map → email-auth-provider-ByNBWdfi.mjs.map} +1 -1
- package/dist/{email-auth-provider-Bk5GSpYT.mjs → email-auth-provider-CODHCC3h.mjs} +2 -2
- package/dist/{email-auth-provider-nDZjRDpj.mjs.map → email-auth-provider-CODHCC3h.mjs.map} +1 -1
- package/dist/{email-auth-provider-DeORQbTK.js → email-auth-provider-CPHrcy_b.js} +2 -2
- package/dist/{email-auth-provider-DeORQbTK.js.map → email-auth-provider-CPHrcy_b.js.map} +1 -1
- package/dist/{email-auth-provider-Cr66GaKw.js → email-auth-provider-CwG04f4u.js} +2 -2
- package/dist/{email-auth-provider-Cr66GaKw.js.map → email-auth-provider-CwG04f4u.js.map} +1 -1
- package/dist/{guest-auth-provider-CUNkZVFK.js → guest-auth-provider-3rfSwq3f.js} +2 -2
- package/dist/{guest-auth-provider-CUNkZVFK.js.map → guest-auth-provider-3rfSwq3f.js.map} +1 -1
- package/dist/{guest-auth-provider-ejUTbjCC.mjs → guest-auth-provider-CGN4k_LG.mjs} +2 -2
- package/dist/{guest-auth-provider-DDudqqxY.mjs.map → guest-auth-provider-CGN4k_LG.mjs.map} +1 -1
- package/dist/{guest-auth-provider-DDudqqxY.mjs → guest-auth-provider-PfOp_Yzj.mjs} +2 -2
- package/dist/{guest-auth-provider-ejUTbjCC.mjs.map → guest-auth-provider-PfOp_Yzj.mjs.map} +1 -1
- package/dist/{guest-auth-provider-5bX-xt6K.js → guest-auth-provider-d6dk97x6.js} +2 -2
- package/dist/{guest-auth-provider-5bX-xt6K.js.map → guest-auth-provider-d6dk97x6.js.map} +1 -1
- package/dist/{index-BAiLpNEQ.mjs → index-C63ceG_z.mjs} +789 -73
- package/dist/index-C63ceG_z.mjs.map +1 -0
- package/dist/{index-BZ0X1Z9X.js → index-nU0ZSfWs.js} +793 -71
- package/dist/index-nU0ZSfWs.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-DJSOqyKQ.js → index.native-BBLBnqal.js} +75 -22
- package/dist/index.native-BBLBnqal.js.map +1 -0
- package/dist/{index.native-DcW2klyn.mjs → index.native-DLAEWwuZ.mjs} +76 -23
- package/dist/index.native-DLAEWwuZ.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-C4aKa2v1.mjs → injected-evm-wallet-provider-C4vNOS4P.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-C4aKa2v1.mjs.map → injected-evm-wallet-provider-C4vNOS4P.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BDYWjIOQ.js → injected-evm-wallet-provider-C6KC7pJ6.js} +2 -2
- package/dist/{injected-evm-wallet-provider-BDYWjIOQ.js.map → injected-evm-wallet-provider-C6KC7pJ6.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-D06arDQD.js → injected-evm-wallet-provider-D1JA3cL4.js} +2 -2
- package/dist/{injected-evm-wallet-provider-D06arDQD.js.map → injected-evm-wallet-provider-D1JA3cL4.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BQ_kG1vI.mjs → injected-evm-wallet-provider-D7rOyYdr.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BQ_kG1vI.mjs.map → injected-evm-wallet-provider-D7rOyYdr.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-Dj-F69gb.mjs → injected-wallet-provider-BLRrB2rb.mjs} +11 -5
- package/dist/{injected-wallet-provider-Dj-F69gb.mjs.map → injected-wallet-provider-BLRrB2rb.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-B9jvzDM5.js → injected-wallet-provider-BXFicWTx.js} +11 -5
- package/dist/{injected-wallet-provider-B9jvzDM5.js.map → injected-wallet-provider-BXFicWTx.js.map} +1 -1
- package/dist/{injected-wallet-provider-Dqmk-m4V.js → injected-wallet-provider-BvlKZoVJ.js} +59 -34
- package/dist/injected-wallet-provider-BvlKZoVJ.js.map +1 -0
- package/dist/{injected-wallet-provider-DxPcYxP-.mjs → injected-wallet-provider-DruiX7GK.mjs} +59 -34
- package/dist/injected-wallet-provider-DruiX7GK.mjs.map +1 -0
- package/dist/venue-escrow.d.ts +113 -0
- package/package.json +2 -2
- package/dist/index-BAiLpNEQ.mjs.map +0 -1
- package/dist/index-BZ0X1Z9X.js.map +0 -1
- package/dist/index.native-DJSOqyKQ.js.map +0 -1
- package/dist/index.native-DcW2klyn.mjs.map +0 -1
- package/dist/injected-wallet-provider-Dqmk-m4V.js.map +0 -1
- package/dist/injected-wallet-provider-DxPcYxP-.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,12 +46,14 @@ export type { TurnkeyEmailLoginHandle } from "./auth/turnkey-auth";
|
|
|
46
46
|
export { getIdToken } from "./utils";
|
|
47
47
|
export { onramp, onrampQuote, onrampStatus } from "./onramp";
|
|
48
48
|
export type { OnrampOptions, OnrampResult, OnrampQuoteInfo, OnrampTransaction } from "./onramp";
|
|
49
|
+
export { fundVenueEscrow, disputeVenueEscrow, getVenueEscrow, VenueEscrowError } from "./venue-escrow";
|
|
50
|
+
export type { VenueEscrowTerms, VenueEscrowFunded, VenueEscrowDisputed, VenueEscrow, VenueEscrowState, VenueEscrowErrorCode, } from "./venue-escrow";
|
|
49
51
|
export { setPlatform, getPlatform } from "./platform";
|
|
50
52
|
export type { PlatformAdapter, StorageAdapter } from "./platform";
|
|
51
53
|
export { OffchainAuthProvider, OffchainAuthProviderConfig, } from "./auth/providers/offchain-auth-provider";
|
|
52
54
|
export { PrivyExpoProvider } from "./auth/providers/privy-expo-provider";
|
|
53
55
|
export type { PrivyExpoMethods } from "./auth/providers/privy-expo-provider";
|
|
54
|
-
export { defaultInjectedProvider } from "./auth/providers/injected-wallet-types";
|
|
56
|
+
export { defaultInjectedProvider, supportsWalletSignIn } from "./auth/providers/injected-wallet-types";
|
|
55
57
|
export type { InjectedWalletConfig, InjectedSolanaProvider, } from "./auth/providers/injected-wallet-types";
|
|
56
58
|
export type { InjectedWalletProvider } from "./auth/providers/injected-wallet-provider";
|
|
57
59
|
export { defaultInjectedEvmProvider, requestEip6963Providers, } from "./auth/providers/injected-evm-wallet-types";
|
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-nU0ZSfWs.js');
|
|
4
4
|
var core = require('@bounded-sh/core');
|
|
5
5
|
require('react');
|
|
6
6
|
|
|
@@ -17,6 +17,7 @@ exports.PARK_REASONS = index.PARK_REASONS;
|
|
|
17
17
|
exports.PrivyExpoProvider = index.PrivyExpoProvider;
|
|
18
18
|
exports.RUN_STATES = index.RUN_STATES;
|
|
19
19
|
exports.TERMINAL_STATES = index.TERMINAL_STATES;
|
|
20
|
+
exports.VenueEscrowError = index.VenueEscrowError;
|
|
20
21
|
exports.WalletConfigError = index.WalletConfigError;
|
|
21
22
|
exports.apps = index.apps;
|
|
22
23
|
exports.builds = index.builds;
|
|
@@ -25,9 +26,11 @@ exports.connectBroadcast = index.connectBroadcast;
|
|
|
25
26
|
exports.connectServiceSession = index.connectServiceSession;
|
|
26
27
|
exports.defaultInjectedEvmProvider = index.defaultInjectedEvmProvider;
|
|
27
28
|
exports.defaultInjectedProvider = index.defaultInjectedProvider;
|
|
29
|
+
exports.disputeVenueEscrow = index.disputeVenueEscrow;
|
|
28
30
|
exports.ensureSharedWalletLoginReady = index.ensureSharedWalletLoginReady;
|
|
29
31
|
exports.ensureSignedIn = index.ensureSignedIn;
|
|
30
32
|
exports.ensureWalletLoginReady = index.ensureWalletLoginReady;
|
|
33
|
+
exports.fundVenueEscrow = index.fundVenueEscrow;
|
|
31
34
|
exports.getAuthLoading = index.getAuthLoading;
|
|
32
35
|
exports.getAuthProvider = index.getAuthProvider;
|
|
33
36
|
exports.getCurrentUser = index.getCurrentUser;
|
|
@@ -37,6 +40,7 @@ exports.getOrCreateTurnkeyWallet = index.getOrCreateTurnkeyWallet;
|
|
|
37
40
|
exports.getPlatform = index.getPlatform;
|
|
38
41
|
exports.getTurnkeyWalletRecoveryUrl = index.getTurnkeyWalletRecoveryUrl;
|
|
39
42
|
exports.getTurnkeyWalletSessionState = index.getTurnkeyWalletSessionState;
|
|
43
|
+
exports.getVenueEscrow = index.getVenueEscrow;
|
|
40
44
|
exports.init = index.init;
|
|
41
45
|
exports.login = index.login;
|
|
42
46
|
exports.loginWithPopup = index.loginWithPopup;
|
|
@@ -58,6 +62,7 @@ exports.setPlatform = index.setPlatform;
|
|
|
58
62
|
exports.signInAnonymously = index.signInAnonymously;
|
|
59
63
|
exports.signSolanaMessageViaTurnkey = index.signSolanaMessageViaTurnkey;
|
|
60
64
|
exports.startTurnkeyEmailLogin = index.startTurnkeyEmailLogin;
|
|
65
|
+
exports.supportsWalletSignIn = index.supportsWalletSignIn;
|
|
61
66
|
exports.useAuth = index.useAuth;
|
|
62
67
|
exports.useBuildRun = index.useBuildRun;
|
|
63
68
|
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 { am as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, al as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, ak as BUILD_REVIEW_CAPABILITY_SCHEMA, ad as BuildsApiError, aj as FAILURE_REASONS, af as NON_TERMINAL_STATES, a7 as OffchainAuthProvider, ai as PARK_REASONS, a8 as PrivyExpoProvider, ah as RUN_STATES, ag as TERMINAL_STATES, a5 as VenueEscrowError, W as WalletConfigError, R as apps, ac as builds, J as completeLoginFromRedirect, aa as connectBroadcast, ab as connectServiceSession, p as defaultInjectedEvmProvider, f as defaultInjectedProvider, a3 as disputeVenueEscrow, G as ensureSharedWalletLoginReady, N as ensureSignedIn, F as ensureWalletLoginReady, a2 as fundVenueEscrow, x as getAuthLoading, B as getAuthProvider, u as getCurrentUser, _ as getIdToken, K as getLoginReturnError, U as getOrCreateTurnkeyWallet, g as getPlatform, Y as getTurnkeyWalletRecoveryUrl, X as getTurnkeyWalletSessionState, a4 as getVenueEscrow, q as init, z as login, L as loginWithPopup, D as loginWithPrivy, I as loginWithRedirect, E as loginWithWallet, A as logout, ae as mediaAgentTools, w as onAuthLoadingChanged, v as onAuthStateChanged, $ as onramp, a0 as onrampQuote, a1 as onrampStatus, M as openBoundedWidget, V as openTurnkeyKeyExport, H as preloadWalletLogin, a9 as requestEip6963Providers, a6 as setPlatform, C as signInAnonymously, T as signSolanaMessageViaTurnkey, Z as startTurnkeyEmailLogin, k as supportsWalletSignIn, O as useAuth, Q as useBuildRun, P as useQuery, y as waitForAuthReady } from './index-C63ceG_z.mjs';
|
|
2
2
|
export * from '@bounded-sh/core';
|
|
3
3
|
export { AppTokenExchangeError, BoundedDeclineError, DECLINE_EVENT_NAME, RATE_LIMIT_EVENT_NAME, ScopedClientReadOnlyError, aggregate, clearAppTokenCache, count, createAppTokenAuthHeaders, createClient, deriveDecline, dispatchDeclineEvent, dispatchRateLimitEvent, docId, exchangeAppToken, get, getConfig, getFiles, getMany, queryAggregate, reconcileSetResult, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe, waitForSetResult } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -4400,6 +4400,47 @@ async function openHiddenSignerFrame(page) {
|
|
|
4400
4400
|
};
|
|
4401
4401
|
}
|
|
4402
4402
|
|
|
4403
|
+
// turnkey-signer-window.ts - the top-level Bounded signer window: opening it, and reserving it
|
|
4404
|
+
// inside a click for an approval that is reached only after awaits.
|
|
4405
|
+
//
|
|
4406
|
+
// A cross-app Turnkey signature (the capability says `transport: 'popup'`) cannot run in the
|
|
4407
|
+
// in-app frame, so it opens in its own window, and a browser opens a window only inside the
|
|
4408
|
+
// user's click. The click handler therefore calls `reserveSignerPopup()` first, before any
|
|
4409
|
+
// `await`, and the exchange in turnkey-signer-bridge.ts navigates that window to the signer later.
|
|
4410
|
+
//
|
|
4411
|
+
// Kept out of the bridge on purpose: the bridge is loaded lazily as a whole module, so a bundler
|
|
4412
|
+
// keeps every one of its exports in every app that signs, while this reservation is needed only
|
|
4413
|
+
// by an app that funds an escrow.
|
|
4414
|
+
function openSignerWindow(url, w = 420, h = 620) {
|
|
4415
|
+
const left = window.screenX + Math.max(0, (window.outerWidth - w) / 2);
|
|
4416
|
+
const top = window.screenY + Math.max(0, (window.outerHeight - h) / 2);
|
|
4417
|
+
return window.open(url, 'bounded-turnkey-signer', `width=${w},height=${h},left=${left},top=${top}`);
|
|
4418
|
+
}
|
|
4419
|
+
// One slot: the next popup exchange takes it, and a new reservation replaces an unused earlier one.
|
|
4420
|
+
// A property of a const rather than a reassigned `let`, which a bundler would keep every assignment
|
|
4421
|
+
// to, dragging the reservation into apps that never reserve.
|
|
4422
|
+
const reserved = { popup: null };
|
|
4423
|
+
/** Hand the reserved window, if one is held, to an exchange: navigated to the signer page at `url`. */
|
|
4424
|
+
function takeReservedPopup(url) {
|
|
4425
|
+
const popup = reserved.popup;
|
|
4426
|
+
reserved.popup = null;
|
|
4427
|
+
if (!popup)
|
|
4428
|
+
return null;
|
|
4429
|
+
if (popup.closed)
|
|
4430
|
+
throw new Error('Wallet approval window was closed before it completed.');
|
|
4431
|
+
try {
|
|
4432
|
+
popup.location.replace(url);
|
|
4433
|
+
}
|
|
4434
|
+
catch (_a) {
|
|
4435
|
+
try {
|
|
4436
|
+
popup.close();
|
|
4437
|
+
}
|
|
4438
|
+
catch ( /* ignore */_b) { /* ignore */ }
|
|
4439
|
+
throw new Error('Wallet approval window could not open the signer - retry from a click.');
|
|
4440
|
+
}
|
|
4441
|
+
return popup;
|
|
4442
|
+
}
|
|
4443
|
+
|
|
4403
4444
|
// turnkey-signing-capability.ts - the pure AS-02 (DS2-0112) signing-capability logic,
|
|
4404
4445
|
// kept import-free (no DOM, no session, no @bounded-sh/core) so it is unit-testable.
|
|
4405
4446
|
//
|
|
@@ -4411,9 +4452,10 @@ async function openHiddenSignerFrame(page) {
|
|
|
4411
4452
|
// so a regression here (a dropped capability, a wrong route, a swallowed error) is
|
|
4412
4453
|
// caught without a browser.
|
|
4413
4454
|
// POST the Bounded id token + payload hash to the issuer's capability mint route and
|
|
4414
|
-
// return the issuer-signed capability for exactly these bytes
|
|
4415
|
-
// is proven with the id token in the
|
|
4416
|
-
// would not carry). Throws with the same
|
|
4455
|
+
// return the issuer-signed capability for exactly these bytes, with the transport the
|
|
4456
|
+
// issuer requires for them. Credential-free: identity is proven with the id token in the
|
|
4457
|
+
// body (not an ambient cookie the cross-origin fetch would not carry). Throws with the same
|
|
4458
|
+
// stable messages the bridge relied on inline.
|
|
4417
4459
|
async function requestTurnkeySigningCapability(opts) {
|
|
4418
4460
|
const base = opts.baseUrl.replace(/\/$/, '');
|
|
4419
4461
|
let res;
|
|
@@ -4443,7 +4485,7 @@ async function requestTurnkeySigningCapability(opts) {
|
|
|
4443
4485
|
if (!d || typeof d.capability !== 'string' || !d.capability) {
|
|
4444
4486
|
throw new Error('Turnkey signing capability was malformed.');
|
|
4445
4487
|
}
|
|
4446
|
-
return d.capability;
|
|
4488
|
+
return d.transport === 'popup' ? { capability: d.capability, transport: 'popup' } : { capability: d.capability };
|
|
4447
4489
|
}
|
|
4448
4490
|
// Assemble the `bounded:turnkey:sign` postMessage request, carrying the issuer-signed
|
|
4449
4491
|
// capability for the same bytes. Without the capability the hosted signer refuses
|
|
@@ -4522,12 +4564,16 @@ function hasDOM$2() {
|
|
|
4522
4564
|
// when we cannot embed (no DOM, or the frame never mounts/loads). Nothing in the
|
|
4523
4565
|
// email-session flow needs a popup by preference: the code entry and the approval
|
|
4524
4566
|
// click both run fine inside a cross-origin iframe on every engine (the old
|
|
4525
|
-
// Safari popup preference existed only for in-iframe WebAuthn CREATE).
|
|
4567
|
+
// Safari popup preference existed only for in-iframe WebAuthn CREATE). The one
|
|
4568
|
+
// exception is a signature the issuer marks `transport: 'popup'` (a cross-app
|
|
4569
|
+
// write): the hosted signer refuses it inside any frame, so it never touches the widget.
|
|
4526
4570
|
async function deliver(url, origin, ex) {
|
|
4527
4571
|
var _a, _b;
|
|
4528
4572
|
const popup = () => runPopup(url, origin, ex);
|
|
4529
4573
|
(_a = ex.assertCurrent) === null || _a === void 0 ? void 0 : _a.call(ex);
|
|
4530
|
-
const result =
|
|
4574
|
+
const result = ex.transport === 'popup'
|
|
4575
|
+
? await popup()
|
|
4576
|
+
: await runWidget(url, origin, { request: ex.request, onResult: ex.onResult, context: ex.context, assertCurrent: ex.assertCurrent }, popup);
|
|
4531
4577
|
(_b = ex.assertCurrent) === null || _b === void 0 ? void 0 : _b.call(ex);
|
|
4532
4578
|
return result;
|
|
4533
4579
|
}
|
|
@@ -4592,14 +4638,12 @@ function activeTurnkeyAddress() {
|
|
|
4592
4638
|
: null;
|
|
4593
4639
|
}
|
|
4594
4640
|
let requestSeq = 0;
|
|
4595
|
-
// Shared popup driver: open the signer page
|
|
4596
|
-
// resolve when `onResult` accepts a result message. Origin +
|
|
4641
|
+
// Shared popup driver: open the signer page (in the reserved window when one is held), do the
|
|
4642
|
+
// ready/postMessage handshake, and resolve when `onResult` accepts a result message. Origin +
|
|
4643
|
+
// source are pinned.
|
|
4597
4644
|
async function runPopup(url, signerOrigin, ex) {
|
|
4598
|
-
var _a
|
|
4599
|
-
const
|
|
4600
|
-
const left = window.screenX + Math.max(0, (window.outerWidth - w) / 2);
|
|
4601
|
-
const top = window.screenY + Math.max(0, (window.outerHeight - h) / 2);
|
|
4602
|
-
const popup = window.open(url, 'bounded-turnkey-signer', `width=${w},height=${h},left=${left},top=${top}`);
|
|
4645
|
+
var _a;
|
|
4646
|
+
const popup = (_a = takeReservedPopup(url)) !== null && _a !== void 0 ? _a : openSignerWindow(url, ex.width, ex.height);
|
|
4603
4647
|
if (!popup) {
|
|
4604
4648
|
throw new Error('Popup blocked - call this from a user gesture (e.g. a click handler) so the wallet approval window can open.');
|
|
4605
4649
|
}
|
|
@@ -4777,7 +4821,7 @@ async function signSolanaMessageViaTurnkey(message) {
|
|
|
4777
4821
|
const messageHex = toHex(message);
|
|
4778
4822
|
// AS-02: obtain the issuer-signed capability for THESE exact bytes first; the signer will
|
|
4779
4823
|
// refuse (capability_required) without it. Fetched per signature (each is single-payload).
|
|
4780
|
-
const capability = await fetchSigningCapability(messageHex, context);
|
|
4824
|
+
const { capability, transport } = await fetchSigningCapability(messageHex, context);
|
|
4781
4825
|
// Inline (authMode:"turnkey") sessions plant no Better Auth cookie on the issuer, so the
|
|
4782
4826
|
// signer's same-origin status/create fetches need a bearer session proof: attach the
|
|
4783
4827
|
// createWallet action authorization (it covers the sign flow's get-or-create too). Minted
|
|
@@ -4786,11 +4830,20 @@ async function signSolanaMessageViaTurnkey(message) {
|
|
|
4786
4830
|
return await deliver(url, origin, {
|
|
4787
4831
|
context: context.key, assertCurrent: context.assertCurrent,
|
|
4788
4832
|
request: buildTurnkeySignRequest({ requestId, messageHex, capability, authorization }),
|
|
4833
|
+
transport,
|
|
4789
4834
|
onResult: (d) => {
|
|
4790
4835
|
if (d.ok && typeof d.signatureHex === 'string' && typeof d.address === 'string') {
|
|
4791
|
-
|
|
4836
|
+
// A top-level popup keeps its signing session in the signer origin's own storage, which the
|
|
4837
|
+
// warm in-app frame (a partitioned context) cannot see, so it says nothing about that frame.
|
|
4838
|
+
if (transport !== 'popup')
|
|
4839
|
+
setWalletSessionState(context.key, { expiresAt: Number(d.signingSessionExpiresAt) });
|
|
4792
4840
|
return { done: true, value: { signature: fromHex(d.signatureHex), address: d.address, subOrgId: String(d.subOrgId || '') } };
|
|
4793
4841
|
}
|
|
4842
|
+
// The hosted signer refuses a cross-app signature inside a frame. Never retry it from here:
|
|
4843
|
+
// the top-level window needs the user's own click.
|
|
4844
|
+
if (d.error === 'top_level_required') {
|
|
4845
|
+
return { error: 'top_level_required: an approval that writes to another app must open in its own window. Start it from a click handler.' };
|
|
4846
|
+
}
|
|
4794
4847
|
return { error: String(d.error || 'Turnkey signing failed') };
|
|
4795
4848
|
},
|
|
4796
4849
|
});
|
|
@@ -6036,7 +6089,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6036
6089
|
// manager as legacy email sessions. Human login should be started
|
|
6037
6090
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
6038
6091
|
// logout surface for those sessions.
|
|
6039
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
6092
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-CwG04f4u.js'); })).EmailAuthProvider();
|
|
6040
6093
|
break;
|
|
6041
6094
|
case "phantom": {
|
|
6042
6095
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6078,7 +6131,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6078
6131
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6079
6132
|
// evidence the user has a wallet.
|
|
6080
6133
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6081
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6134
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-BvlKZoVJ.js'); });
|
|
6082
6135
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6083
6136
|
break;
|
|
6084
6137
|
}
|
|
@@ -6091,7 +6144,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6091
6144
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6092
6145
|
// to point at a specific wallet or set chainId/domain.
|
|
6093
6146
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6094
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
6147
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-C6KC7pJ6.js'); });
|
|
6095
6148
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6096
6149
|
break;
|
|
6097
6150
|
}
|
|
@@ -6116,7 +6169,7 @@ async function getAuthProvider(config, fromStorage = false) {
|
|
|
6116
6169
|
break;
|
|
6117
6170
|
case "guest":
|
|
6118
6171
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6119
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6172
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-3rfSwq3f.js'); })).GuestAuthProvider();
|
|
6120
6173
|
break;
|
|
6121
6174
|
}
|
|
6122
6175
|
if (!currentAuthProvider) {
|
|
@@ -6178,7 +6231,7 @@ async function signInAnonymously() {
|
|
|
6178
6231
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6179
6232
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6180
6233
|
// so bundle-splitting can see it.
|
|
6181
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
6234
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-3rfSwq3f.js'); })).GuestAuthProvider();
|
|
6182
6235
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6183
6236
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6184
6237
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6349,7 +6402,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6349
6402
|
if (!sharedWalletReady) {
|
|
6350
6403
|
sharedWalletReady = (async () => {
|
|
6351
6404
|
await core.getConfig();
|
|
6352
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6405
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-BvlKZoVJ.js'); });
|
|
6353
6406
|
})().catch((error) => {
|
|
6354
6407
|
sharedWalletReady = null;
|
|
6355
6408
|
throw error;
|
|
@@ -8905,4 +8958,4 @@ exports.useBuildRun = useBuildRun;
|
|
|
8905
8958
|
exports.useQuery = useQuery;
|
|
8906
8959
|
exports.waitForAuthReady = waitForAuthReady;
|
|
8907
8960
|
exports.walletStandardFeatureName = walletStandardFeatureName;
|
|
8908
|
-
//# sourceMappingURL=index.native-
|
|
8961
|
+
//# sourceMappingURL=index.native-BBLBnqal.js.map
|