@bounded-sh/client 0.0.95 → 0.0.97
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/turnkey-auth.d.ts +9 -7
- package/dist/bounded-widget-modal-C0Z7gmxH.mjs +31 -0
- package/dist/bounded-widget-modal-C0Z7gmxH.mjs.map +1 -0
- package/dist/bounded-widget-modal-s0PL86Y-.js +33 -0
- package/dist/bounded-widget-modal-s0PL86Y-.js.map +1 -0
- package/dist/builds/client.d.ts +31 -0
- package/dist/builds/index.d.ts +3 -2
- package/dist/{email-auth-provider-mNpHuk1i.js → email-auth-provider-BhYzRN0r.js} +2 -2
- package/dist/{email-auth-provider-mNpHuk1i.js.map → email-auth-provider-BhYzRN0r.js.map} +1 -1
- package/dist/{email-auth-provider-H6Dw5Z9x.mjs → email-auth-provider-CiPAD3vz.mjs} +2 -2
- package/dist/{email-auth-provider-H6Dw5Z9x.mjs.map → email-auth-provider-CiPAD3vz.mjs.map} +1 -1
- package/dist/{email-auth-provider-D7wnHbb3.mjs → email-auth-provider-DbBN1MXS.mjs} +2 -2
- package/dist/{email-auth-provider-D7wnHbb3.mjs.map → email-auth-provider-DbBN1MXS.mjs.map} +1 -1
- package/dist/{email-auth-provider-DqXtds8G.js → email-auth-provider-SqE5H8jv.js} +2 -2
- package/dist/{email-auth-provider-DqXtds8G.js.map → email-auth-provider-SqE5H8jv.js.map} +1 -1
- package/dist/{guest-auth-provider-DwgEfPWe.js → guest-auth-provider-BiM35KHb.js} +2 -2
- package/dist/{guest-auth-provider-DwgEfPWe.js.map → guest-auth-provider-BiM35KHb.js.map} +1 -1
- package/dist/{guest-auth-provider-CenCVVnc.mjs → guest-auth-provider-Dtsq4QaY.mjs} +2 -2
- package/dist/{guest-auth-provider-CenCVVnc.mjs.map → guest-auth-provider-Dtsq4QaY.mjs.map} +1 -1
- package/dist/{guest-auth-provider-CKMU9n1w.js → guest-auth-provider-JE0zdREA.js} +2 -2
- package/dist/{guest-auth-provider-CKMU9n1w.js.map → guest-auth-provider-JE0zdREA.js.map} +1 -1
- package/dist/{guest-auth-provider-CJjhV1b0.mjs → guest-auth-provider-KCalcsKu.mjs} +2 -2
- package/dist/{guest-auth-provider-CJjhV1b0.mjs.map → guest-auth-provider-KCalcsKu.mjs.map} +1 -1
- package/dist/{index-BiytVNMk.js → index-Bb7I-AoO.js} +524 -661
- package/dist/index-Bb7I-AoO.js.map +1 -0
- package/dist/{index-D3mp2wpM.mjs → index-C01Q7k1A.mjs} +524 -661
- package/dist/index-C01Q7k1A.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{index.native-vfNe1Pga.js → index.native-BZOWS_sR.js} +35 -332
- package/dist/index.native-BZOWS_sR.js.map +1 -0
- package/dist/{index.native-DHFDc9Vy.mjs → index.native-gVbAsohv.mjs} +35 -332
- package/dist/index.native-gVbAsohv.mjs.map +1 -0
- package/dist/index.native.js +1 -1
- package/dist/index.native.mjs +1 -1
- package/dist/{injected-evm-wallet-provider-BLg6H50t.js → injected-evm-wallet-provider-C3MwUTRd.js} +2 -2
- package/dist/{injected-evm-wallet-provider-BLg6H50t.js.map → injected-evm-wallet-provider-C3MwUTRd.js.map} +1 -1
- package/dist/{injected-evm-wallet-provider-BsxKY7bi.mjs → injected-evm-wallet-provider-DIMM0HdQ.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-BsxKY7bi.mjs.map → injected-evm-wallet-provider-DIMM0HdQ.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-B8_1qfbX.mjs → injected-evm-wallet-provider-K0j697jt.mjs} +2 -2
- package/dist/{injected-evm-wallet-provider-B8_1qfbX.mjs.map → injected-evm-wallet-provider-K0j697jt.mjs.map} +1 -1
- package/dist/{injected-evm-wallet-provider-B7lMl8NN.js → injected-evm-wallet-provider-ZrxW8UES.js} +2 -2
- package/dist/{injected-evm-wallet-provider-B7lMl8NN.js.map → injected-evm-wallet-provider-ZrxW8UES.js.map} +1 -1
- package/dist/{injected-wallet-provider-zLWZ_vKC.js → injected-wallet-provider-CDl-az6P.js} +2 -2
- package/dist/{injected-wallet-provider-zLWZ_vKC.js.map → injected-wallet-provider-CDl-az6P.js.map} +1 -1
- package/dist/{injected-wallet-provider-DNU7LBlK.js → injected-wallet-provider-CG3oKdp_.js} +2 -2
- package/dist/{injected-wallet-provider-DNU7LBlK.js.map → injected-wallet-provider-CG3oKdp_.js.map} +1 -1
- package/dist/{injected-wallet-provider-D8Y_sP0c.mjs → injected-wallet-provider-DCaT1pKl.mjs} +2 -2
- package/dist/{injected-wallet-provider-D8Y_sP0c.mjs.map → injected-wallet-provider-DCaT1pKl.mjs.map} +1 -1
- package/dist/{injected-wallet-provider-DE_Kce-V.mjs → injected-wallet-provider-DH8yLpyf.mjs} +2 -2
- package/dist/{injected-wallet-provider-DE_Kce-V.mjs.map → injected-wallet-provider-DH8yLpyf.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/index-BiytVNMk.js.map +0 -1
- package/dist/index-D3mp2wpM.mjs.map +0 -1
- package/dist/index.native-DHFDc9Vy.mjs.map +0 -1
- package/dist/index.native-vfNe1Pga.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ab as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, aa as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, a9 as BUILD_REVIEW_CAPABILITY_SCHEMA, a3 as BuildsApiError, a8 as FAILURE_REASONS, a4 as NON_TERMINAL_STATES, $ as OffchainAuthProvider, a7 as PARK_REASONS, a0 as PrivyExpoProvider, a6 as RUN_STATES, a5 as TERMINAL_STATES, W as WalletConfigError, Q as apps, a2 as builds, I as completeLoginFromRedirect, K as completeLoginInPopup, o as defaultInjectedEvmProvider, f as defaultInjectedProvider, F as ensureSharedWalletLoginReady, M as ensureSignedIn, E as ensureWalletLoginReady, w as getAuthLoading, A as getAuthProvider, q as getCurrentUser, V as getIdToken, S as getOrCreateTurnkeyWallet, g as getPlatform, p as init, y as login, J as loginWithPopup, C as loginWithPrivy, H as loginWithRedirect, D as loginWithWallet, z as logout, v as onAuthLoadingChanged, u as onAuthStateChanged, X as onramp, Y as onrampQuote, Z as onrampStatus, L as openBoundedWidget, T as openTurnkeyKeyExport, G as preloadWalletLogin, a1 as requestEip6963Providers, _ as setPlatform, B as signInAnonymously, R as signSolanaMessageViaTurnkey, U as startTurnkeyEmailLogin, N as useAuth, P as useBuildRun, O as useQuery, x as waitForAuthReady } from './index-
|
|
1
|
+
export { ab as BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA, aa as BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA, a9 as BUILD_REVIEW_CAPABILITY_SCHEMA, a3 as BuildsApiError, a8 as FAILURE_REASONS, a4 as NON_TERMINAL_STATES, $ as OffchainAuthProvider, a7 as PARK_REASONS, a0 as PrivyExpoProvider, a6 as RUN_STATES, a5 as TERMINAL_STATES, W as WalletConfigError, Q as apps, a2 as builds, I as completeLoginFromRedirect, K as completeLoginInPopup, o as defaultInjectedEvmProvider, f as defaultInjectedProvider, F as ensureSharedWalletLoginReady, M as ensureSignedIn, E as ensureWalletLoginReady, w as getAuthLoading, A as getAuthProvider, q as getCurrentUser, V as getIdToken, S as getOrCreateTurnkeyWallet, g as getPlatform, p as init, y as login, J as loginWithPopup, C as loginWithPrivy, H as loginWithRedirect, D as loginWithWallet, z as logout, v as onAuthLoadingChanged, u as onAuthStateChanged, X as onramp, Y as onrampQuote, Z as onrampStatus, L as openBoundedWidget, T as openTurnkeyKeyExport, G as preloadWalletLogin, a1 as requestEip6963Providers, _ as setPlatform, B as signInAnonymously, R as signSolanaMessageViaTurnkey, U as startTurnkeyEmailLogin, N as useAuth, P as useBuildRun, O as useQuery, x as waitForAuthReady } from './index-C01Q7k1A.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, reconcileSetResult, runExpression, runExpressionMany, runQuery, runQueryMany, search, set, setFile, setMany, signAndSubmitTransaction, signMessage, signTransaction, subscribe, waitForSetResult } from '@bounded-sh/core';
|
|
4
4
|
import 'react';
|
|
@@ -4188,322 +4188,6 @@ async function ensureSolanaMobileWalletRegistered(config, network) {
|
|
|
4188
4188
|
|
|
4189
4189
|
var bufferExports = requireBuffer();
|
|
4190
4190
|
|
|
4191
|
-
// bounded-widget-modal.ts - the shared in-app WIDGET shell for Bounded's login
|
|
4192
|
-
// and signing surfaces. One Shadow-DOM overlay + panel that matches the Bounded
|
|
4193
|
-
// widget (Seal) look and MOTION: a backdrop fade, a panel rise on desktop, a
|
|
4194
|
-
// bottom-sheet on mobile, a height tween as content swaps, and a clean close.
|
|
4195
|
-
//
|
|
4196
|
-
// It hosts EITHER:
|
|
4197
|
-
// - NATIVE content (the login card the SDK renders itself), or
|
|
4198
|
-
// - an IFRAME (the Bounded-owned signer page, which must run on the single
|
|
4199
|
-
// signer origin because the wallet's 24h signing session lives in that
|
|
4200
|
-
// origin's storage, out of every app's reach).
|
|
4201
|
-
//
|
|
4202
|
-
// The modal is a warm singleton: it stays mounted (hidden) between uses so a
|
|
4203
|
-
// second open - or a signature right after login - is instant and, when it is
|
|
4204
|
-
// already open, a clean in-place view swap rather than a reopen.
|
|
4205
|
-
function hasDOM$4() {
|
|
4206
|
-
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
4207
|
-
}
|
|
4208
|
-
const OVERLAY_CSS = `
|
|
4209
|
-
:host{all:initial}
|
|
4210
|
-
*{box-sizing:border-box}
|
|
4211
|
-
.bw-ov{position:fixed;inset:0;z-index:2147483647;display:none;
|
|
4212
|
-
font-family:"Schibsted Grotesk","Helvetica Neue",Arial,sans-serif}
|
|
4213
|
-
.bw-ov.mounted{display:block}
|
|
4214
|
-
.bw-back{position:fixed;inset:0;background:rgba(4,4,5,.62);opacity:0;
|
|
4215
|
-
transition:opacity .24s ease;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}
|
|
4216
|
-
.bw-wrap{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px}
|
|
4217
|
-
.bw-panel{position:relative;width:420px;max-width:calc(100vw - 28px);height:280px;
|
|
4218
|
-
border-radius:14px;overflow:hidden;background:#0e0f11;border:1px solid rgba(232,230,222,.08);
|
|
4219
|
-
box-shadow:0 1px 0 rgba(232,230,222,.03) inset,0 40px 90px -45px rgba(0,0,0,.85);
|
|
4220
|
-
opacity:0;transform:translateY(14px) scale(.98);will-change:transform,opacity,height;
|
|
4221
|
-
transition:opacity .28s cubic-bezier(.2,.8,.2,1),transform .28s cubic-bezier(.2,.8,.2,1),
|
|
4222
|
-
height .3s cubic-bezier(.2,.8,.2,1)}
|
|
4223
|
-
.bw-ov.show .bw-back{opacity:1}
|
|
4224
|
-
.bw-ov.show .bw-panel{opacity:1;transform:none}
|
|
4225
|
-
.bw-ov.closing .bw-back{opacity:0}
|
|
4226
|
-
.bw-ov.closing .bw-panel{opacity:0;transform:translateY(12px) scale(.99)}
|
|
4227
|
-
.bw-content{position:absolute;inset:0;overflow:hidden}
|
|
4228
|
-
.bw-frame{display:block;width:100%;height:100%;border:0;background:transparent;color-scheme:dark}
|
|
4229
|
-
/* editorial corner crop-marks, matching the reference frame */
|
|
4230
|
-
.bw-mk{position:absolute;width:13px;height:13px;pointer-events:none;z-index:2;
|
|
4231
|
-
border-color:rgba(232,230,222,.22);border-style:solid;border-width:0}
|
|
4232
|
-
.bw-mk.tl{top:11px;left:11px;border-top-width:1px;border-left-width:1px}
|
|
4233
|
-
.bw-mk.tr{top:11px;right:11px;border-top-width:1px;border-right-width:1px}
|
|
4234
|
-
.bw-mk.bl{bottom:11px;left:11px;border-bottom-width:1px;border-left-width:1px}
|
|
4235
|
-
.bw-mk.br{bottom:11px;right:11px;border-bottom-width:1px;border-right-width:1px}
|
|
4236
|
-
@media(max-width:560px){
|
|
4237
|
-
.bw-wrap{align-items:flex-end;padding:0}
|
|
4238
|
-
.bw-panel{width:100%;max-width:100%;border-radius:18px 18px 0 0;border-bottom:0}
|
|
4239
|
-
.bw-content{overflow-y:auto}
|
|
4240
|
-
.bw-ov.show .bw-panel{transform:none}
|
|
4241
|
-
.bw-ov:not(.show) .bw-panel,.bw-ov.closing .bw-panel{transform:translateY(18%)}
|
|
4242
|
-
}
|
|
4243
|
-
@media(prefers-reduced-motion:reduce){.bw-back,.bw-panel{transition:opacity .12s linear!important}}
|
|
4244
|
-
`;
|
|
4245
|
-
let modal = null;
|
|
4246
|
-
function getModal() {
|
|
4247
|
-
if (modal)
|
|
4248
|
-
return modal;
|
|
4249
|
-
const root = document.createElement("div");
|
|
4250
|
-
root.setAttribute("data-bounded-widget", "");
|
|
4251
|
-
const shadow = root.attachShadow({ mode: "open" });
|
|
4252
|
-
const style = document.createElement("style");
|
|
4253
|
-
style.textContent = OVERLAY_CSS;
|
|
4254
|
-
shadow.appendChild(style);
|
|
4255
|
-
const overlay = document.createElement("div");
|
|
4256
|
-
overlay.className = "bw-ov";
|
|
4257
|
-
const back = document.createElement("div");
|
|
4258
|
-
back.className = "bw-back";
|
|
4259
|
-
const wrap = document.createElement("div");
|
|
4260
|
-
wrap.className = "bw-wrap";
|
|
4261
|
-
const panel = document.createElement("div");
|
|
4262
|
-
panel.className = "bw-panel";
|
|
4263
|
-
const content = document.createElement("div");
|
|
4264
|
-
content.className = "bw-content";
|
|
4265
|
-
panel.appendChild(content);
|
|
4266
|
-
for (const corner of ["tl", "tr", "bl", "br"]) {
|
|
4267
|
-
const mk = document.createElement("span");
|
|
4268
|
-
mk.className = "bw-mk " + corner;
|
|
4269
|
-
panel.appendChild(mk);
|
|
4270
|
-
}
|
|
4271
|
-
wrap.appendChild(panel);
|
|
4272
|
-
overlay.appendChild(back);
|
|
4273
|
-
overlay.appendChild(wrap);
|
|
4274
|
-
shadow.appendChild(overlay);
|
|
4275
|
-
(document.body || document.documentElement).appendChild(root);
|
|
4276
|
-
const m = {
|
|
4277
|
-
root,
|
|
4278
|
-
overlay,
|
|
4279
|
-
panel,
|
|
4280
|
-
content,
|
|
4281
|
-
iframe: null,
|
|
4282
|
-
iframeOrigin: "",
|
|
4283
|
-
iframeReady: false,
|
|
4284
|
-
onBackdrop: null,
|
|
4285
|
-
onIframeMessage: null,
|
|
4286
|
-
chain: Promise.resolve(),
|
|
4287
|
-
fitObserver: null,
|
|
4288
|
-
generation: 0,
|
|
4289
|
-
onSupersede: null,
|
|
4290
|
-
};
|
|
4291
|
-
// The dismiss handler lives on `.bw-wrap`: it is the full-viewport flex layer
|
|
4292
|
-
// that sits ABOVE `.bw-back`, so it (not the backdrop element) receives clicks
|
|
4293
|
-
// outside the panel. Fire only when the click lands on the wrap itself, never
|
|
4294
|
-
// when it bubbles up from the panel or its content.
|
|
4295
|
-
wrap.addEventListener("click", (event) => {
|
|
4296
|
-
if (event.target === wrap && m.onBackdrop)
|
|
4297
|
-
m.onBackdrop();
|
|
4298
|
-
});
|
|
4299
|
-
window.addEventListener("message", (event) => {
|
|
4300
|
-
if (!m.iframe)
|
|
4301
|
-
return;
|
|
4302
|
-
if (event.origin !== m.iframeOrigin)
|
|
4303
|
-
return;
|
|
4304
|
-
if (event.source !== m.iframe.contentWindow)
|
|
4305
|
-
return;
|
|
4306
|
-
const d = event.data;
|
|
4307
|
-
if (!d || typeof d !== "object")
|
|
4308
|
-
return;
|
|
4309
|
-
if (m.onIframeMessage)
|
|
4310
|
-
m.onIframeMessage(d);
|
|
4311
|
-
});
|
|
4312
|
-
modal = m;
|
|
4313
|
-
return m;
|
|
4314
|
-
}
|
|
4315
|
-
function showModal(m) {
|
|
4316
|
-
m.overlay.classList.remove("closing");
|
|
4317
|
-
m.overlay.classList.add("mounted");
|
|
4318
|
-
// Force a reflow so the .show transition runs from the hidden state every open.
|
|
4319
|
-
void m.panel.offsetWidth;
|
|
4320
|
-
m.overlay.classList.add("show");
|
|
4321
|
-
}
|
|
4322
|
-
function hideModal(m, after) {
|
|
4323
|
-
m.overlay.classList.remove("show");
|
|
4324
|
-
m.overlay.classList.add("closing");
|
|
4325
|
-
// Capture the generation at hide time. If a newer open re-shows the modal within
|
|
4326
|
-
// the close tween, this stale timer must NOT strip `.mounted`/`.closing` off the
|
|
4327
|
-
// freshly reopened widget - only tear down when we are still the same open.
|
|
4328
|
-
const gen = m.generation;
|
|
4329
|
-
window.setTimeout(() => {
|
|
4330
|
-
if (m.generation === gen)
|
|
4331
|
-
m.overlay.classList.remove("mounted", "closing");
|
|
4332
|
-
}, 260);
|
|
4333
|
-
}
|
|
4334
|
-
function setPanelHeight(m, px) {
|
|
4335
|
-
const h = Math.max(140, Math.min(680, Math.round(px)));
|
|
4336
|
-
m.panel.style.height = h + "px";
|
|
4337
|
-
}
|
|
4338
|
-
/** Get (or lazily create) the warm iframe for signer/hosted-page mode. */
|
|
4339
|
-
function ensureIframe(m, url, origin) {
|
|
4340
|
-
var _a;
|
|
4341
|
-
if (m.iframe && m.iframeOrigin === origin && m.iframe.src === url)
|
|
4342
|
-
return m.iframe;
|
|
4343
|
-
detachIframe(m);
|
|
4344
|
-
(_a = m.fitObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
4345
|
-
m.fitObserver = null;
|
|
4346
|
-
m.content.style.display = "none";
|
|
4347
|
-
const iframe = document.createElement("iframe");
|
|
4348
|
-
iframe.className = "bw-frame";
|
|
4349
|
-
iframe.setAttribute("title", "Bounded");
|
|
4350
|
-
iframe.setAttribute("allow", "clipboard-write");
|
|
4351
|
-
iframe.src = url;
|
|
4352
|
-
m.iframeOrigin = origin;
|
|
4353
|
-
m.iframeReady = false;
|
|
4354
|
-
m.panel.appendChild(iframe);
|
|
4355
|
-
m.iframe = iframe;
|
|
4356
|
-
return iframe;
|
|
4357
|
-
}
|
|
4358
|
-
/**
|
|
4359
|
-
* Destroy the warm signer iframe if one is currently mounted for `origin`, and report
|
|
4360
|
-
* whether there was one. Logout needs this: a signing session can live in that document's
|
|
4361
|
-
* MEMORY (the signer keeps an in-memory mirror when the browser blocks its storage), and a
|
|
4362
|
-
* throwaway iframe opened by the sweep can only ever clear the shared store, never another
|
|
4363
|
-
* document's memory. Removing the iframe discards its browsing context, which takes the
|
|
4364
|
-
* mirror with it.
|
|
4365
|
-
*
|
|
4366
|
-
* Deliberately does NOT call getModal(): that would BUILD a modal just to tear it down, on
|
|
4367
|
-
* every logout of every app, most of which never mounted one.
|
|
4368
|
-
*/
|
|
4369
|
-
function detachWarmSignerIframe(origin) {
|
|
4370
|
-
if (!modal || !modal.iframe || modal.iframeOrigin !== origin)
|
|
4371
|
-
return false;
|
|
4372
|
-
detachIframe(modal);
|
|
4373
|
-
return true;
|
|
4374
|
-
}
|
|
4375
|
-
function detachIframe(m) {
|
|
4376
|
-
if (m.iframe) {
|
|
4377
|
-
try {
|
|
4378
|
-
m.iframe.remove();
|
|
4379
|
-
}
|
|
4380
|
-
catch (_a) {
|
|
4381
|
-
/* ignore */
|
|
4382
|
-
}
|
|
4383
|
-
}
|
|
4384
|
-
m.iframe = null;
|
|
4385
|
-
m.iframeReady = false;
|
|
4386
|
-
m.iframeOrigin = "";
|
|
4387
|
-
m.onIframeMessage = null;
|
|
4388
|
-
}
|
|
4389
|
-
|
|
4390
|
-
var boundedWidgetModal = /*#__PURE__*/Object.freeze({
|
|
4391
|
-
__proto__: null,
|
|
4392
|
-
detachIframe: detachIframe,
|
|
4393
|
-
detachWarmSignerIframe: detachWarmSignerIframe,
|
|
4394
|
-
ensureIframe: ensureIframe,
|
|
4395
|
-
getModal: getModal,
|
|
4396
|
-
hasDOM: hasDOM$4,
|
|
4397
|
-
hideModal: hideModal,
|
|
4398
|
-
setPanelHeight: setPanelHeight,
|
|
4399
|
-
showModal: showModal
|
|
4400
|
-
});
|
|
4401
|
-
|
|
4402
|
-
// turnkey-wallet-widget.ts - runs one Turnkey signer exchange inside the shared
|
|
4403
|
-
// in-app WIDGET (bounded-widget-modal.ts). The Bounded-owned signer page is loaded
|
|
4404
|
-
// in a warm iframe behind the modal so signing feels native: an in-app approve
|
|
4405
|
-
// card (with inline code entry when the 24h signing session must first be
|
|
4406
|
-
// established), never a jarring popup.
|
|
4407
|
-
//
|
|
4408
|
-
// WHY AN IFRAME: the wallet's signing session lives in the single Bounded signer
|
|
4409
|
-
// origin's storage, out of every app's reach, so signing MUST run on that origin;
|
|
4410
|
-
// the iframe brings it in-app.
|
|
4411
|
-
//
|
|
4412
|
-
// Restricted embedders: if the frame never loads, the SAME request reruns through
|
|
4413
|
-
// `popupFallback` (a real window). Callers pass a popup implementation and never
|
|
4414
|
-
// see the difference.
|
|
4415
|
-
/**
|
|
4416
|
-
* Run one signer exchange through the in-app widget. Resolves when `onResult`
|
|
4417
|
-
* accepts a result; falls back to `popupFallback` if the frame cannot be mounted
|
|
4418
|
-
* or never loads.
|
|
4419
|
-
*/
|
|
4420
|
-
async function runWidget(url, signerOrigin, ex, popupFallback) {
|
|
4421
|
-
if (!hasDOM$4())
|
|
4422
|
-
return popupFallback();
|
|
4423
|
-
const m = getModal();
|
|
4424
|
-
const requestId = String(ex.request.requestId);
|
|
4425
|
-
// Serialize: the approve card is modal, and one warm frame handles one request at a time.
|
|
4426
|
-
const run = m.chain.then(() => new Promise((resolve, reject) => {
|
|
4427
|
-
let settled = false;
|
|
4428
|
-
let usedFallback = false;
|
|
4429
|
-
const iframe = ensureIframe(m, url, signerOrigin);
|
|
4430
|
-
const send = () => {
|
|
4431
|
-
if (!iframe.contentWindow)
|
|
4432
|
-
return;
|
|
4433
|
-
try {
|
|
4434
|
-
iframe.contentWindow.postMessage(ex.request, signerOrigin);
|
|
4435
|
-
}
|
|
4436
|
-
catch (_a) {
|
|
4437
|
-
/* frame gone */
|
|
4438
|
-
}
|
|
4439
|
-
};
|
|
4440
|
-
let loadTimer = 0;
|
|
4441
|
-
let ceilingTimer = 0;
|
|
4442
|
-
const finish = (fn) => {
|
|
4443
|
-
if (settled)
|
|
4444
|
-
return;
|
|
4445
|
-
settled = true;
|
|
4446
|
-
m.onIframeMessage = null;
|
|
4447
|
-
m.onBackdrop = null;
|
|
4448
|
-
window.clearTimeout(loadTimer);
|
|
4449
|
-
window.clearTimeout(ceilingTimer);
|
|
4450
|
-
fn();
|
|
4451
|
-
};
|
|
4452
|
-
const goFallback = () => {
|
|
4453
|
-
if (usedFallback || settled)
|
|
4454
|
-
return;
|
|
4455
|
-
usedFallback = true;
|
|
4456
|
-
hideModal(m);
|
|
4457
|
-
finish(() => popupFallback().then(resolve, reject));
|
|
4458
|
-
};
|
|
4459
|
-
m.onBackdrop = () => {
|
|
4460
|
-
hideModal(m);
|
|
4461
|
-
finish(() => reject(new Error("cancelled")));
|
|
4462
|
-
};
|
|
4463
|
-
m.onIframeMessage = (d) => {
|
|
4464
|
-
if (d.type === "bounded:turnkey:ready") {
|
|
4465
|
-
m.iframeReady = true;
|
|
4466
|
-
send();
|
|
4467
|
-
return;
|
|
4468
|
-
}
|
|
4469
|
-
if (d.type === "bounded:turnkey:resize" && typeof d.height === "number") {
|
|
4470
|
-
setPanelHeight(m, d.height);
|
|
4471
|
-
return;
|
|
4472
|
-
}
|
|
4473
|
-
if (d.type === "bounded:turnkey:result" && d.requestId === requestId) {
|
|
4474
|
-
const outcome = ex.onResult(d);
|
|
4475
|
-
if ("error" in outcome) {
|
|
4476
|
-
hideModal(m);
|
|
4477
|
-
finish(() => reject(new Error(outcome.error)));
|
|
4478
|
-
return;
|
|
4479
|
-
}
|
|
4480
|
-
if (outcome.done) {
|
|
4481
|
-
hideModal(m);
|
|
4482
|
-
finish(() => resolve(outcome.value));
|
|
4483
|
-
}
|
|
4484
|
-
}
|
|
4485
|
-
};
|
|
4486
|
-
showModal(m);
|
|
4487
|
-
if (m.iframeReady)
|
|
4488
|
-
send();
|
|
4489
|
-
// If the frame never loads, degrade to the popup (best-effort - a post-load
|
|
4490
|
-
// popup may be blocked without a gesture, in which case the fallback rejects).
|
|
4491
|
-
loadTimer = window.setTimeout(() => {
|
|
4492
|
-
if (!m.iframeReady && !settled)
|
|
4493
|
-
goFallback();
|
|
4494
|
-
}, 8000);
|
|
4495
|
-
// Absolute ceiling so a stuck flow cannot hang forever.
|
|
4496
|
-
ceilingTimer = window.setTimeout(() => {
|
|
4497
|
-
if (!settled) {
|
|
4498
|
-
hideModal(m);
|
|
4499
|
-
finish(() => reject(new Error("Wallet approval timed out.")));
|
|
4500
|
-
}
|
|
4501
|
-
}, 5 * 60 * 1000);
|
|
4502
|
-
}));
|
|
4503
|
-
m.chain = run.then(() => undefined, () => undefined);
|
|
4504
|
-
return run;
|
|
4505
|
-
}
|
|
4506
|
-
|
|
4507
4191
|
// turnkey-signer-frame.ts - a HIDDEN, offscreen iframe of the Bounded signer page
|
|
4508
4192
|
// for UI-less signer exchanges: sealing a login code (bounded:turnkey:encryptOtp),
|
|
4509
4193
|
// establishing the 24h signing session right after login
|
|
@@ -4720,14 +4404,14 @@ async function requestTurnkeyActionAuthorization(opts) {
|
|
|
4720
4404
|
function hasDOM$2() {
|
|
4721
4405
|
return typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
4722
4406
|
}
|
|
4723
|
-
//
|
|
4724
|
-
//
|
|
4725
|
-
//
|
|
4726
|
-
// click
|
|
4727
|
-
//
|
|
4407
|
+
// BSA-2026-006: dispatch every signing / get-or-create exchange through a TOP-LEVEL
|
|
4408
|
+
// POPUP the caller opened from the user gesture - NEVER a framed widget. An authorized
|
|
4409
|
+
// tenant that embedded the signer could overlay its predictable Approve control and steal
|
|
4410
|
+
// one concealed click into a fund-moving signature; a top-level window it cannot reach or
|
|
4411
|
+
// visually redress closes that. A blocked popup surfaces `popup_blocked` (runPopup) and we
|
|
4412
|
+
// never silently fall back to an iframe.
|
|
4728
4413
|
async function deliver(url, origin, ex) {
|
|
4729
|
-
|
|
4730
|
-
return runWidget(url, origin, { request: ex.request, onResult: ex.onResult }, popup);
|
|
4414
|
+
return runPopup(url, origin, ex);
|
|
4731
4415
|
}
|
|
4732
4416
|
async function turnkeySignerPage() {
|
|
4733
4417
|
const cfg = await core.getConfig();
|
|
@@ -4788,7 +4472,7 @@ async function runPopup(url, signerOrigin, ex) {
|
|
|
4788
4472
|
const top = window.screenY + Math.max(0, (window.outerHeight - h) / 2);
|
|
4789
4473
|
const popup = window.open(url, 'bounded-turnkey-signer', `width=${w},height=${h},left=${left},top=${top}`);
|
|
4790
4474
|
if (!popup) {
|
|
4791
|
-
throw new Error('
|
|
4475
|
+
throw new Error('popup_blocked - the wallet approval window was blocked. Call this from a user gesture (e.g. a click handler) so it can open; we never fall back to an in-page frame.');
|
|
4792
4476
|
}
|
|
4793
4477
|
return await new Promise((resolve, reject) => {
|
|
4794
4478
|
let settled = false;
|
|
@@ -4944,7 +4628,7 @@ async function clearTurnkeySigningSession() {
|
|
|
4944
4628
|
// Done first, and synchronously, so it lands even if the frame exchange below fails.
|
|
4945
4629
|
try {
|
|
4946
4630
|
const { origin } = await turnkeySignerPage();
|
|
4947
|
-
(await Promise.resolve().then(function () { return
|
|
4631
|
+
(await Promise.resolve().then(function () { return require('./bounded-widget-modal-s0PL86Y-.js'); })).detachWarmSignerIframe(origin);
|
|
4948
4632
|
}
|
|
4949
4633
|
catch (_a) {
|
|
4950
4634
|
/* no modal module / no warm frame: nothing to take */
|
|
@@ -6021,7 +5705,7 @@ async function getAuthProvider(config) {
|
|
|
6021
5705
|
// manager as legacy email sessions. Human login should be started
|
|
6022
5706
|
// with loginWithRedirect(); this provider is kept as the restore and
|
|
6023
5707
|
// logout surface for those sessions.
|
|
6024
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-
|
|
5708
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./email-auth-provider-BhYzRN0r.js'); })).EmailAuthProvider();
|
|
6025
5709
|
break;
|
|
6026
5710
|
case "phantom": {
|
|
6027
5711
|
// First-class Solana WALLET LOGIN (the poof/TaroBase-style "connect
|
|
@@ -6063,7 +5747,7 @@ async function getAuthProvider(config) {
|
|
|
6063
5747
|
// (bounded-login-widget.ts), so registration never counts as
|
|
6064
5748
|
// evidence the user has a wallet.
|
|
6065
5749
|
await ensureSolanaMobileWalletRegistered(config, configuredNetwork);
|
|
6066
|
-
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
5750
|
+
const { InjectedWalletProvider } = await Promise.resolve().then(function () { return require('./injected-wallet-provider-CG3oKdp_.js'); });
|
|
6067
5751
|
currentAuthProvider = new InjectedWalletProvider(resolveInjectedWalletConfig(config), rpcUrl, configuredNetwork);
|
|
6068
5752
|
break;
|
|
6069
5753
|
}
|
|
@@ -6076,7 +5760,7 @@ async function getAuthProvider(config) {
|
|
|
6076
5760
|
// Selecting authMethod:'evm-wallet' IS the opt-in — pass evmWalletConfig
|
|
6077
5761
|
// to point at a specific wallet or set chainId/domain.
|
|
6078
5762
|
const evmWalletConfig = ((_a = config.evmWalletConfig) !== null && _a !== void 0 ? _a : {});
|
|
6079
|
-
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-
|
|
5763
|
+
const { InjectedEvmWalletProvider } = await Promise.resolve().then(function () { return require('./injected-evm-wallet-provider-C3MwUTRd.js'); });
|
|
6080
5764
|
currentAuthProvider = new InjectedEvmWalletProvider(evmWalletConfig);
|
|
6081
5765
|
break;
|
|
6082
5766
|
}
|
|
@@ -6101,7 +5785,7 @@ async function getAuthProvider(config) {
|
|
|
6101
5785
|
break;
|
|
6102
5786
|
case "guest":
|
|
6103
5787
|
// Anonymous auth: a device-local ed25519 keypair signs the challenge.
|
|
6104
|
-
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
5788
|
+
currentAuthProvider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-BiM35KHb.js'); })).GuestAuthProvider();
|
|
6105
5789
|
break;
|
|
6106
5790
|
}
|
|
6107
5791
|
if (!currentAuthProvider) {
|
|
@@ -6163,7 +5847,7 @@ async function signInAnonymously() {
|
|
|
6163
5847
|
// Lazy-load the guest provider so its ed25519/web3 dependencies stay out of
|
|
6164
5848
|
// the main bundle for data-only apps. Specifier is a static string literal
|
|
6165
5849
|
// so bundle-splitting can see it.
|
|
6166
|
-
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-
|
|
5850
|
+
const provider = new (await Promise.resolve().then(function () { return require('./guest-auth-provider-BiM35KHb.js'); })).GuestAuthProvider();
|
|
6167
5851
|
setAuthLoading(true); // reflect "signing in…" while the guest keypair session is minted
|
|
6168
5852
|
// adoptSessionProvider awaits only getConfig() (already resolved here) and then
|
|
6169
5853
|
// runs every write - provider/method/config/marker/user - in one synchronous
|
|
@@ -6334,7 +6018,7 @@ function ensureSharedWalletLoginReady() {
|
|
|
6334
6018
|
if (!sharedWalletReady) {
|
|
6335
6019
|
sharedWalletReady = (async () => {
|
|
6336
6020
|
await core.getConfig();
|
|
6337
|
-
await Promise.resolve().then(function () { return require('./injected-wallet-provider-
|
|
6021
|
+
await Promise.resolve().then(function () { return require('./injected-wallet-provider-CG3oKdp_.js'); });
|
|
6338
6022
|
})().catch((error) => {
|
|
6339
6023
|
sharedWalletReady = null;
|
|
6340
6024
|
throw error;
|
|
@@ -6955,6 +6639,24 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
|
6955
6639
|
}
|
|
6956
6640
|
return t;
|
|
6957
6641
|
};
|
|
6642
|
+
/** Source is a safe tar.gz tree; attachments remain model input, never executable files. */
|
|
6643
|
+
async function uploadInput(appId, options) {
|
|
6644
|
+
const data = options.data instanceof Uint8Array ? new Uint8Array(options.data).buffer : await options.data.arrayBuffer();
|
|
6645
|
+
const sha256 = Array.from(new Uint8Array(await getPlatform().sha256(new Uint8Array(data))), (byte) => byte.toString(16).padStart(2, '0')).join('');
|
|
6646
|
+
const path = `/app/${encodeURIComponent(appId)}/build-inputs`;
|
|
6647
|
+
const ticket = await requestDevApi(path, {
|
|
6648
|
+
method: 'POST', body: { kind: options.kind, name: options.name, contentType: options.contentType, bytes: data.byteLength, sha256 },
|
|
6649
|
+
});
|
|
6650
|
+
const destination = new URL(ticket.uploadUrl);
|
|
6651
|
+
if (destination.protocol !== 'https:' && !(destination.protocol === 'http:' && ['localhost', '127.0.0.1', '[::1]'].includes(destination.hostname)))
|
|
6652
|
+
throw new Error('Build input upload requires a secure endpoint.');
|
|
6653
|
+
const response = await fetch(destination.href, {
|
|
6654
|
+
method: 'PUT', redirect: 'error', headers: { Authorization: `Bearer ${ticket.uploadToken}`, 'Content-Type': options.contentType }, body: data,
|
|
6655
|
+
});
|
|
6656
|
+
if (!response.ok)
|
|
6657
|
+
throw apiError(response, await responseBody(response));
|
|
6658
|
+
return requestDevApi(`${path}/${encodeURIComponent(ticket.artifactId)}/finalize`, { method: 'POST' });
|
|
6659
|
+
}
|
|
6958
6660
|
/** A structured non-2xx response from the developer API. */
|
|
6959
6661
|
class BuildsApiError extends Error {
|
|
6960
6662
|
constructor(init) {
|
|
@@ -7560,6 +7262,7 @@ const builds = {
|
|
|
7560
7262
|
decideGate,
|
|
7561
7263
|
refreshReviewCapability,
|
|
7562
7264
|
topup,
|
|
7265
|
+
uploadInput,
|
|
7563
7266
|
list: list$1,
|
|
7564
7267
|
watch,
|
|
7565
7268
|
};
|
|
@@ -8336,4 +8039,4 @@ exports.useAuth = useAuth;
|
|
|
8336
8039
|
exports.useBuildRun = useBuildRun;
|
|
8337
8040
|
exports.useQuery = useQuery;
|
|
8338
8041
|
exports.waitForAuthReady = waitForAuthReady;
|
|
8339
|
-
//# sourceMappingURL=index.native-
|
|
8042
|
+
//# sourceMappingURL=index.native-BZOWS_sR.js.map
|