@seams/wallet 0.6.1 → 0.6.2

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.
Files changed (86) hide show
  1. package/dist/.build-inputs.sha256 +1 -1
  2. package/dist/esm/SeamsWeb/operations/registration/registration.js +21 -29
  3. package/dist/esm/core/rpcClients/relayer/walletRegistration.js +1 -43
  4. package/dist/esm/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +19 -0
  5. package/dist/esm/core/signingEngine/flows/signNear/signTransactions.js +25 -6
  6. package/dist/esm/core/signingEngine/nonce/nearNonceLane.js +0 -29
  7. package/dist/esm/core/signingEngine/session/operationState/trace.js +10 -1
  8. package/dist/esm/react/SeamsWeb/operations/registration/registration.js +21 -29
  9. package/dist/esm/react/core/rpcClients/relayer/walletRegistration.js +1 -43
  10. package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +19 -0
  11. package/dist/esm/react/core/signingEngine/flows/signNear/signTransactions.js +25 -6
  12. package/dist/esm/react/core/signingEngine/nonce/nearNonceLane.js +0 -29
  13. package/dist/esm/react/core/signingEngine/session/operationState/trace.js +10 -1
  14. package/dist/esm/sdk/{NonceCoordinator-C7QltTDC.js → NonceCoordinator-C7mqpJiU.js} +0 -29
  15. package/dist/{public/sdk/adapters-LgE4nnos.js → esm/sdk/adapters-m94YFj70.js} +1 -1
  16. package/dist/{public/sdk/display-Cw90-qmF.js → esm/sdk/display-DHdC2yXU.js} +1 -1
  17. package/dist/{public/sdk/export-viewer-host-B3K81QGA.js → esm/sdk/export-viewer-host-CbqG8ZQV.js} +1 -1
  18. package/dist/esm/sdk/{host-Y_xmIzPO.js → host-BPC1zSVg.js} +2 -2
  19. package/dist/esm/sdk/{localOnly-B5TYHJiq.js → localOnly-CbLYTVbo.js} +2 -2
  20. package/dist/esm/sdk/{nearEd25519YaoMaterialActivation-BLxVE6E5.js → nearEd25519YaoMaterialActivation-Cz5UJQ_7.js} +1 -43
  21. package/dist/esm/sdk/{registration-BtPLgKHk.js → registration-DtDICj-o.js} +1 -1
  22. package/dist/esm/sdk/{registration-D-istkMZ.js → registration-PIBMSsQR.js} +22 -30
  23. package/dist/esm/sdk/{registrationPreparationPreload-CvnlDCVn.js → registrationPreparationPreload-BZfAC_ba.js} +2 -2
  24. package/dist/{public/sdk/runtime-auth-B7z1ANNp.js → esm/sdk/runtime-auth-D_lUQQlc.js} +4 -4
  25. package/dist/{public/sdk/runtime-device-link-B8HGDakg.js → esm/sdk/runtime-device-link-CEph1iM0.js} +2 -2
  26. package/dist/esm/sdk/{runtime-ecdsa-tempo-DKdS5-us.js → runtime-ecdsa-tempo-tUWnafRo.js} +2 -2
  27. package/dist/{public/sdk/runtime-email-otp-D5bxhdyG.js → esm/sdk/runtime-email-otp-1wIPTDim.js} +2 -2
  28. package/dist/{public/sdk/runtime-export--hvNrx8l.js → esm/sdk/runtime-export-Du2d4_Vu.js} +2 -2
  29. package/dist/esm/sdk/{runtime-near-CEexHoug.js → runtime-near-CGoWxu7u.js} +2 -2
  30. package/dist/{public/sdk/runtime-preferences-BiqPp1lV.js → esm/sdk/runtime-preferences-JwJK_xP3.js} +2 -2
  31. package/dist/esm/sdk/{runtime-recovery-BYu1gDq_.js → runtime-recovery-BEqBdpyo.js} +2 -2
  32. package/dist/esm/sdk/{runtimeContext-CH97jPZ0.js → runtimeContext-CTt9ON27.js} +22 -22
  33. package/dist/{public/sdk/runtimeLoader-BFAmJAbu.js → esm/sdk/runtimeLoader-ZXsvx9zX.js} +9 -9
  34. package/dist/esm/sdk/{secp256k1-Cr1jBW1n.js → secp256k1-CWDid9WH.js} +1 -1
  35. package/dist/{public/sdk/signEvmFamily-Dxk4sBPY.js → esm/sdk/signEvmFamily-pbMepepQ.js} +5 -5
  36. package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-DHTBHHgE.js → signEvmFamilyWithUiConfirmForTempo-CxvfCI_o.js} +2 -2
  37. package/dist/{public/sdk/signEvmWithUiConfirm-CSxTBQUW.js → esm/sdk/signEvmWithUiConfirm-nk-r3Rff.js} +1 -1
  38. package/dist/esm/sdk/{signNear-B0OCVKoH.js → signNear-DVD9-IO5.js} +45 -8
  39. package/dist/esm/sdk/{signatureUses-C1o1pDql.js → signatureUses-BY1IY7uz.js} +1 -1
  40. package/dist/esm/sdk/{signerLoader-D0WU1jq_.js → signerLoader-D_w-SfR9.js} +3 -3
  41. package/dist/esm/sdk/{trace-DWnDLSuV.js → trace-08ayoiNp.js} +10 -1
  42. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
  43. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
  44. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
  45. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
  46. package/dist/esm/sdk/wallet-ui.css +7 -1
  47. package/dist/public/headers.manifest.json +1 -1
  48. package/dist/public/sdk/{NonceCoordinator-C7QltTDC.js → NonceCoordinator-C7mqpJiU.js} +0 -29
  49. package/dist/{esm/sdk/adapters-LgE4nnos.js → public/sdk/adapters-m94YFj70.js} +1 -1
  50. package/dist/{esm/sdk/display-Cw90-qmF.js → public/sdk/display-DHdC2yXU.js} +1 -1
  51. package/dist/{esm/sdk/export-viewer-host-B3K81QGA.js → public/sdk/export-viewer-host-CbqG8ZQV.js} +1 -1
  52. package/dist/public/sdk/{host-Y_xmIzPO.js → host-BPC1zSVg.js} +2 -2
  53. package/dist/public/sdk/{localOnly-B5TYHJiq.js → localOnly-CbLYTVbo.js} +2 -2
  54. package/dist/public/sdk/{nearEd25519YaoMaterialActivation-BLxVE6E5.js → nearEd25519YaoMaterialActivation-Cz5UJQ_7.js} +1 -43
  55. package/dist/public/sdk/{registration-BtPLgKHk.js → registration-DtDICj-o.js} +1 -1
  56. package/dist/public/sdk/{registration-D-istkMZ.js → registration-PIBMSsQR.js} +22 -30
  57. package/dist/public/sdk/{registrationPreparationPreload-CvnlDCVn.js → registrationPreparationPreload-BZfAC_ba.js} +2 -2
  58. package/dist/{esm/sdk/runtime-auth-B7z1ANNp.js → public/sdk/runtime-auth-D_lUQQlc.js} +4 -4
  59. package/dist/{esm/sdk/runtime-device-link-B8HGDakg.js → public/sdk/runtime-device-link-CEph1iM0.js} +2 -2
  60. package/dist/public/sdk/{runtime-ecdsa-tempo-DKdS5-us.js → runtime-ecdsa-tempo-tUWnafRo.js} +2 -2
  61. package/dist/{esm/sdk/runtime-email-otp-D5bxhdyG.js → public/sdk/runtime-email-otp-1wIPTDim.js} +2 -2
  62. package/dist/{esm/sdk/runtime-export--hvNrx8l.js → public/sdk/runtime-export-Du2d4_Vu.js} +2 -2
  63. package/dist/public/sdk/{runtime-near-CEexHoug.js → runtime-near-CGoWxu7u.js} +2 -2
  64. package/dist/{esm/sdk/runtime-preferences-BiqPp1lV.js → public/sdk/runtime-preferences-JwJK_xP3.js} +2 -2
  65. package/dist/public/sdk/{runtime-recovery-BYu1gDq_.js → runtime-recovery-BEqBdpyo.js} +2 -2
  66. package/dist/public/sdk/{runtimeContext-CH97jPZ0.js → runtimeContext-CTt9ON27.js} +22 -22
  67. package/dist/{esm/sdk/runtimeLoader-BFAmJAbu.js → public/sdk/runtimeLoader-ZXsvx9zX.js} +9 -9
  68. package/dist/public/sdk/{secp256k1-Cr1jBW1n.js → secp256k1-CWDid9WH.js} +1 -1
  69. package/dist/{esm/sdk/signEvmFamily-Dxk4sBPY.js → public/sdk/signEvmFamily-pbMepepQ.js} +5 -5
  70. package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-DHTBHHgE.js → signEvmFamilyWithUiConfirmForTempo-CxvfCI_o.js} +2 -2
  71. package/dist/{esm/sdk/signEvmWithUiConfirm-CSxTBQUW.js → public/sdk/signEvmWithUiConfirm-nk-r3Rff.js} +1 -1
  72. package/dist/public/sdk/{signNear-B0OCVKoH.js → signNear-DVD9-IO5.js} +45 -8
  73. package/dist/public/sdk/{signatureUses-C1o1pDql.js → signatureUses-BY1IY7uz.js} +1 -1
  74. package/dist/public/sdk/{signerLoader-D0WU1jq_.js → signerLoader-D_w-SfR9.js} +3 -3
  75. package/dist/public/sdk/{trace-DWnDLSuV.js → trace-08ayoiNp.js} +10 -1
  76. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
  77. package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
  78. package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
  79. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
  80. package/dist/public/sdk/wallet-ui.css +7 -1
  81. package/dist/public/wallet-assets.manifest.json +58 -58
  82. package/dist/public/wallet-service/index.html +4 -4
  83. package/dist/types/wallet/src/SeamsWeb/operations/registration/registration.d.ts +2 -3
  84. package/dist/types/wallet/src/core/signingEngine/nonce/nearNonceLane.d.ts +2 -1
  85. package/dist/types/wallet/src/core/signingEngine/session/operationState/trace.d.ts +2 -0
  86. package/package.json +1 -1
