@seams/wallet 0.7.3 → 0.8.0

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 (1693) hide show
  1. package/README.md +4 -5
  2. package/THIRD_PARTY_NOTICES.md +1 -9
  3. package/dist/.build-inputs.sha256 +1 -1
  4. package/dist/esm/SeamsWeb/SeamsWeb.js +2 -2
  5. package/dist/esm/SeamsWeb/assembly/browserSigningSurfaceAssembly.js +2 -2
  6. package/dist/esm/SeamsWeb/assembly/createBrowserRecoveryPublicDeps.js +1 -1
  7. package/dist/esm/SeamsWeb/assembly/createBrowserSigningStores.js +1 -1
  8. package/dist/esm/SeamsWeb/assembly/createBrowserWarmSessionPublicDeps.js +0 -2
  9. package/dist/esm/SeamsWeb/operations/auth/login.js +18 -43
  10. package/dist/esm/SeamsWeb/operations/auth/walletUnlockSubject.js +2 -8
  11. package/dist/esm/SeamsWeb/operations/authMethods/emailOtp/addEmailOtp.js +1 -1
  12. package/dist/esm/SeamsWeb/operations/authMethods/emailOtp/googleEmailOtpWalletAuthFlow.js +5 -9
  13. package/dist/esm/SeamsWeb/operations/authMethods/passkey/addPasskey.js +1 -1
  14. package/dist/esm/SeamsWeb/operations/authMethods/revokeAuthMethod.js +1 -1
  15. package/dist/esm/SeamsWeb/operations/devices/deviceLinkingResume.js +1 -4
  16. package/dist/esm/SeamsWeb/operations/devices/linkDeviceFlow.js +38 -13
  17. package/dist/esm/SeamsWeb/operations/devices/scanDevice.js +1 -1
  18. package/dist/esm/SeamsWeb/operations/near/signNEP413.js +0 -1
  19. package/dist/esm/SeamsWeb/operations/recovery/syncAccount.js +2 -4
  20. package/dist/esm/SeamsWeb/operations/recovery/walletRecovery.js +1 -2
  21. package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryCommit.js +4 -5
  22. package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryDurablePayload.js +1 -2
  23. package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryRotation.js +1 -2
  24. package/dist/esm/SeamsWeb/operations/registration/pendingRegistrationRecovery.js +3 -12
  25. package/dist/esm/SeamsWeb/operations/registration/registration.js +5 -5
  26. package/dist/esm/SeamsWeb/operations/registration/registrationStrictEcdsa.js +1 -1
  27. package/dist/esm/SeamsWeb/operations/registration/registrationTerminalCommit.js +1 -1
  28. package/dist/esm/SeamsWeb/operations/session/thresholdEcdsaProvisioning.js +2 -6
  29. package/dist/esm/SeamsWeb/publicApi/near.js +1 -1
  30. package/dist/esm/SeamsWeb/publicApi/transactionReview.js +4 -1
  31. package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +4 -4
  32. package/dist/esm/SeamsWeb/walletIframe/client/router.js +1 -2
  33. package/dist/esm/SeamsWeb/walletIframe/client/surface/domain.js +0 -2
  34. package/dist/esm/SeamsWeb/walletIframe/client/transport/IframeTransport.js +0 -4
  35. package/dist/esm/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.js +1 -1
  36. package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.js +64 -0
  37. package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +165 -222
  38. package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/icons.js +136 -0
  39. package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +6 -6
  40. package/dist/esm/SeamsWeb/walletIframe/shared/transactionReview.js +11 -1
  41. package/dist/esm/advanced.js +0 -1
  42. package/dist/esm/base-styles.js +2 -2
  43. package/dist/esm/core/accountData/near/accountProjection.js +0 -1
  44. package/dist/esm/core/accountData/near/keyMaterial.js +0 -1
  45. package/dist/esm/core/browser/walletIframe/events.js +1 -5
  46. package/dist/esm/core/browser/walletIframe/host-mode.js +0 -10
  47. package/dist/esm/core/config/chains.js +1 -2
  48. package/dist/esm/core/config/configBuilder.js +0 -1
  49. package/dist/esm/core/config/configHelpers.js +0 -1
  50. package/dist/esm/core/indexedDB/accountKeyMaterial.js +0 -1
  51. package/dist/esm/core/indexedDB/index.js +3 -4
  52. package/dist/esm/core/indexedDB/pendingWalletRecoveryCommit.js +1 -4
  53. package/dist/esm/core/indexedDB/schemaNames.js +0 -22
  54. package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.js +3 -3
  55. package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.js +3 -3
  56. package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaClientPresignatures.js +1 -1
  57. package/dist/esm/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.js +0 -1
  58. package/dist/esm/core/indexedDB/seamsWalletDB/registrationSetup.js +103 -0
  59. package/dist/esm/core/indexedDB/seamsWalletDB/repositories.js +2 -3
  60. package/dist/esm/core/indexedDB/seamsWalletDB/signingSessionSeals.js +0 -35
  61. package/dist/esm/core/indexedDB/seamsWalletDB/walletCustodyEcdsaContinuity.js +4 -4
  62. package/dist/esm/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.js +37 -19
  63. package/dist/esm/core/indexedDB/unifiedIndexedDBManager.js +10 -3
  64. package/dist/esm/core/indexedDB/walletCustodyEd25519MaterialRecord.js +1 -1
  65. package/dist/esm/core/platform/browser/createBrowserPlatformRuntime.js +8 -25
  66. package/dist/esm/core/rpcClients/near/rpcCalls.js +39 -1
  67. package/dist/esm/core/rpcClients/relayer/passkeyCustodyEnvelope.js +3 -13
  68. package/dist/esm/core/rpcClients/relayer/thresholdEcdsa.js +0 -2
  69. package/dist/esm/core/rpcClients/relayer/walletRecoveryPrepare.js +3 -4
  70. package/dist/esm/core/rpcClients/relayer/walletRegistration.js +21 -15
  71. package/dist/esm/core/rpcClients/relayer/walletRegistrationTerminalResponse.js +1 -2
  72. package/dist/esm/core/signingEngine/assembly/createManagers.js +1 -1
  73. package/dist/esm/core/signingEngine/assembly/ports/shared.js +1 -2
  74. package/dist/esm/core/signingEngine/assembly/warmup.js +1 -5
  75. package/dist/esm/core/signingEngine/chains/near/nearSignerWasm.js +2 -33
  76. package/dist/esm/core/signingEngine/flows/recovery/ecdsaDerivationExport.js +0 -1
  77. package/dist/esm/core/signingEngine/flows/recovery/ecdsaExportMaterial.js +0 -1
  78. package/dist/esm/core/signingEngine/flows/recovery/passkeyEd25519YaoRecovery.js +1 -1
  79. package/dist/esm/core/signingEngine/flows/recovery/stepUpAuthorization.js +1 -1
  80. package/dist/esm/core/signingEngine/flows/registration/accountLifecycle.js +3 -8
  81. package/dist/esm/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.js +1 -2
  82. package/dist/esm/core/signingEngine/flows/shared/signingStateMachine.js +2 -5
  83. package/dist/esm/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.js +0 -2
  84. package/dist/esm/core/signingEngine/flows/signEvmFamily/signingFlow.js +1 -1
  85. package/dist/esm/core/signingEngine/flows/signEvmFamily/transactionExecutor.js +1 -2
  86. package/dist/esm/core/signingEngine/flows/signNear/implicitAccountFunding.js +1 -1
  87. package/dist/esm/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +33 -42
  88. package/dist/esm/core/signingEngine/flows/signNear/shared/signatureOnlySigning.js +0 -2
  89. package/dist/esm/core/signingEngine/flows/signNear/shared/signingMaterials.js +1 -7
  90. package/dist/esm/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.js +4 -14
  91. package/dist/esm/core/signingEngine/flows/signNear/signDelegate.js +2 -6
  92. package/dist/esm/core/signingEngine/flows/signNear/signNep413.js +2 -6
  93. package/dist/esm/core/signingEngine/nonce/NonceCoordinator.js +1 -1
  94. package/dist/esm/core/signingEngine/nonce/nearNonceLane.js +1 -1
  95. package/dist/esm/core/signingEngine/nonce/nonceDiagnostics.js +1 -1
  96. package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/poolFillRoutes.js +0 -1
  97. package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/presignaturePool.js +0 -1
  98. package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.js +0 -3
  99. package/dist/esm/core/signingEngine/session/SigningSessionCoordinator.js +1 -4
  100. package/dist/esm/core/signingEngine/session/authority/authorityOperationResolver.js +17 -68
  101. package/dist/esm/core/signingEngine/session/emailOtp/EmailOtpWalletSessionCoordinator.js +0 -1
  102. package/dist/esm/core/signingEngine/session/emailOtp/ecdsaBootstrapCommit.js +1 -1
  103. package/dist/esm/core/signingEngine/session/emailOtp/ecdsaLifecycleRuntime.js +0 -3
  104. package/dist/esm/core/signingEngine/session/emailOtp/ecdsaLogin.js +1 -7
  105. package/dist/esm/core/signingEngine/session/emailOtp/ecdsaRecovery.js +10 -14
  106. package/dist/esm/core/signingEngine/session/emailOtp/ed25519ExportContext.js +0 -3
  107. package/dist/esm/core/signingEngine/session/emailOtp/exportRecovery.js +0 -2
  108. package/dist/esm/core/signingEngine/session/identity/clientSessionPersistenceState.js +5 -16
  109. package/dist/esm/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.js +0 -1
  110. package/dist/esm/core/signingEngine/session/identity/exactSigningLaneIdentity.js +1 -1
  111. package/dist/esm/core/signingEngine/session/identity/exactWalletSessionCredential.js +0 -2
  112. package/dist/esm/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.js +1 -2
  113. package/dist/esm/core/signingEngine/session/material/ecdsaCapabilityManifest.js +1 -1
  114. package/dist/esm/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.js +1 -14
  115. package/dist/esm/core/signingEngine/session/operationState/preparedOperation.js +1 -5
  116. package/dist/esm/core/signingEngine/session/passkey/ecdsaBootstrap.js +3 -6
  117. package/dist/esm/core/signingEngine/session/passkey/ecdsaKeyFactsInventory.js +0 -1
  118. package/dist/esm/core/signingEngine/session/passkey/ecdsaRecovery.js +1 -4
  119. package/dist/esm/core/signingEngine/session/passkey/ed25519SessionProvision.js +0 -1
  120. package/dist/esm/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.js +2 -3
  121. package/dist/esm/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.js +12 -45
  122. package/dist/esm/core/signingEngine/session/persistence/clientSessionPersistence.js +8 -16
  123. package/dist/esm/core/signingEngine/session/persistence/sealedSessionRecords.js +0 -2
  124. package/dist/esm/core/signingEngine/session/postconditions/runtimePostconditions.js +0 -2
  125. package/dist/esm/core/signingEngine/session/routerAbSigningWalletSession.js +2 -8
  126. package/dist/esm/core/signingEngine/session/warmCapabilities/readModel.js +2 -8
  127. package/dist/esm/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.js +1 -12
  128. package/dist/esm/core/signingEngine/session/warmCapabilities/transitions.js +7 -11
  129. package/dist/esm/core/signingEngine/stepUpConfirmation/otpPrompt/authLane.js +0 -1
  130. package/dist/esm/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.js +6 -30
  131. package/dist/esm/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.js +0 -3
  132. package/dist/esm/core/signingEngine/stepUpConfirmation/requireStepUpAuth.js +1 -5
  133. package/dist/esm/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.js +0 -3
  134. package/dist/esm/core/signingEngine/threshold/ecdsa/bootstrapSession.js +1 -5
  135. package/dist/esm/core/signingEngine/threshold/ed25519/walletSession.js +1 -1
  136. package/dist/esm/core/signingEngine/threshold/ed25519/yaoClient.js +1 -35
  137. package/dist/esm/core/signingEngine/threshold/sessionPolicy.js +0 -1
  138. package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +1 -4
  139. package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +1 -1
  140. package/dist/esm/core/signingEngine/uiConfirm/UiConfirmManager.js +0 -1
  141. package/dist/esm/core/signingEngine/uiConfirm/handlers/flows/adapters/adapters.js +1 -1
  142. package/dist/esm/core/signingEngine/uiConfirm/handlers/flows/localOnly.js +0 -1
  143. package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +7 -0
  144. package/dist/esm/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.js +3 -13
  145. package/dist/esm/core/signingEngine/walletCustody/activateEd25519Capability.js +0 -1
  146. package/dist/esm/core/signingEngine/walletCustody/emailOtpLink.js +10 -13
  147. package/dist/esm/core/signingEngine/walletCustody/openCustodyCache.js +2 -6
  148. package/dist/esm/core/signingEngine/walletCustody/passkeyLink.js +7 -10
  149. package/dist/esm/core/signingEngine/walletCustody/registrationCeremony.js +0 -1
  150. package/dist/esm/core/signingEngine/walletCustody/walletRecoveryCredential.js +0 -1
  151. package/dist/esm/core/signingEngine/walletCustody/walletRecoveryEcdsa.js +0 -1
  152. package/dist/esm/core/signingEngine/walletCustody/walletRecoveryEd25519.js +1 -1
  153. package/dist/esm/core/signingEngine/walletCustody/walletRecoveryManifest.js +0 -2
  154. package/dist/esm/core/signingEngine/walletCustody/walletRecoveryRotation.js +0 -1
  155. package/dist/esm/core/signingEngine/webauthnAuth/walletOriginWebAuthn.js +109 -0
  156. package/dist/esm/core/signingEngine/workerManager/SignerWorkerManager.js +0 -2
  157. package/dist/esm/core/signingEngine/workerManager/ecdsaClientWorkerChannels.js +0 -4
  158. package/dist/esm/core/signingEngine/workerManager/validation.js +1 -1
  159. package/dist/esm/core/signingEngine/workerManager/workerTransport.js +3 -42
  160. package/dist/esm/core/signingEngine/workerManager/workerTypes.js +0 -2
  161. package/dist/esm/core/types/accountIds.js +0 -1
  162. package/dist/esm/core/types/sdkSentEvents.js +1 -2
  163. package/dist/esm/core/types/signer-worker.js +1 -36
  164. package/dist/esm/core/walletRuntimePaths/base.js +11 -1
  165. package/dist/esm/plugins/headers.js +0 -1
  166. package/dist/esm/plugins/next.js +0 -1
  167. package/dist/esm/plugins/plugin-utils.js +0 -1
  168. package/dist/esm/plugins/shared-ts/src/utils/normalize.js +1 -1
  169. package/dist/esm/react/components/AccountMenuButton/AccountsSection.js +1 -1
  170. package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +1 -1
  171. package/dist/esm/react/components/AccountMenuButton/ExportKeysSection.js +1 -1
  172. package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +4 -4
  173. package/dist/esm/react/components/AccountMenuButton/LockMenuItem.js +1 -1
  174. package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +1 -1
  175. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.css +8 -0
  176. package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +14 -6
  177. package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.js +1 -1
  178. package/dist/esm/react/components/AccountMenuButton/index.js +5 -5
  179. package/dist/esm/react/components/HostedSeamsAuthMenu/SeamsAuthMenuMock.js +1 -1
  180. package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +1 -1
  181. package/dist/esm/react/components/QRCodeScanner.js +2 -2
  182. package/dist/esm/react/components/ShowQRCode.js +4 -4
  183. package/dist/esm/react/components/theme/design-tokens.js +1 -2
  184. package/dist/esm/react/context/index.js +1 -1
  185. package/dist/esm/react/context/reactLoginStateBuilders.js +1 -1
  186. package/dist/esm/react/context/seamsManagerSingleton.js +2 -2
  187. package/dist/esm/react/context/useLoginStateRefresher.js +2 -5
  188. package/dist/esm/react/context/useSeamsContextValue.js +1 -1
  189. package/dist/esm/react/context/useSeamsWithSdkFlow.js +1 -1
  190. package/dist/esm/react/context/useWalletIframeLifecycle.js +1 -1
  191. package/dist/esm/react/hooks/useAccountInput.js +4 -4
  192. package/dist/esm/react/hooks/useNearClient.js +3 -3
  193. package/dist/esm/react/hooks/usePreconnectWalletAssets.js +1 -1
  194. package/dist/esm/react/hooks/useQRCamera.js +2 -2
  195. package/dist/esm/react/hooks/useWallet.js +1 -1
  196. package/dist/esm/react/index.js +10 -10
  197. package/dist/esm/react/styles/styles.css +8 -0
  198. package/dist/esm/react/transactionReview/TransactionReviewHost.js +1 -1
  199. package/dist/esm/react/transactionReview/boundCalls.js +2 -2
  200. package/dist/esm/react/transactionReview/contract.js +1 -1
  201. package/dist/esm/react/transactionReview/controller.js +2 -2
  202. package/dist/esm/react/transactionReview/snapshot.js +2 -2
  203. package/dist/esm/sdk/ConfirmationDrawer-DrsREojk.js +1 -0
  204. package/dist/esm/sdk/EvmClient-DoxytQaJ.js +1 -0
  205. package/dist/esm/sdk/NearClient-vJ65Wjrq.js +1 -0
  206. package/dist/esm/sdk/NonceCoordinator-BBeadCSq.js +1 -0
  207. package/dist/esm/sdk/accountIds-C3Ihsd2c.js +1 -0
  208. package/dist/esm/sdk/accountLifecycle-EyfYPnuT.js +1 -0
  209. package/dist/esm/sdk/actions-DZLxCcrU.js +1 -0
  210. package/dist/esm/sdk/adapters-DtAyuoiA.js +2 -0
  211. package/dist/esm/sdk/base-Xtd32asf.js +1 -0
  212. package/dist/esm/sdk/base64-ojm5DKcF.js +1 -0
  213. package/dist/esm/sdk/browser-CsOGMbMy.js +8 -0
  214. package/dist/esm/sdk/bytes-t5S5mkat.js +1 -0
  215. package/dist/esm/sdk/canonicalPrimitives-MPGET2cl.js +1 -0
  216. package/dist/esm/sdk/canonicalSignerErrorCode-C0hh_SVi.js +1 -0
  217. package/dist/esm/sdk/capabilityKinds-XaXXiD2B.js +1 -0
  218. package/dist/esm/sdk/chains-yAls2d9X.js +1 -0
  219. package/dist/esm/sdk/challengeDelivery-cAsaUC6U.js +1 -0
  220. package/dist/esm/sdk/chunk-dVx5-UGu.js +1 -0
  221. package/dist/esm/sdk/configHelpers-CseiVoZD.js +1 -0
  222. package/dist/esm/sdk/csp-stylesheet-B1fAhrGB.js +2 -0
  223. package/dist/esm/sdk/defaultConfigs-CWpApkMq.js +1 -0
  224. package/dist/esm/sdk/display-jK7_hYho.js +1 -0
  225. package/dist/esm/sdk/domainIds-GDzjOs6i.js +1 -0
  226. package/dist/esm/sdk/ecdsaCapabilityManifest-CHFu-QrV.js +1 -0
  227. package/dist/esm/sdk/ecdsaChainTarget-CRcRR78w.js +1 -0
  228. package/dist/esm/sdk/ecdsaPresignLifecycle-CQnCxSlq.js +1 -0
  229. package/dist/esm/sdk/ecdsaPresignPoolIdentity-Ci-ovDlv.js +1 -0
  230. package/dist/esm/sdk/ecdsaWalletRecords-Cm1DdexN.js +1 -0
  231. package/dist/esm/sdk/enrichDisplayModelWithAbi-CR-4ebuU.js +1 -0
  232. package/dist/esm/sdk/enrichDisplayModelWithAbi-CwHKFqF4.js +569 -0
  233. package/dist/esm/sdk/errors-DfbnsXjO.js +1 -0
  234. package/dist/esm/sdk/events-BJyVcnsn.js +1 -0
  235. package/dist/esm/sdk/evmCryptoWasm-CwEXiLrC.js +1 -0
  236. package/dist/esm/sdk/evmFamilyEcdsaIdentity-Br3iFdQx.js +1 -0
  237. package/dist/esm/sdk/exactSessionState-CjD8gekO.js +210 -0
  238. package/dist/esm/sdk/exactSigningLaneIdentity-olheZx_n.js +1 -0
  239. package/dist/esm/sdk/executeWorkerOperation-CrFf3FkL.js +1 -0
  240. package/dist/esm/sdk/export-viewer-host-jo7h_0wl.js +1 -0
  241. package/dist/esm/sdk/helpers-D4QckQhq.js +1 -0
  242. package/dist/esm/sdk/host-BAqOYnju.js +1 -0
  243. package/dist/esm/sdk/intentDigest-CB6zy3lN.js +1 -0
  244. package/dist/esm/sdk/jsonRpc-C85RYR0A.js +1 -0
  245. package/dist/esm/sdk/jsxRuntime.module-CoHsKD_3.js +1 -0
  246. package/dist/esm/sdk/keccak-zexutGfG.js +1 -0
  247. package/dist/esm/sdk/keyMaterialBrands-uVZHfAh3.js +1 -0
  248. package/dist/esm/sdk/localOnly-DBQRG6Qh.js +1 -0
  249. package/dist/esm/sdk/messages-Cv2j4SKI.js +1 -0
  250. package/dist/esm/sdk/mountExportPrivateKeySurface-G7Z_9JMQ.js +1 -0
  251. package/dist/esm/sdk/mountRecoveryCodeBackupSurface-BBCTaQsu.js +2 -0
  252. package/dist/esm/sdk/nearEd25519YaoMaterialActivation-DQIw8ho3.js +1 -0
  253. package/dist/esm/sdk/nearEd25519YaoSigningPreparation-Bp_CvWRz.js +1 -0
  254. package/dist/esm/sdk/nearRpcResults--cBcfmp4.js +1 -0
  255. package/dist/esm/sdk/nonceLaneKeys-BBYi4g51.js +1 -0
  256. package/dist/esm/sdk/normalization-BGPR6osg.js +1 -0
  257. package/dist/esm/sdk/operationFingerprint-5-wH2Ht8.js +1 -0
  258. package/dist/esm/sdk/operationFingerprint-DtQb0pdp.js +1 -0
  259. package/dist/esm/sdk/passkey-custody-LP4UTFbn.js +1 -0
  260. package/dist/esm/sdk/pendingWalletRecoveryCodeBackup-BNk4ebsY.js +1 -0
  261. package/dist/esm/sdk/prfCache-Mbo7_USg.js +1 -0
  262. package/dist/esm/sdk/profileAccountProjection-DHCaMtOu.js +1 -0
  263. package/dist/esm/sdk/promptText-s8TQ6ckX.js +1 -0
  264. package/dist/esm/sdk/recovery-entrypoint-DkT8sFO5.js +1 -0
  265. package/dist/esm/sdk/registration-Btozh7uh.js +1 -0
  266. package/dist/esm/sdk/registration-CSAG_h4Y.js +1 -0
  267. package/dist/esm/sdk/registrationAccounts-DIeEVy6W.js +1 -0
  268. package/dist/esm/sdk/registrationIds-BIel5S0i.js +1 -0
  269. package/dist/esm/sdk/registrationIntent-DV1GYZ3K.js +1 -0
  270. package/dist/esm/sdk/registrationPreparationPreload-vOCqNuG4.js +1 -0
  271. package/dist/esm/sdk/registrationSignerPlan-FzD3TwxB.js +1 -0
  272. package/dist/esm/sdk/relayerHttp-DaPeS929.js +1 -0
  273. package/dist/esm/sdk/routePlan-B_KJaPtm.js +1 -0
  274. package/dist/esm/sdk/router-Dd3fFHk3.js +1 -0
  275. package/dist/esm/sdk/routerAbNormalSigning-D_fHjq5l.js +1 -0
  276. package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  277. package/dist/esm/sdk/runtime-auth-B2M91rSx.js +1 -0
  278. package/dist/esm/sdk/runtime-device-link-ojjPSRaG.js +1 -0
  279. package/dist/esm/sdk/runtime-ecdsa-tempo-CE4JLgmn.js +1 -0
  280. package/dist/esm/sdk/runtime-email-otp-DDwtKVAe.js +1 -0
  281. package/dist/esm/sdk/runtime-export-JXYk8sQ-.js +1 -0
  282. package/dist/esm/sdk/runtime-near-BB8AG6dV.js +1 -0
  283. package/dist/esm/sdk/runtime-preferences-DKFZYccW.js +1 -0
  284. package/dist/esm/sdk/runtime-recovery-C_XjsDBg.js +1 -0
  285. package/dist/esm/sdk/runtime-recovery-codes-CWp839mH.js +1 -0
  286. package/dist/esm/sdk/runtimeContext-BpObgzbj.js +6 -0
  287. package/dist/esm/sdk/runtimeLoader-DjgBf_yF.js +1 -0
  288. package/dist/esm/sdk/sdkSentEvents-_RGAEeld.js +1 -0
  289. package/dist/esm/sdk/secp256k1-B_6W9QDJ.js +1 -0
  290. package/dist/esm/sdk/secureRandomId-CTdlJ5Mx.js +1 -0
  291. package/dist/esm/sdk/sessionPolicy-CNVK7nJ6.js +1 -0
  292. package/dist/esm/sdk/shared-j_KsFbCT.js +1 -0
  293. package/dist/esm/sdk/signEvmFamily-CcLVBm0f.js +1 -0
  294. package/dist/esm/sdk/signEvmFamilyWithUiConfirmForTempo-DgTbh6jX.js +1 -0
  295. package/dist/esm/sdk/signEvmWithUiConfirm-ChreN7aZ.js +1 -0
  296. package/dist/esm/sdk/signNear-mWbTE2Dl.js +1 -0
  297. package/dist/esm/sdk/signatureUses-CQkkUcwT.js +1 -0
  298. package/dist/esm/sdk/signerDomain-BhUTzDmF.js +1 -0
  299. package/dist/esm/sdk/signerLoader-By0IY24G.js +1 -0
  300. package/dist/esm/sdk/signerSlot-BQ1g5JNV.js +1 -0
  301. package/dist/esm/sdk/signingFlow-LUWrZi2d.js +2 -0
  302. package/dist/esm/sdk/signingSessionSeal-Mr2Xp44o.js +1 -0
  303. package/dist/esm/sdk/surface-measurement-reporter-OICExWKE.js +1 -0
  304. package/dist/esm/sdk/trace-M34pNGuF.js +1 -0
  305. package/dist/esm/sdk/transaction-activity-BbDod7ji.js +1 -0
  306. package/dist/esm/sdk/transactionReview-CBE5oH4c.js +1 -0
  307. package/dist/esm/sdk/transactionReviewAdmission-0ZgWs6q3.js +1 -0
  308. package/dist/esm/sdk/transactionState-9d7f3xVj.js +1 -0
  309. package/dist/esm/sdk/tx-confirm-ui.js +12 -158
  310. package/dist/esm/sdk/types-M7vxrYtJ.js +1 -0
  311. package/dist/esm/sdk/validation-dC1-_uyG.js +1 -0
  312. package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -13
  313. package/dist/esm/sdk/wallet-iframe-host-full.js +1 -6
  314. package/dist/esm/sdk/wallet-iframe-host-near.js +1 -13
  315. package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -4
  316. package/dist/esm/sdk/wallet-recovery-CcDZ1hMH.js +1 -0
  317. package/dist/esm/sdk/wallet-ui.css +1 -5874
  318. package/dist/esm/sdk/walletAuthority-CoWSeqvQ.js +1 -0
  319. package/dist/esm/sdk/walletCustodyEcdsaContinuity-B7xi7nwh.js +1 -0
  320. package/dist/esm/sdk/walletIframeIdentity-C0b0XMQF.js +1 -0
  321. package/dist/esm/sdk/walletRecoveryCommit-ljxVeo-d.js +1 -0
  322. package/dist/esm/sdk/walletRecoveryRotate-HztDcDaY.js +1 -0
  323. package/dist/esm/sdk/warmSessionHydration-BPGM0YRU.js +1 -0
  324. package/dist/esm/sdk/webauthnP256-qu06GNFm.js +1 -0
  325. package/dist/esm/sdk/webauthnPromptCoordinator-DO-qfECu.js +1 -0
  326. package/dist/esm/shared-ts/src/device-linking/parsers.js +41 -1
  327. package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +1 -1
  328. package/dist/esm/shared-ts/src/near/actions.js +10 -1
  329. package/dist/esm/shared-ts/src/near/nearClient.js +0 -2
  330. package/dist/esm/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.js +1 -1
  331. package/dist/esm/shared-ts/src/signing-lanes/index.js +1 -4
  332. package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +0 -1
  333. package/dist/esm/shared-ts/src/signing-lanes/participantDigest.js +0 -1
  334. package/dist/esm/shared-ts/src/signing-lanes/participants.js +1 -1
  335. package/dist/esm/shared-ts/src/signing-lanes/recordParsers.js +1 -1
  336. package/dist/esm/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js +0 -1
  337. package/dist/esm/shared-ts/src/threshold/participants.js +0 -1
  338. package/dist/esm/shared-ts/src/threshold/signingRootScope.js +0 -1
  339. package/dist/esm/shared-ts/src/utils/domainIds.js +1 -7
  340. package/dist/esm/shared-ts/src/utils/ecdsaKeyFactsInventory.js +0 -1
  341. package/dist/esm/shared-ts/src/utils/encoders.js +1 -1
  342. package/dist/esm/shared-ts/src/utils/errors.js +0 -1
  343. package/dist/esm/shared-ts/src/utils/index.js +4 -5
  344. package/dist/esm/shared-ts/src/utils/registrationEstablishedSession.js +1 -1
  345. package/dist/esm/shared-ts/src/utils/registrationIds.js +1 -5
  346. package/dist/esm/shared-ts/src/utils/registrationIntent.js +0 -1
  347. package/dist/esm/shared-ts/src/utils/registrationSetupOperation.js +12 -0
  348. package/dist/esm/shared-ts/src/utils/registrationSignerPlan.js +1 -1
  349. package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -2
  350. package/dist/esm/shared-ts/src/utils/validation.js +0 -1
  351. package/dist/esm/shared-ts/src/utils/walletAuthAuthority.js +0 -1
  352. package/dist/esm/shared-ts/src/utils/walletCapabilityBindings.js +10 -1
  353. package/dist/esm/shared-ts/src/utils/walletManagementProtocol.js +6 -0
  354. package/dist/esm/shared-ts/src/wallet-recovery/index.js +1 -1
  355. package/dist/esm/shared-ts/src/wallet-recovery/recoveryCodeLocator.js +0 -1
  356. package/dist/esm/shared-ts/src/wallet-recovery/recoveryKeyId.js +0 -2
  357. package/dist/esm/theme/base-styles.js +11 -11
  358. package/dist/esm/utils/deviceDetection.js +16 -1
  359. package/dist/esm/utils/qrScanner.js +288 -0
  360. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.d.ts +12 -753
  361. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +126 -3701
  362. package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
  363. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client.d.ts +0 -42
  364. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client.js +2 -106
  365. package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
  366. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client.d.ts +3 -158
  367. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client.js +2 -452
  368. package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
  369. package/dist/public/headers.manifest.json +1 -1
  370. package/dist/public/sdk/ConfirmationDrawer-DrsREojk.js +1 -0
  371. package/dist/public/sdk/EvmClient-DoxytQaJ.js +1 -0
  372. package/dist/public/sdk/NearClient-vJ65Wjrq.js +1 -0
  373. package/dist/public/sdk/NonceCoordinator-BBeadCSq.js +1 -0
  374. package/dist/public/sdk/accountIds-C3Ihsd2c.js +1 -0
  375. package/dist/public/sdk/accountLifecycle-EyfYPnuT.js +1 -0
  376. package/dist/public/sdk/actions-DZLxCcrU.js +1 -0
  377. package/dist/public/sdk/adapters-DtAyuoiA.js +2 -0
  378. package/dist/public/sdk/base-Xtd32asf.js +1 -0
  379. package/dist/public/sdk/base64-ojm5DKcF.js +1 -0
  380. package/dist/public/sdk/browser-CsOGMbMy.js +8 -0
  381. package/dist/public/sdk/bytes-t5S5mkat.js +1 -0
  382. package/dist/public/sdk/canonicalPrimitives-MPGET2cl.js +1 -0
  383. package/dist/public/sdk/canonicalSignerErrorCode-C0hh_SVi.js +1 -0
  384. package/dist/public/sdk/capabilityKinds-XaXXiD2B.js +1 -0
  385. package/dist/public/sdk/chains-yAls2d9X.js +1 -0
  386. package/dist/public/sdk/challengeDelivery-cAsaUC6U.js +1 -0
  387. package/dist/public/sdk/chunk-dVx5-UGu.js +1 -0
  388. package/dist/public/sdk/configHelpers-CseiVoZD.js +1 -0
  389. package/dist/public/sdk/csp-stylesheet-B1fAhrGB.js +2 -0
  390. package/dist/public/sdk/defaultConfigs-CWpApkMq.js +1 -0
  391. package/dist/public/sdk/display-jK7_hYho.js +1 -0
  392. package/dist/public/sdk/domainIds-GDzjOs6i.js +1 -0
  393. package/dist/public/sdk/ecdsaCapabilityManifest-CHFu-QrV.js +1 -0
  394. package/dist/public/sdk/ecdsaChainTarget-CRcRR78w.js +1 -0
  395. package/dist/public/sdk/ecdsaPresignLifecycle-CQnCxSlq.js +1 -0
  396. package/dist/public/sdk/ecdsaPresignPoolIdentity-Ci-ovDlv.js +1 -0
  397. package/dist/public/sdk/ecdsaWalletRecords-Cm1DdexN.js +1 -0
  398. package/dist/public/sdk/enrichDisplayModelWithAbi-CR-4ebuU.js +1 -0
  399. package/dist/public/sdk/enrichDisplayModelWithAbi-CwHKFqF4.js +569 -0
  400. package/dist/public/sdk/errors-DfbnsXjO.js +1 -0
  401. package/dist/public/sdk/events-BJyVcnsn.js +1 -0
  402. package/dist/public/sdk/evmCryptoWasm-CwEXiLrC.js +1 -0
  403. package/dist/public/sdk/evmFamilyEcdsaIdentity-Br3iFdQx.js +1 -0
  404. package/dist/public/sdk/exactSessionState-CjD8gekO.js +210 -0
  405. package/dist/public/sdk/exactSigningLaneIdentity-olheZx_n.js +1 -0
  406. package/dist/public/sdk/executeWorkerOperation-CrFf3FkL.js +1 -0
  407. package/dist/public/sdk/export-viewer-host-jo7h_0wl.js +1 -0
  408. package/dist/public/sdk/helpers-D4QckQhq.js +1 -0
  409. package/dist/public/sdk/host-BAqOYnju.js +1 -0
  410. package/dist/public/sdk/intentDigest-CB6zy3lN.js +1 -0
  411. package/dist/public/sdk/jsonRpc-C85RYR0A.js +1 -0
  412. package/dist/public/sdk/jsxRuntime.module-CoHsKD_3.js +1 -0
  413. package/dist/public/sdk/keccak-zexutGfG.js +1 -0
  414. package/dist/public/sdk/keyMaterialBrands-uVZHfAh3.js +1 -0
  415. package/dist/public/sdk/localOnly-DBQRG6Qh.js +1 -0
  416. package/dist/public/sdk/messages-Cv2j4SKI.js +1 -0
  417. package/dist/public/sdk/mountExportPrivateKeySurface-G7Z_9JMQ.js +1 -0
  418. package/dist/public/sdk/mountRecoveryCodeBackupSurface-BBCTaQsu.js +2 -0
  419. package/dist/public/sdk/nearEd25519YaoMaterialActivation-DQIw8ho3.js +1 -0
  420. package/dist/public/sdk/nearEd25519YaoSigningPreparation-Bp_CvWRz.js +1 -0
  421. package/dist/public/sdk/nearRpcResults--cBcfmp4.js +1 -0
  422. package/dist/public/sdk/nonceLaneKeys-BBYi4g51.js +1 -0
  423. package/dist/public/sdk/normalization-BGPR6osg.js +1 -0
  424. package/dist/public/sdk/operationFingerprint-5-wH2Ht8.js +1 -0
  425. package/dist/public/sdk/operationFingerprint-DtQb0pdp.js +1 -0
  426. package/dist/public/sdk/passkey-custody-LP4UTFbn.js +1 -0
  427. package/dist/public/sdk/pendingWalletRecoveryCodeBackup-BNk4ebsY.js +1 -0
  428. package/dist/public/sdk/prfCache-Mbo7_USg.js +1 -0
  429. package/dist/public/sdk/profileAccountProjection-DHCaMtOu.js +1 -0
  430. package/dist/public/sdk/promptText-s8TQ6ckX.js +1 -0
  431. package/dist/public/sdk/recovery-entrypoint-DkT8sFO5.js +1 -0
  432. package/dist/public/sdk/registration-Btozh7uh.js +1 -0
  433. package/dist/public/sdk/registration-CSAG_h4Y.js +1 -0
  434. package/dist/public/sdk/registrationAccounts-DIeEVy6W.js +1 -0
  435. package/dist/public/sdk/registrationIds-BIel5S0i.js +1 -0
  436. package/dist/public/sdk/registrationIntent-DV1GYZ3K.js +1 -0
  437. package/dist/public/sdk/registrationPreparationPreload-vOCqNuG4.js +1 -0
  438. package/dist/public/sdk/registrationSignerPlan-FzD3TwxB.js +1 -0
  439. package/dist/public/sdk/relayerHttp-DaPeS929.js +1 -0
  440. package/dist/public/sdk/routePlan-B_KJaPtm.js +1 -0
  441. package/dist/public/sdk/router-Dd3fFHk3.js +1 -0
  442. package/dist/public/sdk/routerAbNormalSigning-D_fHjq5l.js +1 -0
  443. package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
  444. package/dist/public/sdk/runtime-auth-B2M91rSx.js +1 -0
  445. package/dist/public/sdk/runtime-device-link-ojjPSRaG.js +1 -0
  446. package/dist/public/sdk/runtime-ecdsa-tempo-CE4JLgmn.js +1 -0
  447. package/dist/public/sdk/runtime-email-otp-DDwtKVAe.js +1 -0
  448. package/dist/public/sdk/runtime-export-JXYk8sQ-.js +1 -0
  449. package/dist/public/sdk/runtime-near-BB8AG6dV.js +1 -0
  450. package/dist/public/sdk/runtime-preferences-DKFZYccW.js +1 -0
  451. package/dist/public/sdk/runtime-recovery-C_XjsDBg.js +1 -0
  452. package/dist/public/sdk/runtime-recovery-codes-CWp839mH.js +1 -0
  453. package/dist/public/sdk/runtimeContext-BpObgzbj.js +6 -0
  454. package/dist/public/sdk/runtimeLoader-DjgBf_yF.js +1 -0
  455. package/dist/public/sdk/sdkSentEvents-_RGAEeld.js +1 -0
  456. package/dist/public/sdk/secp256k1-B_6W9QDJ.js +1 -0
  457. package/dist/public/sdk/secureRandomId-CTdlJ5Mx.js +1 -0
  458. package/dist/public/sdk/sessionPolicy-CNVK7nJ6.js +1 -0
  459. package/dist/public/sdk/shared-j_KsFbCT.js +1 -0
  460. package/dist/public/sdk/signEvmFamily-CcLVBm0f.js +1 -0
  461. package/dist/public/sdk/signEvmFamilyWithUiConfirmForTempo-DgTbh6jX.js +1 -0
  462. package/dist/public/sdk/signEvmWithUiConfirm-ChreN7aZ.js +1 -0
  463. package/dist/public/sdk/signNear-mWbTE2Dl.js +1 -0
  464. package/dist/public/sdk/signatureUses-CQkkUcwT.js +1 -0
  465. package/dist/public/sdk/signerDomain-BhUTzDmF.js +1 -0
  466. package/dist/public/sdk/signerLoader-By0IY24G.js +1 -0
  467. package/dist/public/sdk/signerSlot-BQ1g5JNV.js +1 -0
  468. package/dist/public/sdk/signingFlow-LUWrZi2d.js +2 -0
  469. package/dist/public/sdk/signingSessionSeal-Mr2Xp44o.js +1 -0
  470. package/dist/public/sdk/surface-measurement-reporter-OICExWKE.js +1 -0
  471. package/dist/public/sdk/trace-M34pNGuF.js +1 -0
  472. package/dist/public/sdk/transaction-activity-BbDod7ji.js +1 -0
  473. package/dist/public/sdk/transactionReview-CBE5oH4c.js +1 -0
  474. package/dist/public/sdk/transactionReviewAdmission-0ZgWs6q3.js +1 -0
  475. package/dist/public/sdk/transactionState-9d7f3xVj.js +1 -0
  476. package/dist/public/sdk/tx-confirm-ui.js +12 -158
  477. package/dist/public/sdk/types-M7vxrYtJ.js +1 -0
  478. package/dist/public/sdk/validation-dC1-_uyG.js +1 -0
  479. package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -13
  480. package/dist/public/sdk/wallet-iframe-host-full.js +1 -6
  481. package/dist/public/sdk/wallet-iframe-host-near.js +1 -13
  482. package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -4
  483. package/dist/public/sdk/wallet-recovery-CcDZ1hMH.js +1 -0
  484. package/dist/public/sdk/wallet-ui.css +1 -5874
  485. package/dist/public/sdk/walletAuthority-CoWSeqvQ.js +1 -0
  486. package/dist/public/sdk/walletCustodyEcdsaContinuity-B7xi7nwh.js +1 -0
  487. package/dist/public/sdk/walletIframeIdentity-C0b0XMQF.js +1 -0
  488. package/dist/public/sdk/walletRecoveryCommit-ljxVeo-d.js +1 -0
  489. package/dist/public/sdk/walletRecoveryRotate-HztDcDaY.js +1 -0
  490. package/dist/public/sdk/warmSessionHydration-BPGM0YRU.js +1 -0
  491. package/dist/public/sdk/webauthnP256-qu06GNFm.js +1 -0
  492. package/dist/public/sdk/webauthnPromptCoordinator-DO-qfECu.js +1 -0
  493. package/dist/public/sdk/workers/device-linking-key.worker.js +387 -1952
  494. package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +1523 -2668
  495. package/dist/public/sdk/workers/ecdsa-online-client.worker.js +1 -273
  496. package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +1 -273
  497. package/dist/public/sdk/workers/email-otp.worker.js +228 -2103
  498. package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
  499. package/dist/public/sdk/workers/evm-crypto.worker.js +0 -188
  500. package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
  501. package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
  502. package/dist/public/sdk/workers/near-signer.worker.js +16 -718
  503. package/dist/public/sdk/workers/near_signer.wasm +0 -0
  504. package/dist/public/sdk/workers/passkey-confirm.worker.js +0 -134
  505. package/dist/public/sdk/workers/passkey-mpc-export.worker.js +149 -506
  506. package/dist/public/sdk/workers/passkey-mpc-session.worker.js +0 -134
  507. package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  508. package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  509. package/dist/public/sdk/workers/shamir3pass.worker.js +0 -134
  510. package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
  511. package/dist/public/sdk/workers/tempo-signer.worker.js +0 -134
  512. package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
  513. package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
  514. package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +135 -1635
  515. package/dist/public/sdk/workers/wallet_custody_ceremony.js +0 -14
  516. package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
  517. package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
  518. package/dist/public/wallet-assets.manifest.json +234 -258
  519. package/dist/public/wallet-service/index.html +4 -4
  520. package/dist/types/shared-ts/src/authorization/capabilityKinds.d.ts +0 -4
  521. package/dist/types/shared-ts/src/device-linking/contracts.d.ts +1 -0
  522. package/dist/types/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.d.ts +0 -2
  523. package/dist/types/shared-ts/src/signing-lanes/execution.d.ts +0 -11
  524. package/dist/types/shared-ts/src/signing-lanes/ids.d.ts +2 -7
  525. package/dist/types/shared-ts/src/signing-lanes/index.d.ts +0 -4
  526. package/dist/types/shared-ts/src/signing-lanes/ownerContinuity.d.ts +0 -1
  527. package/dist/types/shared-ts/src/signing-lanes/participantDigest.d.ts +0 -18
  528. package/dist/types/shared-ts/src/signing-lanes/participants.d.ts +6 -35
  529. package/dist/types/shared-ts/src/signing-lanes/rotation.d.ts +6 -843
  530. package/dist/types/shared-ts/src/threshold/keyMaterialBrands.d.ts +0 -10
  531. package/dist/types/shared-ts/src/threshold/participants.d.ts +1 -1
  532. package/dist/types/shared-ts/src/utils/addWalletAuthMethod.d.ts +1 -133
  533. package/dist/types/shared-ts/src/utils/addWalletAuthMethod.typecheck.d.ts +4 -18
  534. package/dist/types/shared-ts/src/utils/domainIds.d.ts +0 -12
  535. package/dist/types/shared-ts/src/utils/errors.d.ts +0 -4
  536. package/dist/types/shared-ts/src/utils/near.d.ts +0 -20
  537. package/dist/types/shared-ts/src/utils/normalize.d.ts +0 -2
  538. package/dist/types/shared-ts/src/utils/registrationSetupOperation.d.ts +3 -0
  539. package/dist/types/shared-ts/src/utils/validation.d.ts +1 -3
  540. package/dist/types/shared-ts/src/utils/walletCapabilityBindings.d.ts +0 -1
  541. package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +3 -0
  542. package/dist/types/shared-ts/src/utils/wireSchema.d.ts +0 -2
  543. package/dist/types/shared-ts/src/wallet-recovery/backupAcknowledgement.d.ts +0 -1
  544. package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeReservation.d.ts +1 -10
  545. package/dist/types/shared-ts/src/wallet-recovery/recoveryCodes.d.ts +1 -3
  546. package/dist/types/shared-ts/src/wallet-recovery/recoveryKeyId.d.ts +5 -21
  547. package/dist/types/wallet/src/SeamsWeb/operations/auth/walletUnlockEcdsaSubject.d.ts +1 -1
  548. package/dist/types/wallet/src/SeamsWeb/operations/auth/walletUnlockSubject.d.ts +0 -3
  549. package/dist/types/wallet/src/SeamsWeb/operations/authMethods/emailOtp/challenge.d.ts +0 -4
  550. package/dist/types/wallet/src/SeamsWeb/operations/devices/deviceLinkingResume.d.ts +0 -1
  551. package/dist/types/wallet/src/SeamsWeb/operations/devices/linkDeviceFlow.d.ts +2 -0
  552. package/dist/types/wallet/src/SeamsWeb/operations/registration/pendingRegistrationRecovery.d.ts +0 -10
  553. package/dist/types/wallet/src/SeamsWeb/operations/session/thresholdEcdsaProvisioning.d.ts +1 -2
  554. package/dist/types/wallet/src/SeamsWeb/signingSurface/ports.d.ts +0 -2
  555. package/dist/types/wallet/src/SeamsWeb/signingSurface/types.d.ts +1 -1
  556. package/dist/types/wallet/src/SeamsWeb/walletIframe/client/surface/domain.d.ts +0 -8
  557. package/dist/types/wallet/src/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.d.ts +1 -2
  558. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +9 -0
  559. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/hostedWalletSeamsSession.d.ts +0 -1
  560. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.d.ts +17 -0
  561. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +11 -3
  562. package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/icons.d.ts +15 -0
  563. package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/exactSessionReconciliation.d.ts +3 -3
  564. package/dist/types/wallet/src/advanced.d.ts +1 -1
  565. package/dist/types/wallet/src/core/browser/walletIframe/events.d.ts +0 -2
  566. package/dist/types/wallet/src/core/indexedDB/index.d.ts +3 -5
  567. package/dist/types/wallet/src/core/indexedDB/passkeyClientDB.types.d.ts +0 -30
  568. package/dist/types/wallet/src/core/indexedDB/pendingWalletRecoveryCommit.d.ts +1 -4
  569. package/dist/types/wallet/src/core/indexedDB/schemaNames.d.ts +0 -22
  570. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.d.ts +1 -1
  571. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.d.ts +1 -1
  572. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.d.ts +0 -1
  573. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/registrationSetup.d.ts +42 -0
  574. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/signingSessionSeals.d.ts +1 -5
  575. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.d.ts +5 -1
  576. package/dist/types/wallet/src/core/indexedDB/unifiedIndexedDBManager.d.ts +1 -0
  577. package/dist/types/wallet/src/core/platform/browser/createBrowserPlatformRuntime.d.ts +1 -6
  578. package/dist/types/wallet/src/core/platform/ecdsaRoleLocalRecords.d.ts +0 -15
  579. package/dist/types/wallet/src/core/platform/index.d.ts +4 -4
  580. package/dist/types/wallet/src/core/platform/ports.d.ts +1 -51
  581. package/dist/types/wallet/src/core/platform/runtime.d.ts +0 -2
  582. package/dist/types/wallet/src/core/platform/secretSources.d.ts +0 -29
  583. package/dist/types/wallet/src/core/rpcClients/near/NearClient.d.ts +1 -1
  584. package/dist/types/wallet/src/core/rpcClients/relayer/passkeyCustodyEnvelope.d.ts +0 -6
  585. package/dist/types/wallet/src/core/rpcClients/relayer/thresholdEcdsa.d.ts +0 -1
  586. package/dist/types/wallet/src/core/rpcClients/relayer/walletRegistration.d.ts +2 -19
  587. package/dist/types/wallet/src/core/signingEngine/assembly/ports/shared.d.ts +0 -1
  588. package/dist/types/wallet/src/core/signingEngine/assembly/ports/warmSigning.d.ts +0 -2
  589. package/dist/types/wallet/src/core/signingEngine/assembly/warmup.d.ts +0 -1
  590. package/dist/types/wallet/src/core/signingEngine/chains/near/nearSignerWasm.d.ts +0 -10
  591. package/dist/types/wallet/src/core/signingEngine/flows/recovery/keyExportConfirmation.d.ts +0 -15
  592. package/dist/types/wallet/src/core/signingEngine/flows/registration/accountLifecycle.d.ts +1 -11
  593. package/dist/types/wallet/src/core/signingEngine/flows/registration/public.d.ts +1 -9
  594. package/dist/types/wallet/src/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.d.ts +0 -2
  595. package/dist/types/wallet/src/core/signingEngine/flows/shared/signingStateMachine.d.ts +0 -6
  596. package/dist/types/wallet/src/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.d.ts +2 -10
  597. package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/ed25519YaoCapabilityResolution.d.ts +1 -4
  598. package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.d.ts +0 -5
  599. package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/signingMaterials.d.ts +0 -4
  600. package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.d.ts +0 -9
  601. package/dist/types/wallet/src/core/signingEngine/interfaces/index.d.ts +0 -1
  602. package/dist/types/wallet/src/core/signingEngine/nonce/NonceCoordinator.d.ts +1 -1
  603. package/dist/types/wallet/src/core/signingEngine/nonce/nonceTypes.d.ts +0 -9
  604. package/dist/types/wallet/src/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.d.ts +0 -3
  605. package/dist/types/wallet/src/core/signingEngine/session/authority/authorityOperationResolver.d.ts +1 -24
  606. package/dist/types/wallet/src/core/signingEngine/session/availability/readiness.d.ts +0 -2
  607. package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ecdsaLogin.d.ts +0 -3
  608. package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ecdsaRecovery.d.ts +0 -5
  609. package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ed25519ExportContext.d.ts +0 -1
  610. package/dist/types/wallet/src/core/signingEngine/session/emailOtp/secretEscrow.d.ts +0 -1
  611. package/dist/types/wallet/src/core/signingEngine/session/identity/clientSessionPersistenceState.d.ts +0 -6
  612. package/dist/types/wallet/src/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.d.ts +0 -3
  613. package/dist/types/wallet/src/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.d.ts +0 -3
  614. package/dist/types/wallet/src/core/signingEngine/session/identity/exactSigningLaneIdentity.d.ts +0 -3
  615. package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionCredential.d.ts +0 -3
  616. package/dist/types/wallet/src/core/signingEngine/session/identity/laneIdentity.d.ts +0 -6
  617. package/dist/types/wallet/src/core/signingEngine/session/identity/walletUnlockSubject.d.ts +0 -8
  618. package/dist/types/wallet/src/core/signingEngine/session/keyMaterialBrands.d.ts +1 -4
  619. package/dist/types/wallet/src/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.d.ts +1 -1
  620. package/dist/types/wallet/src/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.d.ts +0 -3
  621. package/dist/types/wallet/src/core/signingEngine/session/operationState/authorizationAdmission.d.ts +1 -1
  622. package/dist/types/wallet/src/core/signingEngine/session/operationState/preparedOperation.d.ts +0 -2
  623. package/dist/types/wallet/src/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.d.ts +0 -1
  624. package/dist/types/wallet/src/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.d.ts +0 -2
  625. package/dist/types/wallet/src/core/signingEngine/session/persistence/ecdsaRoleLocalRecords.d.ts +1 -10
  626. package/dist/types/wallet/src/core/signingEngine/session/persistence/sealedSessionRecords.d.ts +2 -2
  627. package/dist/types/wallet/src/core/signingEngine/session/persistence/sealedSessionTransportAuth.d.ts +0 -5
  628. package/dist/types/wallet/src/core/signingEngine/session/postconditions/runtimePostconditions.d.ts +0 -2
  629. package/dist/types/wallet/src/core/signingEngine/session/routerAbSigningWalletSession.d.ts +1 -1
  630. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.d.ts +0 -105
  631. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/public.d.ts +0 -1
  632. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.d.ts +0 -12
  633. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/transitions.d.ts +0 -2
  634. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/types.typecheck.d.ts +1 -10
  635. package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/methodRunners.d.ts +1 -5
  636. package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.d.ts +1 -2
  637. package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.d.ts +0 -1
  638. package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/requireStepUpAuth.d.ts +1 -19
  639. package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/types.d.ts +0 -10
  640. package/dist/types/wallet/src/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.d.ts +1 -15
  641. package/dist/types/wallet/src/core/signingEngine/threshold/ecdsa/activation.d.ts +0 -4
  642. package/dist/types/wallet/src/core/signingEngine/threshold/ecdsa/bootstrapSession.d.ts +0 -4
  643. package/dist/types/wallet/src/core/signingEngine/threshold/ed25519/connectSession.d.ts +0 -1
  644. package/dist/types/wallet/src/core/signingEngine/threshold/ed25519/yaoClient.d.ts +1 -8
  645. package/dist/types/wallet/src/core/signingEngine/uiConfirm/handlers/flows/requestRegistrationCredentialConfirmation.d.ts +1 -4
  646. package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.d.ts +0 -1
  647. package/dist/types/wallet/src/core/signingEngine/walletCustody/emailOtpLink.d.ts +0 -1
  648. package/dist/types/wallet/src/core/signingEngine/walletCustody/openCustodyCache.d.ts +0 -3
  649. package/dist/types/wallet/src/core/signingEngine/walletCustody/passkeyLink.d.ts +0 -3
  650. package/dist/types/wallet/src/core/signingEngine/walletCustody/registrationCeremony.d.ts +0 -1
  651. package/dist/types/wallet/src/core/signingEngine/webauthnAuth/walletOriginWebAuthn.d.ts +8 -0
  652. package/dist/types/wallet/src/core/signingEngine/workerManager/SignerWorkerManager.d.ts +0 -2
  653. package/dist/types/wallet/src/core/signingEngine/workerManager/ecdsaClientWorkerChannels.d.ts +0 -8
  654. package/dist/types/wallet/src/core/signingEngine/workerManager/validation.d.ts +1 -1
  655. package/dist/types/wallet/src/core/signingEngine/workerManager/workerTypes.d.ts +6 -109
  656. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/device-linking-key/requests.d.ts +0 -5
  657. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/crypto.d.ts +0 -1
  658. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/custodyRestore.d.ts +0 -8
  659. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/otpVerification.d.ts +0 -1
  660. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/payloadParsing.d.ts +0 -2
  661. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/unlock.d.ts +0 -1
  662. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/near-signer.worker.d.ts +3 -31
  663. package/dist/types/wallet/src/core/types/accountIds.d.ts +1 -1
  664. package/dist/types/wallet/src/core/types/index.d.ts +0 -18
  665. package/dist/types/wallet/src/core/types/sdkSentEvents.d.ts +1 -2
  666. package/dist/types/wallet/src/core/types/secure-confirm-worker.d.ts +0 -5
  667. package/dist/types/wallet/src/core/types/signer-worker.d.ts +75 -134
  668. package/dist/types/wallet/src/react/components/AccountMenuButton/Toggle.d.ts +0 -15
  669. package/dist/types/wallet/src/react/components/theme/design-tokens.d.ts +0 -19
  670. package/dist/types/wallet/src/utils/qrScanner.d.ts +1 -21
  671. package/dist/workers/device-linking-key.worker.js +387 -1952
  672. package/dist/workers/ecdsa-derivation-client.worker.js +1523 -2668
  673. package/dist/workers/ecdsa-online-client.worker.js +1 -273
  674. package/dist/workers/ecdsa-presign-client.worker.js +1 -273
  675. package/dist/workers/email-otp.worker.js +228 -2103
  676. package/dist/workers/email_otp_runtime_bg.wasm +0 -0
  677. package/dist/workers/evm-crypto.worker.js +0 -188
  678. package/dist/workers/evm_crypto.wasm +0 -0
  679. package/dist/workers/evm_crypto_bg.wasm +0 -0
  680. package/dist/workers/near-signer.worker.js +16 -718
  681. package/dist/workers/near_signer.wasm +0 -0
  682. package/dist/workers/passkey-confirm.worker.js +0 -134
  683. package/dist/workers/passkey-mpc-export.worker.js +149 -506
  684. package/dist/workers/passkey-mpc-session.worker.js +0 -134
  685. package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
  686. package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
  687. package/dist/workers/shamir3pass.worker.js +0 -134
  688. package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
  689. package/dist/workers/tempo-signer.worker.js +0 -134
  690. package/dist/workers/tempo_signer.wasm +0 -0
  691. package/dist/workers/tempo_signer_bg.wasm +0 -0
  692. package/dist/workers/wallet-custody-ceremony.worker.js +135 -1635
  693. package/dist/workers/wallet_custody_ceremony.js +0 -14
  694. package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
  695. package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
  696. package/package.json +1 -14
  697. package/dist/esm/SeamsWeb/walletIframe/client/transport/webauthn-bridge.js +0 -99
  698. package/dist/esm/components/AccountMenuButton/AccountsSection.css +0 -81
  699. package/dist/esm/components/AccountMenuButton/ExportKeysSection.css +0 -96
  700. package/dist/esm/components/AccountMenuButton/LinkedDevicesModal.css +0 -612
  701. package/dist/esm/components/AccountMenuButton/MenuItem.css +0 -198
  702. package/dist/esm/components/AccountMenuButton/ProfileDropdown.css +0 -80
  703. package/dist/esm/components/AccountMenuButton/TransactionSettingsSection.css +0 -107
  704. package/dist/esm/components/AccountMenuButton/UserAccountButton.css +0 -177
  705. package/dist/esm/components/AccountMenuButton/WalletSettingsLayout.css +0 -456
  706. package/dist/esm/components/AccountMenuButton/Web3AuthProfileButton.css +0 -23
  707. package/dist/esm/components/AccountMenuButton/icons/TouchIcon.css +0 -46
  708. package/dist/esm/components/QRCodeScanner.css +0 -487
  709. package/dist/esm/components/ShowQRCode.css +0 -331
  710. package/dist/esm/core/indexedDB/seamsWalletDB/laneHolderMaterialStore.js +0 -236
  711. package/dist/esm/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.js +0 -171
  712. package/dist/esm/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.js +0 -32
  713. package/dist/esm/plugins/shared-ts/src/utils/base58.js +0 -1
  714. package/dist/esm/plugins/shared-ts/src/utils/near.js +0 -1
  715. package/dist/esm/plugins/shared-ts/src/utils/validation.js +0 -2
  716. package/dist/esm/react/SeamsWeb/SeamsWeb.js +0 -1918
  717. package/dist/esm/react/SeamsWeb/assembly/browserSigningSurfaceAssembly.js +0 -817
  718. package/dist/esm/react/SeamsWeb/assembly/browserWorkerWarmupPolicy.js +0 -31
  719. package/dist/esm/react/SeamsWeb/assembly/configureBrowserIndexedDB.js +0 -10
  720. package/dist/esm/react/SeamsWeb/assembly/createBrowserRecoveryPublicDeps.js +0 -95
  721. package/dist/esm/react/SeamsWeb/assembly/createBrowserSigningRuntime.js +0 -34
  722. package/dist/esm/react/SeamsWeb/assembly/createBrowserSigningStores.js +0 -39
  723. package/dist/esm/react/SeamsWeb/assembly/createBrowserStepUpRuntime.js +0 -34
  724. package/dist/esm/react/SeamsWeb/assembly/createBrowserWarmSessionPublicDeps.js +0 -31
  725. package/dist/esm/react/SeamsWeb/assembly/createWalletIframeOverlayState.js +0 -9
  726. package/dist/esm/react/SeamsWeb/assembly/createWalletIframeRouter.js +0 -44
  727. package/dist/esm/react/SeamsWeb/assembly/initializeBrowserSigningRuntime.js +0 -19
  728. package/dist/esm/react/SeamsWeb/assembly/runtimeConfig.js +0 -12
  729. package/dist/esm/react/SeamsWeb/operations/auth/login.js +0 -4408
  730. package/dist/esm/react/SeamsWeb/operations/auth/scheduleEcdsaSessionPresignaturePrefill.js +0 -41
  731. package/dist/esm/react/SeamsWeb/operations/auth/scheduleLinkedDevicePresignaturePrefill.js +0 -64
  732. package/dist/esm/react/SeamsWeb/operations/auth/walletAuth.js +0 -142
  733. package/dist/esm/react/SeamsWeb/operations/auth/walletUnlockEcdsaSubject.js +0 -33
  734. package/dist/esm/react/SeamsWeb/operations/auth/walletUnlockSubject.js +0 -294
  735. package/dist/esm/react/SeamsWeb/operations/authMethods/addAuthMethodSourceClaim.js +0 -72
  736. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/addEmailOtp.js +0 -191
  737. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/challenge.js +0 -247
  738. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/googleEmailOtpWalletAuthFlow.js +0 -572
  739. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/localEmailOtpProjection.js +0 -69
  740. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/registrationAuthority.js +0 -62
  741. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/registrationOffer.js +0 -69
  742. package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/walletActivation.js +0 -95
  743. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/addPasskey.js +0 -260
  744. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/ecdsaBootstrap.js +0 -17
  745. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/exactPasskeyAuthority.js +0 -34
  746. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/localPasskeyProjection.js +0 -117
  747. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/localUnlock.js +0 -16
  748. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/loginAssertion.js +0 -25
  749. package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/registrationAuthority.js +0 -84
  750. package/dist/esm/react/SeamsWeb/operations/authMethods/revokeAuthMethod.js +0 -205
  751. package/dist/esm/react/SeamsWeb/operations/authMethods/sourcePasskeyProof.js +0 -12
  752. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingAuthorityInstallation.js +0 -444
  753. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingComposition.js +0 -106
  754. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingEd25519ExportRoot.js +0 -194
  755. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingHttpTransport.js +0 -524
  756. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingOwnerTransport.js +0 -135
  757. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingResume.js +0 -215
  758. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingTargetCredential.js +0 -63
  759. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingTargetEd25519ExportRoot.js +0 -61
  760. package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingWorkerChannels.js +0 -337
  761. package/dist/esm/react/SeamsWeb/operations/devices/linkDevice.js +0 -75
  762. package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceFlow.js +0 -1358
  763. package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceFlowSupport.js +0 -143
  764. package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceTargetActivation.js +0 -119
  765. package/dist/esm/react/SeamsWeb/operations/devices/scanDevice.js +0 -384
  766. package/dist/esm/react/SeamsWeb/operations/devices/walletHostComposition.js +0 -130
  767. package/dist/esm/react/SeamsWeb/operations/devices/walletHostOwnerAuthority.js +0 -191
  768. package/dist/esm/react/SeamsWeb/operations/evm/index.js +0 -35
  769. package/dist/esm/react/SeamsWeb/operations/near/actions.js +0 -484
  770. package/dist/esm/react/SeamsWeb/operations/near/commandSubject.js +0 -14
  771. package/dist/esm/react/SeamsWeb/operations/near/delegateAction.js +0 -247
  772. package/dist/esm/react/SeamsWeb/operations/near/index.js +0 -37
  773. package/dist/esm/react/SeamsWeb/operations/near/signNEP413.js +0 -117
  774. package/dist/esm/react/SeamsWeb/operations/near/signingEventHelpers.js +0 -15
  775. package/dist/esm/react/SeamsWeb/operations/recovery/accountSync.js +0 -21
  776. package/dist/esm/react/SeamsWeb/operations/recovery/recoveryWalletBinding.js +0 -43
  777. package/dist/esm/react/SeamsWeb/operations/recovery/syncAccount.js +0 -914
  778. package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryCodeBackup.js +0 -100
  779. package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryCommit.js +0 -477
  780. package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryDurablePayload.js +0 -383
  781. package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryJournal.js +0 -118
  782. package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryRotation.js +0 -214
  783. package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecovery.js +0 -184
  784. package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecoveryUnlock.js +0 -247
  785. package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecoveryValidation.js +0 -134
  786. package/dist/esm/react/SeamsWeb/operations/registration/pendingRegistrationRecovery.js +0 -363
  787. package/dist/esm/react/SeamsWeb/operations/registration/registration.js +0 -3818
  788. package/dist/esm/react/SeamsWeb/operations/registration/registrationEd25519Yao.js +0 -166
  789. package/dist/esm/react/SeamsWeb/operations/registration/registrationSignerSet.js +0 -60
  790. package/dist/esm/react/SeamsWeb/operations/registration/registrationStrictEcdsa.js +0 -343
  791. package/dist/esm/react/SeamsWeb/operations/registration/registrationTerminalCommit.js +0 -296
  792. package/dist/esm/react/SeamsWeb/operations/registration/registrationTiming.js +0 -682
  793. package/dist/esm/react/SeamsWeb/operations/session/thresholdEcdsaProvisioning.js +0 -40
  794. package/dist/esm/react/SeamsWeb/operations/session/thresholdWarmSessionBootstrap.js +0 -20
  795. package/dist/esm/react/SeamsWeb/operations/tempo/executeEvmFamilyTransaction.js +0 -568
  796. package/dist/esm/react/SeamsWeb/operations/tempo/feeTokenPreference.js +0 -67
  797. package/dist/esm/react/SeamsWeb/operations/tempo/index.js +0 -39
  798. package/dist/esm/react/SeamsWeb/publicApi/auth.js +0 -24
  799. package/dist/esm/react/SeamsWeb/publicApi/awaitNearReady.js +0 -72
  800. package/dist/esm/react/SeamsWeb/publicApi/capabilitySelection.js +0 -63
  801. package/dist/esm/react/SeamsWeb/publicApi/chainTargets.js +0 -48
  802. package/dist/esm/react/SeamsWeb/publicApi/createPublicApi.js +0 -133
  803. package/dist/esm/react/SeamsWeb/publicApi/currentWallet.js +0 -46
  804. package/dist/esm/react/SeamsWeb/publicApi/devices.js +0 -83
  805. package/dist/esm/react/SeamsWeb/publicApi/evm.js +0 -103
  806. package/dist/esm/react/SeamsWeb/publicApi/keyExport.js +0 -90
  807. package/dist/esm/react/SeamsWeb/publicApi/near.js +0 -449
  808. package/dist/esm/react/SeamsWeb/publicApi/preferences.js +0 -61
  809. package/dist/esm/react/SeamsWeb/publicApi/recovery.js +0 -19
  810. package/dist/esm/react/SeamsWeb/publicApi/tempo.js +0 -244
  811. package/dist/esm/react/SeamsWeb/publicApi/transactionReview.js +0 -12
  812. package/dist/esm/react/SeamsWeb/publicApi/types.js +0 -10
  813. package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +0 -3917
  814. package/dist/esm/react/SeamsWeb/walletIframe/client/overlay/overlay-controller.js +0 -530
  815. package/dist/esm/react/SeamsWeb/walletIframe/client/overlay/overlay-styles.js +0 -417
  816. package/dist/esm/react/SeamsWeb/walletIframe/client/progress/on-events-progress-bus.js +0 -134
  817. package/dist/esm/react/SeamsWeb/walletIframe/client/router.js +0 -3368
  818. package/dist/esm/react/SeamsWeb/walletIframe/client/surface/domain.js +0 -288
  819. package/dist/esm/react/SeamsWeb/walletIframe/client/surface/geometry.js +0 -128
  820. package/dist/esm/react/SeamsWeb/walletIframe/client/surface/renderer.js +0 -119
  821. package/dist/esm/react/SeamsWeb/walletIframe/client/surface/transactionSurfaceQueue.js +0 -125
  822. package/dist/esm/react/SeamsWeb/walletIframe/client/transactionReviewReservation.js +0 -96
  823. package/dist/esm/react/SeamsWeb/walletIframe/client/transport/IframeTransport.js +0 -252
  824. package/dist/esm/react/SeamsWeb/walletIframe/client/transport/iframe-transport-dom.js +0 -71
  825. package/dist/esm/react/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.js +0 -211
  826. package/dist/esm/react/SeamsWeb/walletIframe/client/transport/webauthn-bridge.js +0 -99
  827. package/dist/esm/react/SeamsWeb/walletIframe/coordinator.js +0 -235
  828. package/dist/esm/react/SeamsWeb/walletIframe/host/restoredSessionPresignaturePrefill.js +0 -29
  829. package/dist/esm/react/SeamsWeb/walletIframe/host/surface-measurement-reporter.js +0 -158
  830. package/dist/esm/react/SeamsWeb/walletIframe/shared/exactSessionState.js +0 -605
  831. package/dist/esm/react/SeamsWeb/walletIframe/shared/is-dev-host.js +0 -11
  832. package/dist/esm/react/SeamsWeb/walletIframe/shared/messages.js +0 -588
  833. package/dist/esm/react/SeamsWeb/walletIframe/shared/transactionReview.js +0 -83
  834. package/dist/esm/react/SeamsWeb/walletIframe/shared/unlockOptions.js +0 -54
  835. package/dist/esm/react/base-styles.js +0 -13
  836. package/dist/esm/react/build-paths.js +0 -109
  837. package/dist/esm/react/config.js +0 -37
  838. package/dist/esm/react/core/accountData/near/accountProjection.js +0 -119
  839. package/dist/esm/react/core/accountData/near/accountRefs.js +0 -21
  840. package/dist/esm/react/core/accountData/near/keyMaterial.js +0 -171
  841. package/dist/esm/react/core/accountData/near/profileId.js +0 -24
  842. package/dist/esm/react/core/browser/walletIframe/csp-stylesheet.js +0 -189
  843. package/dist/esm/react/core/browser/walletIframe/events.js +0 -10
  844. package/dist/esm/react/core/browser/walletIframe/host-mode.js +0 -19
  845. package/dist/esm/react/core/browser/walletIframe/hostVariant.js +0 -16
  846. package/dist/esm/react/core/config/chains.js +0 -90
  847. package/dist/esm/react/core/config/configBuilder.js +0 -231
  848. package/dist/esm/react/core/config/configHelpers.js +0 -183
  849. package/dist/esm/react/core/config/defaultConfigs.js +0 -120
  850. package/dist/esm/react/core/config/defineConfig.js +0 -48
  851. package/dist/esm/react/core/config/managedRuntimeScope.js +0 -16
  852. package/dist/esm/react/core/indexedDB/accountKeyMaterial.js +0 -68
  853. package/dist/esm/react/core/indexedDB/accountSignerLifecycle.js +0 -143
  854. package/dist/esm/react/core/indexedDB/index.js +0 -60
  855. package/dist/esm/react/core/indexedDB/keyMaterialEnvelope.js +0 -69
  856. package/dist/esm/react/core/indexedDB/lastProfileState.js +0 -22
  857. package/dist/esm/react/core/indexedDB/linkedAuthoritySignerMaterial.js +0 -291
  858. package/dist/esm/react/core/indexedDB/nonceLaneCoordinationStore.js +0 -115
  859. package/dist/esm/react/core/indexedDB/normalization.js +0 -24
  860. package/dist/esm/react/core/indexedDB/pendingWalletRecoveryCommit.js +0 -477
  861. package/dist/esm/react/core/indexedDB/pendingWalletRegistrationCommit.js +0 -745
  862. package/dist/esm/react/core/indexedDB/profileAccountProjection.js +0 -70
  863. package/dist/esm/react/core/indexedDB/schemaNames.js +0 -845
  864. package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestLookups.js +0 -209
  865. package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.js +0 -848
  866. package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.js +0 -1215
  867. package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaClientPresignatures.js +0 -235
  868. package/dist/esm/react/core/indexedDB/seamsWalletDB/manager.js +0 -140
  869. package/dist/esm/react/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.js +0 -145
  870. package/dist/esm/react/core/indexedDB/seamsWalletDB/repositories.js +0 -4747
  871. package/dist/esm/react/core/indexedDB/seamsWalletDB/schema.js +0 -23
  872. package/dist/esm/react/core/indexedDB/seamsWalletDB/signingSessionSeals.js +0 -205
  873. package/dist/esm/react/core/indexedDB/seamsWalletDB/walletCustodyEcdsaContinuity.js +0 -198
  874. package/dist/esm/react/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.js +0 -569
  875. package/dist/esm/react/core/indexedDB/singletons.js +0 -7
  876. package/dist/esm/react/core/indexedDB/unifiedIndexedDBManager.js +0 -578
  877. package/dist/esm/react/core/indexedDB/walletCustodyEd25519MaterialRecord.js +0 -60
  878. package/dist/esm/react/core/platform/browser/createBrowserPlatformRuntime.js +0 -552
  879. package/dist/esm/react/core/platform/secretSources.js +0 -111
  880. package/dist/esm/react/core/platform/signerCoreCommandAdapters.js +0 -122
  881. package/dist/esm/react/core/rpcClients/evm/EvmClient.js +0 -549
  882. package/dist/esm/react/core/rpcClients/evm/nonceBackend.js +0 -279
  883. package/dist/esm/react/core/rpcClients/near/NearClient.js +0 -56
  884. package/dist/esm/react/core/rpcClients/near/NearRpcError.js +0 -105
  885. package/dist/esm/react/core/rpcClients/near/rpcCalls.js +0 -376
  886. package/dist/esm/react/core/rpcClients/relayer/ownerWalletExecutionLanePreflight.js +0 -67
  887. package/dist/esm/react/core/rpcClients/relayer/passkeyCustodyEnvelope.js +0 -228
  888. package/dist/esm/react/core/rpcClients/relayer/registrationSignerSetRequest.js +0 -8
  889. package/dist/esm/react/core/rpcClients/relayer/relayerHttp.js +0 -26
  890. package/dist/esm/react/core/rpcClients/relayer/routerAbNormalSigning.js +0 -812
  891. package/dist/esm/react/core/rpcClients/relayer/routerAbNormalSigningValidation.js +0 -23
  892. package/dist/esm/react/core/rpcClients/relayer/sealedRefreshCapabilities.js +0 -148
  893. package/dist/esm/react/core/rpcClients/relayer/thresholdEcdsa.js +0 -237
  894. package/dist/esm/react/core/rpcClients/relayer/walletRecoveryFinalize.js +0 -174
  895. package/dist/esm/react/core/rpcClients/relayer/walletRecoveryGoogleEmailOtp.js +0 -161
  896. package/dist/esm/react/core/rpcClients/relayer/walletRecoveryPrepare.js +0 -295
  897. package/dist/esm/react/core/rpcClients/relayer/walletRecoveryRotate.js +0 -311
  898. package/dist/esm/react/core/rpcClients/relayer/walletRegistration.js +0 -2349
  899. package/dist/esm/react/core/rpcClients/relayer/walletRegistrationTerminalResponse.js +0 -719
  900. package/dist/esm/react/core/rpcClients/relayer/walletSessionAuthorizationStatus.js +0 -214
  901. package/dist/esm/react/core/runtime/createSigningRuntime.js +0 -100
  902. package/dist/esm/react/core/signingEngine/assembly/createManagers.js +0 -80
  903. package/dist/esm/react/core/signingEngine/assembly/createPorts.js +0 -54
  904. package/dist/esm/react/core/signingEngine/assembly/ports/emailOtp.js +0 -30
  905. package/dist/esm/react/core/signingEngine/assembly/ports/evmFamily.js +0 -73
  906. package/dist/esm/react/core/signingEngine/assembly/ports/near.js +0 -21
  907. package/dist/esm/react/core/signingEngine/assembly/ports/recovery.js +0 -75
  908. package/dist/esm/react/core/signingEngine/assembly/ports/registration.js +0 -22
  909. package/dist/esm/react/core/signingEngine/assembly/ports/session.js +0 -25
  910. package/dist/esm/react/core/signingEngine/assembly/ports/shared.js +0 -40
  911. package/dist/esm/react/core/signingEngine/assembly/ports/stepUpRuntime.js +0 -67
  912. package/dist/esm/react/core/signingEngine/assembly/ports/warmSigning.js +0 -92
  913. package/dist/esm/react/core/signingEngine/assembly/warmup.js +0 -68
  914. package/dist/esm/react/core/signingEngine/chains/evm/bytes.js +0 -22
  915. package/dist/esm/react/core/signingEngine/chains/evm/display/calldata.js +0 -25
  916. package/dist/esm/react/core/signingEngine/chains/evm/display/evmTx.js +0 -119
  917. package/dist/esm/react/core/signingEngine/chains/evm/display/functionSelectors.js +0 -72
  918. package/dist/esm/react/core/signingEngine/chains/evm/display/gas.js +0 -19
  919. package/dist/esm/react/core/signingEngine/chains/evm/display/normalization.js +0 -23
  920. package/dist/esm/react/core/signingEngine/chains/evm/evmAdapter.js +0 -44
  921. package/dist/esm/react/core/signingEngine/chains/evm/evmCryptoWasm.js +0 -198
  922. package/dist/esm/react/core/signingEngine/chains/near/display.js +0 -248
  923. package/dist/esm/react/core/signingEngine/chains/near/nearSignerWasm.js +0 -170
  924. package/dist/esm/react/core/signingEngine/chains/near/payloads.js +0 -58
  925. package/dist/esm/react/core/signingEngine/chains/tempo/display.js +0 -130
  926. package/dist/esm/react/core/signingEngine/chains/tempo/feeToken.js +0 -187
  927. package/dist/esm/react/core/signingEngine/chains/tempo/tempoAdapter.js +0 -49
  928. package/dist/esm/react/core/signingEngine/chains/tempo/tempoSignerWasm.js +0 -90
  929. package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaDerivationExport.js +0 -428
  930. package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaExportFlow.js +0 -660
  931. package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaExportMaterial.js +0 -250
  932. package/dist/esm/react/core/signingEngine/flows/recovery/ed25519YaoExportFlow.js +0 -353
  933. package/dist/esm/react/core/signingEngine/flows/recovery/exportKeypairOperation.js +0 -213
  934. package/dist/esm/react/core/signingEngine/flows/recovery/exportLaneSelection.js +0 -283
  935. package/dist/esm/react/core/signingEngine/flows/recovery/keyExportConfirmation.js +0 -325
  936. package/dist/esm/react/core/signingEngine/flows/recovery/keyExportFlow.js +0 -81
  937. package/dist/esm/react/core/signingEngine/flows/recovery/passkeyEd25519YaoRecovery.js +0 -192
  938. package/dist/esm/react/core/signingEngine/flows/recovery/public.js +0 -26
  939. package/dist/esm/react/core/signingEngine/flows/recovery/stepUpAuthorization.js +0 -139
  940. package/dist/esm/react/core/signingEngine/flows/registration/accountLifecycle.js +0 -1098
  941. package/dist/esm/react/core/signingEngine/flows/registration/nearProvisioningRegistry.js +0 -79
  942. package/dist/esm/react/core/signingEngine/flows/registration/public.js +0 -85
  943. package/dist/esm/react/core/signingEngine/flows/registration/services/ecdsaRegistrationSessions.js +0 -77
  944. package/dist/esm/react/core/signingEngine/flows/registration/services/ecdsaWalletRecords.js +0 -15
  945. package/dist/esm/react/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.js +0 -83
  946. package/dist/esm/react/core/signingEngine/flows/registration/services/registrationAccounts.js +0 -30
  947. package/dist/esm/react/core/signingEngine/flows/registration/session.js +0 -24
  948. package/dist/esm/react/core/signingEngine/flows/shared/signingConfirmation.js +0 -194
  949. package/dist/esm/react/core/signingEngine/flows/shared/signingStateMachine.js +0 -485
  950. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/accountAuth.js +0 -12
  951. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/addresses.js +0 -10
  952. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/authPlanning.js +0 -139
  953. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/ecdsaLanes.js +0 -102
  954. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/ecdsaSelection.js +0 -233
  955. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/emailOtpPublic.js +0 -123
  956. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/emailOtpSigningSession.js +0 -227
  957. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/errors.js +0 -127
  958. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/events.js +0 -39
  959. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/evmNonceLifecycle.js +0 -49
  960. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/executorThresholdState.js +0 -22
  961. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/freshAuthRetryPolicy.js +0 -98
  962. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/freshWalletSessionRetry.js +0 -76
  963. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/nonceLifecycleAdapter.js +0 -245
  964. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/nonceResolution.js +0 -91
  965. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/operationIds.js +0 -33
  966. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/preparedSigning.js +0 -376
  967. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.js +0 -191
  968. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/requireEvmFamilyStepUpAuth.js +0 -128
  969. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmFamily.js +0 -510
  970. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmFamilyWithUiConfirmForTempo.js +0 -65
  971. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmWithUiConfirm.js +0 -26
  972. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signatureUses.js +0 -12
  973. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signerLoader.js +0 -25
  974. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/ecdsaDerivationClientSigningMaterialSource.js +0 -82
  975. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/secp256k1.js +0 -182
  976. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/webauthnP256.js +0 -84
  977. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signingFlow.js +0 -633
  978. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signingFlowRuntime.js +0 -392
  979. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/stepUpAuthorization.js +0 -56
  980. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/tempoNonceLifecycle.js +0 -47
  981. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/thresholdAdmission.js +0 -87
  982. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/transactionExecutor.js +0 -140
  983. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/types.js +0 -20
  984. package/dist/esm/react/core/signingEngine/flows/signEvmFamily/webauthnP256KeyRef.js +0 -33
  985. package/dist/esm/react/core/signingEngine/flows/signNear/implicitAccountFunding.js +0 -202
  986. package/dist/esm/react/core/signingEngine/flows/signNear/nearSigningFlow.js +0 -56
  987. package/dist/esm/react/core/signingEngine/flows/signNear/requireNearStepUpAuth.js +0 -102
  988. package/dist/esm/react/core/signingEngine/flows/signNear/shared/confirmationProgress.js +0 -28
  989. package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoCapabilityResolution.js +0 -101
  990. package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +0 -822
  991. package/dist/esm/react/core/signingEngine/flows/signNear/shared/implicitAccountFundingPort.js +0 -24
  992. package/dist/esm/react/core/signingEngine/flows/signNear/shared/operationStepUpPreparation.js +0 -68
  993. package/dist/esm/react/core/signingEngine/flows/signNear/shared/signatureOnlySigning.js +0 -343
  994. package/dist/esm/react/core/signingEngine/flows/signNear/shared/signingMaterials.js +0 -25
  995. package/dist/esm/react/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.js +0 -138
  996. package/dist/esm/react/core/signingEngine/flows/signNear/signDelegate.js +0 -290
  997. package/dist/esm/react/core/signingEngine/flows/signNear/signNear.js +0 -1238
  998. package/dist/esm/react/core/signingEngine/flows/signNear/signNep413.js +0 -144
  999. package/dist/esm/react/core/signingEngine/flows/signNear/signTransactions.js +0 -897
  1000. package/dist/esm/react/core/signingEngine/flows/signNear/signatureUses.js +0 -12
  1001. package/dist/esm/react/core/signingEngine/flows/signNear/stepUpAuthorization.js +0 -42
  1002. package/dist/esm/react/core/signingEngine/interfaces/accountAuthMetadata.js +0 -14
  1003. package/dist/esm/react/core/signingEngine/interfaces/ecdsaChainTarget.js +0 -142
  1004. package/dist/esm/react/core/signingEngine/interfaces/operationStepUpPreparation.js +0 -18
  1005. package/dist/esm/react/core/signingEngine/nonce/NonceCoordinator.js +0 -1026
  1006. package/dist/esm/react/core/signingEngine/nonce/evmNonceLane.js +0 -182
  1007. package/dist/esm/react/core/signingEngine/nonce/nearNonceLane.js +0 -669
  1008. package/dist/esm/react/core/signingEngine/nonce/nearNonceLaneIdentity.js +0 -24
  1009. package/dist/esm/react/core/signingEngine/nonce/nonceCoordinationRecordBoundary.js +0 -216
  1010. package/dist/esm/react/core/signingEngine/nonce/nonceDiagnostics.js +0 -232
  1011. package/dist/esm/react/core/signingEngine/nonce/nonceLaneKeys.js +0 -110
  1012. package/dist/esm/react/core/signingEngine/nonce/nonceLeaseState.js +0 -128
  1013. package/dist/esm/react/core/signingEngine/nonce/nonceTypes.js +0 -59
  1014. package/dist/esm/react/core/signingEngine/nonce/nonceUtils.js +0 -33
  1015. package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/httpRequest.js +0 -74
  1016. package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/poolFillRoutes.js +0 -217
  1017. package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/presignaturePool.js +0 -1218
  1018. package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/presignatureRefillProgress.js +0 -53
  1019. package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.js +0 -22
  1020. package/dist/esm/react/core/signingEngine/session/SigningSessionCoordinator.js +0 -347
  1021. package/dist/esm/react/core/signingEngine/session/authority/authorityOperationResolver.js +0 -165
  1022. package/dist/esm/react/core/signingEngine/session/availability/availableSigningLanes.js +0 -1064
  1023. package/dist/esm/react/core/signingEngine/session/availability/canonicalLaneInventory.js +0 -127
  1024. package/dist/esm/react/core/signingEngine/session/availability/clientSessionExpiryInvalidator.js +0 -72
  1025. package/dist/esm/react/core/signingEngine/session/availability/persistedAvailableSigningLanes.js +0 -214
  1026. package/dist/esm/react/core/signingEngine/session/availability/readiness.js +0 -464
  1027. package/dist/esm/react/core/signingEngine/session/emailOtp/EmailOtpWalletSessionCoordinator.js +0 -131
  1028. package/dist/esm/react/core/signingEngine/session/emailOtp/challengeDelivery.js +0 -56
  1029. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaBootstrapCommit.js +0 -106
  1030. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaLifecycleRuntime.js +0 -50
  1031. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaLogin.js +0 -936
  1032. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaPublication.js +0 -414
  1033. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaRecovery.js +0 -268
  1034. package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaSigningSessionAuthority.js +0 -95
  1035. package/dist/esm/react/core/signingEngine/session/emailOtp/ed25519ExportContext.js +0 -376
  1036. package/dist/esm/react/core/signingEngine/session/emailOtp/exportRecovery.js +0 -286
  1037. package/dist/esm/react/core/signingEngine/session/emailOtp/exportRecoveryRuntime.js +0 -50
  1038. package/dist/esm/react/core/signingEngine/session/emailOtp/persistedSnapshot.js +0 -22
  1039. package/dist/esm/react/core/signingEngine/session/emailOtp/publicTypes.js +0 -38
  1040. package/dist/esm/react/core/signingEngine/session/emailOtp/routePlan.js +0 -60
  1041. package/dist/esm/react/core/signingEngine/session/emailOtp/runtimeConfig.js +0 -24
  1042. package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRefreshPolicy.js +0 -49
  1043. package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRestoreOrchestrator.js +0 -234
  1044. package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRuntimePurpose.js +0 -16
  1045. package/dist/esm/react/core/signingEngine/session/emailOtp/sealedSessionRegistry.js +0 -40
  1046. package/dist/esm/react/core/signingEngine/session/emailOtp/status.js +0 -72
  1047. package/dist/esm/react/core/signingEngine/session/emailOtp/walletUnlock.js +0 -168
  1048. package/dist/esm/react/core/signingEngine/session/emailOtp/warmSessionRuntime.js +0 -70
  1049. package/dist/esm/react/core/signingEngine/session/emailOtp/workerEnrollment.js +0 -159
  1050. package/dist/esm/react/core/signingEngine/session/emailOtp/workerRequests.js +0 -84
  1051. package/dist/esm/react/core/signingEngine/session/emailOtp/zeroize.js +0 -9
  1052. package/dist/esm/react/core/signingEngine/session/identity/clientSessionPersistenceState.js +0 -95
  1053. package/dist/esm/react/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.js +0 -23
  1054. package/dist/esm/react/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.js +0 -265
  1055. package/dist/esm/react/core/signingEngine/session/identity/exactSigningLaneIdentity.js +0 -338
  1056. package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionCredential.js +0 -106
  1057. package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +0 -54
  1058. package/dist/esm/react/core/signingEngine/session/identity/laneIdentity.js +0 -168
  1059. package/dist/esm/react/core/signingEngine/session/identity/ownerLaneScope.js +0 -185
  1060. package/dist/esm/react/core/signingEngine/session/identity/selectLane.js +0 -335
  1061. package/dist/esm/react/core/signingEngine/session/identity/signingLaneAuthBinding.js +0 -29
  1062. package/dist/esm/react/core/signingEngine/session/keyMaterialBrands.js +0 -75
  1063. package/dist/esm/react/core/signingEngine/session/lanes/walletExecutionLaneHydration.js +0 -194
  1064. package/dist/esm/react/core/signingEngine/session/lifecycle/canonicalWalletSessionStatus.js +0 -32
  1065. package/dist/esm/react/core/signingEngine/session/lifecycle/walletSessionFailure.js +0 -69
  1066. package/dist/esm/react/core/signingEngine/session/lifecycle/walletSessionStatus.js +0 -123
  1067. package/dist/esm/react/core/signingEngine/session/material/activeEcdsaCapabilityRuntime.js +0 -171
  1068. package/dist/esm/react/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.js +0 -318
  1069. package/dist/esm/react/core/signingEngine/session/material/ecdsaCapabilityHydration.js +0 -75
  1070. package/dist/esm/react/core/signingEngine/session/material/ecdsaCapabilityManifest.js +0 -498
  1071. package/dist/esm/react/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.js +0 -122
  1072. package/dist/esm/react/core/signingEngine/session/material/ecdsaSealedRuntime.js +0 -197
  1073. package/dist/esm/react/core/signingEngine/session/material/ecdsaSigningCapability.js +0 -231
  1074. package/dist/esm/react/core/signingEngine/session/material/linkedEcdsaHolderRuntime.js +0 -36
  1075. package/dist/esm/react/core/signingEngine/session/material/mpcCapabilityHydration.js +0 -79
  1076. package/dist/esm/react/core/signingEngine/session/material/nearEd25519YaoMaterialActivation.js +0 -80
  1077. package/dist/esm/react/core/signingEngine/session/material/nearEd25519YaoSigningPreparation.js +0 -122
  1078. package/dist/esm/react/core/signingEngine/session/material/restorableMpcMaterialRef.internal.js +0 -21
  1079. package/dist/esm/react/core/signingEngine/session/material/walletSigningStateFailure.js +0 -84
  1080. package/dist/esm/react/core/signingEngine/session/operationState/authorizationAdmission.js +0 -98
  1081. package/dist/esm/react/core/signingEngine/session/operationState/lanes.js +0 -127
  1082. package/dist/esm/react/core/signingEngine/session/operationState/preparedOperation.js +0 -38
  1083. package/dist/esm/react/core/signingEngine/session/operationState/trace.js +0 -94
  1084. package/dist/esm/react/core/signingEngine/session/operationState/transactionState.js +0 -106
  1085. package/dist/esm/react/core/signingEngine/session/operationState/types.js +0 -88
  1086. package/dist/esm/react/core/signingEngine/session/passkey/ecdsaBootstrap.js +0 -187
  1087. package/dist/esm/react/core/signingEngine/session/passkey/ecdsaKeyFactsInventory.js +0 -206
  1088. package/dist/esm/react/core/signingEngine/session/passkey/ecdsaRecovery.js +0 -87
  1089. package/dist/esm/react/core/signingEngine/session/passkey/ecdsaSessionProvision.js +0 -224
  1090. package/dist/esm/react/core/signingEngine/session/passkey/ecdsaWarmCapabilityBootstrap.js +0 -147
  1091. package/dist/esm/react/core/signingEngine/session/passkey/ed25519Provisioner.js +0 -55
  1092. package/dist/esm/react/core/signingEngine/session/passkey/ed25519SessionProvision.js +0 -229
  1093. package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.js +0 -537
  1094. package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoRecoveryCapability.js +0 -94
  1095. package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoSealedSession.js +0 -57
  1096. package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.js +0 -314
  1097. package/dist/esm/react/core/signingEngine/session/passkey/passkeyCustodySessionCache.js +0 -90
  1098. package/dist/esm/react/core/signingEngine/session/passkey/prfCache.js +0 -60
  1099. package/dist/esm/react/core/signingEngine/session/passkey/public.js +0 -15
  1100. package/dist/esm/react/core/signingEngine/session/passkey/unlockEcdsaWarmupPlanner.js +0 -247
  1101. package/dist/esm/react/core/signingEngine/session/passkey/warmSessionHydration.js +0 -9
  1102. package/dist/esm/react/core/signingEngine/session/persistence/clientSessionPersistence.js +0 -143
  1103. package/dist/esm/react/core/signingEngine/session/persistence/durableSealedSessionCommands.js +0 -30
  1104. package/dist/esm/react/core/signingEngine/session/persistence/ecdsaRoleLocalRecords.js +0 -316
  1105. package/dist/esm/react/core/signingEngine/session/persistence/ecdsaSealedRecordKey.js +0 -20
  1106. package/dist/esm/react/core/signingEngine/session/persistence/sealedSessionRecords.js +0 -761
  1107. package/dist/esm/react/core/signingEngine/session/persistence/sealedSessionStore.js +0 -518
  1108. package/dist/esm/react/core/signingEngine/session/persistence/walletSessionAuthorizationProjection.js +0 -51
  1109. package/dist/esm/react/core/signingEngine/session/planning/operationFingerprint.js +0 -30
  1110. package/dist/esm/react/core/signingEngine/session/planning/operationIdBinding.js +0 -36
  1111. package/dist/esm/react/core/signingEngine/session/planning/planner.js +0 -98
  1112. package/dist/esm/react/core/signingEngine/session/postconditions/runtimePostconditions.js +0 -165
  1113. package/dist/esm/react/core/signingEngine/session/public.js +0 -44
  1114. package/dist/esm/react/core/signingEngine/session/routerAbSigningWalletSession.js +0 -125
  1115. package/dist/esm/react/core/signingEngine/session/sealedRecovery/exactRecordLookup.js +0 -148
  1116. package/dist/esm/react/core/signingEngine/session/sealedRecovery/materialActivationKey.js +0 -22
  1117. package/dist/esm/react/core/signingEngine/session/sealedRecovery/recoveryRecord.js +0 -248
  1118. package/dist/esm/react/core/signingEngine/session/sealedRecovery/restoreCoordinator.js +0 -229
  1119. package/dist/esm/react/core/signingEngine/session/userPreferences.js +0 -212
  1120. package/dist/esm/react/core/signingEngine/session/warmCapabilities/capabilityReader.js +0 -62
  1121. package/dist/esm/react/core/signingEngine/session/warmCapabilities/capabilityReaderCore.js +0 -293
  1122. package/dist/esm/react/core/signingEngine/session/warmCapabilities/clearVolatileWarmSigningMaterial.js +0 -44
  1123. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaBootstrapPersistence.js +0 -107
  1124. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaBootstrapQueue.js +0 -22
  1125. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaLoginPrefill.js +0 -93
  1126. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaLoginPrefillSigningMaterialSource.js +0 -50
  1127. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.js +0 -9
  1128. package/dist/esm/react/core/signingEngine/session/warmCapabilities/ed25519SealedSessionRuntime.js +0 -251
  1129. package/dist/esm/react/core/signingEngine/session/warmCapabilities/nearEd25519CapabilityRehydration.js +0 -98
  1130. package/dist/esm/react/core/signingEngine/session/warmCapabilities/public.js +0 -31
  1131. package/dist/esm/react/core/signingEngine/session/warmCapabilities/readModel.js +0 -161
  1132. package/dist/esm/react/core/signingEngine/session/warmCapabilities/routerAbEd25519WalletSessionState.js +0 -256
  1133. package/dist/esm/react/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.js +0 -73
  1134. package/dist/esm/react/core/signingEngine/session/warmCapabilities/sealedRefreshParity.js +0 -67
  1135. package/dist/esm/react/core/signingEngine/session/warmCapabilities/statusReader.js +0 -100
  1136. package/dist/esm/react/core/signingEngine/session/warmCapabilities/transitions.js +0 -51
  1137. package/dist/esm/react/core/signingEngine/session/warmCapabilities/types.js +0 -122
  1138. package/dist/esm/react/core/signingEngine/session/warmCapabilities/volatileWarmMaterialCommands.js +0 -45
  1139. package/dist/esm/react/core/signingEngine/stepUpConfirmation/channel/confirmCommon.js +0 -89
  1140. package/dist/esm/react/core/signingEngine/stepUpConfirmation/channel/confirmTypes.js +0 -12
  1141. package/dist/esm/react/core/signingEngine/stepUpConfirmation/confirmOperation.js +0 -51
  1142. package/dist/esm/react/core/signingEngine/stepUpConfirmation/intentDigestPreparation.js +0 -29
  1143. package/dist/esm/react/core/signingEngine/stepUpConfirmation/methodSelection.js +0 -41
  1144. package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/authLane.js +0 -32
  1145. package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/exportAuthorization.js +0 -108
  1146. package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/promptText.js +0 -8
  1147. package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/signingPrompt.js +0 -15
  1148. package/dist/esm/react/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.js +0 -295
  1149. package/dist/esm/react/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.js +0 -170
  1150. package/dist/esm/react/core/signingEngine/stepUpConfirmation/requireStepUpAuth.js +0 -63
  1151. package/dist/esm/react/core/signingEngine/stepUpConfirmation/types.js +0 -29
  1152. package/dist/esm/react/core/signingEngine/stepUpConfirmation/userConfirmationType.js +0 -15
  1153. package/dist/esm/react/core/signingEngine/threshold/commitQueueShared.js +0 -139
  1154. package/dist/esm/react/core/signingEngine/threshold/crypto/ecdsaDerivationClientWasm.js +0 -619
  1155. package/dist/esm/react/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.js +0 -70
  1156. package/dist/esm/react/core/signingEngine/threshold/ecdsa/activation.js +0 -267
  1157. package/dist/esm/react/core/signingEngine/threshold/ecdsa/bootstrapSession.js +0 -119
  1158. package/dist/esm/react/core/signingEngine/threshold/ecdsa/operationStepUp.js +0 -110
  1159. package/dist/esm/react/core/signingEngine/threshold/ecdsa/postRegistrationSessionActivation.js +0 -132
  1160. package/dist/esm/react/core/signingEngine/threshold/ecdsa/signingQueue.js +0 -16
  1161. package/dist/esm/react/core/signingEngine/threshold/ed25519/commitQueue.js +0 -16
  1162. package/dist/esm/react/core/signingEngine/threshold/ed25519/connectSession.js +0 -137
  1163. package/dist/esm/react/core/signingEngine/threshold/ed25519/walletSession.js +0 -363
  1164. package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoActiveClientRegistry.js +0 -146
  1165. package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoClient.js +0 -597
  1166. package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoPageLifecycleOwner.js +0 -23
  1167. package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoPublicCapabilityReferences.js +0 -295
  1168. package/dist/esm/react/core/signingEngine/threshold/sessionPolicy.js +0 -94
  1169. package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcExportManager.js +0 -233
  1170. package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +0 -496
  1171. package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +0 -746
  1172. package/dist/esm/react/core/signingEngine/uiConfirm/UiConfirmManager.js +0 -600
  1173. package/dist/esm/react/core/signingEngine/uiConfirm/confirmationReadinessRegistry.js +0 -41
  1174. package/dist/esm/react/core/signingEngine/uiConfirm/exportConfirmRequest.js +0 -149
  1175. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/determineConfirmationConfig.js +0 -82
  1176. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flowOrchestrator.js +0 -363
  1177. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/adapters/adapters.js +0 -337
  1178. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/adapters/request.js +0 -120
  1179. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/localOnly.js +0 -150
  1180. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/registration.js +0 -235
  1181. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/requestRegistrationCredentialConfirmation.js +0 -178
  1182. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/signing.js +0 -684
  1183. package/dist/esm/react/core/signingEngine/uiConfirm/handlers/handlePromptFromWorker.js +0 -90
  1184. package/dist/esm/react/core/signingEngine/uiConfirm/nearFundingNotice.js +0 -50
  1185. package/dist/esm/react/core/signingEngine/uiConfirm/transactionReviewAdmission.js +0 -8
  1186. package/dist/esm/react/core/signingEngine/uiConfirm/ui/appearance-token-vars.js +0 -31
  1187. package/dist/esm/react/core/signingEngine/uiConfirm/ui/appearance.js +0 -27
  1188. package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirm-surface-resize.js +0 -346
  1189. package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirm-ui.js +0 -516
  1190. package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirmation-body-model.js +0 -24
  1191. package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirmation-model.js +0 -161
  1192. package/dist/esm/react/core/signingEngine/uiConfirm/ui/drawer-gesture.js +0 -16
  1193. package/dist/esm/react/core/signingEngine/uiConfirm/ui/export-private-key-reveal.js +0 -155
  1194. package/dist/esm/react/core/signingEngine/uiConfirm/ui/export-viewer-host.js +0 -207
  1195. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmContent.js +0 -131
  1196. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmHeader.js +0 -29
  1197. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationBody.js +0 -49
  1198. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationContent.js +0 -137
  1199. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationDrawer.js +0 -294
  1200. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationModal.js +0 -67
  1201. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/CopyStatusIcon.js +0 -41
  1202. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/EmailOtpContent.js +0 -141
  1203. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/EmailOtpInput.js +0 -92
  1204. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ExportPrivateKeySurface.js +0 -318
  1205. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/HaloBorder.js +0 -91
  1206. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PadlockIcon.js +0 -32
  1207. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyHaloLoading.js +0 -63
  1208. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationContent.js +0 -75
  1209. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationDetails.js +0 -33
  1210. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.js +0 -518
  1211. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.js +0 -128
  1212. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/SeamsWordmark.js +0 -22
  1213. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionLabel.js +0 -158
  1214. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +0 -289
  1215. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionReview.js +0 -311
  1216. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionTree.js +0 -284
  1217. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/clipboard.js +0 -26
  1218. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/confirmation-controller.js +0 -80
  1219. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/confirmation-styles.js +0 -20
  1220. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/email-otp-session.js +0 -178
  1221. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +0 -297
  1222. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountExportPrivateKeySurface.js +0 -86
  1223. package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountRecoveryCodeBackupSurface.js +0 -82
  1224. package/dist/esm/react/core/signingEngine/uiConfirm/ui/seamsWordmarkPaths.js +0 -6
  1225. package/dist/esm/react/core/signingEngine/uiConfirm/ui/surface-measurement-binding.js +0 -12
  1226. package/dist/esm/react/core/signingEngine/uiConfirm/ui/surface-resize-events.js +0 -18
  1227. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-activity.js +0 -46
  1228. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.js +0 -325
  1229. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/abi/enrichDisplayModelWithAbi.js +0 -77
  1230. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/confirmation-tree.js +0 -27
  1231. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/formatters.js +0 -57
  1232. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/renderers/fallback.js +0 -52
  1233. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/renderers/types.js +0 -62
  1234. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/tree.js +0 -249
  1235. package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-receipt.js +0 -50
  1236. package/dist/esm/react/core/signingEngine/uiConfirm/warmSessionUiConfirm.js +0 -65
  1237. package/dist/esm/react/core/signingEngine/walletCustody/activateEd25519Capability.js +0 -123
  1238. package/dist/esm/react/core/signingEngine/walletCustody/ceremonyActiveClientMetadata.js +0 -94
  1239. package/dist/esm/react/core/signingEngine/walletCustody/ceremonyDriver.js +0 -171
  1240. package/dist/esm/react/core/signingEngine/walletCustody/ceremonyStepRunner.js +0 -20
  1241. package/dist/esm/react/core/signingEngine/walletCustody/ed25519ActiveClient.js +0 -100
  1242. package/dist/esm/react/core/signingEngine/walletCustody/ed25519Projection.js +0 -32
  1243. package/dist/esm/react/core/signingEngine/walletCustody/ed25519SeedMaterial.js +0 -92
  1244. package/dist/esm/react/core/signingEngine/walletCustody/emailOtpLink.js +0 -135
  1245. package/dist/esm/react/core/signingEngine/walletCustody/joinCustodyWire.js +0 -64
  1246. package/dist/esm/react/core/signingEngine/walletCustody/openCustodyCache.js +0 -130
  1247. package/dist/esm/react/core/signingEngine/walletCustody/passkeyLink.js +0 -183
  1248. package/dist/esm/react/core/signingEngine/walletCustody/recoveryReplacementEnvelope.js +0 -60
  1249. package/dist/esm/react/core/signingEngine/walletCustody/registrationCeremony.js +0 -461
  1250. package/dist/esm/react/core/signingEngine/walletCustody/unlockedEd25519ExportRootCapability.js +0 -258
  1251. package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryCredential.js +0 -24
  1252. package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryEcdsa.js +0 -76
  1253. package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryEd25519.js +0 -129
  1254. package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryManifest.js +0 -180
  1255. package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryRotation.js +0 -103
  1256. package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/collectAuthenticationCredentialForChallengeB64u.js +0 -154
  1257. package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/credentialExtensions.js +0 -36
  1258. package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/helpers.js +0 -273
  1259. package/dist/esm/react/core/signingEngine/webauthnAuth/device/signerSlot.js +0 -25
  1260. package/dist/esm/react/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.js +0 -171
  1261. package/dist/esm/react/core/signingEngine/workerManager/SignerWorkerManager.js +0 -70
  1262. package/dist/esm/react/core/signingEngine/workerManager/deviceLinkingPorts.js +0 -342
  1263. package/dist/esm/react/core/signingEngine/workerManager/deviceLinkingSourceContribution.js +0 -158
  1264. package/dist/esm/react/core/signingEngine/workerManager/ecdsaClientWorkerChannels.js +0 -17
  1265. package/dist/esm/react/core/signingEngine/workerManager/ecdsaPresignLifecycle.js +0 -6
  1266. package/dist/esm/react/core/signingEngine/workerManager/ecdsaPresignPoolIdentity.js +0 -49
  1267. package/dist/esm/react/core/signingEngine/workerManager/executeWorkerOperation.js +0 -12
  1268. package/dist/esm/react/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.js +0 -32
  1269. package/dist/esm/react/core/signingEngine/workerManager/validation.js +0 -114
  1270. package/dist/esm/react/core/signingEngine/workerManager/workerTransport.js +0 -773
  1271. package/dist/esm/react/core/signingEngine/workerManager/workerTypes.js +0 -109
  1272. package/dist/esm/react/core/types/accountIds.js +0 -26
  1273. package/dist/esm/react/core/types/actionBuilders.js +0 -73
  1274. package/dist/esm/react/core/types/confirmationConfig.js +0 -39
  1275. package/dist/esm/react/core/types/eventLogging.js +0 -28
  1276. package/dist/esm/react/core/types/linkDevice.js +0 -49
  1277. package/dist/esm/react/core/types/sdkSentEvents.js +0 -602
  1278. package/dist/esm/react/core/types/secure-confirm-worker.js +0 -22
  1279. package/dist/esm/react/core/types/signer-worker.js +0 -50
  1280. package/dist/esm/react/core/types/walletIframeIdentity.js +0 -15
  1281. package/dist/esm/react/core/walletRuntimePaths/base.js +0 -60
  1282. package/dist/esm/react/core/walletRuntimePaths/emailOtpWorker.js +0 -12
  1283. package/dist/esm/react/core/walletRuntimePaths/multichainWorkers.js +0 -25
  1284. package/dist/esm/react/core/walletRuntimePaths/walletCustodyCeremonyWorker.js +0 -18
  1285. package/dist/esm/react/core/walletRuntimePaths/workers.js +0 -93
  1286. package/dist/esm/react/externalEvm/boundary.js +0 -309
  1287. package/dist/esm/react/externalEvm/controller.js +0 -440
  1288. package/dist/esm/react/externalEvm/types.js +0 -31
  1289. package/dist/esm/react/node_modules/@noble/hashes/esm/_u64.js +0 -36
  1290. package/dist/esm/react/node_modules/@noble/hashes/esm/sha3.js +0 -197
  1291. package/dist/esm/react/node_modules/@noble/hashes/esm/utils.js +0 -87
  1292. package/dist/esm/react/node_modules/viem/_esm/errors/abi.js +0 -48
  1293. package/dist/esm/react/node_modules/viem/_esm/errors/address.js +0 -14
  1294. package/dist/esm/react/node_modules/viem/_esm/errors/base.js +0 -86
  1295. package/dist/esm/react/node_modules/viem/_esm/errors/data.js +0 -16
  1296. package/dist/esm/react/node_modules/viem/_esm/errors/encoding.js +0 -16
  1297. package/dist/esm/react/node_modules/viem/_esm/errors/typedData.js +0 -28
  1298. package/dist/esm/react/node_modules/viem/_esm/errors/version.js +0 -6
  1299. package/dist/esm/react/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js +0 -243
  1300. package/dist/esm/react/node_modules/viem/_esm/utils/address/getAddress.js +0 -28
  1301. package/dist/esm/react/node_modules/viem/_esm/utils/address/isAddress.js +0 -23
  1302. package/dist/esm/react/node_modules/viem/_esm/utils/data/concat.js +0 -23
  1303. package/dist/esm/react/node_modules/viem/_esm/utils/data/isHex.js +0 -10
  1304. package/dist/esm/react/node_modules/viem/_esm/utils/data/pad.js +0 -40
  1305. package/dist/esm/react/node_modules/viem/_esm/utils/data/size.js +0 -16
  1306. package/dist/esm/react/node_modules/viem/_esm/utils/data/slice.js +0 -59
  1307. package/dist/esm/react/node_modules/viem/_esm/utils/encoding/fromHex.js +0 -13
  1308. package/dist/esm/react/node_modules/viem/_esm/utils/encoding/toBytes.js +0 -175
  1309. package/dist/esm/react/node_modules/viem/_esm/utils/encoding/toHex.js +0 -168
  1310. package/dist/esm/react/node_modules/viem/_esm/utils/hash/keccak256.js +0 -15
  1311. package/dist/esm/react/node_modules/viem/_esm/utils/lru.js +0 -38
  1312. package/dist/esm/react/node_modules/viem/_esm/utils/regex.js +0 -7
  1313. package/dist/esm/react/node_modules/viem/_esm/utils/signature/hashTypedData.js +0 -113
  1314. package/dist/esm/react/node_modules/viem/_esm/utils/stringify.js +0 -9
  1315. package/dist/esm/react/node_modules/viem/_esm/utils/typedData.js +0 -80
  1316. package/dist/esm/react/shared-ts/src/authorization/capabilityKinds.js +0 -111
  1317. package/dist/esm/react/shared-ts/src/authorization/delegatedAuthority.js +0 -121
  1318. package/dist/esm/react/shared-ts/src/authorization/index.js +0 -6
  1319. package/dist/esm/react/shared-ts/src/authorization/operationFingerprint.js +0 -57
  1320. package/dist/esm/react/shared-ts/src/authorization/walletAuthority.js +0 -719
  1321. package/dist/esm/react/shared-ts/src/authorization/walletCustodyOperation.js +0 -16
  1322. package/dist/esm/react/shared-ts/src/authorization/walletSessionIssuance.js +0 -115
  1323. package/dist/esm/react/shared-ts/src/authorization/walletSignerActivationEquality.js +0 -12
  1324. package/dist/esm/react/shared-ts/src/device-linking/activeWalletSession.js +0 -104
  1325. package/dist/esm/react/shared-ts/src/device-linking/authorityActivation.js +0 -142
  1326. package/dist/esm/react/shared-ts/src/device-linking/committedSignerPackages.js +0 -270
  1327. package/dist/esm/react/shared-ts/src/device-linking/contracts.js +0 -8
  1328. package/dist/esm/react/shared-ts/src/device-linking/delegatedActivationPlan.js +0 -130
  1329. package/dist/esm/react/shared-ts/src/device-linking/deviceManagement.js +0 -120
  1330. package/dist/esm/react/shared-ts/src/device-linking/digests.js +0 -115
  1331. package/dist/esm/react/shared-ts/src/device-linking/ed25519ExportRoot.js +0 -167
  1332. package/dist/esm/react/shared-ts/src/device-linking/index.js +0 -12
  1333. package/dist/esm/react/shared-ts/src/device-linking/parsers.js +0 -1029
  1334. package/dist/esm/react/shared-ts/src/device-linking/requestProof.js +0 -25
  1335. package/dist/esm/react/shared-ts/src/device-linking/sourceContribution.js +0 -542
  1336. package/dist/esm/react/shared-ts/src/device-linking/walletSessionCredentialDelivery.js +0 -173
  1337. package/dist/esm/react/shared-ts/src/device-linking/wireFields.js +0 -59
  1338. package/dist/esm/react/shared-ts/src/near/actions.js +0 -236
  1339. package/dist/esm/react/shared-ts/src/near/nearClient.js +0 -252
  1340. package/dist/esm/react/shared-ts/src/passkey-custody/ceremonyCommitPayload.js +0 -43
  1341. package/dist/esm/react/shared-ts/src/passkey-custody/custodyEnvelope.js +0 -278
  1342. package/dist/esm/react/shared-ts/src/passkey-custody/custodySecretBinding.js +0 -181
  1343. package/dist/esm/react/shared-ts/src/passkey-custody/index.js +0 -4
  1344. package/dist/esm/react/shared-ts/src/passkey-custody/primitives.js +0 -62
  1345. package/dist/esm/react/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.js +0 -49
  1346. package/dist/esm/react/shared-ts/src/signing-lanes/index.js +0 -8
  1347. package/dist/esm/react/shared-ts/src/signing-lanes/ownerContinuity.js +0 -62
  1348. package/dist/esm/react/shared-ts/src/signing-lanes/participantDigest.js +0 -2
  1349. package/dist/esm/react/shared-ts/src/signing-lanes/participants.js +0 -256
  1350. package/dist/esm/react/shared-ts/src/signing-lanes/recordParsers.js +0 -479
  1351. package/dist/esm/react/shared-ts/src/signing-lanes/rotationDigests.js +0 -6
  1352. package/dist/esm/react/shared-ts/src/signing-lanes/rotationParsers.js +0 -3
  1353. package/dist/esm/react/shared-ts/src/signing-lanes/rotationProtocolParsers.js +0 -8
  1354. package/dist/esm/react/shared-ts/src/signing-lanes/rotationWireFields.js +0 -3
  1355. package/dist/esm/react/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js +0 -39
  1356. package/dist/esm/react/shared-ts/src/threshold/ed25519OperationFingerprint.js +0 -222
  1357. package/dist/esm/react/shared-ts/src/threshold/keyMaterialBrands.js +0 -25
  1358. package/dist/esm/react/shared-ts/src/threshold/participants.js +0 -67
  1359. package/dist/esm/react/shared-ts/src/threshold/secp256k1.js +0 -6
  1360. package/dist/esm/react/shared-ts/src/threshold/sessionPolicy.js +0 -8
  1361. package/dist/esm/react/shared-ts/src/threshold/signingRootScope.js +0 -43
  1362. package/dist/esm/react/shared-ts/src/utils/addAuthMethodRegistration.js +0 -103
  1363. package/dist/esm/react/shared-ts/src/utils/addWalletAuthMethod.js +0 -1
  1364. package/dist/esm/react/shared-ts/src/utils/authenticatorOptions.js +0 -22
  1365. package/dist/esm/react/shared-ts/src/utils/base58.js +0 -28
  1366. package/dist/esm/react/shared-ts/src/utils/base64.js +0 -70
  1367. package/dist/esm/react/shared-ts/src/utils/canonicalPrimitives.js +0 -38
  1368. package/dist/esm/react/shared-ts/src/utils/digestEncoding.js +0 -63
  1369. package/dist/esm/react/shared-ts/src/utils/digests.js +0 -33
  1370. package/dist/esm/react/shared-ts/src/utils/domainIds.js +0 -257
  1371. package/dist/esm/react/shared-ts/src/utils/ecdsaCapabilityActivation.js +0 -67
  1372. package/dist/esm/react/shared-ts/src/utils/ecdsaKeyFactsInventory.js +0 -44
  1373. package/dist/esm/react/shared-ts/src/utils/ecdsaServerTiming.js +0 -38
  1374. package/dist/esm/react/shared-ts/src/utils/emailOtpDomain.js +0 -28
  1375. package/dist/esm/react/shared-ts/src/utils/emailOtpRecoveryKey.js +0 -65
  1376. package/dist/esm/react/shared-ts/src/utils/encoders.js +0 -2
  1377. package/dist/esm/react/shared-ts/src/utils/errors.js +0 -95
  1378. package/dist/esm/react/shared-ts/src/utils/evmRpcResults.js +0 -101
  1379. package/dist/esm/react/shared-ts/src/utils/exactKeys.js +0 -17
  1380. package/dist/esm/react/shared-ts/src/utils/exactRecord.js +0 -44
  1381. package/dist/esm/react/shared-ts/src/utils/index.js +0 -38
  1382. package/dist/esm/react/shared-ts/src/utils/jsonRpc.js +0 -64
  1383. package/dist/esm/react/shared-ts/src/utils/keccak.js +0 -150
  1384. package/dist/esm/react/shared-ts/src/utils/near.js +0 -205
  1385. package/dist/esm/react/shared-ts/src/utils/nearRpcResults.js +0 -205
  1386. package/dist/esm/react/shared-ts/src/utils/normalize.js +0 -86
  1387. package/dist/esm/react/shared-ts/src/utils/registrationAuthMethodInput.js +0 -84
  1388. package/dist/esm/react/shared-ts/src/utils/registrationEstablishedSession.js +0 -275
  1389. package/dist/esm/react/shared-ts/src/utils/registrationIds.js +0 -226
  1390. package/dist/esm/react/shared-ts/src/utils/registrationIntent.js +0 -390
  1391. package/dist/esm/react/shared-ts/src/utils/registrationSignerPlan.js +0 -439
  1392. package/dist/esm/react/shared-ts/src/utils/routerAbEcdsaDerivation.js +0 -1334
  1393. package/dist/esm/react/shared-ts/src/utils/routerAbEd25519Yao.js +0 -747
  1394. package/dist/esm/react/shared-ts/src/utils/routerAbEd25519YaoDigests.js +0 -76
  1395. package/dist/esm/react/shared-ts/src/utils/routerAbNormalSigningIdentity.js +0 -115
  1396. package/dist/esm/react/shared-ts/src/utils/routerAbPublicKeyset.js +0 -11
  1397. package/dist/esm/react/shared-ts/src/utils/routerAbTraceContext.js +0 -36
  1398. package/dist/esm/react/shared-ts/src/utils/secureRandomId.js +0 -35
  1399. package/dist/esm/react/shared-ts/src/utils/signerDomain.js +0 -37
  1400. package/dist/esm/react/shared-ts/src/utils/signerSlot.js +0 -12
  1401. package/dist/esm/react/shared-ts/src/utils/signingSessionSeal.js +0 -98
  1402. package/dist/esm/react/shared-ts/src/utils/theme.js +0 -8
  1403. package/dist/esm/react/shared-ts/src/utils/thresholdEcdsaChainTarget.js +0 -9
  1404. package/dist/esm/react/shared-ts/src/utils/thresholdEcdsaKeyHandle.js +0 -28
  1405. package/dist/esm/react/shared-ts/src/utils/validation.js +0 -92
  1406. package/dist/esm/react/shared-ts/src/utils/walletAddSignerActivation.js +0 -32
  1407. package/dist/esm/react/shared-ts/src/utils/walletAuthAuthority.js +0 -224
  1408. package/dist/esm/react/shared-ts/src/utils/walletAuthMethodRecord.js +0 -357
  1409. package/dist/esm/react/shared-ts/src/utils/walletCapabilityBindings.js +0 -277
  1410. package/dist/esm/react/shared-ts/src/utils/walletSessionFailure.js +0 -28
  1411. package/dist/esm/react/shared-ts/src/utils/webauthnDeviceInfo.js +0 -50
  1412. package/dist/esm/react/shared-ts/src/utils/wireSchema.js +0 -66
  1413. package/dist/esm/react/shared-ts/src/wallet-recovery/index.js +0 -10
  1414. package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeIssuance.js +0 -35
  1415. package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeLocator.js +0 -34
  1416. package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeReservation.js +0 -24
  1417. package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodes.js +0 -3
  1418. package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryKeyId.js +0 -14
  1419. package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.js +0 -251
  1420. package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryEcdsaPossession.js +0 -153
  1421. package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryEnvelopeSet.js +0 -84
  1422. package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryRotation.js +0 -64
  1423. package/dist/esm/react/theme/base-styles.js +0 -117
  1424. package/dist/esm/react/theme/palette.js +0 -170
  1425. package/dist/esm/react/utils/deviceDetection.js +0 -95
  1426. package/dist/esm/react/utils/intentDigest.js +0 -77
  1427. package/dist/esm/react/utils/menuItemBlink.js +0 -24
  1428. package/dist/esm/react/utils/qrScanner.js +0 -297
  1429. package/dist/esm/sdk/ConfirmationDrawer-MgFTBwwK.js +0 -425
  1430. package/dist/esm/sdk/EvmClient-f3gUhS2L.js +0 -644
  1431. package/dist/esm/sdk/NearClient-DY4NfHeD.js +0 -402
  1432. package/dist/esm/sdk/NonceCoordinator-4XWPhYww.js +0 -2253
  1433. package/dist/esm/sdk/accountIds-DhIPGOSN.js +0 -23
  1434. package/dist/esm/sdk/accountLifecycle-zthG08aC.js +0 -1341
  1435. package/dist/esm/sdk/actions-CCvThiKe.js +0 -225
  1436. package/dist/esm/sdk/adapters-Dli9XAZp.js +0 -4836
  1437. package/dist/esm/sdk/base-D1B5mGin.js +0 -64
  1438. package/dist/esm/sdk/base64-Clm8C-e9.js +0 -68
  1439. package/dist/esm/sdk/browser-D6eZGhzE.js +0 -2393
  1440. package/dist/esm/sdk/bytes-qKxKn4gg.js +0 -40
  1441. package/dist/esm/sdk/canonicalPrimitives-BTHWz80v.js +0 -36
  1442. package/dist/esm/sdk/canonicalSignerErrorCode-BBIk365e.js +0 -139
  1443. package/dist/esm/sdk/capabilityKinds-hvYqa6S_.js +0 -109
  1444. package/dist/esm/sdk/chains-BMh3btVo.js +0 -124
  1445. package/dist/esm/sdk/challengeDelivery-DZtopOAG.js +0 -74
  1446. package/dist/esm/sdk/chunk-BtrIJ4_z.js +0 -33
  1447. package/dist/esm/sdk/configHelpers-D1EqxVxg.js +0 -179
  1448. package/dist/esm/sdk/csp-stylesheet-btENhsNp.js +0 -215
  1449. package/dist/esm/sdk/defaultConfigs-D_33pPT9.js +0 -355
  1450. package/dist/esm/sdk/display-P4nQF-yc.js +0 -126
  1451. package/dist/esm/sdk/domainIds-lcrFg6Sa.js +0 -338
  1452. package/dist/esm/sdk/ecdsaCapabilityManifest-DuMs0VtU.js +0 -805
  1453. package/dist/esm/sdk/ecdsaChainTarget-Bl-JWyuw.js +0 -121
  1454. package/dist/esm/sdk/ecdsaPresignLifecycle-Bfx2AQKb.js +0 -1983
  1455. package/dist/esm/sdk/ecdsaPresignPoolIdentity-BjxZVIqn.js +0 -47
  1456. package/dist/esm/sdk/ecdsaWalletRecords-D42rtA9z.js +0 -18
  1457. package/dist/esm/sdk/encoders-D8d07vpx.js +0 -0
  1458. package/dist/esm/sdk/enrichDisplayModelWithAbi-CWggsykc.js +0 -395
  1459. package/dist/esm/sdk/enrichDisplayModelWithAbi-SDRwTd_M.js +0 -579
  1460. package/dist/esm/sdk/errors-93h9uAW9.js +0 -92
  1461. package/dist/esm/sdk/events-DYoBL2HO.js +0 -8
  1462. package/dist/esm/sdk/evmCryptoWasm-DWklhEEb.js +0 -196
  1463. package/dist/esm/sdk/evmFamilyEcdsaIdentity-CqGafQsI.js +0 -4274
  1464. package/dist/esm/sdk/exactSessionState-LWDUXydN.js +0 -2592
  1465. package/dist/esm/sdk/exactSigningLaneIdentity-m6uTXV_A.js +0 -335
  1466. package/dist/esm/sdk/executeWorkerOperation-Cl9whMK7.js +0 -10
  1467. package/dist/esm/sdk/export-viewer-host-rWMSQQMP.js +0 -204
  1468. package/dist/esm/sdk/helpers-ZrowMnev.js +0 -302
  1469. package/dist/esm/sdk/host-CnV8nAUe.js +0 -533
  1470. package/dist/esm/sdk/intentDigest-CvOSNlCH.js +0 -75
  1471. package/dist/esm/sdk/jsonRpc-VVkaQkFD.js +0 -62
  1472. package/dist/esm/sdk/jsxRuntime.module-CuH5ZEIA.js +0 -298
  1473. package/dist/esm/sdk/keccak-DUL3d8SF.js +0 -148
  1474. package/dist/esm/sdk/keyMaterialBrands-CogGAAZn.js +0 -94
  1475. package/dist/esm/sdk/localOnly-DTpa2jD5.js +0 -146
  1476. package/dist/esm/sdk/messages-C7Dbx9iN.js +0 -594
  1477. package/dist/esm/sdk/mountExportPrivateKeySurface-DgX-IBG_.js +0 -542
  1478. package/dist/esm/sdk/mountRecoveryCodeBackupSurface-DXrExiJ7.js +0 -590
  1479. package/dist/esm/sdk/nearEd25519YaoMaterialActivation-B5GecIvq.js +0 -4018
  1480. package/dist/esm/sdk/nearEd25519YaoSigningPreparation-CdOT5RuC.js +0 -405
  1481. package/dist/esm/sdk/nearRpcResults-DoUgDATm.js +0 -216
  1482. package/dist/esm/sdk/nonceLaneKeys-C3c9lG6u.js +0 -164
  1483. package/dist/esm/sdk/normalization-CBt413-z.js +0 -22
  1484. package/dist/esm/sdk/operationFingerprint-C8Trar4R.js +0 -929
  1485. package/dist/esm/sdk/operationFingerprint-CGZui5dR.js +0 -55
  1486. package/dist/esm/sdk/passkey-custody-UUHbC0pk.js +0 -487
  1487. package/dist/esm/sdk/pendingWalletRecoveryCodeBackup-BWluQMbt.js +0 -237
  1488. package/dist/esm/sdk/prfCache-wqQSjYLn.js +0 -58
  1489. package/dist/esm/sdk/profileAccountProjection-uZVJuBvS.js +0 -86
  1490. package/dist/esm/sdk/promptText-CuRa_ivd.js +0 -32
  1491. package/dist/esm/sdk/recovery-entrypoint-C3fydnRC.js +0 -779
  1492. package/dist/esm/sdk/registration-Ct_7LdGf.js +0 -14402
  1493. package/dist/esm/sdk/registration-DHERU8R_.js +0 -233
  1494. package/dist/esm/sdk/registrationAccounts-DmWPzf3T.js +0 -33
  1495. package/dist/esm/sdk/registrationIds-DLSdEKSv.js +0 -310
  1496. package/dist/esm/sdk/registrationIntent-4zwk16zQ.js +0 -387
  1497. package/dist/esm/sdk/registrationPreparationPreload-D6zpWp4O.js +0 -13
  1498. package/dist/esm/sdk/registrationSignerPlan-DhV8VAob.js +0 -437
  1499. package/dist/esm/sdk/relayerHttp-VC8Holz1.js +0 -24
  1500. package/dist/esm/sdk/routePlan-D59x5xzQ.js +0 -83
  1501. package/dist/esm/sdk/router-B4ZWFy9E.js +0 -4721
  1502. package/dist/esm/sdk/routerAbNormalSigning-CVFEOZ2m.js +0 -992
  1503. package/dist/esm/sdk/runtime-auth-DdfynDKt.js +0 -5393
  1504. package/dist/esm/sdk/runtime-device-link-HJ2ptFux.js +0 -259
  1505. package/dist/esm/sdk/runtime-ecdsa-tempo-BGLsTAWR.js +0 -177
  1506. package/dist/esm/sdk/runtime-email-otp-CpX88VZJ.js +0 -320
  1507. package/dist/esm/sdk/runtime-export-DIVY473L.js +0 -112
  1508. package/dist/esm/sdk/runtime-near-CxtQi4b2.js +0 -278
  1509. package/dist/esm/sdk/runtime-preferences-vnJc5Svg.js +0 -67
  1510. package/dist/esm/sdk/runtime-recovery-codes-BSCLVHQj.js +0 -95
  1511. package/dist/esm/sdk/runtime-recovery-i08vCJST.js +0 -45
  1512. package/dist/esm/sdk/runtimeContext-D3TBExQ6.js +0 -44484
  1513. package/dist/esm/sdk/runtimeLoader-DQVEFVaW.js +0 -44
  1514. package/dist/esm/sdk/sdkSentEvents-MqDkbQg1.js +0 -599
  1515. package/dist/esm/sdk/secp256k1-D-I6Gh4D.js +0 -2515
  1516. package/dist/esm/sdk/secureRandomId-BORsmdS4.js +0 -33
  1517. package/dist/esm/sdk/sessionPolicy-DO-MkL65.js +0 -460
  1518. package/dist/esm/sdk/shared-DkbeLCI3.js +0 -33
  1519. package/dist/esm/sdk/signEvmFamily-C3C97Th-.js +0 -4607
  1520. package/dist/esm/sdk/signEvmFamilyWithUiConfirmForTempo-BI9DSTIS.js +0 -226
  1521. package/dist/esm/sdk/signEvmWithUiConfirm-Bmcim5-g.js +0 -27
  1522. package/dist/esm/sdk/signNear-Bmb2fj_a.js +0 -5893
  1523. package/dist/esm/sdk/signatureUses-BkGyYt8F.js +0 -51
  1524. package/dist/esm/sdk/signerDomain-IEAVrOrc.js +0 -59
  1525. package/dist/esm/sdk/signerLoader-B7orgq5Z.js +0 -23
  1526. package/dist/esm/sdk/signerSlot-_ovonwVX.js +0 -10
  1527. package/dist/esm/sdk/signingFlow-SZ8t_lxv.js +0 -1319
  1528. package/dist/esm/sdk/signingSessionSeal-Cu-GHm6y.js +0 -96
  1529. package/dist/esm/sdk/surface-measurement-reporter-CSTyRsMa.js +0 -156
  1530. package/dist/esm/sdk/trace-DKLQZvec.js +0 -126
  1531. package/dist/esm/sdk/transaction-activity-CSMCveBn.js +0 -218
  1532. package/dist/esm/sdk/transactionReview-DpHLTznU.js +0 -100
  1533. package/dist/esm/sdk/transactionReviewAdmission-BCPvl8OZ.js +0 -172
  1534. package/dist/esm/sdk/transactionState-CJ4U8pcl.js +0 -1894
  1535. package/dist/esm/sdk/types-Dx9fczU7.js +0 -111
  1536. package/dist/esm/sdk/validation-gat4LEKm.js +0 -409
  1537. package/dist/esm/sdk/wallet-recovery-BX61-79p.js +0 -1902
  1538. package/dist/esm/sdk/walletAuthority-DD9T25F6.js +0 -1247
  1539. package/dist/esm/sdk/walletCustodyEcdsaContinuity-CF4bv9OI.js +0 -11000
  1540. package/dist/esm/sdk/walletIframeIdentity-DB6Z2EC9.js +0 -13
  1541. package/dist/esm/sdk/walletRecoveryCommit-AI1AtIRP.js +0 -2101
  1542. package/dist/esm/sdk/walletRecoveryRotate-BgLlW5ih.js +0 -309
  1543. package/dist/esm/sdk/warmSessionHydration-Os8niEm7.js +0 -7
  1544. package/dist/esm/sdk/webauthnP256-DC5EIbKN.js +0 -82
  1545. package/dist/esm/sdk/webauthnPromptCoordinator-L96oVvLz.js +0 -168
  1546. package/dist/esm/shared-ts/src/signing-lanes/rotationDigests.js +0 -6
  1547. package/dist/esm/shared-ts/src/signing-lanes/rotationParsers.js +0 -3
  1548. package/dist/esm/shared-ts/src/signing-lanes/rotationProtocolParsers.js +0 -8
  1549. package/dist/esm/shared-ts/src/signing-lanes/rotationWireFields.js +0 -3
  1550. package/dist/esm/shared-ts/src/utils/addWalletAuthMethod.js +0 -1
  1551. package/dist/esm/styles.css +0 -43
  1552. package/dist/public/sdk/ConfirmationDrawer-MgFTBwwK.js +0 -425
  1553. package/dist/public/sdk/EvmClient-f3gUhS2L.js +0 -644
  1554. package/dist/public/sdk/NearClient-DY4NfHeD.js +0 -402
  1555. package/dist/public/sdk/NonceCoordinator-4XWPhYww.js +0 -2253
  1556. package/dist/public/sdk/accountIds-DhIPGOSN.js +0 -23
  1557. package/dist/public/sdk/accountLifecycle-zthG08aC.js +0 -1341
  1558. package/dist/public/sdk/actions-CCvThiKe.js +0 -225
  1559. package/dist/public/sdk/adapters-Dli9XAZp.js +0 -4836
  1560. package/dist/public/sdk/base-D1B5mGin.js +0 -64
  1561. package/dist/public/sdk/base64-Clm8C-e9.js +0 -68
  1562. package/dist/public/sdk/browser-D6eZGhzE.js +0 -2393
  1563. package/dist/public/sdk/bytes-qKxKn4gg.js +0 -40
  1564. package/dist/public/sdk/canonicalPrimitives-BTHWz80v.js +0 -36
  1565. package/dist/public/sdk/canonicalSignerErrorCode-BBIk365e.js +0 -139
  1566. package/dist/public/sdk/capabilityKinds-hvYqa6S_.js +0 -109
  1567. package/dist/public/sdk/chains-BMh3btVo.js +0 -124
  1568. package/dist/public/sdk/challengeDelivery-DZtopOAG.js +0 -74
  1569. package/dist/public/sdk/chunk-BtrIJ4_z.js +0 -33
  1570. package/dist/public/sdk/configHelpers-D1EqxVxg.js +0 -179
  1571. package/dist/public/sdk/csp-stylesheet-btENhsNp.js +0 -215
  1572. package/dist/public/sdk/defaultConfigs-D_33pPT9.js +0 -355
  1573. package/dist/public/sdk/display-P4nQF-yc.js +0 -126
  1574. package/dist/public/sdk/domainIds-lcrFg6Sa.js +0 -338
  1575. package/dist/public/sdk/ecdsaCapabilityManifest-DuMs0VtU.js +0 -805
  1576. package/dist/public/sdk/ecdsaChainTarget-Bl-JWyuw.js +0 -121
  1577. package/dist/public/sdk/ecdsaPresignLifecycle-Bfx2AQKb.js +0 -1983
  1578. package/dist/public/sdk/ecdsaPresignPoolIdentity-BjxZVIqn.js +0 -47
  1579. package/dist/public/sdk/ecdsaWalletRecords-D42rtA9z.js +0 -18
  1580. package/dist/public/sdk/encoders-D8d07vpx.js +0 -0
  1581. package/dist/public/sdk/enrichDisplayModelWithAbi-CWggsykc.js +0 -395
  1582. package/dist/public/sdk/enrichDisplayModelWithAbi-SDRwTd_M.js +0 -579
  1583. package/dist/public/sdk/errors-93h9uAW9.js +0 -92
  1584. package/dist/public/sdk/events-DYoBL2HO.js +0 -8
  1585. package/dist/public/sdk/evmCryptoWasm-DWklhEEb.js +0 -196
  1586. package/dist/public/sdk/evmFamilyEcdsaIdentity-CqGafQsI.js +0 -4274
  1587. package/dist/public/sdk/exactSessionState-LWDUXydN.js +0 -2592
  1588. package/dist/public/sdk/exactSigningLaneIdentity-m6uTXV_A.js +0 -335
  1589. package/dist/public/sdk/executeWorkerOperation-Cl9whMK7.js +0 -10
  1590. package/dist/public/sdk/export-viewer-host-rWMSQQMP.js +0 -204
  1591. package/dist/public/sdk/helpers-ZrowMnev.js +0 -302
  1592. package/dist/public/sdk/host-CnV8nAUe.js +0 -533
  1593. package/dist/public/sdk/intentDigest-CvOSNlCH.js +0 -75
  1594. package/dist/public/sdk/jsonRpc-VVkaQkFD.js +0 -62
  1595. package/dist/public/sdk/jsxRuntime.module-CuH5ZEIA.js +0 -298
  1596. package/dist/public/sdk/keccak-DUL3d8SF.js +0 -148
  1597. package/dist/public/sdk/keyMaterialBrands-CogGAAZn.js +0 -94
  1598. package/dist/public/sdk/localOnly-DTpa2jD5.js +0 -146
  1599. package/dist/public/sdk/messages-C7Dbx9iN.js +0 -594
  1600. package/dist/public/sdk/mountExportPrivateKeySurface-DgX-IBG_.js +0 -542
  1601. package/dist/public/sdk/mountRecoveryCodeBackupSurface-DXrExiJ7.js +0 -590
  1602. package/dist/public/sdk/nearEd25519YaoMaterialActivation-B5GecIvq.js +0 -4018
  1603. package/dist/public/sdk/nearEd25519YaoSigningPreparation-CdOT5RuC.js +0 -405
  1604. package/dist/public/sdk/nearRpcResults-DoUgDATm.js +0 -216
  1605. package/dist/public/sdk/nonceLaneKeys-C3c9lG6u.js +0 -164
  1606. package/dist/public/sdk/normalization-CBt413-z.js +0 -22
  1607. package/dist/public/sdk/operationFingerprint-C8Trar4R.js +0 -929
  1608. package/dist/public/sdk/operationFingerprint-CGZui5dR.js +0 -55
  1609. package/dist/public/sdk/passkey-custody-UUHbC0pk.js +0 -487
  1610. package/dist/public/sdk/pendingWalletRecoveryCodeBackup-BWluQMbt.js +0 -237
  1611. package/dist/public/sdk/prfCache-wqQSjYLn.js +0 -58
  1612. package/dist/public/sdk/profileAccountProjection-uZVJuBvS.js +0 -86
  1613. package/dist/public/sdk/promptText-CuRa_ivd.js +0 -32
  1614. package/dist/public/sdk/recovery-entrypoint-C3fydnRC.js +0 -779
  1615. package/dist/public/sdk/registration-Ct_7LdGf.js +0 -14402
  1616. package/dist/public/sdk/registration-DHERU8R_.js +0 -233
  1617. package/dist/public/sdk/registrationAccounts-DmWPzf3T.js +0 -33
  1618. package/dist/public/sdk/registrationIds-DLSdEKSv.js +0 -310
  1619. package/dist/public/sdk/registrationIntent-4zwk16zQ.js +0 -387
  1620. package/dist/public/sdk/registrationPreparationPreload-D6zpWp4O.js +0 -13
  1621. package/dist/public/sdk/registrationSignerPlan-DhV8VAob.js +0 -437
  1622. package/dist/public/sdk/relayerHttp-VC8Holz1.js +0 -24
  1623. package/dist/public/sdk/routePlan-D59x5xzQ.js +0 -83
  1624. package/dist/public/sdk/router-B4ZWFy9E.js +0 -4721
  1625. package/dist/public/sdk/routerAbNormalSigning-CVFEOZ2m.js +0 -992
  1626. package/dist/public/sdk/runtime-auth-DdfynDKt.js +0 -5393
  1627. package/dist/public/sdk/runtime-device-link-HJ2ptFux.js +0 -259
  1628. package/dist/public/sdk/runtime-ecdsa-tempo-BGLsTAWR.js +0 -177
  1629. package/dist/public/sdk/runtime-email-otp-CpX88VZJ.js +0 -320
  1630. package/dist/public/sdk/runtime-export-DIVY473L.js +0 -112
  1631. package/dist/public/sdk/runtime-near-CxtQi4b2.js +0 -278
  1632. package/dist/public/sdk/runtime-preferences-vnJc5Svg.js +0 -67
  1633. package/dist/public/sdk/runtime-recovery-codes-BSCLVHQj.js +0 -95
  1634. package/dist/public/sdk/runtime-recovery-i08vCJST.js +0 -45
  1635. package/dist/public/sdk/runtimeContext-D3TBExQ6.js +0 -44484
  1636. package/dist/public/sdk/runtimeLoader-DQVEFVaW.js +0 -44
  1637. package/dist/public/sdk/sdkSentEvents-MqDkbQg1.js +0 -599
  1638. package/dist/public/sdk/secp256k1-D-I6Gh4D.js +0 -2515
  1639. package/dist/public/sdk/secureRandomId-BORsmdS4.js +0 -33
  1640. package/dist/public/sdk/sessionPolicy-DO-MkL65.js +0 -460
  1641. package/dist/public/sdk/shared-DkbeLCI3.js +0 -33
  1642. package/dist/public/sdk/signEvmFamily-C3C97Th-.js +0 -4607
  1643. package/dist/public/sdk/signEvmFamilyWithUiConfirmForTempo-BI9DSTIS.js +0 -226
  1644. package/dist/public/sdk/signEvmWithUiConfirm-Bmcim5-g.js +0 -27
  1645. package/dist/public/sdk/signNear-Bmb2fj_a.js +0 -5893
  1646. package/dist/public/sdk/signatureUses-BkGyYt8F.js +0 -51
  1647. package/dist/public/sdk/signerDomain-IEAVrOrc.js +0 -59
  1648. package/dist/public/sdk/signerLoader-B7orgq5Z.js +0 -23
  1649. package/dist/public/sdk/signerSlot-_ovonwVX.js +0 -10
  1650. package/dist/public/sdk/signingFlow-SZ8t_lxv.js +0 -1319
  1651. package/dist/public/sdk/signingSessionSeal-Cu-GHm6y.js +0 -96
  1652. package/dist/public/sdk/surface-measurement-reporter-CSTyRsMa.js +0 -156
  1653. package/dist/public/sdk/trace-DKLQZvec.js +0 -126
  1654. package/dist/public/sdk/transaction-activity-CSMCveBn.js +0 -218
  1655. package/dist/public/sdk/transactionReview-DpHLTznU.js +0 -100
  1656. package/dist/public/sdk/transactionReviewAdmission-BCPvl8OZ.js +0 -172
  1657. package/dist/public/sdk/transactionState-CJ4U8pcl.js +0 -1894
  1658. package/dist/public/sdk/types-Dx9fczU7.js +0 -111
  1659. package/dist/public/sdk/validation-gat4LEKm.js +0 -409
  1660. package/dist/public/sdk/wallet-recovery-BX61-79p.js +0 -1902
  1661. package/dist/public/sdk/walletAuthority-DD9T25F6.js +0 -1247
  1662. package/dist/public/sdk/walletCustodyEcdsaContinuity-CF4bv9OI.js +0 -11000
  1663. package/dist/public/sdk/walletIframeIdentity-DB6Z2EC9.js +0 -13
  1664. package/dist/public/sdk/walletRecoveryCommit-AI1AtIRP.js +0 -2101
  1665. package/dist/public/sdk/walletRecoveryRotate-BgLlW5ih.js +0 -309
  1666. package/dist/public/sdk/warmSessionHydration-Os8niEm7.js +0 -7
  1667. package/dist/public/sdk/webauthnP256-DC5EIbKN.js +0 -82
  1668. package/dist/public/sdk/webauthnPromptCoordinator-L96oVvLz.js +0 -168
  1669. package/dist/types/shared-ts/src/signing-lanes/participantDigest.typecheck.d.ts +0 -2
  1670. package/dist/types/shared-ts/src/signing-lanes/rotation.typecheck.d.ts +0 -2
  1671. package/dist/types/shared-ts/src/signing-lanes/rotationDigests.d.ts +0 -13
  1672. package/dist/types/shared-ts/src/signing-lanes/rotationLifecycle.d.ts +0 -78
  1673. package/dist/types/shared-ts/src/signing-lanes/rotationParsers.d.ts +0 -27
  1674. package/dist/types/shared-ts/src/signing-lanes/rotationProtocolParsers.d.ts +0 -6
  1675. package/dist/types/shared-ts/src/signing-lanes/rotationWireFields.d.ts +0 -20
  1676. package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeAttempt.d.ts +0 -59
  1677. package/dist/types/wallet/src/SeamsWeb/walletIframe/client/transport/webauthn-bridge.d.ts +0 -3
  1678. package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/laneHolderMaterialStore.d.ts +0 -52
  1679. package/dist/types/wallet/src/core/signingEngine/interfaces/nearKeyOps.d.ts +0 -15
  1680. package/dist/types/wallet/src/core/signingEngine/session/holderShares/forbiddenHolderSharePayloads.typecheck.d.ts +0 -2
  1681. package/dist/types/wallet/src/core/signingEngine/session/holderShares/holderShareHandle.d.ts +0 -6
  1682. package/dist/types/wallet/src/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.typecheck.d.ts +0 -2
  1683. package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/activationCoordinator.d.ts +0 -37
  1684. package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/laneMaterialInvalidation.d.ts +0 -23
  1685. package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/operations.typecheck.d.ts +0 -2
  1686. package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/recipientPreparation.d.ts +0 -55
  1687. package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.typecheck.d.ts +0 -6
  1688. package/dist/types/wallet/src/core/signingEngine/threshold/crypto/ecdsaLaneWasm.d.ts +0 -4
  1689. package/dist/types/wallet/src/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.d.ts +0 -44
  1690. package/dist/types/wallet/src/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.d.ts +0 -4
  1691. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/ecdsaLaneHolderWorkerRuntime.d.ts +0 -20
  1692. package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/passkeyCustodyLink.d.ts +0 -18
  1693. /package/dist/esm/{react/SeamsWeb → SeamsWeb}/assembly/preconnectWalletAssets.js +0 -0
@@ -1,4836 +0,0 @@
1
- import { R as normalizeOptionalNonEmptyString } from "./domainIds-lcrFg6Sa.js";
2
- import { l as isFunction, p as isString, u as isObject } from "./validation-gat4LEKm.js";
3
- import { r as reviewAdmissionForBinding } from "./transactionReviewAdmission-BCPvl8OZ.js";
4
- import { a as isWebAuthnRpIdOriginConfigurationError, o as toError, r as isTouchIdCancellationError, t as errorMessage } from "./errors-93h9uAW9.js";
5
- import { c as resolveExplorerUrlForChainFamily } from "./chains-BMh3btVo.js";
6
- import { t as toAccountId } from "./accountIds-DhIPGOSN.js";
7
- import { p as nonceLeaseToRef } from "./nonceLaneKeys-C3c9lG6u.js";
8
- import { i as buildNearAccountRefs, n as resolveProfileAccountContextFromCandidates } from "./profileAccountProjection-uZVJuBvS.js";
9
- import { u as emitSigningSessionFlowTrace } from "./trace-DKLQZvec.js";
10
- import { a as toActionArgsWasm, i as isActionArgsWasm, r as fromTransactionInputsWasm, t as ActionType } from "./actions-CCvThiKe.js";
11
- import { i as orderActionForDigest, r as computeUiIntentDigestFromTxs } from "./intentDigest-CvOSNlCH.js";
12
- import { t as createWalletIframeSurfaceMeasurementReporter } from "./surface-measurement-reporter-CSTyRsMa.js";
13
- import { r as appearanceTokenCssRule } from "./csp-stylesheet-btENhsNp.js";
14
- import { n as buildNearNonceLane } from "./NonceCoordinator-4XWPhYww.js";
15
- import { n as SigningAuthPlanKind, s as signingAuthModeFromSigningAuthPlan, t as formatEmailOtpSentText } from "./promptText-CuRa_ivd.js";
16
- import { a as retainTransactionActivity } from "./transaction-activity-CSMCveBn.js";
17
- import { a as R, i as M, n as confirmationDocumentStyles, o as S, r as C, t as u } from "./jsxRuntime.module-CuH5ZEIA.js";
18
- import { i as copySurfaceText, n as ConfirmationModal, r as CopyStatusIcon, t as ConfirmationDrawer } from "./ConfirmationDrawer-MgFTBwwK.js";
19
- //#region src/core/types/confirmationConfig.ts
20
- function normalizeVisibleUiMode(uiMode) {
21
- return uiMode === "drawer" ? "drawer" : "modal";
22
- }
23
- function normalizeAutoProceedDelay(delay) {
24
- if (typeof delay !== "number" || !Number.isFinite(delay)) return 0;
25
- return Math.max(0, Math.floor(delay));
26
- }
27
- function normalizeConfirmationConfig(input) {
28
- if (input?.uiMode === "none") return {
29
- kind: "silent",
30
- uiMode: "none"
31
- };
32
- const uiMode = normalizeVisibleUiMode(input?.uiMode);
33
- if (input?.behavior === "skipClick") return {
34
- kind: "auto_proceed",
35
- uiMode,
36
- behavior: "skipClick",
37
- autoProceedDelay: normalizeAutoProceedDelay(input.autoProceedDelay)
38
- };
39
- return {
40
- kind: "interactive",
41
- uiMode,
42
- behavior: "requireClick"
43
- };
44
- }
45
- function silentConfirmationConfig() {
46
- return {
47
- kind: "silent",
48
- uiMode: "none"
49
- };
50
- }
51
- function assertNeverConfirmationConfig(value) {
52
- throw new Error(`Unsupported confirmation config: ${String(value.kind)}`);
53
- }
54
- //#endregion
55
- //#region src/core/signingEngine/stepUpConfirmation/userConfirmationType.ts
56
- let UserConfirmationType = /* @__PURE__ */ function(UserConfirmationType) {
57
- UserConfirmationType["SIGN_TRANSACTION"] = "signTransaction";
58
- UserConfirmationType["REGISTER_ACCOUNT"] = "registerAccount";
59
- UserConfirmationType["LINK_DEVICE"] = "linkDevice";
60
- UserConfirmationType["AUTHORIZE_KEY_EXPORT"] = "authorizeKeyExport";
61
- UserConfirmationType["SIGN_NEP413_MESSAGE"] = "signNep413Message";
62
- UserConfirmationType["SHOW_SECURE_PRIVATE_KEY_UI"] = "showSecurePrivateKeyUi";
63
- UserConfirmationType["SIGN_INTENT_DIGEST"] = "signIntentDigest";
64
- return UserConfirmationType;
65
- }({});
66
- //#endregion
67
- //#region src/core/signingEngine/stepUpConfirmation/channel/confirmTypes.ts
68
- let UserConfirmMessageType = /* @__PURE__ */ function(UserConfirmMessageType) {
69
- UserConfirmMessageType["PROMPT_USER_CONFIRM_IN_JS_MAIN_THREAD"] = "PROMPT_USER_CONFIRM_IN_JS_MAIN_THREAD";
70
- UserConfirmMessageType["USER_PASSKEY_CONFIRM_RESPONSE"] = "USER_PASSKEY_CONFIRM_RESPONSE";
71
- UserConfirmMessageType["USER_PASSKEY_CONFIRM_PROGRESS"] = "USER_PASSKEY_CONFIRM_PROGRESS";
72
- return UserConfirmMessageType;
73
- }({});
74
- //#endregion
75
- //#region src/core/signingEngine/uiConfirm/ui/surface-measurement-binding.ts
76
- function sameSurfaceMeasurementBinding(left, right) {
77
- if (!left || left.kind !== right.kind) return false;
78
- switch (left.kind) {
79
- case "disabled": return right.kind === "disabled";
80
- case "wallet_iframe": return right.kind === "wallet_iframe" && left.requestId === right.requestId && left.postMeasurement === right.postMeasurement && left.hostSurfaceVariant === right.hostSurfaceVariant;
81
- }
82
- }
83
- //#endregion
84
- //#region src/core/signingEngine/uiConfirm/ui/appearance.ts
85
- const DEFAULT_UI_APPEARANCE = {
86
- theme: {
87
- id: "default",
88
- mode: "dark",
89
- colors: {}
90
- },
91
- palette: "default"
92
- };
93
- function isThemeMode(value) {
94
- return value === "light" || value === "dark";
95
- }
96
- function resolveUiAppearance(args) {
97
- const appearance = args.requestedAppearance ?? args.getAppearance?.() ?? DEFAULT_UI_APPEARANCE;
98
- if (!isThemeMode(args.requestedMode) || args.requestedMode === appearance.theme.mode) return appearance;
99
- return {
100
- ...appearance,
101
- theme: {
102
- ...appearance.theme,
103
- mode: args.requestedMode
104
- }
105
- };
106
- }
107
- //#endregion
108
- //#region src/core/signingEngine/uiConfirm/handlers/flows/adapters/request.ts
109
- function assertSigningRequestContext(request) {
110
- if (request.type !== UserConfirmationType.SIGN_TRANSACTION) return;
111
- const payload = request.payload;
112
- if (payload.signingKind !== "transaction") return;
113
- const { subject, operation, signatureUses } = payload.nearFundingRequest;
114
- if (subject.walletId !== payload.walletId || subject.nearAccountId !== payload.rpcCall.nearAccountId || subject.nearPublicKeyStr !== payload.nearPublicKeyStr) throw new Error("Invalid secure confirm request: NEAR funding subject mismatch");
115
- if (operation.accountId !== subject.nearAccountId) throw new Error("Invalid secure confirm request: NEAR funding operation account mismatch");
116
- if (!Number.isInteger(signatureUses) || signatureUses < 1) throw new Error("Invalid secure confirm request: invalid NEAR funding signature use count");
117
- }
118
- function assertNoForbiddenMainThreadSigningSecrets(request) {
119
- if (request.type !== UserConfirmationType.SIGN_TRANSACTION && request.type !== UserConfirmationType.SIGN_NEP413_MESSAGE) return;
120
- const payload = request.payload;
121
- if (payload.prfOutput !== void 0) throw new Error("Invalid secure confirm request: forbidden signing payload field prfOutput");
122
- if (payload.wrapKeySeed !== void 0) throw new Error("Invalid secure confirm request: forbidden signing payload field wrapKeySeed");
123
- if (payload.wrapKeySalt !== void 0) throw new Error("Invalid secure confirm request: forbidden signing payload field wrapKeySalt");
124
- }
125
- function getNearAccountId(request) {
126
- switch (request.type) {
127
- case UserConfirmationType.SIGN_TRANSACTION: return getSignTransactionPayload(request).rpcCall.nearAccountId;
128
- case UserConfirmationType.SIGN_NEP413_MESSAGE: return request.payload.nearAccountId;
129
- case UserConfirmationType.SIGN_INTENT_DIGEST: {
130
- const subject = getSignIntentDigestSubject(request);
131
- return subject.kind === "near_wallet" ? subject.nearAccountId : "";
132
- }
133
- case UserConfirmationType.REGISTER_ACCOUNT:
134
- case UserConfirmationType.LINK_DEVICE: return String(getRegisterAccountPayload(request).nearAccountId || "").trim();
135
- case UserConfirmationType.AUTHORIZE_KEY_EXPORT: {
136
- const subject = getLocalOnlyExportSubject(request);
137
- return subject.kind === "near_wallet" ? subject.nearAccountId : "";
138
- }
139
- case UserConfirmationType.SHOW_SECURE_PRIVATE_KEY_UI: {
140
- const subject = getLocalOnlyExportSubject(request);
141
- return subject.kind === "near_wallet" ? subject.nearAccountId : "";
142
- }
143
- default: return "";
144
- }
145
- }
146
- function getLocalOnlyExportSubject(request) {
147
- if (request.type !== UserConfirmationType.AUTHORIZE_KEY_EXPORT && request.type !== UserConfirmationType.SHOW_SECURE_PRIVATE_KEY_UI) throw new Error(`Expected local key export request, got ${request.type}`);
148
- return request.payload.subject;
149
- }
150
- function getLocalOnlyExportSubjectId(request) {
151
- const subject = getLocalOnlyExportSubject(request);
152
- switch (subject.kind) {
153
- case "near_wallet": return subject.nearAccountId;
154
- case "evm_wallet": return subject.walletId;
155
- default: {
156
- const exhaustive = subject;
157
- throw new Error(`Unsupported local key export subject: ${String(exhaustive)}`);
158
- }
159
- }
160
- }
161
- function getSignIntentDigestSubject(request) {
162
- if (request.type !== UserConfirmationType.SIGN_INTENT_DIGEST) throw new Error(`Expected SIGN_INTENT_DIGEST request, got ${request.type}`);
163
- return request.payload.signingSubject;
164
- }
165
- function getWalletId(request) {
166
- switch (request.type) {
167
- case UserConfirmationType.SIGN_TRANSACTION: return String(getSignTransactionPayload(request).walletId || "").trim();
168
- case UserConfirmationType.SIGN_NEP413_MESSAGE: return String(request.payload.walletId || "").trim();
169
- case UserConfirmationType.REGISTER_ACCOUNT:
170
- case UserConfirmationType.LINK_DEVICE: return String(getRegisterAccountPayload(request).walletId || "").trim();
171
- case UserConfirmationType.SIGN_INTENT_DIGEST: return getSignIntentDigestSubject(request).walletId;
172
- case UserConfirmationType.AUTHORIZE_KEY_EXPORT:
173
- case UserConfirmationType.SHOW_SECURE_PRIVATE_KEY_UI: return getLocalOnlyExportSubjectId(request);
174
- default: return getNearAccountId(request);
175
- }
176
- }
177
- function getTxCount(request) {
178
- return request.type === UserConfirmationType.SIGN_TRANSACTION ? getSignTransactionPayload(request).txSigningRequests?.length || 1 : 1;
179
- }
180
- function getIntentDigest(request) {
181
- if (request.type === UserConfirmationType.SIGN_TRANSACTION) return request.payload.intentDigest;
182
- return request?.intentDigest;
183
- }
184
- function getSignTransactionPayload(request) {
185
- if (request.type !== UserConfirmationType.SIGN_TRANSACTION) throw new Error(`Expected SIGN_TRANSACTION request, got ${request.type}`);
186
- return request.payload;
187
- }
188
- function getDisplayModel(request) {
189
- if (request.type === UserConfirmationType.SIGN_TRANSACTION) return getSignTransactionPayload(request).displayModel;
190
- if (request.type === UserConfirmationType.SIGN_NEP413_MESSAGE) return request.payload.displayModel;
191
- if (request.type === UserConfirmationType.SIGN_INTENT_DIGEST) return request.payload.displayModel;
192
- }
193
- function getSigningAuthMode(request) {
194
- if (request.type === UserConfirmationType.SIGN_TRANSACTION) return signingAuthModeFromSigningAuthPlan(getSignTransactionPayload(request).signingAuthPlan);
195
- if (request.type === UserConfirmationType.SIGN_NEP413_MESSAGE) {
196
- const payload = request.payload;
197
- return signingAuthModeFromSigningAuthPlan(payload.signingAuthPlan);
198
- }
199
- if (request.type === UserConfirmationType.SIGN_INTENT_DIGEST) {
200
- const payload = request.payload;
201
- return signingAuthModeFromSigningAuthPlan(payload.signingAuthPlan);
202
- }
203
- }
204
- function getEmailOtpPrompt(request) {
205
- if (request.type === UserConfirmationType.SIGN_TRANSACTION) {
206
- const payload = getSignTransactionPayload(request);
207
- return payload.signingAuthPlan?.kind === SigningAuthPlanKind.EmailOtpReauth ? payload.signingAuthPlan.emailOtpPrompt : payload.emailOtpPrompt;
208
- }
209
- if (request.type === UserConfirmationType.SIGN_NEP413_MESSAGE) {
210
- const payload = request.payload;
211
- return payload.signingAuthPlan?.kind === SigningAuthPlanKind.EmailOtpReauth ? payload.signingAuthPlan.emailOtpPrompt : payload.emailOtpPrompt;
212
- }
213
- if (request.type === UserConfirmationType.SIGN_INTENT_DIGEST) {
214
- const payload = request.payload;
215
- return payload.signingAuthPlan?.kind === SigningAuthPlanKind.EmailOtpReauth ? payload.signingAuthPlan.emailOtpPrompt : payload.emailOtpPrompt;
216
- }
217
- }
218
- function getRegisterAccountPayload(request) {
219
- if (request.type !== UserConfirmationType.REGISTER_ACCOUNT && request.type !== UserConfirmationType.LINK_DEVICE) throw new Error(`Expected REGISTER_ACCOUNT or LINK_DEVICE request, got ${request.type}`);
220
- return request.payload;
221
- }
222
- //#endregion
223
- //#region src/core/signingEngine/stepUpConfirmation/channel/confirmCommon.ts
224
- function parseTransactionSummary(summaryData) {
225
- if (typeof summaryData === "string") {
226
- const raw = summaryData.trim();
227
- if (!raw) return {};
228
- try {
229
- const parsed = JSON.parse(raw);
230
- if (isObject(parsed) && !Array.isArray(parsed)) return parsed;
231
- return {};
232
- } catch {
233
- return {};
234
- }
235
- }
236
- if (!isObject(summaryData) || Array.isArray(summaryData)) throw new Error("Invalid secure confirm request summary: expected an object");
237
- return summaryData;
238
- }
239
- function sanitizeForPostMessage(data) {
240
- if (data == null) return data;
241
- if (Array.isArray(data)) return data.map((v) => v);
242
- if (isObject(data)) {
243
- const src = data;
244
- const out = {};
245
- for (const key of Object.keys(src)) {
246
- if (key === "_confirmHandle") continue;
247
- const value = src[key];
248
- if (isFunction(value)) continue;
249
- out[key] = value;
250
- }
251
- return out;
252
- }
253
- return data;
254
- }
255
- const ERROR_MESSAGES = {
256
- cancelled: "User cancelled secure confirm request",
257
- collectCredentialsFailed: "Failed to collect credentials",
258
- nearRpcFailed: "Failed to fetch NEAR data"
259
- };
260
- function getWorkerChannelToken(worker) {
261
- return normalizeOptionalNonEmptyString(worker.channelToken);
262
- }
263
- function createUserConfirmScopedWorker(worker, options) {
264
- const channelToken = normalizeOptionalNonEmptyString(options?.channelToken);
265
- if (!channelToken && !options?.onDecision) return worker;
266
- return {
267
- postMessage: worker.postMessage.bind(worker),
268
- ...channelToken ? { channelToken } : {},
269
- ...options?.onDecision ? { onDecision: options.onDecision } : {}
270
- };
271
- }
272
- function sendConfirmResponse(worker, response, options) {
273
- const { _confirmHandle: _ignoredConfirmHandle, ...decision } = response;
274
- const requestId = isString(decision.requestId) ? decision.requestId : response.requestId;
275
- const channelToken = normalizeOptionalNonEmptyString(options?.channelToken) ?? getWorkerChannelToken(worker);
276
- const envelope = {
277
- type: UserConfirmMessageType.USER_PASSKEY_CONFIRM_RESPONSE,
278
- requestId,
279
- data: decision,
280
- ...channelToken ? { channelToken } : {}
281
- };
282
- worker.onDecision?.(decision);
283
- worker.postMessage(envelope);
284
- }
285
- function sendConfirmProgress(worker, progress, options) {
286
- const sanitized = sanitizeForPostMessage(progress);
287
- const requestId = isString(sanitized?.requestId) ? sanitized.requestId : progress.requestId;
288
- const channelToken = normalizeOptionalNonEmptyString(options?.channelToken) ?? getWorkerChannelToken(worker);
289
- const envelope = {
290
- type: UserConfirmMessageType.USER_PASSKEY_CONFIRM_PROGRESS,
291
- requestId,
292
- data: sanitized,
293
- ...channelToken ? { channelToken } : {}
294
- };
295
- worker.postMessage(envelope);
296
- }
297
- function isUserCancelledUserConfirm(error) {
298
- if (isWebAuthnRpIdOriginConfigurationError(error)) return false;
299
- return isTouchIdCancellationError(error) || (() => {
300
- const e = toError(error);
301
- return e?.name === "NotAllowedError" || e?.name === "AbortError";
302
- })();
303
- }
304
- //#endregion
305
- //#region src/core/signingEngine/webauthnAuth/credentials/collectAuthenticationCredentialForChallengeB64u.ts
306
- async function listActiveWalletPasskeyAuthenticators(args) {
307
- const [authenticators, methods] = await Promise.all([args.credentialStore.listWalletPasskeyAuthenticators(args.walletId), args.credentialStore.listWalletAuthMethodsV2ForWallet(args.walletId)]);
308
- const activeCredentialIds = /* @__PURE__ */ new Set();
309
- for (const method of methods) if (method.kind === "passkey" && method.status === "active" && String(method.walletId) === args.walletId) activeCredentialIds.add(method.credentialIdB64u);
310
- return authenticators.filter((authenticator) => activeCredentialIds.has(authenticator.credentialId));
311
- }
312
- function authenticatorsToAllowCredentials(authenticators) {
313
- return authenticators.map((auth) => ({
314
- id: String(auth.credentialId || ""),
315
- type: "public-key",
316
- transports: Array.isArray(auth.transports) ? auth.transports : []
317
- }));
318
- }
319
- function canonicalWalletIdFromPasskeySigner(signer) {
320
- if (String(signer.signerAuthMethod || "") !== "passkey") return "";
321
- const walletId = String(signer.metadata?.walletId || "").trim();
322
- const credentialId = String(signer.metadata?.passkeyCredentialRawId || "").trim();
323
- return walletId && credentialId ? walletId : "";
324
- }
325
- async function resolveCanonicalWalletPasskeyContext(args) {
326
- const signers = await args.credentialStore.listAccountSigners({
327
- chainIdKey: args.chainIdKey,
328
- accountAddress: args.accountAddress,
329
- status: "active"
330
- });
331
- const walletIds = Array.from(new Set(signers.map(canonicalWalletIdFromPasskeySigner).filter(Boolean)));
332
- if (walletIds.length === 0) throw new Error(`[multichain] no passkey signer found for account ${args.accountLabel}`);
333
- if (walletIds.length > 1) throw new Error(`[multichain] multiple wallet identities found for account ${args.accountLabel}`);
334
- const walletId = walletIds[0];
335
- return {
336
- walletId,
337
- authenticators: await listActiveWalletPasskeyAuthenticators({
338
- credentialStore: args.credentialStore,
339
- walletId
340
- })
341
- };
342
- }
343
- async function collectFromAuthenticators(args) {
344
- if (args.authenticators.length === 0) throw new Error(`[multichain] no passkeys found for account ${String(args.accountLabel)}`);
345
- const authenticatorsForPrompt = (await args.credentialStore.selectProfileAuthenticatorsForPrompt({
346
- profileId: args.profileId,
347
- authenticators: args.authenticators,
348
- accountLabel: String(args.accountLabel)
349
- })).authenticatorsForPrompt;
350
- if (authenticatorsForPrompt.length === 0) throw new Error(`[multichain] no passkey credential selected for account ${String(args.accountLabel)}`);
351
- args.onBeforePrompt?.({
352
- authenticators: args.authenticators,
353
- authenticatorsForPrompt,
354
- challengeB64u: args.challengeB64u
355
- });
356
- const allowCredentials = authenticatorsToAllowCredentials(authenticatorsForPrompt);
357
- const serialized = await args.touchIdPrompt.getAuthenticationCredentialsSerializedForChallengeB64u({
358
- subjectId: String(args.accountLabel),
359
- challengeB64u: args.challengeB64u,
360
- allowCredentials,
361
- cancellation: args.cancellation,
362
- includeSecondPrfOutput: args.includeSecondPrfOutput
363
- });
364
- const selected = await args.credentialStore.selectProfileAuthenticatorsForPrompt({
365
- profileId: args.profileId,
366
- authenticators: args.authenticators,
367
- selectedCredentialRawId: serialized.rawId,
368
- accountLabel: String(args.accountLabel)
369
- });
370
- if (selected?.wrongPasskeyError) throw new Error(String(selected.wrongPasskeyError));
371
- return serialized;
372
- }
373
- async function collectFromExactAuthenticator(args) {
374
- const credentialIdB64u = String(args.credentialIdB64u || "").trim();
375
- if (!credentialIdB64u) throw new Error("[webauthn] exact passkey credential is required");
376
- const credential = await args.touchIdPrompt.getAuthenticationCredentialsSerializedForChallengeB64u({
377
- subjectId: String(args.accountLabel),
378
- challengeB64u: args.challengeB64u,
379
- allowCredentials: [{
380
- id: credentialIdB64u,
381
- type: "public-key",
382
- transports: []
383
- }],
384
- cancellation: args.cancellation,
385
- includeSecondPrfOutput: args.includeSecondPrfOutput
386
- });
387
- if (credential.rawId !== credentialIdB64u) throw new Error("[webauthn] authentication returned a different passkey credential");
388
- return credential;
389
- }
390
- async function collectAuthenticationCredentialForExactNearChallengeB64u(args) {
391
- const nearAccountId = toAccountId(args.nearAccountId);
392
- return await collectFromExactAuthenticator({
393
- touchIdPrompt: args.touchIdPrompt,
394
- accountLabel: nearAccountId,
395
- challengeB64u: args.challengeB64u,
396
- credentialIdB64u: args.credentialIdB64u,
397
- cancellation: args.cancellation,
398
- includeSecondPrfOutput: args.includeSecondPrfOutput
399
- });
400
- }
401
- async function collectAuthenticationCredentialForExactWalletChallengeB64u(args) {
402
- const walletId = String(args.walletId || "").trim();
403
- return await collectFromExactAuthenticator({
404
- touchIdPrompt: args.touchIdPrompt,
405
- accountLabel: walletId,
406
- challengeB64u: args.challengeB64u,
407
- credentialIdB64u: args.credentialIdB64u,
408
- cancellation: args.cancellation,
409
- includeSecondPrfOutput: args.includeSecondPrfOutput
410
- });
411
- }
412
- async function collectAuthenticationCredentialForChallengeB64u(args) {
413
- const nearAccountId = toAccountId(args.nearAccountId);
414
- const context = await resolveProfileAccountContextFromCandidates(args.credentialStore, buildNearAccountRefs(nearAccountId));
415
- if (!context?.profileId) throw new Error(`[multichain] no profile/account mapping found for account ${nearAccountId}`);
416
- const passkeyContext = await resolveCanonicalWalletPasskeyContext({
417
- credentialStore: args.credentialStore,
418
- chainIdKey: context.accountRef.chainIdKey,
419
- accountAddress: context.accountRef.accountAddress,
420
- accountLabel: nearAccountId
421
- });
422
- return await collectFromAuthenticators({
423
- credentialStore: args.credentialStore,
424
- touchIdPrompt: args.touchIdPrompt,
425
- profileId: passkeyContext.walletId,
426
- accountLabel: nearAccountId,
427
- authenticators: passkeyContext.authenticators,
428
- challengeB64u: args.challengeB64u,
429
- cancellation: args.cancellation,
430
- ...args.onBeforePrompt ? { onBeforePrompt: args.onBeforePrompt } : {},
431
- ...typeof args.includeSecondPrfOutput === "boolean" ? { includeSecondPrfOutput: args.includeSecondPrfOutput } : {}
432
- });
433
- }
434
- async function collectAuthenticationCredentialForWalletChallengeB64u(args) {
435
- const walletId = String(args.walletId || "").trim();
436
- const authenticators = await listActiveWalletPasskeyAuthenticators({
437
- credentialStore: args.credentialStore,
438
- walletId
439
- });
440
- return await collectFromAuthenticators({
441
- credentialStore: args.credentialStore,
442
- touchIdPrompt: args.touchIdPrompt,
443
- profileId: walletId,
444
- accountLabel: walletId,
445
- authenticators,
446
- challengeB64u: args.challengeB64u,
447
- cancellation: args.cancellation,
448
- ...args.onBeforePrompt ? { onBeforePrompt: args.onBeforePrompt } : {},
449
- ...typeof args.includeSecondPrfOutput === "boolean" ? { includeSecondPrfOutput: args.includeSecondPrfOutput } : {}
450
- });
451
- }
452
- //#endregion
453
- //#region src/core/browser/walletIframe/host-mode.ts
454
- let IS_WALLET_IFRAME_HOST = false;
455
- function __setWalletIframeHostMode(enabled = true) {
456
- IS_WALLET_IFRAME_HOST = !!enabled;
457
- }
458
- function readForcedHostModeFlag() {
459
- try {
460
- const forced = globalThis.__SEAMS_TEST_WALLET_IFRAME_HOST_MODE__;
461
- return typeof forced === "boolean" ? forced : void 0;
462
- } catch {
463
- return;
464
- }
465
- }
466
- function __isWalletIframeHostMode() {
467
- const forced = readForcedHostModeFlag();
468
- if (forced !== void 0) return forced;
469
- return IS_WALLET_IFRAME_HOST;
470
- }
471
- //#endregion
472
- //#region src/core/signingEngine/uiConfirm/ui/transaction-display/formatters.ts
473
- function formatArgs(args) {
474
- if (!args) return "";
475
- if (typeof args === "string") return args;
476
- try {
477
- return JSON.stringify(args, (_k, v) => typeof v === "bigint" ? v.toString() : v, 2);
478
- } catch {
479
- return String(args);
480
- }
481
- }
482
- function formatDeposit(deposit) {
483
- if (!deposit || deposit === "0") return "0 NEAR";
484
- try {
485
- const yocto = BigInt(deposit);
486
- const YOCTO_FACTOR = BigInt("1000000000000000000000000");
487
- const whole = yocto / YOCTO_FACTOR;
488
- const frac = yocto % YOCTO_FACTOR;
489
- const maxDecimals = 5;
490
- if (frac === BigInt(0)) return `${whole.toString()} NEAR`;
491
- let fracStr = frac.toString().padStart(24, "0").slice(0, maxDecimals);
492
- fracStr = fracStr.replace(/0+$/g, "");
493
- if (fracStr.length === 0) return `${whole.toString()} NEAR`;
494
- return `${whole.toString()}.${fracStr} NEAR`;
495
- } catch {
496
- return deposit;
497
- }
498
- }
499
- function formatGas(gas) {
500
- if (!gas) return "";
501
- try {
502
- return `${BigInt(gas) / BigInt("1000000000000")} Tgas`;
503
- } catch {
504
- return gas;
505
- }
506
- }
507
- /**
508
- * Shorten a long public key or identifier by keeping a head and tail
509
- * and replacing the middle with an ellipsis.
510
- * Example: ed25519:ABCDEFGH...WXYZ12
511
- */
512
- function shortenPubkey(pk, opts = {}) {
513
- if (!pk || typeof pk !== "string") return "";
514
- const { prefix = 12, suffix = 6 } = opts;
515
- if (pk.length <= prefix + suffix + 3) return pk;
516
- return `${pk.slice(0, prefix)}...${pk.slice(-suffix)}`;
517
- }
518
- function formatCodeSize(code) {
519
- if (!code) return "0 bytes";
520
- if (code instanceof Uint8Array) return `${code.byteLength} bytes`;
521
- if (Array.isArray(code)) return `${code.length} bytes`;
522
- if (typeof code === "string") return `${code.length} bytes`;
523
- return "unknown";
524
- }
525
- //#endregion
526
- //#region src/core/signingEngine/uiConfirm/ui/transaction-display/renderers/types.ts
527
- function sanitizeContentVariants(variants) {
528
- if (!variants) return void 0;
529
- const decoded = String(variants.decoded || "");
530
- const raw = String(variants.raw || "");
531
- if (!decoded || !raw) return void 0;
532
- if (decoded === raw) return void 0;
533
- return {
534
- decoded,
535
- raw,
536
- defaultMode: variants.defaultMode === "raw" ? "raw" : "decoded"
537
- };
538
- }
539
- function isZeroWeiDisplayField(label, value) {
540
- if (!/Value \(wei\)$/i.test(label.trim())) return false;
541
- const normalized = value.trim();
542
- if (!normalized) return false;
543
- if (normalized === "0") return true;
544
- if (/^0x0+$/i.test(normalized)) return true;
545
- try {
546
- return BigInt(normalized) === 0n;
547
- } catch {
548
- return false;
549
- }
550
- }
551
- function buildFieldNodes(parentId, fields) {
552
- if (!Array.isArray(fields) || fields.length === 0) return [];
553
- return fields.flatMap((field, fieldIndex) => {
554
- const label = String(field.label || "").trim();
555
- const value = String(field.value || "");
556
- const renderAs = field.renderAs || "inline";
557
- if (isZeroWeiDisplayField(label, value)) return [];
558
- if (renderAs === "file-content") {
559
- const contentVariants = sanitizeContentVariants(field.contentVariants);
560
- const content = contentVariants?.defaultMode === "raw" ? contentVariants.raw : contentVariants?.decoded || value;
561
- return [{
562
- id: `${parentId}-field-${fieldIndex}`,
563
- label: label ? `${label}:` : "",
564
- fieldLabel: label ? `${label}:` : void 0,
565
- type: "file",
566
- open: false,
567
- content,
568
- ...contentVariants ? { contentVariants } : {},
569
- copyValue: typeof field.copyValue === "string" ? field.copyValue : void 0,
570
- hideLabel: Boolean(field.hideLabel),
571
- hideChevron: typeof field.hideChevron === "boolean" ? field.hideChevron : true
572
- }];
573
- }
574
- return [{
575
- id: `${parentId}-field-${fieldIndex}`,
576
- label: label ? `${label}: ${value}` : value,
577
- fieldLabel: label ? `${label}:` : void 0,
578
- type: "file",
579
- open: false,
580
- copyValue: typeof field.copyValue === "string" ? field.copyValue : void 0
581
- }];
582
- });
583
- }
584
- //#endregion
585
- //#region src/core/signingEngine/uiConfirm/ui/transaction-display/renderers/fallback.ts
586
- const renderFallbackDisplayOperation = ({ operation, depth, path, renderChild }) => {
587
- const opId = String(operation.id || "").trim() || `op-${path}`;
588
- const contractAddress = (() => {
589
- const raw = String(operation.to || "").trim();
590
- return /^0x[0-9a-fA-F]{40}$/.test(raw) ? raw : void 0;
591
- })();
592
- const description = String(operation.description || "").trim();
593
- const childOps = Array.isArray(operation.children) ? operation.children.map((child, childIndex) => renderChild(child, depth + 1, `${path}.${childIndex}`)) : [];
594
- const fieldNodes = buildFieldNodes(opId, operation.fields);
595
- const metadataNodes = description ? [{
596
- id: `${opId}-description`,
597
- label: description,
598
- type: "file",
599
- open: false
600
- }] : [];
601
- if (operation.kind === "raw.fallback") {
602
- const rawValue = String(operation.raw || "").trim();
603
- if (rawValue) metadataNodes.push({
604
- id: `${opId}-raw`,
605
- label: "Raw payload",
606
- type: "file",
607
- open: false,
608
- content: rawValue
609
- });
610
- }
611
- const children = [
612
- ...metadataNodes,
613
- ...fieldNodes,
614
- ...childOps
615
- ];
616
- if (children.length === 0) return {
617
- id: opId,
618
- label: String(operation.label || operation.kind),
619
- type: "file",
620
- open: false,
621
- contractAddress
622
- };
623
- return {
624
- id: opId,
625
- label: String(operation.label || operation.kind),
626
- type: "folder",
627
- open: depth < 1,
628
- contractAddress,
629
- children
630
- };
631
- };
632
- //#endregion
633
- //#region src/core/signingEngine/uiConfirm/ui/transaction-display/tree.ts
634
- function toChainLabel(chain) {
635
- switch (chain) {
636
- case "near": return "NEAR";
637
- case "evm": return "EVM";
638
- case "tempo": return "Tempo";
639
- default: return "Unknown";
640
- }
641
- }
642
- function buildWarningNodes(warnings) {
643
- if (!Array.isArray(warnings) || warnings.length === 0) return [];
644
- return [{
645
- id: "warnings-root",
646
- label: "Warnings",
647
- type: "folder",
648
- open: true,
649
- children: warnings.map((warning, warningIndex) => ({
650
- id: `warning-${warningIndex}`,
651
- label: `[${String(warning.severity || "warning").toUpperCase()}] ${String(warning.message || "")}`,
652
- type: "file",
653
- open: false
654
- }))
655
- }];
656
- }
657
- function renderOperationNode(operation, depth, path) {
658
- return renderFallbackDisplayOperation({
659
- operation,
660
- depth,
661
- path,
662
- renderChild: (childOperation, childDepth, childPath) => renderOperationNode(childOperation, childDepth, childPath)
663
- });
664
- }
665
- function hideFolderChevrons(node) {
666
- const children = Array.isArray(node.children) ? node.children.map((child) => hideFolderChevrons(child)) : void 0;
667
- if (node.type !== "folder") return children ? {
668
- ...node,
669
- children
670
- } : node;
671
- return {
672
- ...node,
673
- hideChevron: true,
674
- children
675
- };
676
- }
677
- function attachChainToNode(node, chain) {
678
- const children = Array.isArray(node.children) ? node.children.map((child) => attachChainToNode(child, chain)) : void 0;
679
- return {
680
- ...node,
681
- chain,
682
- ...children ? { children } : {}
683
- };
684
- }
685
- function buildDisplayTreeFromModel(model) {
686
- const hideModelFolderChevrons = model.chain === "evm" || model.chain === "tempo";
687
- const operationNodes = (Array.isArray(model.operations) ? model.operations : []).map((operation, operationIndex) => renderOperationNode(operation, 0, String(operationIndex))).map((node) => attachChainToNode(node, model.chain)).map((node) => hideModelFolderChevrons ? hideFolderChevrons(node) : node);
688
- const rootChildren = [...buildWarningNodes(model.warnings).map((node) => attachChainToNode(node, model.chain)).map((node) => hideModelFolderChevrons ? hideFolderChevrons(node) : node), ...operationNodes];
689
- if (rootChildren.length === 0) rootChildren.push({
690
- id: "no-operations",
691
- label: "No operations",
692
- type: "file",
693
- open: false
694
- });
695
- const chainLabel = toChainLabel(model.chain);
696
- return {
697
- id: "display-root",
698
- label: String(model.title || "").trim() || `${chainLabel} Transaction`,
699
- type: "folder",
700
- open: true,
701
- children: rootChildren
702
- };
703
- }
704
- function buildActionNode(action, idx) {
705
- let actionNodes;
706
- switch (action.type) {
707
- case "FunctionCall":
708
- actionNodes = [{
709
- id: `a${idx}-args`,
710
- label: "using args:",
711
- type: "file",
712
- open: false,
713
- hideChevron: true,
714
- hideLabel: true,
715
- content: formatArgs(action.args)
716
- }];
717
- break;
718
- case "Transfer":
719
- actionNodes = [];
720
- break;
721
- case "CreateAccount":
722
- actionNodes = [];
723
- break;
724
- case "DeployContract": {
725
- const codeSize = formatCodeSize(action.code);
726
- actionNodes = [{
727
- id: `a${idx}-code-size`,
728
- label: `WASM contract code size: ${codeSize}`,
729
- type: "file",
730
- open: false
731
- }];
732
- break;
733
- }
734
- case "DeployGlobalContract": {
735
- const code = action.code;
736
- const deployMode = action.deployMode;
737
- const codeSize = formatCodeSize(code);
738
- actionNodes = [{
739
- id: `a${idx}-deploy-mode`,
740
- label: `mode: ${String(deployMode || "")}`,
741
- type: "file",
742
- open: false
743
- }, {
744
- id: `a${idx}-code-size`,
745
- label: `WASM global contract code size: ${codeSize}`,
746
- type: "file",
747
- open: false
748
- }];
749
- break;
750
- }
751
- case "UseGlobalContract": {
752
- const accountId = action.accountId;
753
- const codeHash = action.codeHash;
754
- let label;
755
- if (accountId) label = `by account: ${String(accountId)}`;
756
- else if (codeHash) label = `by hash: ${shortenPubkey(String(codeHash), {
757
- prefix: 10,
758
- suffix: 6
759
- })}`;
760
- else label = "by global contract identifier";
761
- actionNodes = [{
762
- id: `a${idx}-identifier`,
763
- label,
764
- type: "file",
765
- open: false
766
- }];
767
- break;
768
- }
769
- case "Stake":
770
- actionNodes = [{
771
- id: `a${idx}-publicKey`,
772
- label: `validator: ${shortenPubkey(action.publicKey)}`,
773
- type: "file",
774
- open: true,
775
- copyValue: action.publicKey
776
- }];
777
- break;
778
- case "AddKey": {
779
- const ak = action.accessKey;
780
- let permissions = "";
781
- try {
782
- permissions = (isString(ak) ? JSON.parse(ak) : ak).permission === "FullAccess" ? "Full Access" : "Function Call";
783
- } catch {
784
- permissions = "Unknown";
785
- }
786
- actionNodes = [{
787
- id: `a${idx}-publicKey`,
788
- label: `key: ${shortenPubkey(action.publicKey)}`,
789
- open: false,
790
- type: "file",
791
- copyValue: action.publicKey
792
- }, {
793
- id: `a${idx}-permissions`,
794
- label: `permissions: ${permissions}`,
795
- open: false,
796
- type: "file"
797
- }];
798
- break;
799
- }
800
- case "DeleteKey":
801
- actionNodes = [{
802
- id: `a${idx}-publicKey`,
803
- label: `key: ${shortenPubkey(action.publicKey)}`,
804
- open: false,
805
- type: "file",
806
- copyValue: action.publicKey
807
- }];
808
- break;
809
- case "DeleteAccount":
810
- actionNodes = [{
811
- id: `a${idx}-beneficiaryId`,
812
- label: `sending balance to: ${action.beneficiaryId}`,
813
- open: false,
814
- type: "file"
815
- }];
816
- break;
817
- default: {
818
- let raw = "";
819
- try {
820
- raw = JSON.stringify(action, null, 2);
821
- } catch {
822
- raw = String(action);
823
- }
824
- actionNodes = [{
825
- id: `a${idx}-action`,
826
- label: `Action: ${action.type || "Unknown"}`,
827
- open: false,
828
- type: "file"
829
- }, {
830
- id: `a${idx}-raw`,
831
- label: "Raw Data",
832
- type: "file",
833
- open: false,
834
- content: raw
835
- }];
836
- break;
837
- }
838
- }
839
- return {
840
- id: `action-${idx}`,
841
- label: "",
842
- type: "folder",
843
- open: false,
844
- hideChevron: true,
845
- action,
846
- actionIndex: idx,
847
- children: actionNodes
848
- };
849
- }
850
- function buildTransactionNode(tx, tIdx, totalTransactions) {
851
- const actionFolders = tx.actions.map((action, idx) => buildActionNode(action, idx));
852
- return {
853
- id: `tx-${tIdx}`,
854
- label: "",
855
- type: "folder",
856
- open: true,
857
- hideChevron: true,
858
- transaction: tx,
859
- transactionIndex: tIdx,
860
- totalTransactions,
861
- children: [...actionFolders]
862
- };
863
- }
864
- function buildDisplayTreeFromTxPayloads(txSigningRequests) {
865
- const totalTransactions = txSigningRequests.length;
866
- const txFolders = txSigningRequests.map((tx, tIdx) => buildTransactionNode(tx, tIdx, totalTransactions));
867
- return {
868
- id: "txs-root",
869
- label: totalTransactions > 1 ? "Transactions" : "Transaction",
870
- type: "folder",
871
- open: true,
872
- children: txFolders
873
- };
874
- }
875
- //#endregion
876
- //#region src/core/signingEngine/uiConfirm/ui/transaction-display/confirmation-tree.ts
877
- function operationHasAbiDecodeHint(operation) {
878
- const hint = operation.abiDecodeHint;
879
- if (hint && Array.isArray(hint.abi) && hint.abi.length > 0) {
880
- const dataHex = String(hint.dataHex || "").trim();
881
- if (dataHex && dataHex !== "0x") return true;
882
- }
883
- return (Array.isArray(operation.children) ? operation.children : []).some(operationHasAbiDecodeHint);
884
- }
885
- function modelHasAbiDecodeHints(model) {
886
- return (Array.isArray(model.operations) ? model.operations : []).some(operationHasAbiDecodeHint);
887
- }
888
- function buildConfirmationTree(input) {
889
- const txs = Array.isArray(input.txSigningRequests) ? input.txSigningRequests : [];
890
- if (txs.length > 0) return buildDisplayTreeFromTxPayloads(fromTransactionInputsWasm(txs));
891
- const model = input.model;
892
- if (!model) return null;
893
- const operations = Array.isArray(model.operations) ? model.operations : [];
894
- const warnings = Array.isArray(model.warnings) ? model.warnings : [];
895
- return operations.length > 0 || warnings.length > 0 ? buildDisplayTreeFromModel(model) : null;
896
- }
897
- //#endregion
898
- //#region src/core/signingEngine/uiConfirm/nearFundingNotice.ts
899
- const NEAR_TRANSACTION_SUBMITTING_NOTICE = "Topping up account...";
900
- const NEAR_ACCOUNT_FUNDING_NOTICE_PATTERN = /^NEAR account ([^\s]+) needs funding before signing\.$/;
901
- function shortenNearAccountForFundingNotice(accountId) {
902
- const value = String(accountId || "").trim();
903
- if (value.length <= 8) return value;
904
- return `${value.slice(0, 4)}...${value.slice(-4)}`;
905
- }
906
- function formatNearAccountFundingNotice(nearAccountId) {
907
- const accountId = String(nearAccountId || "").trim();
908
- if (!accountId) return "NEAR account needs funding before signing.";
909
- return `NEAR account ${accountId} needs funding before signing.`;
910
- }
911
- function parseNearAccountFundingNotice(body) {
912
- const value = String(body || "").trim();
913
- const match = NEAR_ACCOUNT_FUNDING_NOTICE_PATTERN.exec(value);
914
- if (!match) return null;
915
- const accountId = String(match[1] || "").trim();
916
- if (!accountId) return null;
917
- return {
918
- accountId,
919
- shortAccountId: shortenNearAccountForFundingNotice(accountId)
920
- };
921
- }
922
- function isNearTransactionSubmittingNotice(body) {
923
- return String(body || "").trim() === NEAR_TRANSACTION_SUBMITTING_NOTICE;
924
- }
925
- /**
926
- * Shown while an unfunded implicit account is being funded, which happens after
927
- * the user confirms and before the step-up prompt. Funding is a real NEAR
928
- * transaction, so this is the one step in the confirmation that can take
929
- * seconds — without it the prompt keeps saying the account "needs funding" next
930
- * to a bare spinner, and a legitimate wait reads as a hang.
931
- */
932
- function formatNearAccountFundingProgressNotice(nearAccountId) {
933
- const accountId = shortenNearAccountForFundingNotice(nearAccountId);
934
- return accountId ? `Funding NEAR account ${accountId}...` : "Funding NEAR account...";
935
- }
936
- function isNearAccountFundingProgressNotice(body) {
937
- const value = String(body || "").trim();
938
- return value.startsWith("Funding NEAR account") && value.endsWith("...");
939
- }
940
- /** Body copy that reports work in progress rather than describing the request. */
941
- function isNearSigningProgressNotice(body) {
942
- return isNearTransactionSubmittingNotice(body) || isNearAccountFundingProgressNotice(body);
943
- }
944
- //#endregion
945
- //#region src/core/signingEngine/uiConfirm/ui/confirmation-body-model.ts
946
- function buildConfirmationBody(body) {
947
- const text = body.trim();
948
- if (!text) return { kind: "empty" };
949
- if (isNearSigningProgressNotice(text)) return {
950
- kind: "status",
951
- text
952
- };
953
- const funding = parseNearAccountFundingNotice(text);
954
- if (funding) return {
955
- kind: "funding",
956
- accountId: funding.accountId,
957
- shortAccountId: funding.shortAccountId
958
- };
959
- return {
960
- kind: "text",
961
- text
962
- };
963
- }
964
- //#endregion
965
- //#region src/core/signingEngine/uiConfirm/ui/confirmation-model.ts
966
- function normalizeConfirmationModel(input) {
967
- const source = input.presentation;
968
- const errorMessage = source.errorMessage ?? "";
969
- const cancelText = source.cancelText ?? "Cancel";
970
- const registration = source.securityContext?.passkeyRegistration;
971
- if (registration?.kind === "passkey_registration_confirm_display_v1") return {
972
- ok: true,
973
- model: {
974
- appearance: input.appearance,
975
- content: {
976
- kind: "registration",
977
- registration: {
978
- display: registration,
979
- heading: source.title?.trim() || "Create your passkey",
980
- body: source.body?.trim() || "Use Touch ID or your device passkey to create credentials for this account.",
981
- cancelText,
982
- errorMessage,
983
- decision: source.loading ? { kind: "creating" } : {
984
- kind: "ready",
985
- onConfirm: input.callbacks.confirm
986
- },
987
- onCancel: input.callbacks.cancel
988
- }
989
- }
990
- }
991
- };
992
- let prompt;
993
- switch (source.signingAuthMode) {
994
- case "emailOtp": {
995
- const email = source.emailOtpPrompt;
996
- const challengeId = email?.challengeId.trim();
997
- if (!email || !challengeId) return {
998
- ok: false,
999
- error: "missing_email_challenge"
1000
- };
1001
- prompt = {
1002
- kind: "email",
1003
- email: {
1004
- prompt: {
1005
- challengeId,
1006
- title: email.title,
1007
- body: email.body,
1008
- helperText: email.helperText,
1009
- emailHint: email.emailHint,
1010
- resendDebounceMs: email.resendDebounceMs,
1011
- onResend: email.onResend
1012
- },
1013
- verification: emailVerification(source.loading === true, errorMessage),
1014
- onSubmit: input.callbacks.submitEmail
1015
- }
1016
- };
1017
- break;
1018
- }
1019
- case "warmSession":
1020
- prompt = { kind: "session" };
1021
- break;
1022
- case "webauthn":
1023
- case void 0:
1024
- prompt = { kind: "passkey" };
1025
- break;
1026
- default: return assertNever$5(source.signingAuthMode);
1027
- }
1028
- const body = buildConfirmationBody(source.body ?? "");
1029
- return {
1030
- ok: true,
1031
- model: {
1032
- appearance: input.appearance,
1033
- content: {
1034
- kind: "transaction",
1035
- review: {
1036
- model: source.model ?? null,
1037
- tree: input.tree
1038
- },
1039
- header: {
1040
- heading: confirmationHeading(source),
1041
- website: statusText(source.securityContext?.rpId?.trim() ?? ""),
1042
- chainDetails: chainStatus(source, source.loading === true || body.kind === "status"),
1043
- errorMessage
1044
- },
1045
- body,
1046
- prompt,
1047
- transaction: {
1048
- tree: input.tree,
1049
- theme: input.appearance.theme.mode,
1050
- explorers: {
1051
- near: source.nearExplorerUrl || "https://testnet.nearblocks.io",
1052
- tempo: source.tempoExplorerUrl,
1053
- evm: source.evmExplorerUrl
1054
- },
1055
- decision: source.loading || source.preparing ? { kind: "preparing" } : {
1056
- kind: "ready",
1057
- onConfirm: input.callbacks.confirm
1058
- },
1059
- confirmText: source.signingAuthMode === "emailOtp" ? "Confirm Code" : source.confirmText ?? "Confirm",
1060
- cancelText,
1061
- errorMessage,
1062
- onCancel: input.callbacks.cancel,
1063
- onBack: source.onBack
1064
- }
1065
- }
1066
- }
1067
- };
1068
- }
1069
- function emailVerification(pending, error) {
1070
- if (pending) return { kind: "pending" };
1071
- if (error) return {
1072
- kind: "rejected",
1073
- message: error
1074
- };
1075
- return { kind: "ready" };
1076
- }
1077
- function confirmationHeading(source) {
1078
- const passkeyHeading = (source.model?.operations.length ?? 0) === 0 ? "Register with Passkey" : "Confirm with Passkey";
1079
- switch (source.signingAuthMode) {
1080
- case "emailOtp": return source.emailOtpPrompt?.title?.trim() || "Enter email code to sign";
1081
- case "warmSession": return "Review transaction";
1082
- case "webauthn": return passkeyHeading;
1083
- case void 0: return source.title?.trim() || passkeyHeading;
1084
- default: return assertNever$5(source.signingAuthMode);
1085
- }
1086
- }
1087
- function statusText(text) {
1088
- return text ? {
1089
- kind: "ready",
1090
- text
1091
- } : { kind: "loading" };
1092
- }
1093
- function chainStatus(source, pending) {
1094
- const model = source.model;
1095
- if (model?.chainId) return {
1096
- kind: "ready",
1097
- text: `${chainLabel(model.chain)} | ChainID: ${model.chainId}`
1098
- };
1099
- const blockHeight = String(source.securityContext?.blockHeight || "").trim();
1100
- if (blockHeight) return {
1101
- kind: "ready",
1102
- text: `block ${blockHeight}`
1103
- };
1104
- return pending ? { kind: "loading" } : {
1105
- kind: "ready",
1106
- text: "block"
1107
- };
1108
- }
1109
- function chainLabel(chain) {
1110
- switch (chain) {
1111
- case "near": return "NEAR";
1112
- case "evm": return "EVM";
1113
- case "tempo": return "Tempo";
1114
- case "unknown": return "Unknown";
1115
- default: return assertNever$5(chain);
1116
- }
1117
- }
1118
- function assertNever$5(value) {
1119
- throw new Error(`Unexpected confirmation presentation: ${String(value)}`);
1120
- }
1121
- //#endregion
1122
- //#region src/core/signingEngine/uiConfirm/ui/surface-resize-events.ts
1123
- const SURFACE_RESIZE_BEGIN_EVENT = "seams-surface-resize-begin";
1124
- function dispatchSurfaceResizeBegin(target, detail) {
1125
- return target.dispatchEvent(new CustomEvent(SURFACE_RESIZE_BEGIN_EVENT, {
1126
- bubbles: true,
1127
- composed: true,
1128
- detail
1129
- }));
1130
- }
1131
- function addSurfaceResizeBeginListener(target, listener, options) {
1132
- const handler = listener;
1133
- target.addEventListener(SURFACE_RESIZE_BEGIN_EVENT, handler, options);
1134
- return () => target.removeEventListener(SURFACE_RESIZE_BEGIN_EVENT, handler, options);
1135
- }
1136
- //#endregion
1137
- //#region src/core/signingEngine/uiConfirm/ui/confirm-surface-resize.ts
1138
- /**
1139
- * Host-driven height changes for wallet-iframe confirmations.
1140
- *
1141
- * In the wallet-iframe modal surface the parent window sizes the iframe to hug
1142
- * this confirmer (surface-measurement-reporter.ts) and eases the box to every
1143
- * new size it hears about (OverlayController.startSurfaceResize). Content that
1144
- * animates its own height fights that ease: every frame of the animation posts
1145
- * a fresh measurement, the box restarts its ease from wherever it is, and the
1146
- * card — anchored to the iframe's top-left and already at full height — is
1147
- * clipped by an iframe still catching up.
1148
- *
1149
- * So the order is reversed here. A component about to change height clamps
1150
- * itself at its pre-change height and announces the change; the confirmer host
1151
- * is pinned to the size it is heading for — exactly one measurement, so the
1152
- * parent runs exactly one ease — and the component is then driven from the
1153
- * room the iframe has actually made available, frame by frame. The content can
1154
- * never outrun the box, whatever the parent's easing (or its absence under
1155
- * reduced motion) turns out to be.
1156
- *
1157
- * The host is a transparent shell in that surface, so pinning it taller or
1158
- * shorter than its content is invisible. The pin goes through a constructable
1159
- * stylesheet because the wallet origin ships `style-src-attr 'none'`.
1160
- *
1161
- * The module owns the rules for iframe-hosted confirmation reflow.
1162
- */
1163
- const CONFIRM_SURFACE_MODE_ATTR = "data-seams-confirm-surface";
1164
- const CONFIRM_SURFACE_MODE_WALLET_IFRAME = "wallet-iframe";
1165
- /** Marks the confirmer host while its height is held at a motion's target. */
1166
- const CONFIRM_SURFACE_PINNED_CLASS = "seams-confirm-surface-pinned";
1167
- /**
1168
- * Marks the document root for the same span. It is a second class rather than
1169
- * the one above because the host rule must match any element that hosts a
1170
- * confirmation — including the plain container the component suites mount —
1171
- * so it cannot be qualified by tag, and an unqualified height rule would
1172
- * otherwise also size `<html>`.
1173
- */
1174
- const CONFIRM_SURFACE_PINNED_ROOT_CLASS = "seams-confirm-surface-pinned-root";
1175
- /** Marks an element whose height is being driven through a motion. */
1176
- const CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS = "seams-surface-height-driven";
1177
- /** The CSS variable the class above reads. Components own the write (CSP). */
1178
- const CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR = "--seams-surface-height-driven-target";
1179
- /** Frames the box may sit still, after it has moved, before its motion counts as over. */
1180
- const SETTLED_FRAMES_AFTER_MOTION = 8;
1181
- /** Frames to wait for the parent to react at all before giving up on it. */
1182
- const SETTLED_FRAMES_WITHOUT_MOTION = 20;
1183
- /**
1184
- * The parent writes the destination box and forces a layout BEFORE it starts
1185
- * its ease, and a cross-origin iframe can receive that destination size for one
1186
- * frame before the animation snaps it back to the origin. Landing on that
1187
- * frame finishes the interior instantly and leaves the box to ease on its
1188
- * own — the exact jank this module exists to remove. A box that jumps straight
1189
- * to the target therefore has to stay there this many frames before the
1190
- * content lands on it; a box that eased through intermediate sizes lands at
1191
- * once. The parent pins the iframe to the origin for that read
1192
- * (`overlay-styles.ts pinDialogIframe`), so this is the second of two guards.
1193
- */
1194
- const LANDING_CONFIRM_FRAMES = 3;
1195
- /** The parent rounds the measured size; allow that much slack when asking whether the box hugs the host. */
1196
- const HUG_TOLERANCE_CSS_PX = 1;
1197
- /** A host that claims a motion and never lands it must not leave content clamped. */
1198
- const ANNOUNCE_SAFETY_MS = 1500;
1199
- /** Height changes below this are not worth a motion, and round to nothing. */
1200
- const MIN_ANNOUNCED_DELTA_CSS_PX = 1;
1201
- /**
1202
- * Offer a height change to the surrounding surface before making it.
1203
- *
1204
- * Returns true when a host claimed the motion and now owns it: the component
1205
- * must not animate, and its `finish` will be called when the box has arrived.
1206
- * Returns false when nobody claimed it — a standalone surface, or a box that
1207
- * does not hug this content — and the component animates itself as usual.
1208
- */
1209
- function announceSurfaceResize(target, announcement) {
1210
- const { fromCssPx, toCssPx } = announcement;
1211
- if (!Number.isFinite(fromCssPx) || !Number.isFinite(toCssPx)) return false;
1212
- const deltaCssPx = toCssPx - fromCssPx;
1213
- if (Math.abs(deltaCssPx) < MIN_ANNOUNCED_DELTA_CSS_PX) return false;
1214
- const lowerCssPx = Math.min(fromCssPx, toCssPx);
1215
- const upperCssPx = Math.max(fromCssPx, toCssPx);
1216
- let driver = null;
1217
- let finished = false;
1218
- let safety = null;
1219
- const setProgress = (progress) => {
1220
- if (finished) return;
1221
- const px = fromCssPx + (Number.isFinite(progress) ? Math.min(Math.max(progress, 0), 1) : 0) * deltaCssPx;
1222
- announcement.setHeightCssPx(Math.min(Math.max(px, lowerCssPx), upperCssPx));
1223
- };
1224
- const finish = () => {
1225
- if (finished) return;
1226
- finished = true;
1227
- if (safety !== null) window.clearTimeout(safety);
1228
- announcement.finish();
1229
- };
1230
- const claim = () => {
1231
- if (driver || finished) return null;
1232
- announcement.onClaimed?.();
1233
- setProgress(0);
1234
- safety = window.setTimeout(() => {
1235
- setProgress(1);
1236
- finish();
1237
- }, ANNOUNCE_SAFETY_MS);
1238
- driver = {
1239
- setProgress,
1240
- finish
1241
- };
1242
- return driver;
1243
- };
1244
- dispatchSurfaceResizeBegin(target, {
1245
- ...announcement.reason ? { reason: announcement.reason } : {},
1246
- deltaCssPx,
1247
- claim
1248
- });
1249
- return driver !== null;
1250
- }
1251
- function createSurfaceHeightReflow(args) {
1252
- let capturedCssPx = null;
1253
- let clampedElement = null;
1254
- const release = () => {
1255
- const element = clampedElement;
1256
- clampedElement = null;
1257
- if (!element) return;
1258
- element.classList.remove(CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS);
1259
- };
1260
- return {
1261
- capture() {
1262
- const element = args.element();
1263
- capturedCssPx = element ? element.getBoundingClientRect().height : null;
1264
- },
1265
- commit() {
1266
- const fromCssPx = capturedCssPx;
1267
- capturedCssPx = null;
1268
- const element = args.element();
1269
- if (!element || fromCssPx === null) return;
1270
- if (document.documentElement.classList.contains(CONFIRM_SURFACE_PINNED_ROOT_CLASS)) return;
1271
- if (element.parentElement?.closest(`.${CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS}`)) return;
1272
- clampedElement = element;
1273
- element.classList.add(CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS);
1274
- args.setHeightCssPx(fromCssPx);
1275
- Promise.resolve(args.settled?.()).then(() => new Promise((resolve) => requestAnimationFrame(() => resolve()))).then(() => {
1276
- if (clampedElement !== element) return;
1277
- if (document.documentElement.classList.contains(CONFIRM_SURFACE_PINNED_ROOT_CLASS)) {
1278
- release();
1279
- return;
1280
- }
1281
- element.classList.remove(CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS);
1282
- const toCssPx = element.getBoundingClientRect().height;
1283
- element.classList.add(CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS);
1284
- if (!announceClampedSurfaceResize({
1285
- ...args.reason ? { reason: args.reason } : {},
1286
- element,
1287
- fromCssPx,
1288
- toCssPx,
1289
- setHeightCssPx: (px) => args.setHeightCssPx(px),
1290
- onSettled: () => {
1291
- clampedElement = null;
1292
- }
1293
- })) release();
1294
- });
1295
- },
1296
- dispose: release
1297
- };
1298
- }
1299
- /**
1300
- * Clamp an element at its pre-change height, announce the change, and release
1301
- * the clamp when the motion lands. This is the call every height change in a
1302
- * confirmation goes through, because the clamp has to be in place *before* the
1303
- * announcement: a host measures itself while the event is dispatched.
1304
- *
1305
- * Returns true when a host took the motion. False means the clamp was never
1306
- * applied (or has already been dropped) and the caller animates itself.
1307
- */
1308
- function announceClampedSurfaceResize(args) {
1309
- const { element, fromCssPx, toCssPx } = args;
1310
- if (!Number.isFinite(fromCssPx) || !Number.isFinite(toCssPx)) return false;
1311
- if (Math.abs(toCssPx - fromCssPx) < MIN_ANNOUNCED_DELTA_CSS_PX) return false;
1312
- const drivenClasses = args.drivenClasses ?? [CONFIRM_SURFACE_HEIGHT_DRIVEN_CLASS];
1313
- const addedClasses = drivenClasses.filter((name) => !element.classList.contains(name));
1314
- element.classList.add(...addedClasses);
1315
- args.setHeightCssPx(fromCssPx);
1316
- const claimed = announceSurfaceResize(element, {
1317
- ...args.reason ? { reason: args.reason } : {},
1318
- fromCssPx,
1319
- toCssPx,
1320
- setHeightCssPx: args.setHeightCssPx,
1321
- finish: () => {
1322
- element.classList.remove(...drivenClasses);
1323
- args.onSettled?.();
1324
- }
1325
- });
1326
- if (!claimed) element.classList.remove(...addedClasses);
1327
- return claimed;
1328
- }
1329
- let diagnosticHost = null;
1330
- const surfaceMotionDiagnostics = {
1331
- blipFrames: 0,
1332
- trace(durationMs = 2e3) {
1333
- return new Promise((resolve) => {
1334
- const lines = [];
1335
- const startedAt = performance.now();
1336
- const tick = () => {
1337
- const host = diagnosticHost;
1338
- const pinned = host?.classList.contains(CONFIRM_SURFACE_PINNED_CLASS) ? "*" : "";
1339
- lines.push(`${Math.round(performance.now() - startedAt)}: box=${document.documentElement.clientHeight} content=${host ? Math.round(host.getBoundingClientRect().height) : "-"}${pinned}`);
1340
- if (performance.now() - startedAt < durationMs) requestAnimationFrame(tick);
1341
- else resolve(lines);
1342
- };
1343
- requestAnimationFrame(tick);
1344
- });
1345
- }
1346
- };
1347
- function publishDiagnostics(element) {
1348
- diagnosticHost = element;
1349
- try {
1350
- window.__seamsSurfaceMotion = surfaceMotionDiagnostics;
1351
- } catch {}
1352
- }
1353
- function defaultViewportHeightCssPx() {
1354
- const height = document.documentElement?.clientHeight ?? 0;
1355
- return height > 0 ? height : window.innerHeight;
1356
- }
1357
- function clamp(value, min, max) {
1358
- return Math.min(Math.max(value, min), max);
1359
- }
1360
- function isWalletIframeConfirmSurface(element) {
1361
- return element.getAttribute(CONFIRM_SURFACE_MODE_ATTR) === CONFIRM_SURFACE_MODE_WALLET_IFRAME;
1362
- }
1363
- function createHostHeightPin(element) {
1364
- if (typeof CSSStyleSheet !== "function" || !("adoptedStyleSheets" in document)) return null;
1365
- let sheet = null;
1366
- const release = () => {
1367
- element.classList.remove(CONFIRM_SURFACE_PINNED_CLASS);
1368
- document.documentElement.classList.remove(CONFIRM_SURFACE_PINNED_ROOT_CLASS);
1369
- };
1370
- return {
1371
- set(px) {
1372
- try {
1373
- if (!sheet) sheet = new CSSStyleSheet();
1374
- sheet.replaceSync(`.${CONFIRM_SURFACE_PINNED_CLASS}{height:${Math.max(0, Math.round(px))}px}.${CONFIRM_SURFACE_PINNED_ROOT_CLASS}{overflow:hidden}`);
1375
- if (!document.adoptedStyleSheets.includes(sheet)) document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
1376
- } catch {
1377
- return false;
1378
- }
1379
- element.classList.add(CONFIRM_SURFACE_PINNED_CLASS);
1380
- document.documentElement.classList.add(CONFIRM_SURFACE_PINNED_ROOT_CLASS);
1381
- return true;
1382
- },
1383
- release,
1384
- dispose() {
1385
- release();
1386
- if (!sheet) return;
1387
- const retired = sheet;
1388
- sheet = null;
1389
- try {
1390
- document.adoptedStyleSheets = document.adoptedStyleSheets.filter((s) => s !== retired);
1391
- } catch {}
1392
- }
1393
- };
1394
- }
1395
- function attachConfirmSurfaceResizeChoreographer(element, options = {}) {
1396
- const readViewportHeightCssPx = options.viewportHeightCssPx ?? defaultViewportHeightCssPx;
1397
- const pin = createHostHeightPin(element);
1398
- publishDiagnostics(element);
1399
- let active = null;
1400
- const settle = () => {
1401
- const current = active;
1402
- if (!current) return;
1403
- active = null;
1404
- if (current.frame !== null) cancelAnimationFrame(current.frame);
1405
- current.driver.setProgress(1);
1406
- current.driver.finish();
1407
- pin?.release();
1408
- };
1409
- const step = () => {
1410
- const current = active;
1411
- if (!current) return;
1412
- current.frame = null;
1413
- const viewportPx = readViewportHeightCssPx();
1414
- if (viewportPx !== current.lastViewportPx) {
1415
- current.lastViewportPx = viewportPx;
1416
- current.framesSinceChange = 0;
1417
- current.moved = true;
1418
- } else current.framesSinceChange += 1;
1419
- const progress = clamp((viewportPx - current.originHostPx) / current.deltaCssPx, 0, 1);
1420
- if (progress >= 1) {
1421
- current.framesAtTarget += 1;
1422
- if (current.sawIntermediate || current.framesAtTarget >= LANDING_CONFIRM_FRAMES) {
1423
- settle();
1424
- return;
1425
- }
1426
- current.frame = requestAnimationFrame(step);
1427
- return;
1428
- }
1429
- if (current.framesAtTarget > 0) surfaceMotionDiagnostics.blipFrames += 1;
1430
- current.framesAtTarget = 0;
1431
- if (progress > 0) current.sawIntermediate = true;
1432
- current.driver.setProgress(progress);
1433
- const settledFrames = current.moved ? SETTLED_FRAMES_AFTER_MOTION : SETTLED_FRAMES_WITHOUT_MOTION;
1434
- if (current.framesSinceChange >= settledFrames) {
1435
- settle();
1436
- return;
1437
- }
1438
- current.frame = requestAnimationFrame(step);
1439
- };
1440
- const onSurfaceResizeBegin = (event) => {
1441
- const detail = event.detail;
1442
- if (!pin || !detail || !isWalletIframeConfirmSurface(element)) return;
1443
- const deltaCssPx = detail.deltaCssPx;
1444
- if (!Number.isFinite(deltaCssPx) || Math.abs(deltaCssPx) < MIN_ANNOUNCED_DELTA_CSS_PX) return;
1445
- settle();
1446
- const viewportPx = readViewportHeightCssPx();
1447
- const hostPx = element.getBoundingClientRect().height;
1448
- if (!(viewportPx > 0) || !(hostPx > 0) || Math.abs(viewportPx - hostPx) > HUG_TOLERANCE_CSS_PX) return;
1449
- const originHostPx = Math.round(hostPx);
1450
- const targetHostPx = originHostPx + deltaCssPx;
1451
- if (!(targetHostPx > 0)) return;
1452
- if (!pin.set(targetHostPx)) return;
1453
- const driver = detail.claim();
1454
- if (!driver) {
1455
- pin.release();
1456
- return;
1457
- }
1458
- active = {
1459
- driver,
1460
- originHostPx,
1461
- deltaCssPx,
1462
- lastViewportPx: viewportPx,
1463
- framesSinceChange: 0,
1464
- moved: false,
1465
- sawIntermediate: false,
1466
- framesAtTarget: 0,
1467
- frame: null
1468
- };
1469
- active.frame = requestAnimationFrame(step);
1470
- };
1471
- const removeListener = addSurfaceResizeBeginListener(element, onSurfaceResizeBegin);
1472
- return { dispose() {
1473
- removeListener();
1474
- settle();
1475
- pin?.dispose();
1476
- } };
1477
- }
1478
- //#endregion
1479
- //#region src/core/signingEngine/uiConfirm/ui/preact/PadlockIcon.tsx
1480
- function PadlockIcon(props) {
1481
- const size = props.size ?? "100%";
1482
- const strokeWidth = props.strokeWidth ?? 2;
1483
- return /* @__PURE__ */ u("svg", {
1484
- class: "padlock-icon seams-padlock-icon",
1485
- xmlns: "http://www.w3.org/2000/svg",
1486
- viewBox: "0 0 24 24",
1487
- fill: "none",
1488
- stroke: "currentColor",
1489
- "stroke-width": strokeWidth,
1490
- "stroke-linecap": "round",
1491
- "stroke-linejoin": "round",
1492
- width: size,
1493
- height: size,
1494
- "aria-hidden": "true",
1495
- focusable: "false",
1496
- children: [/* @__PURE__ */ u("rect", {
1497
- width: "18",
1498
- height: "11",
1499
- x: "3",
1500
- y: "11",
1501
- rx: "2",
1502
- ry: "2"
1503
- }), /* @__PURE__ */ u("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })]
1504
- });
1505
- }
1506
- //#endregion
1507
- //#region src/core/signingEngine/uiConfirm/ui/preact/HaloBorder.tsx
1508
- /** @jsxImportSource preact */
1509
- let nextHaloId = 0;
1510
- var HaloBorder = class extends C {
1511
- constructor(..._args) {
1512
- super(..._args);
1513
- this.id = `seams-halo-${++nextHaloId}`;
1514
- this.element = M();
1515
- this.motion = null;
1516
- this.frame = null;
1517
- this.startedAt = null;
1518
- this.angle = null;
1519
- this.updateAnimation = () => {
1520
- this.cancelFrame();
1521
- this.angle = null;
1522
- this.syncDynamicStyles();
1523
- if (this.props.animated && this.motion?.matches) this.frame = this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick);
1524
- };
1525
- this.tick = (timestamp) => {
1526
- if (!this.element.current || !this.props.animated || !this.motion?.matches) return;
1527
- this.startedAt ??= timestamp;
1528
- const configuredDuration = this.props.durationMs;
1529
- const duration = configuredDuration && Number.isFinite(configuredDuration) && configuredDuration > 0 ? configuredDuration : 1150;
1530
- this.angle = `${(timestamp - this.startedAt) % duration / duration * 360}deg`;
1531
- this.syncDynamicStyles();
1532
- this.frame = this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick);
1533
- };
1534
- }
1535
- componentDidMount() {
1536
- this.motion = this.element.current.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: no-preference)");
1537
- this.motion.addEventListener("change", this.updateAnimation);
1538
- this.syncDynamicStyles();
1539
- this.updateAnimation();
1540
- }
1541
- componentDidUpdate(previous) {
1542
- if (previous.styles !== this.props.styles) previous.styles.deleteDynamicRule(this.id);
1543
- if (previous.innerPadding !== this.props.innerPadding) this.syncDynamicStyles();
1544
- if (previous.animated !== this.props.animated || previous.durationMs !== this.props.durationMs || previous.styles !== this.props.styles) this.updateAnimation();
1545
- }
1546
- componentWillUnmount() {
1547
- this.cancelFrame();
1548
- this.motion?.removeEventListener("change", this.updateAnimation);
1549
- this.motion = null;
1550
- this.props.styles.deleteDynamicRule(this.id);
1551
- }
1552
- cancelFrame() {
1553
- const window = this.element.current?.ownerDocument.defaultView;
1554
- if (this.frame !== null) window?.cancelAnimationFrame(this.frame);
1555
- this.frame = null;
1556
- this.startedAt = null;
1557
- }
1558
- syncDynamicStyles() {
1559
- const declarations = {};
1560
- if (this.props.innerPadding) declarations["--inner-padding"] = this.props.innerPadding;
1561
- if (this.angle) declarations["--halo-angle"] = this.angle;
1562
- if (Object.keys(declarations).length === 0) {
1563
- this.props.styles.deleteDynamicRule(this.id);
1564
- return;
1565
- }
1566
- this.props.styles.setDynamicDeclarations(this.id, `#${this.id}`, declarations);
1567
- }
1568
- render() {
1569
- return /* @__PURE__ */ u("div", {
1570
- id: this.id,
1571
- ref: this.element,
1572
- class: "seams-halo-border",
1573
- children: /* @__PURE__ */ u("div", {
1574
- class: `halo-root${this.props.animated ? " animated" : ""}`,
1575
- children: /* @__PURE__ */ u("div", {
1576
- class: "halo-inner",
1577
- children: /* @__PURE__ */ u("div", {
1578
- class: "halo-outer",
1579
- children: [this.props.animated && /* @__PURE__ */ u("div", {
1580
- class: "halo-ring",
1581
- "aria-hidden": "true"
1582
- }), /* @__PURE__ */ u("div", {
1583
- class: "halo-content",
1584
- children: this.props.children
1585
- })]
1586
- })
1587
- })
1588
- })
1589
- });
1590
- }
1591
- };
1592
- //#endregion
1593
- //#region src/core/signingEngine/uiConfirm/ui/preact/PasskeyHaloLoading.tsx
1594
- function PasskeyHaloLoading(props) {
1595
- return /* @__PURE__ */ u("div", {
1596
- class: "seams-passkey-halo-loading",
1597
- "aria-hidden": "true",
1598
- children: /* @__PURE__ */ u("div", {
1599
- class: "seams-passkey-loading-root",
1600
- children: /* @__PURE__ */ u(HaloBorder, {
1601
- animated: props.animated,
1602
- innerPadding: props.innerPadding,
1603
- styles: props.styles,
1604
- children: /* @__PURE__ */ u("div", {
1605
- class: "seams-passkey-loading-touch-icon-container",
1606
- children: /* @__PURE__ */ u("svg", {
1607
- class: "seams-passkey-loading-touch-icon",
1608
- "data-icon": props.icon,
1609
- width: props.size ?? 36,
1610
- height: props.size ?? 36,
1611
- viewBox: "0 0 24 24",
1612
- fill: "none",
1613
- xmlns: "http://www.w3.org/2000/svg",
1614
- focusable: "false",
1615
- children: props.icon === "mail" ? /* @__PURE__ */ u(MailPaths, {}) : /* @__PURE__ */ u(FingerprintPath, {})
1616
- })
1617
- })
1618
- })
1619
- })
1620
- });
1621
- }
1622
- function MailPaths() {
1623
- return /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ u("path", {
1624
- d: "M4.5 6.5H19.5C20.0523 6.5 20.5 6.94772 20.5 7.5V16.5C20.5 17.0523 20.0523 17.5 19.5 17.5H4.5C3.94772 17.5 3.5 17.0523 3.5 16.5V7.5C3.5 6.94772 3.94772 6.5 4.5 6.5Z",
1625
- stroke: "currentColor",
1626
- "stroke-width": "var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)",
1627
- "stroke-linecap": "round",
1628
- "stroke-linejoin": "round",
1629
- "vector-effect": "non-scaling-stroke"
1630
- }), /* @__PURE__ */ u("path", {
1631
- d: "M4.25 7.25L12 12.75L19.75 7.25",
1632
- stroke: "currentColor",
1633
- "stroke-width": "var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)",
1634
- "stroke-linecap": "round",
1635
- "stroke-linejoin": "round",
1636
- "vector-effect": "non-scaling-stroke"
1637
- })] });
1638
- }
1639
- function FingerprintPath() {
1640
- return /* @__PURE__ */ u("path", {
1641
- d: "M6.40519 19.0481C6.58912 18.6051 6.75832 18.1545 6.91219 17.6969M14.3433 20.6926C14.6095 19.9418 14.8456 19.1768 15.0502 18.399C15.2359 17.6934 15.3956 16.9772 15.5283 16.2516M19.4477 17.0583C19.8121 15.0944 20.0026 13.0694 20.0026 11C20.0026 6.58172 16.4209 3 12.0026 3C10.7472 3 9.55932 3.28918 8.50195 3.80456M3.52344 15.0245C3.83663 13.7343 4.00262 12.3865 4.00262 11C4.00262 9.25969 4.55832 7.64917 5.50195 6.33621M12.003 11C12.003 13.7604 11.5557 16.4163 10.7295 18.8992C10.5169 19.5381 10.2792 20.1655 10.0176 20.7803M7.71227 14.5C7.90323 13.3618 8.00262 12.1925 8.00262 11C8.00262 8.79086 9.79348 7 12.0026 7C14.2118 7 16.0026 8.79086 16.0026 11C16.0026 11.6166 15.9834 12.2287 15.9455 12.8357",
1642
- stroke: "currentColor",
1643
- "stroke-width": "var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)",
1644
- "stroke-linecap": "round",
1645
- "stroke-linejoin": "round",
1646
- "vector-effect": "non-scaling-stroke",
1647
- pathLength: "1"
1648
- });
1649
- }
1650
- //#endregion
1651
- //#region src/core/signingEngine/uiConfirm/ui/preact/ConfirmHeader.tsx
1652
- function LoadingStatus(props) {
1653
- return /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ u("span", {
1654
- class: "loading-ellipsis",
1655
- "aria-hidden": "true",
1656
- children: [
1657
- /* @__PURE__ */ u("span", {
1658
- class: "loading-ellipsis__dot",
1659
- children: "."
1660
- }),
1661
- /* @__PURE__ */ u("span", {
1662
- class: "loading-ellipsis__dot",
1663
- children: "."
1664
- }),
1665
- /* @__PURE__ */ u("span", {
1666
- class: "loading-ellipsis__dot",
1667
- children: "."
1668
- })
1669
- ]
1670
- }), /* @__PURE__ */ u("span", {
1671
- class: "sr-only",
1672
- children: props.label
1673
- })] });
1674
- }
1675
- //#endregion
1676
- //#region src/core/signingEngine/uiConfirm/ui/preact/TransactionLabel.tsx
1677
- function addressHref(base, address) {
1678
- return `${base.trim().replace(/\/$/, "")}/address/${encodeURIComponent(address)}`;
1679
- }
1680
- function ReceiverLink(props) {
1681
- return /* @__PURE__ */ u("a", {
1682
- class: "highlight-receiver-id",
1683
- href: addressHref(props.base, props.address),
1684
- target: "_blank",
1685
- rel: "noopener noreferrer",
1686
- children: props.children
1687
- });
1688
- }
1689
- function shortAddress(address) {
1690
- const normalized = address.trim();
1691
- return /^0x[0-9a-fA-F]{40}$/.test(normalized) ? `${normalized.slice(0, 8)}...${normalized.slice(-4)}` : normalized;
1692
- }
1693
- function contractPrefix(node) {
1694
- const match = node.label.trim().match(/^(Transaction(?:\s+\d+)?\s+to contract)\b/i);
1695
- return match ? `${match[1]} ` : void 0;
1696
- }
1697
- function assertNever$4(value) {
1698
- throw new Error(`Unsupported transaction action: ${String(value)}`);
1699
- }
1700
- function transactionLabelTitle(node) {
1701
- const action = node.action;
1702
- if (action) switch (action.type) {
1703
- case ActionType.FunctionCall: return `Calling ${action.methodName} with ${formatDeposit(action.deposit)} using ${formatGas(action.gas)}`;
1704
- case ActionType.Transfer: return `Transfer ${formatDeposit(action.amount)}`;
1705
- case ActionType.CreateAccount: return "Creating Account";
1706
- case ActionType.DeleteAccount: return "Deleting Account";
1707
- case ActionType.Stake: return `Staking ${formatDeposit(action.stake)}`;
1708
- case ActionType.AddKey: return "Adding Key";
1709
- case ActionType.DeleteKey: return "Deleting Key";
1710
- case ActionType.DeployContract: return "Deploying WASM contract";
1711
- case ActionType.DeployGlobalContract: return `Deploy global WASM contract (mode: ${action.deployMode}, size ${formatCodeSize(action.code)})`;
1712
- case ActionType.UseGlobalContract:
1713
- if (action.accountId) return `Use global contract by account ${action.accountId}`;
1714
- if (action.codeHash) return `Use global contract by hash ${action.codeHash}`;
1715
- return "Use global contract";
1716
- default: return assertNever$4(action);
1717
- }
1718
- if (node.transaction) return ((node.totalTransactions ?? 1) > 1 ? `Transaction ${(node.transactionIndex ?? 0) + 1}: to ` : "Transaction to ") + node.transaction.receiverId;
1719
- const prefix = contractPrefix(node);
1720
- if (node.contractAddress?.trim() && prefix) return prefix + shortAddress(node.contractAddress);
1721
- return node.label;
1722
- }
1723
- function TransactionLabel({ node, explorers }) {
1724
- const action = node.action;
1725
- if (action) switch (action.type) {
1726
- case ActionType.FunctionCall: {
1727
- const gas = formatGas(action.gas);
1728
- const deposit = formatDeposit(action.deposit);
1729
- return /* @__PURE__ */ u(S, { children: [
1730
- "Calling ",
1731
- /* @__PURE__ */ u("span", {
1732
- class: "highlight-method-name",
1733
- children: action.methodName
1734
- }),
1735
- deposit !== "0 NEAR" && /* @__PURE__ */ u(S, { children: [
1736
- " ",
1737
- "with ",
1738
- /* @__PURE__ */ u("span", {
1739
- class: "highlight-method-name",
1740
- children: deposit
1741
- })
1742
- ] }),
1743
- gas && /* @__PURE__ */ u(S, { children: [
1744
- " ",
1745
- "using ",
1746
- /* @__PURE__ */ u("span", {
1747
- class: "highlight-method-name",
1748
- children: gas
1749
- })
1750
- ] })
1751
- ] });
1752
- }
1753
- case ActionType.Transfer: return /* @__PURE__ */ u(S, { children: ["Transfer ", /* @__PURE__ */ u("span", {
1754
- class: "highlight-amount",
1755
- children: formatDeposit(action.amount)
1756
- })] });
1757
- case ActionType.CreateAccount: return "Creating Account";
1758
- case ActionType.DeleteAccount: return "Deleting Account";
1759
- case ActionType.Stake: return `Staking ${formatDeposit(action.stake)}`;
1760
- case ActionType.AddKey: return "Adding Key";
1761
- case ActionType.DeleteKey: return "Deleting Key";
1762
- case ActionType.DeployContract: return `Deploying WASM contract (${formatCodeSize(action.code)})`;
1763
- case ActionType.DeployGlobalContract: return transactionLabelTitle(node);
1764
- case ActionType.UseGlobalContract:
1765
- if (action.accountId) return /* @__PURE__ */ u(S, { children: [
1766
- "Use global contract",
1767
- " ",
1768
- /* @__PURE__ */ u(ReceiverLink, {
1769
- base: explorers.near,
1770
- address: action.accountId,
1771
- children: action.accountId
1772
- })
1773
- ] });
1774
- if (action.codeHash) return /* @__PURE__ */ u(S, { children: [
1775
- "Use global contract by hash",
1776
- " ",
1777
- /* @__PURE__ */ u("span", {
1778
- class: "highlight-method-name",
1779
- children: shortenPubkey(action.codeHash, {
1780
- prefix: 10,
1781
- suffix: 6
1782
- })
1783
- })
1784
- ] });
1785
- return "Use global contract";
1786
- default: return assertNever$4(action);
1787
- }
1788
- if (node.transaction) return /* @__PURE__ */ u(S, { children: [(node.totalTransactions ?? 1) > 1 ? `Transaction ${(node.transactionIndex ?? 0) + 1}: to ` : "Transaction to ", /* @__PURE__ */ u(ReceiverLink, {
1789
- base: explorers.near,
1790
- address: node.transaction.receiverId,
1791
- children: node.transaction.receiverId
1792
- })] });
1793
- const prefix = contractPrefix(node);
1794
- const address = node.contractAddress?.trim();
1795
- if (address && prefix) {
1796
- const base = node.chain && node.chain !== "unknown" ? explorers[node.chain] : void 0;
1797
- return /* @__PURE__ */ u(S, { children: [prefix, base ? /* @__PURE__ */ u(ReceiverLink, {
1798
- base,
1799
- address,
1800
- children: shortAddress(address)
1801
- }) : /* @__PURE__ */ u("span", {
1802
- class: "highlight-receiver-id",
1803
- children: shortAddress(address)
1804
- })] });
1805
- }
1806
- const label = node.label.trim();
1807
- if (label.toLowerCase().startsWith("calling ")) {
1808
- const rest = label.slice(8).trim();
1809
- const index = rest.toLowerCase().indexOf(" using ");
1810
- if (index < 0 && rest) return /* @__PURE__ */ u(S, { children: ["Calling ", /* @__PURE__ */ u("span", {
1811
- class: "highlight-method-name",
1812
- children: rest
1813
- })] });
1814
- const method = rest.slice(0, index).trim();
1815
- const trailing = rest.slice(index + 7).trim();
1816
- if (index >= 0 && method) return /* @__PURE__ */ u(S, { children: [
1817
- "Calling ",
1818
- /* @__PURE__ */ u("span", {
1819
- class: "highlight-method-name",
1820
- children: method
1821
- }),
1822
- trailing && ` using ${trailing}`
1823
- ] });
1824
- }
1825
- return node.label;
1826
- }
1827
- //#endregion
1828
- //#region src/core/signingEngine/uiConfirm/ui/preact/TransactionTree.tsx
1829
- /** @jsxImportSource preact */
1830
- const drivenClasses = [
1831
- "anim-h",
1832
- "anim-h-active",
1833
- "anim-h-driven"
1834
- ];
1835
- const motionClasses = [...drivenClasses, "anim-h-hold"];
1836
- let nextNodeId = 0;
1837
- function Chevron() {
1838
- return /* @__PURE__ */ u("svg", {
1839
- class: "chevron",
1840
- viewBox: "0 0 16 16",
1841
- "aria-hidden": "true",
1842
- children: /* @__PURE__ */ u("path", {
1843
- fill: "currentColor",
1844
- d: "M6 3l5 5-5 5z"
1845
- })
1846
- });
1847
- }
1848
- function hasContentVariants(node) {
1849
- return !!node.contentVariants?.decoded && !!node.contentVariants.raw && node.contentVariants.decoded !== node.contentVariants.raw;
1850
- }
1851
- function renderChild(interactions, depth, node) {
1852
- return /* @__PURE__ */ u(TransactionNode, {
1853
- node,
1854
- depth,
1855
- styles: interactions.styles,
1856
- explorers: interactions.explorers,
1857
- onToggle: interactions.onToggle,
1858
- onCopy: interactions.onCopy
1859
- }, node.id);
1860
- }
1861
- function TransactionTree(props) {
1862
- if (!props.node.children?.length) return null;
1863
- const content = /* @__PURE__ */ u("div", {
1864
- class: "tooltip-tree-root",
1865
- children: /* @__PURE__ */ u("div", {
1866
- class: "tooltip-tree-children",
1867
- children: props.node.children.map(renderChild.bind(null, props, 1))
1868
- })
1869
- });
1870
- return /* @__PURE__ */ u("div", {
1871
- class: "seams-tx-tree",
1872
- "data-theme": props.theme,
1873
- children: props.showShadow ? /* @__PURE__ */ u("div", {
1874
- class: "tooltip-border-outer",
1875
- children: content
1876
- }) : content
1877
- });
1878
- }
1879
- var TransactionNode = class extends C {
1880
- constructor(..._args) {
1881
- super(..._args);
1882
- this.state = {
1883
- mode: this.props.node.contentVariants?.defaultMode === "raw" ? "raw" : "decoded",
1884
- copied: false
1885
- };
1886
- this.id = `seams-tree-node-${++nextNodeId}`;
1887
- this.details = M();
1888
- this.shell = M();
1889
- this.disposed = false;
1890
- this.copiedTimer = null;
1891
- this.frame = null;
1892
- this.motionTimer = null;
1893
- this.motion = null;
1894
- this.modeHeight = null;
1895
- this.setHeight = (height) => {
1896
- if (this.disposed) return;
1897
- this.props.styles.setDynamicDeclarations(this.id, `#${this.id}`, { "--seams-tree__anim-target": `${height}px` });
1898
- };
1899
- this.releaseHeight = () => {
1900
- this.props.styles.deleteDynamicRule(this.id);
1901
- };
1902
- this.clearCopied = () => {
1903
- this.copiedTimer = null;
1904
- if (!this.disposed) this.setState({ copied: false });
1905
- };
1906
- this.copy = async (event) => {
1907
- event.preventDefault();
1908
- event.stopPropagation();
1909
- const value = this.props.node.copyValue;
1910
- if (!value) return;
1911
- const root = event.currentTarget.closest(".seams-tx-tree");
1912
- if (!root) return;
1913
- try {
1914
- if (!await copySurfaceText(root, value)) return;
1915
- if (this.disposed) return;
1916
- if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);
1917
- this.setState({ copied: true });
1918
- this.copiedTimer = setTimeout(this.clearCopied, 2e3);
1919
- this.props.onCopy?.(value);
1920
- } catch {}
1921
- };
1922
- this.toggleMode = (event) => {
1923
- event.preventDefault();
1924
- event.stopPropagation();
1925
- if (!hasContentVariants(this.props.node)) return;
1926
- if (this.shell.current) {
1927
- this.modeHeight = this.shell.current.getBoundingClientRect().height;
1928
- this.setHeight(this.modeHeight);
1929
- this.shell.current.classList.add(...drivenClasses);
1930
- }
1931
- this.setState({ mode: this.state.mode === "decoded" ? "raw" : "decoded" });
1932
- };
1933
- this.toggle = (event) => {
1934
- if (event.target.closest("a, button")) {
1935
- event.stopPropagation();
1936
- return;
1937
- }
1938
- event.preventDefault();
1939
- event.stopPropagation();
1940
- const details = this.details.current;
1941
- if (!details || this.motion) return;
1942
- const body = details.querySelector(":scope > .folder-children");
1943
- const open = !details.open;
1944
- const reduced = details.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches;
1945
- if (!body || reduced) {
1946
- details.open = open;
1947
- this.props.onToggle?.(this.props.node.id, open);
1948
- return;
1949
- }
1950
- this.motion = {
1951
- body,
1952
- open
1953
- };
1954
- const height = open ? 0 : body.getBoundingClientRect().height;
1955
- this.setHeight(height);
1956
- body.classList.add("anim-h", "anim-h-active", "anim-h-hold");
1957
- details.open = true;
1958
- body.offsetHeight;
1959
- this.frame = details.ownerDocument.defaultView.requestAnimationFrame(this.startMotion);
1960
- };
1961
- this.startMotion = () => {
1962
- this.frame = null;
1963
- if (!this.motion || this.disposed) return;
1964
- const { body, open } = this.motion;
1965
- const fromCssPx = body.getBoundingClientRect().height;
1966
- const toCssPx = open ? body.scrollHeight : 0;
1967
- if (announceClampedSurfaceResize({
1968
- reason: this.props.node.id,
1969
- element: body,
1970
- drivenClasses,
1971
- fromCssPx,
1972
- toCssPx,
1973
- setHeightCssPx: this.setHeight,
1974
- onSettled: this.finishMotion
1975
- })) return;
1976
- body.addEventListener("transitionend", this.onTransitionEnd);
1977
- body.classList.remove("anim-h-hold");
1978
- this.setHeight(toCssPx);
1979
- this.motionTimer = setTimeout(this.finishMotion, open ? 200 : 250);
1980
- };
1981
- this.onTransitionEnd = (event) => {
1982
- if (event.target === this.motion?.body && event.propertyName === "height") this.finishMotion();
1983
- };
1984
- this.finishMotion = () => {
1985
- if (this.disposed || !this.motion) return;
1986
- const { body, open } = this.motion;
1987
- this.motion = null;
1988
- if (this.motionTimer !== null) clearTimeout(this.motionTimer);
1989
- this.motionTimer = null;
1990
- body.removeEventListener("transitionend", this.onTransitionEnd);
1991
- body.classList.remove(...motionClasses);
1992
- if (this.details.current) this.details.current.open = open;
1993
- this.releaseHeight();
1994
- this.props.onToggle?.(this.props.node.id, open);
1995
- };
1996
- }
1997
- componentDidUpdate(previous) {
1998
- if (previous.styles !== this.props.styles) previous.styles.deleteDynamicRule(this.id);
1999
- if (this.modeHeight !== null && this.shell.current) {
2000
- const shell = this.shell.current;
2001
- const fromCssPx = this.modeHeight;
2002
- this.modeHeight = null;
2003
- shell.classList.remove(...drivenClasses);
2004
- const toCssPx = shell.getBoundingClientRect().height;
2005
- shell.classList.add(...drivenClasses);
2006
- if (!announceClampedSurfaceResize({
2007
- reason: `${this.props.node.id}:file-content-mode`,
2008
- element: shell,
2009
- drivenClasses,
2010
- fromCssPx,
2011
- toCssPx,
2012
- setHeightCssPx: this.setHeight,
2013
- onSettled: this.releaseHeight
2014
- })) {
2015
- shell.classList.remove(...drivenClasses);
2016
- this.releaseHeight();
2017
- }
2018
- }
2019
- }
2020
- componentWillUnmount() {
2021
- this.disposed = true;
2022
- if (this.copiedTimer !== null) clearTimeout(this.copiedTimer);
2023
- if (this.motionTimer !== null) clearTimeout(this.motionTimer);
2024
- if (this.frame !== null) this.details.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame);
2025
- this.motion?.body.removeEventListener("transitionend", this.onTransitionEnd);
2026
- this.motion = null;
2027
- this.releaseHeight();
2028
- }
2029
- label(chevron) {
2030
- const node = this.props.node;
2031
- return /* @__PURE__ */ u("span", {
2032
- class: `label${node.type === "file" ? " label-action-node" : ""}`,
2033
- hidden: node.hideLabel,
2034
- children: [
2035
- chevron && !node.hideChevron && /* @__PURE__ */ u(Chevron, {}),
2036
- /* @__PURE__ */ u("span", {
2037
- class: "label-text",
2038
- title: transactionLabelTitle(node),
2039
- children: /* @__PURE__ */ u(TransactionLabel, {
2040
- node,
2041
- explorers: this.props.explorers
2042
- })
2043
- }),
2044
- node.type === "file" && node.copyValue && /* @__PURE__ */ u("button", {
2045
- type: "button",
2046
- class: "copy-badge",
2047
- "data-copied": String(this.state.copied),
2048
- onClick: this.copy,
2049
- title: this.state.copied ? "Copied" : "Copy",
2050
- children: this.state.copied ? "copied" : "copy"
2051
- })
2052
- ]
2053
- });
2054
- }
2055
- render() {
2056
- const { node, depth } = this.props;
2057
- const rowClass = `row summary-row depth-${Math.max(0, depth - 1)}`;
2058
- if (node.type === "file" && !node.content) return /* @__PURE__ */ u("div", {
2059
- id: this.id,
2060
- class: `row file-row depth-${Math.max(0, depth - 1)}`,
2061
- "data-no-elbow": String(!!node.hideLabel),
2062
- children: [/* @__PURE__ */ u("span", { class: "indent" }), this.label(false)]
2063
- });
2064
- const variants = hasContentVariants(node);
2065
- const content = variants && node.contentVariants ? node.contentVariants[this.state.mode] : node.content;
2066
- const toggleLabel = this.state.mode === "decoded" ? "bytes" : "decoded";
2067
- return /* @__PURE__ */ u("details", {
2068
- id: this.id,
2069
- ref: this.details,
2070
- class: `tree-node ${node.type}`,
2071
- open: !!node.open,
2072
- "data-node-id": node.id,
2073
- children: [/* @__PURE__ */ u("summary", {
2074
- class: rowClass,
2075
- "data-no-elbow": String(!!node.hideLabel),
2076
- onClick: this.toggle,
2077
- children: [
2078
- /* @__PURE__ */ u("span", { class: "indent" }),
2079
- this.label(true),
2080
- node.type === "file" && /* @__PURE__ */ u("div", {
2081
- ref: this.shell,
2082
- class: `file-content-shell${variants ? " has-mode-toggle" : ""}`,
2083
- children: [variants && /* @__PURE__ */ u("button", {
2084
- type: "button",
2085
- class: "file-content-mode-toggle",
2086
- title: `Show ${toggleLabel}`,
2087
- "aria-label": `Show ${toggleLabel}`,
2088
- onClick: this.toggleMode,
2089
- children: toggleLabel
2090
- }), /* @__PURE__ */ u("div", {
2091
- class: "file-content",
2092
- children: content
2093
- })]
2094
- })
2095
- ]
2096
- }), node.type === "folder" && !!node.children?.length && /* @__PURE__ */ u("div", {
2097
- class: "folder-children",
2098
- children: node.children.map(renderChild.bind(null, this.props, depth + 1))
2099
- })]
2100
- });
2101
- }
2102
- };
2103
- //#endregion
2104
- //#region src/core/signingEngine/uiConfirm/ui/preact/ConfirmContent.tsx
2105
- /** @jsxImportSource preact */
2106
- let nextContentId = 0;
2107
- function stopDragStart(event) {
2108
- event.stopPropagation();
2109
- }
2110
- var ConfirmContent = class extends C {
2111
- constructor(props) {
2112
- super(props);
2113
- this.state = { armed: false };
2114
- this.id = `seams-confirm-content-${++nextContentId}`;
2115
- this.root = M();
2116
- this.frame = null;
2117
- this.capturedBeforeUpdate = false;
2118
- this.reflowEnabled = true;
2119
- this.getReflowElement = () => {
2120
- const root = this.root.current;
2121
- return root?.closest(".modal-container-root, .seams-confirmation-drawer") ?? root;
2122
- };
2123
- this.setHeight = (height) => {
2124
- const element = this.getReflowElement();
2125
- const selector = element?.id ? `#${element.id}` : `#${this.id}`;
2126
- this.props.styles.setDynamicDeclarations(this.id, selector, { [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${height}px` });
2127
- };
2128
- this.afterFirstPaint = () => {
2129
- this.frame = this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.arm);
2130
- };
2131
- this.arm = () => {
2132
- this.frame = null;
2133
- this.setState({ armed: true });
2134
- };
2135
- this.confirm = () => {
2136
- if (this.state.armed && this.props.decision.kind === "ready") this.props.decision.onConfirm();
2137
- };
2138
- this.cancel = () => {
2139
- this.props.onCancel();
2140
- };
2141
- this.reflow = createSurfaceHeightReflow({
2142
- reason: "tx-body",
2143
- element: this.getReflowElement,
2144
- setHeightCssPx: this.setHeight
2145
- });
2146
- }
2147
- componentDidMount() {
2148
- this.reflowEnabled = this.getReflowElement() === this.root.current;
2149
- this.frame = this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.afterFirstPaint);
2150
- }
2151
- componentWillReceiveProps() {
2152
- if (!this.reflowEnabled) return;
2153
- this.reflow.capture();
2154
- this.capturedBeforeUpdate = true;
2155
- }
2156
- componentWillUpdate() {
2157
- if (!this.reflowEnabled) return;
2158
- if (this.capturedBeforeUpdate) return;
2159
- this.reflow.capture();
2160
- }
2161
- componentDidUpdate(previous) {
2162
- if (!this.reflowEnabled) return;
2163
- this.capturedBeforeUpdate = false;
2164
- if (previous.styles !== this.props.styles) previous.styles.deleteDynamicRule(this.id);
2165
- this.reflow.commit();
2166
- }
2167
- componentWillUnmount() {
2168
- if (this.frame !== null) this.root.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame);
2169
- this.frame = null;
2170
- this.reflow.dispose();
2171
- this.props.styles.deleteDynamicRule(this.id);
2172
- }
2173
- render() {
2174
- const preparing = this.props.decision.kind === "preparing";
2175
- return /* @__PURE__ */ u("div", {
2176
- class: "seams-tx-confirm-content",
2177
- onPointerDown: stopDragStart,
2178
- onMouseDown: stopDragStart,
2179
- onTouchStart: stopDragStart,
2180
- children: /* @__PURE__ */ u("div", {
2181
- id: this.id,
2182
- ref: this.root,
2183
- class: "txc-root",
2184
- children: [
2185
- this.props.errorMessage && /* @__PURE__ */ u("div", {
2186
- class: "error",
2187
- role: "alert",
2188
- children: this.props.errorMessage
2189
- }),
2190
- this.props.tree && /* @__PURE__ */ u("div", {
2191
- class: "tooltip-width",
2192
- children: /* @__PURE__ */ u(TransactionTree, {
2193
- node: this.props.tree,
2194
- theme: this.props.theme,
2195
- explorers: this.props.explorers,
2196
- styles: this.props.styles,
2197
- showShadow: false,
2198
- onToggle: this.props.onTreeToggle,
2199
- onCopy: this.props.onCopy
2200
- })
2201
- }),
2202
- /* @__PURE__ */ u("div", {
2203
- class: "actions",
2204
- children: [!this.props.cancelInHeader && /* @__PURE__ */ u("button", {
2205
- type: "button",
2206
- class: "cancel",
2207
- onClick: this.cancel,
2208
- children: this.props.cancelText
2209
- }), /* @__PURE__ */ u("button", {
2210
- type: this.props.decision.kind === "form" ? "submit" : "button",
2211
- form: this.props.decision.kind === "form" ? this.props.decision.formId : void 0,
2212
- class: `confirm${preparing ? " loading" : ""}`,
2213
- onClick: this.confirm,
2214
- disabled: preparing || !this.state.armed,
2215
- children: preparing ? /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ u("span", {
2216
- class: "loading-indicator",
2217
- role: "progressbar",
2218
- "aria-label": "Loading"
2219
- }), /* @__PURE__ */ u("span", { children: "Loading..." })] }) : /* @__PURE__ */ u(S, { children: [this.props.confirmIcon, this.props.confirmText] })
2220
- })]
2221
- })
2222
- ]
2223
- })
2224
- });
2225
- }
2226
- };
2227
- //#endregion
2228
- //#region src/core/signingEngine/uiConfirm/ui/preact/ConfirmationBody.tsx
2229
- /** @jsxImportSource preact */
2230
- function assertNever$3(value) {
2231
- throw new Error(`Unexpected confirmation body: ${String(value)}`);
2232
- }
2233
- var ConfirmationBody = class extends C {
2234
- constructor(..._args) {
2235
- super(..._args);
2236
- this.copy = () => {
2237
- if (this.props.model.kind === "funding") this.props.onCopyAccount(this.props.model.accountId);
2238
- };
2239
- }
2240
- render() {
2241
- const model = this.props.model;
2242
- switch (model.kind) {
2243
- case "empty": return null;
2244
- case "text": return /* @__PURE__ */ u("div", {
2245
- class: "confirmation-body",
2246
- children: model.text
2247
- });
2248
- case "status": return /* @__PURE__ */ u("div", {
2249
- class: "confirmation-body confirmation-body--status",
2250
- children: model.text
2251
- });
2252
- case "funding": return /* @__PURE__ */ u("div", {
2253
- class: "confirmation-body confirmation-body--funding",
2254
- children: [
2255
- "NEAR account",
2256
- /* @__PURE__ */ u("button", {
2257
- type: "button",
2258
- class: "confirmation-body__copy-target",
2259
- title: `Copy ${model.accountId}`,
2260
- "aria-label": `Copy NEAR account ${model.accountId}`,
2261
- onClick: this.copy,
2262
- children: model.shortAccountId
2263
- }),
2264
- "needs funding"
2265
- ]
2266
- });
2267
- default: return assertNever$3(model);
2268
- }
2269
- }
2270
- };
2271
- //#endregion
2272
- //#region src/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationDetails.tsx
2273
- function PasskeyRegistrationDetails(props) {
2274
- return /* @__PURE__ */ u("div", {
2275
- class: "passkey-registration-confirm__identity",
2276
- "aria-label": "Passkey registration details",
2277
- children: [/* @__PURE__ */ u("div", {
2278
- class: "passkey-registration-confirm__row",
2279
- children: [/* @__PURE__ */ u("span", {
2280
- class: "passkey-registration-confirm__label",
2281
- children: "Account"
2282
- }), /* @__PURE__ */ u("span", {
2283
- class: "passkey-registration-confirm__value",
2284
- title: props.display.intendedUserName,
2285
- children: props.display.intendedUserName
2286
- })]
2287
- }), /* @__PURE__ */ u("div", {
2288
- class: "passkey-registration-confirm__row",
2289
- children: [/* @__PURE__ */ u("span", {
2290
- class: "passkey-registration-confirm__label",
2291
- children: "Website"
2292
- }), /* @__PURE__ */ u("span", {
2293
- class: "passkey-registration-confirm__value",
2294
- title: props.display.rpId,
2295
- children: props.display.rpId
2296
- })]
2297
- })]
2298
- });
2299
- }
2300
- //#endregion
2301
- //#region src/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationContent.tsx
2302
- /** @jsxImportSource preact */
2303
- var PasskeyRegistrationContent = class extends C {
2304
- constructor(..._args) {
2305
- super(..._args);
2306
- this.confirm = () => {
2307
- if (this.props.decision.kind === "ready") this.props.decision.onConfirm();
2308
- };
2309
- this.cancel = () => {
2310
- this.props.onCancel();
2311
- };
2312
- }
2313
- render() {
2314
- const creating = this.props.decision.kind === "creating";
2315
- return /* @__PURE__ */ u("div", {
2316
- ref: this.props.root,
2317
- class: "passkey-registration-confirm",
2318
- children: [
2319
- /* @__PURE__ */ u("div", {
2320
- class: "hero passkey-registration-confirm__hero",
2321
- children: [/* @__PURE__ */ u(PasskeyHaloLoading, {
2322
- animated: !this.props.errorMessage,
2323
- icon: "fingerprint",
2324
- size: 44,
2325
- styles: this.props.styles
2326
- }), /* @__PURE__ */ u("div", {
2327
- class: "hero-container passkey-registration-confirm__hero-copy",
2328
- children: [/* @__PURE__ */ u("h2", {
2329
- class: "hero-heading",
2330
- children: this.props.heading
2331
- }), /* @__PURE__ */ u("p", {
2332
- class: "passkey-registration-confirm__body",
2333
- children: this.props.body
2334
- })]
2335
- })]
2336
- }),
2337
- this.props.errorMessage && /* @__PURE__ */ u("div", {
2338
- class: "error-banner",
2339
- children: this.props.errorMessage
2340
- }),
2341
- /* @__PURE__ */ u(PasskeyRegistrationDetails, { display: this.props.display }),
2342
- /* @__PURE__ */ u("div", {
2343
- class: "passkey-registration-confirm__actions",
2344
- children: [/* @__PURE__ */ u("button", {
2345
- type: "button",
2346
- class: "btn btn-cancel",
2347
- onClick: this.cancel,
2348
- children: this.props.cancelText
2349
- }), /* @__PURE__ */ u("button", {
2350
- type: "button",
2351
- class: "btn btn-confirm",
2352
- disabled: creating,
2353
- onClick: this.confirm,
2354
- children: creating ? /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ u("span", {
2355
- class: "loading-indicator passkey-registration-confirm__spinner",
2356
- role: "progressbar",
2357
- "aria-label": "Creating passkey"
2358
- }), /* @__PURE__ */ u("span", {
2359
- class: "passkey-registration-confirm__busy-label",
2360
- children: "Creating passkey..."
2361
- })] }) : "Create passkey"
2362
- })]
2363
- })
2364
- ]
2365
- });
2366
- }
2367
- };
2368
- //#endregion
2369
- //#region src/core/signingEngine/uiConfirm/ui/preact/EmailOtpInput.tsx
2370
- /** @jsxImportSource preact */
2371
- let nextInputId = 0;
2372
- var EmailOtpInput = class extends C {
2373
- constructor(..._args) {
2374
- super(..._args);
2375
- this.id = `seams-email-code-${++nextInputId}`;
2376
- this.input = (event) => {
2377
- if (this.props.state.kind === "editing") this.props.state.onInput(event.currentTarget.value);
2378
- };
2379
- this.resend = () => {
2380
- if (this.props.resend?.kind === "available") this.props.resend.onResend();
2381
- };
2382
- this.renderDigit = (index) => {
2383
- const digit = this.props.code[index] || "";
2384
- return /* @__PURE__ */ u("span", {
2385
- class: `email-otp-confirm__slot${digit ? " is-filled" : ""}`,
2386
- children: digit
2387
- }, index);
2388
- };
2389
- }
2390
- render() {
2391
- const disabled = this.props.state.kind !== "editing";
2392
- const helperId = `${this.id}-helper`;
2393
- const errorId = `${this.id}-error`;
2394
- return /* @__PURE__ */ u("div", {
2395
- class: "email-otp-confirm",
2396
- children: [
2397
- /* @__PURE__ */ u("label", {
2398
- class: "email-otp-confirm__label",
2399
- for: this.id,
2400
- children: "Email code"
2401
- }),
2402
- /* @__PURE__ */ u("div", {
2403
- class: "email-otp-confirm__code-field",
2404
- "data-disabled": disabled ? "true" : "false",
2405
- children: [/* @__PURE__ */ u("input", {
2406
- id: this.id,
2407
- name: "email-code",
2408
- type: "text",
2409
- class: "email-otp-confirm__input",
2410
- inputMode: "numeric",
2411
- autoComplete: "one-time-code",
2412
- "data-email-otp-challenge-id": this.props.challengeId,
2413
- pattern: "[0-9]*",
2414
- maxLength: 6,
2415
- spellcheck: false,
2416
- value: this.props.code,
2417
- disabled,
2418
- onInput: this.input,
2419
- "aria-invalid": this.props.errorMessage ? "true" : void 0,
2420
- "aria-describedby": this.props.errorMessage ? `${helperId} ${errorId}` : helperId
2421
- }), /* @__PURE__ */ u("div", {
2422
- class: `email-otp-confirm__slots${disabled ? " is-submitting" : ""}`,
2423
- "aria-hidden": "true",
2424
- children: [
2425
- 0,
2426
- 1,
2427
- 2,
2428
- 3,
2429
- 4,
2430
- 5
2431
- ].map(this.renderDigit)
2432
- })]
2433
- }),
2434
- /* @__PURE__ */ u("div", {
2435
- id: helperId,
2436
- class: "email-otp-confirm__helper",
2437
- children: this.props.helperText
2438
- }),
2439
- this.props.errorMessage && /* @__PURE__ */ u("div", {
2440
- id: errorId,
2441
- class: "email-otp-confirm__error",
2442
- children: this.props.errorMessage
2443
- }),
2444
- this.props.resend && /* @__PURE__ */ u("button", {
2445
- type: "button",
2446
- class: "email-otp-confirm__resend",
2447
- disabled: this.props.resend.kind === "unavailable",
2448
- onClick: this.resend,
2449
- children: this.props.resend.label
2450
- })
2451
- ]
2452
- });
2453
- }
2454
- };
2455
- //#endregion
2456
- //#region src/core/signingEngine/uiConfirm/ui/preact/email-otp-session.ts
2457
- var EmailOtpSession = class {
2458
- constructor(options) {
2459
- this.codeState = {
2460
- kind: "editing",
2461
- code: ""
2462
- };
2463
- this.resendState = {
2464
- kind: "available",
2465
- label: "Resend code"
2466
- };
2467
- this.error = "";
2468
- this.countdown = null;
2469
- this.input = (rawValue) => {
2470
- if (this.codeState.kind !== "editing") return;
2471
- const code = rawValue.replace(/\D/g, "").slice(0, 6);
2472
- this.error = "";
2473
- this.codeState = {
2474
- kind: "editing",
2475
- code
2476
- };
2477
- if (code.length === 6) this.confirm();
2478
- else this.publish();
2479
- };
2480
- this.submit = () => {
2481
- if (this.codeState.kind !== "fading") return;
2482
- const code = this.codeState.code;
2483
- this.codeState = {
2484
- kind: "submitting",
2485
- code
2486
- };
2487
- this.publish();
2488
- if (!this.isDisposed()) this.options.onSubmit(code);
2489
- };
2490
- this.resend = async () => {
2491
- if (this.codeState.kind !== "editing" || this.resendState.kind !== "available") return;
2492
- const action = this.options.resend;
2493
- if (!action) return;
2494
- const until = Date.now() + action.cooldownMs;
2495
- const pending = {
2496
- kind: "sending",
2497
- until
2498
- };
2499
- this.resendState = pending;
2500
- this.error = "";
2501
- this.publish();
2502
- if (this.isDisposed()) return;
2503
- let result;
2504
- try {
2505
- result = await action.send();
2506
- } catch {
2507
- result = {
2508
- kind: "failed",
2509
- message: "Could not send code."
2510
- };
2511
- }
2512
- if (this.isDisposed() || this.resendState !== pending) return;
2513
- const label = result.kind === "sent" ? "Code sent" : "Resend code";
2514
- if (result.kind === "failed") this.error = result.message;
2515
- if (Date.now() >= until) this.resendState = {
2516
- kind: "available",
2517
- label
2518
- };
2519
- else {
2520
- this.resendState = {
2521
- kind: "cooldown",
2522
- until,
2523
- label
2524
- };
2525
- this.countdown = setInterval(this.tick, 250);
2526
- }
2527
- this.publish();
2528
- };
2529
- this.tick = () => {
2530
- if (this.resendState.kind !== "cooldown") return;
2531
- if (Date.now() >= this.resendState.until) {
2532
- this.resendState = {
2533
- kind: "available",
2534
- label: this.resendState.label
2535
- };
2536
- this.clearCountdown();
2537
- }
2538
- this.publish();
2539
- };
2540
- this.options = options;
2541
- }
2542
- confirm() {
2543
- if (this.codeState.kind !== "editing") return "ignored";
2544
- const code = this.codeState.code;
2545
- if (code.length !== 6) {
2546
- this.error = "Enter the 6-digit Email OTP code.";
2547
- this.publish();
2548
- return "invalid";
2549
- }
2550
- this.error = "";
2551
- this.codeState = {
2552
- kind: "fading",
2553
- code,
2554
- timer: setTimeout(this.submit, 150)
2555
- };
2556
- this.publish();
2557
- return "accepted";
2558
- }
2559
- retry(message) {
2560
- if (this.codeState.kind === "disposed") return;
2561
- this.cancelFade();
2562
- this.codeState = {
2563
- kind: "editing",
2564
- code: this.codeState.code
2565
- };
2566
- this.error = message;
2567
- this.publish();
2568
- }
2569
- setVerification(state) {
2570
- if (this.codeState.kind === "disposed") return;
2571
- switch (state.kind) {
2572
- case "ready":
2573
- if (this.codeState.kind === "submitting") this.retry("");
2574
- return;
2575
- case "pending":
2576
- this.cancelFade();
2577
- this.codeState = {
2578
- kind: "submitting",
2579
- code: this.codeState.code
2580
- };
2581
- this.publish();
2582
- return;
2583
- case "rejected":
2584
- this.retry(state.message);
2585
- return;
2586
- }
2587
- }
2588
- isDisposed() {
2589
- return this.codeState.kind === "disposed";
2590
- }
2591
- publish() {
2592
- if (this.codeState.kind === "disposed") return;
2593
- this.options.onChange({
2594
- code: this.codeState.code,
2595
- phase: this.codeState.kind,
2596
- error: this.error,
2597
- resend: this.options.resend ? this.resendSnapshot() : null
2598
- });
2599
- }
2600
- resendSnapshot() {
2601
- switch (this.resendState.kind) {
2602
- case "available": return {
2603
- available: this.codeState.kind === "editing",
2604
- label: this.resendState.label
2605
- };
2606
- case "sending": return {
2607
- available: false,
2608
- label: "Sending..."
2609
- };
2610
- case "cooldown": return {
2611
- available: false,
2612
- label: `Resend in ${Math.max(1, Math.ceil((this.resendState.until - Date.now()) / 1e3))}s`
2613
- };
2614
- }
2615
- }
2616
- cancelFade() {
2617
- if (this.codeState.kind === "fading") clearTimeout(this.codeState.timer);
2618
- }
2619
- clearCountdown() {
2620
- if (this.countdown !== null) clearInterval(this.countdown);
2621
- this.countdown = null;
2622
- }
2623
- dispose() {
2624
- this.cancelFade();
2625
- this.clearCountdown();
2626
- this.codeState = { kind: "disposed" };
2627
- this.error = "";
2628
- }
2629
- };
2630
- //#endregion
2631
- //#region src/core/signingEngine/uiConfirm/ui/preact/EmailOtpContent.tsx
2632
- /** @jsxImportSource preact */
2633
- function EmailOtpContent(props) {
2634
- return /* @__PURE__ */ u(EmailOtpSessionView, { ...props }, props.prompt.challengeId);
2635
- }
2636
- var EmailOtpSessionView = class extends C {
2637
- constructor(props) {
2638
- super(props);
2639
- this.form = M();
2640
- this.submit = (code) => {
2641
- if (this.lifetime.kind === "active") this.props.onSubmit(code, this.lifetime.challengeId);
2642
- };
2643
- this.send = async () => {
2644
- const callback = this.props.prompt.onResend;
2645
- if (!callback) return {
2646
- kind: "failed",
2647
- message: "Could not send code."
2648
- };
2649
- try {
2650
- const result = await callback();
2651
- if (this.lifetime.kind === "disposed") return { kind: "sent" };
2652
- const challengeId = String(result?.challengeId || "").trim();
2653
- const emailHint = String(result?.emailHint || "").trim();
2654
- if (challengeId) this.lifetime = {
2655
- kind: "active",
2656
- challengeId,
2657
- emailHint: emailHint || this.lifetime.emailHint
2658
- };
2659
- return { kind: "sent" };
2660
- } catch (error) {
2661
- return {
2662
- kind: "failed",
2663
- message: formatResendError(error)
2664
- };
2665
- }
2666
- };
2667
- this.change = (snapshot) => {
2668
- this.setState(snapshot);
2669
- };
2670
- this.confirm = (event) => {
2671
- event.preventDefault();
2672
- event.stopPropagation();
2673
- if (this.session.confirm() === "invalid") this.setState({}, this.focusCode);
2674
- };
2675
- this.focusCode = () => {
2676
- this.form.current?.querySelector("input")?.focus({ preventScroll: true });
2677
- };
2678
- this.lifetime = {
2679
- kind: "active",
2680
- challengeId: props.prompt.challengeId,
2681
- emailHint: props.prompt.emailHint?.trim() || ""
2682
- };
2683
- this.state = {
2684
- code: "",
2685
- phase: "editing",
2686
- error: "",
2687
- resend: props.prompt.onResend ? {
2688
- available: true,
2689
- label: "Resend code"
2690
- } : null
2691
- };
2692
- this.session = new EmailOtpSession({
2693
- onSubmit: this.submit,
2694
- onChange: this.change,
2695
- resend: props.prompt.onResend ? {
2696
- send: this.send,
2697
- cooldownMs: Math.max(1e3, Math.floor(Number(props.prompt.resendDebounceMs) || 1e4))
2698
- } : null
2699
- });
2700
- }
2701
- componentDidMount() {
2702
- this.session.setVerification(this.props.verification);
2703
- }
2704
- componentDidUpdate(previous) {
2705
- if (verificationChanged(previous.verification, this.props.verification)) this.session.setVerification(this.props.verification);
2706
- }
2707
- componentWillUnmount() {
2708
- this.lifetime = { kind: "disposed" };
2709
- this.session.dispose();
2710
- }
2711
- inputState() {
2712
- switch (this.state.phase) {
2713
- case "editing": return {
2714
- kind: "editing",
2715
- onInput: this.session.input
2716
- };
2717
- case "fading": return { kind: "fading" };
2718
- case "submitting": return { kind: "submitting" };
2719
- }
2720
- }
2721
- resendAction() {
2722
- const resend = this.state.resend;
2723
- if (!resend) return null;
2724
- if (!resend.available) return {
2725
- kind: "unavailable",
2726
- label: resend.label
2727
- };
2728
- return {
2729
- kind: "available",
2730
- label: resend.label,
2731
- onResend: this.session.resend
2732
- };
2733
- }
2734
- render() {
2735
- return /* @__PURE__ */ u("form", {
2736
- ref: this.form,
2737
- id: this.props.formId,
2738
- onSubmit: this.confirm,
2739
- noValidate: true,
2740
- children: /* @__PURE__ */ u(EmailOtpInput, {
2741
- challengeId: this.lifetime.kind === "active" ? this.lifetime.challengeId : "",
2742
- code: this.state.code,
2743
- helperText: this.props.prompt.helperText?.trim() || formatEmailOtpSentText(this.lifetime.kind === "active" ? this.lifetime.emailHint : ""),
2744
- errorMessage: this.state.error || void 0,
2745
- state: this.inputState(),
2746
- resend: this.resendAction()
2747
- })
2748
- });
2749
- }
2750
- };
2751
- function verificationChanged(previous, next) {
2752
- if (previous.kind !== next.kind) return true;
2753
- return previous.kind === "rejected" && next.kind === "rejected" && previous.message !== next.message;
2754
- }
2755
- function formatResendError(error) {
2756
- if (error && typeof error === "object" && "code" in error && error.code === "rate_limited") {
2757
- const retryAfterMs = "retryAfterMs" in error ? Number(error.retryAfterMs) : NaN;
2758
- if (Number.isFinite(retryAfterMs) && retryAfterMs > 0) return `Too many requests. Try again in ${Math.max(1, Math.ceil(retryAfterMs / 1e3))}s.`;
2759
- return "Too many requests. Try again shortly.";
2760
- }
2761
- return error instanceof Error && error.message ? error.message : "Could not send code.";
2762
- }
2763
- //#endregion
2764
- //#region src/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.tsx
2765
- /** @jsxImportSource preact */
2766
- let nextDisclosureId = 0;
2767
- var ReviewDisclosure = class extends C {
2768
- constructor(..._args) {
2769
- super(..._args);
2770
- this.root = M();
2771
- this.id = `seams-review-disclosure-${++nextDisclosureId}`;
2772
- this.motion = null;
2773
- this.setHeight = (height) => {
2774
- const details = this.root.current;
2775
- if (!details) return;
2776
- confirmationDocumentStyles(details.ownerDocument).setDynamicDeclarations(this.id, `#${this.id}`, { "--seams-review-disclosure-height": `${height}px` });
2777
- };
2778
- this.finish = () => {
2779
- if (this.root.current && this.motion) {
2780
- this.root.current.open = this.motion.opening;
2781
- this.root.current.removeAttribute("data-closing");
2782
- }
2783
- this.clearMotion();
2784
- };
2785
- this.toggle = (event) => {
2786
- const details = this.root.current;
2787
- if (!details) return;
2788
- event.preventDefault();
2789
- if (this.motion?.kind === "hosted") return;
2790
- const opening = this.motion ? !this.motion.opening : !details.open;
2791
- const body = details.lastElementChild;
2792
- if (!(body instanceof HTMLElement)) return;
2793
- const height = details.open ? body.getBoundingClientRect().height : 0;
2794
- this.clearMotion();
2795
- details.toggleAttribute("data-closing", !opening);
2796
- if (window.matchMedia("(prefers-reduced-motion: reduce)").matches || !details.animate) {
2797
- details.open = opening;
2798
- details.removeAttribute("data-closing");
2799
- return;
2800
- }
2801
- details.open = true;
2802
- details.setAttribute("data-resizing", "");
2803
- const target = opening ? body.scrollHeight : 0;
2804
- this.motion = {
2805
- kind: "hosted",
2806
- opening
2807
- };
2808
- if (announceClampedSurfaceResize({
2809
- element: body,
2810
- reason: "review-details",
2811
- fromCssPx: height,
2812
- toCssPx: target,
2813
- drivenClasses: ["seams-review-disclosure-driven"],
2814
- setHeightCssPx: this.setHeight,
2815
- onSettled: this.finish
2816
- })) return;
2817
- const size = body.animate([{
2818
- height: `${height}px`,
2819
- overflow: "hidden"
2820
- }, {
2821
- height: `${target}px`,
2822
- overflow: "hidden"
2823
- }], {
2824
- duration: opening ? 220 : 180,
2825
- easing: "cubic-bezier(.2,0,0,1)",
2826
- fill: "both"
2827
- });
2828
- this.motion = {
2829
- kind: "local",
2830
- opening,
2831
- size,
2832
- fade: body.animate(opening ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }], {
2833
- duration: opening ? 180 : 100,
2834
- easing: "ease-out",
2835
- fill: "both"
2836
- })
2837
- };
2838
- size.onfinish = this.finish;
2839
- };
2840
- }
2841
- componentDidMount() {
2842
- if (this.root.current) this.root.current.open = this.props.initiallyOpen ?? false;
2843
- }
2844
- componentWillUnmount() {
2845
- this.clearMotion();
2846
- if (this.root.current) confirmationDocumentStyles(this.root.current.ownerDocument).deleteDynamicRule(this.id);
2847
- }
2848
- clearMotion() {
2849
- if (!this.motion) return;
2850
- if (this.motion.kind === "local") {
2851
- this.motion.size.onfinish = null;
2852
- this.motion.size.cancel();
2853
- this.motion.fade.cancel();
2854
- }
2855
- this.motion = null;
2856
- this.root.current?.removeAttribute("data-resizing");
2857
- }
2858
- render() {
2859
- return /* @__PURE__ */ u("details", {
2860
- ref: this.root,
2861
- class: "seams-review-technical",
2862
- children: [/* @__PURE__ */ u("summary", {
2863
- onClick: this.toggle,
2864
- children: [this.props.label, /* @__PURE__ */ u("svg", {
2865
- class: "seams-review-caret",
2866
- viewBox: "0 0 20 20",
2867
- width: "16",
2868
- height: "16",
2869
- fill: "none",
2870
- stroke: "currentColor",
2871
- "stroke-width": "1.6",
2872
- "stroke-linecap": "round",
2873
- "stroke-linejoin": "round",
2874
- "aria-hidden": "true",
2875
- children: /* @__PURE__ */ u("path", { d: "m5 7.5 5 5 5-5" })
2876
- })]
2877
- }), /* @__PURE__ */ u("div", {
2878
- id: this.id,
2879
- children: this.props.children
2880
- })]
2881
- });
2882
- }
2883
- };
2884
- //#endregion
2885
- //#region src/core/signingEngine/uiConfirm/ui/seamsWordmarkPaths.ts
2886
- const SEAMS_STANDARD_WORDMARK_PATH = "M 1152.240 22.260 C 1142.208 32.303, 1134 41.030, 1134 41.653 C 1134 42.276, 1134.625 43.026, 1135.388 43.319 C 1137.220 44.022, 1149.487 58.808, 1154.965 66.916 C 1160.947 75.770, 1167.188 88.708, 1170.922 100 C 1179.875 127.067, 1179.861 153.906, 1170.878 184.346 C 1169.767 188.111, 1169.068 191.402, 1169.325 191.658 C 1169.581 191.915, 1173.776 190.129, 1178.646 187.690 C 1189.458 182.274, 1206.826 175.821, 1220.384 172.183 L 1230.500 169.469 1231.685 161.485 C 1233.180 151.413, 1233.316 131.031, 1231.963 119.974 C 1231.393 115.313, 1229.818 106.851, 1228.463 101.170 C 1227.108 95.488, 1226 90.723, 1226 90.580 C 1226 90.437, 1231.063 91.354, 1237.250 92.617 C 1288.849 103.153, 1340.642 93.721, 1389.671 64.860 C 1397.021 60.533, 1419.577 45.437, 1422.276 43.038 C 1422.979 42.413, 1384.105 4.943, 1381.956 4.174 C 1381.455 3.995, 1378.447 5.832, 1375.273 8.256 C 1352.212 25.865, 1329.230 37.090, 1305.831 42.174 C 1290.920 45.414, 1262.231 45.389, 1247 42.123 C 1221.862 36.733, 1202.051 27.300, 1180.320 10.372 C 1175.820 6.867, 1171.766 4, 1171.309 4 C 1170.853 4, 1162.272 12.217, 1152.240 22.260 M 276 48.064 C 245.671 51.807, 220.471 65.845, 203.537 88.432 C 196.121 98.323, 188.492 116.648, 186.051 130.434 C 184.471 139.355, 184.755 159.897, 186.580 168.731 C 192.404 196.928, 208.854 220.370, 232.901 234.742 C 262.591 252.485, 304.246 254.795, 337.980 240.568 C 350.834 235.146, 367.194 223.594, 373.765 215.297 L 376.932 211.299 361.834 197.711 L 346.737 184.124 339.619 190.143 C 320.291 206.485, 299.180 212.864, 278.754 208.536 C 258.217 204.184, 242.399 188.671, 237.623 168.197 L 236.177 162 311.543 162 L 386.909 162 387.587 158.388 C 387.960 156.402, 388.018 148.189, 387.716 140.138 C 387.277 128.449, 386.625 123.586, 384.479 116 C 379.212 97.381, 371.713 84.617, 359.119 72.834 C 341.964 56.786, 321.656 48.842, 294.709 47.639 C 288.544 47.364, 280.125 47.556, 276 48.064 M 1000.983 49.026 C 981.627 51.294, 962.676 59.399, 951.124 70.351 C 938.360 82.454, 932.081 100.926, 935.370 116.700 C 938.138 129.975, 945.329 140.076, 958.015 148.510 C 967.604 154.885, 980.155 159.892, 1004.029 166.867 C 1015.288 170.156, 1026.528 173.719, 1029.008 174.784 C 1048.926 183.343, 1047.372 201.937, 1026.053 210.140 C 1015.474 214.211, 997.351 212.791, 986.004 207.002 C 979.694 203.783, 970.400 196.188, 965.527 190.269 C 962.915 187.096, 960.339 184.500, 959.804 184.500 C 959.268 184.500, 951.497 190.575, 942.534 198 C 929.678 208.651, 926.415 211.838, 927.076 213.103 C 928.792 216.389, 942.709 229.745, 948.500 233.663 C 980.766 255.495, 1031.930 258.256, 1064.810 239.938 C 1093.327 224.051, 1103.456 188.645, 1086.875 162.806 C 1079.079 150.656, 1060.449 139.092, 1036.756 131.697 C 1030.565 129.765, 1019.425 126.293, 1012 123.982 C 996.026 119.010, 990.228 116.248, 986.523 111.845 C 984.091 108.955, 983.837 107.979, 984.242 103.095 C 984.660 98.058, 985.089 97.243, 989.362 93.375 C 995.842 87.508, 1002.195 85.510, 1014 85.627 C 1029.536 85.780, 1040.165 90.408, 1053 102.609 L 1059.500 108.788 1074.500 95.232 C 1082.750 87.776, 1089.635 81.130, 1089.799 80.462 C 1090.225 78.739, 1079.812 69.686, 1071.224 64.313 C 1057.482 55.715, 1042.661 51.008, 1023.144 49.043 C 1011.825 47.903, 1010.580 47.902, 1000.983 49.026 M 478.921 50.482 C 460.570 53.573, 444.266 60.019, 429.500 70.020 C 421.367 75.529, 412.785 82.902, 413.207 84.017 C 413.368 84.442, 419.475 90.933, 426.777 98.443 L 440.055 112.097 448.277 105.504 C 457.467 98.135, 466.747 93.115, 477.373 89.764 C 483.388 87.867, 486.684 87.524, 498.500 87.561 C 514.277 87.612, 519.926 89.109, 528.209 95.433 C 533.564 99.522, 538.796 108.852, 539.546 115.650 C 539.840 118.318, 540.248 121.894, 540.453 123.597 L 540.825 126.694 512.662 127.312 C 474.264 128.156, 456.457 131.057, 438.650 139.369 C 409.872 152.803, 397.368 179.013, 406.084 207.632 C 408.813 216.591, 412.119 222.196, 418.848 229.266 C 433.800 244.978, 457.890 252.692, 484.002 250.132 C 504.167 248.154, 520.632 240.972, 534.077 228.288 L 541 221.758 541 233.379 L 541 245 566.559 245 L 592.118 245 591.717 179.750 C 591.282 109.141, 591.338 109.914, 585.549 94.533 C 576.527 70.565, 555.039 55.122, 524.252 50.482 C 512.527 48.714, 489.412 48.714, 478.921 50.482 M 72.366 51.570 C 50.831 55.188, 30.787 66.983, 21.508 81.500 C 9.386 100.466, 11.445 124.131, 26.601 140.021 C 37.041 150.966, 47.790 156.186, 80 165.955 C 101.571 172.497, 108.741 175.471, 113.227 179.737 C 122.014 188.093, 117.373 201.967, 103.727 208.137 C 99.071 210.242, 97.079 210.495, 85.500 210.457 C 74.475 210.420, 71.648 210.076, 66.895 208.189 C 57.333 204.394, 48.391 197.450, 39.713 187.077 L 36.013 182.655 31.756 186.047 C 22.049 193.784, 3 210.296, 3 210.975 C 3 212.867, 19.844 229.407, 25.799 233.361 C 42.118 244.199, 63.087 249.992, 86 249.992 C 132.157 249.992, 165.601 226.871, 167.716 193.500 C 168.732 177.462, 164.163 165.154, 153.024 153.923 C 141.991 142.799, 129.353 136.682, 96.500 126.567 C 76.762 120.489, 67.150 116.278, 64.064 112.355 C 60.911 108.346, 60.514 103.886, 62.843 98.621 C 65.477 92.667, 71.720 88.644, 81.804 86.400 C 88.654 84.876, 90.160 84.859, 98.418 86.211 C 110.806 88.240, 117.685 91.723, 127.138 100.754 L 134.931 108.199 137.816 105.850 C 146.860 98.484, 165.983 80.444, 165.693 79.550 C 164.936 77.217, 150.022 65.736, 142.959 62.051 C 122.849 51.558, 96.089 47.585, 72.366 51.570 M 825.539 51.051 C 817.528 52.301, 809.553 54.686, 804.028 57.486 C 796.847 61.125, 787.304 68.749, 783.769 73.673 L 780.532 78.180 779.078 75.840 C 775.424 69.955, 764.796 60.805, 757.750 57.477 C 746.137 51.993, 739.434 50.698, 725.533 51.254 C 706.839 52.001, 694.387 57.102, 681.866 69.140 L 676 74.781 676 65.390 L 676 56 651.661 56 L 627.322 56 626.663 83.750 C 626.300 99.013, 626.003 141.537, 626.002 178.250 L 626 245 650 245 L 674 245 674 187.958 C 674 125.947, 674.350 121.163, 679.650 110.703 C 691.004 88.298, 724.199 85.661, 735.947 106.231 C 741.820 116.514, 742 118.855, 742 184.966 L 742 245.037 765.250 244.768 L 788.500 244.500 789.039 184 C 789.453 137.683, 789.889 122.562, 790.903 119.500 C 794.665 108.131, 800.351 100.945, 809.283 96.269 C 813.828 93.890, 815.659 93.536, 823.500 93.519 C 831.355 93.502, 833.225 93.856, 838.201 96.300 C 845.065 99.670, 850.240 106.160, 853.351 115.297 C 855.395 121.302, 855.473 123.474, 855.781 183.250 L 856.099 245 880.095 245 L 904.091 245 903.766 176.750 C 903.447 109.712, 903.401 108.359, 901.212 100.558 C 894.210 75.604, 876.712 57.823, 854 52.581 C 845.325 50.579, 832.863 49.909, 825.539 51.051 M 279 83.691 C 264.019 86.199, 249.825 96.478, 243.191 109.624 C 240.856 114.250, 237 124.874, 237 126.682 C 237 126.857, 259.500 127, 287 127 C 317.941 127, 337 126.638, 337 126.049 C 337 122.644, 334.294 113.593, 331.779 108.589 C 325.881 96.853, 314.699 87.980, 301.458 84.531 C 296.022 83.115, 284.921 82.700, 279 83.691 M 1373.984 93.932 C 1358.717 101.014, 1349.722 104.330, 1336.008 107.930 L 1325.515 110.685 1324.277 117.592 C 1323.596 121.392, 1323.013 131.475, 1322.982 140 C 1322.924 156.322, 1324.865 170.597, 1328.959 183.948 C 1330.047 187.495, 1330.837 190.497, 1330.714 190.619 C 1330.592 190.742, 1326.893 189.972, 1322.496 188.909 C 1304.642 184.594, 1295.980 183.607, 1276 183.612 C 1260.205 183.616, 1254.056 184.048, 1243.635 185.884 C 1213.691 191.158, 1186.385 202.666, 1158.538 221.745 C 1146.555 229.956, 1134 239.793, 1134 240.971 C 1134 241.645, 1155.018 264.209, 1166.941 276.336 L 1171.695 281.172 1182.932 272.727 C 1209.090 253.066, 1232.355 242.974, 1260.846 238.927 C 1271.516 237.412, 1297.903 238.291, 1308 240.498 C 1333.016 245.966, 1352.163 255.502, 1374.794 273.765 L 1384.088 281.266 1386.294 279.318 C 1387.507 278.246, 1396.721 269.819, 1406.769 260.591 L 1425.039 243.812 1418.769 236.895 C 1393.960 209.525, 1382.368 185.212, 1378.937 153.347 C 1377.153 136.771, 1379.694 114.031, 1385.375 95.750 C 1386.699 91.487, 1387.494 88.028, 1387.141 88.063 C 1386.789 88.098, 1380.868 90.739, 1373.984 93.932 M 487 161.998 C 465.755 164.841, 454 174.462, 454 189.008 C 454 210.801, 485.917 220.760, 513.612 207.607 C 529.505 200.060, 540 183.837, 540 166.818 L 540 161 516.250 161.131 C 503.188 161.203, 490.025 161.593, 487 161.998";
2887
- //#endregion
2888
- //#region src/core/signingEngine/uiConfirm/ui/preact/SeamsWordmark.tsx
2889
- /** @jsxImportSource preact */
2890
- function SeamsWordmark() {
2891
- return /* @__PURE__ */ u("svg", {
2892
- class: "seams-receipt-wordmark",
2893
- viewBox: "0 0 1428 285",
2894
- role: "img",
2895
- "aria-label": "seams",
2896
- children: /* @__PURE__ */ u("path", {
2897
- d: SEAMS_STANDARD_WORDMARK_PATH,
2898
- stroke: "none",
2899
- fill: "currentColor",
2900
- "fill-rule": "evenodd"
2901
- })
2902
- });
2903
- }
2904
- //#endregion
2905
- //#region src/core/signingEngine/uiConfirm/ui/preact/TransactionReview.tsx
2906
- /** @jsxImportSource preact */
2907
- function ReviewIcon({ kind }) {
2908
- const paths = {
2909
- back: "m15 6-6 6 6 6",
2910
- close: "M6 6l12 12M6 18L18 6",
2911
- minimize: "M5 12h14",
2912
- check: "m5 12 4 4L19 6",
2913
- arrow: "M7 17 17 7M7 7h10v10",
2914
- shield: "M12 3 4.5 6v5.5c0 4.2 2.7 7.4 7.5 9.5 4.8-2.1 7.5-5.3 7.5-9.5V6L12 3Z M8.5 11.5l2.5 2.5 4.5-5",
2915
- copy: "M8 8h12v12H8ZM4 16V4h12",
2916
- loader: "M12 3a9 9 0 1 1-9 9",
2917
- alert: "M12 8v5m0 3v.1M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0",
2918
- fingerprint: "M6.405 19.048c.184-.443.353-.894.507-1.351M14.343 20.693c.266-.751.502-1.516.707-2.294.186-.706.346-1.422.478-2.147M19.448 17.058c.364-1.964.555-3.989.555-6.058 0-4.418-3.582-8-8-8-1.255 0-2.443.289-3.501.805M3.523 15.025c.314-1.29.48-2.638.48-4.025 0-1.74.556-3.351 1.499-4.664M12.003 11c0 2.76-.447 5.416-1.273 7.899-.213.639-.451 1.266-.712 1.881M7.712 14.5c.191-1.138.291-2.308.291-3.5 0-2.209 1.791-4 4-4s4 1.791 4 4c0 .617-.02 1.229-.058 1.836"
2919
- };
2920
- return /* @__PURE__ */ u("svg", {
2921
- viewBox: "0 0 24 24",
2922
- fill: "none",
2923
- stroke: "currentColor",
2924
- "stroke-width": "1.6",
2925
- "stroke-linecap": "round",
2926
- "stroke-linejoin": "round",
2927
- "aria-hidden": "true",
2928
- children: /* @__PURE__ */ u("path", { d: paths[kind] })
2929
- });
2930
- }
2931
- function reviewNetwork(model) {
2932
- if (!model) return "Wallet transaction";
2933
- if (model.chain === "evm" && model.chainId === 8453) return "Base";
2934
- if (model.chain === "evm" && model.chainId === 84532) return "Base Sepolia";
2935
- if (model.chain === "evm" && model.chainId === 1) return "Ethereum";
2936
- if (model.chain === "evm" && model.chainId === 11155111) return "Ethereum Sepolia";
2937
- return `${model.chain.toUpperCase()}${model.chainId ? ` · ${model.chainId}` : ""}`;
2938
- }
2939
- function reviewRecipient(model) {
2940
- if (model?.operations.length !== 1) return null;
2941
- const operation = model.operations[0];
2942
- return operation.kind === "generic.contractCall" || operation.kind === "tempo.eip2718" ? operation.to ?? null : null;
2943
- }
2944
- /** The whole value when it fits; otherwise the middle truncates and the last eight characters stay. */
2945
- function ReviewMiddleTruncated({ value, class: className }) {
2946
- return /* @__PURE__ */ u("bdi", {
2947
- class: `seams-review-middle ${className}`,
2948
- dir: "ltr",
2949
- title: value,
2950
- children: [/* @__PURE__ */ u("span", { children: value.slice(0, -8) }), /* @__PURE__ */ u("span", { children: value.slice(-8) })]
2951
- });
2952
- }
2953
- function TokenIcon({ symbol }) {
2954
- if (symbol === "ETH") return /* @__PURE__ */ u("svg", {
2955
- class: "seams-review-token",
2956
- viewBox: "0 0 42 42",
2957
- "aria-hidden": "true",
2958
- children: [
2959
- /* @__PURE__ */ u("circle", {
2960
- cx: "21",
2961
- cy: "21",
2962
- r: "21",
2963
- fill: "#eef0fb"
2964
- }),
2965
- /* @__PURE__ */ u("path", {
2966
- d: "m21 6-9 15 9 5 9-5Z",
2967
- fill: "#627eea"
2968
- }),
2969
- /* @__PURE__ */ u("path", {
2970
- d: "m21 6 9 15-9 5Z",
2971
- fill: "#465da9"
2972
- }),
2973
- /* @__PURE__ */ u("path", {
2974
- d: "m12 23 9 13 9-13-9 5Z",
2975
- fill: "#627eea"
2976
- })
2977
- ]
2978
- });
2979
- if (symbol === "USDC") return /* @__PURE__ */ u("svg", {
2980
- class: "seams-review-token",
2981
- viewBox: "0 0 42 42",
2982
- "aria-hidden": "true",
2983
- children: [/* @__PURE__ */ u("circle", {
2984
- cx: "21",
2985
- cy: "21",
2986
- r: "21",
2987
- fill: "#2775ca"
2988
- }), /* @__PURE__ */ u("path", {
2989
- d: "M17 8a14 14 0 0 0 0 26M25 8a14 14 0 0 1 0 26M26 15c-1-4-10-4-10 1 0 5 10 3 10 8 0 5-9 5-11 1M21 10v4m0 14v4",
2990
- fill: "none",
2991
- stroke: "white",
2992
- "stroke-width": "2"
2993
- })]
2994
- });
2995
- return /* @__PURE__ */ u("span", {
2996
- class: "seams-review-token seams-review-token-fallback",
2997
- "aria-hidden": "true",
2998
- children: symbol.slice(0, 1)
2999
- });
3000
- }
3001
- function ReviewAmount({ model, compact = false }) {
3002
- const amount = reviewAmount(model);
3003
- if (!amount) return null;
3004
- return /* @__PURE__ */ u("div", {
3005
- class: `seams-review-amount${compact ? " seams-review-amount--compact" : ""}`,
3006
- children: [!compact && /* @__PURE__ */ u(TokenIcon, { symbol: amount.symbol }), /* @__PURE__ */ u("div", { children: [
3007
- /* @__PURE__ */ u("span", { children: amount.value }),
3008
- " ",
3009
- /* @__PURE__ */ u("small", { children: amount.symbol })
3010
- ] })]
3011
- });
3012
- }
3013
- function WalletReceiptFooter() {
3014
- return /* @__PURE__ */ u("div", {
3015
- class: "seams-receipt-footer",
3016
- children: [
3017
- /* @__PURE__ */ u(ReviewIcon, { kind: "shield" }),
3018
- " ",
3019
- /* @__PURE__ */ u("span", { children: "Secured by" }),
3020
- " ",
3021
- /* @__PURE__ */ u(SeamsWordmark, {})
3022
- ]
3023
- });
3024
- }
3025
- function decimalUnits(value, decimals) {
3026
- if (!/^\d+$/.test(value)) return value;
3027
- const padded = value.padStart(decimals + 1, "0");
3028
- const fraction = padded.slice(-decimals).replace(/0+$/, "");
3029
- return `${padded.slice(0, -decimals)}${fraction ? `.${fraction}` : ""}`;
3030
- }
3031
- function reviewAmount(model) {
3032
- const total = model?.totals;
3033
- if (!total?.nativeValue) return null;
3034
- if (total.nativeSymbol === "yoctoNEAR") return {
3035
- value: decimalUnits(total.nativeValue, 24),
3036
- symbol: "NEAR"
3037
- };
3038
- return {
3039
- value: total.nativeValue,
3040
- symbol: total.nativeSymbol ?? ""
3041
- };
3042
- }
3043
- var CopyReviewValue = class extends C {
3044
- constructor(..._args) {
3045
- super(..._args);
3046
- this.state = { copied: false };
3047
- this.lifetime = new AbortController();
3048
- this.timer = null;
3049
- this.resetCopied = () => {
3050
- this.setState({ copied: false });
3051
- };
3052
- this.copy = async (event) => {
3053
- const target = event.currentTarget;
3054
- if (!(target instanceof HTMLElement)) return;
3055
- const signal = this.lifetime.signal;
3056
- try {
3057
- if (!await copySurfaceText(target, this.props.value, signal) || signal.aborted) return;
3058
- this.setState({ copied: true });
3059
- if (this.timer !== null) clearTimeout(this.timer);
3060
- this.timer = setTimeout(this.resetCopied, 3e3);
3061
- } catch {
3062
- if (!signal.aborted) this.setState({ copied: false });
3063
- }
3064
- };
3065
- }
3066
- componentWillUnmount() {
3067
- this.lifetime.abort();
3068
- if (this.timer !== null) clearTimeout(this.timer);
3069
- }
3070
- componentDidUpdate(previous) {
3071
- if (previous.value === this.props.value) return;
3072
- this.lifetime.abort();
3073
- this.lifetime = new AbortController();
3074
- if (this.timer !== null) clearTimeout(this.timer);
3075
- this.resetCopied();
3076
- }
3077
- render() {
3078
- return /* @__PURE__ */ u("button", {
3079
- type: "button",
3080
- class: `seams-review-copy${this.props.address ? " seams-review-copy-address" : ""}${this.state.copied ? " copied" : ""}`,
3081
- onClick: this.copy,
3082
- "aria-label": this.state.copied ? "Copied" : this.props.label ?? "Copy value",
3083
- children: [this.props.address && /* @__PURE__ */ u("bdi", {
3084
- class: "seams-review-full-address",
3085
- dir: "ltr",
3086
- children: this.props.value
3087
- }), /* @__PURE__ */ u(CopyStatusIcon, {})]
3088
- });
3089
- }
3090
- };
3091
- function ReviewDetailLabel({ node }) {
3092
- if (node.action || node.transaction) return /* @__PURE__ */ u(S, { children: transactionLabelTitle(node) });
3093
- const contract = contractPrefix(node);
3094
- if (contract && node.contractAddress) {
3095
- const address = node.contractAddress;
3096
- return /* @__PURE__ */ u("span", {
3097
- class: "seams-review-contract",
3098
- children: [contract.trim(), /* @__PURE__ */ u("span", {
3099
- class: "seams-review-contract-value",
3100
- children: [/* @__PURE__ */ u(ReviewMiddleTruncated, {
3101
- value: address,
3102
- class: "seams-review-contract-address"
3103
- }), /* @__PURE__ */ u(CopyReviewValue, {
3104
- value: address,
3105
- label: `Copy contract address ${address}`
3106
- })]
3107
- })]
3108
- });
3109
- }
3110
- if (node.fieldLabel) {
3111
- const value = node.label.slice(node.fieldLabel.length);
3112
- return /* @__PURE__ */ u(S, { children: [node.fieldLabel, node.fieldLabel === "Method:" ? /* @__PURE__ */ u("span", {
3113
- class: "seams-review-function",
3114
- children: value
3115
- }) : value] });
3116
- }
3117
- const call = /^(Call(?:ing)? )([^\s]+)(.*)$/.exec(node.label);
3118
- if (call) return /* @__PURE__ */ u(S, { children: [
3119
- call[1],
3120
- /* @__PURE__ */ u("span", {
3121
- class: "seams-review-function",
3122
- children: call[2]
3123
- }),
3124
- call[3]
3125
- ] });
3126
- return /* @__PURE__ */ u(S, { children: node.label });
3127
- }
3128
- function ReviewDetail({ node }) {
3129
- const content = node.contentVariants?.decoded ?? node.content;
3130
- const block = Boolean(node.contentVariants || content?.includes("\n"));
3131
- return /* @__PURE__ */ u("div", {
3132
- class: "seams-review-detail",
3133
- children: [
3134
- /* @__PURE__ */ u("div", {
3135
- class: content ? `seams-review-detail-row${block ? " seams-review-detail-row--block" : ""}` : "seams-review-detail-label",
3136
- children: [
3137
- /* @__PURE__ */ u("span", { children: /* @__PURE__ */ u(ReviewDetailLabel, { node }) }),
3138
- content && /* @__PURE__ */ u("pre", { children: content }),
3139
- node.copyValue && /* @__PURE__ */ u(CopyReviewValue, { value: node.copyValue })
3140
- ]
3141
- }),
3142
- node.contentVariants && /* @__PURE__ */ u("details", {
3143
- class: "seams-review-raw",
3144
- children: [/* @__PURE__ */ u("summary", { children: "Raw data" }), /* @__PURE__ */ u("pre", { children: node.contentVariants.raw })]
3145
- }),
3146
- Boolean(node.children?.length) && /* @__PURE__ */ u("div", {
3147
- class: "seams-review-detail-children",
3148
- children: node.children?.map((child) => /* @__PURE__ */ u(ReviewDetail, { node: child }, child.id))
3149
- })
3150
- ]
3151
- });
3152
- }
3153
- function TransactionReview({ data, details = true }) {
3154
- const model = data.model;
3155
- const operation = model?.operations[0];
3156
- const recipient = reviewRecipient(model);
3157
- return /* @__PURE__ */ u("div", {
3158
- class: "seams-transaction-review",
3159
- children: [
3160
- /* @__PURE__ */ u(ReviewAmount, { model }),
3161
- model?.warnings?.map((warning) => /* @__PURE__ */ u("div", {
3162
- class: "seams-review-warning",
3163
- role: "alert",
3164
- children: warning.message
3165
- }, warning.code)),
3166
- /* @__PURE__ */ u("dl", {
3167
- class: "seams-review-fields",
3168
- children: [
3169
- recipient && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "To" }), /* @__PURE__ */ u("dd", {
3170
- class: "seams-review-recipient",
3171
- children: /* @__PURE__ */ u(CopyReviewValue, {
3172
- value: recipient,
3173
- address: true,
3174
- label: `Copy recipient address ${recipient}`
3175
- })
3176
- })] }),
3177
- model && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "Network" }), /* @__PURE__ */ u("dd", { children: [/* @__PURE__ */ u("span", { class: "seams-review-network-dot" }), reviewNetwork(model)] })] }),
3178
- model?.totals?.estimatedFee && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "Estimated network fee" }), /* @__PURE__ */ u("dd", { children: [
3179
- model.totals.estimatedFee,
3180
- " ",
3181
- model.totals.feeSymbol
3182
- ] })] })
3183
- ]
3184
- }),
3185
- details && data.tree && /* @__PURE__ */ u(ReviewDisclosure, {
3186
- initiallyOpen: data.detailsInitiallyOpen,
3187
- label: operation?.kind === "near.message" ? "Message details" : "Transaction details",
3188
- children: /* @__PURE__ */ u(ReviewDetail, { node: data.tree })
3189
- }),
3190
- model?.signerAccount && /* @__PURE__ */ u("div", {
3191
- class: "seams-review-account",
3192
- children: [/* @__PURE__ */ u("span", {
3193
- class: "seams-review-avatar",
3194
- "aria-hidden": "true",
3195
- children: "S"
3196
- }), /* @__PURE__ */ u("div", { children: ["Signing account", /* @__PURE__ */ u("small", { children: /* @__PURE__ */ u(CopyReviewValue, {
3197
- value: model.signerAccount,
3198
- address: true,
3199
- label: `Copy signing account address ${model.signerAccount}`
3200
- }) })] })]
3201
- })
3202
- ]
3203
- });
3204
- }
3205
- //#endregion
3206
- //#region src/core/signingEngine/uiConfirm/ui/preact/ConfirmationContent.tsx
3207
- /** @jsxImportSource preact */
3208
- let nextConfirmationId = 0;
3209
- var ConfirmationContent = class extends C {
3210
- constructor(..._args) {
3211
- super(..._args);
3212
- this.root = M();
3213
- this.otpFormId = `seams-confirmation-email-${++nextConfirmationId}`;
3214
- this.reflowId = `seams-confirmation-content-surface-${nextConfirmationId}`;
3215
- this.getReflowElement = () => {
3216
- return this.root.current?.closest(".modal-container-root, .seams-confirmation-drawer") ?? null;
3217
- };
3218
- this.setHeight = (height) => {
3219
- const element = this.getReflowElement();
3220
- if (!element?.id) return;
3221
- this.props.styles.setDynamicDeclarations(this.reflowId, `#${element.id}`, { [CONFIRM_SURFACE_HEIGHT_DRIVEN_VAR]: `${height}px` });
3222
- };
3223
- this.reflow = createSurfaceHeightReflow({
3224
- reason: "confirm-body",
3225
- element: this.getReflowElement,
3226
- setHeightCssPx: this.setHeight
3227
- });
3228
- this.copyAccount = (accountId) => {
3229
- const root = this.root.current;
3230
- if (root) copySurfaceText(root, accountId).catch(ignoreCopyFailure);
3231
- };
3232
- }
3233
- componentWillReceiveProps() {
3234
- this.reflow.capture();
3235
- }
3236
- componentDidUpdate(previous) {
3237
- if (previous.styles !== this.props.styles) previous.styles.deleteDynamicRule(this.reflowId);
3238
- this.reflow.commit();
3239
- }
3240
- componentWillUnmount() {
3241
- this.reflow.dispose();
3242
- this.props.styles.deleteDynamicRule(this.reflowId);
3243
- }
3244
- render() {
3245
- const model = this.props.model;
3246
- switch (model.kind) {
3247
- case "registration": return /* @__PURE__ */ u(PasskeyRegistrationContent, {
3248
- ...model.registration,
3249
- root: this.root,
3250
- styles: this.props.styles
3251
- });
3252
- case "transaction": return this.renderTransaction(model);
3253
- default: return assertNever$2(model);
3254
- }
3255
- }
3256
- renderTransaction(model) {
3257
- const contentClass = this.props.variant === "drawer" ? "seams-confirmation-content seams-confirmation-content--drawer" : "seams-confirmation-content";
3258
- const decision = model.prompt.kind === "email" && model.transaction.decision.kind === "ready" ? {
3259
- kind: "form",
3260
- formId: this.otpFormId
3261
- } : model.transaction.decision;
3262
- return /* @__PURE__ */ u("div", {
3263
- ref: this.root,
3264
- class: contentClass,
3265
- children: /* @__PURE__ */ u("div", {
3266
- class: "seams-review-content",
3267
- children: [
3268
- this.props.variant !== "drawer" && /* @__PURE__ */ u("div", {
3269
- class: "seams-review-toolbar",
3270
- children: [/* @__PURE__ */ u("div", {
3271
- class: "seams-review-origin",
3272
- children: [
3273
- model.transaction.onBack && /* @__PURE__ */ u("button", {
3274
- type: "button",
3275
- "aria-label": "Back to review",
3276
- title: "Back to review",
3277
- disabled: decision.kind === "preparing",
3278
- onClick: model.transaction.onBack,
3279
- children: /* @__PURE__ */ u(ReviewIcon, { kind: "back" })
3280
- }),
3281
- /* @__PURE__ */ u(PadlockIcon, {}),
3282
- model.header.website.kind === "ready" ? model.header.website.text : /* @__PURE__ */ u(LoadingStatus, { label: "Loading website" })
3283
- ]
3284
- }), /* @__PURE__ */ u("button", {
3285
- type: "button",
3286
- "aria-label": model.transaction.cancelText,
3287
- onClick: model.transaction.onCancel,
3288
- children: /* @__PURE__ */ u(ReviewIcon, { kind: "close" })
3289
- })]
3290
- }),
3291
- model.review.model && /* @__PURE__ */ u("div", {
3292
- class: "seams-review-eyebrow",
3293
- children: model.review.model.operations.length === 1 ? model.review.model.operations[0].label.replace(/\s+using\s+[\d,.]+\s+gas$/i, "") : "Transaction"
3294
- }),
3295
- /* @__PURE__ */ u("h2", {
3296
- class: "seams-review-title",
3297
- children: model.header.heading
3298
- }),
3299
- /* @__PURE__ */ u(TransactionReview, { data: model.review }),
3300
- /* @__PURE__ */ u("div", {
3301
- class: "seams-review-context",
3302
- children: [/* @__PURE__ */ u(ConfirmationBody, {
3303
- model: model.body,
3304
- onCopyAccount: this.copyAccount
3305
- }), model.prompt.kind === "email" && /* @__PURE__ */ u(EmailOtpContent, {
3306
- ...model.prompt.email,
3307
- formId: this.otpFormId
3308
- })]
3309
- }),
3310
- /* @__PURE__ */ u(ConfirmContent, {
3311
- ...model.transaction,
3312
- tree: null,
3313
- styles: this.props.styles,
3314
- decision,
3315
- cancelInHeader: true,
3316
- confirmIcon: model.prompt.kind === "passkey" ? /* @__PURE__ */ u(ReviewIcon, { kind: "fingerprint" }) : void 0
3317
- }),
3318
- /* @__PURE__ */ u(WalletReceiptFooter, {})
3319
- ]
3320
- })
3321
- });
3322
- }
3323
- };
3324
- function ignoreCopyFailure() {}
3325
- function assertNever$2(value) {
3326
- throw new Error(`Unexpected confirmation content: ${String(value)}`);
3327
- }
3328
- //#endregion
3329
- //#region src/core/signingEngine/uiConfirm/ui/transaction-receipt.ts
3330
- function receiptIsPending(state) {
3331
- return state.kind === "signing" || state.kind === "broadcasting" || state.kind === "submitted";
3332
- }
3333
- function receiptCompletedStages(state) {
3334
- switch (state.kind) {
3335
- case "signing": return 0;
3336
- case "signed":
3337
- case "broadcasting": return 1;
3338
- case "submitted":
3339
- case "reverted": return 2;
3340
- case "confirmed": return 3;
3341
- case "failed":
3342
- case "unknown": return state.hash ? 2 : 0;
3343
- default: return assertNever$1(state);
3344
- }
3345
- }
3346
- function receiptHeading(state) {
3347
- switch (state.kind) {
3348
- case "signing": return "Signing transaction";
3349
- case "signed": return "Signature ready";
3350
- case "broadcasting": return "Broadcasting transaction";
3351
- case "submitted": return "Waiting for confirmation";
3352
- case "confirmed": return "Transaction complete";
3353
- case "failed": return "Transaction failed";
3354
- case "reverted": return "Transaction reverted";
3355
- case "unknown": return "Confirmation unavailable";
3356
- default: return assertNever$1(state);
3357
- }
3358
- }
3359
- function receiptDescription(state) {
3360
- switch (state.kind) {
3361
- case "signing": return "Preparing your signed transaction.";
3362
- case "signed": return "Signature created, ready to broadcast.";
3363
- case "broadcasting": return "Submitting your signed transaction to the network.";
3364
- case "submitted": return "Submitted to the network. Waiting for the receipt.";
3365
- case "confirmed": return "The network confirmed your transaction.";
3366
- case "failed":
3367
- case "reverted":
3368
- case "unknown": return state.message;
3369
- default: return assertNever$1(state);
3370
- }
3371
- }
3372
- function assertNever$1(value) {
3373
- throw new Error(`Unexpected transaction receipt state: ${String(value)}`);
3374
- }
3375
- //#endregion
3376
- //#region src/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.tsx
3377
- /** @jsxImportSource preact */
3378
- const EXPLORER_REVEAL_MS = 240;
3379
- const EXPLORER_REVEAL_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
3380
- let nextExplorerRowId = 0;
3381
- var TransactionReceipt = class extends C {
3382
- constructor(..._args) {
3383
- super(..._args);
3384
- this.explorerRow = M();
3385
- this.explorerRowId = `seams-receipt-explorer-row-${++nextExplorerRowId}`;
3386
- this.minimize = () => {
3387
- this.props.receipt.onView("toast");
3388
- };
3389
- this.expand = () => {
3390
- this.props.receipt.onView("expanded");
3391
- };
3392
- this.close = () => {
3393
- if (receiptIsPending(this.props.receipt.state)) this.minimize();
3394
- else this.props.receipt.onDismiss();
3395
- };
3396
- this.setExplorerRowHeight = (height) => {
3397
- const row = this.explorerRow.current;
3398
- if (!row) return;
3399
- confirmationDocumentStyles(row.ownerDocument).setDynamicDeclarations(this.explorerRowId, `#${this.explorerRowId}`, { "--seams-receipt-explorer-height": `${height}px` });
3400
- };
3401
- this.releaseExplorerRow = () => {
3402
- const row = this.explorerRow.current;
3403
- if (!row) return;
3404
- delete row.dataset.opening;
3405
- confirmationDocumentStyles(row.ownerDocument).deleteDynamicRule(this.explorerRowId);
3406
- };
3407
- }
3408
- componentDidUpdate(previous) {
3409
- const { receipt } = this.props;
3410
- if (receipt.view === "expanded" && previous.receipt.view === "expanded" && receipt.state.kind === "confirmed" && previous.receipt.state.kind !== "confirmed") this.revealExplorerLink();
3411
- }
3412
- componentWillUnmount() {
3413
- this.releaseExplorerRow();
3414
- }
3415
- revealExplorerLink() {
3416
- const row = this.explorerRow.current;
3417
- const link = row?.firstElementChild;
3418
- if (!row || !link) return;
3419
- if (row.ownerDocument.defaultView?.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
3420
- const height = row.getBoundingClientRect().height;
3421
- row.dataset.opening = "";
3422
- const showLink = () => {
3423
- this.releaseExplorerRow();
3424
- link.animate([{
3425
- opacity: 0,
3426
- filter: "blur(4px)",
3427
- transform: "translateY(6px)"
3428
- }, {
3429
- opacity: 1,
3430
- filter: "blur(0)",
3431
- transform: "translateY(0)"
3432
- }], {
3433
- duration: EXPLORER_REVEAL_MS,
3434
- easing: EXPLORER_REVEAL_EASING
3435
- });
3436
- };
3437
- if (!announceClampedSurfaceResize({
3438
- reason: "receipt-explorer",
3439
- element: row,
3440
- fromCssPx: 0,
3441
- toCssPx: height,
3442
- drivenClasses: ["seams-receipt-explorer-driven"],
3443
- setHeightCssPx: this.setExplorerRowHeight,
3444
- onSettled: showLink
3445
- })) {
3446
- const opening = row.animate([{ height: "0px" }, { height: `${height}px` }], {
3447
- duration: EXPLORER_REVEAL_MS,
3448
- easing: EXPLORER_REVEAL_EASING
3449
- });
3450
- opening.onfinish = showLink;
3451
- opening.oncancel = this.releaseExplorerRow;
3452
- }
3453
- }
3454
- render() {
3455
- const { receipt, data } = this.props;
3456
- const heading = receiptHeading(receipt.state);
3457
- const complete = receipt.state.kind === "confirmed" || receipt.state.kind === "signed";
3458
- const pending = receiptIsPending(receipt.state);
3459
- const completedStages = receiptCompletedStages(receipt.state);
3460
- const recipient = reviewRecipient(data.model);
3461
- const explorerHref = receipt.state.kind === "confirmed" && receipt.state.hash ? transactionExplorerHref(data.model, this.props.explorers, receipt.state.hash) : null;
3462
- if (receipt.view === "toast") return /* @__PURE__ */ u("div", {
3463
- class: "seams-transaction-toast",
3464
- "data-completed-stages": completedStages,
3465
- "data-stage": receipt.state.kind,
3466
- "data-pending": pending,
3467
- children: [
3468
- /* @__PURE__ */ u("div", {
3469
- class: "seams-toast-progress",
3470
- "aria-hidden": "true",
3471
- children: /* @__PURE__ */ u("span", {
3472
- class: "seams-toast-progress-fill",
3473
- children: pending && /* @__PURE__ */ u("span", { class: "seams-toast-progress-active" })
3474
- })
3475
- }),
3476
- /* @__PURE__ */ u("span", {
3477
- class: "seams-receipt-symbol",
3478
- "data-pending": pending,
3479
- children: /* @__PURE__ */ u(ReviewIcon, { kind: pending ? "loader" : complete ? "check" : "alert" })
3480
- }),
3481
- /* @__PURE__ */ u("div", {
3482
- class: "seams-transaction-toast-text",
3483
- children: [/* @__PURE__ */ u("strong", {
3484
- role: "status",
3485
- children: heading
3486
- }), /* @__PURE__ */ u("span", { children: reviewNetwork(data.model) })]
3487
- }),
3488
- /* @__PURE__ */ u("button", {
3489
- type: "button",
3490
- class: "seams-receipt-open",
3491
- onClick: this.expand,
3492
- children: ["Open ", /* @__PURE__ */ u(ReviewIcon, { kind: "arrow" })]
3493
- })
3494
- ]
3495
- });
3496
- return /* @__PURE__ */ u("div", {
3497
- class: "seams-transaction-receipt",
3498
- children: [
3499
- /* @__PURE__ */ u("div", {
3500
- class: "seams-review-toolbar",
3501
- children: [/* @__PURE__ */ u("span", { children: "Transaction receipt" }), /* @__PURE__ */ u("button", {
3502
- type: "button",
3503
- "aria-label": "Minimize transaction",
3504
- onClick: this.minimize,
3505
- children: /* @__PURE__ */ u(ReviewIcon, { kind: "minimize" })
3506
- })]
3507
- }),
3508
- /* @__PURE__ */ u("div", {
3509
- class: "seams-receipt-heading",
3510
- children: [/* @__PURE__ */ u("span", {
3511
- class: "seams-receipt-symbol",
3512
- "data-pending": pending,
3513
- children: /* @__PURE__ */ u(ReviewIcon, { kind: pending ? "loader" : complete ? "check" : "alert" })
3514
- }), /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("h2", {
3515
- role: "status",
3516
- children: heading
3517
- }), /* @__PURE__ */ u("p", { children: receiptDescription(receipt.state) })] })]
3518
- }),
3519
- /* @__PURE__ */ u(ReviewAmount, {
3520
- model: data.model,
3521
- compact: true
3522
- }),
3523
- /* @__PURE__ */ u("div", {
3524
- class: "seams-receipt-destination",
3525
- children: [recipient && /* @__PURE__ */ u(S, { children: ["To ", /* @__PURE__ */ u(CopyReviewValue, {
3526
- value: recipient,
3527
- address: true,
3528
- label: `Copy recipient address ${recipient}`
3529
- })] }), !recipient && reviewNetwork(data.model)]
3530
- }),
3531
- data.model?.totals?.estimatedFee && /* @__PURE__ */ u("dl", {
3532
- class: "seams-review-fields",
3533
- children: /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "Estimated network fee" }), /* @__PURE__ */ u("dd", { children: [
3534
- data.model.totals.estimatedFee,
3535
- " ",
3536
- data.model.totals.feeSymbol
3537
- ] })] })
3538
- }),
3539
- /* @__PURE__ */ u("div", {
3540
- class: "seams-receipt-steps",
3541
- "aria-label": "Transaction progress",
3542
- children: [
3543
- /* @__PURE__ */ u(ReceiptStep, {
3544
- stage: "signing",
3545
- label: "Signed",
3546
- activeLabel: "Signing",
3547
- complete: completedStages >= 1,
3548
- active: receipt.state.kind === "signing"
3549
- }),
3550
- /* @__PURE__ */ u(ReceiptStep, {
3551
- stage: "broadcast",
3552
- label: "Broadcast",
3553
- activeLabel: "Broadcasting",
3554
- complete: completedStages >= 2,
3555
- active: receipt.state.kind === "broadcasting"
3556
- }),
3557
- /* @__PURE__ */ u(ReceiptStep, {
3558
- stage: "confirming",
3559
- label: receipt.state.kind === "reverted" ? "Reverted" : "Confirmed",
3560
- activeLabel: "Confirming",
3561
- complete: completedStages === 3,
3562
- active: receipt.state.kind === "submitted"
3563
- })
3564
- ]
3565
- }),
3566
- /* @__PURE__ */ u(ReviewDisclosure, {
3567
- label: "Receipt details",
3568
- children: /* @__PURE__ */ u("dl", {
3569
- class: "seams-review-fields",
3570
- children: [
3571
- data.model?.signerAccount && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "From" }), /* @__PURE__ */ u("dd", {
3572
- class: "seams-review-recipient",
3573
- children: /* @__PURE__ */ u(CopyReviewValue, {
3574
- value: data.model.signerAccount,
3575
- address: true,
3576
- label: `Copy signer address ${data.model.signerAccount}`
3577
- })
3578
- })] }),
3579
- recipient && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "To" }), /* @__PURE__ */ u("dd", {
3580
- class: "seams-review-recipient",
3581
- children: /* @__PURE__ */ u(CopyReviewValue, {
3582
- value: recipient,
3583
- address: true,
3584
- label: `Copy recipient address ${recipient}`
3585
- })
3586
- })] }),
3587
- receipt.state.hash && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "Transaction" }), /* @__PURE__ */ u("dd", { children: [/* @__PURE__ */ u(ReviewMiddleTruncated, {
3588
- value: receipt.state.hash,
3589
- class: "seams-review-hash"
3590
- }), /* @__PURE__ */ u(CopyReviewValue, { value: receipt.state.hash })] })] }),
3591
- /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("dt", { children: "Status" }), /* @__PURE__ */ u("dd", { children: heading })] })
3592
- ]
3593
- })
3594
- }),
3595
- /* @__PURE__ */ u("button", {
3596
- type: "button",
3597
- class: "seams-receipt-primary",
3598
- onClick: this.close,
3599
- children: receiptIsPending(receipt.state) ? "Continue in background" : "Done"
3600
- }),
3601
- explorerHref && /* @__PURE__ */ u("div", {
3602
- id: this.explorerRowId,
3603
- class: "seams-receipt-explorer-row",
3604
- ref: this.explorerRow,
3605
- children: /* @__PURE__ */ u("a", {
3606
- class: "seams-receipt-explorer",
3607
- href: explorerHref,
3608
- target: "_blank",
3609
- rel: "noopener noreferrer",
3610
- children: ["View transaction ", /* @__PURE__ */ u(ReviewIcon, { kind: "arrow" })]
3611
- })
3612
- }),
3613
- /* @__PURE__ */ u(WalletReceiptFooter, {})
3614
- ]
3615
- });
3616
- }
3617
- };
3618
- function transactionExplorerHref(model, explorers, hash) {
3619
- if (!model) return null;
3620
- let base;
3621
- switch (model.chain) {
3622
- case "near":
3623
- base = explorers.near;
3624
- break;
3625
- case "evm":
3626
- base = explorers.evm;
3627
- break;
3628
- case "tempo":
3629
- base = explorers.tempo;
3630
- break;
3631
- case "unknown": return null;
3632
- default: return assertNeverDisplayChain(model.chain);
3633
- }
3634
- if (!base) return null;
3635
- const path = model.chain === "near" ? "txns" : "tx";
3636
- return `${base.trim().replace(/\/$/, "")}/${path}/${encodeURIComponent(hash)}`;
3637
- }
3638
- function assertNeverDisplayChain(chain) {
3639
- throw new Error(`Unexpected display chain: ${String(chain)}`);
3640
- }
3641
- function ReceiptStep(props) {
3642
- const state = props.complete ? "complete" : props.active ? "active" : "waiting";
3643
- return /* @__PURE__ */ u("span", {
3644
- class: "seams-receipt-step",
3645
- "data-stage": props.stage,
3646
- "data-state": state,
3647
- "aria-current": props.active ? "step" : void 0,
3648
- children: [/* @__PURE__ */ u("span", {
3649
- class: "seams-receipt-track",
3650
- "aria-hidden": "true"
3651
- }), props.active ? props.activeLabel : props.label]
3652
- });
3653
- }
3654
- //#endregion
3655
- //#region src/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.tsx
3656
- /** @jsxImportSource preact */
3657
- const RECEIPT_MORPH_DURATION_MS = 360;
3658
- const RECEIPT_MORPH_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
3659
- const RECEIPT_ANCHORS = [
3660
- ".seams-receipt-symbol",
3661
- "[role=\"status\"]",
3662
- ".seams-review-amount"
3663
- ];
3664
- function captureReceiptAnchors(surface) {
3665
- const anchors = [];
3666
- for (const selector of RECEIPT_ANCHORS) {
3667
- const element = surface.querySelector(selector);
3668
- if (!element) continue;
3669
- anchors.push({
3670
- selector,
3671
- text: element.textContent,
3672
- bounds: element.getBoundingClientRect(),
3673
- fontSize: getComputedStyle(element).fontSize
3674
- });
3675
- }
3676
- return anchors;
3677
- }
3678
- let nextSurfaceId = 0;
3679
- var MountedConfirmationSurface = class {
3680
- constructor(input) {
3681
- this.receipt = null;
3682
- this.receiptMotion = [];
3683
- this.receiptShell = null;
3684
- this.clearReceiptMotion = () => {
3685
- for (const animation of this.receiptMotion) animation.cancel();
3686
- this.receiptMotion = [];
3687
- this.receiptShell?.remove();
3688
- this.receiptShell = null;
3689
- this.element.removeAttribute("data-receipt-morphing");
3690
- };
3691
- this.dispose = () => {
3692
- if (this.state.kind === "disposed") return;
3693
- const onClosed = this.state.onClosed;
3694
- this.remove();
3695
- onClosed();
3696
- };
3697
- this.cancel = () => {
3698
- if (this.state.kind !== "mounted") return;
3699
- if (this.receipt) {
3700
- if (receiptIsPending(this.receipt.state)) this.receipt.onView("toast");
3701
- else this.receipt.onDismiss();
3702
- return;
3703
- }
3704
- const content = this.state.model.content;
3705
- if (content.kind === "registration") content.registration.onCancel();
3706
- else content.transaction.onCancel();
3707
- };
3708
- this.confirm = () => {
3709
- if (this.state.kind !== "mounted") return;
3710
- const content = this.state.model.content;
3711
- const decision = content.kind === "registration" ? content.registration.decision : content.transaction.decision;
3712
- if (decision.kind === "ready") decision.onConfirm();
3713
- };
3714
- this.submitOtp = (code, challengeId) => {
3715
- if (this.state.kind !== "mounted") return;
3716
- const content = this.state.model.content;
3717
- if (content.kind === "transaction" && content.prompt.kind === "email") content.prompt.email.onSubmit(code, challengeId);
3718
- };
3719
- const document = input.parent.ownerDocument;
3720
- this.styles = confirmationDocumentStyles(document);
3721
- this.presentation = {
3722
- variant: input.presentation.variant,
3723
- context: input.presentation.context
3724
- };
3725
- this.state = {
3726
- kind: "mounted",
3727
- model: input.model,
3728
- onClosed: input.onClosed
3729
- };
3730
- this.element = document.createElement("div");
3731
- this.element.id = `seams-confirmation-surface-${++nextSurfaceId}`;
3732
- this.element.className = "seams-wallet-ui seams-confirmation-surface";
3733
- this.element.dataset.seamsConfirmSurface = input.presentation.context;
3734
- this.element.dataset.seamsConfirmVariant = input.presentation.variant;
3735
- this.element.addEventListener("cancel", this.cancel);
3736
- input.parent.appendChild(this.element);
3737
- try {
3738
- this.update(input.model);
3739
- } catch (error) {
3740
- this.remove();
3741
- throw error;
3742
- }
3743
- }
3744
- update(model) {
3745
- if (this.state.kind !== "mounted") return;
3746
- this.state.model = model;
3747
- this.element.dataset.confirmationKind = model.content.kind;
3748
- this.element.dataset.seamsConfirmReady = String(model.content.kind === "transaction" && model.content.transaction.decision.kind === "ready");
3749
- this.element.dataset.theme = model.appearance.theme.mode;
3750
- this.styles.setDynamicRule(this.element.id, appearanceTokenCssRule(this.element.id, model.appearance));
3751
- this.renderSurface();
3752
- }
3753
- close() {
3754
- if (this.state.kind !== "mounted") return;
3755
- this.state = {
3756
- kind: "closing",
3757
- model: this.state.model,
3758
- onClosed: this.state.onClosed
3759
- };
3760
- if (this.presentation.variant === "modal") this.dispose();
3761
- else this.renderSurface();
3762
- }
3763
- showReceipt(model) {
3764
- if (this.state.kind !== "mounted" || this.state.model.content.kind !== "transaction") return;
3765
- const viewChanged = this.receipt?.view !== model.view;
3766
- const previousShell = this.receiptShell ?? this.element.querySelector(".modal-container-root");
3767
- const previousBounds = previousShell?.getBoundingClientRect();
3768
- const anchors = viewChanged ? captureReceiptAnchors(this.element) : [];
3769
- const previousRadius = previousShell ? getComputedStyle(previousShell).borderRadius : "26px";
3770
- if (viewChanged) this.clearReceiptMotion();
3771
- this.receipt = model;
3772
- this.element.dataset.receiptView = model.view;
3773
- this.element.dataset.seamsConfirmSurface = "wallet-iframe";
3774
- this.element.dataset.seamsConfirmVariant = "modal";
3775
- this.renderSurface();
3776
- const target = this.element.querySelector(".modal-container-root");
3777
- if (viewChanged && previousBounds && target && !window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
3778
- const bounds = target.getBoundingClientRect();
3779
- const shell = this.element.ownerDocument.createElement("div");
3780
- shell.className = "seams-receipt-morph-shell";
3781
- shell.setAttribute("aria-hidden", "true");
3782
- this.element.appendChild(shell);
3783
- this.receiptShell = shell;
3784
- this.element.setAttribute("data-receipt-morphing", "");
3785
- const morph = shell.animate([{
3786
- left: `${previousBounds.left}px`,
3787
- top: `${previousBounds.top}px`,
3788
- width: `${previousBounds.width}px`,
3789
- height: `${previousBounds.height}px`,
3790
- borderRadius: previousRadius
3791
- }, {
3792
- left: `${bounds.left}px`,
3793
- top: `${bounds.top}px`,
3794
- width: `${bounds.width}px`,
3795
- height: `${bounds.height}px`,
3796
- borderRadius: getComputedStyle(target).borderRadius
3797
- }], {
3798
- duration: RECEIPT_MORPH_DURATION_MS,
3799
- easing: RECEIPT_MORPH_EASING,
3800
- fill: "both"
3801
- });
3802
- this.receiptMotion = [morph];
3803
- const shared = /* @__PURE__ */ new Set();
3804
- for (const anchor of anchors) {
3805
- const element = target.querySelector(anchor.selector);
3806
- if (!element || element.textContent !== anchor.text) continue;
3807
- const destination = element.getBoundingClientRect();
3808
- shared.add(element);
3809
- const scale = parseFloat(anchor.fontSize) / parseFloat(getComputedStyle(element).fontSize);
3810
- this.receiptMotion.push(element.animate([{
3811
- transform: `translate(${anchor.bounds.left - destination.left}px, ${anchor.bounds.top - destination.top}px) scale(${scale})`,
3812
- transformOrigin: "top left"
3813
- }, {
3814
- transform: "translate(0, 0) scale(1)",
3815
- transformOrigin: "top left"
3816
- }], {
3817
- duration: RECEIPT_MORPH_DURATION_MS,
3818
- easing: RECEIPT_MORPH_EASING
3819
- }));
3820
- }
3821
- const details = target.querySelectorAll(".seams-transaction-receipt > :not(.seams-receipt-heading), .seams-receipt-heading > .seams-receipt-symbol, .seams-receipt-heading h2, .seams-receipt-heading p, .seams-transaction-toast > :not(.seams-transaction-toast-text, .seams-toast-progress), .seams-transaction-toast-text > *");
3822
- let order = 0;
3823
- for (const detail of details) {
3824
- if (shared.has(detail)) continue;
3825
- this.receiptMotion.push(detail.animate([{
3826
- opacity: 0,
3827
- transform: "translateY(8px)"
3828
- }, {
3829
- opacity: 1,
3830
- transform: "translateY(0)"
3831
- }], {
3832
- duration: 120,
3833
- delay: model.view === "toast" ? 240 : 180 + Math.min(order, 4) * 15,
3834
- fill: "backwards",
3835
- easing: "ease-out"
3836
- }));
3837
- order += 1;
3838
- }
3839
- morph.onfinish = this.clearReceiptMotion;
3840
- }
3841
- }
3842
- remove() {
3843
- this.clearReceiptMotion();
3844
- this.state = { kind: "disposed" };
3845
- this.element.removeEventListener("cancel", this.cancel);
3846
- R(null, this.element);
3847
- this.styles.deleteDynamicRule(this.element.id);
3848
- this.element.remove();
3849
- }
3850
- renderSurface() {
3851
- const state = this.state;
3852
- if (state.kind === "disposed") return;
3853
- const source = state.model.content;
3854
- const model = this.contentModel(source, state.kind === "closing");
3855
- const content = this.receipt && source.kind === "transaction" ? /* @__PURE__ */ u(TransactionReceipt, {
3856
- receipt: this.receipt,
3857
- data: source.review,
3858
- explorers: source.transaction.explorers
3859
- }) : /* @__PURE__ */ u(ConfirmationContent, {
3860
- model,
3861
- styles: this.styles,
3862
- variant: this.presentation.variant
3863
- });
3864
- const label = source.kind === "registration" ? source.registration.heading : source.header.heading;
3865
- if (this.receipt || this.presentation.variant === "modal") {
3866
- R(/* @__PURE__ */ u(ConfirmationModal, {
3867
- context: this.receipt ? "wallet-iframe" : this.presentation.context,
3868
- label,
3869
- onCancel: this.cancel,
3870
- children: content
3871
- }), this.element);
3872
- return;
3873
- }
3874
- const decision = source.kind === "registration" ? source.registration.decision : source.transaction.decision;
3875
- R(/* @__PURE__ */ u(ConfirmationDrawer, {
3876
- context: this.presentation.context,
3877
- label,
3878
- origin: source.kind === "transaction" && source.header.website.kind === "ready" ? /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ u(PadlockIcon, {}), source.header.website.text] }) : void 0,
3879
- errorMessage: source.kind === "registration" ? source.registration.errorMessage : source.transaction.errorMessage,
3880
- styles: this.styles,
3881
- state: state.kind === "closing" ? {
3882
- kind: "closing",
3883
- onClosed: this.dispose
3884
- } : {
3885
- kind: "open",
3886
- interaction: decision.kind === "ready" ? "ready" : "busy"
3887
- },
3888
- onCancel: this.cancel,
3889
- children: content
3890
- }), this.element);
3891
- }
3892
- contentModel(source, closing) {
3893
- switch (source.kind) {
3894
- case "registration": return {
3895
- kind: "registration",
3896
- registration: {
3897
- ...source.registration,
3898
- decision: !closing && source.registration.decision.kind === "ready" ? {
3899
- kind: "ready",
3900
- onConfirm: this.confirm
3901
- } : { kind: "creating" },
3902
- onCancel: this.cancel
3903
- }
3904
- };
3905
- case "transaction": return {
3906
- kind: "transaction",
3907
- header: source.header,
3908
- body: source.body,
3909
- review: source.review,
3910
- prompt: source.prompt.kind === "email" ? {
3911
- kind: "email",
3912
- email: {
3913
- prompt: source.prompt.email.prompt,
3914
- verification: closing ? { kind: "pending" } : source.prompt.email.verification,
3915
- onSubmit: this.submitOtp
3916
- }
3917
- } : source.prompt,
3918
- transaction: {
3919
- ...source.transaction,
3920
- decision: !closing && source.transaction.decision.kind === "ready" ? {
3921
- kind: "ready",
3922
- onConfirm: this.confirm
3923
- } : { kind: "preparing" },
3924
- onCancel: this.cancel
3925
- }
3926
- };
3927
- default: return assertNever(source);
3928
- }
3929
- }
3930
- };
3931
- function assertNever(value) {
3932
- throw new Error(`Unexpected confirmation content: ${String(value)}`);
3933
- }
3934
- function mountConfirmationSurface(input) {
3935
- return new MountedConfirmationSurface(input);
3936
- }
3937
- //#endregion
3938
- //#region src/core/signingEngine/uiConfirm/ui/preact/confirmation-controller.ts
3939
- var MountedConfirmationController = class {
3940
- constructor(input) {
3941
- this.callbacks = input.callbacks;
3942
- this.appearance = input.appearance;
3943
- this.presentation = input.presentation;
3944
- this.tree = input.tree;
3945
- this.currentModel = this.normalize();
3946
- this.surface = mountConfirmationSurface({
3947
- parent: input.parent,
3948
- presentation: {
3949
- variant: input.variant,
3950
- context: input.context
3951
- },
3952
- model: this.currentModel,
3953
- onClosed: input.onClosed
3954
- });
3955
- this.element = this.surface.element;
3956
- }
3957
- update(update) {
3958
- this.presentation = mergeConfirmationPresentation(this.presentation, update);
3959
- if (update.appearance) this.appearance = update.appearance;
3960
- if (Object.hasOwn(update, "model")) this.tree = buildConfirmationTree({ model: update.model });
3961
- this.currentModel = this.normalize();
3962
- this.surface.update(this.currentModel);
3963
- }
3964
- setTree(tree) {
3965
- this.tree = tree;
3966
- this.currentModel = this.normalize();
3967
- this.surface.update(this.currentModel);
3968
- }
3969
- close() {
3970
- this.surface.close();
3971
- }
3972
- showReceipt(model) {
3973
- this.surface.showReceipt(model);
3974
- }
3975
- dispose() {
3976
- this.surface.dispose();
3977
- }
3978
- normalize() {
3979
- const result = normalizeConfirmationModel({
3980
- presentation: this.presentation,
3981
- appearance: this.appearance,
3982
- tree: this.tree,
3983
- callbacks: this.callbacks
3984
- });
3985
- if (!result.ok) throw new Error(`Cannot render confirmation surface: ${result.error}`);
3986
- return result.model;
3987
- }
3988
- };
3989
- function mergeConfirmationPresentation(current, update) {
3990
- return {
3991
- model: Object.hasOwn(update, "model") ? update.model : current.model,
3992
- securityContext: Object.hasOwn(update, "securityContext") ? update.securityContext : current.securityContext,
3993
- loading: Object.hasOwn(update, "loading") ? update.loading : current.loading,
3994
- preparing: Object.hasOwn(update, "preparing") ? update.preparing : current.preparing,
3995
- title: Object.hasOwn(update, "title") ? update.title : current.title,
3996
- body: Object.hasOwn(update, "body") ? update.body : current.body,
3997
- errorMessage: Object.hasOwn(update, "errorMessage") ? update.errorMessage : current.errorMessage,
3998
- confirmText: Object.hasOwn(update, "confirmText") ? update.confirmText : current.confirmText,
3999
- cancelText: Object.hasOwn(update, "cancelText") ? update.cancelText : current.cancelText,
4000
- onBack: Object.hasOwn(update, "onBack") ? update.onBack : current.onBack,
4001
- signingAuthMode: Object.hasOwn(update, "signingAuthMode") ? update.signingAuthMode : current.signingAuthMode,
4002
- emailOtpPrompt: Object.hasOwn(update, "emailOtpPrompt") ? update.emailOtpPrompt : current.emailOtpPrompt,
4003
- nearExplorerUrl: Object.hasOwn(update, "nearExplorerUrl") ? update.nearExplorerUrl : current.nearExplorerUrl,
4004
- tempoExplorerUrl: Object.hasOwn(update, "tempoExplorerUrl") ? update.tempoExplorerUrl : current.tempoExplorerUrl,
4005
- evmExplorerUrl: Object.hasOwn(update, "evmExplorerUrl") ? update.evmExplorerUrl : current.evmExplorerUrl
4006
- };
4007
- }
4008
- function createConfirmationSurfaceController(input) {
4009
- return new MountedConfirmationController(input);
4010
- }
4011
- //#endregion
4012
- //#region src/core/signingEngine/uiConfirm/ui/confirm-ui.ts
4013
- const CONFIRM_PORTAL_ID = "seams-confirm-portal";
4014
- function roundConfirmUiDurationMs(startedAt) {
4015
- return Math.max(0, Math.round(performance.now() - startedAt));
4016
- }
4017
- const confirmSurfaceMeasurementReporters = /* @__PURE__ */ new WeakMap();
4018
- const confirmSurfaceResizeChoreographers = /* @__PURE__ */ new WeakMap();
4019
- const confirmSurfaceMeasurementBindings = /* @__PURE__ */ new WeakMap();
4020
- const confirmationHosts = /* @__PURE__ */ new WeakMap();
4021
- const confirmationChannels = /* @__PURE__ */ new WeakMap();
4022
- const confirmationTreeBuildVersions = /* @__PURE__ */ new WeakMap();
4023
- function postWalletUiMessage(type) {
4024
- try {
4025
- if (!__isWalletIframeHostMode()) return;
4026
- if (typeof window === "undefined") return;
4027
- if (window.parent === window) return;
4028
- window.parent?.postMessage({ type }, "*");
4029
- } catch {}
4030
- }
4031
- function uiModeToVariant(uiMode) {
4032
- return uiMode === "drawer" ? "drawer" : "modal";
4033
- }
4034
- function normalizeTxSigningRequestsForDigest(txSigningRequests) {
4035
- return (txSigningRequests || []).map((tx) => ({
4036
- receiverId: tx.receiverId,
4037
- actions: (tx.actions || []).map((action) => isActionArgsWasm(action) ? action : toActionArgsWasm(action)).map((action) => orderActionForDigest(action))
4038
- }));
4039
- }
4040
- async function checkIntentDigestGuard(expectedIntentDigest, txSigningRequests) {
4041
- if (!((txSigningRequests?.length || 0) > 0) || !expectedIntentDigest) return void 0;
4042
- try {
4043
- return await computeUiIntentDigestFromTxs(normalizeTxSigningRequestsForDigest(txSigningRequests)) === expectedIntentDigest ? void 0 : "INTENT_DIGEST_MISMATCH";
4044
- } catch {
4045
- return "UI_DIGEST_VALIDATION_FAILED";
4046
- }
4047
- }
4048
- function updateConfirmPortalState(portal) {
4049
- if (portal.childElementCount > 0) portal.classList.add("seams-portal--visible");
4050
- else portal.classList.remove("seams-portal--visible");
4051
- }
4052
- function mountedConfirmerHosts() {
4053
- const hosts = [];
4054
- for (const candidate of document.querySelectorAll(".seams-confirmation-surface")) {
4055
- if (candidate.parentElement?.closest(".seams-confirmation-surface")) continue;
4056
- hosts.push(candidate);
4057
- }
4058
- return hosts;
4059
- }
4060
- function cleanupExistingConfirmers() {
4061
- for (const element of mountedConfirmerHosts()) {
4062
- confirmationChannels.get(element)?.callbacks.cancel();
4063
- confirmationHosts.get(element)?.dispose();
4064
- confirmationTreeBuildVersions.delete(element);
4065
- disconnectConfirmSurfaceMeasurementReporter(element);
4066
- element.remove();
4067
- }
4068
- const portal = document.getElementById(CONFIRM_PORTAL_ID);
4069
- if (portal) updateConfirmPortalState(portal);
4070
- }
4071
- function ensureConfirmPortal() {
4072
- let portal = document.getElementById(CONFIRM_PORTAL_ID);
4073
- if (!portal) {
4074
- portal = document.createElement("div");
4075
- portal.id = CONFIRM_PORTAL_ID;
4076
- portal.classList.add("seams-portal");
4077
- const root = document.body ?? document.documentElement;
4078
- if (root) root.appendChild(portal);
4079
- }
4080
- return portal;
4081
- }
4082
- function removeHostConfirmerElement(element) {
4083
- confirmationHosts.delete(element);
4084
- confirmationTreeBuildVersions.delete(element);
4085
- disconnectConfirmSurfaceMeasurementReporter(element);
4086
- element.remove();
4087
- const portal = document.getElementById(CONFIRM_PORTAL_ID);
4088
- if (portal) updateConfirmPortalState(portal);
4089
- }
4090
- function postWalletUiClosedIfPortalEmpty() {
4091
- if ((document.getElementById(CONFIRM_PORTAL_ID)?.childElementCount ?? 0) > 0) return;
4092
- postWalletUiMessage("WALLET_UI_CLOSED");
4093
- }
4094
- function resolveExplorerUrlsFromModel(ctx, model) {
4095
- const chain = model?.chain;
4096
- if (chain !== "near" && chain !== "tempo" && chain !== "evm") return {};
4097
- const explorerUrl = resolveExplorerUrlForChainFamily({
4098
- chains: ctx.chains,
4099
- family: chain,
4100
- chainId: model?.chainId
4101
- });
4102
- if (!explorerUrl) return {};
4103
- if (chain === "near") return { nearExplorerUrl: explorerUrl };
4104
- if (chain === "tempo") return { tempoExplorerUrl: explorerUrl };
4105
- return { evmExplorerUrl: explorerUrl };
4106
- }
4107
- function applyHostElementProps(host, props) {
4108
- if (!props) return;
4109
- host.update(props);
4110
- if (Object.hasOwn(props, "model")) scheduleConfirmationAbiEnrichment(host.element, host, props.model);
4111
- }
4112
- function scheduleConfirmationAbiEnrichment(element, host, model) {
4113
- const buildVersion = (confirmationTreeBuildVersions.get(element) ?? 0) + 1;
4114
- confirmationTreeBuildVersions.set(element, buildVersion);
4115
- if (!model || !modelHasAbiDecodeHints(model)) return;
4116
- import("./enrichDisplayModelWithAbi-CWggsykc.js").then((module) => {
4117
- if (confirmationTreeBuildVersions.get(element) !== buildVersion || !element.isConnected || confirmationHosts.get(element) !== host) return;
4118
- const enrichedModel = module.enrichDisplayModelWithAbi(model);
4119
- if (confirmationTreeBuildVersions.get(element) !== buildVersion) return;
4120
- host.setTree(buildConfirmationTree({ model: enrichedModel }));
4121
- }).catch((error) => {
4122
- console.warn("[ConfirmUI] failed to lazy-load ABI display enrichment", error);
4123
- });
4124
- }
4125
- function disconnectConfirmSurfaceMeasurementReporter(element) {
4126
- confirmSurfaceMeasurementReporters.get(element)?.disconnect();
4127
- confirmSurfaceMeasurementReporters.delete(element);
4128
- confirmSurfaceResizeChoreographers.get(element)?.dispose();
4129
- confirmSurfaceResizeChoreographers.delete(element);
4130
- confirmSurfaceMeasurementBindings.delete(element);
4131
- }
4132
- function createConfirmSurfaceMeasurementReporter(binding, element) {
4133
- switch (binding.kind) {
4134
- case "disabled": return null;
4135
- case "wallet_iframe": return createWalletIframeSurfaceMeasurementReporter({
4136
- kind: "request_surface",
4137
- element,
4138
- requestId: binding.requestId,
4139
- postMeasurement: binding.postMeasurement
4140
- });
4141
- default: {
4142
- const exhaustive = binding;
4143
- throw new Error(`Unhandled confirmation measurement binding: ${String(exhaustive)}`);
4144
- }
4145
- }
4146
- }
4147
- /**
4148
- * Two independent values decide how a confirmation is laid out, and conflating
4149
- * them is what once stranded the Email OTP export prompt in the top-left corner:
4150
- *
4151
- * - `data-seams-confirm-variant` is what THIS confirmation renders (modal card or
4152
- * bottom sheet). It comes from the Confirmer UI setting.
4153
- * - `data-seams-confirm-surface` is the shape of the HOST BOX it renders into.
4154
- * `wallet-iframe` means the parent measured the card and sized the box to hug
4155
- * it, so the card must not position itself. `standalone` means the card owns a
4156
- * full-viewport canvas and centres (modal) or bottom-anchors (drawer) itself.
4157
- *
4158
- * They are usually the same value, so the box shape is inferred from the
4159
- * variant. Key export is the exception: its box is pinned to a full-viewport
4160
- * drawer for the whole request (the key viewer is always a drawer), while the
4161
- * OTP prompt inside that box still follows the Confirmer UI setting. A modal
4162
- * prompt in a full-viewport box must self-centre, so the box shape wins.
4163
- */
4164
- function applyConfirmSurfaceMode(element, variant, binding) {
4165
- element.setAttribute(CONFIRM_SURFACE_MODE_ATTR, confirmationSurfaceContext(binding, variant));
4166
- element.setAttribute("data-seams-confirm-variant", variant);
4167
- element.toggleAttribute("data-seams-review-frame", !!reviewAdmissionForBinding(binding));
4168
- }
4169
- function bindConfirmSurfaceMeasurementReporter(element, variant, binding) {
4170
- reviewAdmissionForBinding(binding)?.attach(element);
4171
- applyConfirmSurfaceMode(element, variant, binding);
4172
- if (sameSurfaceMeasurementBinding(confirmSurfaceMeasurementBindings.get(element), binding)) return;
4173
- disconnectConfirmSurfaceMeasurementReporter(element);
4174
- confirmSurfaceMeasurementBindings.set(element, binding);
4175
- const reporter = createConfirmSurfaceMeasurementReporter(binding, element);
4176
- if (!reporter) return;
4177
- confirmSurfaceMeasurementReporters.set(element, reporter);
4178
- confirmSurfaceResizeChoreographers.set(element, attachConfirmSurfaceResizeChoreographer(element));
4179
- }
4180
- function returnToApplicationReview(admission, navigation) {
4181
- if (navigation.kind === "review_available") admission.returnToReview();
4182
- }
4183
- function createConfirmationDecisionChannel(admission) {
4184
- const navigation = { kind: "review_available" };
4185
- const queuedDecisions = [];
4186
- const decisionWaiters = [];
4187
- const cancelListeners = /* @__PURE__ */ new Set();
4188
- const publishDecision = (decision) => {
4189
- navigation.kind = "decision_published";
4190
- const waiter = decisionWaiters.shift();
4191
- if (waiter) {
4192
- waiter(decision);
4193
- return;
4194
- }
4195
- queuedDecisions.push(decision);
4196
- };
4197
- const cancel = (error) => {
4198
- publishDecision({
4199
- kind: "cancelled",
4200
- error: error ?? null
4201
- });
4202
- for (const listener of cancelListeners) listener({ ...error ? { error } : {} });
4203
- };
4204
- return {
4205
- cancelListeners,
4206
- onBack: admission ? returnToApplicationReview.bind(null, admission, navigation) : void 0,
4207
- callbacks: {
4208
- confirm: () => {
4209
- if (admission && !admission.allowInteraction()) return;
4210
- publishDecision({
4211
- kind: "confirmed",
4212
- emailOtp: { kind: "absent" }
4213
- });
4214
- },
4215
- cancel: () => cancel(),
4216
- submitEmail: (code, challengeId) => {
4217
- if (admission && !admission.allowInteraction()) return;
4218
- const otpCode = code.trim();
4219
- const emailOtpChallengeId = challengeId.trim();
4220
- if (!otpCode || !emailOtpChallengeId) {
4221
- cancel("Email OTP challenge is missing.");
4222
- return;
4223
- }
4224
- publishDecision({
4225
- kind: "confirmed",
4226
- emailOtp: {
4227
- kind: "provided",
4228
- code: otpCode,
4229
- challengeId: emailOtpChallengeId
4230
- }
4231
- });
4232
- }
4233
- },
4234
- takeDecision: async () => {
4235
- const queued = queuedDecisions.shift();
4236
- if (queued) return queued;
4237
- return await new Promise((resolve) => {
4238
- decisionWaiters.push(resolve);
4239
- });
4240
- }
4241
- };
4242
- }
4243
- function createHostConfirmHandle(host, channel, binding) {
4244
- let closed = false;
4245
- return {
4246
- element: host.element,
4247
- close: (confirmed) => {
4248
- if (closed) return;
4249
- closed = true;
4250
- if (!confirmed) channel.callbacks.cancel();
4251
- channel.cancelListeners.clear();
4252
- if (confirmed && binding.kind === "wallet_iframe" && retainTransactionActivity(binding.requestId, host)) return;
4253
- disconnectConfirmSurfaceMeasurementReporter(host.element);
4254
- host.close();
4255
- },
4256
- update: (props) => applyHostElementProps(host, props),
4257
- onCancel: (listener) => {
4258
- channel.cancelListeners.add(listener);
4259
- return () => channel.cancelListeners.delete(listener);
4260
- },
4261
- takeDecision: () => channel.takeDecision()
4262
- };
4263
- }
4264
- async function mountConfirmUI({ ctx, summary, txSigningRequests, model, securityContext, loading, theme, appearance, uiMode, signingAuthMode, emailOtpPrompt }) {
4265
- return mountHostElement({
4266
- ctx,
4267
- summary,
4268
- txSigningRequests,
4269
- model,
4270
- securityContext,
4271
- loading,
4272
- theme,
4273
- appearance,
4274
- variant: uiModeToVariant(uiMode),
4275
- signingAuthMode,
4276
- emailOtpPrompt
4277
- });
4278
- }
4279
- function reuseMountedDecisionSurface(args) {
4280
- const handle = args.surface.handle;
4281
- const el = handle.element;
4282
- if (!el.isConnected) throw new Error("Cannot reuse a detached confirmation surface");
4283
- const host = confirmationHosts.get(el);
4284
- if (!host) throw new Error("Cannot reuse an unmanaged confirmation surface");
4285
- bindConfirmSurfaceMeasurementReporter(el, args.variant, args.ctx.surfaceMeasurementBinding);
4286
- const resolvedAppearance = resolveUiAppearance({
4287
- getAppearance: args.ctx.getAppearance,
4288
- requestedAppearance: args.appearance,
4289
- requestedMode: args.theme
4290
- });
4291
- const explorerOverrides = resolveExplorerUrlsFromModel(args.ctx, args.model);
4292
- host.update({
4293
- model: args.model,
4294
- securityContext: args.securityContext,
4295
- loading: args.loading ?? false,
4296
- appearance: resolvedAppearance,
4297
- title: args.summary.title ?? "",
4298
- body: args.summary.body ?? "",
4299
- signingAuthMode: args.signingAuthMode,
4300
- emailOtpPrompt: args.emailOtpPrompt,
4301
- errorMessage: "",
4302
- ...explorerOverrides
4303
- });
4304
- host.setTree(buildConfirmationTree({
4305
- txSigningRequests: args.txSigningRequests,
4306
- model: args.model
4307
- }));
4308
- scheduleConfirmationAbiEnrichment(el, host, args.model);
4309
- return {
4310
- handle,
4311
- reused: true
4312
- };
4313
- }
4314
- function assertNeverConfirmationSurface(value) {
4315
- throw new Error(`Unhandled confirmation surface: ${JSON.stringify(value)}`);
4316
- }
4317
- function resolveDecisionSurface(args) {
4318
- switch (args.surface.kind) {
4319
- case "mount_new": return {
4320
- handle: mountHostElement({
4321
- ctx: args.ctx,
4322
- summary: args.summary,
4323
- txSigningRequests: args.txSigningRequests,
4324
- model: args.model,
4325
- securityContext: args.securityContext,
4326
- loading: args.loading,
4327
- theme: args.theme,
4328
- appearance: args.appearance,
4329
- variant: args.variant,
4330
- signingAuthMode: args.signingAuthMode,
4331
- emailOtpPrompt: args.emailOtpPrompt
4332
- }),
4333
- reused: false
4334
- };
4335
- case "reuse_mounted": return reuseMountedDecisionSurface({
4336
- ...args,
4337
- surface: args.surface
4338
- });
4339
- case "preparation_cancelled": throw new Error("A cancelled preparation surface cannot be mounted");
4340
- default: return assertNeverConfirmationSurface(args.surface);
4341
- }
4342
- }
4343
- async function prepareConfirmUISurface(args) {
4344
- return resolveDecisionSurface({
4345
- ctx: args.ctx,
4346
- summary: args.summary,
4347
- txSigningRequests: args.txSigningRequests,
4348
- model: args.model,
4349
- securityContext: args.securityContext,
4350
- loading: args.loading,
4351
- theme: args.theme,
4352
- appearance: args.appearance,
4353
- variant: uiModeToVariant(args.uiMode),
4354
- signingAuthMode: args.signingAuthMode,
4355
- emailOtpPrompt: args.emailOtpPrompt,
4356
- surface: args.surface
4357
- }).handle;
4358
- }
4359
- async function awaitConfirmUIDecision({ ctx, summary, txSigningRequests, model, securityContext, loading, theme, appearance, uiMode, onMounted, signingAuthMode, emailOtpPrompt, surface }) {
4360
- const variant = uiModeToVariant(uiMode);
4361
- return new Promise((resolve) => {
4362
- const mountStartedAt = performance.now();
4363
- const { handle, reused } = resolveDecisionSurface({
4364
- ctx,
4365
- summary,
4366
- txSigningRequests,
4367
- model,
4368
- securityContext,
4369
- loading,
4370
- theme,
4371
- appearance,
4372
- variant,
4373
- signingAuthMode,
4374
- emailOtpPrompt,
4375
- surface
4376
- });
4377
- const mountMs = roundConfirmUiDurationMs(mountStartedAt);
4378
- const decisionWaitStartedAt = performance.now();
4379
- let hostFirstUpdateMs = 0;
4380
- let hostInteractiveMs = reused ? mountMs : 0;
4381
- let confirmEventMs = 0;
4382
- const markDecisionWaitOffset = (currentValue) => currentValue > 0 ? currentValue : roundConfirmUiDurationMs(decisionWaitStartedAt);
4383
- Promise.resolve().then(() => {
4384
- hostFirstUpdateMs = markDecisionWaitOffset(hostFirstUpdateMs);
4385
- if (!reused) hostInteractiveMs = markDecisionWaitOffset(hostInteractiveMs);
4386
- });
4387
- try {
4388
- onMounted?.(handle);
4389
- } catch {}
4390
- const finalize = (result) => {
4391
- const diagnostics = {
4392
- kind: "confirm_ui_prompt_diagnostics_v1",
4393
- elementDefineMs: 0,
4394
- mountMs,
4395
- hostFirstUpdateMs,
4396
- hostInteractiveMs,
4397
- confirmEventMs,
4398
- decisionWaitMs: roundConfirmUiDurationMs(decisionWaitStartedAt)
4399
- };
4400
- cleanup();
4401
- resolve({
4402
- ...result,
4403
- handle,
4404
- diagnostics
4405
- });
4406
- };
4407
- const onDecision = async (decision) => {
4408
- confirmEventMs = markDecisionWaitOffset(confirmEventMs);
4409
- if (decision.kind === "cancelled") {
4410
- const error = decision.error || void 0;
4411
- handle.update({
4412
- ...error ? { errorMessage: error } : {},
4413
- loading: false
4414
- });
4415
- finalize({
4416
- confirmed: false,
4417
- error
4418
- });
4419
- return;
4420
- }
4421
- let error;
4422
- const guardError = await checkIntentDigestGuard(String(model?.intentDigest || summary?.intentDigest || "").trim(), txSigningRequests);
4423
- if (guardError) error = guardError;
4424
- if (error) {
4425
- handle.update({
4426
- errorMessage: error,
4427
- loading: false
4428
- });
4429
- finalize({
4430
- confirmed: false,
4431
- error
4432
- });
4433
- return;
4434
- }
4435
- finalize({
4436
- confirmed: true,
4437
- ...decision.emailOtp.kind === "provided" ? {
4438
- otpCode: decision.emailOtp.code,
4439
- emailOtpChallengeId: decision.emailOtp.challengeId
4440
- } : {}
4441
- });
4442
- };
4443
- const cleanup = () => {
4444
- hostFirstUpdateMs = Math.max(hostFirstUpdateMs, 0);
4445
- };
4446
- (async () => {
4447
- let decision = await handle.takeDecision();
4448
- if (signingAuthMode === "emailOtp" && decision.kind === "confirmed" && decision.emailOtp.kind === "absent") {
4449
- handle.update({ loading: false });
4450
- decision = await handle.takeDecision();
4451
- }
4452
- await onDecision(decision);
4453
- })();
4454
- });
4455
- }
4456
- function mountHostElement({ ctx, summary, txSigningRequests, model, securityContext, loading, theme, appearance, variant, signingAuthMode, emailOtpPrompt }) {
4457
- reviewAdmissionForBinding(ctx.surfaceMeasurementBinding)?.assertPending();
4458
- cleanupExistingConfirmers();
4459
- const resolvedAppearance = resolveUiAppearance({
4460
- getAppearance: ctx.getAppearance,
4461
- requestedAppearance: appearance,
4462
- requestedMode: theme
4463
- });
4464
- const portal = ensureConfirmPortal();
4465
- const explorerOverrides = resolveExplorerUrlsFromModel(ctx, model);
4466
- const channel = createConfirmationDecisionChannel(reviewAdmissionForBinding(ctx.surfaceMeasurementBinding));
4467
- let host;
4468
- host = createConfirmationSurfaceController({
4469
- parent: portal,
4470
- variant,
4471
- context: confirmationSurfaceContext(ctx.surfaceMeasurementBinding, variant),
4472
- appearance: resolvedAppearance,
4473
- presentation: {
4474
- onBack: channel.onBack,
4475
- model,
4476
- securityContext,
4477
- loading,
4478
- title: summary?.title ?? (summary?.delegate ? "Sign Delegate Action" : void 0),
4479
- body: summary?.body,
4480
- signingAuthMode,
4481
- emailOtpPrompt,
4482
- nearExplorerUrl: ctx.nearExplorerUrl ?? explorerOverrides.nearExplorerUrl,
4483
- tempoExplorerUrl: ctx.tempoExplorerUrl ?? explorerOverrides.tempoExplorerUrl,
4484
- evmExplorerUrl: ctx.evmExplorerUrl ?? explorerOverrides.evmExplorerUrl
4485
- },
4486
- tree: buildConfirmationTree({
4487
- txSigningRequests,
4488
- model
4489
- }),
4490
- callbacks: channel.callbacks,
4491
- onClosed: () => {
4492
- removeHostConfirmerElement(host.element);
4493
- postWalletUiClosedIfPortalEmpty();
4494
- }
4495
- });
4496
- confirmationHosts.set(host.element, host);
4497
- confirmationChannels.set(host.element, channel);
4498
- updateConfirmPortalState(portal);
4499
- bindConfirmSurfaceMeasurementReporter(host.element, variant, ctx.surfaceMeasurementBinding);
4500
- scheduleConfirmationAbiEnrichment(host.element, host, model);
4501
- portal.classList.remove("seams-portal--visible");
4502
- requestAnimationFrame(() => {
4503
- portal.classList.add("seams-portal--visible");
4504
- });
4505
- postWalletUiMessage("WALLET_UI_OPENED");
4506
- return createHostConfirmHandle(host, channel, ctx.surfaceMeasurementBinding);
4507
- }
4508
- function confirmationSurfaceContext(binding, variant) {
4509
- const hostVariant = binding.kind === "wallet_iframe" ? binding.hostSurfaceVariant ?? variant : variant;
4510
- return binding.kind === "wallet_iframe" && hostVariant === "modal" ? "wallet-iframe" : "standalone";
4511
- }
4512
- //#endregion
4513
- //#region src/core/signingEngine/uiConfirm/handlers/flows/adapters/adapters.ts
4514
- function parseReadinessNonce(raw, fallback) {
4515
- if (typeof raw === "bigint") return raw;
4516
- const normalized = String(raw ?? fallback ?? "0").trim();
4517
- if (!normalized) return 0n;
4518
- try {
4519
- return BigInt(normalized);
4520
- } catch {
4521
- return 0n;
4522
- }
4523
- }
4524
- function parseNearExecutionReadiness(raw) {
4525
- if (!isObject(raw)) return null;
4526
- const kind = String(raw.kind || "").trim();
4527
- const walletId = String(raw.walletId || "").trim();
4528
- const nearAccountId = String(raw.nearAccountId || "").trim();
4529
- const nearPublicKeyStr = String(raw.nearPublicKeyStr || "").trim();
4530
- if (!walletId || !nearAccountId || !nearPublicKeyStr) return null;
4531
- switch (kind) {
4532
- case "implicit_unfunded": return {
4533
- kind,
4534
- walletId,
4535
- nearAccountId,
4536
- nearPublicKeyStr
4537
- };
4538
- case "access_key_available":
4539
- case "sponsored_named_ready": return {
4540
- kind,
4541
- walletId,
4542
- nearAccountId,
4543
- nearPublicKeyStr,
4544
- nonce: parseReadinessNonce(raw.nonce, raw.nextNonce),
4545
- accessKeyNonce: String(raw.accessKeyNonce || "").trim(),
4546
- nextNonce: String(raw.nextNonce || "").trim(),
4547
- txBlockHeight: String(raw.txBlockHeight || "").trim(),
4548
- txBlockHash: String(raw.txBlockHash || "").trim()
4549
- };
4550
- case "account_lookup_failed": return {
4551
- kind,
4552
- walletId,
4553
- nearAccountId,
4554
- nearPublicKeyStr,
4555
- message: String(raw.message || "").trim()
4556
- };
4557
- default: return null;
4558
- }
4559
- }
4560
- function nearExecutionReadinessFromError(error) {
4561
- if (!isObject(error)) return null;
4562
- return parseNearExecutionReadiness(error.readiness);
4563
- }
4564
- function implicitFundingReadinessMatchesRequest(readiness, request) {
4565
- return readiness.walletId === String(request.subject.walletId) && readiness.nearAccountId === String(request.subject.nearAccountId) && readiness.nearPublicKeyStr === request.subject.nearPublicKeyStr;
4566
- }
4567
- async function fetchNearContext(ctx, request) {
4568
- try {
4569
- const { context, leases } = await ctx.nonceCoordinator.reserveNearContext({
4570
- lane: buildNearNonceLane({
4571
- chains: ctx.chains,
4572
- walletId: String(request.subject.walletId),
4573
- nearAccountId: String(request.subject.nearAccountId),
4574
- nearPublicKeyStr: request.subject.nearPublicKeyStr
4575
- }),
4576
- operation: request.operation,
4577
- count: request.signatureUses,
4578
- nearClient: ctx.nearClient
4579
- });
4580
- return {
4581
- kind: "readiness",
4582
- readiness: {
4583
- kind: "context_ready",
4584
- transactionContext: { ...context },
4585
- nonceLeases: leases.map(nonceLeaseToRef)
4586
- },
4587
- reservedNonceLeases: leases
4588
- };
4589
- } catch (error) {
4590
- const readiness = nearExecutionReadinessFromError(error);
4591
- if (readiness?.kind === "implicit_unfunded" && implicitFundingReadinessMatchesRequest(readiness, request)) return {
4592
- kind: "readiness",
4593
- readiness: {
4594
- kind: "funding_required",
4595
- request
4596
- },
4597
- reservedNonceLeases: []
4598
- };
4599
- return {
4600
- kind: "failed",
4601
- error: readiness?.kind === "account_lookup_failed" ? "NEAR_ACCOUNT_LOOKUP_FAILED" : "NEAR_CONTEXT_UNAVAILABLE",
4602
- details: errorMessage(error)
4603
- };
4604
- }
4605
- }
4606
- async function releaseReservedNonces(ctx, nonceLeases) {
4607
- if (!nonceLeases?.length) return;
4608
- await Promise.all(nonceLeases.map((nonceLease) => ctx.nonceCoordinator.release({
4609
- leaseId: nonceLease.leaseId,
4610
- operationId: nonceLease.operationId,
4611
- operationFingerprint: nonceLease.operationFingerprint,
4612
- reason: "cancelled"
4613
- })));
4614
- }
4615
- async function collectAuthenticationCredentialWithPRF({ ctx, nearAccountId, challengeB64u, onBeforePrompt, includeSecondPrfOutput = false }) {
4616
- return collectAuthenticationCredentialForChallengeB64u({
4617
- credentialStore: ctx.webauthnCredentialStore,
4618
- touchIdPrompt: ctx.touchIdPrompt,
4619
- nearAccountId,
4620
- challengeB64u,
4621
- includeSecondPrfOutput,
4622
- onBeforePrompt
4623
- });
4624
- }
4625
- function closeModalSafely(confirmed, handle) {
4626
- handle?.close?.(confirmed);
4627
- }
4628
- function confirmUiRenderContext(ctx) {
4629
- return {
4630
- chains: ctx.chains,
4631
- getAppearance: ctx.getAppearance,
4632
- nearExplorerUrl: ctx.nearExplorerUrl,
4633
- tempoExplorerUrl: ctx.tempoExplorerUrl,
4634
- evmExplorerUrl: ctx.evmExplorerUrl,
4635
- surfaceMeasurementBinding: ctx.surfaceMeasurementBinding
4636
- };
4637
- }
4638
- function emptyConfirmDiagnostics() {
4639
- return {
4640
- kind: "confirm_ui_prompt_diagnostics_v1",
4641
- elementDefineMs: 0,
4642
- mountMs: 0,
4643
- hostFirstUpdateMs: 0,
4644
- hostInteractiveMs: 0,
4645
- confirmEventMs: 0,
4646
- decisionWaitMs: 0
4647
- };
4648
- }
4649
- async function renderAutoProceedConfirmUI(args) {
4650
- const mountStartedAt = performance.now();
4651
- const handle = await prepareConfirmUISurface({
4652
- ctx: confirmUiRenderContext(args.ctx),
4653
- summary: args.transactionSummary,
4654
- txSigningRequests: args.txSigningRequests,
4655
- model: args.model,
4656
- securityContext: args.securityContext,
4657
- loading: args.loading ?? true,
4658
- theme: args.theme,
4659
- uiMode: args.confirmationConfig.uiMode,
4660
- signingAuthMode: args.signingAuthMode,
4661
- emailOtpPrompt: args.emailOtpPrompt,
4662
- surface: args.surface
4663
- });
4664
- const mountMs = Math.max(0, Math.round(performance.now() - mountStartedAt));
4665
- args.onMounted?.(handle);
4666
- const decisionWaitStartedAt = performance.now();
4667
- await new Promise((resolve) => setTimeout(resolve, args.confirmationConfig.autoProceedDelay));
4668
- const decisionWaitMs = Math.max(0, Math.round(performance.now() - decisionWaitStartedAt));
4669
- return {
4670
- confirmed: true,
4671
- confirmHandle: handle,
4672
- diagnostics: {
4673
- ...emptyConfirmDiagnostics(),
4674
- mountMs,
4675
- decisionWaitMs
4676
- }
4677
- };
4678
- }
4679
- async function renderInteractiveConfirmUI(args) {
4680
- const { confirmed, handle, error, otpCode, emailOtpChallengeId, diagnostics } = await awaitConfirmUIDecision({
4681
- ctx: confirmUiRenderContext(args.ctx),
4682
- summary: args.transactionSummary,
4683
- txSigningRequests: args.txSigningRequests,
4684
- model: args.model,
4685
- securityContext: args.securityContext,
4686
- loading: args.loading,
4687
- theme: args.theme,
4688
- uiMode: args.confirmationConfig.uiMode,
4689
- onMounted: args.onMounted,
4690
- signingAuthMode: args.signingAuthMode,
4691
- emailOtpPrompt: args.emailOtpPrompt,
4692
- surface: args.surface
4693
- });
4694
- if (args.request.type === UserConfirmationType.SIGN_TRANSACTION && getSignTransactionPayload(args.request).signingKind === "transaction") emitSigningSessionFlowTrace("near", {
4695
- event: "near_confirmation_prompt_timing",
4696
- mountMs: diagnostics.mountMs,
4697
- decisionWaitMs: diagnostics.decisionWaitMs,
4698
- confirmed
4699
- });
4700
- return {
4701
- confirmed,
4702
- confirmHandle: handle,
4703
- error,
4704
- otpCode,
4705
- emailOtpChallengeId,
4706
- diagnostics
4707
- };
4708
- }
4709
- async function renderConfirmUI({ ctx, request, confirmationConfig, transactionSummary, securityContext, loading, theme, surface, onMounted }) {
4710
- if (surface.kind === "preparation_cancelled") return {
4711
- confirmed: false,
4712
- confirmHandle: void 0,
4713
- diagnostics: emptyConfirmDiagnostics()
4714
- };
4715
- const txSigningRequests = request.type === UserConfirmationType.SIGN_TRANSACTION ? getSignTransactionPayload(request).txSigningRequests : [];
4716
- const model = getDisplayModel(request);
4717
- const signingAuthMode = getSigningAuthMode(request);
4718
- const emailOtpPrompt = getEmailOtpPrompt(request);
4719
- switch (confirmationConfig.kind) {
4720
- case "silent":
4721
- if (surface.kind === "reuse_mounted") surface.handle.close(true);
4722
- return {
4723
- confirmed: true,
4724
- confirmHandle: void 0,
4725
- diagnostics: emptyConfirmDiagnostics()
4726
- };
4727
- case "auto_proceed": return await renderAutoProceedConfirmUI({
4728
- ctx,
4729
- request,
4730
- confirmationConfig,
4731
- transactionSummary,
4732
- securityContext,
4733
- loading,
4734
- theme,
4735
- surface,
4736
- onMounted,
4737
- txSigningRequests,
4738
- model,
4739
- signingAuthMode,
4740
- emailOtpPrompt
4741
- });
4742
- case "interactive": return await renderInteractiveConfirmUI({
4743
- ctx,
4744
- request,
4745
- confirmationConfig,
4746
- transactionSummary,
4747
- securityContext,
4748
- loading,
4749
- theme,
4750
- surface,
4751
- onMounted,
4752
- txSigningRequests,
4753
- model,
4754
- signingAuthMode,
4755
- emailOtpPrompt
4756
- });
4757
- default: return assertNeverConfirmationConfig(confirmationConfig);
4758
- }
4759
- }
4760
- function createConfirmTxFlowAdapters(ctx) {
4761
- return {
4762
- near: {
4763
- fetchNearContext: (opts) => fetchNearContext(ctx, opts),
4764
- releaseReservedNonces: (nonceLease) => releaseReservedNonces(ctx, nonceLease)
4765
- },
4766
- security: { getRpId: () => ctx.touchIdPrompt.getRpId() },
4767
- webauthn: {
4768
- collectAuthenticationCredentialWithPRF: (args) => collectAuthenticationCredentialWithPRF({
4769
- ctx,
4770
- ...args
4771
- }),
4772
- createRegistrationCredential: (args) => ctx.touchIdPrompt.generateRegistrationCredentialsInternal(args)
4773
- },
4774
- ui: {
4775
- renderConfirmUI: (args) => renderConfirmUI({
4776
- ctx,
4777
- ...args
4778
- }),
4779
- closeModalSafely
4780
- }
4781
- };
4782
- }
4783
- function createConfirmSession({ adapters, worker, request, confirmationConfig, transactionSummary, theme, surface }) {
4784
- let nonceLeases;
4785
- let confirmHandle;
4786
- const setNonceLeases = (leases) => {
4787
- nonceLeases = leases;
4788
- };
4789
- const updateUI = (props) => {
4790
- confirmHandle?.update?.(props);
4791
- };
4792
- const promptUser = async ({ securityContext, loading, onMounted }) => {
4793
- const { confirmed, confirmHandle: handle, error, otpCode, emailOtpChallengeId, diagnostics } = await adapters.ui.renderConfirmUI({
4794
- request,
4795
- confirmationConfig,
4796
- transactionSummary,
4797
- securityContext,
4798
- loading,
4799
- theme,
4800
- surface,
4801
- onMounted: (mountedHandle) => {
4802
- confirmHandle = mountedHandle;
4803
- onMounted?.(mountedHandle);
4804
- }
4805
- });
4806
- confirmHandle = handle;
4807
- return {
4808
- confirmed,
4809
- error,
4810
- otpCode,
4811
- emailOtpChallengeId,
4812
- diagnostics
4813
- };
4814
- };
4815
- const confirmAndCloseModal = (decision) => {
4816
- try {
4817
- sendConfirmResponse(worker, decision);
4818
- } finally {
4819
- if (!decision.confirmed) adapters.near.releaseReservedNonces(nonceLeases);
4820
- adapters.ui.closeModalSafely(!!decision.confirmed, confirmHandle);
4821
- }
4822
- };
4823
- const dismissReviewSurface = () => {
4824
- adapters.ui.closeModalSafely(true, confirmHandle);
4825
- confirmHandle = void 0;
4826
- };
4827
- return {
4828
- setNonceLeases,
4829
- updateUI,
4830
- promptUser,
4831
- dismissReviewSurface,
4832
- confirmAndCloseModal
4833
- };
4834
- }
4835
- //#endregion
4836
- export { UserConfirmMessageType as A, getSignIntentDigestSubject as C, getWalletId as D, getTxCount as E, normalizeConfirmationConfig as M, silentConfirmationConfig as N, resolveUiAppearance as O, getNearAccountId as S, getSigningAuthMode as T, sendConfirmProgress as _, formatNearAccountFundingProgressNotice as a, assertSigningRequestContext as b, collectAuthenticationCredentialForChallengeB64u as c, collectAuthenticationCredentialForWalletChallengeB64u as d, ERROR_MESSAGES as f, sanitizeForPostMessage as g, parseTransactionSummary as h, formatNearAccountFundingNotice as i, UserConfirmationType as j, sameSurfaceMeasurementBinding as k, collectAuthenticationCredentialForExactNearChallengeB64u as l, isUserCancelledUserConfirm as m, createConfirmTxFlowAdapters as n, __isWalletIframeHostMode as o, createUserConfirmScopedWorker as p, mountConfirmUI as r, __setWalletIframeHostMode as s, createConfirmSession as t, collectAuthenticationCredentialForExactWalletChallengeB64u as u, sendConfirmResponse as v, getSignTransactionPayload as w, getIntentDigest as x, assertNoForbiddenMainThreadSigningSecrets as y };