@@ -9,6 +9,7 @@ import { parseCapabilityId, parseCapabilityOperationId, parsePrincipalId, parseT
9
9
  import { SigningSessionIds } from "../../../session/operationState/types.js";
10
10
  import { buildCapabilityOperationEnvelope, parseSigningOperationFingerprintDigest } from "../../../../../shared-ts/src/authorization/operationFingerprint.js";
11
11
  import { ActionType, fromActionArgsWasm } from "../../../../../shared-ts/src/near/actions.js";
12
+ import { emitEd25519SigningTiming } from "../../../session/operationState/trace.js";
12
13
  import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionOperationFingerprint } from "../../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
13
14
  import { WorkerResponseType } from "../../../../types/signer-worker.js";
14
15
  import { buildThresholdEd25519DelegateSigningPayloadWasm, buildThresholdEd25519NearTxUnsignedBorshWasm, decodeThresholdEd25519SignedNearTxBorshWasm, finalizeThresholdEd25519DelegateFromSignatureWasm, finalizeThresholdEd25519NearTxFromSignatureWasm } from "../../../chains/near/nearSignerWasm.js";
@@ -260,6 +261,18 @@ function requireActiveClientMatchesNormalSigningOperation(args) {
260
261
  if (!sameBytes(metadata.signingWorkerVerifyingShare, args.signingWorkerVerifyingShare)) throw new Error("Router A/B Ed25519 active Client SigningWorker verifying share mismatch");
261
262
  }
262
263
  async function tryFinalizeRouterAbEd25519NormalSigningSignature(args) {
264
+ const operationId = args.prepare.request.intent.operation_id;
265
+ const signatureStartedAt = performance.now();
266
+ let outcome = "failed";
267
+ try {
268
+ const finalized = await finalizeRouterAbEd25519NormalSigningSignature(args, operationId);
269
+ outcome = "succeeded";
270
+ return finalized;
271
+ } finally {
272
+ emitEd25519SigningTiming(operationId, "signature_total", signatureStartedAt, outcome);
273
+ }
274
+ }
275
+ async function finalizeRouterAbEd25519NormalSigningSignature(args, operationId) {
263
276
  const signingPayload = base64UrlDecode(args.signingDigestB64u);
264
277
  if (signingPayload.length !== 32) throw new Error(`Router A/B normal-signing ${args.signingPayloadLabel} must be 32 bytes`);
265
278
  const admittedDigest = requireWireBytes32(args.prepare.admissionMaterial.admittedSigningDigest.bytes, "admitted digest");
@@ -279,11 +292,13 @@ async function tryFinalizeRouterAbEd25519NormalSigningSignature(args) {
279
292
  runtimePolicyScope: args.walletSessionState.runtimePolicyScope,
280
293
  relayerUrl: args.walletSessionState.relayerUrl
281
294
  } : args.materialFacts;
295
+ const prepareStartedAt = performance.now();
282
296
  const prepareResponse = await prepareRouterAbNormalSigningV2({
283
297
  relayServerUrl: materialFacts.relayerUrl,
284
298
  credential: args.credential,
285
299
  request: args.prepare.request
286
300
  });
301
+ emitEd25519SigningTiming(operationId, "prepare", prepareStartedAt);
287
302
  requireRouterAbNormalSigningPrepareMatchesRequest({
288
303
  request: args.prepare.request,
289
304
  signingPayloadDigest: args.prepare.admissionMaterial.signingPayloadDigest,
@@ -304,12 +319,15 @@ async function tryFinalizeRouterAbEd25519NormalSigningSignature(args) {
304
319
  signingWorkerId: prepareResponse.signing_worker.server_id,
305
320
  signingWorkerVerifyingShare
306
321
  });
322
+ const clientShareStartedAt = performance.now();
307
323
  const clientShare = await args.activeClient.createSigningShare({
308
324
  admittedDigest,
309
325
  signingWorkerCommitments: prepareResponse.server_commitments,
310
326
  signingWorkerVerifyingShare
311
327
  });
328
+ emitEd25519SigningTiming(operationId, "client_share", clientShareStartedAt);
312
329
  if (clientShare.clientVerifyingShare.length !== 32) throw new Error("Router A/B normal-signing Client verifying share must be 32 bytes");
330
+ const finalizeStartedAt = performance.now();
313
331
  const signingResponse = await finalizeRouterAbNormalSigningV2({
314
332
  relayServerUrl: materialFacts.relayerUrl,
315
333
  credential: args.credential,
@@ -323,6 +341,7 @@ async function tryFinalizeRouterAbEd25519NormalSigningSignature(args) {
323
341
  clientSignatureShareB64u: clientShare.clientSignatureShareB64u
324
342
  })
325
343
  });
344
+ emitEd25519SigningTiming(operationId, "finalize", finalizeStartedAt);
326
345
  requireRouterAbNormalSigningResponseMatchesRequest({
327
346
  request: args.prepare.request,
328
347
  signingPayloadDigest: args.prepare.admissionMaterial.signingPayloadDigest,
@@ -10,7 +10,7 @@ import { SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSen
10
10
  import { isWarmSessionSigningAuthPlan } from "../../stepUpConfirmation/types.js";
11
11
  import { resolveNearSigningMaterials } from "./shared/signingMaterials.js";
12
12
  import { buildNearTransactionSigningPayload } from "../../chains/near/payloads.js";
13
- import { createSigningBoundaryTraceEvent, emitSigningBoundaryTrace } from "../../session/operationState/trace.js";
13
+ import { createSigningBoundaryTraceEvent, emitEd25519SigningTiming, emitSigningBoundaryTrace } from "../../session/operationState/trace.js";
14
14
  import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionPlanningOperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
15
15
  import { SigningOperationCommandKind, isSigningOperationReviewApprovedState, runSigningOperationCommand } from "../shared/signingStateMachine.js";
16
16
  import { requireNearStepUpAuth, signingAuthPlanForNearMaterialRequirement } from "./requireNearStepUpAuth.js";
@@ -45,6 +45,16 @@ function disposeOwnedNearOperationStepUpMaterialAndRethrow(args, error) {
45
45
  disposeOwnedNearOperationStepUpMaterial(args);
46
46
  throw error;
47
47
  }
48
+ async function resolveWarmNearSigningMaterial(args) {
49
+ return {
50
+ material: await resolvePreparedNearEd25519YaoMaterial(args.preparation, args.executor),
51
+ walletSessionState: await args.executor.resolveWalletSessionState()
52
+ };
53
+ }
54
+ function requireWarmNearSigningMaterialTask(task) {
55
+ if (!task) throw new Error("[SigningEngine][near] warm signing material was not prepared");
56
+ return task;
57
+ }
48
58
  async function resolveNearTransactionOperationStepUpMaterial(args) {
49
59
  if (args.authorization.kind === "passkey") {
50
60
  if (args.material.kind !== "passkey_live" && args.material.kind !== "passkey_sealed") throw new Error("[SigningEngine][near] passkey transaction material changed factor");
@@ -385,6 +395,8 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
385
395
  const nearAccountId = toAccountId(nearAccount.accountId);
386
396
  const relayerUrl = ctx.relayerUrl;
387
397
  const warnings = [];
398
+ const durableLeaseRecovery = ctx.nonceCoordinator.recoverDurableLeases({ walletId: String(commandSubject.walletSession.walletId) });
399
+ durableLeaseRecovery.catch(() => {});
388
400
  emitNearSigningEvent(onEvent, nearAccountId, {
389
401
  phase: SigningEventPhase.STEP_02_REQUEST_PREPARED,
390
402
  status: "running",
@@ -484,6 +496,11 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
484
496
  ...passkeyEd25519OperationStepUp ? { passkeyEd25519OperationStepUp } : {},
485
497
  ...emailOtpEd25519StepUp ? { emailOtpEd25519StepUp } : {}
486
498
  });
499
+ const warmSigningMaterialTask = preparedStepUp.kind === "warm_session" ? resolveWarmNearSigningMaterial({
500
+ preparation: yaoSigningPreparation,
501
+ executor: yaoMaterialExecutor
502
+ }) : null;
503
+ warmSigningMaterialTask?.catch(() => {});
487
504
  const confirmationAuthPayload = preparedStepUp.confirmationAuthPayload;
488
505
  if (isWarmSessionSigningAuthPlan(confirmationAuthPayload.signingAuthPlan)) emitNearSigningEvent(onEvent, nearAccountId, {
489
506
  phase: SigningEventPhase.STEP_06_AUTH_WARM_SESSION_CLAIMED,
@@ -578,6 +595,7 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
578
595
  readiness: operationStepUpReadiness
579
596
  });
580
597
  }
598
+ const confirmationCompletedAt = performance.now();
581
599
  const operationStepUpMaterial = operationStepUpReadiness ? await operationStepUpReadiness : null;
582
600
  if (transactionReviewRequired) emitNearSigningEvent(onEvent, nearAccountId, {
583
601
  phase: SigningEventPhase.STEP_05_CONFIRMATION_APPROVED,
@@ -610,7 +628,7 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
610
628
  });
611
629
  const ownsResolvedOperationStepUpMaterial = operationStepUpMaterial?.kind === "passkey_sealed" || operationStepUpMaterial?.kind === "email_otp_sealed";
612
630
  try {
613
- await ctx.nonceCoordinator.recoverDurableLeases({ walletId: String(signingLane.identity.signer.account.wallet.walletId) });
631
+ await durableLeaseRecovery;
614
632
  } catch (error) {
615
633
  disposeOwnedNearOperationStepUpMaterial({
616
634
  resolved: resolvedOperationStepUpMaterial,
@@ -633,14 +651,14 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
633
651
  });
634
652
  const resolvedMaterial = stepUpAuthorization.kind === "warm_session" ? {
635
653
  kind: "warm_session",
636
- material: await resolvePreparedNearEd25519YaoMaterial(yaoSigningPreparation, yaoMaterialExecutor)
654
+ resolved: await requireWarmNearSigningMaterialTask(warmSigningMaterialTask)
637
655
  } : {
638
656
  kind: "operation_step_up",
639
657
  resolved: resolvedOperationStepUpMaterial
640
658
  };
641
- const canonicalThresholdSessionId = resolvedMaterial.kind === "warm_session" ? resolvedMaterial.material.facts.thresholdSessionId : resolvedMaterial.resolved.material.facts.thresholdSessionId;
642
- const activeYaoClient = resolvedMaterial.kind === "warm_session" ? resolvedMaterial.material.activeClient : resolvedMaterial.resolved.material.activeClient;
643
- const activeWalletSessionState = resolvedMaterial.kind === "warm_session" ? await yaoMaterialExecutor.resolveWalletSessionState() : null;
659
+ const canonicalThresholdSessionId = resolvedMaterial.kind === "warm_session" ? resolvedMaterial.resolved.material.facts.thresholdSessionId : resolvedMaterial.resolved.material.facts.thresholdSessionId;
660
+ const activeYaoClient = resolvedMaterial.kind === "warm_session" ? resolvedMaterial.resolved.material.activeClient : resolvedMaterial.resolved.material.activeClient;
661
+ const activeWalletSessionState = resolvedMaterial.kind === "warm_session" ? resolvedMaterial.resolved.walletSessionState : null;
644
662
  const confirmedNearContext = resolvedMaterial.kind === "warm_session" ? await resolveConfirmedNearTransactionContext({
645
663
  confirmation,
646
664
  ctx,
@@ -771,6 +789,7 @@ async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubj
771
789
  warnings,
772
790
  nonceLeases: nonceLeaseRefs
773
791
  });
792
+ emitEd25519SigningTiming(String(signingOperation.operationId), "confirmed_to_signed", confirmationCompletedAt);
774
793
  emitNearSigningEvent(onEvent, nearAccountId, {
775
794
  phase: SigningEventPhase.STEP_11_TRANSACTION_SIGNED,
776
795
  status: "succeeded",
@@ -393,22 +393,6 @@ var NearImplicitAccountFundingRequiredError = class extends Error {
393
393
  });
394
394
  }
395
395
  };
396
- async function readImplicitNearAccountFundingState(input) {
397
- try {
398
- await input.nearClient.viewAccount(input.subject.nearAccountId);
399
- return { kind: "funded" };
400
- } catch (error) {
401
- if (!isMissingNearAccessKeyError(errorMessage(error))) throw error;
402
- }
403
- return {
404
- kind: "needs_funding",
405
- error: new NearImplicitAccountFundingRequiredError({
406
- walletId: input.subject.walletId,
407
- nearAccountId: input.subject.nearAccountId,
408
- nearPublicKeyStr: input.subject.publicKey
409
- })
410
- };
411
- }
412
396
  var NearAccountLookupFailedError = class extends Error {
413
397
  constructor(args) {
414
398
  super(args.message || `NEAR account ${args.nearAccountId} access key lookup failed.`);
@@ -442,16 +426,11 @@ async function fetchNearFreshDataForState(input) {
442
426
  let txBlockHash = previousTransactionContext?.txBlockHash;
443
427
  const fetchAccessKey = isNonceStale || !accessKeyInfo;
444
428
  const fetchBlock = isBlockStale || !txBlockHeight || !txBlockHash;
445
- const fetchImplicitAccountFunding = isImplicitNearAccountId(capturedSubject.nearAccountId) && (input.force || fetchAccessKey || !readyContext);
446
429
  let maybeAccessKey = accessKeyInfo ?? null;
447
430
  let maybeBlock = null;
448
431
  let accessKeyError = null;
449
432
  let blockError = null;
450
433
  const tasks = [];
451
- const implicitFundingPromise = fetchImplicitAccountFunding ? readImplicitNearAccountFundingState({
452
- nearClient: input.nearClient,
453
- subject: capturedSubject
454
- }) : null;
455
434
  if (fetchAccessKey) tasks.push((async () => {
456
435
  try {
457
436
  maybeAccessKey = await input.nearClient.viewAccessKey(capturedSubject.nearAccountId, capturedSubject.publicKey);
@@ -485,14 +464,6 @@ async function fetchNearFreshDataForState(input) {
485
464
  }
486
465
  })());
487
466
  if (tasks.length > 0) await Promise.all(tasks);
488
- const implicitFunding = implicitFundingPromise ? await implicitFundingPromise : null;
489
- if (implicitFunding?.kind === "needs_funding") {
490
- setNearImplicitUnfunded({
491
- state,
492
- subject: capturedSubject
493
- });
494
- throw implicitFunding.error;
495
- }
496
467
  if (accessKeyError) {
497
468
  if (accessKeyError instanceof NearImplicitAccountFundingRequiredError) setNearImplicitUnfunded({
498
469
  state,
@@ -30,6 +30,15 @@ function emitEcdsaSigningTiming(operationId, stage, startedAt, outcome = "succee
30
30
  outcome
31
31
  });
32
32
  }
33
+ function emitEd25519SigningTiming(operationId, stage, startedAt, outcome = "succeeded") {
34
+ emitSigningSessionFlowTrace("near", {
35
+ event: "ed25519_signing_timing",
36
+ operationId,
37
+ stage,
38
+ durationMs: Math.max(0, performance.now() - startedAt),
39
+ outcome
40
+ });
41
+ }
33
42
  function emitSigningLaneResolutionTrace(scope, lane, args = {}) {
34
43
  if (!lane || !isSigningSessionTraceEnabled()) return;
35
44
  try {
@@ -80,6 +89,6 @@ function isSigningSessionTraceEnabled() {
80
89
  }
81
90
  }
82
91
  //#endregion
83
- export { createSigningBoundaryTraceEvent, emitEcdsaPresignServerTiming, emitEcdsaServerTiming, emitEcdsaSigningTiming, emitSigningBoundaryTrace, emitSigningLaneResolutionTrace, emitSigningPlannerDecisionTrace, emitSigningSessionFlowFailure, emitSigningSessionFlowTrace };
92
+ export { createSigningBoundaryTraceEvent, emitEcdsaPresignServerTiming, emitEcdsaServerTiming, emitEcdsaSigningTiming, emitEd25519SigningTiming, emitSigningBoundaryTrace, emitSigningLaneResolutionTrace, emitSigningPlannerDecisionTrace, emitSigningSessionFlowFailure, emitSigningSessionFlowTrace };
84
93
 
85
94
  //# sourceMappingURL=trace.js.map
@@ -722,22 +722,6 @@ var NearImplicitAccountFundingRequiredError = class extends Error {
722
722
  });
723
723
  }
724
724
  };
725
- async function readImplicitNearAccountFundingState(input) {
726
- try {
727
- await input.nearClient.viewAccount(input.subject.nearAccountId);
728
- return { kind: "funded" };
729
- } catch (error) {
730
- if (!isMissingNearAccessKeyError(errorMessage(error))) throw error;
731
- }
732
- return {
733
- kind: "needs_funding",
734
- error: new NearImplicitAccountFundingRequiredError({
735
- walletId: input.subject.walletId,
736
- nearAccountId: input.subject.nearAccountId,
737
- nearPublicKeyStr: input.subject.publicKey
738
- })
739
- };
740
- }
741
725
  var NearAccountLookupFailedError = class extends Error {
742
726
  constructor(args) {
743
727
  super(args.message || `NEAR account ${args.nearAccountId} access key lookup failed.`);
@@ -771,16 +755,11 @@ async function fetchNearFreshDataForState(input) {
771
755
  let txBlockHash = previousTransactionContext?.txBlockHash;
772
756
  const fetchAccessKey = isNonceStale || !accessKeyInfo;
773
757
  const fetchBlock = isBlockStale || !txBlockHeight || !txBlockHash;
774
- const fetchImplicitAccountFunding = isImplicitNearAccountId(capturedSubject.nearAccountId) && (input.force || fetchAccessKey || !readyContext);
775
758
  let maybeAccessKey = accessKeyInfo ?? null;
776
759
  let maybeBlock = null;
777
760
  let accessKeyError = null;
778
761
  let blockError = null;
779
762
  const tasks = [];
780
- const implicitFundingPromise = fetchImplicitAccountFunding ? readImplicitNearAccountFundingState({
781
- nearClient: input.nearClient,
782
- subject: capturedSubject
783
- }) : null;
784
763
  if (fetchAccessKey) tasks.push((async () => {
785
764
  try {
786
765
  maybeAccessKey = await input.nearClient.viewAccessKey(capturedSubject.nearAccountId, capturedSubject.publicKey);
@@ -814,14 +793,6 @@ async function fetchNearFreshDataForState(input) {
814
793
  }
815
794
  })());
816
795
  if (tasks.length > 0) await Promise.all(tasks);
817
- const implicitFunding = implicitFundingPromise ? await implicitFundingPromise : null;
818
- if (implicitFunding?.kind === "needs_funding") {
819
- setNearImplicitUnfunded({
820
- state,
821
- subject: capturedSubject
822
- });
823
- throw implicitFunding.error;
824
- }
825
796
  if (accessKeyError) {
826
797
  if (accessKeyError instanceof NearImplicitAccountFundingRequiredError) setNearImplicitUnfunded({
827
798
  state,
@@ -10,7 +10,7 @@ import { a as toActionArgsWasm, i as isActionArgsWasm, r as fromTransactionInput
10
10
  import { i as orderActionForDigest, r as computeUiIntentDigestFromTxs } from "./intentDigest-A1MbbJPu.js";
11
11
  import { t as createWalletIframeSurfaceMeasurementReporter } from "./surface-measurement-reporter-D7BNehf4.js";
12
12
  import { r as appearanceTokenCssRule } from "./csp-stylesheet-DLj_a6t_.js";
13
- import { n as buildNearNonceLane } from "./NonceCoordinator-C7QltTDC.js";
13
+ import { n as buildNearNonceLane } from "./NonceCoordinator-C7mqpJiU.js";
14
14
  import { n as SigningAuthPlanKind, s as signingAuthModeFromSigningAuthPlan, t as formatEmailOtpSentText } from "./promptText-BEgOkGxB.js";
15
15
  import { a as retainTransactionActivity } from "./transaction-activity-DKgIGpKG.js";
16
16
  import { a as R, i as M, n as confirmationDocumentStyles, o as S, r as C, t as u } from "./jsxRuntime.module-FAP0NE9p.js";
@@ -1,5 +1,5 @@
1
1
  import { i as normalizeHexData } from "./bytes-CwytAKz8.js";
2
- import { g as selectorFromHexData, h as resolveFunctionDisplayName, m as formatCalldataForDisplay, p as formatCompactGas } from "./signatureUses-C1o1pDql.js";
2
+ import { g as selectorFromHexData, h as resolveFunctionDisplayName, m as formatCalldataForDisplay, p as formatCompactGas } from "./signatureUses-BY1IY7uz.js";
3
3
  //#region src/core/signingEngine/chains/tempo/display.ts
4
4
  function toSafeJson(value) {
5
5
  try {
@@ -1,4 +1,4 @@
1
- import { O as resolveUiAppearance, k as sameSurfaceMeasurementBinding } from "./adapters-LgE4nnos.js";
1
+ import { O as resolveUiAppearance, k as sameSurfaceMeasurementBinding } from "./adapters-m94YFj70.js";
2
2
  import { t as createWalletIframeSurfaceMeasurementReporter } from "./surface-measurement-reporter-D7BNehf4.js";
3
3
  //#region src/core/signingEngine/uiConfirm/ui/export-viewer-host.ts
4
4
  let mountedHost = null;
@@ -6,7 +6,7 @@ import { t as walletIframeRequestIdFromBoundary } from "./walletIframeIdentity-U
6
6
  import { o as isObject, s as isPlainObject } from "./validation-BphUDXs7.js";
7
7
  import { _ as parseHostedAuthMenuExternalAuthResolution, n as WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH, p as parseHostedAuthMenuCancelPayload, r as WALLET_PROTOCOL_VERSION, v as parseHostedAuthMenuOpenRequest } from "./messages-B3UbNZYc.js";
8
8
  import { t as errorMessage } from "./errors-93h9uAW9.js";
9
- import { n as preloadWalletHostRecoveryCodeSurface, t as loadWalletHostRuntime } from "./runtimeLoader-BFAmJAbu.js";
9
+ import { n as preloadWalletHostRecoveryCodeSurface, t as loadWalletHostRuntime } from "./runtimeLoader-ZXsvx9zX.js";
10
10
  //#region src/SeamsWeb/walletIframe/host/bootstrap.ts
11
11
  /**
12
12
  * Bootstrap tasks for the wallet iframe host.
@@ -387,7 +387,7 @@ function initWalletIFrame(options = {}) {
387
387
  ...state.walletConfigs || {},
388
388
  ...route.request.payload
389
389
  };
390
- if (CONFIRM_UI_SURFACES.some(({ selector }) => document.querySelector(selector))) (await import("./runtimeContext-CH97jPZ0.js")).syncActiveWalletHostRuntimeConfig(state);
390
+ if (CONFIRM_UI_SURFACES.some(({ selector }) => document.querySelector(selector))) (await import("./runtimeContext-CTt9ON27.js")).syncActiveWalletHostRuntimeConfig(state);
391
391
  post({
392
392
  type: "PONG",
393
393
  requestId
@@ -7,8 +7,8 @@ import "./participants-Bcnsa_ip.js";
7
7
  import "./capabilityKinds-jwCEaqBU.js";
8
8
  import "./evmFamilyEcdsaIdentity-_kuKSW35.js";
9
9
  import "./actions-DsBQcjBn.js";
10
- import { N as silentConfirmationConfig, O as resolveUiAppearance, f as ERROR_MESSAGES, j as UserConfirmationType, l as collectAuthenticationCredentialForExactNearChallengeB64u, m as isUserCancelledUserConfirm, n as createConfirmTxFlowAdapters, o as __isWalletIframeHostMode, t as createConfirmSession, u as collectAuthenticationCredentialForExactWalletChallengeB64u, x as getIntentDigest } from "./adapters-LgE4nnos.js";
11
- import { n as removeExportViewerHostIfPresent, r as upsertExportViewerHost } from "./export-viewer-host-B3K81QGA.js";
10
+ import { N as silentConfirmationConfig, O as resolveUiAppearance, f as ERROR_MESSAGES, j as UserConfirmationType, l as collectAuthenticationCredentialForExactNearChallengeB64u, m as isUserCancelledUserConfirm, n as createConfirmTxFlowAdapters, o as __isWalletIframeHostMode, t as createConfirmSession, u as collectAuthenticationCredentialForExactWalletChallengeB64u, x as getIntentDigest } from "./adapters-m94YFj70.js";
11
+ import { n as removeExportViewerHostIfPresent, r as upsertExportViewerHost } from "./export-viewer-host-CbqG8ZQV.js";
12
12
  import "./jsxRuntime.module-FAP0NE9p.js";
13
13
  //#region src/core/signingEngine/uiConfirm/handlers/flows/localOnly.ts
14
14
  function createRandomChallengeB64u() {
@@ -1423,7 +1423,6 @@ const ROUTE_PAYLOAD_BREAKDOWN_MAX_DEPTH = 2;
1423
1423
  const ROUTE_PAYLOAD_BREAKDOWN_MAX_FIELDS = 64;
1424
1424
  const WALLET_REGISTRATION_SETUP_PATH = "/wallets/register/setup";
1425
1425
  const WALLET_REGISTRATION_RESPOND_PATH = "/wallets/register/respond";
1426
- const WALLET_REGISTRATION_NEAR_ADMISSION_PATH = "/wallets/register/near-admission";
1427
1426
  const WALLET_REGISTRATION_ACTIVATE_PATH = "/wallets/register/activate";
1428
1427
  const WALLET_REGISTRATION_NEAR_PROVISIONING_PATH = "/wallets/register/near-provisioning";
1429
1428
  /** Managed environment id header for Router API `api_credentials` auth. */
@@ -3126,47 +3125,6 @@ async function respondWalletRegistration(args) {
3126
3125
  onServerTiming: args.onServerTiming
3127
3126
  }));
3128
3127
  }
3129
- async function authorizeWalletRegistrationNearAdmission(args) {
3130
- const body = {
3131
- registrationCeremonyId: args.registrationCeremonyId,
3132
- signedSetup: args.signedSetup
3133
- };
3134
- switch (args.kind) {
3135
- case "passkey":
3136
- body.webauthn_registration = args.webauthnRegistration;
3137
- break;
3138
- case "email_otp":
3139
- body.emailOtpRegistrationProof = args.emailOtpRegistrationProof;
3140
- break;
3141
- }
3142
- const response = await postJson({
3143
- relayerUrl: args.relayerUrl,
3144
- path: WALLET_REGISTRATION_NEAR_ADMISSION_PATH,
3145
- headers: args.headers,
3146
- body
3147
- });
3148
- const responseName = "Wallet registration NEAR admission";
3149
- const record = requireWalletRegistrationResponseObject({
3150
- responseName,
3151
- field: "body",
3152
- value: response
3153
- });
3154
- assertWalletRegistrationResponseKeys(record, [
3155
- "ok",
3156
- "registrationCeremonyId",
3157
- "ed25519"
3158
- ], responseName);
3159
- if (readWalletRegistrationResponseField(record, "ok", responseName) !== true) throw new Error(`${responseName} response is not successful`);
3160
- return {
3161
- ok: true,
3162
- registrationCeremonyId: requireResponseString({
3163
- responseName,
3164
- field: "registrationCeremonyId",
3165
- value: readWalletRegistrationResponseField(record, "registrationCeremonyId", responseName)
3166
- }),
3167
- ed25519: parseWalletRegistrationRespondEd25519DeferredWork(readWalletRegistrationResponseField(record, "ed25519", responseName))
3168
- };
3169
- }
3170
3128
  function parseRegistrationEstablishedSessionResult(value, expectedWalletId) {
3171
3129
  const responseName = "Wallet registration established session";
3172
3130
  const parsed = parseRegistrationEstablishedSessionResultV2(value);
@@ -4030,4 +3988,4 @@ function resolveNearEd25519YaoCapabilityHydrationV1(input) {
4030
3988
  throw new Error("Unsupported Near Ed25519 unlock-source observation");
4031
3989
  }
4032
3990
  //#endregion
4033
- export { activateRouterAbEcdsaPostRegistrationSession as A, requestAddAuthMethodEmailOtpChallenge as C, setupWalletRegistration as D, revokeWalletAuthMethod as E, startWalletAddAuthMethod as O, parseWalletRegistrationEcdsaDerivationRespond as S, respondWalletRegistration as T, fetchWalletEcdsaKeyFactsInventoryWithWebAuthn as _, buildRehydrateMaterialActivationHydrationPlan as a, fundImplicitNearAccountForTesting as b, parseWalletUnlockAlreadyCommittedResponseV1 as c, activateWalletRegistration as d, authorizeWalletRegistrationNearAdmission as f, fetchWalletEcdsaKeyFactsInventoryWithOperationCredential as g, createWalletAddSignerIntent as h, buildBlockedMpcCapabilityHydrationPlan as i, parseProfileContinuityEcdsaWarmKey as j, startWalletAddSigner as k, computeWalletCustodyAdminChallengeDigest as l, createWalletAddAuthMethodIntent as m, nearEd25519YaoRuntimeRef as n, buildUseLiveRuntimeHydrationPlan as o, completeWalletRegistrationNearProvisioning as p, resolveNearEd25519YaoCapabilityHydrationV1 as r, parseWalletSessionAlreadyCommittedResponseV1 as s, nearEd25519YaoMaterialActivationFromMetadata as t, activateWalletAddSignerEcdsa as u, finalizeWalletAddAuthMethod as v, respondWalletAddSignerEcdsa as w, isEmailOtpWalletRegistrationFinalizeResponse as x, finalizeWalletAddSigner as y };
3991
+ export { parseProfileContinuityEcdsaWarmKey as A, respondWalletAddSignerEcdsa as C, startWalletAddAuthMethod as D, setupWalletRegistration as E, startWalletAddSigner as O, requestAddAuthMethodEmailOtpChallenge as S, revokeWalletAuthMethod as T, finalizeWalletAddAuthMethod as _, buildRehydrateMaterialActivationHydrationPlan as a, isEmailOtpWalletRegistrationFinalizeResponse as b, parseWalletUnlockAlreadyCommittedResponseV1 as c, activateWalletRegistration as d, completeWalletRegistrationNearProvisioning as f, fetchWalletEcdsaKeyFactsInventoryWithWebAuthn as g, fetchWalletEcdsaKeyFactsInventoryWithOperationCredential as h, buildBlockedMpcCapabilityHydrationPlan as i, activateRouterAbEcdsaPostRegistrationSession as k, computeWalletCustodyAdminChallengeDigest as l, createWalletAddSignerIntent as m, nearEd25519YaoRuntimeRef as n, buildUseLiveRuntimeHydrationPlan as o, createWalletAddAuthMethodIntent as p, resolveNearEd25519YaoCapabilityHydrationV1 as r, parseWalletSessionAlreadyCommittedResponseV1 as s, nearEd25519YaoMaterialActivationFromMetadata as t, activateWalletAddSignerEcdsa as u, finalizeWalletAddSigner as v, respondWalletRegistration as w, parseWalletRegistrationEcdsaDerivationRespond as x, fundImplicitNearAccountForTesting as y };
@@ -2,7 +2,7 @@ import { n as __exportAll } from "./chunk-BtrIJ4_z.js";
2
2
  import { o as toError } from "./errors-93h9uAW9.js";
3
3
  import { c as serializeRegistrationCredentialWithPRF, r as isSerializedRegistrationCredential } from "./helpers-DpRjHMBx.js";
4
4
  import { t as webAuthnPromptCoordinator } from "./webauthnPromptCoordinator-CLeba8ru.js";
5
- import { D as getWalletId, S as getNearAccountId, f as ERROR_MESSAGES, m as isUserCancelledUserConfirm, n as createConfirmTxFlowAdapters, t as createConfirmSession, x as getIntentDigest } from "./adapters-LgE4nnos.js";
5
+ import { D as getWalletId, S as getNearAccountId, f as ERROR_MESSAGES, m as isUserCancelledUserConfirm, n as createConfirmTxFlowAdapters, t as createConfirmSession, x as getIntentDigest } from "./adapters-m94YFj70.js";
6
6
  import { a as sha256Base64UrlUtf8 } from "./intentDigest-A1MbbJPu.js";
7
7
  //#region src/core/signingEngine/uiConfirm/handlers/flows/registration.ts
8
8
  var registration_exports = /* @__PURE__ */ __exportAll({ handleRegistrationFlow: () => handleRegistrationFlow });
@@ -25,12 +25,12 @@ import { a as SIGNING_SESSION_SEAL_ALG, c as SIGNING_SESSION_SECRET_KIND, l as p
25
25
  import { n as parseEmailOtpChallengeDelivery } from "./challengeDelivery-BjLKoou3.js";
26
26
  import { l as getPrfFirstB64uFromCredential, o as redactedPasskeyRegistrationCredential, u as redactCredentialExtensionOutputs } from "./helpers-DpRjHMBx.js";
27
27
  import { i as buildNearAccountRefs } from "./profileAccountProjection-C9rVhbeJ.js";
28
- import { D as setupWalletRegistration, S as parseWalletRegistrationEcdsaDerivationRespond, T as respondWalletRegistration, c as parseWalletUnlockAlreadyCommittedResponseV1, d as activateWalletRegistration, f as authorizeWalletRegistrationNearAdmission, h as createWalletAddSignerIntent, k as startWalletAddSigner, n as nearEd25519YaoRuntimeRef, p as completeWalletRegistrationNearProvisioning, r as resolveNearEd25519YaoCapabilityHydrationV1, s as parseWalletSessionAlreadyCommittedResponseV1, t as nearEd25519YaoMaterialActivationFromMetadata, u as activateWalletAddSignerEcdsa, w as respondWalletAddSignerEcdsa, x as isEmailOtpWalletRegistrationFinalizeResponse, y as finalizeWalletAddSigner } from "./nearEd25519YaoMaterialActivation-BLxVE6E5.js";
28
+ import { C as respondWalletAddSignerEcdsa, E as setupWalletRegistration, O as startWalletAddSigner, b as isEmailOtpWalletRegistrationFinalizeResponse, c as parseWalletUnlockAlreadyCommittedResponseV1, d as activateWalletRegistration, f as completeWalletRegistrationNearProvisioning, m as createWalletAddSignerIntent, n as nearEd25519YaoRuntimeRef, r as resolveNearEd25519YaoCapabilityHydrationV1, s as parseWalletSessionAlreadyCommittedResponseV1, t as nearEd25519YaoMaterialActivationFromMetadata, u as activateWalletAddSignerEcdsa, v as finalizeWalletAddSigner, w as respondWalletRegistration, x as parseWalletRegistrationEcdsaDerivationRespond } from "./nearEd25519YaoMaterialActivation-Cz5UJQ_7.js";
29
29
  import { n as buildRelayerJsonPostRequestInit, r as normalizeRelayerBaseUrl, t as buildBearerAuthorizationHeader } from "./relayerHttp-LsVTZCxA.js";
30
30
  import { a as nearEd25519SessionMatchesMaterialActivation, h as emailOtpAuthContextProviderUserId, l as buildEmailOtpAuthContext, m as emailOtpAuthContextProvider, p as emailOtpAuthContextEmailHashHex, s as buildNearTransactionSigningLane } from "./nearEd25519YaoSigningPreparation-DX6xG-IW.js";
31
31
  import { o as buildEmailOtpRoutePlan, r as buildFreshEmailOtpRoutePlan } from "./routePlan-nLpPFHB-.js";
32
32
  import { n as generateSessionId } from "./prfCache-CgAr-VEU.js";
33
- import { l as emitSigningSessionFlowTrace } from "./trace-DWnDLSuV.js";
33
+ import { u as emitSigningSessionFlowTrace } from "./trace-08ayoiNp.js";
34
34
  import { t as webAuthnPromptCoordinator } from "./webauthnPromptCoordinator-CLeba8ru.js";
35
35
  import { t as computeAddSignerIntentDigest } from "./intentDigest-A1MbbJPu.js";
36
36
  import { n as showWalletRecoveryCodeBackupUi, t as pendingWalletRecoveryCodeBackupRepository } from "./pendingWalletRecoveryCodeBackup-DyvRysWg.js";
@@ -11412,17 +11412,10 @@ function registrationThreeRouteAuthorityPayload(authority) {
11412
11412
  default: return assertNever(authority);
11413
11413
  }
11414
11414
  }
11415
- async function startEarlyNearRegistrationAdmission(args) {
11415
+ async function startNearRegistrationAdmission(args) {
11416
11416
  const startedAt = performance.now();
11417
11417
  try {
11418
- const deferredNear = (await authorizeWalletRegistrationNearAdmission({
11419
- relayerUrl: args.relayerUrl,
11420
- headers: registrationRouteHeaders(args.traceContext),
11421
- registrationCeremonyId: args.registrationCeremonyId,
11422
- signedSetup: args.signedSetup,
11423
- ...registrationThreeRouteAuthorityPayload(args.authority)
11424
- })).ed25519;
11425
- const admissionReceipt = await admitDeferredNearRegistration(deferredNear, {
11418
+ const admissionReceipt = await admitDeferredNearRegistration(args.deferredNear, {
11426
11419
  routerOrigin: new URL(args.relayerUrl).origin,
11427
11420
  authorization: {
11428
11421
  kind: "bearer",
@@ -11438,7 +11431,7 @@ async function startEarlyNearRegistrationAdmission(args) {
11438
11431
  outcome: "success"
11439
11432
  });
11440
11433
  return {
11441
- deferredNear,
11434
+ deferredNear: args.deferredNear,
11442
11435
  admissionReceipt
11443
11436
  };
11444
11437
  } catch (error) {
@@ -11451,7 +11444,7 @@ async function startEarlyNearRegistrationAdmission(args) {
11451
11444
  throw error;
11452
11445
  }
11453
11446
  }
11454
- function requireEarlyNearRegistrationAdmission(admission) {
11447
+ function requireNearRegistrationAdmission(admission) {
11455
11448
  if (!admission) throw new Error("Mixed registration did not start NEAR admission");
11456
11449
  return admission;
11457
11450
  }
@@ -11628,14 +11621,6 @@ async function runEcdsaEnabledThreeRouteRegistrationCeremony(args) {
11628
11621
  clientCeremony: args.clientCeremony
11629
11622
  })
11630
11623
  });
11631
- const earlyNearAdmission = args.signerPlanKind === "near_ed25519_and_evm_family_ecdsa" ? startEarlyNearRegistrationAdmission({
11632
- relayerUrl: args.relayerUrl,
11633
- registrationCeremonyId: ceremonyId,
11634
- signedSetup: args.signedSetup,
11635
- authority: args.authority,
11636
- traceContext: args.traceContext
11637
- }) : null;
11638
- earlyNearAdmission?.catch(ignoreNearCustodyFailure);
11639
11624
  const responded = await measureStrictEcdsaCeremonyStep({
11640
11625
  registrationTiming: args.registrationTiming,
11641
11626
  bucket: "ecdsaRegistrationGatewayRespondMs",
@@ -11656,6 +11641,14 @@ async function runEcdsaEnabledThreeRouteRegistrationCeremony(args) {
11656
11641
  });
11657
11642
  if (responded.kind === "near_ed25519") throw new Error("ECDSA registration ceremony received an Ed25519-only respond result");
11658
11643
  const deferredNear = responded.kind === "near_ed25519_and_evm_family_ecdsa" ? responded.ed25519 : null;
11644
+ const nearAdmission = deferredNear ? startNearRegistrationAdmission({
11645
+ relayerUrl: args.relayerUrl,
11646
+ registrationCeremonyId: ceremonyId,
11647
+ signedSetup: args.signedSetup,
11648
+ deferredNear,
11649
+ traceContext: args.traceContext
11650
+ }) : null;
11651
+ nearAdmission?.catch(ignoreNearCustodyFailure);
11659
11652
  const verified = await measureStrictEcdsaCeremonyStep({
11660
11653
  registrationTiming: args.registrationTiming,
11661
11654
  bucket: "ecdsaRegistrationClientProofVerifyMs",
@@ -11716,8 +11709,7 @@ async function runEcdsaEnabledThreeRouteRegistrationCeremony(args) {
11716
11709
  deferredNear
11717
11710
  });
11718
11711
  deferredNearCustodyWork = args.startDeferredNearCustody({
11719
- deferredNear,
11720
- earlyAdmission: requireEarlyNearRegistrationAdmission(earlyNearAdmission),
11712
+ admission: requireNearRegistrationAdmission(nearAdmission),
11721
11713
  establishedEvmCustodyCommit: bootstrap.preActivationCommitPayload
11722
11714
  });
11723
11715
  deferredNearCustodyWork.catch(ignoreNearCustodyFailure);
@@ -12015,14 +12007,14 @@ async function startDeferredNearWalletCustody(base, input) {
12015
12007
  operation: "near_provisioning"
12016
12008
  });
12017
12009
  if (!pending || pending.operation !== "near_provisioning" || pending.phase !== "planned") throw new Error("NEAR registration has no planned continuation");
12018
- let earlyAdmissionReceipt;
12010
+ let preAdmittedReceipt;
12019
12011
  try {
12020
- const early = await input.earlyAdmission;
12021
- if (!sameRouterAbEd25519YaoRegistrationAdmissionRequestV1(early.deferredNear.admissionRequest, pending.admissionRequest)) throw new Error("Early NEAR admission changed the authorized request");
12022
- earlyAdmissionReceipt = early.admissionReceipt;
12012
+ const admitted = await input.admission;
12013
+ if (!sameRouterAbEd25519YaoRegistrationAdmissionRequestV1(admitted.deferredNear.admissionRequest, pending.admissionRequest)) throw new Error("NEAR admission changed the authorized request");
12014
+ preAdmittedReceipt = admitted.admissionReceipt;
12023
12015
  } catch (error) {
12024
- if (error instanceof Error && error.message === "Early NEAR admission changed the authorized request") throw error;
12025
- earlyAdmissionReceipt = void 0;
12016
+ if (error instanceof Error && error.message === "NEAR admission changed the authorized request") throw error;
12017
+ preAdmittedReceipt = void 0;
12026
12018
  }
12027
12019
  const { joined, admissionReceipt } = await continueNearRegistrationCustody({
12028
12020
  pending,
@@ -12031,7 +12023,7 @@ async function startDeferredNearWalletCustody(base, input) {
12031
12023
  credential: base.signedSetup,
12032
12024
  traceContext: base.traceContext,
12033
12025
  factorSecret,
12034
- ...earlyAdmissionReceipt ? { admitted: earlyAdmissionReceipt } : {}
12026
+ ...preAdmittedReceipt ? { admitted: preAdmittedReceipt } : {}
12035
12027
  });
12036
12028
  outcome = "success";
12037
12029
  return {
@@ -1,8 +1,8 @@
1
- import { i as loadWebAuthnP256EngineCtor, n as loadSignEvmFamilyWithUiConfirmForTempo, r as loadSignEvmWithUiConfirm, t as loadSecp256k1EngineCtor } from "./signerLoader-D0WU1jq_.js";
1
+ import { i as loadWebAuthnP256EngineCtor, n as loadSignEvmFamilyWithUiConfirmForTempo, r as loadSignEvmWithUiConfirm, t as loadSecp256k1EngineCtor } from "./signerLoader-D_w-SfR9.js";
2
2
  //#region src/SeamsWeb/walletIframe/host/registrationPreparationPreload.ts
3
3
  async function preloadWalletHostRegistrationPreparation() {
4
4
  await Promise.all([
5
- import("./runtime-ecdsa-tempo-DKdS5-us.js").catch(() => void 0),
5
+ import("./runtime-ecdsa-tempo-tUWnafRo.js").catch(() => void 0),
6
6
  loadSignEvmFamilyWithUiConfirmForTempo().catch(() => void 0),
7
7
  loadSignEvmWithUiConfirm().catch(() => void 0),
8
8
  loadSecp256k1EngineCtor().catch(() => void 0),
@@ -3,8 +3,8 @@ import { t as walletIframeRequestIdFromBoundary } from "./walletIframeIdentity-U
3
3
  import "./validation-BphUDXs7.js";
4
4
  import { _ as parseHostedAuthMenuExternalAuthResolution, h as parseHostedAuthMenuErrorEvent, o as hostedAuthMenuExternalAuthRequestIdFromBoundary, p as parseHostedAuthMenuCancelPayload, v as parseHostedAuthMenuOpenRequest } from "./messages-B3UbNZYc.js";
5
5
  import "./errors-93h9uAW9.js";
6
- import { r as preloadWalletHostRegistrationSurface } from "./runtimeLoader-BFAmJAbu.js";
7
- import { i as registerPreparedHostedPasskeyRegistration, n as cancelHostedPasskeyRegistration, r as prepareHostedPasskeyRegistration, s as startHostedPasskeyRegistrationCredential, ut as WalletSessionStatusReadScope } from "./registration-D-istkMZ.js";
6
+ import { r as preloadWalletHostRegistrationSurface } from "./runtimeLoader-ZXsvx9zX.js";
7
+ import { i as registerPreparedHostedPasskeyRegistration, n as cancelHostedPasskeyRegistration, r as prepareHostedPasskeyRegistration, s as startHostedPasskeyRegistrationCredential, ut as WalletSessionStatusReadScope } from "./registration-PIBMSsQR.js";
8
8
  import { l as activeWalletSessionV1RecordsEqual } from "./device-linking-DpVGjSeq.js";
9
9
  import { k as walletIdFromString, l as createReadableWalletId } from "./registrationIntent-DwAIMQYh.js";
10
10
  import { c as toWalletId, u as walletSessionRefFromSession } from "./ecdsaChainTarget-BOTPGIU_.js";
@@ -21,13 +21,13 @@ import { s as IndexedDBManager, v as walletSessionAuthorizations } from "./ed255
21
21
  import "./keccak-DY5wDsym.js";
22
22
  import "./signingSessionSeal-CdtgXHSL.js";
23
23
  import { l as pmUnlockPayloadToLoginHooksOptions, n as exactSessionIdentitiesMatch, r as parseWalletIframeExactSessionIdentity, s as readSelectedWalletIframeExactSessionState, u as requirePMUnlockPayload } from "./exactSessionState-Bt0HforB.js";
24
- import "./nearEd25519YaoMaterialActivation-BLxVE6E5.js";
24
+ import "./nearEd25519YaoMaterialActivation-Cz5UJQ_7.js";
25
25
  import "./operationFingerprint-CsYO6b0a.js";
26
26
  import "./actions-DsBQcjBn.js";
27
27
  import { t as createWalletIframeSurfaceMeasurementReporter } from "./surface-measurement-reporter-D7BNehf4.js";
28
28
  import { n as getDefaultCspNonce, r as appearanceTokenCssRule, t as createCspStylesheetManager } from "./csp-stylesheet-DLj_a6t_.js";
29
29
  import { a as R, o as S, r as C, t as u } from "./jsxRuntime.module-FAP0NE9p.js";
30
- import { a as syncAccountWithPreparedCredential, c as listLocalLoginAuthMethods, d as unlockLinkedDevicePasskey, f as unlockResolvedWalletSubjectSet, g as normalizeLinkedDeviceTargetEmailAddressV1, h as isLinkedDeviceTargetEmailAddressV1, handleWalletHostRuntimeRequestWithHandlers, i as prepareSyncAccountChallenge, l as resolveLinkedDevicePasskeyAuthoritySelection, m as DeviceLinkingErrorCode, n as clearHostedWalletSessions, o as buildNearWalletRegistrationSignerSetSelection, p as resolveWalletUnlockSubjectSet, s as resolvePasskeyRegistrationAccountProvisioning, t as activeHostedWalletSessionOperationCredential, u as resolveLinkedDeviceUnlockSubjectSet } from "./runtimeContext-CH97jPZ0.js";
30
+ import { a as syncAccountWithPreparedCredential, c as listLocalLoginAuthMethods, d as unlockLinkedDevicePasskey, f as unlockResolvedWalletSubjectSet, g as normalizeLinkedDeviceTargetEmailAddressV1, h as isLinkedDeviceTargetEmailAddressV1, handleWalletHostRuntimeRequestWithHandlers, i as prepareSyncAccountChallenge, l as resolveLinkedDevicePasskeyAuthoritySelection, m as DeviceLinkingErrorCode, n as clearHostedWalletSessions, o as buildNearWalletRegistrationSignerSetSelection, p as resolveWalletUnlockSubjectSet, s as resolvePasskeyRegistrationAccountProvisioning, t as activeHostedWalletSessionOperationCredential, u as resolveLinkedDeviceUnlockSubjectSet } from "./runtimeContext-CTt9ON27.js";
31
31
  import { n as respondOkResult, r as withProgress, t as respondOk } from "./shared-Qy1DGMqH.js";
32
32
  //#region src/SeamsWeb/walletIframe/shared/exactSessionReconciliation.ts
33
33
  /**
@@ -15,11 +15,11 @@ import { c as classifyLinkDeviceFlowEvent } from "./sdkSentEvents-5Pi-hjHB.js";
15
15
  import "./ed25519SeedMaterial-Cghz8-XB.js";
16
16
  import "./keccak-DY5wDsym.js";
17
17
  import "./signingSessionSeal-CdtgXHSL.js";
18
- import "./nearEd25519YaoMaterialActivation-BLxVE6E5.js";
18
+ import "./nearEd25519YaoMaterialActivation-Cz5UJQ_7.js";
19
19
  import "./operationFingerprint-CsYO6b0a.js";
20
20
  import "./actions-DsBQcjBn.js";
21
21
  import "./jsxRuntime.module-FAP0NE9p.js";
22
- import { handleWalletHostRuntimeRequestWithHandlers } from "./runtimeContext-CH97jPZ0.js";
22
+ import { handleWalletHostRuntimeRequestWithHandlers } from "./runtimeContext-CTt9ON27.js";
23
23
  import { n as respondOkResult, r as withProgress, t as respondOk } from "./shared-Qy1DGMqH.js";
24
24
  //#region src/SeamsWeb/walletIframe/host/handlers/deviceLink.ts
25
25
  /** The QR payload's own lifetime; a selection older than this blocks nothing. */
@@ -14,11 +14,11 @@ import "./ed25519SeedMaterial-Cghz8-XB.js";
14
14
  import "./keccak-DY5wDsym.js";
15
15
  import "./signingSessionSeal-CdtgXHSL.js";
16
16
  import { S as requireTempoFeeTokenPreferenceSigningRequest } from "./exactSessionState-Bt0HforB.js";
17
- import "./nearEd25519YaoMaterialActivation-BLxVE6E5.js";
17
+ import "./nearEd25519YaoMaterialActivation-Cz5UJQ_7.js";
18
18
  import "./operationFingerprint-CsYO6b0a.js";
19
19
  import "./actions-DsBQcjBn.js";
20
20
  import "./jsxRuntime.module-FAP0NE9p.js";
21
- import { handleWalletHostRuntimeRequestWithHandlers } from "./runtimeContext-CH97jPZ0.js";
21
+ import { handleWalletHostRuntimeRequestWithHandlers } from "./runtimeContext-CTt9ON27.js";
22
22
  import { n as respondOkResult, t as respondOk } from "./shared-Qy1DGMqH.js";
23
23
  //#region src/SeamsWeb/walletIframe/host/handlers/ecdsaTempo.ts
24
24
  function createEcdsaTempoWalletIframeHandlers(deps) {