@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.
- package/README.md +4 -5
- package/THIRD_PARTY_NOTICES.md +1 -9
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/SeamsWeb.js +2 -2
- package/dist/esm/SeamsWeb/assembly/browserSigningSurfaceAssembly.js +2 -2
- package/dist/esm/SeamsWeb/assembly/createBrowserRecoveryPublicDeps.js +1 -1
- package/dist/esm/SeamsWeb/assembly/createBrowserSigningStores.js +1 -1
- package/dist/esm/SeamsWeb/assembly/createBrowserWarmSessionPublicDeps.js +0 -2
- package/dist/esm/SeamsWeb/operations/auth/login.js +18 -43
- package/dist/esm/SeamsWeb/operations/auth/walletUnlockSubject.js +2 -8
- package/dist/esm/SeamsWeb/operations/authMethods/emailOtp/addEmailOtp.js +1 -1
- package/dist/esm/SeamsWeb/operations/authMethods/emailOtp/googleEmailOtpWalletAuthFlow.js +5 -9
- package/dist/esm/SeamsWeb/operations/authMethods/passkey/addPasskey.js +1 -1
- package/dist/esm/SeamsWeb/operations/authMethods/revokeAuthMethod.js +1 -1
- package/dist/esm/SeamsWeb/operations/devices/deviceLinkingResume.js +1 -4
- package/dist/esm/SeamsWeb/operations/devices/linkDeviceFlow.js +38 -13
- package/dist/esm/SeamsWeb/operations/devices/scanDevice.js +1 -1
- package/dist/esm/SeamsWeb/operations/near/signNEP413.js +0 -1
- package/dist/esm/SeamsWeb/operations/recovery/syncAccount.js +2 -4
- package/dist/esm/SeamsWeb/operations/recovery/walletRecovery.js +1 -2
- package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryCommit.js +4 -5
- package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryDurablePayload.js +1 -2
- package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryRotation.js +1 -2
- package/dist/esm/SeamsWeb/operations/registration/pendingRegistrationRecovery.js +3 -12
- package/dist/esm/SeamsWeb/operations/registration/registration.js +5 -5
- package/dist/esm/SeamsWeb/operations/registration/registrationStrictEcdsa.js +1 -1
- package/dist/esm/SeamsWeb/operations/registration/registrationTerminalCommit.js +1 -1
- package/dist/esm/SeamsWeb/operations/session/thresholdEcdsaProvisioning.js +2 -6
- package/dist/esm/SeamsWeb/publicApi/near.js +1 -1
- package/dist/esm/SeamsWeb/publicApi/transactionReview.js +4 -1
- package/dist/esm/SeamsWeb/signingSurface/BrowserSigningSurface.js +4 -4
- package/dist/esm/SeamsWeb/walletIframe/client/router.js +1 -2
- package/dist/esm/SeamsWeb/walletIframe/client/surface/domain.js +0 -2
- package/dist/esm/SeamsWeb/walletIframe/client/transport/IframeTransport.js +0 -4
- package/dist/esm/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.js +1 -1
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.js +64 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +165 -222
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/icons.js +136 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +6 -6
- package/dist/esm/SeamsWeb/walletIframe/shared/transactionReview.js +11 -1
- package/dist/esm/advanced.js +0 -1
- package/dist/esm/base-styles.js +2 -2
- package/dist/esm/core/accountData/near/accountProjection.js +0 -1
- package/dist/esm/core/accountData/near/keyMaterial.js +0 -1
- package/dist/esm/core/browser/walletIframe/events.js +1 -5
- package/dist/esm/core/browser/walletIframe/host-mode.js +0 -10
- package/dist/esm/core/config/chains.js +1 -2
- package/dist/esm/core/config/configBuilder.js +0 -1
- package/dist/esm/core/config/configHelpers.js +0 -1
- package/dist/esm/core/indexedDB/accountKeyMaterial.js +0 -1
- package/dist/esm/core/indexedDB/index.js +3 -4
- package/dist/esm/core/indexedDB/pendingWalletRecoveryCommit.js +1 -4
- package/dist/esm/core/indexedDB/schemaNames.js +0 -22
- package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.js +3 -3
- package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.js +3 -3
- package/dist/esm/core/indexedDB/seamsWalletDB/ecdsaClientPresignatures.js +1 -1
- package/dist/esm/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.js +0 -1
- package/dist/esm/core/indexedDB/seamsWalletDB/registrationSetup.js +103 -0
- package/dist/esm/core/indexedDB/seamsWalletDB/repositories.js +2 -3
- package/dist/esm/core/indexedDB/seamsWalletDB/signingSessionSeals.js +0 -35
- package/dist/esm/core/indexedDB/seamsWalletDB/walletCustodyEcdsaContinuity.js +4 -4
- package/dist/esm/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.js +37 -19
- package/dist/esm/core/indexedDB/unifiedIndexedDBManager.js +10 -3
- package/dist/esm/core/indexedDB/walletCustodyEd25519MaterialRecord.js +1 -1
- package/dist/esm/core/platform/browser/createBrowserPlatformRuntime.js +8 -25
- package/dist/esm/core/rpcClients/near/rpcCalls.js +39 -1
- package/dist/esm/core/rpcClients/relayer/passkeyCustodyEnvelope.js +3 -13
- package/dist/esm/core/rpcClients/relayer/thresholdEcdsa.js +0 -2
- package/dist/esm/core/rpcClients/relayer/walletRecoveryPrepare.js +3 -4
- package/dist/esm/core/rpcClients/relayer/walletRegistration.js +21 -15
- package/dist/esm/core/rpcClients/relayer/walletRegistrationTerminalResponse.js +1 -2
- package/dist/esm/core/signingEngine/assembly/createManagers.js +1 -1
- package/dist/esm/core/signingEngine/assembly/ports/shared.js +1 -2
- package/dist/esm/core/signingEngine/assembly/warmup.js +1 -5
- package/dist/esm/core/signingEngine/chains/near/nearSignerWasm.js +2 -33
- package/dist/esm/core/signingEngine/flows/recovery/ecdsaDerivationExport.js +0 -1
- package/dist/esm/core/signingEngine/flows/recovery/ecdsaExportMaterial.js +0 -1
- package/dist/esm/core/signingEngine/flows/recovery/passkeyEd25519YaoRecovery.js +1 -1
- package/dist/esm/core/signingEngine/flows/recovery/stepUpAuthorization.js +1 -1
- package/dist/esm/core/signingEngine/flows/registration/accountLifecycle.js +3 -8
- package/dist/esm/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.js +1 -2
- package/dist/esm/core/signingEngine/flows/shared/signingStateMachine.js +2 -5
- package/dist/esm/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.js +0 -2
- package/dist/esm/core/signingEngine/flows/signEvmFamily/signingFlow.js +1 -1
- package/dist/esm/core/signingEngine/flows/signEvmFamily/transactionExecutor.js +1 -2
- package/dist/esm/core/signingEngine/flows/signNear/implicitAccountFunding.js +1 -1
- package/dist/esm/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +33 -42
- package/dist/esm/core/signingEngine/flows/signNear/shared/signatureOnlySigning.js +0 -2
- package/dist/esm/core/signingEngine/flows/signNear/shared/signingMaterials.js +1 -7
- package/dist/esm/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.js +4 -14
- package/dist/esm/core/signingEngine/flows/signNear/signDelegate.js +2 -6
- package/dist/esm/core/signingEngine/flows/signNear/signNep413.js +2 -6
- package/dist/esm/core/signingEngine/nonce/NonceCoordinator.js +1 -1
- package/dist/esm/core/signingEngine/nonce/nearNonceLane.js +1 -1
- package/dist/esm/core/signingEngine/nonce/nonceDiagnostics.js +1 -1
- package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/poolFillRoutes.js +0 -1
- package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/presignaturePool.js +0 -1
- package/dist/esm/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.js +0 -3
- package/dist/esm/core/signingEngine/session/SigningSessionCoordinator.js +1 -4
- package/dist/esm/core/signingEngine/session/authority/authorityOperationResolver.js +17 -68
- package/dist/esm/core/signingEngine/session/emailOtp/EmailOtpWalletSessionCoordinator.js +0 -1
- package/dist/esm/core/signingEngine/session/emailOtp/ecdsaBootstrapCommit.js +1 -1
- package/dist/esm/core/signingEngine/session/emailOtp/ecdsaLifecycleRuntime.js +0 -3
- package/dist/esm/core/signingEngine/session/emailOtp/ecdsaLogin.js +1 -7
- package/dist/esm/core/signingEngine/session/emailOtp/ecdsaRecovery.js +10 -14
- package/dist/esm/core/signingEngine/session/emailOtp/ed25519ExportContext.js +0 -3
- package/dist/esm/core/signingEngine/session/emailOtp/exportRecovery.js +0 -2
- package/dist/esm/core/signingEngine/session/identity/clientSessionPersistenceState.js +5 -16
- package/dist/esm/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.js +0 -1
- package/dist/esm/core/signingEngine/session/identity/exactSigningLaneIdentity.js +1 -1
- package/dist/esm/core/signingEngine/session/identity/exactWalletSessionCredential.js +0 -2
- package/dist/esm/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.js +1 -2
- package/dist/esm/core/signingEngine/session/material/ecdsaCapabilityManifest.js +1 -1
- package/dist/esm/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.js +1 -14
- package/dist/esm/core/signingEngine/session/operationState/preparedOperation.js +1 -5
- package/dist/esm/core/signingEngine/session/passkey/ecdsaBootstrap.js +3 -6
- package/dist/esm/core/signingEngine/session/passkey/ecdsaKeyFactsInventory.js +0 -1
- package/dist/esm/core/signingEngine/session/passkey/ecdsaRecovery.js +1 -4
- package/dist/esm/core/signingEngine/session/passkey/ed25519SessionProvision.js +0 -1
- package/dist/esm/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.js +2 -3
- package/dist/esm/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.js +12 -45
- package/dist/esm/core/signingEngine/session/persistence/clientSessionPersistence.js +8 -16
- package/dist/esm/core/signingEngine/session/persistence/sealedSessionRecords.js +0 -2
- package/dist/esm/core/signingEngine/session/postconditions/runtimePostconditions.js +0 -2
- package/dist/esm/core/signingEngine/session/routerAbSigningWalletSession.js +2 -8
- package/dist/esm/core/signingEngine/session/warmCapabilities/readModel.js +2 -8
- package/dist/esm/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.js +1 -12
- package/dist/esm/core/signingEngine/session/warmCapabilities/transitions.js +7 -11
- package/dist/esm/core/signingEngine/stepUpConfirmation/otpPrompt/authLane.js +0 -1
- package/dist/esm/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.js +6 -30
- package/dist/esm/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.js +0 -3
- package/dist/esm/core/signingEngine/stepUpConfirmation/requireStepUpAuth.js +1 -5
- package/dist/esm/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.js +0 -3
- package/dist/esm/core/signingEngine/threshold/ecdsa/bootstrapSession.js +1 -5
- package/dist/esm/core/signingEngine/threshold/ed25519/walletSession.js +1 -1
- package/dist/esm/core/signingEngine/threshold/ed25519/yaoClient.js +1 -35
- package/dist/esm/core/signingEngine/threshold/sessionPolicy.js +0 -1
- package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +1 -4
- package/dist/esm/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +1 -1
- package/dist/esm/core/signingEngine/uiConfirm/UiConfirmManager.js +0 -1
- package/dist/esm/core/signingEngine/uiConfirm/handlers/flows/adapters/adapters.js +1 -1
- package/dist/esm/core/signingEngine/uiConfirm/handlers/flows/localOnly.js +0 -1
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +7 -0
- package/dist/esm/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.js +3 -13
- package/dist/esm/core/signingEngine/walletCustody/activateEd25519Capability.js +0 -1
- package/dist/esm/core/signingEngine/walletCustody/emailOtpLink.js +10 -13
- package/dist/esm/core/signingEngine/walletCustody/openCustodyCache.js +2 -6
- package/dist/esm/core/signingEngine/walletCustody/passkeyLink.js +7 -10
- package/dist/esm/core/signingEngine/walletCustody/registrationCeremony.js +0 -1
- package/dist/esm/core/signingEngine/walletCustody/walletRecoveryCredential.js +0 -1
- package/dist/esm/core/signingEngine/walletCustody/walletRecoveryEcdsa.js +0 -1
- package/dist/esm/core/signingEngine/walletCustody/walletRecoveryEd25519.js +1 -1
- package/dist/esm/core/signingEngine/walletCustody/walletRecoveryManifest.js +0 -2
- package/dist/esm/core/signingEngine/walletCustody/walletRecoveryRotation.js +0 -1
- package/dist/esm/core/signingEngine/webauthnAuth/walletOriginWebAuthn.js +109 -0
- package/dist/esm/core/signingEngine/workerManager/SignerWorkerManager.js +0 -2
- package/dist/esm/core/signingEngine/workerManager/ecdsaClientWorkerChannels.js +0 -4
- package/dist/esm/core/signingEngine/workerManager/validation.js +1 -1
- package/dist/esm/core/signingEngine/workerManager/workerTransport.js +3 -42
- package/dist/esm/core/signingEngine/workerManager/workerTypes.js +0 -2
- package/dist/esm/core/types/accountIds.js +0 -1
- package/dist/esm/core/types/sdkSentEvents.js +1 -2
- package/dist/esm/core/types/signer-worker.js +1 -36
- package/dist/esm/core/walletRuntimePaths/base.js +11 -1
- package/dist/esm/plugins/headers.js +0 -1
- package/dist/esm/plugins/next.js +0 -1
- package/dist/esm/plugins/plugin-utils.js +0 -1
- package/dist/esm/plugins/shared-ts/src/utils/normalize.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/AccountsSection.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/ExportKeysSection.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +4 -4
- package/dist/esm/react/components/AccountMenuButton/LockMenuItem.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.css +8 -0
- package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +14 -6
- package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/index.js +5 -5
- package/dist/esm/react/components/HostedSeamsAuthMenu/SeamsAuthMenuMock.js +1 -1
- package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +1 -1
- package/dist/esm/react/components/QRCodeScanner.js +2 -2
- package/dist/esm/react/components/ShowQRCode.js +4 -4
- package/dist/esm/react/components/theme/design-tokens.js +1 -2
- package/dist/esm/react/context/index.js +1 -1
- package/dist/esm/react/context/reactLoginStateBuilders.js +1 -1
- package/dist/esm/react/context/seamsManagerSingleton.js +2 -2
- package/dist/esm/react/context/useLoginStateRefresher.js +2 -5
- package/dist/esm/react/context/useSeamsContextValue.js +1 -1
- package/dist/esm/react/context/useSeamsWithSdkFlow.js +1 -1
- package/dist/esm/react/context/useWalletIframeLifecycle.js +1 -1
- package/dist/esm/react/hooks/useAccountInput.js +4 -4
- package/dist/esm/react/hooks/useNearClient.js +3 -3
- package/dist/esm/react/hooks/usePreconnectWalletAssets.js +1 -1
- package/dist/esm/react/hooks/useQRCamera.js +2 -2
- package/dist/esm/react/hooks/useWallet.js +1 -1
- package/dist/esm/react/index.js +10 -10
- package/dist/esm/react/styles/styles.css +8 -0
- package/dist/esm/react/transactionReview/TransactionReviewHost.js +1 -1
- package/dist/esm/react/transactionReview/boundCalls.js +2 -2
- package/dist/esm/react/transactionReview/contract.js +1 -1
- package/dist/esm/react/transactionReview/controller.js +2 -2
- package/dist/esm/react/transactionReview/snapshot.js +2 -2
- package/dist/esm/sdk/ConfirmationDrawer-DrsREojk.js +1 -0
- package/dist/esm/sdk/EvmClient-DoxytQaJ.js +1 -0
- package/dist/esm/sdk/NearClient-vJ65Wjrq.js +1 -0
- package/dist/esm/sdk/NonceCoordinator-BBeadCSq.js +1 -0
- package/dist/esm/sdk/accountIds-C3Ihsd2c.js +1 -0
- package/dist/esm/sdk/accountLifecycle-EyfYPnuT.js +1 -0
- package/dist/esm/sdk/actions-DZLxCcrU.js +1 -0
- package/dist/esm/sdk/adapters-DtAyuoiA.js +2 -0
- package/dist/esm/sdk/base-Xtd32asf.js +1 -0
- package/dist/esm/sdk/base64-ojm5DKcF.js +1 -0
- package/dist/esm/sdk/browser-CsOGMbMy.js +8 -0
- package/dist/esm/sdk/bytes-t5S5mkat.js +1 -0
- package/dist/esm/sdk/canonicalPrimitives-MPGET2cl.js +1 -0
- package/dist/esm/sdk/canonicalSignerErrorCode-C0hh_SVi.js +1 -0
- package/dist/esm/sdk/capabilityKinds-XaXXiD2B.js +1 -0
- package/dist/esm/sdk/chains-yAls2d9X.js +1 -0
- package/dist/esm/sdk/challengeDelivery-cAsaUC6U.js +1 -0
- package/dist/esm/sdk/chunk-dVx5-UGu.js +1 -0
- package/dist/esm/sdk/configHelpers-CseiVoZD.js +1 -0
- package/dist/esm/sdk/csp-stylesheet-B1fAhrGB.js +2 -0
- package/dist/esm/sdk/defaultConfigs-CWpApkMq.js +1 -0
- package/dist/esm/sdk/display-jK7_hYho.js +1 -0
- package/dist/esm/sdk/domainIds-GDzjOs6i.js +1 -0
- package/dist/esm/sdk/ecdsaCapabilityManifest-CHFu-QrV.js +1 -0
- package/dist/esm/sdk/ecdsaChainTarget-CRcRR78w.js +1 -0
- package/dist/esm/sdk/ecdsaPresignLifecycle-CQnCxSlq.js +1 -0
- package/dist/esm/sdk/ecdsaPresignPoolIdentity-Ci-ovDlv.js +1 -0
- package/dist/esm/sdk/ecdsaWalletRecords-Cm1DdexN.js +1 -0
- package/dist/esm/sdk/enrichDisplayModelWithAbi-CR-4ebuU.js +1 -0
- package/dist/esm/sdk/enrichDisplayModelWithAbi-CwHKFqF4.js +569 -0
- package/dist/esm/sdk/errors-DfbnsXjO.js +1 -0
- package/dist/esm/sdk/events-BJyVcnsn.js +1 -0
- package/dist/esm/sdk/evmCryptoWasm-CwEXiLrC.js +1 -0
- package/dist/esm/sdk/evmFamilyEcdsaIdentity-Br3iFdQx.js +1 -0
- package/dist/esm/sdk/exactSessionState-CjD8gekO.js +210 -0
- package/dist/esm/sdk/exactSigningLaneIdentity-olheZx_n.js +1 -0
- package/dist/esm/sdk/executeWorkerOperation-CrFf3FkL.js +1 -0
- package/dist/esm/sdk/export-viewer-host-jo7h_0wl.js +1 -0
- package/dist/esm/sdk/helpers-D4QckQhq.js +1 -0
- package/dist/esm/sdk/host-BAqOYnju.js +1 -0
- package/dist/esm/sdk/intentDigest-CB6zy3lN.js +1 -0
- package/dist/esm/sdk/jsonRpc-C85RYR0A.js +1 -0
- package/dist/esm/sdk/jsxRuntime.module-CoHsKD_3.js +1 -0
- package/dist/esm/sdk/keccak-zexutGfG.js +1 -0
- package/dist/esm/sdk/keyMaterialBrands-uVZHfAh3.js +1 -0
- package/dist/esm/sdk/localOnly-DBQRG6Qh.js +1 -0
- package/dist/esm/sdk/messages-Cv2j4SKI.js +1 -0
- package/dist/esm/sdk/mountExportPrivateKeySurface-G7Z_9JMQ.js +1 -0
- package/dist/esm/sdk/mountRecoveryCodeBackupSurface-BBCTaQsu.js +2 -0
- package/dist/esm/sdk/nearEd25519YaoMaterialActivation-DQIw8ho3.js +1 -0
- package/dist/esm/sdk/nearEd25519YaoSigningPreparation-Bp_CvWRz.js +1 -0
- package/dist/esm/sdk/nearRpcResults--cBcfmp4.js +1 -0
- package/dist/esm/sdk/nonceLaneKeys-BBYi4g51.js +1 -0
- package/dist/esm/sdk/normalization-BGPR6osg.js +1 -0
- package/dist/esm/sdk/operationFingerprint-5-wH2Ht8.js +1 -0
- package/dist/esm/sdk/operationFingerprint-DtQb0pdp.js +1 -0
- package/dist/esm/sdk/passkey-custody-LP4UTFbn.js +1 -0
- package/dist/esm/sdk/pendingWalletRecoveryCodeBackup-BNk4ebsY.js +1 -0
- package/dist/esm/sdk/prfCache-Mbo7_USg.js +1 -0
- package/dist/esm/sdk/profileAccountProjection-DHCaMtOu.js +1 -0
- package/dist/esm/sdk/promptText-s8TQ6ckX.js +1 -0
- package/dist/esm/sdk/recovery-entrypoint-DkT8sFO5.js +1 -0
- package/dist/esm/sdk/registration-Btozh7uh.js +1 -0
- package/dist/esm/sdk/registration-CSAG_h4Y.js +1 -0
- package/dist/esm/sdk/registrationAccounts-DIeEVy6W.js +1 -0
- package/dist/esm/sdk/registrationIds-BIel5S0i.js +1 -0
- package/dist/esm/sdk/registrationIntent-DV1GYZ3K.js +1 -0
- package/dist/esm/sdk/registrationPreparationPreload-vOCqNuG4.js +1 -0
- package/dist/esm/sdk/registrationSignerPlan-FzD3TwxB.js +1 -0
- package/dist/esm/sdk/relayerHttp-DaPeS929.js +1 -0
- package/dist/esm/sdk/routePlan-B_KJaPtm.js +1 -0
- package/dist/esm/sdk/router-Dd3fFHk3.js +1 -0
- package/dist/esm/sdk/routerAbNormalSigning-D_fHjq5l.js +1 -0
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/esm/sdk/runtime-auth-B2M91rSx.js +1 -0
- package/dist/esm/sdk/runtime-device-link-ojjPSRaG.js +1 -0
- package/dist/esm/sdk/runtime-ecdsa-tempo-CE4JLgmn.js +1 -0
- package/dist/esm/sdk/runtime-email-otp-DDwtKVAe.js +1 -0
- package/dist/esm/sdk/runtime-export-JXYk8sQ-.js +1 -0
- package/dist/esm/sdk/runtime-near-BB8AG6dV.js +1 -0
- package/dist/esm/sdk/runtime-preferences-DKFZYccW.js +1 -0
- package/dist/esm/sdk/runtime-recovery-C_XjsDBg.js +1 -0
- package/dist/esm/sdk/runtime-recovery-codes-CWp839mH.js +1 -0
- package/dist/esm/sdk/runtimeContext-BpObgzbj.js +6 -0
- package/dist/esm/sdk/runtimeLoader-DjgBf_yF.js +1 -0
- package/dist/esm/sdk/sdkSentEvents-_RGAEeld.js +1 -0
- package/dist/esm/sdk/secp256k1-B_6W9QDJ.js +1 -0
- package/dist/esm/sdk/secureRandomId-CTdlJ5Mx.js +1 -0
- package/dist/esm/sdk/sessionPolicy-CNVK7nJ6.js +1 -0
- package/dist/esm/sdk/shared-j_KsFbCT.js +1 -0
- package/dist/esm/sdk/signEvmFamily-CcLVBm0f.js +1 -0
- package/dist/esm/sdk/signEvmFamilyWithUiConfirmForTempo-DgTbh6jX.js +1 -0
- package/dist/esm/sdk/signEvmWithUiConfirm-ChreN7aZ.js +1 -0
- package/dist/esm/sdk/signNear-mWbTE2Dl.js +1 -0
- package/dist/esm/sdk/signatureUses-CQkkUcwT.js +1 -0
- package/dist/esm/sdk/signerDomain-BhUTzDmF.js +1 -0
- package/dist/esm/sdk/signerLoader-By0IY24G.js +1 -0
- package/dist/esm/sdk/signerSlot-BQ1g5JNV.js +1 -0
- package/dist/esm/sdk/signingFlow-LUWrZi2d.js +2 -0
- package/dist/esm/sdk/signingSessionSeal-Mr2Xp44o.js +1 -0
- package/dist/esm/sdk/surface-measurement-reporter-OICExWKE.js +1 -0
- package/dist/esm/sdk/trace-M34pNGuF.js +1 -0
- package/dist/esm/sdk/transaction-activity-BbDod7ji.js +1 -0
- package/dist/esm/sdk/transactionReview-CBE5oH4c.js +1 -0
- package/dist/esm/sdk/transactionReviewAdmission-0ZgWs6q3.js +1 -0
- package/dist/esm/sdk/transactionState-9d7f3xVj.js +1 -0
- package/dist/esm/sdk/tx-confirm-ui.js +12 -158
- package/dist/esm/sdk/types-M7vxrYtJ.js +1 -0
- package/dist/esm/sdk/validation-dC1-_uyG.js +1 -0
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -13
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -6
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -13
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -4
- package/dist/esm/sdk/wallet-recovery-CcDZ1hMH.js +1 -0
- package/dist/esm/sdk/wallet-ui.css +1 -5874
- package/dist/esm/sdk/walletAuthority-CoWSeqvQ.js +1 -0
- package/dist/esm/sdk/walletCustodyEcdsaContinuity-B7xi7nwh.js +1 -0
- package/dist/esm/sdk/walletIframeIdentity-C0b0XMQF.js +1 -0
- package/dist/esm/sdk/walletRecoveryCommit-ljxVeo-d.js +1 -0
- package/dist/esm/sdk/walletRecoveryRotate-HztDcDaY.js +1 -0
- package/dist/esm/sdk/warmSessionHydration-BPGM0YRU.js +1 -0
- package/dist/esm/sdk/webauthnP256-qu06GNFm.js +1 -0
- package/dist/esm/sdk/webauthnPromptCoordinator-DO-qfECu.js +1 -0
- package/dist/esm/shared-ts/src/device-linking/parsers.js +41 -1
- package/dist/esm/shared-ts/src/device-linking/sourceContribution.js +1 -1
- package/dist/esm/shared-ts/src/near/actions.js +10 -1
- package/dist/esm/shared-ts/src/near/nearClient.js +0 -2
- package/dist/esm/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.js +1 -1
- package/dist/esm/shared-ts/src/signing-lanes/index.js +1 -4
- package/dist/esm/shared-ts/src/signing-lanes/ownerContinuity.js +0 -1
- package/dist/esm/shared-ts/src/signing-lanes/participantDigest.js +0 -1
- package/dist/esm/shared-ts/src/signing-lanes/participants.js +1 -1
- package/dist/esm/shared-ts/src/signing-lanes/recordParsers.js +1 -1
- package/dist/esm/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js +0 -1
- package/dist/esm/shared-ts/src/threshold/participants.js +0 -1
- package/dist/esm/shared-ts/src/threshold/signingRootScope.js +0 -1
- package/dist/esm/shared-ts/src/utils/domainIds.js +1 -7
- package/dist/esm/shared-ts/src/utils/ecdsaKeyFactsInventory.js +0 -1
- package/dist/esm/shared-ts/src/utils/encoders.js +1 -1
- package/dist/esm/shared-ts/src/utils/errors.js +0 -1
- package/dist/esm/shared-ts/src/utils/index.js +4 -5
- package/dist/esm/shared-ts/src/utils/registrationEstablishedSession.js +1 -1
- package/dist/esm/shared-ts/src/utils/registrationIds.js +1 -5
- package/dist/esm/shared-ts/src/utils/registrationIntent.js +0 -1
- package/dist/esm/shared-ts/src/utils/registrationSetupOperation.js +12 -0
- package/dist/esm/shared-ts/src/utils/registrationSignerPlan.js +1 -1
- package/dist/esm/shared-ts/src/utils/routerAbEcdsaDerivation.js +1 -2
- package/dist/esm/shared-ts/src/utils/validation.js +0 -1
- package/dist/esm/shared-ts/src/utils/walletAuthAuthority.js +0 -1
- package/dist/esm/shared-ts/src/utils/walletCapabilityBindings.js +10 -1
- package/dist/esm/shared-ts/src/utils/walletManagementProtocol.js +6 -0
- package/dist/esm/shared-ts/src/wallet-recovery/index.js +1 -1
- package/dist/esm/shared-ts/src/wallet-recovery/recoveryCodeLocator.js +0 -1
- package/dist/esm/shared-ts/src/wallet-recovery/recoveryKeyId.js +0 -2
- package/dist/esm/theme/base-styles.js +11 -11
- package/dist/esm/utils/deviceDetection.js +16 -1
- package/dist/esm/utils/qrScanner.js +288 -0
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.d.ts +12 -753
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker.js +126 -3701
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client.d.ts +0 -42
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client.js +2 -106
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client.d.ts +3 -158
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client.js +2 -452
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/ConfirmationDrawer-DrsREojk.js +1 -0
- package/dist/public/sdk/EvmClient-DoxytQaJ.js +1 -0
- package/dist/public/sdk/NearClient-vJ65Wjrq.js +1 -0
- package/dist/public/sdk/NonceCoordinator-BBeadCSq.js +1 -0
- package/dist/public/sdk/accountIds-C3Ihsd2c.js +1 -0
- package/dist/public/sdk/accountLifecycle-EyfYPnuT.js +1 -0
- package/dist/public/sdk/actions-DZLxCcrU.js +1 -0
- package/dist/public/sdk/adapters-DtAyuoiA.js +2 -0
- package/dist/public/sdk/base-Xtd32asf.js +1 -0
- package/dist/public/sdk/base64-ojm5DKcF.js +1 -0
- package/dist/public/sdk/browser-CsOGMbMy.js +8 -0
- package/dist/public/sdk/bytes-t5S5mkat.js +1 -0
- package/dist/public/sdk/canonicalPrimitives-MPGET2cl.js +1 -0
- package/dist/public/sdk/canonicalSignerErrorCode-C0hh_SVi.js +1 -0
- package/dist/public/sdk/capabilityKinds-XaXXiD2B.js +1 -0
- package/dist/public/sdk/chains-yAls2d9X.js +1 -0
- package/dist/public/sdk/challengeDelivery-cAsaUC6U.js +1 -0
- package/dist/public/sdk/chunk-dVx5-UGu.js +1 -0
- package/dist/public/sdk/configHelpers-CseiVoZD.js +1 -0
- package/dist/public/sdk/csp-stylesheet-B1fAhrGB.js +2 -0
- package/dist/public/sdk/defaultConfigs-CWpApkMq.js +1 -0
- package/dist/public/sdk/display-jK7_hYho.js +1 -0
- package/dist/public/sdk/domainIds-GDzjOs6i.js +1 -0
- package/dist/public/sdk/ecdsaCapabilityManifest-CHFu-QrV.js +1 -0
- package/dist/public/sdk/ecdsaChainTarget-CRcRR78w.js +1 -0
- package/dist/public/sdk/ecdsaPresignLifecycle-CQnCxSlq.js +1 -0
- package/dist/public/sdk/ecdsaPresignPoolIdentity-Ci-ovDlv.js +1 -0
- package/dist/public/sdk/ecdsaWalletRecords-Cm1DdexN.js +1 -0
- package/dist/public/sdk/enrichDisplayModelWithAbi-CR-4ebuU.js +1 -0
- package/dist/public/sdk/enrichDisplayModelWithAbi-CwHKFqF4.js +569 -0
- package/dist/public/sdk/errors-DfbnsXjO.js +1 -0
- package/dist/public/sdk/events-BJyVcnsn.js +1 -0
- package/dist/public/sdk/evmCryptoWasm-CwEXiLrC.js +1 -0
- package/dist/public/sdk/evmFamilyEcdsaIdentity-Br3iFdQx.js +1 -0
- package/dist/public/sdk/exactSessionState-CjD8gekO.js +210 -0
- package/dist/public/sdk/exactSigningLaneIdentity-olheZx_n.js +1 -0
- package/dist/public/sdk/executeWorkerOperation-CrFf3FkL.js +1 -0
- package/dist/public/sdk/export-viewer-host-jo7h_0wl.js +1 -0
- package/dist/public/sdk/helpers-D4QckQhq.js +1 -0
- package/dist/public/sdk/host-BAqOYnju.js +1 -0
- package/dist/public/sdk/intentDigest-CB6zy3lN.js +1 -0
- package/dist/public/sdk/jsonRpc-C85RYR0A.js +1 -0
- package/dist/public/sdk/jsxRuntime.module-CoHsKD_3.js +1 -0
- package/dist/public/sdk/keccak-zexutGfG.js +1 -0
- package/dist/public/sdk/keyMaterialBrands-uVZHfAh3.js +1 -0
- package/dist/public/sdk/localOnly-DBQRG6Qh.js +1 -0
- package/dist/public/sdk/messages-Cv2j4SKI.js +1 -0
- package/dist/public/sdk/mountExportPrivateKeySurface-G7Z_9JMQ.js +1 -0
- package/dist/public/sdk/mountRecoveryCodeBackupSurface-BBCTaQsu.js +2 -0
- package/dist/public/sdk/nearEd25519YaoMaterialActivation-DQIw8ho3.js +1 -0
- package/dist/public/sdk/nearEd25519YaoSigningPreparation-Bp_CvWRz.js +1 -0
- package/dist/public/sdk/nearRpcResults--cBcfmp4.js +1 -0
- package/dist/public/sdk/nonceLaneKeys-BBYi4g51.js +1 -0
- package/dist/public/sdk/normalization-BGPR6osg.js +1 -0
- package/dist/public/sdk/operationFingerprint-5-wH2Ht8.js +1 -0
- package/dist/public/sdk/operationFingerprint-DtQb0pdp.js +1 -0
- package/dist/public/sdk/passkey-custody-LP4UTFbn.js +1 -0
- package/dist/public/sdk/pendingWalletRecoveryCodeBackup-BNk4ebsY.js +1 -0
- package/dist/public/sdk/prfCache-Mbo7_USg.js +1 -0
- package/dist/public/sdk/profileAccountProjection-DHCaMtOu.js +1 -0
- package/dist/public/sdk/promptText-s8TQ6ckX.js +1 -0
- package/dist/public/sdk/recovery-entrypoint-DkT8sFO5.js +1 -0
- package/dist/public/sdk/registration-Btozh7uh.js +1 -0
- package/dist/public/sdk/registration-CSAG_h4Y.js +1 -0
- package/dist/public/sdk/registrationAccounts-DIeEVy6W.js +1 -0
- package/dist/public/sdk/registrationIds-BIel5S0i.js +1 -0
- package/dist/public/sdk/registrationIntent-DV1GYZ3K.js +1 -0
- package/dist/public/sdk/registrationPreparationPreload-vOCqNuG4.js +1 -0
- package/dist/public/sdk/registrationSignerPlan-FzD3TwxB.js +1 -0
- package/dist/public/sdk/relayerHttp-DaPeS929.js +1 -0
- package/dist/public/sdk/routePlan-B_KJaPtm.js +1 -0
- package/dist/public/sdk/router-Dd3fFHk3.js +1 -0
- package/dist/public/sdk/routerAbNormalSigning-D_fHjq5l.js +1 -0
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/runtime-auth-B2M91rSx.js +1 -0
- package/dist/public/sdk/runtime-device-link-ojjPSRaG.js +1 -0
- package/dist/public/sdk/runtime-ecdsa-tempo-CE4JLgmn.js +1 -0
- package/dist/public/sdk/runtime-email-otp-DDwtKVAe.js +1 -0
- package/dist/public/sdk/runtime-export-JXYk8sQ-.js +1 -0
- package/dist/public/sdk/runtime-near-BB8AG6dV.js +1 -0
- package/dist/public/sdk/runtime-preferences-DKFZYccW.js +1 -0
- package/dist/public/sdk/runtime-recovery-C_XjsDBg.js +1 -0
- package/dist/public/sdk/runtime-recovery-codes-CWp839mH.js +1 -0
- package/dist/public/sdk/runtimeContext-BpObgzbj.js +6 -0
- package/dist/public/sdk/runtimeLoader-DjgBf_yF.js +1 -0
- package/dist/public/sdk/sdkSentEvents-_RGAEeld.js +1 -0
- package/dist/public/sdk/secp256k1-B_6W9QDJ.js +1 -0
- package/dist/public/sdk/secureRandomId-CTdlJ5Mx.js +1 -0
- package/dist/public/sdk/sessionPolicy-CNVK7nJ6.js +1 -0
- package/dist/public/sdk/shared-j_KsFbCT.js +1 -0
- package/dist/public/sdk/signEvmFamily-CcLVBm0f.js +1 -0
- package/dist/public/sdk/signEvmFamilyWithUiConfirmForTempo-DgTbh6jX.js +1 -0
- package/dist/public/sdk/signEvmWithUiConfirm-ChreN7aZ.js +1 -0
- package/dist/public/sdk/signNear-mWbTE2Dl.js +1 -0
- package/dist/public/sdk/signatureUses-CQkkUcwT.js +1 -0
- package/dist/public/sdk/signerDomain-BhUTzDmF.js +1 -0
- package/dist/public/sdk/signerLoader-By0IY24G.js +1 -0
- package/dist/public/sdk/signerSlot-BQ1g5JNV.js +1 -0
- package/dist/public/sdk/signingFlow-LUWrZi2d.js +2 -0
- package/dist/public/sdk/signingSessionSeal-Mr2Xp44o.js +1 -0
- package/dist/public/sdk/surface-measurement-reporter-OICExWKE.js +1 -0
- package/dist/public/sdk/trace-M34pNGuF.js +1 -0
- package/dist/public/sdk/transaction-activity-BbDod7ji.js +1 -0
- package/dist/public/sdk/transactionReview-CBE5oH4c.js +1 -0
- package/dist/public/sdk/transactionReviewAdmission-0ZgWs6q3.js +1 -0
- package/dist/public/sdk/transactionState-9d7f3xVj.js +1 -0
- package/dist/public/sdk/tx-confirm-ui.js +12 -158
- package/dist/public/sdk/types-M7vxrYtJ.js +1 -0
- package/dist/public/sdk/validation-dC1-_uyG.js +1 -0
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -13
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -6
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -13
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -4
- package/dist/public/sdk/wallet-recovery-CcDZ1hMH.js +1 -0
- package/dist/public/sdk/wallet-ui.css +1 -5874
- package/dist/public/sdk/walletAuthority-CoWSeqvQ.js +1 -0
- package/dist/public/sdk/walletCustodyEcdsaContinuity-B7xi7nwh.js +1 -0
- package/dist/public/sdk/walletIframeIdentity-C0b0XMQF.js +1 -0
- package/dist/public/sdk/walletRecoveryCommit-ljxVeo-d.js +1 -0
- package/dist/public/sdk/walletRecoveryRotate-HztDcDaY.js +1 -0
- package/dist/public/sdk/warmSessionHydration-BPGM0YRU.js +1 -0
- package/dist/public/sdk/webauthnP256-qu06GNFm.js +1 -0
- package/dist/public/sdk/webauthnPromptCoordinator-DO-qfECu.js +1 -0
- package/dist/public/sdk/workers/device-linking-key.worker.js +387 -1952
- package/dist/public/sdk/workers/ecdsa-derivation-client.worker.js +1523 -2668
- package/dist/public/sdk/workers/ecdsa-online-client.worker.js +1 -273
- package/dist/public/sdk/workers/ecdsa-presign-client.worker.js +1 -273
- package/dist/public/sdk/workers/email-otp.worker.js +228 -2103
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm-crypto.worker.js +0 -188
- package/dist/public/sdk/workers/evm_crypto.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- package/dist/public/sdk/workers/near-signer.worker.js +16 -718
- package/dist/public/sdk/workers/near_signer.wasm +0 -0
- package/dist/public/sdk/workers/passkey-confirm.worker.js +0 -134
- package/dist/public/sdk/workers/passkey-mpc-export.worker.js +149 -506
- package/dist/public/sdk/workers/passkey-mpc-session.worker.js +0 -134
- package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/shamir3pass.worker.js +0 -134
- package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo-signer.worker.js +0 -134
- package/dist/public/sdk/workers/tempo_signer.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- package/dist/public/sdk/workers/wallet-custody-ceremony.worker.js +135 -1635
- package/dist/public/sdk/workers/wallet_custody_ceremony.js +0 -14
- package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
- package/dist/public/wallet-assets.manifest.json +234 -258
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/shared-ts/src/authorization/capabilityKinds.d.ts +0 -4
- package/dist/types/shared-ts/src/device-linking/contracts.d.ts +1 -0
- package/dist/types/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/execution.d.ts +0 -11
- package/dist/types/shared-ts/src/signing-lanes/ids.d.ts +2 -7
- package/dist/types/shared-ts/src/signing-lanes/index.d.ts +0 -4
- package/dist/types/shared-ts/src/signing-lanes/ownerContinuity.d.ts +0 -1
- package/dist/types/shared-ts/src/signing-lanes/participantDigest.d.ts +0 -18
- package/dist/types/shared-ts/src/signing-lanes/participants.d.ts +6 -35
- package/dist/types/shared-ts/src/signing-lanes/rotation.d.ts +6 -843
- package/dist/types/shared-ts/src/threshold/keyMaterialBrands.d.ts +0 -10
- package/dist/types/shared-ts/src/threshold/participants.d.ts +1 -1
- package/dist/types/shared-ts/src/utils/addWalletAuthMethod.d.ts +1 -133
- package/dist/types/shared-ts/src/utils/addWalletAuthMethod.typecheck.d.ts +4 -18
- package/dist/types/shared-ts/src/utils/domainIds.d.ts +0 -12
- package/dist/types/shared-ts/src/utils/errors.d.ts +0 -4
- package/dist/types/shared-ts/src/utils/near.d.ts +0 -20
- package/dist/types/shared-ts/src/utils/normalize.d.ts +0 -2
- package/dist/types/shared-ts/src/utils/registrationSetupOperation.d.ts +3 -0
- package/dist/types/shared-ts/src/utils/validation.d.ts +1 -3
- package/dist/types/shared-ts/src/utils/walletCapabilityBindings.d.ts +0 -1
- package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +3 -0
- package/dist/types/shared-ts/src/utils/wireSchema.d.ts +0 -2
- package/dist/types/shared-ts/src/wallet-recovery/backupAcknowledgement.d.ts +0 -1
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeReservation.d.ts +1 -10
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodes.d.ts +1 -3
- package/dist/types/shared-ts/src/wallet-recovery/recoveryKeyId.d.ts +5 -21
- package/dist/types/wallet/src/SeamsWeb/operations/auth/walletUnlockEcdsaSubject.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/operations/auth/walletUnlockSubject.d.ts +0 -3
- package/dist/types/wallet/src/SeamsWeb/operations/authMethods/emailOtp/challenge.d.ts +0 -4
- package/dist/types/wallet/src/SeamsWeb/operations/devices/deviceLinkingResume.d.ts +0 -1
- package/dist/types/wallet/src/SeamsWeb/operations/devices/linkDeviceFlow.d.ts +2 -0
- package/dist/types/wallet/src/SeamsWeb/operations/registration/pendingRegistrationRecovery.d.ts +0 -10
- package/dist/types/wallet/src/SeamsWeb/operations/session/thresholdEcdsaProvisioning.d.ts +1 -2
- package/dist/types/wallet/src/SeamsWeb/signingSurface/ports.d.ts +0 -2
- package/dist/types/wallet/src/SeamsWeb/signingSurface/types.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/surface/domain.d.ts +0 -8
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.d.ts +1 -2
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +9 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/hostedWalletSeamsSession.d.ts +0 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.d.ts +17 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +11 -3
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/icons.d.ts +15 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/exactSessionReconciliation.d.ts +3 -3
- package/dist/types/wallet/src/advanced.d.ts +1 -1
- package/dist/types/wallet/src/core/browser/walletIframe/events.d.ts +0 -2
- package/dist/types/wallet/src/core/indexedDB/index.d.ts +3 -5
- package/dist/types/wallet/src/core/indexedDB/passkeyClientDB.types.d.ts +0 -30
- package/dist/types/wallet/src/core/indexedDB/pendingWalletRecoveryCommit.d.ts +1 -4
- package/dist/types/wallet/src/core/indexedDB/schemaNames.d.ts +0 -22
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.d.ts +1 -1
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.d.ts +1 -1
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.d.ts +0 -1
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/registrationSetup.d.ts +42 -0
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/signingSessionSeals.d.ts +1 -5
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.d.ts +5 -1
- package/dist/types/wallet/src/core/indexedDB/unifiedIndexedDBManager.d.ts +1 -0
- package/dist/types/wallet/src/core/platform/browser/createBrowserPlatformRuntime.d.ts +1 -6
- package/dist/types/wallet/src/core/platform/ecdsaRoleLocalRecords.d.ts +0 -15
- package/dist/types/wallet/src/core/platform/index.d.ts +4 -4
- package/dist/types/wallet/src/core/platform/ports.d.ts +1 -51
- package/dist/types/wallet/src/core/platform/runtime.d.ts +0 -2
- package/dist/types/wallet/src/core/platform/secretSources.d.ts +0 -29
- package/dist/types/wallet/src/core/rpcClients/near/NearClient.d.ts +1 -1
- package/dist/types/wallet/src/core/rpcClients/relayer/passkeyCustodyEnvelope.d.ts +0 -6
- package/dist/types/wallet/src/core/rpcClients/relayer/thresholdEcdsa.d.ts +0 -1
- package/dist/types/wallet/src/core/rpcClients/relayer/walletRegistration.d.ts +2 -19
- package/dist/types/wallet/src/core/signingEngine/assembly/ports/shared.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/assembly/ports/warmSigning.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/assembly/warmup.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/chains/near/nearSignerWasm.d.ts +0 -10
- package/dist/types/wallet/src/core/signingEngine/flows/recovery/keyExportConfirmation.d.ts +0 -15
- package/dist/types/wallet/src/core/signingEngine/flows/registration/accountLifecycle.d.ts +1 -11
- package/dist/types/wallet/src/core/signingEngine/flows/registration/public.d.ts +1 -9
- package/dist/types/wallet/src/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/flows/shared/signingStateMachine.d.ts +0 -6
- package/dist/types/wallet/src/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.d.ts +2 -10
- package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/ed25519YaoCapabilityResolution.d.ts +1 -4
- package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.d.ts +0 -5
- package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/signingMaterials.d.ts +0 -4
- package/dist/types/wallet/src/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.d.ts +0 -9
- package/dist/types/wallet/src/core/signingEngine/interfaces/index.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/nonce/NonceCoordinator.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/nonce/nonceTypes.d.ts +0 -9
- package/dist/types/wallet/src/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/authority/authorityOperationResolver.d.ts +1 -24
- package/dist/types/wallet/src/core/signingEngine/session/availability/readiness.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ecdsaLogin.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ecdsaRecovery.d.ts +0 -5
- package/dist/types/wallet/src/core/signingEngine/session/emailOtp/ed25519ExportContext.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/session/emailOtp/secretEscrow.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/session/identity/clientSessionPersistenceState.d.ts +0 -6
- package/dist/types/wallet/src/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/identity/exactSigningLaneIdentity.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/identity/exactWalletSessionCredential.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/identity/laneIdentity.d.ts +0 -6
- package/dist/types/wallet/src/core/signingEngine/session/identity/walletUnlockSubject.d.ts +0 -8
- package/dist/types/wallet/src/core/signingEngine/session/keyMaterialBrands.d.ts +1 -4
- package/dist/types/wallet/src/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/session/operationState/authorizationAdmission.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/session/operationState/preparedOperation.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/persistence/ecdsaRoleLocalRecords.d.ts +1 -10
- package/dist/types/wallet/src/core/signingEngine/session/persistence/sealedSessionRecords.d.ts +2 -2
- package/dist/types/wallet/src/core/signingEngine/session/persistence/sealedSessionTransportAuth.d.ts +0 -5
- package/dist/types/wallet/src/core/signingEngine/session/postconditions/runtimePostconditions.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/routerAbSigningWalletSession.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.d.ts +0 -105
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/public.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.d.ts +0 -12
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/transitions.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/types.typecheck.d.ts +1 -10
- package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/methodRunners.d.ts +1 -5
- package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.d.ts +1 -2
- package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/requireStepUpAuth.d.ts +1 -19
- package/dist/types/wallet/src/core/signingEngine/stepUpConfirmation/types.d.ts +0 -10
- package/dist/types/wallet/src/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.d.ts +1 -15
- package/dist/types/wallet/src/core/signingEngine/threshold/ecdsa/activation.d.ts +0 -4
- package/dist/types/wallet/src/core/signingEngine/threshold/ecdsa/bootstrapSession.d.ts +0 -4
- package/dist/types/wallet/src/core/signingEngine/threshold/ed25519/connectSession.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/threshold/ed25519/yaoClient.d.ts +1 -8
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/handlers/flows/requestRegistrationCredentialConfirmation.d.ts +1 -4
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/walletCustody/emailOtpLink.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/walletCustody/openCustodyCache.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/walletCustody/passkeyLink.d.ts +0 -3
- package/dist/types/wallet/src/core/signingEngine/walletCustody/registrationCeremony.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/webauthnAuth/walletOriginWebAuthn.d.ts +8 -0
- package/dist/types/wallet/src/core/signingEngine/workerManager/SignerWorkerManager.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/workerManager/ecdsaClientWorkerChannels.d.ts +0 -8
- package/dist/types/wallet/src/core/signingEngine/workerManager/validation.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/workerManager/workerTypes.d.ts +6 -109
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/device-linking-key/requests.d.ts +0 -5
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/crypto.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/custodyRestore.d.ts +0 -8
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/otpVerification.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/payloadParsing.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/unlock.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/near-signer.worker.d.ts +3 -31
- package/dist/types/wallet/src/core/types/accountIds.d.ts +1 -1
- package/dist/types/wallet/src/core/types/index.d.ts +0 -18
- package/dist/types/wallet/src/core/types/sdkSentEvents.d.ts +1 -2
- package/dist/types/wallet/src/core/types/secure-confirm-worker.d.ts +0 -5
- package/dist/types/wallet/src/core/types/signer-worker.d.ts +75 -134
- package/dist/types/wallet/src/react/components/AccountMenuButton/Toggle.d.ts +0 -15
- package/dist/types/wallet/src/react/components/theme/design-tokens.d.ts +0 -19
- package/dist/types/wallet/src/utils/qrScanner.d.ts +1 -21
- package/dist/workers/device-linking-key.worker.js +387 -1952
- package/dist/workers/ecdsa-derivation-client.worker.js +1523 -2668
- package/dist/workers/ecdsa-online-client.worker.js +1 -273
- package/dist/workers/ecdsa-presign-client.worker.js +1 -273
- package/dist/workers/email-otp.worker.js +228 -2103
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm-crypto.worker.js +0 -188
- package/dist/workers/evm_crypto.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- package/dist/workers/near-signer.worker.js +16 -718
- package/dist/workers/near_signer.wasm +0 -0
- package/dist/workers/passkey-confirm.worker.js +0 -134
- package/dist/workers/passkey-mpc-export.worker.js +149 -506
- package/dist/workers/passkey-mpc-session.worker.js +0 -134
- package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/workers/shamir3pass.worker.js +0 -134
- package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/workers/tempo-signer.worker.js +0 -134
- package/dist/workers/tempo_signer.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet-custody-ceremony.worker.js +135 -1635
- package/dist/workers/wallet_custody_ceremony.js +0 -14
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +1 -14
- package/dist/esm/SeamsWeb/walletIframe/client/transport/webauthn-bridge.js +0 -99
- package/dist/esm/components/AccountMenuButton/AccountsSection.css +0 -81
- package/dist/esm/components/AccountMenuButton/ExportKeysSection.css +0 -96
- package/dist/esm/components/AccountMenuButton/LinkedDevicesModal.css +0 -612
- package/dist/esm/components/AccountMenuButton/MenuItem.css +0 -198
- package/dist/esm/components/AccountMenuButton/ProfileDropdown.css +0 -80
- package/dist/esm/components/AccountMenuButton/TransactionSettingsSection.css +0 -107
- package/dist/esm/components/AccountMenuButton/UserAccountButton.css +0 -177
- package/dist/esm/components/AccountMenuButton/WalletSettingsLayout.css +0 -456
- package/dist/esm/components/AccountMenuButton/Web3AuthProfileButton.css +0 -23
- package/dist/esm/components/AccountMenuButton/icons/TouchIcon.css +0 -46
- package/dist/esm/components/QRCodeScanner.css +0 -487
- package/dist/esm/components/ShowQRCode.css +0 -331
- package/dist/esm/core/indexedDB/seamsWalletDB/laneHolderMaterialStore.js +0 -236
- package/dist/esm/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.js +0 -171
- package/dist/esm/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.js +0 -32
- package/dist/esm/plugins/shared-ts/src/utils/base58.js +0 -1
- package/dist/esm/plugins/shared-ts/src/utils/near.js +0 -1
- package/dist/esm/plugins/shared-ts/src/utils/validation.js +0 -2
- package/dist/esm/react/SeamsWeb/SeamsWeb.js +0 -1918
- package/dist/esm/react/SeamsWeb/assembly/browserSigningSurfaceAssembly.js +0 -817
- package/dist/esm/react/SeamsWeb/assembly/browserWorkerWarmupPolicy.js +0 -31
- package/dist/esm/react/SeamsWeb/assembly/configureBrowserIndexedDB.js +0 -10
- package/dist/esm/react/SeamsWeb/assembly/createBrowserRecoveryPublicDeps.js +0 -95
- package/dist/esm/react/SeamsWeb/assembly/createBrowserSigningRuntime.js +0 -34
- package/dist/esm/react/SeamsWeb/assembly/createBrowserSigningStores.js +0 -39
- package/dist/esm/react/SeamsWeb/assembly/createBrowserStepUpRuntime.js +0 -34
- package/dist/esm/react/SeamsWeb/assembly/createBrowserWarmSessionPublicDeps.js +0 -31
- package/dist/esm/react/SeamsWeb/assembly/createWalletIframeOverlayState.js +0 -9
- package/dist/esm/react/SeamsWeb/assembly/createWalletIframeRouter.js +0 -44
- package/dist/esm/react/SeamsWeb/assembly/initializeBrowserSigningRuntime.js +0 -19
- package/dist/esm/react/SeamsWeb/assembly/runtimeConfig.js +0 -12
- package/dist/esm/react/SeamsWeb/operations/auth/login.js +0 -4408
- package/dist/esm/react/SeamsWeb/operations/auth/scheduleEcdsaSessionPresignaturePrefill.js +0 -41
- package/dist/esm/react/SeamsWeb/operations/auth/scheduleLinkedDevicePresignaturePrefill.js +0 -64
- package/dist/esm/react/SeamsWeb/operations/auth/walletAuth.js +0 -142
- package/dist/esm/react/SeamsWeb/operations/auth/walletUnlockEcdsaSubject.js +0 -33
- package/dist/esm/react/SeamsWeb/operations/auth/walletUnlockSubject.js +0 -294
- package/dist/esm/react/SeamsWeb/operations/authMethods/addAuthMethodSourceClaim.js +0 -72
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/addEmailOtp.js +0 -191
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/challenge.js +0 -247
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/googleEmailOtpWalletAuthFlow.js +0 -572
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/localEmailOtpProjection.js +0 -69
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/registrationAuthority.js +0 -62
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/registrationOffer.js +0 -69
- package/dist/esm/react/SeamsWeb/operations/authMethods/emailOtp/walletActivation.js +0 -95
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/addPasskey.js +0 -260
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/ecdsaBootstrap.js +0 -17
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/exactPasskeyAuthority.js +0 -34
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/localPasskeyProjection.js +0 -117
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/localUnlock.js +0 -16
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/loginAssertion.js +0 -25
- package/dist/esm/react/SeamsWeb/operations/authMethods/passkey/registrationAuthority.js +0 -84
- package/dist/esm/react/SeamsWeb/operations/authMethods/revokeAuthMethod.js +0 -205
- package/dist/esm/react/SeamsWeb/operations/authMethods/sourcePasskeyProof.js +0 -12
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingAuthorityInstallation.js +0 -444
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingComposition.js +0 -106
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingEd25519ExportRoot.js +0 -194
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingHttpTransport.js +0 -524
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingOwnerTransport.js +0 -135
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingResume.js +0 -215
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingTargetCredential.js +0 -63
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingTargetEd25519ExportRoot.js +0 -61
- package/dist/esm/react/SeamsWeb/operations/devices/deviceLinkingWorkerChannels.js +0 -337
- package/dist/esm/react/SeamsWeb/operations/devices/linkDevice.js +0 -75
- package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceFlow.js +0 -1358
- package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceFlowSupport.js +0 -143
- package/dist/esm/react/SeamsWeb/operations/devices/linkDeviceTargetActivation.js +0 -119
- package/dist/esm/react/SeamsWeb/operations/devices/scanDevice.js +0 -384
- package/dist/esm/react/SeamsWeb/operations/devices/walletHostComposition.js +0 -130
- package/dist/esm/react/SeamsWeb/operations/devices/walletHostOwnerAuthority.js +0 -191
- package/dist/esm/react/SeamsWeb/operations/evm/index.js +0 -35
- package/dist/esm/react/SeamsWeb/operations/near/actions.js +0 -484
- package/dist/esm/react/SeamsWeb/operations/near/commandSubject.js +0 -14
- package/dist/esm/react/SeamsWeb/operations/near/delegateAction.js +0 -247
- package/dist/esm/react/SeamsWeb/operations/near/index.js +0 -37
- package/dist/esm/react/SeamsWeb/operations/near/signNEP413.js +0 -117
- package/dist/esm/react/SeamsWeb/operations/near/signingEventHelpers.js +0 -15
- package/dist/esm/react/SeamsWeb/operations/recovery/accountSync.js +0 -21
- package/dist/esm/react/SeamsWeb/operations/recovery/recoveryWalletBinding.js +0 -43
- package/dist/esm/react/SeamsWeb/operations/recovery/syncAccount.js +0 -914
- package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryCodeBackup.js +0 -100
- package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryCommit.js +0 -477
- package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryDurablePayload.js +0 -383
- package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryJournal.js +0 -118
- package/dist/esm/react/SeamsWeb/operations/recovery/walletRecoveryRotation.js +0 -214
- package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecovery.js +0 -184
- package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecoveryUnlock.js +0 -247
- package/dist/esm/react/SeamsWeb/operations/registration/pendingEcdsaRegistrationRecoveryValidation.js +0 -134
- package/dist/esm/react/SeamsWeb/operations/registration/pendingRegistrationRecovery.js +0 -363
- package/dist/esm/react/SeamsWeb/operations/registration/registration.js +0 -3818
- package/dist/esm/react/SeamsWeb/operations/registration/registrationEd25519Yao.js +0 -166
- package/dist/esm/react/SeamsWeb/operations/registration/registrationSignerSet.js +0 -60
- package/dist/esm/react/SeamsWeb/operations/registration/registrationStrictEcdsa.js +0 -343
- package/dist/esm/react/SeamsWeb/operations/registration/registrationTerminalCommit.js +0 -296
- package/dist/esm/react/SeamsWeb/operations/registration/registrationTiming.js +0 -682
- package/dist/esm/react/SeamsWeb/operations/session/thresholdEcdsaProvisioning.js +0 -40
- package/dist/esm/react/SeamsWeb/operations/session/thresholdWarmSessionBootstrap.js +0 -20
- package/dist/esm/react/SeamsWeb/operations/tempo/executeEvmFamilyTransaction.js +0 -568
- package/dist/esm/react/SeamsWeb/operations/tempo/feeTokenPreference.js +0 -67
- package/dist/esm/react/SeamsWeb/operations/tempo/index.js +0 -39
- package/dist/esm/react/SeamsWeb/publicApi/auth.js +0 -24
- package/dist/esm/react/SeamsWeb/publicApi/awaitNearReady.js +0 -72
- package/dist/esm/react/SeamsWeb/publicApi/capabilitySelection.js +0 -63
- package/dist/esm/react/SeamsWeb/publicApi/chainTargets.js +0 -48
- package/dist/esm/react/SeamsWeb/publicApi/createPublicApi.js +0 -133
- package/dist/esm/react/SeamsWeb/publicApi/currentWallet.js +0 -46
- package/dist/esm/react/SeamsWeb/publicApi/devices.js +0 -83
- package/dist/esm/react/SeamsWeb/publicApi/evm.js +0 -103
- package/dist/esm/react/SeamsWeb/publicApi/keyExport.js +0 -90
- package/dist/esm/react/SeamsWeb/publicApi/near.js +0 -449
- package/dist/esm/react/SeamsWeb/publicApi/preferences.js +0 -61
- package/dist/esm/react/SeamsWeb/publicApi/recovery.js +0 -19
- package/dist/esm/react/SeamsWeb/publicApi/tempo.js +0 -244
- package/dist/esm/react/SeamsWeb/publicApi/transactionReview.js +0 -12
- package/dist/esm/react/SeamsWeb/publicApi/types.js +0 -10
- package/dist/esm/react/SeamsWeb/signingSurface/BrowserSigningSurface.js +0 -3917
- package/dist/esm/react/SeamsWeb/walletIframe/client/overlay/overlay-controller.js +0 -530
- package/dist/esm/react/SeamsWeb/walletIframe/client/overlay/overlay-styles.js +0 -417
- package/dist/esm/react/SeamsWeb/walletIframe/client/progress/on-events-progress-bus.js +0 -134
- package/dist/esm/react/SeamsWeb/walletIframe/client/router.js +0 -3368
- package/dist/esm/react/SeamsWeb/walletIframe/client/surface/domain.js +0 -288
- package/dist/esm/react/SeamsWeb/walletIframe/client/surface/geometry.js +0 -128
- package/dist/esm/react/SeamsWeb/walletIframe/client/surface/renderer.js +0 -119
- package/dist/esm/react/SeamsWeb/walletIframe/client/surface/transactionSurfaceQueue.js +0 -125
- package/dist/esm/react/SeamsWeb/walletIframe/client/transactionReviewReservation.js +0 -96
- package/dist/esm/react/SeamsWeb/walletIframe/client/transport/IframeTransport.js +0 -252
- package/dist/esm/react/SeamsWeb/walletIframe/client/transport/iframe-transport-dom.js +0 -71
- package/dist/esm/react/SeamsWeb/walletIframe/client/transport/iframe-transport-handshake.js +0 -211
- package/dist/esm/react/SeamsWeb/walletIframe/client/transport/webauthn-bridge.js +0 -99
- package/dist/esm/react/SeamsWeb/walletIframe/coordinator.js +0 -235
- package/dist/esm/react/SeamsWeb/walletIframe/host/restoredSessionPresignaturePrefill.js +0 -29
- package/dist/esm/react/SeamsWeb/walletIframe/host/surface-measurement-reporter.js +0 -158
- package/dist/esm/react/SeamsWeb/walletIframe/shared/exactSessionState.js +0 -605
- package/dist/esm/react/SeamsWeb/walletIframe/shared/is-dev-host.js +0 -11
- package/dist/esm/react/SeamsWeb/walletIframe/shared/messages.js +0 -588
- package/dist/esm/react/SeamsWeb/walletIframe/shared/transactionReview.js +0 -83
- package/dist/esm/react/SeamsWeb/walletIframe/shared/unlockOptions.js +0 -54
- package/dist/esm/react/base-styles.js +0 -13
- package/dist/esm/react/build-paths.js +0 -109
- package/dist/esm/react/config.js +0 -37
- package/dist/esm/react/core/accountData/near/accountProjection.js +0 -119
- package/dist/esm/react/core/accountData/near/accountRefs.js +0 -21
- package/dist/esm/react/core/accountData/near/keyMaterial.js +0 -171
- package/dist/esm/react/core/accountData/near/profileId.js +0 -24
- package/dist/esm/react/core/browser/walletIframe/csp-stylesheet.js +0 -189
- package/dist/esm/react/core/browser/walletIframe/events.js +0 -10
- package/dist/esm/react/core/browser/walletIframe/host-mode.js +0 -19
- package/dist/esm/react/core/browser/walletIframe/hostVariant.js +0 -16
- package/dist/esm/react/core/config/chains.js +0 -90
- package/dist/esm/react/core/config/configBuilder.js +0 -231
- package/dist/esm/react/core/config/configHelpers.js +0 -183
- package/dist/esm/react/core/config/defaultConfigs.js +0 -120
- package/dist/esm/react/core/config/defineConfig.js +0 -48
- package/dist/esm/react/core/config/managedRuntimeScope.js +0 -16
- package/dist/esm/react/core/indexedDB/accountKeyMaterial.js +0 -68
- package/dist/esm/react/core/indexedDB/accountSignerLifecycle.js +0 -143
- package/dist/esm/react/core/indexedDB/index.js +0 -60
- package/dist/esm/react/core/indexedDB/keyMaterialEnvelope.js +0 -69
- package/dist/esm/react/core/indexedDB/lastProfileState.js +0 -22
- package/dist/esm/react/core/indexedDB/linkedAuthoritySignerMaterial.js +0 -291
- package/dist/esm/react/core/indexedDB/nonceLaneCoordinationStore.js +0 -115
- package/dist/esm/react/core/indexedDB/normalization.js +0 -24
- package/dist/esm/react/core/indexedDB/pendingWalletRecoveryCommit.js +0 -477
- package/dist/esm/react/core/indexedDB/pendingWalletRegistrationCommit.js +0 -745
- package/dist/esm/react/core/indexedDB/profileAccountProjection.js +0 -70
- package/dist/esm/react/core/indexedDB/schemaNames.js +0 -845
- package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestLookups.js +0 -209
- package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestRecords.js +0 -848
- package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaCapabilityManifestStore.js +0 -1215
- package/dist/esm/react/core/indexedDB/seamsWalletDB/ecdsaClientPresignatures.js +0 -235
- package/dist/esm/react/core/indexedDB/seamsWalletDB/manager.js +0 -140
- package/dist/esm/react/core/indexedDB/seamsWalletDB/pendingWalletRecoveryCodeBackup.js +0 -145
- package/dist/esm/react/core/indexedDB/seamsWalletDB/repositories.js +0 -4747
- package/dist/esm/react/core/indexedDB/seamsWalletDB/schema.js +0 -23
- package/dist/esm/react/core/indexedDB/seamsWalletDB/signingSessionSeals.js +0 -205
- package/dist/esm/react/core/indexedDB/seamsWalletDB/walletCustodyEcdsaContinuity.js +0 -198
- package/dist/esm/react/core/indexedDB/seamsWalletDB/walletSessionAuthorizationStore.js +0 -569
- package/dist/esm/react/core/indexedDB/singletons.js +0 -7
- package/dist/esm/react/core/indexedDB/unifiedIndexedDBManager.js +0 -578
- package/dist/esm/react/core/indexedDB/walletCustodyEd25519MaterialRecord.js +0 -60
- package/dist/esm/react/core/platform/browser/createBrowserPlatformRuntime.js +0 -552
- package/dist/esm/react/core/platform/secretSources.js +0 -111
- package/dist/esm/react/core/platform/signerCoreCommandAdapters.js +0 -122
- package/dist/esm/react/core/rpcClients/evm/EvmClient.js +0 -549
- package/dist/esm/react/core/rpcClients/evm/nonceBackend.js +0 -279
- package/dist/esm/react/core/rpcClients/near/NearClient.js +0 -56
- package/dist/esm/react/core/rpcClients/near/NearRpcError.js +0 -105
- package/dist/esm/react/core/rpcClients/near/rpcCalls.js +0 -376
- package/dist/esm/react/core/rpcClients/relayer/ownerWalletExecutionLanePreflight.js +0 -67
- package/dist/esm/react/core/rpcClients/relayer/passkeyCustodyEnvelope.js +0 -228
- package/dist/esm/react/core/rpcClients/relayer/registrationSignerSetRequest.js +0 -8
- package/dist/esm/react/core/rpcClients/relayer/relayerHttp.js +0 -26
- package/dist/esm/react/core/rpcClients/relayer/routerAbNormalSigning.js +0 -812
- package/dist/esm/react/core/rpcClients/relayer/routerAbNormalSigningValidation.js +0 -23
- package/dist/esm/react/core/rpcClients/relayer/sealedRefreshCapabilities.js +0 -148
- package/dist/esm/react/core/rpcClients/relayer/thresholdEcdsa.js +0 -237
- package/dist/esm/react/core/rpcClients/relayer/walletRecoveryFinalize.js +0 -174
- package/dist/esm/react/core/rpcClients/relayer/walletRecoveryGoogleEmailOtp.js +0 -161
- package/dist/esm/react/core/rpcClients/relayer/walletRecoveryPrepare.js +0 -295
- package/dist/esm/react/core/rpcClients/relayer/walletRecoveryRotate.js +0 -311
- package/dist/esm/react/core/rpcClients/relayer/walletRegistration.js +0 -2349
- package/dist/esm/react/core/rpcClients/relayer/walletRegistrationTerminalResponse.js +0 -719
- package/dist/esm/react/core/rpcClients/relayer/walletSessionAuthorizationStatus.js +0 -214
- package/dist/esm/react/core/runtime/createSigningRuntime.js +0 -100
- package/dist/esm/react/core/signingEngine/assembly/createManagers.js +0 -80
- package/dist/esm/react/core/signingEngine/assembly/createPorts.js +0 -54
- package/dist/esm/react/core/signingEngine/assembly/ports/emailOtp.js +0 -30
- package/dist/esm/react/core/signingEngine/assembly/ports/evmFamily.js +0 -73
- package/dist/esm/react/core/signingEngine/assembly/ports/near.js +0 -21
- package/dist/esm/react/core/signingEngine/assembly/ports/recovery.js +0 -75
- package/dist/esm/react/core/signingEngine/assembly/ports/registration.js +0 -22
- package/dist/esm/react/core/signingEngine/assembly/ports/session.js +0 -25
- package/dist/esm/react/core/signingEngine/assembly/ports/shared.js +0 -40
- package/dist/esm/react/core/signingEngine/assembly/ports/stepUpRuntime.js +0 -67
- package/dist/esm/react/core/signingEngine/assembly/ports/warmSigning.js +0 -92
- package/dist/esm/react/core/signingEngine/assembly/warmup.js +0 -68
- package/dist/esm/react/core/signingEngine/chains/evm/bytes.js +0 -22
- package/dist/esm/react/core/signingEngine/chains/evm/display/calldata.js +0 -25
- package/dist/esm/react/core/signingEngine/chains/evm/display/evmTx.js +0 -119
- package/dist/esm/react/core/signingEngine/chains/evm/display/functionSelectors.js +0 -72
- package/dist/esm/react/core/signingEngine/chains/evm/display/gas.js +0 -19
- package/dist/esm/react/core/signingEngine/chains/evm/display/normalization.js +0 -23
- package/dist/esm/react/core/signingEngine/chains/evm/evmAdapter.js +0 -44
- package/dist/esm/react/core/signingEngine/chains/evm/evmCryptoWasm.js +0 -198
- package/dist/esm/react/core/signingEngine/chains/near/display.js +0 -248
- package/dist/esm/react/core/signingEngine/chains/near/nearSignerWasm.js +0 -170
- package/dist/esm/react/core/signingEngine/chains/near/payloads.js +0 -58
- package/dist/esm/react/core/signingEngine/chains/tempo/display.js +0 -130
- package/dist/esm/react/core/signingEngine/chains/tempo/feeToken.js +0 -187
- package/dist/esm/react/core/signingEngine/chains/tempo/tempoAdapter.js +0 -49
- package/dist/esm/react/core/signingEngine/chains/tempo/tempoSignerWasm.js +0 -90
- package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaDerivationExport.js +0 -428
- package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaExportFlow.js +0 -660
- package/dist/esm/react/core/signingEngine/flows/recovery/ecdsaExportMaterial.js +0 -250
- package/dist/esm/react/core/signingEngine/flows/recovery/ed25519YaoExportFlow.js +0 -353
- package/dist/esm/react/core/signingEngine/flows/recovery/exportKeypairOperation.js +0 -213
- package/dist/esm/react/core/signingEngine/flows/recovery/exportLaneSelection.js +0 -283
- package/dist/esm/react/core/signingEngine/flows/recovery/keyExportConfirmation.js +0 -325
- package/dist/esm/react/core/signingEngine/flows/recovery/keyExportFlow.js +0 -81
- package/dist/esm/react/core/signingEngine/flows/recovery/passkeyEd25519YaoRecovery.js +0 -192
- package/dist/esm/react/core/signingEngine/flows/recovery/public.js +0 -26
- package/dist/esm/react/core/signingEngine/flows/recovery/stepUpAuthorization.js +0 -139
- package/dist/esm/react/core/signingEngine/flows/registration/accountLifecycle.js +0 -1098
- package/dist/esm/react/core/signingEngine/flows/registration/nearProvisioningRegistry.js +0 -79
- package/dist/esm/react/core/signingEngine/flows/registration/public.js +0 -85
- package/dist/esm/react/core/signingEngine/flows/registration/services/ecdsaRegistrationSessions.js +0 -77
- package/dist/esm/react/core/signingEngine/flows/registration/services/ecdsaWalletRecords.js +0 -15
- package/dist/esm/react/core/signingEngine/flows/registration/services/passkeyEd25519YaoAddSigner.js +0 -83
- package/dist/esm/react/core/signingEngine/flows/registration/services/registrationAccounts.js +0 -30
- package/dist/esm/react/core/signingEngine/flows/registration/session.js +0 -24
- package/dist/esm/react/core/signingEngine/flows/shared/signingConfirmation.js +0 -194
- package/dist/esm/react/core/signingEngine/flows/shared/signingStateMachine.js +0 -485
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/accountAuth.js +0 -12
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/addresses.js +0 -10
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/authPlanning.js +0 -139
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/ecdsaLanes.js +0 -102
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/ecdsaSelection.js +0 -233
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/emailOtpPublic.js +0 -123
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/emailOtpSigningSession.js +0 -227
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/errors.js +0 -127
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/events.js +0 -39
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/evmNonceLifecycle.js +0 -49
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/executorThresholdState.js +0 -22
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/freshAuthRetryPolicy.js +0 -98
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/freshWalletSessionRetry.js +0 -76
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/nonceLifecycleAdapter.js +0 -245
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/nonceResolution.js +0 -91
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/operationIds.js +0 -33
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/preparedSigning.js +0 -376
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/readySecp256k1Material.js +0 -191
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/requireEvmFamilyStepUpAuth.js +0 -128
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmFamily.js +0 -510
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmFamilyWithUiConfirmForTempo.js +0 -65
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signEvmWithUiConfirm.js +0 -26
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signatureUses.js +0 -12
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signerLoader.js +0 -25
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/ecdsaDerivationClientSigningMaterialSource.js +0 -82
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/secp256k1.js +0 -182
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signers/webauthnP256.js +0 -84
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signingFlow.js +0 -633
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/signingFlowRuntime.js +0 -392
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/stepUpAuthorization.js +0 -56
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/tempoNonceLifecycle.js +0 -47
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/thresholdAdmission.js +0 -87
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/transactionExecutor.js +0 -140
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/types.js +0 -20
- package/dist/esm/react/core/signingEngine/flows/signEvmFamily/webauthnP256KeyRef.js +0 -33
- package/dist/esm/react/core/signingEngine/flows/signNear/implicitAccountFunding.js +0 -202
- package/dist/esm/react/core/signingEngine/flows/signNear/nearSigningFlow.js +0 -56
- package/dist/esm/react/core/signingEngine/flows/signNear/requireNearStepUpAuth.js +0 -102
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/confirmationProgress.js +0 -28
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoCapabilityResolution.js +0 -101
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +0 -822
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/implicitAccountFundingPort.js +0 -24
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/operationStepUpPreparation.js +0 -68
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/signatureOnlySigning.js +0 -343
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/signingMaterials.js +0 -25
- package/dist/esm/react/core/signingEngine/flows/signNear/shared/signingSessionAuthMode.js +0 -138
- package/dist/esm/react/core/signingEngine/flows/signNear/signDelegate.js +0 -290
- package/dist/esm/react/core/signingEngine/flows/signNear/signNear.js +0 -1238
- package/dist/esm/react/core/signingEngine/flows/signNear/signNep413.js +0 -144
- package/dist/esm/react/core/signingEngine/flows/signNear/signTransactions.js +0 -897
- package/dist/esm/react/core/signingEngine/flows/signNear/signatureUses.js +0 -12
- package/dist/esm/react/core/signingEngine/flows/signNear/stepUpAuthorization.js +0 -42
- package/dist/esm/react/core/signingEngine/interfaces/accountAuthMetadata.js +0 -14
- package/dist/esm/react/core/signingEngine/interfaces/ecdsaChainTarget.js +0 -142
- package/dist/esm/react/core/signingEngine/interfaces/operationStepUpPreparation.js +0 -18
- package/dist/esm/react/core/signingEngine/nonce/NonceCoordinator.js +0 -1026
- package/dist/esm/react/core/signingEngine/nonce/evmNonceLane.js +0 -182
- package/dist/esm/react/core/signingEngine/nonce/nearNonceLane.js +0 -669
- package/dist/esm/react/core/signingEngine/nonce/nearNonceLaneIdentity.js +0 -24
- package/dist/esm/react/core/signingEngine/nonce/nonceCoordinationRecordBoundary.js +0 -216
- package/dist/esm/react/core/signingEngine/nonce/nonceDiagnostics.js +0 -232
- package/dist/esm/react/core/signingEngine/nonce/nonceLaneKeys.js +0 -110
- package/dist/esm/react/core/signingEngine/nonce/nonceLeaseState.js +0 -128
- package/dist/esm/react/core/signingEngine/nonce/nonceTypes.js +0 -59
- package/dist/esm/react/core/signingEngine/nonce/nonceUtils.js +0 -33
- package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/httpRequest.js +0 -74
- package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/poolFillRoutes.js +0 -217
- package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/presignaturePool.js +0 -1218
- package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/presignatureRefillProgress.js +0 -53
- package/dist/esm/react/core/signingEngine/routerAb/ecdsaDerivation/signingMaterialRef.js +0 -22
- package/dist/esm/react/core/signingEngine/session/SigningSessionCoordinator.js +0 -347
- package/dist/esm/react/core/signingEngine/session/authority/authorityOperationResolver.js +0 -165
- package/dist/esm/react/core/signingEngine/session/availability/availableSigningLanes.js +0 -1064
- package/dist/esm/react/core/signingEngine/session/availability/canonicalLaneInventory.js +0 -127
- package/dist/esm/react/core/signingEngine/session/availability/clientSessionExpiryInvalidator.js +0 -72
- package/dist/esm/react/core/signingEngine/session/availability/persistedAvailableSigningLanes.js +0 -214
- package/dist/esm/react/core/signingEngine/session/availability/readiness.js +0 -464
- package/dist/esm/react/core/signingEngine/session/emailOtp/EmailOtpWalletSessionCoordinator.js +0 -131
- package/dist/esm/react/core/signingEngine/session/emailOtp/challengeDelivery.js +0 -56
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaBootstrapCommit.js +0 -106
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaLifecycleRuntime.js +0 -50
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaLogin.js +0 -936
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaPublication.js +0 -414
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaRecovery.js +0 -268
- package/dist/esm/react/core/signingEngine/session/emailOtp/ecdsaSigningSessionAuthority.js +0 -95
- package/dist/esm/react/core/signingEngine/session/emailOtp/ed25519ExportContext.js +0 -376
- package/dist/esm/react/core/signingEngine/session/emailOtp/exportRecovery.js +0 -286
- package/dist/esm/react/core/signingEngine/session/emailOtp/exportRecoveryRuntime.js +0 -50
- package/dist/esm/react/core/signingEngine/session/emailOtp/persistedSnapshot.js +0 -22
- package/dist/esm/react/core/signingEngine/session/emailOtp/publicTypes.js +0 -38
- package/dist/esm/react/core/signingEngine/session/emailOtp/routePlan.js +0 -60
- package/dist/esm/react/core/signingEngine/session/emailOtp/runtimeConfig.js +0 -24
- package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRefreshPolicy.js +0 -49
- package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRestoreOrchestrator.js +0 -234
- package/dist/esm/react/core/signingEngine/session/emailOtp/sealedRuntimePurpose.js +0 -16
- package/dist/esm/react/core/signingEngine/session/emailOtp/sealedSessionRegistry.js +0 -40
- package/dist/esm/react/core/signingEngine/session/emailOtp/status.js +0 -72
- package/dist/esm/react/core/signingEngine/session/emailOtp/walletUnlock.js +0 -168
- package/dist/esm/react/core/signingEngine/session/emailOtp/warmSessionRuntime.js +0 -70
- package/dist/esm/react/core/signingEngine/session/emailOtp/workerEnrollment.js +0 -159
- package/dist/esm/react/core/signingEngine/session/emailOtp/workerRequests.js +0 -84
- package/dist/esm/react/core/signingEngine/session/emailOtp/zeroize.js +0 -9
- package/dist/esm/react/core/signingEngine/session/identity/clientSessionPersistenceState.js +0 -95
- package/dist/esm/react/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.js +0 -23
- package/dist/esm/react/core/signingEngine/session/identity/evmFamilyEcdsaIdentity.js +0 -265
- package/dist/esm/react/core/signingEngine/session/identity/exactSigningLaneIdentity.js +0 -338
- package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionCredential.js +0 -106
- package/dist/esm/react/core/signingEngine/session/identity/exactWalletSessionReader.js +0 -54
- package/dist/esm/react/core/signingEngine/session/identity/laneIdentity.js +0 -168
- package/dist/esm/react/core/signingEngine/session/identity/ownerLaneScope.js +0 -185
- package/dist/esm/react/core/signingEngine/session/identity/selectLane.js +0 -335
- package/dist/esm/react/core/signingEngine/session/identity/signingLaneAuthBinding.js +0 -29
- package/dist/esm/react/core/signingEngine/session/keyMaterialBrands.js +0 -75
- package/dist/esm/react/core/signingEngine/session/lanes/walletExecutionLaneHydration.js +0 -194
- package/dist/esm/react/core/signingEngine/session/lifecycle/canonicalWalletSessionStatus.js +0 -32
- package/dist/esm/react/core/signingEngine/session/lifecycle/walletSessionFailure.js +0 -69
- package/dist/esm/react/core/signingEngine/session/lifecycle/walletSessionStatus.js +0 -123
- package/dist/esm/react/core/signingEngine/session/material/activeEcdsaCapabilityRuntime.js +0 -171
- package/dist/esm/react/core/signingEngine/session/material/activeWalletAuthorityEcdsaRuntime.js +0 -318
- package/dist/esm/react/core/signingEngine/session/material/ecdsaCapabilityHydration.js +0 -75
- package/dist/esm/react/core/signingEngine/session/material/ecdsaCapabilityManifest.js +0 -498
- package/dist/esm/react/core/signingEngine/session/material/ecdsaRoleLocalMaterialResolver.js +0 -122
- package/dist/esm/react/core/signingEngine/session/material/ecdsaSealedRuntime.js +0 -197
- package/dist/esm/react/core/signingEngine/session/material/ecdsaSigningCapability.js +0 -231
- package/dist/esm/react/core/signingEngine/session/material/linkedEcdsaHolderRuntime.js +0 -36
- package/dist/esm/react/core/signingEngine/session/material/mpcCapabilityHydration.js +0 -79
- package/dist/esm/react/core/signingEngine/session/material/nearEd25519YaoMaterialActivation.js +0 -80
- package/dist/esm/react/core/signingEngine/session/material/nearEd25519YaoSigningPreparation.js +0 -122
- package/dist/esm/react/core/signingEngine/session/material/restorableMpcMaterialRef.internal.js +0 -21
- package/dist/esm/react/core/signingEngine/session/material/walletSigningStateFailure.js +0 -84
- package/dist/esm/react/core/signingEngine/session/operationState/authorizationAdmission.js +0 -98
- package/dist/esm/react/core/signingEngine/session/operationState/lanes.js +0 -127
- package/dist/esm/react/core/signingEngine/session/operationState/preparedOperation.js +0 -38
- package/dist/esm/react/core/signingEngine/session/operationState/trace.js +0 -94
- package/dist/esm/react/core/signingEngine/session/operationState/transactionState.js +0 -106
- package/dist/esm/react/core/signingEngine/session/operationState/types.js +0 -88
- package/dist/esm/react/core/signingEngine/session/passkey/ecdsaBootstrap.js +0 -187
- package/dist/esm/react/core/signingEngine/session/passkey/ecdsaKeyFactsInventory.js +0 -206
- package/dist/esm/react/core/signingEngine/session/passkey/ecdsaRecovery.js +0 -87
- package/dist/esm/react/core/signingEngine/session/passkey/ecdsaSessionProvision.js +0 -224
- package/dist/esm/react/core/signingEngine/session/passkey/ecdsaWarmCapabilityBootstrap.js +0 -147
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519Provisioner.js +0 -55
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519SessionProvision.js +0 -229
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.js +0 -537
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoRecoveryCapability.js +0 -94
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoSealedSession.js +0 -57
- package/dist/esm/react/core/signingEngine/session/passkey/ed25519YaoWarmRecovery.js +0 -314
- package/dist/esm/react/core/signingEngine/session/passkey/passkeyCustodySessionCache.js +0 -90
- package/dist/esm/react/core/signingEngine/session/passkey/prfCache.js +0 -60
- package/dist/esm/react/core/signingEngine/session/passkey/public.js +0 -15
- package/dist/esm/react/core/signingEngine/session/passkey/unlockEcdsaWarmupPlanner.js +0 -247
- package/dist/esm/react/core/signingEngine/session/passkey/warmSessionHydration.js +0 -9
- package/dist/esm/react/core/signingEngine/session/persistence/clientSessionPersistence.js +0 -143
- package/dist/esm/react/core/signingEngine/session/persistence/durableSealedSessionCommands.js +0 -30
- package/dist/esm/react/core/signingEngine/session/persistence/ecdsaRoleLocalRecords.js +0 -316
- package/dist/esm/react/core/signingEngine/session/persistence/ecdsaSealedRecordKey.js +0 -20
- package/dist/esm/react/core/signingEngine/session/persistence/sealedSessionRecords.js +0 -761
- package/dist/esm/react/core/signingEngine/session/persistence/sealedSessionStore.js +0 -518
- package/dist/esm/react/core/signingEngine/session/persistence/walletSessionAuthorizationProjection.js +0 -51
- package/dist/esm/react/core/signingEngine/session/planning/operationFingerprint.js +0 -30
- package/dist/esm/react/core/signingEngine/session/planning/operationIdBinding.js +0 -36
- package/dist/esm/react/core/signingEngine/session/planning/planner.js +0 -98
- package/dist/esm/react/core/signingEngine/session/postconditions/runtimePostconditions.js +0 -165
- package/dist/esm/react/core/signingEngine/session/public.js +0 -44
- package/dist/esm/react/core/signingEngine/session/routerAbSigningWalletSession.js +0 -125
- package/dist/esm/react/core/signingEngine/session/sealedRecovery/exactRecordLookup.js +0 -148
- package/dist/esm/react/core/signingEngine/session/sealedRecovery/materialActivationKey.js +0 -22
- package/dist/esm/react/core/signingEngine/session/sealedRecovery/recoveryRecord.js +0 -248
- package/dist/esm/react/core/signingEngine/session/sealedRecovery/restoreCoordinator.js +0 -229
- package/dist/esm/react/core/signingEngine/session/userPreferences.js +0 -212
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/capabilityReader.js +0 -62
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/capabilityReaderCore.js +0 -293
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/clearVolatileWarmSigningMaterial.js +0 -44
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaBootstrapPersistence.js +0 -107
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaBootstrapQueue.js +0 -22
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaLoginPrefill.js +0 -93
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaLoginPrefillSigningMaterialSource.js +0 -50
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.js +0 -9
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/ed25519SealedSessionRuntime.js +0 -251
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/nearEd25519CapabilityRehydration.js +0 -98
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/public.js +0 -31
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/readModel.js +0 -161
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/routerAbEd25519WalletSessionState.js +0 -256
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/routerAbWalletSessionCredential.js +0 -73
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/sealedRefreshParity.js +0 -67
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/statusReader.js +0 -100
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/transitions.js +0 -51
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/types.js +0 -122
- package/dist/esm/react/core/signingEngine/session/warmCapabilities/volatileWarmMaterialCommands.js +0 -45
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/channel/confirmCommon.js +0 -89
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/channel/confirmTypes.js +0 -12
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/confirmOperation.js +0 -51
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/intentDigestPreparation.js +0 -29
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/methodSelection.js +0 -41
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/authLane.js +0 -32
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/exportAuthorization.js +0 -108
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/promptText.js +0 -8
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/otpPrompt/signingPrompt.js +0 -15
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/passkeyPrompt/touchIdPrompt.js +0 -295
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/passkeyPrompt/webauthnPromptCoordinator.js +0 -170
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/requireStepUpAuth.js +0 -63
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/types.js +0 -29
- package/dist/esm/react/core/signingEngine/stepUpConfirmation/userConfirmationType.js +0 -15
- package/dist/esm/react/core/signingEngine/threshold/commitQueueShared.js +0 -139
- package/dist/esm/react/core/signingEngine/threshold/crypto/ecdsaDerivationClientWasm.js +0 -619
- package/dist/esm/react/core/signingEngine/threshold/crypto/ed25519YaoLaneWasm.js +0 -70
- package/dist/esm/react/core/signingEngine/threshold/ecdsa/activation.js +0 -267
- package/dist/esm/react/core/signingEngine/threshold/ecdsa/bootstrapSession.js +0 -119
- package/dist/esm/react/core/signingEngine/threshold/ecdsa/operationStepUp.js +0 -110
- package/dist/esm/react/core/signingEngine/threshold/ecdsa/postRegistrationSessionActivation.js +0 -132
- package/dist/esm/react/core/signingEngine/threshold/ecdsa/signingQueue.js +0 -16
- package/dist/esm/react/core/signingEngine/threshold/ed25519/commitQueue.js +0 -16
- package/dist/esm/react/core/signingEngine/threshold/ed25519/connectSession.js +0 -137
- package/dist/esm/react/core/signingEngine/threshold/ed25519/walletSession.js +0 -363
- package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoActiveClientRegistry.js +0 -146
- package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoClient.js +0 -597
- package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoPageLifecycleOwner.js +0 -23
- package/dist/esm/react/core/signingEngine/threshold/ed25519/yaoPublicCapabilityReferences.js +0 -295
- package/dist/esm/react/core/signingEngine/threshold/sessionPolicy.js +0 -94
- package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcExportManager.js +0 -233
- package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionDurableState.js +0 -496
- package/dist/esm/react/core/signingEngine/uiConfirm/PasskeyMpcSessionManager.js +0 -746
- package/dist/esm/react/core/signingEngine/uiConfirm/UiConfirmManager.js +0 -600
- package/dist/esm/react/core/signingEngine/uiConfirm/confirmationReadinessRegistry.js +0 -41
- package/dist/esm/react/core/signingEngine/uiConfirm/exportConfirmRequest.js +0 -149
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/determineConfirmationConfig.js +0 -82
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flowOrchestrator.js +0 -363
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/adapters/adapters.js +0 -337
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/adapters/request.js +0 -120
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/localOnly.js +0 -150
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/registration.js +0 -235
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/requestRegistrationCredentialConfirmation.js +0 -178
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/flows/signing.js +0 -684
- package/dist/esm/react/core/signingEngine/uiConfirm/handlers/handlePromptFromWorker.js +0 -90
- package/dist/esm/react/core/signingEngine/uiConfirm/nearFundingNotice.js +0 -50
- package/dist/esm/react/core/signingEngine/uiConfirm/transactionReviewAdmission.js +0 -8
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/appearance-token-vars.js +0 -31
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/appearance.js +0 -27
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirm-surface-resize.js +0 -346
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirm-ui.js +0 -516
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirmation-body-model.js +0 -24
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/confirmation-model.js +0 -161
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/drawer-gesture.js +0 -16
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/export-private-key-reveal.js +0 -155
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/export-viewer-host.js +0 -207
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmContent.js +0 -131
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmHeader.js +0 -29
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationBody.js +0 -49
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationContent.js +0 -137
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationDrawer.js +0 -294
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ConfirmationModal.js +0 -67
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/CopyStatusIcon.js +0 -41
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/EmailOtpContent.js +0 -141
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/EmailOtpInput.js +0 -92
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ExportPrivateKeySurface.js +0 -318
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/HaloBorder.js +0 -91
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PadlockIcon.js +0 -32
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyHaloLoading.js +0 -63
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationContent.js +0 -75
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationDetails.js +0 -33
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.js +0 -518
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.js +0 -128
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/SeamsWordmark.js +0 -22
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionLabel.js +0 -158
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +0 -289
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionReview.js +0 -311
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/TransactionTree.js +0 -284
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/clipboard.js +0 -26
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/confirmation-controller.js +0 -80
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/confirmation-styles.js +0 -20
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/email-otp-session.js +0 -178
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +0 -297
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountExportPrivateKeySurface.js +0 -86
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/preact/mountRecoveryCodeBackupSurface.js +0 -82
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/seamsWordmarkPaths.js +0 -6
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/surface-measurement-binding.js +0 -12
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/surface-resize-events.js +0 -18
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-activity.js +0 -46
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/abi/abiDecode.js +0 -325
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/abi/enrichDisplayModelWithAbi.js +0 -77
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/confirmation-tree.js +0 -27
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/formatters.js +0 -57
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/renderers/fallback.js +0 -52
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/renderers/types.js +0 -62
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-display/tree.js +0 -249
- package/dist/esm/react/core/signingEngine/uiConfirm/ui/transaction-receipt.js +0 -50
- package/dist/esm/react/core/signingEngine/uiConfirm/warmSessionUiConfirm.js +0 -65
- package/dist/esm/react/core/signingEngine/walletCustody/activateEd25519Capability.js +0 -123
- package/dist/esm/react/core/signingEngine/walletCustody/ceremonyActiveClientMetadata.js +0 -94
- package/dist/esm/react/core/signingEngine/walletCustody/ceremonyDriver.js +0 -171
- package/dist/esm/react/core/signingEngine/walletCustody/ceremonyStepRunner.js +0 -20
- package/dist/esm/react/core/signingEngine/walletCustody/ed25519ActiveClient.js +0 -100
- package/dist/esm/react/core/signingEngine/walletCustody/ed25519Projection.js +0 -32
- package/dist/esm/react/core/signingEngine/walletCustody/ed25519SeedMaterial.js +0 -92
- package/dist/esm/react/core/signingEngine/walletCustody/emailOtpLink.js +0 -135
- package/dist/esm/react/core/signingEngine/walletCustody/joinCustodyWire.js +0 -64
- package/dist/esm/react/core/signingEngine/walletCustody/openCustodyCache.js +0 -130
- package/dist/esm/react/core/signingEngine/walletCustody/passkeyLink.js +0 -183
- package/dist/esm/react/core/signingEngine/walletCustody/recoveryReplacementEnvelope.js +0 -60
- package/dist/esm/react/core/signingEngine/walletCustody/registrationCeremony.js +0 -461
- package/dist/esm/react/core/signingEngine/walletCustody/unlockedEd25519ExportRootCapability.js +0 -258
- package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryCredential.js +0 -24
- package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryEcdsa.js +0 -76
- package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryEd25519.js +0 -129
- package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryManifest.js +0 -180
- package/dist/esm/react/core/signingEngine/walletCustody/walletRecoveryRotation.js +0 -103
- package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/collectAuthenticationCredentialForChallengeB64u.js +0 -154
- package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/credentialExtensions.js +0 -36
- package/dist/esm/react/core/signingEngine/webauthnAuth/credentials/helpers.js +0 -273
- package/dist/esm/react/core/signingEngine/webauthnAuth/device/signerSlot.js +0 -25
- package/dist/esm/react/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.js +0 -171
- package/dist/esm/react/core/signingEngine/workerManager/SignerWorkerManager.js +0 -70
- package/dist/esm/react/core/signingEngine/workerManager/deviceLinkingPorts.js +0 -342
- package/dist/esm/react/core/signingEngine/workerManager/deviceLinkingSourceContribution.js +0 -158
- package/dist/esm/react/core/signingEngine/workerManager/ecdsaClientWorkerChannels.js +0 -17
- package/dist/esm/react/core/signingEngine/workerManager/ecdsaPresignLifecycle.js +0 -6
- package/dist/esm/react/core/signingEngine/workerManager/ecdsaPresignPoolIdentity.js +0 -49
- package/dist/esm/react/core/signingEngine/workerManager/executeWorkerOperation.js +0 -12
- package/dist/esm/react/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.js +0 -32
- package/dist/esm/react/core/signingEngine/workerManager/validation.js +0 -114
- package/dist/esm/react/core/signingEngine/workerManager/workerTransport.js +0 -773
- package/dist/esm/react/core/signingEngine/workerManager/workerTypes.js +0 -109
- package/dist/esm/react/core/types/accountIds.js +0 -26
- package/dist/esm/react/core/types/actionBuilders.js +0 -73
- package/dist/esm/react/core/types/confirmationConfig.js +0 -39
- package/dist/esm/react/core/types/eventLogging.js +0 -28
- package/dist/esm/react/core/types/linkDevice.js +0 -49
- package/dist/esm/react/core/types/sdkSentEvents.js +0 -602
- package/dist/esm/react/core/types/secure-confirm-worker.js +0 -22
- package/dist/esm/react/core/types/signer-worker.js +0 -50
- package/dist/esm/react/core/types/walletIframeIdentity.js +0 -15
- package/dist/esm/react/core/walletRuntimePaths/base.js +0 -60
- package/dist/esm/react/core/walletRuntimePaths/emailOtpWorker.js +0 -12
- package/dist/esm/react/core/walletRuntimePaths/multichainWorkers.js +0 -25
- package/dist/esm/react/core/walletRuntimePaths/walletCustodyCeremonyWorker.js +0 -18
- package/dist/esm/react/core/walletRuntimePaths/workers.js +0 -93
- package/dist/esm/react/externalEvm/boundary.js +0 -309
- package/dist/esm/react/externalEvm/controller.js +0 -440
- package/dist/esm/react/externalEvm/types.js +0 -31
- package/dist/esm/react/node_modules/@noble/hashes/esm/_u64.js +0 -36
- package/dist/esm/react/node_modules/@noble/hashes/esm/sha3.js +0 -197
- package/dist/esm/react/node_modules/@noble/hashes/esm/utils.js +0 -87
- package/dist/esm/react/node_modules/viem/_esm/errors/abi.js +0 -48
- package/dist/esm/react/node_modules/viem/_esm/errors/address.js +0 -14
- package/dist/esm/react/node_modules/viem/_esm/errors/base.js +0 -86
- package/dist/esm/react/node_modules/viem/_esm/errors/data.js +0 -16
- package/dist/esm/react/node_modules/viem/_esm/errors/encoding.js +0 -16
- package/dist/esm/react/node_modules/viem/_esm/errors/typedData.js +0 -28
- package/dist/esm/react/node_modules/viem/_esm/errors/version.js +0 -6
- package/dist/esm/react/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js +0 -243
- package/dist/esm/react/node_modules/viem/_esm/utils/address/getAddress.js +0 -28
- package/dist/esm/react/node_modules/viem/_esm/utils/address/isAddress.js +0 -23
- package/dist/esm/react/node_modules/viem/_esm/utils/data/concat.js +0 -23
- package/dist/esm/react/node_modules/viem/_esm/utils/data/isHex.js +0 -10
- package/dist/esm/react/node_modules/viem/_esm/utils/data/pad.js +0 -40
- package/dist/esm/react/node_modules/viem/_esm/utils/data/size.js +0 -16
- package/dist/esm/react/node_modules/viem/_esm/utils/data/slice.js +0 -59
- package/dist/esm/react/node_modules/viem/_esm/utils/encoding/fromHex.js +0 -13
- package/dist/esm/react/node_modules/viem/_esm/utils/encoding/toBytes.js +0 -175
- package/dist/esm/react/node_modules/viem/_esm/utils/encoding/toHex.js +0 -168
- package/dist/esm/react/node_modules/viem/_esm/utils/hash/keccak256.js +0 -15
- package/dist/esm/react/node_modules/viem/_esm/utils/lru.js +0 -38
- package/dist/esm/react/node_modules/viem/_esm/utils/regex.js +0 -7
- package/dist/esm/react/node_modules/viem/_esm/utils/signature/hashTypedData.js +0 -113
- package/dist/esm/react/node_modules/viem/_esm/utils/stringify.js +0 -9
- package/dist/esm/react/node_modules/viem/_esm/utils/typedData.js +0 -80
- package/dist/esm/react/shared-ts/src/authorization/capabilityKinds.js +0 -111
- package/dist/esm/react/shared-ts/src/authorization/delegatedAuthority.js +0 -121
- package/dist/esm/react/shared-ts/src/authorization/index.js +0 -6
- package/dist/esm/react/shared-ts/src/authorization/operationFingerprint.js +0 -57
- package/dist/esm/react/shared-ts/src/authorization/walletAuthority.js +0 -719
- package/dist/esm/react/shared-ts/src/authorization/walletCustodyOperation.js +0 -16
- package/dist/esm/react/shared-ts/src/authorization/walletSessionIssuance.js +0 -115
- package/dist/esm/react/shared-ts/src/authorization/walletSignerActivationEquality.js +0 -12
- package/dist/esm/react/shared-ts/src/device-linking/activeWalletSession.js +0 -104
- package/dist/esm/react/shared-ts/src/device-linking/authorityActivation.js +0 -142
- package/dist/esm/react/shared-ts/src/device-linking/committedSignerPackages.js +0 -270
- package/dist/esm/react/shared-ts/src/device-linking/contracts.js +0 -8
- package/dist/esm/react/shared-ts/src/device-linking/delegatedActivationPlan.js +0 -130
- package/dist/esm/react/shared-ts/src/device-linking/deviceManagement.js +0 -120
- package/dist/esm/react/shared-ts/src/device-linking/digests.js +0 -115
- package/dist/esm/react/shared-ts/src/device-linking/ed25519ExportRoot.js +0 -167
- package/dist/esm/react/shared-ts/src/device-linking/index.js +0 -12
- package/dist/esm/react/shared-ts/src/device-linking/parsers.js +0 -1029
- package/dist/esm/react/shared-ts/src/device-linking/requestProof.js +0 -25
- package/dist/esm/react/shared-ts/src/device-linking/sourceContribution.js +0 -542
- package/dist/esm/react/shared-ts/src/device-linking/walletSessionCredentialDelivery.js +0 -173
- package/dist/esm/react/shared-ts/src/device-linking/wireFields.js +0 -59
- package/dist/esm/react/shared-ts/src/near/actions.js +0 -236
- package/dist/esm/react/shared-ts/src/near/nearClient.js +0 -252
- package/dist/esm/react/shared-ts/src/passkey-custody/ceremonyCommitPayload.js +0 -43
- package/dist/esm/react/shared-ts/src/passkey-custody/custodyEnvelope.js +0 -278
- package/dist/esm/react/shared-ts/src/passkey-custody/custodySecretBinding.js +0 -181
- package/dist/esm/react/shared-ts/src/passkey-custody/index.js +0 -4
- package/dist/esm/react/shared-ts/src/passkey-custody/primitives.js +0 -62
- package/dist/esm/react/shared-ts/src/signing-lanes/evmFamilySigningKeySlotId.js +0 -49
- package/dist/esm/react/shared-ts/src/signing-lanes/index.js +0 -8
- package/dist/esm/react/shared-ts/src/signing-lanes/ownerContinuity.js +0 -62
- package/dist/esm/react/shared-ts/src/signing-lanes/participantDigest.js +0 -2
- package/dist/esm/react/shared-ts/src/signing-lanes/participants.js +0 -256
- package/dist/esm/react/shared-ts/src/signing-lanes/recordParsers.js +0 -479
- package/dist/esm/react/shared-ts/src/signing-lanes/rotationDigests.js +0 -6
- package/dist/esm/react/shared-ts/src/signing-lanes/rotationParsers.js +0 -3
- package/dist/esm/react/shared-ts/src/signing-lanes/rotationProtocolParsers.js +0 -8
- package/dist/esm/react/shared-ts/src/signing-lanes/rotationWireFields.js +0 -3
- package/dist/esm/react/shared-ts/src/threshold/ecdsaDerivationRoleLocalBootstrap.js +0 -39
- package/dist/esm/react/shared-ts/src/threshold/ed25519OperationFingerprint.js +0 -222
- package/dist/esm/react/shared-ts/src/threshold/keyMaterialBrands.js +0 -25
- package/dist/esm/react/shared-ts/src/threshold/participants.js +0 -67
- package/dist/esm/react/shared-ts/src/threshold/secp256k1.js +0 -6
- package/dist/esm/react/shared-ts/src/threshold/sessionPolicy.js +0 -8
- package/dist/esm/react/shared-ts/src/threshold/signingRootScope.js +0 -43
- package/dist/esm/react/shared-ts/src/utils/addAuthMethodRegistration.js +0 -103
- package/dist/esm/react/shared-ts/src/utils/addWalletAuthMethod.js +0 -1
- package/dist/esm/react/shared-ts/src/utils/authenticatorOptions.js +0 -22
- package/dist/esm/react/shared-ts/src/utils/base58.js +0 -28
- package/dist/esm/react/shared-ts/src/utils/base64.js +0 -70
- package/dist/esm/react/shared-ts/src/utils/canonicalPrimitives.js +0 -38
- package/dist/esm/react/shared-ts/src/utils/digestEncoding.js +0 -63
- package/dist/esm/react/shared-ts/src/utils/digests.js +0 -33
- package/dist/esm/react/shared-ts/src/utils/domainIds.js +0 -257
- package/dist/esm/react/shared-ts/src/utils/ecdsaCapabilityActivation.js +0 -67
- package/dist/esm/react/shared-ts/src/utils/ecdsaKeyFactsInventory.js +0 -44
- package/dist/esm/react/shared-ts/src/utils/ecdsaServerTiming.js +0 -38
- package/dist/esm/react/shared-ts/src/utils/emailOtpDomain.js +0 -28
- package/dist/esm/react/shared-ts/src/utils/emailOtpRecoveryKey.js +0 -65
- package/dist/esm/react/shared-ts/src/utils/encoders.js +0 -2
- package/dist/esm/react/shared-ts/src/utils/errors.js +0 -95
- package/dist/esm/react/shared-ts/src/utils/evmRpcResults.js +0 -101
- package/dist/esm/react/shared-ts/src/utils/exactKeys.js +0 -17
- package/dist/esm/react/shared-ts/src/utils/exactRecord.js +0 -44
- package/dist/esm/react/shared-ts/src/utils/index.js +0 -38
- package/dist/esm/react/shared-ts/src/utils/jsonRpc.js +0 -64
- package/dist/esm/react/shared-ts/src/utils/keccak.js +0 -150
- package/dist/esm/react/shared-ts/src/utils/near.js +0 -205
- package/dist/esm/react/shared-ts/src/utils/nearRpcResults.js +0 -205
- package/dist/esm/react/shared-ts/src/utils/normalize.js +0 -86
- package/dist/esm/react/shared-ts/src/utils/registrationAuthMethodInput.js +0 -84
- package/dist/esm/react/shared-ts/src/utils/registrationEstablishedSession.js +0 -275
- package/dist/esm/react/shared-ts/src/utils/registrationIds.js +0 -226
- package/dist/esm/react/shared-ts/src/utils/registrationIntent.js +0 -390
- package/dist/esm/react/shared-ts/src/utils/registrationSignerPlan.js +0 -439
- package/dist/esm/react/shared-ts/src/utils/routerAbEcdsaDerivation.js +0 -1334
- package/dist/esm/react/shared-ts/src/utils/routerAbEd25519Yao.js +0 -747
- package/dist/esm/react/shared-ts/src/utils/routerAbEd25519YaoDigests.js +0 -76
- package/dist/esm/react/shared-ts/src/utils/routerAbNormalSigningIdentity.js +0 -115
- package/dist/esm/react/shared-ts/src/utils/routerAbPublicKeyset.js +0 -11
- package/dist/esm/react/shared-ts/src/utils/routerAbTraceContext.js +0 -36
- package/dist/esm/react/shared-ts/src/utils/secureRandomId.js +0 -35
- package/dist/esm/react/shared-ts/src/utils/signerDomain.js +0 -37
- package/dist/esm/react/shared-ts/src/utils/signerSlot.js +0 -12
- package/dist/esm/react/shared-ts/src/utils/signingSessionSeal.js +0 -98
- package/dist/esm/react/shared-ts/src/utils/theme.js +0 -8
- package/dist/esm/react/shared-ts/src/utils/thresholdEcdsaChainTarget.js +0 -9
- package/dist/esm/react/shared-ts/src/utils/thresholdEcdsaKeyHandle.js +0 -28
- package/dist/esm/react/shared-ts/src/utils/validation.js +0 -92
- package/dist/esm/react/shared-ts/src/utils/walletAddSignerActivation.js +0 -32
- package/dist/esm/react/shared-ts/src/utils/walletAuthAuthority.js +0 -224
- package/dist/esm/react/shared-ts/src/utils/walletAuthMethodRecord.js +0 -357
- package/dist/esm/react/shared-ts/src/utils/walletCapabilityBindings.js +0 -277
- package/dist/esm/react/shared-ts/src/utils/walletSessionFailure.js +0 -28
- package/dist/esm/react/shared-ts/src/utils/webauthnDeviceInfo.js +0 -50
- package/dist/esm/react/shared-ts/src/utils/wireSchema.js +0 -66
- package/dist/esm/react/shared-ts/src/wallet-recovery/index.js +0 -10
- package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeIssuance.js +0 -35
- package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeLocator.js +0 -34
- package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodeReservation.js +0 -24
- package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryCodes.js +0 -3
- package/dist/esm/react/shared-ts/src/wallet-recovery/recoveryKeyId.js +0 -14
- package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryCommittedProjection.js +0 -251
- package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryEcdsaPossession.js +0 -153
- package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryEnvelopeSet.js +0 -84
- package/dist/esm/react/shared-ts/src/wallet-recovery/walletRecoveryRotation.js +0 -64
- package/dist/esm/react/theme/base-styles.js +0 -117
- package/dist/esm/react/theme/palette.js +0 -170
- package/dist/esm/react/utils/deviceDetection.js +0 -95
- package/dist/esm/react/utils/intentDigest.js +0 -77
- package/dist/esm/react/utils/menuItemBlink.js +0 -24
- package/dist/esm/react/utils/qrScanner.js +0 -297
- package/dist/esm/sdk/ConfirmationDrawer-MgFTBwwK.js +0 -425
- package/dist/esm/sdk/EvmClient-f3gUhS2L.js +0 -644
- package/dist/esm/sdk/NearClient-DY4NfHeD.js +0 -402
- package/dist/esm/sdk/NonceCoordinator-4XWPhYww.js +0 -2253
- package/dist/esm/sdk/accountIds-DhIPGOSN.js +0 -23
- package/dist/esm/sdk/accountLifecycle-zthG08aC.js +0 -1341
- package/dist/esm/sdk/actions-CCvThiKe.js +0 -225
- package/dist/esm/sdk/adapters-Dli9XAZp.js +0 -4836
- package/dist/esm/sdk/base-D1B5mGin.js +0 -64
- package/dist/esm/sdk/base64-Clm8C-e9.js +0 -68
- package/dist/esm/sdk/browser-D6eZGhzE.js +0 -2393
- package/dist/esm/sdk/bytes-qKxKn4gg.js +0 -40
- package/dist/esm/sdk/canonicalPrimitives-BTHWz80v.js +0 -36
- package/dist/esm/sdk/canonicalSignerErrorCode-BBIk365e.js +0 -139
- package/dist/esm/sdk/capabilityKinds-hvYqa6S_.js +0 -109
- package/dist/esm/sdk/chains-BMh3btVo.js +0 -124
- package/dist/esm/sdk/challengeDelivery-DZtopOAG.js +0 -74
- package/dist/esm/sdk/chunk-BtrIJ4_z.js +0 -33
- package/dist/esm/sdk/configHelpers-D1EqxVxg.js +0 -179
- package/dist/esm/sdk/csp-stylesheet-btENhsNp.js +0 -215
- package/dist/esm/sdk/defaultConfigs-D_33pPT9.js +0 -355
- package/dist/esm/sdk/display-P4nQF-yc.js +0 -126
- package/dist/esm/sdk/domainIds-lcrFg6Sa.js +0 -338
- package/dist/esm/sdk/ecdsaCapabilityManifest-DuMs0VtU.js +0 -805
- package/dist/esm/sdk/ecdsaChainTarget-Bl-JWyuw.js +0 -121
- package/dist/esm/sdk/ecdsaPresignLifecycle-Bfx2AQKb.js +0 -1983
- package/dist/esm/sdk/ecdsaPresignPoolIdentity-BjxZVIqn.js +0 -47
- package/dist/esm/sdk/ecdsaWalletRecords-D42rtA9z.js +0 -18
- package/dist/esm/sdk/encoders-D8d07vpx.js +0 -0
- package/dist/esm/sdk/enrichDisplayModelWithAbi-CWggsykc.js +0 -395
- package/dist/esm/sdk/enrichDisplayModelWithAbi-SDRwTd_M.js +0 -579
- package/dist/esm/sdk/errors-93h9uAW9.js +0 -92
- package/dist/esm/sdk/events-DYoBL2HO.js +0 -8
- package/dist/esm/sdk/evmCryptoWasm-DWklhEEb.js +0 -196
- package/dist/esm/sdk/evmFamilyEcdsaIdentity-CqGafQsI.js +0 -4274
- package/dist/esm/sdk/exactSessionState-LWDUXydN.js +0 -2592
- package/dist/esm/sdk/exactSigningLaneIdentity-m6uTXV_A.js +0 -335
- package/dist/esm/sdk/executeWorkerOperation-Cl9whMK7.js +0 -10
- package/dist/esm/sdk/export-viewer-host-rWMSQQMP.js +0 -204
- package/dist/esm/sdk/helpers-ZrowMnev.js +0 -302
- package/dist/esm/sdk/host-CnV8nAUe.js +0 -533
- package/dist/esm/sdk/intentDigest-CvOSNlCH.js +0 -75
- package/dist/esm/sdk/jsonRpc-VVkaQkFD.js +0 -62
- package/dist/esm/sdk/jsxRuntime.module-CuH5ZEIA.js +0 -298
- package/dist/esm/sdk/keccak-DUL3d8SF.js +0 -148
- package/dist/esm/sdk/keyMaterialBrands-CogGAAZn.js +0 -94
- package/dist/esm/sdk/localOnly-DTpa2jD5.js +0 -146
- package/dist/esm/sdk/messages-C7Dbx9iN.js +0 -594
- package/dist/esm/sdk/mountExportPrivateKeySurface-DgX-IBG_.js +0 -542
- package/dist/esm/sdk/mountRecoveryCodeBackupSurface-DXrExiJ7.js +0 -590
- package/dist/esm/sdk/nearEd25519YaoMaterialActivation-B5GecIvq.js +0 -4018
- package/dist/esm/sdk/nearEd25519YaoSigningPreparation-CdOT5RuC.js +0 -405
- package/dist/esm/sdk/nearRpcResults-DoUgDATm.js +0 -216
- package/dist/esm/sdk/nonceLaneKeys-C3c9lG6u.js +0 -164
- package/dist/esm/sdk/normalization-CBt413-z.js +0 -22
- package/dist/esm/sdk/operationFingerprint-C8Trar4R.js +0 -929
- package/dist/esm/sdk/operationFingerprint-CGZui5dR.js +0 -55
- package/dist/esm/sdk/passkey-custody-UUHbC0pk.js +0 -487
- package/dist/esm/sdk/pendingWalletRecoveryCodeBackup-BWluQMbt.js +0 -237
- package/dist/esm/sdk/prfCache-wqQSjYLn.js +0 -58
- package/dist/esm/sdk/profileAccountProjection-uZVJuBvS.js +0 -86
- package/dist/esm/sdk/promptText-CuRa_ivd.js +0 -32
- package/dist/esm/sdk/recovery-entrypoint-C3fydnRC.js +0 -779
- package/dist/esm/sdk/registration-Ct_7LdGf.js +0 -14402
- package/dist/esm/sdk/registration-DHERU8R_.js +0 -233
- package/dist/esm/sdk/registrationAccounts-DmWPzf3T.js +0 -33
- package/dist/esm/sdk/registrationIds-DLSdEKSv.js +0 -310
- package/dist/esm/sdk/registrationIntent-4zwk16zQ.js +0 -387
- package/dist/esm/sdk/registrationPreparationPreload-D6zpWp4O.js +0 -13
- package/dist/esm/sdk/registrationSignerPlan-DhV8VAob.js +0 -437
- package/dist/esm/sdk/relayerHttp-VC8Holz1.js +0 -24
- package/dist/esm/sdk/routePlan-D59x5xzQ.js +0 -83
- package/dist/esm/sdk/router-B4ZWFy9E.js +0 -4721
- package/dist/esm/sdk/routerAbNormalSigning-CVFEOZ2m.js +0 -992
- package/dist/esm/sdk/runtime-auth-DdfynDKt.js +0 -5393
- package/dist/esm/sdk/runtime-device-link-HJ2ptFux.js +0 -259
- package/dist/esm/sdk/runtime-ecdsa-tempo-BGLsTAWR.js +0 -177
- package/dist/esm/sdk/runtime-email-otp-CpX88VZJ.js +0 -320
- package/dist/esm/sdk/runtime-export-DIVY473L.js +0 -112
- package/dist/esm/sdk/runtime-near-CxtQi4b2.js +0 -278
- package/dist/esm/sdk/runtime-preferences-vnJc5Svg.js +0 -67
- package/dist/esm/sdk/runtime-recovery-codes-BSCLVHQj.js +0 -95
- package/dist/esm/sdk/runtime-recovery-i08vCJST.js +0 -45
- package/dist/esm/sdk/runtimeContext-D3TBExQ6.js +0 -44484
- package/dist/esm/sdk/runtimeLoader-DQVEFVaW.js +0 -44
- package/dist/esm/sdk/sdkSentEvents-MqDkbQg1.js +0 -599
- package/dist/esm/sdk/secp256k1-D-I6Gh4D.js +0 -2515
- package/dist/esm/sdk/secureRandomId-BORsmdS4.js +0 -33
- package/dist/esm/sdk/sessionPolicy-DO-MkL65.js +0 -460
- package/dist/esm/sdk/shared-DkbeLCI3.js +0 -33
- package/dist/esm/sdk/signEvmFamily-C3C97Th-.js +0 -4607
- package/dist/esm/sdk/signEvmFamilyWithUiConfirmForTempo-BI9DSTIS.js +0 -226
- package/dist/esm/sdk/signEvmWithUiConfirm-Bmcim5-g.js +0 -27
- package/dist/esm/sdk/signNear-Bmb2fj_a.js +0 -5893
- package/dist/esm/sdk/signatureUses-BkGyYt8F.js +0 -51
- package/dist/esm/sdk/signerDomain-IEAVrOrc.js +0 -59
- package/dist/esm/sdk/signerLoader-B7orgq5Z.js +0 -23
- package/dist/esm/sdk/signerSlot-_ovonwVX.js +0 -10
- package/dist/esm/sdk/signingFlow-SZ8t_lxv.js +0 -1319
- package/dist/esm/sdk/signingSessionSeal-Cu-GHm6y.js +0 -96
- package/dist/esm/sdk/surface-measurement-reporter-CSTyRsMa.js +0 -156
- package/dist/esm/sdk/trace-DKLQZvec.js +0 -126
- package/dist/esm/sdk/transaction-activity-CSMCveBn.js +0 -218
- package/dist/esm/sdk/transactionReview-DpHLTznU.js +0 -100
- package/dist/esm/sdk/transactionReviewAdmission-BCPvl8OZ.js +0 -172
- package/dist/esm/sdk/transactionState-CJ4U8pcl.js +0 -1894
- package/dist/esm/sdk/types-Dx9fczU7.js +0 -111
- package/dist/esm/sdk/validation-gat4LEKm.js +0 -409
- package/dist/esm/sdk/wallet-recovery-BX61-79p.js +0 -1902
- package/dist/esm/sdk/walletAuthority-DD9T25F6.js +0 -1247
- package/dist/esm/sdk/walletCustodyEcdsaContinuity-CF4bv9OI.js +0 -11000
- package/dist/esm/sdk/walletIframeIdentity-DB6Z2EC9.js +0 -13
- package/dist/esm/sdk/walletRecoveryCommit-AI1AtIRP.js +0 -2101
- package/dist/esm/sdk/walletRecoveryRotate-BgLlW5ih.js +0 -309
- package/dist/esm/sdk/warmSessionHydration-Os8niEm7.js +0 -7
- package/dist/esm/sdk/webauthnP256-DC5EIbKN.js +0 -82
- package/dist/esm/sdk/webauthnPromptCoordinator-L96oVvLz.js +0 -168
- package/dist/esm/shared-ts/src/signing-lanes/rotationDigests.js +0 -6
- package/dist/esm/shared-ts/src/signing-lanes/rotationParsers.js +0 -3
- package/dist/esm/shared-ts/src/signing-lanes/rotationProtocolParsers.js +0 -8
- package/dist/esm/shared-ts/src/signing-lanes/rotationWireFields.js +0 -3
- package/dist/esm/shared-ts/src/utils/addWalletAuthMethod.js +0 -1
- package/dist/esm/styles.css +0 -43
- package/dist/public/sdk/ConfirmationDrawer-MgFTBwwK.js +0 -425
- package/dist/public/sdk/EvmClient-f3gUhS2L.js +0 -644
- package/dist/public/sdk/NearClient-DY4NfHeD.js +0 -402
- package/dist/public/sdk/NonceCoordinator-4XWPhYww.js +0 -2253
- package/dist/public/sdk/accountIds-DhIPGOSN.js +0 -23
- package/dist/public/sdk/accountLifecycle-zthG08aC.js +0 -1341
- package/dist/public/sdk/actions-CCvThiKe.js +0 -225
- package/dist/public/sdk/adapters-Dli9XAZp.js +0 -4836
- package/dist/public/sdk/base-D1B5mGin.js +0 -64
- package/dist/public/sdk/base64-Clm8C-e9.js +0 -68
- package/dist/public/sdk/browser-D6eZGhzE.js +0 -2393
- package/dist/public/sdk/bytes-qKxKn4gg.js +0 -40
- package/dist/public/sdk/canonicalPrimitives-BTHWz80v.js +0 -36
- package/dist/public/sdk/canonicalSignerErrorCode-BBIk365e.js +0 -139
- package/dist/public/sdk/capabilityKinds-hvYqa6S_.js +0 -109
- package/dist/public/sdk/chains-BMh3btVo.js +0 -124
- package/dist/public/sdk/challengeDelivery-DZtopOAG.js +0 -74
- package/dist/public/sdk/chunk-BtrIJ4_z.js +0 -33
- package/dist/public/sdk/configHelpers-D1EqxVxg.js +0 -179
- package/dist/public/sdk/csp-stylesheet-btENhsNp.js +0 -215
- package/dist/public/sdk/defaultConfigs-D_33pPT9.js +0 -355
- package/dist/public/sdk/display-P4nQF-yc.js +0 -126
- package/dist/public/sdk/domainIds-lcrFg6Sa.js +0 -338
- package/dist/public/sdk/ecdsaCapabilityManifest-DuMs0VtU.js +0 -805
- package/dist/public/sdk/ecdsaChainTarget-Bl-JWyuw.js +0 -121
- package/dist/public/sdk/ecdsaPresignLifecycle-Bfx2AQKb.js +0 -1983
- package/dist/public/sdk/ecdsaPresignPoolIdentity-BjxZVIqn.js +0 -47
- package/dist/public/sdk/ecdsaWalletRecords-D42rtA9z.js +0 -18
- package/dist/public/sdk/encoders-D8d07vpx.js +0 -0
- package/dist/public/sdk/enrichDisplayModelWithAbi-CWggsykc.js +0 -395
- package/dist/public/sdk/enrichDisplayModelWithAbi-SDRwTd_M.js +0 -579
- package/dist/public/sdk/errors-93h9uAW9.js +0 -92
- package/dist/public/sdk/events-DYoBL2HO.js +0 -8
- package/dist/public/sdk/evmCryptoWasm-DWklhEEb.js +0 -196
- package/dist/public/sdk/evmFamilyEcdsaIdentity-CqGafQsI.js +0 -4274
- package/dist/public/sdk/exactSessionState-LWDUXydN.js +0 -2592
- package/dist/public/sdk/exactSigningLaneIdentity-m6uTXV_A.js +0 -335
- package/dist/public/sdk/executeWorkerOperation-Cl9whMK7.js +0 -10
- package/dist/public/sdk/export-viewer-host-rWMSQQMP.js +0 -204
- package/dist/public/sdk/helpers-ZrowMnev.js +0 -302
- package/dist/public/sdk/host-CnV8nAUe.js +0 -533
- package/dist/public/sdk/intentDigest-CvOSNlCH.js +0 -75
- package/dist/public/sdk/jsonRpc-VVkaQkFD.js +0 -62
- package/dist/public/sdk/jsxRuntime.module-CuH5ZEIA.js +0 -298
- package/dist/public/sdk/keccak-DUL3d8SF.js +0 -148
- package/dist/public/sdk/keyMaterialBrands-CogGAAZn.js +0 -94
- package/dist/public/sdk/localOnly-DTpa2jD5.js +0 -146
- package/dist/public/sdk/messages-C7Dbx9iN.js +0 -594
- package/dist/public/sdk/mountExportPrivateKeySurface-DgX-IBG_.js +0 -542
- package/dist/public/sdk/mountRecoveryCodeBackupSurface-DXrExiJ7.js +0 -590
- package/dist/public/sdk/nearEd25519YaoMaterialActivation-B5GecIvq.js +0 -4018
- package/dist/public/sdk/nearEd25519YaoSigningPreparation-CdOT5RuC.js +0 -405
- package/dist/public/sdk/nearRpcResults-DoUgDATm.js +0 -216
- package/dist/public/sdk/nonceLaneKeys-C3c9lG6u.js +0 -164
- package/dist/public/sdk/normalization-CBt413-z.js +0 -22
- package/dist/public/sdk/operationFingerprint-C8Trar4R.js +0 -929
- package/dist/public/sdk/operationFingerprint-CGZui5dR.js +0 -55
- package/dist/public/sdk/passkey-custody-UUHbC0pk.js +0 -487
- package/dist/public/sdk/pendingWalletRecoveryCodeBackup-BWluQMbt.js +0 -237
- package/dist/public/sdk/prfCache-wqQSjYLn.js +0 -58
- package/dist/public/sdk/profileAccountProjection-uZVJuBvS.js +0 -86
- package/dist/public/sdk/promptText-CuRa_ivd.js +0 -32
- package/dist/public/sdk/recovery-entrypoint-C3fydnRC.js +0 -779
- package/dist/public/sdk/registration-Ct_7LdGf.js +0 -14402
- package/dist/public/sdk/registration-DHERU8R_.js +0 -233
- package/dist/public/sdk/registrationAccounts-DmWPzf3T.js +0 -33
- package/dist/public/sdk/registrationIds-DLSdEKSv.js +0 -310
- package/dist/public/sdk/registrationIntent-4zwk16zQ.js +0 -387
- package/dist/public/sdk/registrationPreparationPreload-D6zpWp4O.js +0 -13
- package/dist/public/sdk/registrationSignerPlan-DhV8VAob.js +0 -437
- package/dist/public/sdk/relayerHttp-VC8Holz1.js +0 -24
- package/dist/public/sdk/routePlan-D59x5xzQ.js +0 -83
- package/dist/public/sdk/router-B4ZWFy9E.js +0 -4721
- package/dist/public/sdk/routerAbNormalSigning-CVFEOZ2m.js +0 -992
- package/dist/public/sdk/runtime-auth-DdfynDKt.js +0 -5393
- package/dist/public/sdk/runtime-device-link-HJ2ptFux.js +0 -259
- package/dist/public/sdk/runtime-ecdsa-tempo-BGLsTAWR.js +0 -177
- package/dist/public/sdk/runtime-email-otp-CpX88VZJ.js +0 -320
- package/dist/public/sdk/runtime-export-DIVY473L.js +0 -112
- package/dist/public/sdk/runtime-near-CxtQi4b2.js +0 -278
- package/dist/public/sdk/runtime-preferences-vnJc5Svg.js +0 -67
- package/dist/public/sdk/runtime-recovery-codes-BSCLVHQj.js +0 -95
- package/dist/public/sdk/runtime-recovery-i08vCJST.js +0 -45
- package/dist/public/sdk/runtimeContext-D3TBExQ6.js +0 -44484
- package/dist/public/sdk/runtimeLoader-DQVEFVaW.js +0 -44
- package/dist/public/sdk/sdkSentEvents-MqDkbQg1.js +0 -599
- package/dist/public/sdk/secp256k1-D-I6Gh4D.js +0 -2515
- package/dist/public/sdk/secureRandomId-BORsmdS4.js +0 -33
- package/dist/public/sdk/sessionPolicy-DO-MkL65.js +0 -460
- package/dist/public/sdk/shared-DkbeLCI3.js +0 -33
- package/dist/public/sdk/signEvmFamily-C3C97Th-.js +0 -4607
- package/dist/public/sdk/signEvmFamilyWithUiConfirmForTempo-BI9DSTIS.js +0 -226
- package/dist/public/sdk/signEvmWithUiConfirm-Bmcim5-g.js +0 -27
- package/dist/public/sdk/signNear-Bmb2fj_a.js +0 -5893
- package/dist/public/sdk/signatureUses-BkGyYt8F.js +0 -51
- package/dist/public/sdk/signerDomain-IEAVrOrc.js +0 -59
- package/dist/public/sdk/signerLoader-B7orgq5Z.js +0 -23
- package/dist/public/sdk/signerSlot-_ovonwVX.js +0 -10
- package/dist/public/sdk/signingFlow-SZ8t_lxv.js +0 -1319
- package/dist/public/sdk/signingSessionSeal-Cu-GHm6y.js +0 -96
- package/dist/public/sdk/surface-measurement-reporter-CSTyRsMa.js +0 -156
- package/dist/public/sdk/trace-DKLQZvec.js +0 -126
- package/dist/public/sdk/transaction-activity-CSMCveBn.js +0 -218
- package/dist/public/sdk/transactionReview-DpHLTznU.js +0 -100
- package/dist/public/sdk/transactionReviewAdmission-BCPvl8OZ.js +0 -172
- package/dist/public/sdk/transactionState-CJ4U8pcl.js +0 -1894
- package/dist/public/sdk/types-Dx9fczU7.js +0 -111
- package/dist/public/sdk/validation-gat4LEKm.js +0 -409
- package/dist/public/sdk/wallet-recovery-BX61-79p.js +0 -1902
- package/dist/public/sdk/walletAuthority-DD9T25F6.js +0 -1247
- package/dist/public/sdk/walletCustodyEcdsaContinuity-CF4bv9OI.js +0 -11000
- package/dist/public/sdk/walletIframeIdentity-DB6Z2EC9.js +0 -13
- package/dist/public/sdk/walletRecoveryCommit-AI1AtIRP.js +0 -2101
- package/dist/public/sdk/walletRecoveryRotate-BgLlW5ih.js +0 -309
- package/dist/public/sdk/warmSessionHydration-Os8niEm7.js +0 -7
- package/dist/public/sdk/webauthnP256-DC5EIbKN.js +0 -82
- package/dist/public/sdk/webauthnPromptCoordinator-L96oVvLz.js +0 -168
- package/dist/types/shared-ts/src/signing-lanes/participantDigest.typecheck.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/rotation.typecheck.d.ts +0 -2
- package/dist/types/shared-ts/src/signing-lanes/rotationDigests.d.ts +0 -13
- package/dist/types/shared-ts/src/signing-lanes/rotationLifecycle.d.ts +0 -78
- package/dist/types/shared-ts/src/signing-lanes/rotationParsers.d.ts +0 -27
- package/dist/types/shared-ts/src/signing-lanes/rotationProtocolParsers.d.ts +0 -6
- package/dist/types/shared-ts/src/signing-lanes/rotationWireFields.d.ts +0 -20
- package/dist/types/shared-ts/src/wallet-recovery/recoveryCodeAttempt.d.ts +0 -59
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/transport/webauthn-bridge.d.ts +0 -3
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/laneHolderMaterialStore.d.ts +0 -52
- package/dist/types/wallet/src/core/signingEngine/interfaces/nearKeyOps.d.ts +0 -15
- package/dist/types/wallet/src/core/signingEngine/session/holderShares/forbiddenHolderSharePayloads.typecheck.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/holderShares/holderShareHandle.d.ts +0 -6
- package/dist/types/wallet/src/core/signingEngine/session/identity/emailOtpEcdsaDerivationIdentity.typecheck.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/activationCoordinator.d.ts +0 -37
- package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/laneMaterialInvalidation.d.ts +0 -23
- package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/operations.typecheck.d.ts +0 -2
- package/dist/types/wallet/src/core/signingEngine/session/lanes/operations/recipientPreparation.d.ts +0 -55
- package/dist/types/wallet/src/core/signingEngine/session/warmCapabilities/ecdsaProvisionPlan.typecheck.d.ts +0 -6
- package/dist/types/wallet/src/core/signingEngine/threshold/crypto/ecdsaLaneWasm.d.ts +0 -4
- package/dist/types/wallet/src/core/signingEngine/webauthnAuth/fallbacks/safari-fallbacks.d.ts +0 -44
- package/dist/types/wallet/src/core/signingEngine/workerManager/nearKeyOps/createNearKeyOps.d.ts +0 -4
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/ecdsaLaneHolderWorkerRuntime.d.ts +0 -20
- package/dist/types/wallet/src/core/signingEngine/workerManager/workers/email-otp/passkeyCustodyLink.d.ts +0 -18
- /package/dist/esm/{react/SeamsWeb → SeamsWeb}/assembly/preconnectWalletAssets.js +0 -0
|
@@ -1,3368 +0,0 @@
|
|
|
1
|
-
import { toError } from "../../../shared-ts/src/utils/errors.js";
|
|
2
|
-
import { secureRandomBase36 } from "../../../shared-ts/src/utils/secureRandomId.js";
|
|
3
|
-
import { joinNormalizedUrl, stripTrailingSlashes, toBasePath } from "../../../shared-ts/src/utils/normalize.js";
|
|
4
|
-
import { extractBorshBytesFromPlainSignedTx, isBoolean, isObject, isPlainSignedTransactionLike, stripFunctionsShallow } from "../../../shared-ts/src/utils/validation.js";
|
|
5
|
-
import { SignedTransaction } from "../../../core/rpcClients/near/NearClient.js";
|
|
6
|
-
import { cloneResolvedChainConfig } from "../../../core/config/chains.js";
|
|
7
|
-
import { PASSKEY_MANAGER_DEFAULT_CONFIGS } from "../../../core/config/defaultConfigs.js";
|
|
8
|
-
import { parseMpcMaterialActivationRef } from "../../../shared-ts/src/utils/domainIds.js";
|
|
9
|
-
import { parseWalletSessionOperationCredentialV1 } from "../../../shared-ts/src/device-linking/activeWalletSession.js";
|
|
10
|
-
import { walletIdFromString } from "../../../shared-ts/src/utils/registrationIds.js";
|
|
11
|
-
import { thresholdEcdsaChainTargetsEqual, toWalletId } from "../../../core/signingEngine/interfaces/ecdsaChainTarget.js";
|
|
12
|
-
import { parseExactEcdsaSigningLaneIdentity, parseExactEd25519ExportMaterialIdentity } from "../../../core/signingEngine/session/identity/exactSigningLaneIdentity.js";
|
|
13
|
-
import { parseLinkedDeviceListRequestV1, parseLinkedDeviceListResultV1, parseLinkedDeviceRevokeRequestV1, parseLinkedDeviceRevokeResultV1 } from "../../../shared-ts/src/device-linking/deviceManagement.js";
|
|
14
|
-
import "../../../shared-ts/src/device-linking/index.js";
|
|
15
|
-
import { AccountSyncEventPhase, KeyExportEventPhase, LinkDeviceEventPhase, RegistrationEventPhase, SigningEventPhase, UnlockEventPhase, classifyLinkDeviceFlowEvent, createAccountSyncFlowEvent, createKeyExportFlowEvent, createLinkDeviceFlowEvent, createRegistrationFlowEvent, createSigningFlowEvent, createUnlockFlowEvent, isWalletFlowEvent, parseNearProvisioningState, parseSdkLifecycleEvent } from "../../../core/types/sdkSentEvents.js";
|
|
16
|
-
import { TransactionReviewError, assertTransactionReviewValid, parseTransactionReviewState, reviewedConfirmationConfig, sameTransactionReviewIdentity, transactionReviewCancellationCode } from "../shared/transactionReview.js";
|
|
17
|
-
import { needsExplicitActivation } from "../../../utils/deviceDetection.js";
|
|
18
|
-
import { walletIframeSurfaceIdFromBoundary } from "../../../core/types/walletIframeIdentity.js";
|
|
19
|
-
import { anchorWalletIframeModalGeometry, isWalletIframeModalGeometry, resolveWalletIframeSurfaceGeometry } from "./surface/geometry.js";
|
|
20
|
-
import OverlayController from "./overlay/overlay-controller.js";
|
|
21
|
-
import { WalletIframeSessionExpiredRequestError, parseWalletIframeExactSessionLockResult, parseWalletIframeExactSessionState, parseWalletSessionFromBoundary } from "../shared/exactSessionState.js";
|
|
22
|
-
import { buildPMUnlockPayload } from "../shared/unlockOptions.js";
|
|
23
|
-
import { requireTempoFeeTokenPreferenceSigningRequest } from "../../../core/signingEngine/chains/tempo/feeToken.js";
|
|
24
|
-
import { HOSTED_AUTH_MENU_ERROR_EVENT, buildHostedAuthMenuCancelPayload, buildPMRedeemHostedWalletSeamsSessionPayload, hostedAuthMenuSessionIdFromBoundary, isDeviceLinkEmailOtpBaseFactorSelectionProgressV1, isDeviceLinkTargetFactorActivationProgressV1, isRegistrationTimingSpanV1, parseHostedAuthMenuDemoEmailOtpDelivery, parseHostedAuthMenuErrorEvent, parseHostedAuthMenuExternalAuthRequest, parseHostedAuthMenuExternalAuthResolution, parseHostedAuthMenuOpenRequest, parseHostedAuthMenuOutcome, parseWalletIframeSurfaceMeasurement } from "../shared/messages.js";
|
|
25
|
-
import { TransactionReviewReservation } from "./transactionReviewReservation.js";
|
|
26
|
-
import { OnEventsProgressBus } from "./progress/on-events-progress-bus.js";
|
|
27
|
-
import { registrationSignerSetRequestSelection } from "../../../core/rpcClients/relayer/registrationSignerSetRequest.js";
|
|
28
|
-
import { IframeTransport } from "./transport/IframeTransport.js";
|
|
29
|
-
import { authMenuWalletIframeSurfacePresentation, drawerWalletIframeSurfacePresentation, hiddenWalletIframeSurface, modalWalletIframeSurfacePresentation, passkeyRegistrationPreparationReceipt, reduceWalletIframeSurface, requestSurfaceIdentity, trustedWalletIframeSurfaceMeasurementFromWire, walletIframeConnectionIdFromBoundary } from "./surface/domain.js";
|
|
30
|
-
import { WalletIframeSurfaceRenderer } from "./surface/renderer.js";
|
|
31
|
-
import { WalletIframeTransactionSurfaceQueue } from "./surface/transactionSurfaceQueue.js";
|
|
32
|
-
//#region src/SeamsWeb/walletIframe/client/router.ts
|
|
33
|
-
/**
|
|
34
|
-
* Strips out functions as they cannot be sent over postMessage to iframe
|
|
35
|
-
*/
|
|
36
|
-
function requestSurfaceKindForMessage(type, payload) {
|
|
37
|
-
if (isTransactionSurfaceMessage(type) && confirmationUiModeForRequest(type, payload) === "none" && !needsExplicitActivation()) return null;
|
|
38
|
-
switch (type) {
|
|
39
|
-
case "PM_OPEN_AUTH_MENU": return "auth_menu";
|
|
40
|
-
case "PM_REGISTER_WALLET":
|
|
41
|
-
case "PM_ADD_WALLET_SIGNER":
|
|
42
|
-
case "PM_ADD_PASSKEY":
|
|
43
|
-
case "PM_ROTATE_WALLET_RECOVERY_CODES": return "registration";
|
|
44
|
-
case "PM_ADD_EMAIL_OTP": return "email_otp_enrollment";
|
|
45
|
-
case "PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP": return "recovery_codes";
|
|
46
|
-
case "PM_SIGN_TX_WITH_ACTIONS":
|
|
47
|
-
case "PM_SIGN_AND_SEND_TX":
|
|
48
|
-
case "PM_EXECUTE_ACTION":
|
|
49
|
-
case "PM_SIGN_DELEGATE_ACTION":
|
|
50
|
-
case "PM_SIGN_NEP413":
|
|
51
|
-
case "PM_SIGN_TEMPO": return "transaction";
|
|
52
|
-
case "PM_EXPORT_KEYPAIR_UI": return isObject(payload) && payload.kind === "ecdsa" ? "key_export_threshold" : "key_export_near";
|
|
53
|
-
case "PM_UNLOCK": return "unlock";
|
|
54
|
-
case "PM_SCAN_AND_LINK_DEVICE": return "device_link";
|
|
55
|
-
case "PM_START_DEVICE2_LINKING_FLOW": return "device_link_qr";
|
|
56
|
-
default: return null;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function isTransactionSurfaceMessage(type) {
|
|
60
|
-
switch (type) {
|
|
61
|
-
case "PM_SIGN_TX_WITH_ACTIONS":
|
|
62
|
-
case "PM_SIGN_AND_SEND_TX":
|
|
63
|
-
case "PM_EXECUTE_ACTION":
|
|
64
|
-
case "PM_SIGN_DELEGATE_ACTION":
|
|
65
|
-
case "PM_SIGN_NEP413":
|
|
66
|
-
case "PM_SIGN_TEMPO": return true;
|
|
67
|
-
default: return false;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function confirmationUiModeForRequest(type, payload, fallbackUiMode) {
|
|
71
|
-
if (type === "PM_EXPORT_KEYPAIR_UI" && isObject(payload)) {
|
|
72
|
-
const exportOptions = isObject(payload.options) ? payload.options : null;
|
|
73
|
-
if (exportOptions?.variant === "drawer") return "drawer";
|
|
74
|
-
if (exportOptions?.variant === "modal") return "modal";
|
|
75
|
-
}
|
|
76
|
-
if (!isObject(payload)) return "modal";
|
|
77
|
-
const rootConfig = isObject(payload.confirmationConfig) ? payload.confirmationConfig : null;
|
|
78
|
-
const options = isObject(payload.options) ? payload.options : null;
|
|
79
|
-
const configuredUiMode = (options && isObject(options.confirmationConfig) ? options.confirmationConfig : null)?.uiMode ?? rootConfig?.uiMode ?? fallbackUiMode;
|
|
80
|
-
if (configuredUiMode === "none" || configuredUiMode === "drawer" || configuredUiMode === "modal") return configuredUiMode;
|
|
81
|
-
return "modal";
|
|
82
|
-
}
|
|
83
|
-
function effectiveTransactionSurfaceUiMode(payload, fallbackUiMode) {
|
|
84
|
-
const requested = confirmationUiModeForRequest("PM_SIGN_TX_WITH_ACTIONS", payload, fallbackUiMode);
|
|
85
|
-
if (requested === "none") return needsExplicitActivation() ? "drawer" : "modal";
|
|
86
|
-
return requested;
|
|
87
|
-
}
|
|
88
|
-
function requestSurfacePresentationFor(kind, payload, fallbackUiMode) {
|
|
89
|
-
switch (kind) {
|
|
90
|
-
case "auth_menu": return authMenuWalletIframeSurfacePresentation("Sign in or create an account");
|
|
91
|
-
case "registration": return modalWalletIframeSurfacePresentation("Confirm passkey registration");
|
|
92
|
-
case "email_otp_enrollment": return confirmationUiModeForRequest("PM_ADD_EMAIL_OTP", payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Enter email code") : modalWalletIframeSurfacePresentation("Enter email code");
|
|
93
|
-
case "transaction": return effectiveTransactionSurfaceUiMode(payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Confirm transaction") : modalWalletIframeSurfacePresentation("Confirm transaction");
|
|
94
|
-
case "key_export_near":
|
|
95
|
-
case "key_export_threshold": return confirmationUiModeForRequest("PM_EXPORT_KEYPAIR_UI", payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Confirm key export") : modalWalletIframeSurfacePresentation("Confirm key export");
|
|
96
|
-
case "unlock": return confirmationUiModeForRequest("PM_UNLOCK", payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Unlock wallet") : modalWalletIframeSurfacePresentation("Unlock wallet");
|
|
97
|
-
case "recovery_codes": return modalWalletIframeSurfacePresentation("Wallet recovery codes");
|
|
98
|
-
case "device_link":
|
|
99
|
-
case "device_link_qr": return modalWalletIframeSurfacePresentation("Link a device");
|
|
100
|
-
default: return assertNeverWalletIframeRequestSurfaceKind(kind);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function authMenuSessionIdForMessage(type, payload) {
|
|
104
|
-
if (type !== "PM_OPEN_AUTH_MENU") return null;
|
|
105
|
-
return parseHostedAuthMenuOpenRequest(payload)?.authMenuSessionId ?? null;
|
|
106
|
-
}
|
|
107
|
-
function assertNeverWalletIframeRequestSurfaceKind(value) {
|
|
108
|
-
throw new Error(`Unhandled wallet iframe request surface kind: ${String(value)}`);
|
|
109
|
-
}
|
|
110
|
-
function isTerminalStickyWalletFlowProgress(payload) {
|
|
111
|
-
if (!isWalletFlowEvent(payload)) return false;
|
|
112
|
-
if (payload.flow === "link_device") {
|
|
113
|
-
const outcome = classifyLinkDeviceFlowEvent(payload);
|
|
114
|
-
switch (outcome.kind) {
|
|
115
|
-
case "pending": return false;
|
|
116
|
-
case "active":
|
|
117
|
-
case "invalid_active":
|
|
118
|
-
case "failed":
|
|
119
|
-
case "cancelled": return true;
|
|
120
|
-
default: return assertNeverLinkDeviceFlowOutcome(outcome);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return payload.status === "cancelled" || payload.status === "failed" || payload.phase === KeyExportEventPhase.STEP_05_VIEWER_CLOSED || payload.phase === KeyExportEventPhase.STEP_06_COMPLETED;
|
|
124
|
-
}
|
|
125
|
-
function assertNeverLinkDeviceFlowOutcome(value) {
|
|
126
|
-
throw new Error(`Unhandled link-device flow outcome: ${String(value)}`);
|
|
127
|
-
}
|
|
128
|
-
function shouldHideWalletIframeSurface(payload) {
|
|
129
|
-
if (!isWalletFlowEvent(payload)) return false;
|
|
130
|
-
if (payload.interaction?.overlay !== "hide") return false;
|
|
131
|
-
if (payload.flow !== "key_export") return true;
|
|
132
|
-
return isTerminalStickyWalletFlowProgress(payload);
|
|
133
|
-
}
|
|
134
|
-
function dispatchHostedAuthMenuError(anchorElement, error) {
|
|
135
|
-
anchorElement.dispatchEvent(new CustomEvent(HOSTED_AUTH_MENU_ERROR_EVENT, {
|
|
136
|
-
bubbles: true,
|
|
137
|
-
composed: true,
|
|
138
|
-
detail: error
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
const WALLET_IFRAME_PROGRESS_TIMEOUT_EXTENSION_FACTOR = 4;
|
|
142
|
-
/**
|
|
143
|
-
* Grace period before an unmeasured surface falls back to filling the viewport.
|
|
144
|
-
*
|
|
145
|
-
* Every in-iframe mounter binds a measurement reporter, and the reporter posts
|
|
146
|
-
* as soon as its element exists, so "no measurement" means "nothing is mounted
|
|
147
|
-
* yet" — not "mounted but unmeasurable". Plenty of surfaces mount behind a
|
|
148
|
-
* network round-trip (the email OTP export prompt waits for its challenge to be
|
|
149
|
-
* issued and mailed), so a short deadline declared them broken mid-flight and
|
|
150
|
-
* swapped a hidden provisional box for a full-viewport, unshadowed one that
|
|
151
|
-
* then snapped back once the card finally reported. The deadline is a backstop
|
|
152
|
-
* for a child that never reports at all, so it is sized to outlast a slow
|
|
153
|
-
* request rather than to race one, and progress on the request restarts it.
|
|
154
|
-
*/
|
|
155
|
-
const WALLET_IFRAME_SURFACE_MEASUREMENT_FALLBACK_TIMEOUT_MS = 4e3;
|
|
156
|
-
const WALLET_IFRAME_REGISTRATION_TIMEOUT_MS = 18e4;
|
|
157
|
-
const WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS = 3e4;
|
|
158
|
-
function hostedAuthMenuAnchorMetrics(anchor) {
|
|
159
|
-
if (!anchor?.isConnected) return null;
|
|
160
|
-
const rect = anchor.getBoundingClientRect();
|
|
161
|
-
const layoutWidthCssPx = anchor.offsetWidth;
|
|
162
|
-
if (!Number.isFinite(rect.top) || !Number.isFinite(rect.left) || !Number.isFinite(rect.width) || !Number.isFinite(rect.height) || rect.width <= 0 || rect.height <= 0 || !Number.isFinite(layoutWidthCssPx) || layoutWidthCssPx <= 0) return null;
|
|
163
|
-
return {
|
|
164
|
-
topCssPx: rect.top,
|
|
165
|
-
leftCssPx: rect.left,
|
|
166
|
-
layoutWidthCssPx,
|
|
167
|
-
heightCssPx: rect.height,
|
|
168
|
-
visualScale: rect.width / layoutWidthCssPx
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
const HOSTED_AUTH_MENU_ANCHOR_HEIGHT_CSS_VAR = "--seams-auth-menu-height";
|
|
172
|
-
function pageScrollOffsetCssPx(axis) {
|
|
173
|
-
if (typeof window === "undefined") return 0;
|
|
174
|
-
const value = axis === "x" ? window.scrollX : window.scrollY;
|
|
175
|
-
return Number.isFinite(value) ? value : 0;
|
|
176
|
-
}
|
|
177
|
-
function documentCoordinateAuthMenuGeometry(geometry) {
|
|
178
|
-
return {
|
|
179
|
-
...geometry,
|
|
180
|
-
topCssPx: Math.round(geometry.topCssPx + pageScrollOffsetCssPx("y")),
|
|
181
|
-
leftCssPx: Math.round(geometry.leftCssPx + pageScrollOffsetCssPx("x"))
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
function publishHostedAuthMenuAnchorHeight(anchor, heightCssPx) {
|
|
185
|
-
if (!anchor?.isConnected || !Number.isFinite(heightCssPx) || heightCssPx <= 0) return;
|
|
186
|
-
const next = `${Math.round(heightCssPx)}px`;
|
|
187
|
-
if (anchor.style.getPropertyValue(HOSTED_AUTH_MENU_ANCHOR_HEIGHT_CSS_VAR) === next) return;
|
|
188
|
-
anchor.style.setProperty(HOSTED_AUTH_MENU_ANCHOR_HEIGHT_CSS_VAR, next);
|
|
189
|
-
}
|
|
190
|
-
function buildSignTempoIframePayload(payload) {
|
|
191
|
-
if (payload.request.chain === "tempo") {
|
|
192
|
-
if (payload.chainTarget.kind !== "tempo") throw new Error("[wallet-iframe] Tempo request requires a Tempo target");
|
|
193
|
-
return {
|
|
194
|
-
...payload,
|
|
195
|
-
operationKind: "tempo_transaction",
|
|
196
|
-
request: payload.request,
|
|
197
|
-
chainTarget: payload.chainTarget
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (payload.chainTarget.kind === "evm") return {
|
|
201
|
-
...payload,
|
|
202
|
-
operationKind: "evm_transaction",
|
|
203
|
-
request: payload.request,
|
|
204
|
-
chainTarget: payload.chainTarget
|
|
205
|
-
};
|
|
206
|
-
return {
|
|
207
|
-
...payload,
|
|
208
|
-
operationKind: "tempo_fee_token_preference",
|
|
209
|
-
request: requireTempoFeeTokenPreferenceSigningRequest({
|
|
210
|
-
request: payload.request,
|
|
211
|
-
chainTarget: payload.chainTarget
|
|
212
|
-
}),
|
|
213
|
-
chainTarget: payload.chainTarget
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
const WALLET_IFRAME_EMAIL_OTP_ENROLLMENT_TIMEOUT_MS = 300 * 1e3;
|
|
217
|
-
function walletIframeLoginStatusFromExactSession(state) {
|
|
218
|
-
switch (state.kind) {
|
|
219
|
-
case "active_session":
|
|
220
|
-
case "expired_session":
|
|
221
|
-
case "wallet_authenticated_identity_unresolvable":
|
|
222
|
-
case "wallet_unlocked_without_signing_session": return {
|
|
223
|
-
isLoggedIn: true,
|
|
224
|
-
walletId: state.walletId
|
|
225
|
-
};
|
|
226
|
-
case "wallet_locked": return {
|
|
227
|
-
isLoggedIn: false,
|
|
228
|
-
walletId: null
|
|
229
|
-
};
|
|
230
|
-
default: throw new Error("Wallet iframe exact session state is invalid");
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
function parseResolveExactKeyExportLaneResult(result) {
|
|
234
|
-
switch (result.kind) {
|
|
235
|
-
case "relink_required": return {
|
|
236
|
-
kind: "relink_required",
|
|
237
|
-
reason: result.reason
|
|
238
|
-
};
|
|
239
|
-
case "ecdsa": return {
|
|
240
|
-
kind: "ecdsa",
|
|
241
|
-
laneIdentity: parseExactEcdsaSigningLaneIdentity(result.laneIdentity)
|
|
242
|
-
};
|
|
243
|
-
case "ed25519": {
|
|
244
|
-
const materialActivation = parseMpcMaterialActivationRef(result.materialActivation);
|
|
245
|
-
if (!materialActivation.ok) throw new Error(materialActivation.error.message);
|
|
246
|
-
return {
|
|
247
|
-
kind: "ed25519",
|
|
248
|
-
laneIdentity: parseExactEd25519ExportMaterialIdentity(result.laneIdentity),
|
|
249
|
-
materialActivation: materialActivation.value
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function walletIframeExportPayload(input, options) {
|
|
255
|
-
switch (input.kind) {
|
|
256
|
-
case "ecdsa": {
|
|
257
|
-
const laneIdentity = parseExactEcdsaSigningLaneIdentity(input.laneIdentity);
|
|
258
|
-
if (String(laneIdentity.signer.walletId) !== String(input.walletSession.walletId)) throw new Error("[WalletIframeRouter] key export lane wallet does not match wallet session");
|
|
259
|
-
if (!thresholdEcdsaChainTargetsEqual(laneIdentity.signer.chainTarget, input.chainTarget)) throw new Error("[WalletIframeRouter] key export lane chain target does not match request target");
|
|
260
|
-
return {
|
|
261
|
-
kind: "ecdsa",
|
|
262
|
-
chainTarget: input.chainTarget,
|
|
263
|
-
walletSession: input.walletSession,
|
|
264
|
-
laneIdentity,
|
|
265
|
-
options
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
case "ed25519": {
|
|
269
|
-
const laneIdentity = parseExactEd25519ExportMaterialIdentity(input.laneIdentity);
|
|
270
|
-
if (String(laneIdentity.signer.account.wallet.walletId) !== String(input.walletSession.walletId)) throw new Error("[WalletIframeRouter] Ed25519 export lane wallet does not match wallet session");
|
|
271
|
-
if (String(laneIdentity.signer.account.nearAccountId) !== String(input.nearAccount.accountId)) throw new Error("[WalletIframeRouter] Ed25519 export lane does not match the NEAR account");
|
|
272
|
-
return {
|
|
273
|
-
kind: "ed25519",
|
|
274
|
-
nearAccount: input.nearAccount,
|
|
275
|
-
walletSession: input.walletSession,
|
|
276
|
-
laneIdentity,
|
|
277
|
-
materialActivation: input.materialActivation,
|
|
278
|
-
options
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
const EMAIL_OTP_APP_ORIGIN_FORBIDDEN_RESULT_KEYS = new Set([
|
|
284
|
-
"S",
|
|
285
|
-
"secretS",
|
|
286
|
-
"recoveredS",
|
|
287
|
-
"recoveredSB64u",
|
|
288
|
-
"recoveryKeys",
|
|
289
|
-
"clientSecret32",
|
|
290
|
-
"clientRootShare32",
|
|
291
|
-
"clientRootShare32B64u",
|
|
292
|
-
"clientAdditiveShare32",
|
|
293
|
-
"clientAdditiveShare32B64u",
|
|
294
|
-
"clientSigningShare32",
|
|
295
|
-
"clientSigningShare32B64u",
|
|
296
|
-
"kShareB64u",
|
|
297
|
-
"sigmaShareB64u"
|
|
298
|
-
]);
|
|
299
|
-
function requireNonEmptyBoundaryString(value, label) {
|
|
300
|
-
if (typeof value !== "string" || value.trim() !== value || value.length === 0) throw new Error(`${label} must be a non-empty canonical string`);
|
|
301
|
-
return value;
|
|
302
|
-
}
|
|
303
|
-
function requireCompactExchangeValue(value, label) {
|
|
304
|
-
const parsed = requireNonEmptyBoundaryString(value, label);
|
|
305
|
-
if (parsed.length > 512 || /[\s\u0000-\u001f\u007f]/.test(parsed)) throw new Error(`${label} must be a compact opaque identifier`);
|
|
306
|
-
return parsed;
|
|
307
|
-
}
|
|
308
|
-
function assertExactBoundaryFields(value, fields, label) {
|
|
309
|
-
if (!isObject(value) || Object.keys(value).length !== fields.size) throw new Error(`${label} must be an exact object`);
|
|
310
|
-
for (const field of fields) if (!Object.hasOwn(value, field)) throw new Error(`Missing ${label} field: ${field}`);
|
|
311
|
-
return value;
|
|
312
|
-
}
|
|
313
|
-
function parseHostedWalletExchangeFailure(value, status) {
|
|
314
|
-
const record = assertExactBoundaryFields(value, new Set([
|
|
315
|
-
"ok",
|
|
316
|
-
"code",
|
|
317
|
-
"message"
|
|
318
|
-
]), "session exchange failure");
|
|
319
|
-
if (record.ok !== false) throw new Error("session exchange failure is invalid");
|
|
320
|
-
const code = requireNonEmptyBoundaryString(record.code, "session exchange error code");
|
|
321
|
-
const message = requireNonEmptyBoundaryString(record.message, "session exchange error message");
|
|
322
|
-
const error = new Error(message);
|
|
323
|
-
error.code = code;
|
|
324
|
-
error.status = status;
|
|
325
|
-
return error;
|
|
326
|
-
}
|
|
327
|
-
function parseHostedWalletExchangeDelivery(value, expected) {
|
|
328
|
-
const response = assertExactBoundaryFields(value, new Set(["ok", "delivery"]), "session exchange response");
|
|
329
|
-
if (response.ok !== true) throw new Error("session exchange response must contain one delivery");
|
|
330
|
-
const deliveryFields = new Set([
|
|
331
|
-
"exchangeCode",
|
|
332
|
-
"nonce",
|
|
333
|
-
"appOrigin",
|
|
334
|
-
"walletOrigin",
|
|
335
|
-
"expiresAtMs"
|
|
336
|
-
]);
|
|
337
|
-
const delivery = assertExactBoundaryFields(response.delivery, deliveryFields, "session exchange delivery");
|
|
338
|
-
const appOrigin = requireNonEmptyBoundaryString(delivery.appOrigin, "delivery.appOrigin");
|
|
339
|
-
const walletOrigin = requireNonEmptyBoundaryString(delivery.walletOrigin, "delivery.walletOrigin");
|
|
340
|
-
if (appOrigin !== expected.appOrigin || walletOrigin !== expected.walletOrigin) throw new Error("session exchange delivery origin binding does not match the iframe");
|
|
341
|
-
const expiresAtMs = Number(delivery.expiresAtMs);
|
|
342
|
-
if (!Number.isSafeInteger(expiresAtMs) || expiresAtMs <= Date.now()) throw new Error("session exchange delivery is expired");
|
|
343
|
-
return {
|
|
344
|
-
exchangeCode: requireCompactExchangeValue(delivery.exchangeCode, "delivery.exchangeCode"),
|
|
345
|
-
nonce: requireCompactExchangeValue(delivery.nonce, "delivery.nonce"),
|
|
346
|
-
appOrigin,
|
|
347
|
-
walletOrigin,
|
|
348
|
-
expiresAtMs
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
function parseHostedWalletSeamsSessionRedemption(value) {
|
|
352
|
-
const result = assertExactBoundaryFields(value, new Set(["kind", "expiresAtMs"]), "hosted-wallet session redemption result");
|
|
353
|
-
if (result.kind !== "redeemed_hosted_wallet_seams_session") throw new Error("wallet iframe returned an invalid hosted-wallet session redemption");
|
|
354
|
-
const expiresAtMs = Number(result.expiresAtMs);
|
|
355
|
-
if (!Number.isSafeInteger(expiresAtMs) || expiresAtMs <= Date.now()) throw new Error("wallet iframe returned an expired hosted-wallet session redemption");
|
|
356
|
-
return {
|
|
357
|
-
kind: result.kind,
|
|
358
|
-
expiresAtMs
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
async function readSessionExchangeJson(response) {
|
|
362
|
-
try {
|
|
363
|
-
return await response.json();
|
|
364
|
-
} catch {
|
|
365
|
-
return null;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
function canonicalHostedWalletRelayUrl(value) {
|
|
369
|
-
return stripTrailingSlashes(requireNonEmptyBoundaryString(value, "hosted-wallet relayUrl"));
|
|
370
|
-
}
|
|
371
|
-
function hostedWalletSessionSourcesMatch(left, right) {
|
|
372
|
-
return left !== null && canonicalHostedWalletRelayUrl(left.relayUrl) === canonicalHostedWalletRelayUrl(right.relayUrl) && left.operationCredential.walletSessionId === right.operationCredential.walletSessionId && left.operationCredential.token === right.operationCredential.token;
|
|
373
|
-
}
|
|
374
|
-
function hostedWalletSeamsSessionSource(input) {
|
|
375
|
-
if (input.operationCredential === void 0) return null;
|
|
376
|
-
return {
|
|
377
|
-
relayUrl: canonicalHostedWalletRelayUrl(input.relayUrl),
|
|
378
|
-
operationCredential: parseWalletSessionOperationCredentialV1(input.operationCredential)
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
function hostedWalletSeamsSessionSourceFromUnlock(request, defaultRelayUrl) {
|
|
382
|
-
if (request.kind !== "custom_options") return null;
|
|
383
|
-
const inventory = request.options.ecdsaKeyFactsInventory;
|
|
384
|
-
if (!inventory || inventory.mode !== "wallet_session_operation_credential_v1" || inventory.operationCredential.kind !== "opaque_wallet_session_operation_credential_v1") return null;
|
|
385
|
-
return hostedWalletSeamsSessionSource({
|
|
386
|
-
relayUrl: defaultRelayUrl,
|
|
387
|
-
operationCredential: inventory.operationCredential
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
function assertNeverRegistrationAuthMethod(value) {
|
|
391
|
-
throw new Error(`Unsupported registration auth method: ${String(value)}`);
|
|
392
|
-
}
|
|
393
|
-
function hostedWalletRegistrationTransport(authMethod) {
|
|
394
|
-
switch (authMethod.kind) {
|
|
395
|
-
case "passkey": return {
|
|
396
|
-
authMethod: {
|
|
397
|
-
kind: "passkey",
|
|
398
|
-
rpId: authMethod.rpId,
|
|
399
|
-
...authMethod.authenticatorOptions === void 0 ? {} : { authenticatorOptions: authMethod.authenticatorOptions }
|
|
400
|
-
},
|
|
401
|
-
sessionSource: null
|
|
402
|
-
};
|
|
403
|
-
case "email_otp": switch (authMethod.proofKind) {
|
|
404
|
-
case "otp_challenge": return {
|
|
405
|
-
authMethod: {
|
|
406
|
-
kind: "email_otp",
|
|
407
|
-
proofKind: "otp_challenge",
|
|
408
|
-
email: authMethod.email,
|
|
409
|
-
providerSubject: authMethod.providerSubject,
|
|
410
|
-
otpCode: authMethod.otpCode,
|
|
411
|
-
...authMethod.challengeId === void 0 ? {} : { challengeId: authMethod.challengeId }
|
|
412
|
-
},
|
|
413
|
-
sessionSource: null
|
|
414
|
-
};
|
|
415
|
-
case "google_sso_registration": return {
|
|
416
|
-
authMethod: {
|
|
417
|
-
kind: "email_otp",
|
|
418
|
-
proofKind: "google_sso_registration",
|
|
419
|
-
email: authMethod.email,
|
|
420
|
-
providerSubject: authMethod.providerSubject,
|
|
421
|
-
googleEmailOtpRegistrationAttemptId: authMethod.googleEmailOtpRegistrationAttemptId,
|
|
422
|
-
googleEmailOtpRegistrationOfferId: authMethod.googleEmailOtpRegistrationOfferId,
|
|
423
|
-
googleEmailOtpRegistrationCandidateId: authMethod.googleEmailOtpRegistrationCandidateId
|
|
424
|
-
},
|
|
425
|
-
sessionSource: null
|
|
426
|
-
};
|
|
427
|
-
default: return assertNeverRegistrationAuthMethod(authMethod);
|
|
428
|
-
}
|
|
429
|
-
default: return assertNeverRegistrationAuthMethod(authMethod);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
function walletIframeSurfaceBusyError(detail) {
|
|
433
|
-
const error = /* @__PURE__ */ new Error("The wallet iframe is reserved by an active foreground surface");
|
|
434
|
-
error.code = "wallet_iframe_surface_busy";
|
|
435
|
-
if (detail) error.detail = detail;
|
|
436
|
-
return error;
|
|
437
|
-
}
|
|
438
|
-
var WalletIframeConnectionClosedRequestError = class extends Error {
|
|
439
|
-
constructor(requestId, connectionId, requestType) {
|
|
440
|
-
super(`Wallet iframe connection closed while handling ${requestType}`);
|
|
441
|
-
this.requestId = requestId;
|
|
442
|
-
this.connectionId = connectionId;
|
|
443
|
-
this.code = "connection_closed";
|
|
444
|
-
this.name = "WalletIframeConnectionClosedRequestError";
|
|
445
|
-
}
|
|
446
|
-
};
|
|
447
|
-
function createTerminalProgressForRequest(args) {
|
|
448
|
-
const { requestType, requestId, status, message, errorCode } = args;
|
|
449
|
-
const common = {
|
|
450
|
-
flowId: `wallet-iframe:${requestType}:${requestId}`,
|
|
451
|
-
requestId,
|
|
452
|
-
status,
|
|
453
|
-
message,
|
|
454
|
-
error: {
|
|
455
|
-
...errorCode ? { code: errorCode } : {},
|
|
456
|
-
message
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
const registrationRequests = new Set([
|
|
460
|
-
"PM_REGISTER_WALLET",
|
|
461
|
-
"PM_ADD_PASSKEY",
|
|
462
|
-
"PM_REQUEST_EMAIL_OTP_ENROLLMENT_CHALLENGE",
|
|
463
|
-
"PM_ENROLL_EMAIL_OTP"
|
|
464
|
-
]);
|
|
465
|
-
const unlockRequests = new Set([
|
|
466
|
-
"PM_UNLOCK",
|
|
467
|
-
"PM_BOOTSTRAP_THRESHOLD_ECDSA_SESSION",
|
|
468
|
-
"PM_REQUEST_EMAIL_OTP_CHALLENGE",
|
|
469
|
-
"PM_LOGIN_EMAIL_OTP_ECDSA_CAPABILITY"
|
|
470
|
-
]);
|
|
471
|
-
const signingRequests = new Set([
|
|
472
|
-
"PM_SIGN_TX_WITH_ACTIONS",
|
|
473
|
-
"PM_SIGN_AND_SEND_TX",
|
|
474
|
-
"PM_SEND_TRANSACTION",
|
|
475
|
-
"PM_EXECUTE_ACTION",
|
|
476
|
-
"PM_SIGN_DELEGATE_ACTION",
|
|
477
|
-
"PM_SIGN_NEP413",
|
|
478
|
-
"PM_SIGN_TEMPO",
|
|
479
|
-
"PM_REPORT_TEMPO_BROADCAST_ACCEPTED",
|
|
480
|
-
"PM_REPORT_TEMPO_BROADCAST_REJECTED",
|
|
481
|
-
"PM_REPORT_TEMPO_FINALIZED",
|
|
482
|
-
"PM_REPORT_TEMPO_DROPPED_OR_REPLACED",
|
|
483
|
-
"PM_RECONCILE_TEMPO_NONCE_LANE"
|
|
484
|
-
]);
|
|
485
|
-
const linkDeviceRequests = new Set([
|
|
486
|
-
"PM_SCAN_AND_LINK_DEVICE",
|
|
487
|
-
"PM_START_DEVICE2_LINKING_FLOW",
|
|
488
|
-
"PM_CANCEL_DEVICE_LINKING"
|
|
489
|
-
]);
|
|
490
|
-
if (registrationRequests.has(requestType)) return createRegistrationFlowEvent({
|
|
491
|
-
...common,
|
|
492
|
-
phase: status === "cancelled" ? RegistrationEventPhase.CANCELLED : RegistrationEventPhase.FAILED
|
|
493
|
-
});
|
|
494
|
-
if (unlockRequests.has(requestType)) return createUnlockFlowEvent({
|
|
495
|
-
...common,
|
|
496
|
-
phase: status === "cancelled" ? UnlockEventPhase.CANCELLED : UnlockEventPhase.FAILED
|
|
497
|
-
});
|
|
498
|
-
if (signingRequests.has(requestType)) return createSigningFlowEvent({
|
|
499
|
-
...common,
|
|
500
|
-
phase: status === "cancelled" ? SigningEventPhase.CANCELLED : SigningEventPhase.FAILED
|
|
501
|
-
});
|
|
502
|
-
if (linkDeviceRequests.has(requestType)) return createLinkDeviceFlowEvent({
|
|
503
|
-
...common,
|
|
504
|
-
phase: status === "cancelled" ? LinkDeviceEventPhase.CANCELLED : LinkDeviceEventPhase.FAILED
|
|
505
|
-
});
|
|
506
|
-
if (requestType === "PM_SYNC_ACCOUNT_FLOW") return createAccountSyncFlowEvent({
|
|
507
|
-
...common,
|
|
508
|
-
phase: status === "cancelled" ? AccountSyncEventPhase.CANCELLED : AccountSyncEventPhase.FAILED
|
|
509
|
-
});
|
|
510
|
-
if (requestType === "PM_EXPORT_KEYPAIR_UI") return createKeyExportFlowEvent({
|
|
511
|
-
...common,
|
|
512
|
-
phase: status === "cancelled" ? KeyExportEventPhase.CANCELLED : KeyExportEventPhase.FAILED
|
|
513
|
-
});
|
|
514
|
-
return null;
|
|
515
|
-
}
|
|
516
|
-
function sanitizeEmailOtpIframeResult(value) {
|
|
517
|
-
if (Array.isArray(value)) return value.map((entry) => sanitizeEmailOtpIframeResult(entry));
|
|
518
|
-
if (!isObject(value)) return value;
|
|
519
|
-
const out = {};
|
|
520
|
-
for (const [key, entry] of Object.entries(value)) {
|
|
521
|
-
if (EMAIL_OTP_APP_ORIGIN_FORBIDDEN_RESULT_KEYS.has(key)) continue;
|
|
522
|
-
out[key] = sanitizeEmailOtpIframeResult(entry);
|
|
523
|
-
}
|
|
524
|
-
return out;
|
|
525
|
-
}
|
|
526
|
-
const CANONICAL_SIGNER_BOUNDARY_MESSAGES = {
|
|
527
|
-
commit_queue_overflow: "Threshold signing commit queue is full. Wait for pending requests and retry.",
|
|
528
|
-
commit_queue_timeout: "Threshold signing commit request timed out in queue. Retry the request.",
|
|
529
|
-
threshold_ed25519_session_not_ready: "Threshold Ed25519 signing session is not ready. Refresh the signing session and retry.",
|
|
530
|
-
threshold_ecdsa_session_not_ready: "Threshold ECDSA signing session is not ready. Refresh the signing session and retry.",
|
|
531
|
-
threshold_session_kind_mismatch: "Threshold signing session kind mismatch. Refresh the signing session and retry.",
|
|
532
|
-
session_not_ready: "Threshold signing session is not ready. Refresh the signing session and retry.",
|
|
533
|
-
nonce_conflict_retryable: "Nonce conflict detected. Refresh nonce state and retry the request.",
|
|
534
|
-
rpc_request_failed: "RPC request failed. Retry the request or use another RPC endpoint.",
|
|
535
|
-
wallet_signing_material_invalid: "Wallet signing material is invalid. Log in again or recover the wallet.",
|
|
536
|
-
wallet_full_login_required: "A full wallet login is required before signing.",
|
|
537
|
-
wallet_signing_material_temporarily_unavailable: "Wallet signing material storage is temporarily unavailable. Retry the operation.",
|
|
538
|
-
wallet_operation_step_up_cancelled: "Request cancelled.",
|
|
539
|
-
cancelled: "Request cancelled."
|
|
540
|
-
};
|
|
541
|
-
function isTerminalWalletStateErrorCode(code) {
|
|
542
|
-
return code === "wallet_signing_material_invalid" || code === "wallet_full_login_required" || code === "wallet_operation_step_up_cancelled";
|
|
543
|
-
}
|
|
544
|
-
function isWalletOperationCancellationCode(code) {
|
|
545
|
-
return code === "cancelled" || code === "wallet_operation_step_up_cancelled";
|
|
546
|
-
}
|
|
547
|
-
function resolveCanonicalSignerBoundaryMessage(rawCode, fallbackMessage) {
|
|
548
|
-
const code = String(rawCode || "").trim().toLowerCase();
|
|
549
|
-
if (code && CANONICAL_SIGNER_BOUNDARY_MESSAGES[code]) return CANONICAL_SIGNER_BOUNDARY_MESSAGES[code];
|
|
550
|
-
return String(fallbackMessage || "").trim() || "Wallet error";
|
|
551
|
-
}
|
|
552
|
-
function walletIframeRequestCancelledError() {
|
|
553
|
-
const error = new Error(CANONICAL_SIGNER_BOUNDARY_MESSAGES.cancelled);
|
|
554
|
-
error.code = "cancelled";
|
|
555
|
-
return error;
|
|
556
|
-
}
|
|
557
|
-
function emitDemoEmailOtpCodeFromWire(args) {
|
|
558
|
-
if (args.wire.mode !== "login") return;
|
|
559
|
-
switch (args.wire.delivery.kind) {
|
|
560
|
-
case "provider": return;
|
|
561
|
-
case "demo_code_response":
|
|
562
|
-
case "provider_and_demo_code":
|
|
563
|
-
args.onDemoOtp?.(args.wire.delivery);
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
function rawClientMessageObject(value) {
|
|
568
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
569
|
-
}
|
|
570
|
-
function hasOnlyClientMessageFields(value, allowedFields) {
|
|
571
|
-
const allowed = new Set(allowedFields);
|
|
572
|
-
return Object.keys(value).every((field) => allowed.has(field));
|
|
573
|
-
}
|
|
574
|
-
function clientChildRequestId(value) {
|
|
575
|
-
if (!Object.hasOwn(value, "requestId")) return void 0;
|
|
576
|
-
const requestId = Reflect.get(value, "requestId");
|
|
577
|
-
if (requestId === void 0) return void 0;
|
|
578
|
-
return typeof requestId === "string" ? requestId : null;
|
|
579
|
-
}
|
|
580
|
-
function clientChildRequestIdFields(requestId) {
|
|
581
|
-
return requestId === void 0 ? {} : { requestId };
|
|
582
|
-
}
|
|
583
|
-
function parseClientPreferencesChangedPayload(value) {
|
|
584
|
-
const record = rawClientMessageObject(value);
|
|
585
|
-
if (!record || !hasOnlyClientMessageFields(record, [
|
|
586
|
-
"walletId",
|
|
587
|
-
"confirmationConfig",
|
|
588
|
-
"updatedAt"
|
|
589
|
-
])) return null;
|
|
590
|
-
const walletId = Reflect.get(record, "walletId");
|
|
591
|
-
if (walletId !== null && typeof walletId !== "string") return null;
|
|
592
|
-
const confirmationConfig = rawClientMessageObject(Reflect.get(record, "confirmationConfig"));
|
|
593
|
-
if (!confirmationConfig || !hasOnlyClientMessageFields(confirmationConfig, [
|
|
594
|
-
"uiMode",
|
|
595
|
-
"behavior",
|
|
596
|
-
"autoProceedDelay"
|
|
597
|
-
])) return null;
|
|
598
|
-
const uiMode = Reflect.get(confirmationConfig, "uiMode");
|
|
599
|
-
const behavior = Reflect.get(confirmationConfig, "behavior");
|
|
600
|
-
if (uiMode !== "none" && uiMode !== "modal" && uiMode !== "drawer") return null;
|
|
601
|
-
if (behavior !== "requireClick" && behavior !== "skipClick") return null;
|
|
602
|
-
const autoProceedDelay = Reflect.get(confirmationConfig, "autoProceedDelay");
|
|
603
|
-
if (autoProceedDelay !== void 0 && (typeof autoProceedDelay !== "number" || !Number.isFinite(autoProceedDelay))) return null;
|
|
604
|
-
const updatedAt = Reflect.get(record, "updatedAt");
|
|
605
|
-
if (typeof updatedAt !== "number" || !Number.isFinite(updatedAt)) return null;
|
|
606
|
-
return {
|
|
607
|
-
walletId,
|
|
608
|
-
confirmationConfig: autoProceedDelay === void 0 ? {
|
|
609
|
-
uiMode,
|
|
610
|
-
behavior
|
|
611
|
-
} : {
|
|
612
|
-
uiMode,
|
|
613
|
-
behavior,
|
|
614
|
-
autoProceedDelay
|
|
615
|
-
},
|
|
616
|
-
updatedAt
|
|
617
|
-
};
|
|
618
|
-
}
|
|
619
|
-
function isClientDeviceLinkProgressCandidate(value) {
|
|
620
|
-
const record = rawClientMessageObject(value);
|
|
621
|
-
if (!record) return false;
|
|
622
|
-
const event = Reflect.get(record, "event");
|
|
623
|
-
return event === "wallet_device_link_email_otp_base_factor_selection_required_v1" || event === "wallet_device_link_target_factor_activation_v1";
|
|
624
|
-
}
|
|
625
|
-
function parseClientProgressPayload(value) {
|
|
626
|
-
if (isWalletFlowEvent(value)) return value;
|
|
627
|
-
if (isRegistrationTimingSpanV1(value)) return value;
|
|
628
|
-
if (!isClientDeviceLinkProgressCandidate(value)) return null;
|
|
629
|
-
if (isDeviceLinkEmailOtpBaseFactorSelectionProgressV1(value)) return value;
|
|
630
|
-
return isDeviceLinkTargetFactorActivationProgressV1(value) ? value : null;
|
|
631
|
-
}
|
|
632
|
-
function parseClientPmResultPayload(value) {
|
|
633
|
-
const record = rawClientMessageObject(value);
|
|
634
|
-
if (!record || !hasOnlyClientMessageFields(record, [
|
|
635
|
-
"ok",
|
|
636
|
-
"result",
|
|
637
|
-
"error"
|
|
638
|
-
])) return null;
|
|
639
|
-
const ok = Reflect.get(record, "ok");
|
|
640
|
-
if (typeof ok !== "boolean") return null;
|
|
641
|
-
const error = Reflect.get(record, "error");
|
|
642
|
-
if (error !== void 0 && typeof error !== "string") return null;
|
|
643
|
-
return {
|
|
644
|
-
ok,
|
|
645
|
-
...Object.hasOwn(record, "result") ? { result: Reflect.get(record, "result") } : {},
|
|
646
|
-
...error !== void 0 ? { error } : {}
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
function parseClientErrorPayload(value) {
|
|
650
|
-
const record = rawClientMessageObject(value);
|
|
651
|
-
if (!record || !hasOnlyClientMessageFields(record, [
|
|
652
|
-
"code",
|
|
653
|
-
"message",
|
|
654
|
-
"details"
|
|
655
|
-
])) return null;
|
|
656
|
-
const code = Reflect.get(record, "code");
|
|
657
|
-
const message = Reflect.get(record, "message");
|
|
658
|
-
if (typeof code !== "string" || typeof message !== "string") return null;
|
|
659
|
-
return {
|
|
660
|
-
code,
|
|
661
|
-
message,
|
|
662
|
-
...Object.hasOwn(record, "details") ? { details: Reflect.get(record, "details") } : {}
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
function parseClientChildToParentEnvelope(value) {
|
|
666
|
-
const record = rawClientMessageObject(value);
|
|
667
|
-
if (!record || !hasOnlyClientMessageFields(record, [
|
|
668
|
-
"type",
|
|
669
|
-
"requestId",
|
|
670
|
-
"payload"
|
|
671
|
-
])) return null;
|
|
672
|
-
const requestId = clientChildRequestId(record);
|
|
673
|
-
if (requestId === null) return null;
|
|
674
|
-
const requestIdFields = clientChildRequestIdFields(requestId);
|
|
675
|
-
const type = Reflect.get(record, "type");
|
|
676
|
-
switch (type) {
|
|
677
|
-
case "PONG": return Object.hasOwn(record, "payload") ? null : {
|
|
678
|
-
...requestIdFields,
|
|
679
|
-
type
|
|
680
|
-
};
|
|
681
|
-
case "PREFERENCES_CHANGED": {
|
|
682
|
-
const payload = parseClientPreferencesChangedPayload(Reflect.get(record, "payload"));
|
|
683
|
-
return payload ? {
|
|
684
|
-
...requestIdFields,
|
|
685
|
-
type,
|
|
686
|
-
payload
|
|
687
|
-
} : null;
|
|
688
|
-
}
|
|
689
|
-
case "AUTH_MENU_EXTERNAL_AUTH_REQUEST": {
|
|
690
|
-
const payload = parseHostedAuthMenuExternalAuthRequest(Reflect.get(record, "payload"));
|
|
691
|
-
return payload ? {
|
|
692
|
-
...requestIdFields,
|
|
693
|
-
type,
|
|
694
|
-
payload
|
|
695
|
-
} : null;
|
|
696
|
-
}
|
|
697
|
-
case "AUTH_MENU_ERROR": {
|
|
698
|
-
const payload = parseHostedAuthMenuErrorEvent(Reflect.get(record, "payload"));
|
|
699
|
-
return payload ? {
|
|
700
|
-
...requestIdFields,
|
|
701
|
-
type,
|
|
702
|
-
payload
|
|
703
|
-
} : null;
|
|
704
|
-
}
|
|
705
|
-
case "AUTH_MENU_DEMO_EMAIL_OTP_DELIVERY": {
|
|
706
|
-
const payload = parseHostedAuthMenuDemoEmailOtpDelivery(Reflect.get(record, "payload"));
|
|
707
|
-
return payload ? {
|
|
708
|
-
...requestIdFields,
|
|
709
|
-
type,
|
|
710
|
-
payload
|
|
711
|
-
} : null;
|
|
712
|
-
}
|
|
713
|
-
case "TRANSACTION_REVIEW_STATE": {
|
|
714
|
-
const payload = parseTransactionReviewState(Reflect.get(record, "payload"));
|
|
715
|
-
return payload ? {
|
|
716
|
-
...requestIdFields,
|
|
717
|
-
type,
|
|
718
|
-
payload
|
|
719
|
-
} : null;
|
|
720
|
-
}
|
|
721
|
-
case "SURFACE_MEASUREMENT": {
|
|
722
|
-
const payload = parseWalletIframeSurfaceMeasurement(Reflect.get(record, "payload"));
|
|
723
|
-
return payload ? {
|
|
724
|
-
...requestIdFields,
|
|
725
|
-
type,
|
|
726
|
-
payload
|
|
727
|
-
} : null;
|
|
728
|
-
}
|
|
729
|
-
case "TRANSACTION_ACTIVITY": {
|
|
730
|
-
const payload = Reflect.get(record, "payload");
|
|
731
|
-
return typeof requestId === "string" && (payload === "expanded" || payload === "toast" || payload === "closed") ? {
|
|
732
|
-
type,
|
|
733
|
-
requestId,
|
|
734
|
-
payload
|
|
735
|
-
} : null;
|
|
736
|
-
}
|
|
737
|
-
case "PROGRESS": {
|
|
738
|
-
const payload = parseClientProgressPayload(Reflect.get(record, "payload"));
|
|
739
|
-
return payload ? {
|
|
740
|
-
...requestIdFields,
|
|
741
|
-
type,
|
|
742
|
-
payload
|
|
743
|
-
} : null;
|
|
744
|
-
}
|
|
745
|
-
case "PM_RESULT": {
|
|
746
|
-
const payload = parseClientPmResultPayload(Reflect.get(record, "payload"));
|
|
747
|
-
return payload ? {
|
|
748
|
-
...requestIdFields,
|
|
749
|
-
type,
|
|
750
|
-
payload
|
|
751
|
-
} : null;
|
|
752
|
-
}
|
|
753
|
-
case "ERROR": {
|
|
754
|
-
const payload = parseClientErrorPayload(Reflect.get(record, "payload"));
|
|
755
|
-
return payload ? {
|
|
756
|
-
...requestIdFields,
|
|
757
|
-
type,
|
|
758
|
-
payload
|
|
759
|
-
} : null;
|
|
760
|
-
}
|
|
761
|
-
default: return null;
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
function parseSdkLifecycleEnvelope(value) {
|
|
765
|
-
if (!isObject(value) || value.type !== "SDK_LIFECYCLE_EVENT") return { kind: "not_lifecycle_event" };
|
|
766
|
-
const event = parseSdkLifecycleEvent(value.payload);
|
|
767
|
-
if (!event) return { kind: "invalid_lifecycle_event" };
|
|
768
|
-
return {
|
|
769
|
-
kind: "lifecycle_event",
|
|
770
|
-
event
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
function assertNeverSdkLifecycleEventName(value) {
|
|
774
|
-
throw new Error(`Unsupported SDK lifecycle event: ${String(value)}`);
|
|
775
|
-
}
|
|
776
|
-
var WalletIframeRouter = class {
|
|
777
|
-
constructor(options) {
|
|
778
|
-
this.state = {
|
|
779
|
-
port: null,
|
|
780
|
-
connectionId: null,
|
|
781
|
-
ready: false,
|
|
782
|
-
configured: false,
|
|
783
|
-
configurationInFlight: null,
|
|
784
|
-
initInFlight: null,
|
|
785
|
-
hostedWalletSessionInFlight: null,
|
|
786
|
-
hostedWalletSessionExpiresAtMs: 0,
|
|
787
|
-
hostedWalletSessionSource: null,
|
|
788
|
-
pending: /* @__PURE__ */ new Map(),
|
|
789
|
-
reqCounter: 0
|
|
790
|
-
};
|
|
791
|
-
this.listeners = {
|
|
792
|
-
ready: /* @__PURE__ */ new Set(),
|
|
793
|
-
loginStatus: /* @__PURE__ */ new Set(),
|
|
794
|
-
preferencesChanged: /* @__PURE__ */ new Set(),
|
|
795
|
-
hostedAuthMenuExternalAuthRequest: /* @__PURE__ */ new Set(),
|
|
796
|
-
hostedAuthMenuDemoEmailOtpDelivery: /* @__PURE__ */ new Set(),
|
|
797
|
-
sdkLifecycleEvent: /* @__PURE__ */ new Set()
|
|
798
|
-
};
|
|
799
|
-
this.expiredSigningSessionsByWallet = /* @__PURE__ */ new Map();
|
|
800
|
-
this.exactSessionState = null;
|
|
801
|
-
this.lastPreferencesChangedPayload = null;
|
|
802
|
-
this.mirroredConfirmationUiMode = null;
|
|
803
|
-
this.debug = false;
|
|
804
|
-
this.walletIframeSurface = hiddenWalletIframeSurface();
|
|
805
|
-
this.transactionReceipt = null;
|
|
806
|
-
this.activeSurfaceMeasurement = null;
|
|
807
|
-
this.activeSurfaceMeasurementUnavailable = false;
|
|
808
|
-
this.surfaceGeneration = 0;
|
|
809
|
-
this.activeSurfaceMeasurementGeneration = 0;
|
|
810
|
-
this.surfaceViewportListenersAttached = false;
|
|
811
|
-
this.surfaceLayoutObserver = null;
|
|
812
|
-
this.measurementFallbackTimer = null;
|
|
813
|
-
this.measurementFallbackGeneration = 0;
|
|
814
|
-
this.disposed = false;
|
|
815
|
-
this.reviews = /* @__PURE__ */ new Map();
|
|
816
|
-
this.reviewCancellationTimers = /* @__PURE__ */ new Map();
|
|
817
|
-
this.reviewIdentityGeneration = 0;
|
|
818
|
-
this.reviewWaiters = /* @__PURE__ */ new Map();
|
|
819
|
-
this.reviewSessionDeadline = null;
|
|
820
|
-
this.reviewGeneration = 0;
|
|
821
|
-
this.reviewResizeObserver = null;
|
|
822
|
-
this.reviewMutationObserver = null;
|
|
823
|
-
this.transactionSurfaceQueue = new WalletIframeTransactionSurfaceQueue();
|
|
824
|
-
this.hostedAuthMenuRequestIds = /* @__PURE__ */ new Map();
|
|
825
|
-
this.hostedAuthMenuConnectionIds = /* @__PURE__ */ new Map();
|
|
826
|
-
this.hostedAuthMenuAnchors = /* @__PURE__ */ new Map();
|
|
827
|
-
this.hostedAuthMenuAnchorTrackingFrame = null;
|
|
828
|
-
this.hostedAuthMenuAnchorTrackingSession = null;
|
|
829
|
-
this.hostedAuthMenuAnchorTrackingDeadlineMs = 0;
|
|
830
|
-
this.cancelledHostedAuthMenuSessions = /* @__PURE__ */ new Set();
|
|
831
|
-
this.refreshReviewGeometry = () => {
|
|
832
|
-
const surface = this.walletIframeSurface;
|
|
833
|
-
if (surface.kind !== "modal_transaction_review") return;
|
|
834
|
-
const slot = this.reviews.get(surface.identity.requestId)?.reservation.slot;
|
|
835
|
-
if (slot?.firstElementChild) this.reviewResizeObserver?.observe(slot.firstElementChild);
|
|
836
|
-
this.renderActiveWalletIframeSurface();
|
|
837
|
-
};
|
|
838
|
-
this.handleSurfaceViewportChange = () => {
|
|
839
|
-
if (this.walletIframeSurface.kind === "hidden") return;
|
|
840
|
-
this.renderActiveWalletIframeSurface();
|
|
841
|
-
};
|
|
842
|
-
this.handleMeasurementFallbackTimeout = () => {
|
|
843
|
-
this.measurementFallbackTimer = null;
|
|
844
|
-
this.markMeasurementUnavailable(this.measurementFallbackGeneration);
|
|
845
|
-
};
|
|
846
|
-
this.handleOverlayDismiss = (event) => {
|
|
847
|
-
const surface = this.walletIframeSurface;
|
|
848
|
-
if (surface.kind === "hidden") return;
|
|
849
|
-
if (surface.identity.surfaceId !== event.identity.surfaceId || surface.identity.requestId !== event.identity.requestId) return;
|
|
850
|
-
if (surface.kind === "modal_auth_menu") {
|
|
851
|
-
if (surface.authMenuSessionId !== event.authMenuSessionId) return;
|
|
852
|
-
this.cancelHostedAuthMenuWithReason(surface.authMenuSessionId, "close_button");
|
|
853
|
-
return;
|
|
854
|
-
}
|
|
855
|
-
if (event.authMenuSessionId !== void 0) return;
|
|
856
|
-
if (this.transactionReceipt?.requestId === surface.identity.requestId) {
|
|
857
|
-
this.state.port?.postMessage({
|
|
858
|
-
type: "PM_SET_TRANSACTION_VIEW",
|
|
859
|
-
payload: {
|
|
860
|
-
requestId: surface.identity.requestId,
|
|
861
|
-
view: "toast"
|
|
862
|
-
}
|
|
863
|
-
});
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
this.cancelRequest(surface.identity.requestId);
|
|
867
|
-
};
|
|
868
|
-
this.handleTransportConnectionClosed = () => {
|
|
869
|
-
const connectionId = this.state.connectionId;
|
|
870
|
-
if (connectionId) this.handleConnectionClosed(connectionId);
|
|
871
|
-
};
|
|
872
|
-
this.updateHostedAuthMenuAnchorPosition = (timestampMs) => {
|
|
873
|
-
this.hostedAuthMenuAnchorTrackingFrame = null;
|
|
874
|
-
const authMenuSessionId = this.hostedAuthMenuAnchorTrackingSession;
|
|
875
|
-
if (!authMenuSessionId) return;
|
|
876
|
-
const surface = this.walletIframeSurface;
|
|
877
|
-
if (surface.kind === "modal_auth_menu" && surface.authMenuSessionId === authMenuSessionId) this.renderActiveWalletIframeSurface();
|
|
878
|
-
if (timestampMs >= this.hostedAuthMenuAnchorTrackingDeadlineMs) return;
|
|
879
|
-
this.hostedAuthMenuAnchorTrackingFrame = requestAnimationFrame(this.updateHostedAuthMenuAnchorPosition);
|
|
880
|
-
};
|
|
881
|
-
if (!options?.walletOrigin) throw new Error("[WalletIframeRouter] walletOrigin is required when using the wallet iframe");
|
|
882
|
-
let parsedOrigin;
|
|
883
|
-
try {
|
|
884
|
-
parsedOrigin = new URL(options.walletOrigin);
|
|
885
|
-
} catch (err) {
|
|
886
|
-
throw new Error(`[WalletIframeRouter] Invalid walletOrigin: ${options.walletOrigin}`);
|
|
887
|
-
}
|
|
888
|
-
if (typeof window !== "undefined") {
|
|
889
|
-
const parentOrigin = window.location.origin;
|
|
890
|
-
if (parsedOrigin.origin === parentOrigin) console.warn("[WalletIframeRouter] walletOrigin matches the host origin. Isolation safeguards rely on the parent; consider moving the wallet to a dedicated origin.");
|
|
891
|
-
}
|
|
892
|
-
const testOptions = {
|
|
893
|
-
routerId: `seams-${Date.now()}-${secureRandomBase36(6, "wallet iframe router IDs")}`,
|
|
894
|
-
ownerTag: void 0,
|
|
895
|
-
autoMount: true,
|
|
896
|
-
...options?.testOptions || {}
|
|
897
|
-
};
|
|
898
|
-
const normalizedServicePath = (() => {
|
|
899
|
-
const p = toBasePath(options?.servicePath, "/wallet-service");
|
|
900
|
-
return p === "/" ? "/wallet-service" : p;
|
|
901
|
-
})();
|
|
902
|
-
const normalizedSdkBasePath = (() => {
|
|
903
|
-
const p = toBasePath(options?.sdkBasePath, "/sdk");
|
|
904
|
-
return p === "/" ? "/sdk" : p;
|
|
905
|
-
})();
|
|
906
|
-
this.opts = {
|
|
907
|
-
connectTimeoutMs: 8e3,
|
|
908
|
-
requestTimeoutMs: 2e4,
|
|
909
|
-
getAppearance: () => options.appearance,
|
|
910
|
-
...options,
|
|
911
|
-
servicePath: normalizedServicePath,
|
|
912
|
-
sdkBasePath: normalizedSdkBasePath,
|
|
913
|
-
testOptions,
|
|
914
|
-
chains: (options.chains ?? PASSKEY_MANAGER_DEFAULT_CONFIGS.network.chains).map(cloneResolvedChainConfig)
|
|
915
|
-
};
|
|
916
|
-
this.walletOriginUrl = parsedOrigin;
|
|
917
|
-
this.walletOriginOrigin = parsedOrigin.origin;
|
|
918
|
-
this.debug = !!this.opts.debug;
|
|
919
|
-
this.transport = new IframeTransport({
|
|
920
|
-
walletOrigin: this.opts.walletOrigin,
|
|
921
|
-
servicePath: this.opts.servicePath,
|
|
922
|
-
connectTimeoutMs: this.opts.connectTimeoutMs,
|
|
923
|
-
debug: this.debug,
|
|
924
|
-
testOptions: {
|
|
925
|
-
routerId: this.opts.testOptions.routerId,
|
|
926
|
-
ownerTag: this.opts.testOptions.ownerTag
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
this.transport.onConnectionClosed(this.handleTransportConnectionClosed);
|
|
930
|
-
this.overlayState = (this.opts.createOverlayState || ((args) => ({ controller: new OverlayController(args) })))({ ensureIframe: (mountParent) => this.transport.ensureIframeMounted(mountParent) });
|
|
931
|
-
this.overlayState.controller.setDismissHandler(this.handleOverlayDismiss);
|
|
932
|
-
this.surfaceRenderer = new WalletIframeSurfaceRenderer(this.overlayState.controller);
|
|
933
|
-
this.progressBus = new OnEventsProgressBus(this.debug ? (msg, data) => {
|
|
934
|
-
console.debug("[WalletIframeRouter][OnEventsProgressBus]", msg, data || {});
|
|
935
|
-
} : void 0);
|
|
936
|
-
}
|
|
937
|
-
async reserveTransactionReview(args) {
|
|
938
|
-
if (args.signal.aborted) throw args.signal.reason;
|
|
939
|
-
const initialGeneration = this.reviewIdentityGeneration;
|
|
940
|
-
await this.init();
|
|
941
|
-
const session = await this.getExactSessionState();
|
|
942
|
-
const confirmationConfig = reviewedConfirmationConfig(await this.getConfirmationConfig(), args.confirmationConfig);
|
|
943
|
-
if (args.signal.aborted) throw args.signal.reason;
|
|
944
|
-
if (initialGeneration !== this.reviewIdentityGeneration || session.kind === "wallet_locked" || session.walletId !== args.walletId) throw new TransactionReviewError("review_identity_changed", "The selected wallet or signing session changed");
|
|
945
|
-
const connectionId = this.state.connectionId;
|
|
946
|
-
if (!connectionId) throw new Error("Wallet iframe connection is unavailable");
|
|
947
|
-
const surface = this.walletIframeSurface;
|
|
948
|
-
if (surface.kind !== "hidden" && surface.kind !== "modal_transaction_confirm" && surface.kind !== "modal_transaction_review") throw walletIframeSurfaceBusyError();
|
|
949
|
-
const requestId = this.allocateRequestId();
|
|
950
|
-
const cancelWaiter = this.transactionSurfaceQueue.cancel.bind(this.transactionSurfaceQueue, requestId);
|
|
951
|
-
this.reviewWaiters.set(requestId, args.onCancel);
|
|
952
|
-
args.signal.addEventListener("abort", cancelWaiter, { once: true });
|
|
953
|
-
let lease;
|
|
954
|
-
try {
|
|
955
|
-
lease = await this.transactionSurfaceQueue.acquire({
|
|
956
|
-
requestId,
|
|
957
|
-
deadline: { kind: "interactive" }
|
|
958
|
-
});
|
|
959
|
-
} finally {
|
|
960
|
-
this.reviewWaiters.delete(requestId);
|
|
961
|
-
args.signal.removeEventListener("abort", cancelWaiter);
|
|
962
|
-
}
|
|
963
|
-
try {
|
|
964
|
-
if (args.signal.aborted) throw args.signal.reason;
|
|
965
|
-
this.assertReviewIdentity(connectionId, initialGeneration);
|
|
966
|
-
assertTransactionReviewValid(args.validity);
|
|
967
|
-
const identity = this.requestSurfaceIdentity(requestId);
|
|
968
|
-
const previousReceipt = this.transactionReceipt;
|
|
969
|
-
if (previousReceipt) {
|
|
970
|
-
this.state.port?.postMessage({
|
|
971
|
-
type: "PM_SET_TRANSACTION_VIEW",
|
|
972
|
-
payload: {
|
|
973
|
-
requestId: previousReceipt.requestId,
|
|
974
|
-
view: "closed"
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
this.transactionReceipt = null;
|
|
978
|
-
if (this.walletIframeSurface.kind !== "hidden" && this.walletIframeSurface.identity.requestId === previousReceipt.requestId) this.walletIframeSurface = hiddenWalletIframeSurface();
|
|
979
|
-
}
|
|
980
|
-
const slot = this.overlayState.controller.getTransactionReviewSlot();
|
|
981
|
-
this.overlayState.controller.setReviewAppearance(this.getCurrentAppearance());
|
|
982
|
-
const reservation = new TransactionReviewReservation(connectionId, identity, slot, args.title, args.validity, confirmationConfig, ++this.reviewGeneration, lease, this.assertReviewIdentity.bind(this, connectionId, initialGeneration), this.cancelReviewReservation.bind(this, requestId), this.finishReviewReservation.bind(this, requestId), this.resumeReviewReservation.bind(this, requestId));
|
|
983
|
-
this.reviews.set(requestId, {
|
|
984
|
-
reservation,
|
|
985
|
-
onCancel: args.onCancel
|
|
986
|
-
});
|
|
987
|
-
const result = this.transitionWalletIframeSurface({
|
|
988
|
-
kind: "transaction_review_started",
|
|
989
|
-
connectionId,
|
|
990
|
-
identity,
|
|
991
|
-
presentation: {
|
|
992
|
-
kind: "modal",
|
|
993
|
-
title: args.title
|
|
994
|
-
}
|
|
995
|
-
});
|
|
996
|
-
if (result.kind === "rejected") throw walletIframeSurfaceBusyError(result.error);
|
|
997
|
-
this.cancelMeasurementFallback();
|
|
998
|
-
this.reviewResizeObserver = new ResizeObserver(this.refreshReviewGeometry);
|
|
999
|
-
this.reviewMutationObserver = new MutationObserver(this.refreshReviewGeometry);
|
|
1000
|
-
this.reviewMutationObserver.observe(slot, {
|
|
1001
|
-
childList: true,
|
|
1002
|
-
subtree: true,
|
|
1003
|
-
characterData: true
|
|
1004
|
-
});
|
|
1005
|
-
return reservation;
|
|
1006
|
-
} catch (error) {
|
|
1007
|
-
this.reviews.delete(requestId);
|
|
1008
|
-
lease.release();
|
|
1009
|
-
throw error;
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
invalidateReviews() {
|
|
1013
|
-
this.reviewIdentityGeneration += 1;
|
|
1014
|
-
const error = new TransactionReviewError("review_identity_changed", "The wallet or signing session changed");
|
|
1015
|
-
for (const [requestId, cancel] of this.reviewWaiters) {
|
|
1016
|
-
this.transactionSurfaceQueue.cancel(requestId);
|
|
1017
|
-
cancel(error);
|
|
1018
|
-
}
|
|
1019
|
-
for (const entry of this.reviews.values()) entry.reservation.cancel(error);
|
|
1020
|
-
}
|
|
1021
|
-
updateReviewSession(state) {
|
|
1022
|
-
const previous = this.exactSessionState;
|
|
1023
|
-
if (previous && !sameReviewSession(previous, state)) this.invalidateReviews();
|
|
1024
|
-
if (this.reviewSessionDeadline) clearTimeout(this.reviewSessionDeadline);
|
|
1025
|
-
this.reviewSessionDeadline = null;
|
|
1026
|
-
if (state.kind === "active_session") this.reviewSessionDeadline = setTimeout(this.expireReviewSession.bind(this, state), Math.min(Math.max(0, state.expiresAtMs - Date.now()), 2147483647));
|
|
1027
|
-
}
|
|
1028
|
-
expireReviewSession(state) {
|
|
1029
|
-
if (this.exactSessionState !== state) return;
|
|
1030
|
-
if (Date.now() < state.expiresAtMs) {
|
|
1031
|
-
this.updateReviewSession(state);
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
this.invalidateReviews();
|
|
1035
|
-
}
|
|
1036
|
-
assertReviewIdentity(connectionId, generation) {
|
|
1037
|
-
if (this.state.connectionId !== connectionId || generation !== this.reviewIdentityGeneration || this.disposed) throw new TransactionReviewError("review_identity_changed", "The wallet connection or signing session changed");
|
|
1038
|
-
}
|
|
1039
|
-
finishReviewReservation(requestId) {
|
|
1040
|
-
this.reviews.delete(requestId);
|
|
1041
|
-
this.clearReviewCancellationTimer(requestId);
|
|
1042
|
-
this.reviewResizeObserver?.disconnect();
|
|
1043
|
-
this.reviewMutationObserver?.disconnect();
|
|
1044
|
-
this.reviewResizeObserver = null;
|
|
1045
|
-
this.reviewSurfaceMeasurement = void 0;
|
|
1046
|
-
this.reviewMutationObserver = null;
|
|
1047
|
-
this.finishRequestSurface(requestId, false);
|
|
1048
|
-
}
|
|
1049
|
-
cancelReviewReservation(requestId, error) {
|
|
1050
|
-
const entry = this.reviews.get(requestId);
|
|
1051
|
-
if (!entry) return;
|
|
1052
|
-
if (entry.reservation.state.kind === "reviewing") {
|
|
1053
|
-
entry.onCancel(error);
|
|
1054
|
-
entry.reservation.finish();
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
if (entry.reservation.state.kind === "signing" || entry.reservation.state.kind === "settled") return;
|
|
1058
|
-
if (this.reviewCancellationTimers.has(requestId)) return;
|
|
1059
|
-
this.sendBestEffortCancel(requestId, error);
|
|
1060
|
-
this.reviewCancellationTimers.set(requestId, window.setTimeout(this.reviewCancellationTimedOut.bind(this, requestId), 3e4));
|
|
1061
|
-
}
|
|
1062
|
-
clearReviewCancellationTimer(requestId) {
|
|
1063
|
-
const timer = this.reviewCancellationTimers.get(requestId);
|
|
1064
|
-
if (timer !== void 0) window.clearTimeout(timer);
|
|
1065
|
-
this.reviewCancellationTimers.delete(requestId);
|
|
1066
|
-
}
|
|
1067
|
-
reviewCancellationTimedOut(requestId) {
|
|
1068
|
-
const pending = this.state.pending.get(requestId);
|
|
1069
|
-
if (!pending) return;
|
|
1070
|
-
pending.reject(pending.onTimeout());
|
|
1071
|
-
}
|
|
1072
|
-
handleReviewState(value) {
|
|
1073
|
-
const message = parseTransactionReviewState(value);
|
|
1074
|
-
if (!message) return;
|
|
1075
|
-
const entry = this.reviews.get(message.requestId);
|
|
1076
|
-
if (!entry || !sameTransactionReviewIdentity(entry.reservation.metadata, message)) return;
|
|
1077
|
-
switch (message.phase) {
|
|
1078
|
-
case "prepared":
|
|
1079
|
-
entry.reservation.prepared();
|
|
1080
|
-
this.maybeActivateReview(entry.reservation);
|
|
1081
|
-
return;
|
|
1082
|
-
case "activated":
|
|
1083
|
-
entry.reservation.activated();
|
|
1084
|
-
return;
|
|
1085
|
-
case "reviewing":
|
|
1086
|
-
if (!entry.reservation.returnToReview()) return;
|
|
1087
|
-
this.transitionWalletIframeSurface({
|
|
1088
|
-
kind: "transaction_review_returned",
|
|
1089
|
-
connectionId: entry.reservation.connectionId,
|
|
1090
|
-
identity: entry.reservation.identity,
|
|
1091
|
-
presentation: {
|
|
1092
|
-
kind: "modal",
|
|
1093
|
-
title: entry.reservation.title
|
|
1094
|
-
}
|
|
1095
|
-
});
|
|
1096
|
-
return;
|
|
1097
|
-
case "signing":
|
|
1098
|
-
this.clearReviewCancellationTimer(message.requestId);
|
|
1099
|
-
entry.reservation.signing();
|
|
1100
|
-
return;
|
|
1101
|
-
case "cancelled": return;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
resumeReviewReservation(requestId) {
|
|
1105
|
-
const entry = this.reviews.get(requestId);
|
|
1106
|
-
if (entry) this.maybeActivateReview(entry.reservation);
|
|
1107
|
-
}
|
|
1108
|
-
maybeActivateReview(reservation) {
|
|
1109
|
-
if (!this.activeSurfaceMeasurement || this.activeSurfaceMeasurement.identity.requestId !== reservation.identity.requestId) return;
|
|
1110
|
-
if (!reservation.activate()) return;
|
|
1111
|
-
this.transitionWalletIframeSurface({
|
|
1112
|
-
kind: "transaction_review_handoff",
|
|
1113
|
-
connectionId: reservation.connectionId,
|
|
1114
|
-
identity: reservation.identity,
|
|
1115
|
-
presentation: {
|
|
1116
|
-
kind: "modal",
|
|
1117
|
-
title: "Confirm transaction"
|
|
1118
|
-
}
|
|
1119
|
-
});
|
|
1120
|
-
this.overlayState.controller.activateAfterReviewHandoff(this.activateReview.bind(this, reservation));
|
|
1121
|
-
}
|
|
1122
|
-
activateReview(reservation) {
|
|
1123
|
-
if (reservation.state.kind !== "activating" || this.state.connectionId !== reservation.connectionId || this.reviewCancellationTimers.has(reservation.identity.requestId)) return;
|
|
1124
|
-
this.state.port?.postMessage({
|
|
1125
|
-
type: "PM_ACTIVATE_TRANSACTION_REVIEW",
|
|
1126
|
-
payload: {
|
|
1127
|
-
connectionId: reservation.connectionId,
|
|
1128
|
-
requestId: reservation.identity.requestId,
|
|
1129
|
-
surfaceId: reservation.identity.surfaceId,
|
|
1130
|
-
generation: reservation.metadata.generation,
|
|
1131
|
-
phase: "activated"
|
|
1132
|
-
}
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
getCurrentAppearance() {
|
|
1136
|
-
return this.opts.getAppearance() ?? this.opts.appearance;
|
|
1137
|
-
}
|
|
1138
|
-
transitionWalletIframeSurface(event) {
|
|
1139
|
-
const result = reduceWalletIframeSurface(this.walletIframeSurface, event);
|
|
1140
|
-
if (result.kind === "applied") {
|
|
1141
|
-
const previousSurface = this.walletIframeSurface;
|
|
1142
|
-
this.walletIframeSurface = result.surface;
|
|
1143
|
-
if (!this.surfaceIdentityEqual(previousSurface, result.surface)) {
|
|
1144
|
-
this.surfaceGeneration += 1;
|
|
1145
|
-
this.activeSurfaceMeasurement = null;
|
|
1146
|
-
this.activeSurfaceMeasurementUnavailable = false;
|
|
1147
|
-
this.activeSurfaceMeasurementGeneration = this.surfaceGeneration;
|
|
1148
|
-
}
|
|
1149
|
-
this.updateSurfaceViewportListeners();
|
|
1150
|
-
this.renderActiveWalletIframeSurface();
|
|
1151
|
-
if (result.surface.kind === "modal_auth_menu" && this.hostedAuthMenuAnchors.has(result.surface.authMenuSessionId)) this.startHostedAuthMenuAnchorTracking(result.surface.authMenuSessionId);
|
|
1152
|
-
if (result.surface.kind !== "hidden" && !this.activeSurfaceMeasurement) this.scheduleMeasurementFallback(this.surfaceGeneration);
|
|
1153
|
-
}
|
|
1154
|
-
return result;
|
|
1155
|
-
}
|
|
1156
|
-
updateSurfaceViewportListeners() {
|
|
1157
|
-
const shouldAttach = this.walletIframeSurface.kind !== "hidden";
|
|
1158
|
-
if (shouldAttach === this.surfaceViewportListenersAttached) return;
|
|
1159
|
-
const visualViewport = window.visualViewport;
|
|
1160
|
-
if (shouldAttach) {
|
|
1161
|
-
window.addEventListener("resize", this.handleSurfaceViewportChange);
|
|
1162
|
-
window.addEventListener("scroll", this.handleSurfaceViewportChange, true);
|
|
1163
|
-
visualViewport?.addEventListener("resize", this.handleSurfaceViewportChange);
|
|
1164
|
-
visualViewport?.addEventListener("scroll", this.handleSurfaceViewportChange);
|
|
1165
|
-
if (typeof ResizeObserver === "function" && document.body) {
|
|
1166
|
-
this.surfaceLayoutObserver = new ResizeObserver(this.handleSurfaceViewportChange);
|
|
1167
|
-
this.surfaceLayoutObserver.observe(document.body);
|
|
1168
|
-
}
|
|
1169
|
-
this.surfaceViewportListenersAttached = true;
|
|
1170
|
-
return;
|
|
1171
|
-
}
|
|
1172
|
-
window.removeEventListener("resize", this.handleSurfaceViewportChange);
|
|
1173
|
-
window.removeEventListener("scroll", this.handleSurfaceViewportChange, true);
|
|
1174
|
-
visualViewport?.removeEventListener("resize", this.handleSurfaceViewportChange);
|
|
1175
|
-
visualViewport?.removeEventListener("scroll", this.handleSurfaceViewportChange);
|
|
1176
|
-
this.surfaceLayoutObserver?.disconnect();
|
|
1177
|
-
this.surfaceLayoutObserver = null;
|
|
1178
|
-
this.surfaceViewportListenersAttached = false;
|
|
1179
|
-
this.cancelMeasurementFallback();
|
|
1180
|
-
}
|
|
1181
|
-
scheduleMeasurementFallback(generation) {
|
|
1182
|
-
this.cancelMeasurementFallback();
|
|
1183
|
-
if (this.walletIframeSurface.kind === "hidden") return;
|
|
1184
|
-
this.measurementFallbackGeneration = generation;
|
|
1185
|
-
this.measurementFallbackTimer = window.setTimeout(this.handleMeasurementFallbackTimeout, WALLET_IFRAME_SURFACE_MEASUREMENT_FALLBACK_TIMEOUT_MS);
|
|
1186
|
-
}
|
|
1187
|
-
/**
|
|
1188
|
-
* A request that is still reporting progress has not stalled, so its surface
|
|
1189
|
-
* must not be declared unmeasurable while it works toward mounting.
|
|
1190
|
-
*/
|
|
1191
|
-
extendMeasurementFallbackOnProgress(requestId) {
|
|
1192
|
-
if (this.measurementFallbackTimer === null) return;
|
|
1193
|
-
const surface = this.walletIframeSurface;
|
|
1194
|
-
if (surface.kind === "hidden" || surface.identity.requestId !== requestId) return;
|
|
1195
|
-
this.scheduleMeasurementFallback(this.measurementFallbackGeneration);
|
|
1196
|
-
}
|
|
1197
|
-
markMeasurementUnavailable(generation) {
|
|
1198
|
-
if (generation !== this.surfaceGeneration || this.walletIframeSurface.kind === "hidden") return;
|
|
1199
|
-
if (this.activeSurfaceMeasurement) return;
|
|
1200
|
-
this.activeSurfaceMeasurementUnavailable = true;
|
|
1201
|
-
this.cancelMeasurementFallback();
|
|
1202
|
-
this.renderActiveWalletIframeSurface();
|
|
1203
|
-
}
|
|
1204
|
-
cancelMeasurementFallback() {
|
|
1205
|
-
if (this.measurementFallbackTimer !== null) {
|
|
1206
|
-
window.clearTimeout(this.measurementFallbackTimer);
|
|
1207
|
-
this.measurementFallbackTimer = null;
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
surfaceIdentityEqual(left, right) {
|
|
1211
|
-
if (left.kind === "hidden" || right.kind === "hidden") return left.kind === right.kind;
|
|
1212
|
-
if (left.connectionId !== right.connectionId || left.identity.surfaceId !== right.identity.surfaceId || left.identity.requestId !== right.identity.requestId) return false;
|
|
1213
|
-
if (left.kind === "modal_auth_menu" || right.kind === "modal_auth_menu") return left.kind === "modal_auth_menu" && right.kind === "modal_auth_menu" && left.authMenuSessionId === right.authMenuSessionId;
|
|
1214
|
-
return true;
|
|
1215
|
-
}
|
|
1216
|
-
currentSurfaceViewport() {
|
|
1217
|
-
const visualViewport = window.visualViewport;
|
|
1218
|
-
const widthCandidate = visualViewport?.width ?? window.innerWidth;
|
|
1219
|
-
const heightCandidate = visualViewport?.height ?? window.innerHeight;
|
|
1220
|
-
const widthCssPx = Number.isFinite(widthCandidate) && widthCandidate > 0 ? widthCandidate : 1;
|
|
1221
|
-
const heightCssPx = Number.isFinite(heightCandidate) && heightCandidate > 0 ? heightCandidate : 1;
|
|
1222
|
-
const offsetLeftCandidate = visualViewport?.offsetLeft ?? 0;
|
|
1223
|
-
const offsetTopCandidate = visualViewport?.offsetTop ?? 0;
|
|
1224
|
-
return {
|
|
1225
|
-
widthCssPx,
|
|
1226
|
-
heightCssPx,
|
|
1227
|
-
offsetLeftCssPx: Number.isFinite(offsetLeftCandidate) ? offsetLeftCandidate : 0,
|
|
1228
|
-
offsetTopCssPx: Number.isFinite(offsetTopCandidate) ? offsetTopCandidate : 0
|
|
1229
|
-
};
|
|
1230
|
-
}
|
|
1231
|
-
renderActiveWalletIframeSurface() {
|
|
1232
|
-
const surface = this.walletIframeSurface;
|
|
1233
|
-
if (surface.kind === "hidden") {
|
|
1234
|
-
this.surfaceRenderer.render(surface);
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
|
-
let measurement = this.activeSurfaceMeasurement ? {
|
|
1238
|
-
kind: "measured",
|
|
1239
|
-
widthCssPx: this.activeSurfaceMeasurement.widthCssPx,
|
|
1240
|
-
heightCssPx: this.activeSurfaceMeasurement.heightCssPx
|
|
1241
|
-
} : this.activeSurfaceMeasurementUnavailable ? { kind: "unavailable" } : void 0;
|
|
1242
|
-
if (surface.kind === "modal_transaction_review") {
|
|
1243
|
-
const slot = this.reviews.get(surface.identity.requestId)?.reservation.slot;
|
|
1244
|
-
const content = slot?.firstElementChild;
|
|
1245
|
-
if (content && !slot.hidden) this.reviewSurfaceMeasurement = {
|
|
1246
|
-
kind: "measured",
|
|
1247
|
-
widthCssPx: content.getBoundingClientRect().width,
|
|
1248
|
-
heightCssPx: content.scrollHeight
|
|
1249
|
-
};
|
|
1250
|
-
measurement = this.reviewSurfaceMeasurement;
|
|
1251
|
-
}
|
|
1252
|
-
const viewport = this.currentSurfaceViewport();
|
|
1253
|
-
const receiptView = this.transactionReceipt?.requestId === surface.identity.requestId ? this.transactionReceipt.view : null;
|
|
1254
|
-
const resolvedGeometry = resolveWalletIframeSurfaceGeometry({
|
|
1255
|
-
presentation: receiptView ? {
|
|
1256
|
-
kind: "modal",
|
|
1257
|
-
title: "Transaction receipt"
|
|
1258
|
-
} : surface.presentation,
|
|
1259
|
-
viewport,
|
|
1260
|
-
measurement,
|
|
1261
|
-
maxModalWidthCssPx: surface.kind === "modal_recovery_codes" ? 688 : void 0
|
|
1262
|
-
});
|
|
1263
|
-
const anchor = surface.kind === "modal_auth_menu" ? this.hostedAuthMenuAnchors.get(surface.authMenuSessionId) : void 0;
|
|
1264
|
-
let anchorMetrics = hostedAuthMenuAnchorMetrics(anchor);
|
|
1265
|
-
let geometry = resolvedGeometry;
|
|
1266
|
-
let authMenuVisualScale = 1;
|
|
1267
|
-
if (surface.kind === "modal_auth_menu" && anchorMetrics && isWalletIframeModalGeometry(resolvedGeometry) && !(resolvedGeometry.kind === "viewport_fallback" && resolvedGeometry.reason === "measurement_unavailable")) {
|
|
1268
|
-
const measuredHeightCssPx = this.activeSurfaceMeasurement?.heightCssPx;
|
|
1269
|
-
const anchoredBase = resolvedGeometry.kind === "viewport_fallback" ? {
|
|
1270
|
-
kind: measuredHeightCssPx != null ? "centered_modal" : "provisional_centered_modal",
|
|
1271
|
-
widthCssPx: resolvedGeometry.widthCssPx,
|
|
1272
|
-
heightCssPx: measuredHeightCssPx ?? 320,
|
|
1273
|
-
topCssPx: resolvedGeometry.topCssPx,
|
|
1274
|
-
leftCssPx: resolvedGeometry.leftCssPx
|
|
1275
|
-
} : measuredHeightCssPx != null ? {
|
|
1276
|
-
...resolvedGeometry,
|
|
1277
|
-
heightCssPx: measuredHeightCssPx
|
|
1278
|
-
} : resolvedGeometry;
|
|
1279
|
-
publishHostedAuthMenuAnchorHeight(anchor, anchoredBase.heightCssPx);
|
|
1280
|
-
anchorMetrics = hostedAuthMenuAnchorMetrics(anchor) ?? anchorMetrics;
|
|
1281
|
-
authMenuVisualScale = anchorMetrics.visualScale;
|
|
1282
|
-
geometry = anchorWalletIframeModalGeometry(anchoredBase, {
|
|
1283
|
-
topCssPx: anchorMetrics.topCssPx,
|
|
1284
|
-
leftCssPx: anchorMetrics.leftCssPx,
|
|
1285
|
-
widthCssPx: anchorMetrics.layoutWidthCssPx,
|
|
1286
|
-
heightCssPx: anchorMetrics.heightCssPx
|
|
1287
|
-
});
|
|
1288
|
-
}
|
|
1289
|
-
if (surface.kind === "modal_auth_menu" && isWalletIframeModalGeometry(geometry)) geometry = documentCoordinateAuthMenuGeometry(geometry);
|
|
1290
|
-
this.overlayState.controller.setAuthMenuVisualScale(authMenuVisualScale);
|
|
1291
|
-
if (receiptView === "toast") {
|
|
1292
|
-
const width = Math.min(360, Math.max(1, viewport.widthCssPx - 32));
|
|
1293
|
-
const height = Math.min(this.activeSurfaceMeasurement?.heightCssPx ?? 88, Math.max(1, viewport.heightCssPx - 32));
|
|
1294
|
-
geometry = {
|
|
1295
|
-
kind: "centered_modal",
|
|
1296
|
-
widthCssPx: width,
|
|
1297
|
-
heightCssPx: height,
|
|
1298
|
-
leftCssPx: viewport.offsetLeftCssPx + viewport.widthCssPx - width - 16,
|
|
1299
|
-
topCssPx: viewport.offsetTopCssPx + viewport.heightCssPx - height - 16
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
this.surfaceRenderer.render(surface, geometry, receiptView);
|
|
1303
|
-
if (surface.kind === "modal_auth_menu" && geometry.kind !== "provisional_centered_modal") this.hostedAuthMenuAnchors.get(surface.authMenuSessionId)?.style.setProperty("--seams-auth-menu-placeholder-opacity", "0");
|
|
1304
|
-
}
|
|
1305
|
-
startHostedAuthMenuAnchorTracking(authMenuSessionId) {
|
|
1306
|
-
if (this.hostedAuthMenuAnchorTrackingFrame !== null) cancelAnimationFrame(this.hostedAuthMenuAnchorTrackingFrame);
|
|
1307
|
-
this.hostedAuthMenuAnchorTrackingSession = authMenuSessionId;
|
|
1308
|
-
this.hostedAuthMenuAnchorTrackingDeadlineMs = performance.now() + 750;
|
|
1309
|
-
this.hostedAuthMenuAnchorTrackingFrame = requestAnimationFrame(this.updateHostedAuthMenuAnchorPosition);
|
|
1310
|
-
}
|
|
1311
|
-
stopHostedAuthMenuAnchorTracking(authMenuSessionId) {
|
|
1312
|
-
if (this.hostedAuthMenuAnchorTrackingSession !== authMenuSessionId) return;
|
|
1313
|
-
this.hostedAuthMenuAnchorTrackingSession = null;
|
|
1314
|
-
if (this.hostedAuthMenuAnchorTrackingFrame !== null) {
|
|
1315
|
-
cancelAnimationFrame(this.hostedAuthMenuAnchorTrackingFrame);
|
|
1316
|
-
this.hostedAuthMenuAnchorTrackingFrame = null;
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1319
|
-
handleSurfaceMeasurement(value) {
|
|
1320
|
-
const measurement = parseWalletIframeSurfaceMeasurement(value);
|
|
1321
|
-
if (!measurement) return;
|
|
1322
|
-
const surface = this.walletIframeSurface;
|
|
1323
|
-
const connectionId = this.state.connectionId;
|
|
1324
|
-
if (!connectionId || surface.kind === "hidden") return;
|
|
1325
|
-
if (measurement.requestId !== surface.identity.requestId) return;
|
|
1326
|
-
if (measurement.kind === "measured_auth_menu_v1") {
|
|
1327
|
-
if (surface.kind !== "modal_auth_menu" || measurement.authMenuSessionId !== surface.authMenuSessionId) return;
|
|
1328
|
-
} else if (surface.kind === "modal_auth_menu") return;
|
|
1329
|
-
const trusted = trustedWalletIframeSurfaceMeasurementFromWire({
|
|
1330
|
-
connectionId,
|
|
1331
|
-
identity: surface.identity,
|
|
1332
|
-
measurement
|
|
1333
|
-
});
|
|
1334
|
-
if (!trusted) return;
|
|
1335
|
-
if (this.activeSurfaceMeasurement && this.activeSurfaceMeasurementGeneration === this.surfaceGeneration && trusted.sequence <= this.activeSurfaceMeasurement.sequence) return;
|
|
1336
|
-
this.activeSurfaceMeasurement = trusted;
|
|
1337
|
-
this.activeSurfaceMeasurementUnavailable = false;
|
|
1338
|
-
this.activeSurfaceMeasurementGeneration = this.surfaceGeneration;
|
|
1339
|
-
this.cancelMeasurementFallback();
|
|
1340
|
-
const review = this.reviews.get(measurement.requestId);
|
|
1341
|
-
if (review) this.maybeActivateReview(review.reservation);
|
|
1342
|
-
this.renderActiveWalletIframeSurface();
|
|
1343
|
-
}
|
|
1344
|
-
requestSurfaceIdentity(requestId) {
|
|
1345
|
-
return requestSurfaceIdentity({
|
|
1346
|
-
surfaceId: walletIframeSurfaceIdFromBoundary(`request-surface-${requestId}`),
|
|
1347
|
-
requestId
|
|
1348
|
-
});
|
|
1349
|
-
}
|
|
1350
|
-
beginRequestSurface(args) {
|
|
1351
|
-
const connectionId = this.state.connectionId;
|
|
1352
|
-
if (!connectionId) throw new Error("Wallet iframe connection is unavailable for a foreground surface");
|
|
1353
|
-
const identity = this.requestSurfaceIdentity(args.requestId);
|
|
1354
|
-
if (this.transactionReceipt) {
|
|
1355
|
-
const receiptId = this.transactionReceipt.requestId;
|
|
1356
|
-
this.transactionReceipt = null;
|
|
1357
|
-
this.state.port?.postMessage({
|
|
1358
|
-
type: "PM_SET_TRANSACTION_VIEW",
|
|
1359
|
-
payload: {
|
|
1360
|
-
requestId: receiptId,
|
|
1361
|
-
view: "closed"
|
|
1362
|
-
}
|
|
1363
|
-
});
|
|
1364
|
-
const previous = this.walletIframeSurface;
|
|
1365
|
-
if (previous.kind !== "hidden" && previous.identity.requestId === receiptId) this.finishRequestSurface(previous.identity.requestId, false);
|
|
1366
|
-
}
|
|
1367
|
-
let result;
|
|
1368
|
-
switch (args.kind) {
|
|
1369
|
-
case "auth_menu":
|
|
1370
|
-
if (!args.authMenuSessionId) throw new Error("Hosted auth-menu request is missing its session identity");
|
|
1371
|
-
result = this.transitionWalletIframeSurface({
|
|
1372
|
-
kind: "auth_menu_request_started",
|
|
1373
|
-
connectionId,
|
|
1374
|
-
identity,
|
|
1375
|
-
presentation: requestSurfacePresentationFor("auth_menu", args.payload),
|
|
1376
|
-
authMenuSessionId: args.authMenuSessionId
|
|
1377
|
-
});
|
|
1378
|
-
break;
|
|
1379
|
-
case "registration":
|
|
1380
|
-
if (args.deadlineAtMs === null) throw new Error("Registration surface requires a finite request deadline");
|
|
1381
|
-
result = this.transitionWalletIframeSurface({
|
|
1382
|
-
kind: "registration_modal_request_started",
|
|
1383
|
-
connectionId,
|
|
1384
|
-
identity,
|
|
1385
|
-
presentation: requestSurfacePresentationFor("registration", args.payload, this.mirroredConfirmationUiMode ?? void 0),
|
|
1386
|
-
preparation: passkeyRegistrationPreparationReceipt(args.deadlineAtMs)
|
|
1387
|
-
});
|
|
1388
|
-
break;
|
|
1389
|
-
case "email_otp_enrollment":
|
|
1390
|
-
result = this.transitionWalletIframeSurface({
|
|
1391
|
-
kind: "transaction_modal_request_started",
|
|
1392
|
-
connectionId,
|
|
1393
|
-
identity,
|
|
1394
|
-
presentation: requestSurfacePresentationFor("email_otp_enrollment", args.payload, this.mirroredConfirmationUiMode ?? void 0)
|
|
1395
|
-
});
|
|
1396
|
-
break;
|
|
1397
|
-
case "transaction":
|
|
1398
|
-
result = this.transitionWalletIframeSurface({
|
|
1399
|
-
kind: "transaction_modal_request_started",
|
|
1400
|
-
connectionId,
|
|
1401
|
-
identity,
|
|
1402
|
-
presentation: requestSurfacePresentationFor("transaction", args.payload, this.mirroredConfirmationUiMode ?? void 0)
|
|
1403
|
-
});
|
|
1404
|
-
break;
|
|
1405
|
-
case "key_export_near":
|
|
1406
|
-
result = this.transitionWalletIframeSurface({
|
|
1407
|
-
kind: "key_export_modal_request_started",
|
|
1408
|
-
connectionId,
|
|
1409
|
-
identity,
|
|
1410
|
-
presentation: requestSurfacePresentationFor("key_export_near", args.payload, this.mirroredConfirmationUiMode ?? void 0),
|
|
1411
|
-
exportKind: "near_keypair"
|
|
1412
|
-
});
|
|
1413
|
-
break;
|
|
1414
|
-
case "key_export_threshold":
|
|
1415
|
-
result = this.transitionWalletIframeSurface({
|
|
1416
|
-
kind: "key_export_modal_request_started",
|
|
1417
|
-
connectionId,
|
|
1418
|
-
identity,
|
|
1419
|
-
presentation: requestSurfacePresentationFor("key_export_threshold", args.payload, this.mirroredConfirmationUiMode ?? void 0),
|
|
1420
|
-
exportKind: "threshold_ed25519_seed_from_yao"
|
|
1421
|
-
});
|
|
1422
|
-
break;
|
|
1423
|
-
case "unlock":
|
|
1424
|
-
result = this.transitionWalletIframeSurface({
|
|
1425
|
-
kind: "unlock_modal_request_started",
|
|
1426
|
-
connectionId,
|
|
1427
|
-
identity,
|
|
1428
|
-
presentation: requestSurfacePresentationFor("unlock", args.payload, this.mirroredConfirmationUiMode ?? void 0),
|
|
1429
|
-
unlockKind: "passkey"
|
|
1430
|
-
});
|
|
1431
|
-
break;
|
|
1432
|
-
case "recovery_codes":
|
|
1433
|
-
result = this.transitionWalletIframeSurface({
|
|
1434
|
-
kind: "recovery_codes_modal_request_started",
|
|
1435
|
-
connectionId,
|
|
1436
|
-
identity,
|
|
1437
|
-
presentation: requestSurfacePresentationFor("recovery_codes", args.payload),
|
|
1438
|
-
operation: "show"
|
|
1439
|
-
});
|
|
1440
|
-
break;
|
|
1441
|
-
case "device_link":
|
|
1442
|
-
result = this.transitionWalletIframeSurface({
|
|
1443
|
-
kind: "unlock_modal_request_started",
|
|
1444
|
-
connectionId,
|
|
1445
|
-
identity,
|
|
1446
|
-
presentation: requestSurfacePresentationFor("unlock", args.payload, this.mirroredConfirmationUiMode ?? void 0),
|
|
1447
|
-
unlockKind: "device_link"
|
|
1448
|
-
});
|
|
1449
|
-
break;
|
|
1450
|
-
case "device_link_qr":
|
|
1451
|
-
result = this.transitionWalletIframeSurface({
|
|
1452
|
-
kind: "device_link_qr_modal_request_started",
|
|
1453
|
-
connectionId,
|
|
1454
|
-
identity,
|
|
1455
|
-
presentation: requestSurfacePresentationFor("device_link_qr", args.payload, this.mirroredConfirmationUiMode ?? void 0)
|
|
1456
|
-
});
|
|
1457
|
-
break;
|
|
1458
|
-
default: return assertNeverWalletIframeRequestSurfaceKind(args.kind);
|
|
1459
|
-
}
|
|
1460
|
-
if (result.kind === "rejected") throw walletIframeSurfaceBusyError(result.error);
|
|
1461
|
-
if (args.kind === "auth_menu" && args.authMenuSessionId) this.hostedAuthMenuConnectionIds.set(args.authMenuSessionId, connectionId);
|
|
1462
|
-
}
|
|
1463
|
-
finishRequestSurface(requestId, cancelled) {
|
|
1464
|
-
if (this.transactionReceipt?.requestId === requestId) {
|
|
1465
|
-
if (!cancelled) return;
|
|
1466
|
-
this.transactionReceipt = null;
|
|
1467
|
-
}
|
|
1468
|
-
const connectionId = this.state.connectionId;
|
|
1469
|
-
if (!connectionId) return;
|
|
1470
|
-
this.transitionWalletIframeSurface({
|
|
1471
|
-
kind: cancelled ? "request_cancelled" : "request_finished",
|
|
1472
|
-
connectionId,
|
|
1473
|
-
identity: this.requestSurfaceIdentity(requestId)
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
hostedAuthMenuSessionIdForRequestId(requestId) {
|
|
1477
|
-
for (const [sessionId, activeRequestId] of this.hostedAuthMenuRequestIds) if (activeRequestId === requestId) return sessionId;
|
|
1478
|
-
return null;
|
|
1479
|
-
}
|
|
1480
|
-
settleHostedAuthMenuCancellation(authMenuSessionId, reason) {
|
|
1481
|
-
const requestId = this.hostedAuthMenuRequestIds.get(authMenuSessionId);
|
|
1482
|
-
this.cancelledHostedAuthMenuSessions.add(authMenuSessionId);
|
|
1483
|
-
this.hostedAuthMenuConnectionIds.delete(authMenuSessionId);
|
|
1484
|
-
if (!requestId) return;
|
|
1485
|
-
this.hostedAuthMenuRequestIds.delete(authMenuSessionId);
|
|
1486
|
-
const pending = this.state.pending.get(requestId);
|
|
1487
|
-
if (pending) {
|
|
1488
|
-
if (pending.timer !== void 0) window.clearTimeout(pending.timer);
|
|
1489
|
-
this.state.pending.delete(requestId);
|
|
1490
|
-
this.progressBus.unregister(requestId);
|
|
1491
|
-
if (reason === "connection_closed" || reason === "close_button") pending.resolve({
|
|
1492
|
-
ok: true,
|
|
1493
|
-
result: {
|
|
1494
|
-
kind: "cancelled",
|
|
1495
|
-
authMenuSessionId,
|
|
1496
|
-
reason
|
|
1497
|
-
}
|
|
1498
|
-
});
|
|
1499
|
-
else pending.reject(/* @__PURE__ */ new Error(`Hosted auth-menu cancelled: ${reason}`));
|
|
1500
|
-
}
|
|
1501
|
-
const surface = this.walletIframeSurface;
|
|
1502
|
-
if (surface.kind === "modal_auth_menu" && surface.authMenuSessionId === authMenuSessionId) this.transitionWalletIframeSurface({
|
|
1503
|
-
kind: "auth_menu_request_cancelled",
|
|
1504
|
-
connectionId: surface.connectionId,
|
|
1505
|
-
identity: surface.identity,
|
|
1506
|
-
authMenuSessionId
|
|
1507
|
-
});
|
|
1508
|
-
}
|
|
1509
|
-
settlePendingRequestsForConnectionClosed(connectionId) {
|
|
1510
|
-
for (const [requestId, pending] of this.state.pending) {
|
|
1511
|
-
if (pending.connectionId !== connectionId) continue;
|
|
1512
|
-
if (this.hostedAuthMenuSessionIdForRequestId(pending.requestId)) continue;
|
|
1513
|
-
this.state.pending.delete(requestId);
|
|
1514
|
-
if (pending.timer !== void 0) window.clearTimeout(pending.timer);
|
|
1515
|
-
const error = new WalletIframeConnectionClosedRequestError(pending.requestId, pending.connectionId, pending.requestType);
|
|
1516
|
-
const fallbackProgress = createTerminalProgressForRequest({
|
|
1517
|
-
requestType: pending.requestType,
|
|
1518
|
-
requestId: pending.requestId,
|
|
1519
|
-
status: "failed",
|
|
1520
|
-
message: error.message,
|
|
1521
|
-
errorCode: error.code
|
|
1522
|
-
});
|
|
1523
|
-
if (fallbackProgress) this.progressBus.dispatch({
|
|
1524
|
-
requestId: pending.requestId,
|
|
1525
|
-
payload: fallbackProgress
|
|
1526
|
-
});
|
|
1527
|
-
this.progressBus.unregister(pending.requestId);
|
|
1528
|
-
this.finishRequestSurface(pending.requestId, false);
|
|
1529
|
-
this.sendBestEffortCancel(pending.requestId);
|
|
1530
|
-
pending.reject(error);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
settlePendingRequestCancellation(requestId, emitTerminalProgress) {
|
|
1534
|
-
const pending = this.state.pending.get(requestId);
|
|
1535
|
-
if (pending) {
|
|
1536
|
-
this.state.pending.delete(requestId);
|
|
1537
|
-
if (pending.timer !== void 0) window.clearTimeout(pending.timer);
|
|
1538
|
-
if (emitTerminalProgress) {
|
|
1539
|
-
const message = CANONICAL_SIGNER_BOUNDARY_MESSAGES.cancelled;
|
|
1540
|
-
const progress = createTerminalProgressForRequest({
|
|
1541
|
-
requestType: pending.requestType,
|
|
1542
|
-
requestId,
|
|
1543
|
-
status: "cancelled",
|
|
1544
|
-
message,
|
|
1545
|
-
errorCode: "cancelled"
|
|
1546
|
-
});
|
|
1547
|
-
if (progress) this.progressBus.dispatch({
|
|
1548
|
-
requestId,
|
|
1549
|
-
payload: progress
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
pending.reject(walletIframeRequestCancelledError());
|
|
1553
|
-
}
|
|
1554
|
-
this.progressBus.unregister(requestId);
|
|
1555
|
-
this.finishRequestSurface(requestId, true);
|
|
1556
|
-
}
|
|
1557
|
-
handleConnectionClosed(connectionId) {
|
|
1558
|
-
this.reviewIdentityGeneration += 1;
|
|
1559
|
-
if (this.reviewSessionDeadline) clearTimeout(this.reviewSessionDeadline);
|
|
1560
|
-
this.reviewSessionDeadline = null;
|
|
1561
|
-
for (const entry of this.reviews.values()) if (entry.reservation.connectionId === connectionId && entry.reservation.state.kind === "reviewing") entry.reservation.cancel(/* @__PURE__ */ new Error("Wallet iframe connection closed"));
|
|
1562
|
-
this.transactionReceipt = null;
|
|
1563
|
-
this.transactionSurfaceQueue.cancelAll(/* @__PURE__ */ new Error("Wallet iframe connection closed while waiting for transaction surface"));
|
|
1564
|
-
for (const [authMenuSessionId, activeConnectionId] of this.hostedAuthMenuConnectionIds) {
|
|
1565
|
-
if (activeConnectionId !== connectionId) continue;
|
|
1566
|
-
this.settleHostedAuthMenuCancellation(authMenuSessionId, "connection_closed");
|
|
1567
|
-
}
|
|
1568
|
-
this.settlePendingRequestsForConnectionClosed(connectionId);
|
|
1569
|
-
if (this.walletIframeSurface.kind !== "hidden" && this.walletIframeSurface.connectionId === connectionId) this.transitionWalletIframeSurface({
|
|
1570
|
-
kind: "connection_closed",
|
|
1571
|
-
connectionId
|
|
1572
|
-
});
|
|
1573
|
-
this.overlayState.controller.dispose();
|
|
1574
|
-
this.updateSurfaceViewportListeners();
|
|
1575
|
-
if (this.state.connectionId === connectionId) {
|
|
1576
|
-
this.state.connectionId = null;
|
|
1577
|
-
this.state.port = null;
|
|
1578
|
-
this.state.ready = false;
|
|
1579
|
-
this.state.configured = false;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
hideRequestSurface(requestId) {
|
|
1583
|
-
if (this.walletIframeSurface.kind === "modal_transaction_confirm" && this.walletIframeSurface.identity.requestId === requestId) return;
|
|
1584
|
-
if (this.transactionReceipt?.requestId === requestId) return;
|
|
1585
|
-
const connectionId = this.state.connectionId;
|
|
1586
|
-
if (!connectionId) return;
|
|
1587
|
-
this.transitionWalletIframeSurface({
|
|
1588
|
-
kind: "request_surface_hidden",
|
|
1589
|
-
connectionId,
|
|
1590
|
-
identity: this.requestSurfaceIdentity(requestId)
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
finishDeviceLinkQrSurface() {
|
|
1594
|
-
const surface = this.walletIframeSurface;
|
|
1595
|
-
if (surface.kind !== "modal_device_link_qr") return;
|
|
1596
|
-
this.finishRequestSurface(surface.identity.requestId, true);
|
|
1597
|
-
}
|
|
1598
|
-
/**
|
|
1599
|
-
* Subscribe to service-ready event. Returns an unsubscribe function.
|
|
1600
|
-
* If already ready, the listener is invoked on next microtask.
|
|
1601
|
-
*/
|
|
1602
|
-
onReady(listener) {
|
|
1603
|
-
if (this.state.ready) {
|
|
1604
|
-
Promise.resolve().then(() => {
|
|
1605
|
-
listener();
|
|
1606
|
-
});
|
|
1607
|
-
return () => {};
|
|
1608
|
-
}
|
|
1609
|
-
this.listeners.ready.add(listener);
|
|
1610
|
-
return () => {
|
|
1611
|
-
this.listeners.ready.delete(listener);
|
|
1612
|
-
};
|
|
1613
|
-
}
|
|
1614
|
-
onHostedAuthMenuExternalAuthRequest(listener) {
|
|
1615
|
-
this.listeners.hostedAuthMenuExternalAuthRequest.add(listener);
|
|
1616
|
-
return () => this.listeners.hostedAuthMenuExternalAuthRequest.delete(listener);
|
|
1617
|
-
}
|
|
1618
|
-
onHostedAuthMenuDemoEmailOtpDelivery(listener) {
|
|
1619
|
-
this.listeners.hostedAuthMenuDemoEmailOtpDelivery.add(listener);
|
|
1620
|
-
return () => this.listeners.hostedAuthMenuDemoEmailOtpDelivery.delete(listener);
|
|
1621
|
-
}
|
|
1622
|
-
async resolveHostedAuthMenuExternalAuth(resolution) {
|
|
1623
|
-
const sessionId = hostedAuthMenuSessionIdFromBoundary(resolution.authMenuSessionId);
|
|
1624
|
-
if (!sessionId) throw new Error("authMenuSessionId must be a non-empty string");
|
|
1625
|
-
const activeRequestId = this.hostedAuthMenuRequestIds.get(sessionId);
|
|
1626
|
-
if (!activeRequestId) return;
|
|
1627
|
-
const normalized = parseHostedAuthMenuExternalAuthResolution({
|
|
1628
|
-
...resolution,
|
|
1629
|
-
requestId: activeRequestId
|
|
1630
|
-
});
|
|
1631
|
-
if (!normalized) throw new Error("Hosted auth-menu external-auth resolution is invalid");
|
|
1632
|
-
await this.post({
|
|
1633
|
-
type: "PM_RESOLVE_AUTH_MENU_EXTERNAL_AUTH",
|
|
1634
|
-
payload: normalized
|
|
1635
|
-
}).then(() => void 0);
|
|
1636
|
-
}
|
|
1637
|
-
emitReady() {
|
|
1638
|
-
if (!this.listeners.ready.size) return;
|
|
1639
|
-
for (const cb of Array.from(this.listeners.ready)) cb();
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Initialize the transport and configure the wallet host.
|
|
1643
|
-
* Safe to call multiple times; concurrent calls deduplicate via initInFlight.
|
|
1644
|
-
*/
|
|
1645
|
-
async init(hostedWalletSession) {
|
|
1646
|
-
if (this.state.initInFlight) return this.state.initInFlight;
|
|
1647
|
-
if (this.state.ready && this.exactSessionState !== null) return;
|
|
1648
|
-
this.state.initInFlight = (async () => {
|
|
1649
|
-
await this.ensureConfigured();
|
|
1650
|
-
if (hostedWalletSession) await this.ensureHostedWalletSeamsSession(hostedWalletSession);
|
|
1651
|
-
await this.refreshExactSessionAndEmitLoginStatus("restore", { kind: "current" });
|
|
1652
|
-
await this.getConfirmationConfig().catch(() => void 0);
|
|
1653
|
-
this.emitReady();
|
|
1654
|
-
})();
|
|
1655
|
-
try {
|
|
1656
|
-
await this.state.initInFlight;
|
|
1657
|
-
} finally {
|
|
1658
|
-
this.state.initInFlight = null;
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
async ensureConfigured() {
|
|
1662
|
-
if (this.state.configurationInFlight) {
|
|
1663
|
-
await this.state.configurationInFlight;
|
|
1664
|
-
return;
|
|
1665
|
-
}
|
|
1666
|
-
if (this.state.configured) return;
|
|
1667
|
-
this.state.configurationInFlight = this.connectAndConfigure();
|
|
1668
|
-
try {
|
|
1669
|
-
await this.state.configurationInFlight;
|
|
1670
|
-
} finally {
|
|
1671
|
-
this.state.configurationInFlight = null;
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
async connectAndConfigure() {
|
|
1675
|
-
if (this.opts.testOptions.autoMount !== false && (!this.state.ready || !this.state.port)) {
|
|
1676
|
-
this.overlayState.controller.prepare();
|
|
1677
|
-
this.state.port = await this.transport.connect();
|
|
1678
|
-
const connectionId = walletIframeConnectionIdFromBoundary(`wallet-iframe-connection-${secureRandomBase36(16, "wallet iframe connection IDs")}`);
|
|
1679
|
-
this.state.connectionId = connectionId;
|
|
1680
|
-
this.state.port.onmessage = (event) => this.onPortMessage(event, connectionId);
|
|
1681
|
-
this.state.port.start?.();
|
|
1682
|
-
this.state.ready = true;
|
|
1683
|
-
}
|
|
1684
|
-
await this.post({
|
|
1685
|
-
type: "PM_SET_CONFIG",
|
|
1686
|
-
payload: {
|
|
1687
|
-
chains: this.opts.chains,
|
|
1688
|
-
relayerAccount: this.opts.relayerAccount,
|
|
1689
|
-
relayer: this.opts.relayer,
|
|
1690
|
-
registration: this.opts.registration,
|
|
1691
|
-
signingSessionDefaults: this.opts.signingSessionDefaults,
|
|
1692
|
-
signingSessionPersistenceMode: this.opts.signingSessionPersistenceMode,
|
|
1693
|
-
routerAb: this.opts.routerAb,
|
|
1694
|
-
routerAbEcdsaDerivationPresignaturePool: this.opts.routerAbEcdsaDerivationPresignaturePool,
|
|
1695
|
-
provisioningDefaults: this.opts.provisioningDefaults,
|
|
1696
|
-
iframeWallet: this.opts.rpIdOverride ? { rpIdOverride: this.opts.rpIdOverride } : void 0,
|
|
1697
|
-
authenticatorOptions: this.opts.authenticatorOptions,
|
|
1698
|
-
appearance: this.getCurrentAppearance(),
|
|
1699
|
-
assetsBaseUrl: this.walletAssetBaseUrl()
|
|
1700
|
-
}
|
|
1701
|
-
});
|
|
1702
|
-
this.state.configured = true;
|
|
1703
|
-
}
|
|
1704
|
-
walletAssetBaseUrl() {
|
|
1705
|
-
try {
|
|
1706
|
-
const base = new URL(this.opts.sdkBasePath, this.walletOriginUrl).toString();
|
|
1707
|
-
return base.endsWith("/") ? base : `${base}/`;
|
|
1708
|
-
} catch {
|
|
1709
|
-
const fallback = new URL("/sdk/", this.walletOriginUrl).toString();
|
|
1710
|
-
return fallback.endsWith("/") ? fallback : `${fallback}/`;
|
|
1711
|
-
}
|
|
1712
|
-
}
|
|
1713
|
-
isReady() {
|
|
1714
|
-
return this.state.ready;
|
|
1715
|
-
}
|
|
1716
|
-
async initializeHostedWalletSeamsSession(source) {
|
|
1717
|
-
await this.init(source);
|
|
1718
|
-
await this.ensureHostedWalletSeamsSession(source);
|
|
1719
|
-
}
|
|
1720
|
-
async ensureHostedWalletSeamsSession(source) {
|
|
1721
|
-
if (!source) return;
|
|
1722
|
-
const normalizedSource = {
|
|
1723
|
-
relayUrl: canonicalHostedWalletRelayUrl(source.relayUrl),
|
|
1724
|
-
operationCredential: parseWalletSessionOperationCredentialV1(source.operationCredential)
|
|
1725
|
-
};
|
|
1726
|
-
if (this.state.hostedWalletSessionExpiresAtMs > Date.now() + 3e4 && hostedWalletSessionSourcesMatch(this.state.hostedWalletSessionSource, normalizedSource)) return;
|
|
1727
|
-
const inFlight = this.state.hostedWalletSessionInFlight;
|
|
1728
|
-
if (inFlight) {
|
|
1729
|
-
await inFlight;
|
|
1730
|
-
if (this.state.hostedWalletSessionExpiresAtMs > Date.now() + 3e4 && hostedWalletSessionSourcesMatch(this.state.hostedWalletSessionSource, normalizedSource)) return;
|
|
1731
|
-
}
|
|
1732
|
-
this.state.hostedWalletSessionInFlight = this.exchangeHostedWalletSeamsSession(normalizedSource);
|
|
1733
|
-
try {
|
|
1734
|
-
await this.state.hostedWalletSessionInFlight;
|
|
1735
|
-
} finally {
|
|
1736
|
-
this.state.hostedWalletSessionInFlight = null;
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
async exchangeHostedWalletSeamsSession(source) {
|
|
1740
|
-
const relayUrl = canonicalHostedWalletRelayUrl(source.relayUrl);
|
|
1741
|
-
const operationCredential = parseWalletSessionOperationCredentialV1(source.operationCredential);
|
|
1742
|
-
const appOrigin = window.location.origin;
|
|
1743
|
-
const walletOrigin = this.walletOriginOrigin;
|
|
1744
|
-
const response = await fetch(joinNormalizedUrl(relayUrl, "/wallet/session/exchange/issue"), {
|
|
1745
|
-
method: "POST",
|
|
1746
|
-
headers: {
|
|
1747
|
-
"Content-Type": "application/json",
|
|
1748
|
-
Authorization: `Bearer ${operationCredential.token}`
|
|
1749
|
-
},
|
|
1750
|
-
body: JSON.stringify({
|
|
1751
|
-
appOrigin,
|
|
1752
|
-
walletOrigin
|
|
1753
|
-
})
|
|
1754
|
-
});
|
|
1755
|
-
const raw = await readSessionExchangeJson(response);
|
|
1756
|
-
if (!response.ok) throw parseHostedWalletExchangeFailure(raw, response.status);
|
|
1757
|
-
const delivery = parseHostedWalletExchangeDelivery(raw, {
|
|
1758
|
-
appOrigin: window.location.origin,
|
|
1759
|
-
walletOrigin: this.walletOriginOrigin
|
|
1760
|
-
});
|
|
1761
|
-
const redemption = parseHostedWalletSeamsSessionRedemption((await this.post({
|
|
1762
|
-
type: "PM_REDEEM_HOSTED_WALLET_SEAMS_SESSION",
|
|
1763
|
-
payload: buildPMRedeemHostedWalletSeamsSessionPayload({
|
|
1764
|
-
exchangeCode: delivery.exchangeCode,
|
|
1765
|
-
nonce: delivery.nonce,
|
|
1766
|
-
appOrigin: delivery.appOrigin,
|
|
1767
|
-
walletOrigin: delivery.walletOrigin,
|
|
1768
|
-
relayUrl
|
|
1769
|
-
})
|
|
1770
|
-
})).result);
|
|
1771
|
-
this.state.hostedWalletSessionExpiresAtMs = redemption.expiresAtMs;
|
|
1772
|
-
this.state.hostedWalletSessionSource = {
|
|
1773
|
-
relayUrl,
|
|
1774
|
-
operationCredential
|
|
1775
|
-
};
|
|
1776
|
-
}
|
|
1777
|
-
getTransportDiagnosticsSnapshot() {
|
|
1778
|
-
return this.transport.getDiagnosticsSnapshot();
|
|
1779
|
-
}
|
|
1780
|
-
dispose() {
|
|
1781
|
-
if (this.disposed) return;
|
|
1782
|
-
this.disposed = true;
|
|
1783
|
-
const connectionId = this.state.connectionId;
|
|
1784
|
-
if (connectionId) this.handleConnectionClosed(connectionId);
|
|
1785
|
-
this.cancelMeasurementFallback();
|
|
1786
|
-
this.updateSurfaceViewportListeners();
|
|
1787
|
-
this.overlayState.controller.dispose();
|
|
1788
|
-
this.transport.dispose();
|
|
1789
|
-
}
|
|
1790
|
-
onLoginStatusChanged(listener) {
|
|
1791
|
-
this.listeners.loginStatus.add(listener);
|
|
1792
|
-
return () => {
|
|
1793
|
-
this.listeners.loginStatus.delete(listener);
|
|
1794
|
-
};
|
|
1795
|
-
}
|
|
1796
|
-
onPreferencesChanged(listener) {
|
|
1797
|
-
this.listeners.preferencesChanged.add(listener);
|
|
1798
|
-
if (this.lastPreferencesChangedPayload) this.notifyPreferencesChangedListener(listener, this.lastPreferencesChangedPayload);
|
|
1799
|
-
return () => {
|
|
1800
|
-
this.listeners.preferencesChanged.delete(listener);
|
|
1801
|
-
};
|
|
1802
|
-
}
|
|
1803
|
-
onSdkLifecycleEvent(listener) {
|
|
1804
|
-
this.listeners.sdkLifecycleEvent.add(listener);
|
|
1805
|
-
return () => {
|
|
1806
|
-
this.listeners.sdkLifecycleEvent.delete(listener);
|
|
1807
|
-
};
|
|
1808
|
-
}
|
|
1809
|
-
getMirroredExactSessionState() {
|
|
1810
|
-
if (this.exactSessionState === null) throw new Error("Wallet iframe exact session state has not been initialized");
|
|
1811
|
-
return this.exactSessionState;
|
|
1812
|
-
}
|
|
1813
|
-
async getExactSessionState() {
|
|
1814
|
-
return await this.refreshExactSessionState("current", { kind: "current" });
|
|
1815
|
-
}
|
|
1816
|
-
async refreshExactSessionState(authenticationRead, wallet) {
|
|
1817
|
-
const state = parseWalletIframeExactSessionState((await this.post({
|
|
1818
|
-
type: "PM_GET_EXACT_WALLET_SESSION_STATE",
|
|
1819
|
-
payload: {
|
|
1820
|
-
authenticationRead,
|
|
1821
|
-
wallet
|
|
1822
|
-
}
|
|
1823
|
-
})).result);
|
|
1824
|
-
this.updateReviewSession(state);
|
|
1825
|
-
this.exactSessionState = state;
|
|
1826
|
-
return state;
|
|
1827
|
-
}
|
|
1828
|
-
emitLoginStatusChanged(status) {
|
|
1829
|
-
for (const cb of Array.from(this.listeners.loginStatus)) try {
|
|
1830
|
-
cb(status);
|
|
1831
|
-
} catch {}
|
|
1832
|
-
}
|
|
1833
|
-
mirrorExactSessionAndEmitLoginStatus(state) {
|
|
1834
|
-
this.updateReviewSession(state);
|
|
1835
|
-
this.exactSessionState = state;
|
|
1836
|
-
this.emitLoginStatusChanged(walletIframeLoginStatusFromExactSession(state));
|
|
1837
|
-
}
|
|
1838
|
-
async refreshExactSessionAndEmitLoginStatus(authenticationRead, wallet) {
|
|
1839
|
-
const state = await this.refreshExactSessionState(authenticationRead, wallet);
|
|
1840
|
-
this.mirrorExactSessionAndEmitLoginStatus(state);
|
|
1841
|
-
return state;
|
|
1842
|
-
}
|
|
1843
|
-
emitPreferencesChanged(payload) {
|
|
1844
|
-
this.lastPreferencesChangedPayload = payload;
|
|
1845
|
-
this.mirroredConfirmationUiMode = payload.confirmationConfig.uiMode;
|
|
1846
|
-
for (const cb of Array.from(this.listeners.preferencesChanged)) this.notifyPreferencesChangedListener(cb, payload);
|
|
1847
|
-
}
|
|
1848
|
-
notifyPreferencesChangedListener(listener, payload) {
|
|
1849
|
-
try {
|
|
1850
|
-
listener(payload);
|
|
1851
|
-
} catch {}
|
|
1852
|
-
}
|
|
1853
|
-
handlePreferencesChanged(payload) {
|
|
1854
|
-
const previousWalletId = this.lastPreferencesChangedPayload?.walletId;
|
|
1855
|
-
this.emitPreferencesChanged(payload);
|
|
1856
|
-
const walletId = String(payload.walletId || "").trim();
|
|
1857
|
-
if (walletId === previousWalletId) return;
|
|
1858
|
-
if (previousWalletId !== void 0) this.invalidateReviews();
|
|
1859
|
-
if (!walletId) return;
|
|
1860
|
-
this.refreshExactSessionAndEmitLoginStatus("current", {
|
|
1861
|
-
kind: "exact",
|
|
1862
|
-
walletId: parseRequestedWalletId(walletId)
|
|
1863
|
-
}).catch((error) => {
|
|
1864
|
-
console.warn("[WalletIframeRouter] Exact session refresh after wallet change failed:", error);
|
|
1865
|
-
});
|
|
1866
|
-
}
|
|
1867
|
-
emitSdkLifecycleEvent(event) {
|
|
1868
|
-
const eventName = event.event;
|
|
1869
|
-
switch (eventName) {
|
|
1870
|
-
case "signing_session.expired":
|
|
1871
|
-
this.failPendingRequestsForExpiredSession(event);
|
|
1872
|
-
this.mirrorExpiredSession(event);
|
|
1873
|
-
if (!this.markSigningSessionExpiryAsNew(event)) return;
|
|
1874
|
-
for (const listener of Array.from(this.listeners.sdkLifecycleEvent)) listener(event);
|
|
1875
|
-
return;
|
|
1876
|
-
case "registration.near_provisioning_changed":
|
|
1877
|
-
for (const listener of Array.from(this.listeners.sdkLifecycleEvent)) listener(event);
|
|
1878
|
-
return;
|
|
1879
|
-
default: assertNeverSdkLifecycleEventName(eventName);
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
mirrorExpiredSession(event) {
|
|
1883
|
-
const state = this.exactSessionState;
|
|
1884
|
-
if (state === null || state.kind !== "active_session") return;
|
|
1885
|
-
if (state.walletId !== event.walletId || state.walletSessionId !== event.walletSessionId) return;
|
|
1886
|
-
const expiredState = {
|
|
1887
|
-
kind: "expired_session",
|
|
1888
|
-
walletId: event.walletId,
|
|
1889
|
-
authorizationId: state.authorizationId,
|
|
1890
|
-
walletSessionId: event.walletSessionId,
|
|
1891
|
-
authMethod: event.authMethod,
|
|
1892
|
-
expiresAtMs: event.expiresAtMs
|
|
1893
|
-
};
|
|
1894
|
-
this.updateReviewSession(expiredState);
|
|
1895
|
-
this.exactSessionState = expiredState;
|
|
1896
|
-
this.emitLoginStatusChanged(walletIframeLoginStatusFromExactSession(expiredState));
|
|
1897
|
-
}
|
|
1898
|
-
failPendingRequestsForExpiredSession(event) {
|
|
1899
|
-
for (const [requestId, pending] of this.state.pending) {
|
|
1900
|
-
const reviewed = this.reviews.get(requestId);
|
|
1901
|
-
if (reviewed) {
|
|
1902
|
-
reviewed.reservation.cancel(new TransactionReviewError("review_identity_changed", "Wallet session expired"));
|
|
1903
|
-
continue;
|
|
1904
|
-
}
|
|
1905
|
-
const binding = pending.sessionBinding;
|
|
1906
|
-
if (binding.kind !== "exact_session") continue;
|
|
1907
|
-
if (binding.walletId !== event.walletId || binding.walletSessionId !== event.walletSessionId) continue;
|
|
1908
|
-
this.state.pending.delete(requestId);
|
|
1909
|
-
if (pending.timer !== void 0) window.clearTimeout(pending.timer);
|
|
1910
|
-
this.progressBus.unregister(requestId);
|
|
1911
|
-
this.finishRequestSurface(requestId, true);
|
|
1912
|
-
this.sendBestEffortCancel(requestId);
|
|
1913
|
-
pending.reject(new WalletIframeSessionExpiredRequestError({
|
|
1914
|
-
kind: "wallet_iframe_request_failure",
|
|
1915
|
-
code: "wallet_session_expired",
|
|
1916
|
-
walletId: event.walletId,
|
|
1917
|
-
walletSessionId: event.walletSessionId
|
|
1918
|
-
}));
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
markSigningSessionExpiryAsNew(event) {
|
|
1922
|
-
const expiredSessionIds = this.expiredSigningSessionsByWallet.get(event.walletId);
|
|
1923
|
-
if (expiredSessionIds?.has(event.walletSessionId)) return false;
|
|
1924
|
-
if (expiredSessionIds) {
|
|
1925
|
-
expiredSessionIds.add(event.walletSessionId);
|
|
1926
|
-
return true;
|
|
1927
|
-
}
|
|
1928
|
-
this.expiredSigningSessionsByWallet.set(event.walletId, new Set([event.walletSessionId]));
|
|
1929
|
-
return true;
|
|
1930
|
-
}
|
|
1931
|
-
async signTransactionWithActions(payload) {
|
|
1932
|
-
const safeOptions = {
|
|
1933
|
-
...typeof payload.options.signerSlot === "number" ? { signerSlot: payload.options.signerSlot } : {},
|
|
1934
|
-
...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {},
|
|
1935
|
-
...payload.options.confirmerText ? { confirmerText: payload.options.confirmerText } : {}
|
|
1936
|
-
};
|
|
1937
|
-
return normalizeSignedTransactionResult((await this.post({
|
|
1938
|
-
type: "PM_SIGN_TX_WITH_ACTIONS",
|
|
1939
|
-
payload: {
|
|
1940
|
-
walletId: payload.walletId,
|
|
1941
|
-
nearAccountId: payload.nearAccountId,
|
|
1942
|
-
transaction: payload.transaction,
|
|
1943
|
-
options: safeOptions
|
|
1944
|
-
},
|
|
1945
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
1946
|
-
})).result);
|
|
1947
|
-
}
|
|
1948
|
-
async signDelegateAction(payload) {
|
|
1949
|
-
const safeOptions = {
|
|
1950
|
-
...typeof payload.options.signerSlot === "number" ? { signerSlot: payload.options.signerSlot } : {},
|
|
1951
|
-
...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {},
|
|
1952
|
-
...payload.options.confirmerText ? { confirmerText: payload.options.confirmerText } : {}
|
|
1953
|
-
};
|
|
1954
|
-
return (await this.post({
|
|
1955
|
-
type: "PM_SIGN_DELEGATE_ACTION",
|
|
1956
|
-
payload: {
|
|
1957
|
-
walletId: payload.walletId,
|
|
1958
|
-
nearAccountId: payload.nearAccountId,
|
|
1959
|
-
delegate: payload.delegate,
|
|
1960
|
-
options: safeOptions
|
|
1961
|
-
},
|
|
1962
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
1963
|
-
})).result;
|
|
1964
|
-
}
|
|
1965
|
-
async registerWallet(payload) {
|
|
1966
|
-
const transport = hostedWalletRegistrationTransport(payload.authMethod);
|
|
1967
|
-
await this.ensureHostedWalletSeamsSession(transport.sessionSource);
|
|
1968
|
-
const confirmationConfig = payload.options?.confirmationConfig;
|
|
1969
|
-
if (confirmationConfig) {
|
|
1970
|
-
const base = await this.getConfirmationConfig();
|
|
1971
|
-
await this.setConfirmationConfig({
|
|
1972
|
-
...base,
|
|
1973
|
-
...confirmationConfig
|
|
1974
|
-
});
|
|
1975
|
-
}
|
|
1976
|
-
const safeOptions = removeFunctionsFromOptions(payload.options);
|
|
1977
|
-
const res = await this.post({
|
|
1978
|
-
type: "PM_REGISTER_WALLET",
|
|
1979
|
-
payload: {
|
|
1980
|
-
authMethod: transport.authMethod,
|
|
1981
|
-
wallet: payload.wallet,
|
|
1982
|
-
signerSelection: registrationSignerSetRequestSelection(payload.signerSelection),
|
|
1983
|
-
options: safeOptions,
|
|
1984
|
-
...confirmationConfig ? { confirmationConfig } : {}
|
|
1985
|
-
},
|
|
1986
|
-
options: { onProgress: bridgeRegistrationProgress(payload.options?.onEvent, payload.options?.onTimingSpan) }
|
|
1987
|
-
}, { timeoutMs: WALLET_IFRAME_REGISTRATION_TIMEOUT_MS });
|
|
1988
|
-
const walletId = res.result?.success ? String(res.result.walletId || "") : "";
|
|
1989
|
-
if (walletId) await this.refreshExactSessionAndEmitLoginStatus("current", {
|
|
1990
|
-
kind: "exact",
|
|
1991
|
-
walletId
|
|
1992
|
-
});
|
|
1993
|
-
return res.result;
|
|
1994
|
-
}
|
|
1995
|
-
async getNearProvisioningState(args) {
|
|
1996
|
-
const walletId = toWalletId(args.walletId);
|
|
1997
|
-
const response = await this.post({
|
|
1998
|
-
type: "PM_GET_NEAR_PROVISIONING_STATE",
|
|
1999
|
-
payload: { walletId: String(walletId) }
|
|
2000
|
-
});
|
|
2001
|
-
if (response.result === null) return null;
|
|
2002
|
-
const state = parseNearProvisioningState(response.result);
|
|
2003
|
-
if (!state) throw new Error("[WalletIframeRouter] Invalid NEAR provisioning state response");
|
|
2004
|
-
return state;
|
|
2005
|
-
}
|
|
2006
|
-
async resumePendingEcdsaRegistration(args) {
|
|
2007
|
-
return (await this.post({
|
|
2008
|
-
type: "PM_RESUME_PENDING_ECDSA_REGISTRATION",
|
|
2009
|
-
payload: args
|
|
2010
|
-
})).result;
|
|
2011
|
-
}
|
|
2012
|
-
async addWalletSigner(payload) {
|
|
2013
|
-
const confirmationConfig = payload.options?.confirmationConfig;
|
|
2014
|
-
if (confirmationConfig) {
|
|
2015
|
-
const base = await this.getConfirmationConfig();
|
|
2016
|
-
await this.setConfirmationConfig({
|
|
2017
|
-
...base,
|
|
2018
|
-
...confirmationConfig
|
|
2019
|
-
});
|
|
2020
|
-
}
|
|
2021
|
-
const safeOptions = removeFunctionsFromOptions(payload.options);
|
|
2022
|
-
return (await this.post({
|
|
2023
|
-
type: "PM_ADD_WALLET_SIGNER",
|
|
2024
|
-
payload: {
|
|
2025
|
-
walletId: payload.walletId,
|
|
2026
|
-
rpId: payload.rpId,
|
|
2027
|
-
signerSelection: payload.signerSelection,
|
|
2028
|
-
options: safeOptions,
|
|
2029
|
-
...confirmationConfig ? { confirmationConfig } : {}
|
|
2030
|
-
},
|
|
2031
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isRegistrationFlowEvent) }
|
|
2032
|
-
})).result;
|
|
2033
|
-
}
|
|
2034
|
-
async addPasskey(payload) {
|
|
2035
|
-
const confirmationConfig = payload.options?.confirmationConfig;
|
|
2036
|
-
if (confirmationConfig) {
|
|
2037
|
-
const base = await this.getConfirmationConfig();
|
|
2038
|
-
await this.setConfirmationConfig({
|
|
2039
|
-
...base,
|
|
2040
|
-
...confirmationConfig
|
|
2041
|
-
});
|
|
2042
|
-
}
|
|
2043
|
-
const safeOptions = removeFunctionsFromOptions(payload.options);
|
|
2044
|
-
return (await this.post({
|
|
2045
|
-
type: "PM_ADD_PASSKEY",
|
|
2046
|
-
payload: {
|
|
2047
|
-
walletId: payload.walletId,
|
|
2048
|
-
rpId: payload.rpId,
|
|
2049
|
-
options: safeOptions,
|
|
2050
|
-
...confirmationConfig ? { confirmationConfig } : {}
|
|
2051
|
-
},
|
|
2052
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isRegistrationFlowEvent) }
|
|
2053
|
-
})).result;
|
|
2054
|
-
}
|
|
2055
|
-
async addEmailOtp(payload) {
|
|
2056
|
-
const safeOptions = removeFunctionsFromOptions(payload.options);
|
|
2057
|
-
return (await this.post({
|
|
2058
|
-
type: "PM_ADD_EMAIL_OTP",
|
|
2059
|
-
payload: {
|
|
2060
|
-
walletId: payload.walletId,
|
|
2061
|
-
emailAddress: payload.emailAddress,
|
|
2062
|
-
options: safeOptions
|
|
2063
|
-
},
|
|
2064
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isRegistrationFlowEvent) }
|
|
2065
|
-
}, { timeout: "interactive" })).result;
|
|
2066
|
-
}
|
|
2067
|
-
async revokeAuthMethod(payload) {
|
|
2068
|
-
return (await this.post({
|
|
2069
|
-
type: "PM_REVOKE_AUTH_METHOD",
|
|
2070
|
-
payload: {
|
|
2071
|
-
walletId: payload.walletId,
|
|
2072
|
-
walletAuthMethodId: payload.walletAuthMethodId
|
|
2073
|
-
}
|
|
2074
|
-
})).result;
|
|
2075
|
-
}
|
|
2076
|
-
async bootstrapEcdsaSession(payload) {
|
|
2077
|
-
const safePayload = removeFunctionsFromOptions(payload);
|
|
2078
|
-
return (await this.post({
|
|
2079
|
-
type: "PM_BOOTSTRAP_THRESHOLD_ECDSA_SESSION",
|
|
2080
|
-
payload: safePayload
|
|
2081
|
-
}, {
|
|
2082
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2083
|
-
progressTimeoutExtensionFactor: 1
|
|
2084
|
-
})).result;
|
|
2085
|
-
}
|
|
2086
|
-
async unlock(payload) {
|
|
2087
|
-
await this.ensureHostedWalletSeamsSession(hostedWalletSeamsSessionSourceFromUnlock(payload, this.opts.relayer?.url));
|
|
2088
|
-
const unlockPayload = buildPMUnlockPayload(payload);
|
|
2089
|
-
const onEvent = unlockOnEventFromRequest(payload);
|
|
2090
|
-
const result = (await this.post({
|
|
2091
|
-
type: "PM_UNLOCK",
|
|
2092
|
-
payload: unlockPayload,
|
|
2093
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isUnlockFlowEvent) }
|
|
2094
|
-
})).result;
|
|
2095
|
-
if (result.success) await this.refreshExactSessionAndEmitLoginStatus("current", { kind: "current" });
|
|
2096
|
-
return result;
|
|
2097
|
-
}
|
|
2098
|
-
async getWalletSession(walletId) {
|
|
2099
|
-
const expectedWalletId = walletId === void 0 ? void 0 : parseRequestedWalletId(walletId);
|
|
2100
|
-
return parseWalletSessionFromBoundary((await this.post({
|
|
2101
|
-
type: "PM_GET_WALLET_SESSION",
|
|
2102
|
-
payload: expectedWalletId ? { walletId: expectedWalletId } : void 0
|
|
2103
|
-
})).result, expectedWalletId);
|
|
2104
|
-
}
|
|
2105
|
-
async requestEmailOtpChallenge(payload) {
|
|
2106
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2107
|
-
return (await this.post({
|
|
2108
|
-
type: "PM_REQUEST_EMAIL_OTP_CHALLENGE",
|
|
2109
|
-
payload: wirePayload,
|
|
2110
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isUnlockFlowEvent) }
|
|
2111
|
-
})).result;
|
|
2112
|
-
}
|
|
2113
|
-
async requestEmailOtpEnrollmentChallenge(payload) {
|
|
2114
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2115
|
-
return (await this.post({
|
|
2116
|
-
type: "PM_REQUEST_EMAIL_OTP_ENROLLMENT_CHALLENGE",
|
|
2117
|
-
payload: wirePayload,
|
|
2118
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isRegistrationFlowEvent) }
|
|
2119
|
-
})).result;
|
|
2120
|
-
}
|
|
2121
|
-
async requestEmailOtpSigningSessionChallenge(payload) {
|
|
2122
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2123
|
-
return (await this.post({
|
|
2124
|
-
type: "PM_REQUEST_EMAIL_OTP_SIGNING_SESSION_CHALLENGE",
|
|
2125
|
-
payload: wirePayload,
|
|
2126
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isUnlockFlowEvent) }
|
|
2127
|
-
})).result;
|
|
2128
|
-
}
|
|
2129
|
-
googleEmailOtpWalletAuthFlowFromWire(wire, onDemoOtp) {
|
|
2130
|
-
emitDemoEmailOtpCodeFromWire({
|
|
2131
|
-
wire,
|
|
2132
|
-
onDemoOtp
|
|
2133
|
-
});
|
|
2134
|
-
const cancel = async () => {
|
|
2135
|
-
await this.post({
|
|
2136
|
-
type: "PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_CANCEL",
|
|
2137
|
-
payload: {
|
|
2138
|
-
flowHandleId: wire.flowHandleId,
|
|
2139
|
-
flowId: wire.flowId,
|
|
2140
|
-
walletId: wire.walletId,
|
|
2141
|
-
mode: wire.mode
|
|
2142
|
-
}
|
|
2143
|
-
});
|
|
2144
|
-
};
|
|
2145
|
-
if (wire.mode === "register") return {
|
|
2146
|
-
kind: "google_email_otp_wallet_auth_flow_v1",
|
|
2147
|
-
state: "registration_ready",
|
|
2148
|
-
flowId: wire.flowId,
|
|
2149
|
-
requestedMode: wire.requestedMode,
|
|
2150
|
-
mode: "register",
|
|
2151
|
-
walletId: walletIdFromString(wire.walletId),
|
|
2152
|
-
emailHint: wire.emailHint,
|
|
2153
|
-
prompt: wire.prompt,
|
|
2154
|
-
expiresAtMs: wire.expiresAtMs,
|
|
2155
|
-
completeRegistration: async () => {
|
|
2156
|
-
const res = await this.post({
|
|
2157
|
-
type: "PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_COMPLETE_REGISTRATION",
|
|
2158
|
-
payload: {
|
|
2159
|
-
flowHandleId: wire.flowHandleId,
|
|
2160
|
-
flowId: wire.flowId,
|
|
2161
|
-
walletId: wire.walletId,
|
|
2162
|
-
mode: wire.mode
|
|
2163
|
-
}
|
|
2164
|
-
}, {
|
|
2165
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2166
|
-
progressTimeoutExtensionFactor: 1
|
|
2167
|
-
});
|
|
2168
|
-
if (res.result.ok) await this.refreshExactSessionAndEmitLoginStatus("current", {
|
|
2169
|
-
kind: "exact",
|
|
2170
|
-
walletId: String(res.result.value.walletId)
|
|
2171
|
-
});
|
|
2172
|
-
return res.result;
|
|
2173
|
-
},
|
|
2174
|
-
rerollWalletId: async () => {
|
|
2175
|
-
const res = await this.post({
|
|
2176
|
-
type: "PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_REROLL_WALLET_ID",
|
|
2177
|
-
payload: {
|
|
2178
|
-
flowHandleId: wire.flowHandleId,
|
|
2179
|
-
flowId: wire.flowId,
|
|
2180
|
-
walletId: wire.walletId,
|
|
2181
|
-
mode: wire.mode
|
|
2182
|
-
}
|
|
2183
|
-
});
|
|
2184
|
-
if (!res.result.ok) return res.result;
|
|
2185
|
-
const flow = this.googleEmailOtpWalletAuthFlowFromWire(res.result.value, onDemoOtp);
|
|
2186
|
-
if (flow.mode !== "register") throw new Error("Google Email OTP registration reroll returned a login flow");
|
|
2187
|
-
return {
|
|
2188
|
-
ok: true,
|
|
2189
|
-
value: flow
|
|
2190
|
-
};
|
|
2191
|
-
},
|
|
2192
|
-
cancel
|
|
2193
|
-
};
|
|
2194
|
-
return {
|
|
2195
|
-
kind: "google_email_otp_wallet_auth_flow_v1",
|
|
2196
|
-
state: "challenge_sent",
|
|
2197
|
-
flowId: wire.flowId,
|
|
2198
|
-
requestedMode: wire.requestedMode,
|
|
2199
|
-
mode: "login",
|
|
2200
|
-
walletId: walletIdFromString(wire.walletId),
|
|
2201
|
-
emailHint: wire.emailHint,
|
|
2202
|
-
prompt: wire.prompt,
|
|
2203
|
-
delivery: wire.delivery,
|
|
2204
|
-
expiresAtMs: wire.expiresAtMs,
|
|
2205
|
-
resend: async () => {
|
|
2206
|
-
const res = await this.post({
|
|
2207
|
-
type: "PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_RESEND",
|
|
2208
|
-
payload: {
|
|
2209
|
-
flowHandleId: wire.flowHandleId,
|
|
2210
|
-
flowId: wire.flowId,
|
|
2211
|
-
walletId: wire.walletId,
|
|
2212
|
-
mode: wire.mode
|
|
2213
|
-
}
|
|
2214
|
-
});
|
|
2215
|
-
return res.result.ok ? {
|
|
2216
|
-
ok: true,
|
|
2217
|
-
value: this.googleEmailOtpWalletAuthFlowFromWire(res.result.value, onDemoOtp)
|
|
2218
|
-
} : res.result;
|
|
2219
|
-
},
|
|
2220
|
-
submit: async (input) => {
|
|
2221
|
-
const res = await this.post({
|
|
2222
|
-
type: "PM_GOOGLE_EMAIL_OTP_WALLET_AUTH_SUBMIT",
|
|
2223
|
-
payload: {
|
|
2224
|
-
flowHandleId: wire.flowHandleId,
|
|
2225
|
-
flowId: wire.flowId,
|
|
2226
|
-
walletId: wire.walletId,
|
|
2227
|
-
mode: wire.mode,
|
|
2228
|
-
otpCode: input.otpCode
|
|
2229
|
-
}
|
|
2230
|
-
}, {
|
|
2231
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2232
|
-
progressTimeoutExtensionFactor: 1
|
|
2233
|
-
});
|
|
2234
|
-
if (res.result.ok) await this.refreshExactSessionAndEmitLoginStatus("current", { kind: "current" });
|
|
2235
|
-
return res.result;
|
|
2236
|
-
},
|
|
2237
|
-
cancel
|
|
2238
|
-
};
|
|
2239
|
-
}
|
|
2240
|
-
async beginGoogleEmailOtpWalletAuth(payload) {
|
|
2241
|
-
const { onDemoOtp, onEvent, ...wirePayload } = payload;
|
|
2242
|
-
const diagnosticsEnabled = Reflect.get(globalThis, "__SEAMS_EMAIL_OTP_UNLOCK_DIAGNOSTICS") === true;
|
|
2243
|
-
const registrationBenchmarkTimings = Reflect.get(globalThis, "__SEAMS_REGISTRATION_BENCHMARK_DIAGNOSTICS") === true;
|
|
2244
|
-
const requestPayload = {
|
|
2245
|
-
...wirePayload,
|
|
2246
|
-
diagnostics: {
|
|
2247
|
-
emailOtpUnlockTimings: diagnosticsEnabled,
|
|
2248
|
-
registrationBenchmarkTimings
|
|
2249
|
-
}
|
|
2250
|
-
};
|
|
2251
|
-
const res = await this.post({
|
|
2252
|
-
type: "PM_BEGIN_GOOGLE_EMAIL_OTP_WALLET_AUTH",
|
|
2253
|
-
payload: requestPayload,
|
|
2254
|
-
options: {
|
|
2255
|
-
sticky: true,
|
|
2256
|
-
onProgress: payload.mode === "register" ? this.wrapOnEvent(onEvent, isRegistrationFlowEvent) : this.wrapOnEvent(onEvent, isUnlockFlowEvent)
|
|
2257
|
-
}
|
|
2258
|
-
}, {
|
|
2259
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2260
|
-
progressTimeoutExtensionFactor: 1
|
|
2261
|
-
});
|
|
2262
|
-
return res.result.ok ? {
|
|
2263
|
-
ok: true,
|
|
2264
|
-
value: this.googleEmailOtpWalletAuthFlowFromWire(res.result.value, onDemoOtp)
|
|
2265
|
-
} : res.result;
|
|
2266
|
-
}
|
|
2267
|
-
async enrollEmailOtp(payload) {
|
|
2268
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2269
|
-
return sanitizeEmailOtpIframeResult((await this.post({
|
|
2270
|
-
type: "PM_ENROLL_EMAIL_OTP",
|
|
2271
|
-
payload: wirePayload,
|
|
2272
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isRegistrationFlowEvent) }
|
|
2273
|
-
}, {
|
|
2274
|
-
timeoutMs: WALLET_IFRAME_EMAIL_OTP_ENROLLMENT_TIMEOUT_MS,
|
|
2275
|
-
progressTimeoutExtensionFactor: 1
|
|
2276
|
-
})).result);
|
|
2277
|
-
}
|
|
2278
|
-
async unlockAddedEmailOtpWallet(payload) {
|
|
2279
|
-
await this.post({
|
|
2280
|
-
type: "PM_UNLOCK_ADDED_EMAIL_OTP_WALLET",
|
|
2281
|
-
payload
|
|
2282
|
-
});
|
|
2283
|
-
await this.refreshExactSessionAndEmitLoginStatus("current", { kind: "current" });
|
|
2284
|
-
}
|
|
2285
|
-
async loginWithEmailOtpEcdsaCapability(payload) {
|
|
2286
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2287
|
-
const res = await this.post({
|
|
2288
|
-
type: "PM_LOGIN_EMAIL_OTP_ECDSA_CAPABILITY",
|
|
2289
|
-
payload: wirePayload,
|
|
2290
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isUnlockFlowEvent) }
|
|
2291
|
-
}, {
|
|
2292
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2293
|
-
progressTimeoutExtensionFactor: 1
|
|
2294
|
-
});
|
|
2295
|
-
await this.refreshExactSessionAndEmitLoginStatus("current", { kind: "current" });
|
|
2296
|
-
return sanitizeEmailOtpIframeResult(res.result);
|
|
2297
|
-
}
|
|
2298
|
-
async refreshEmailOtpSigningSession(payload) {
|
|
2299
|
-
const { onEvent, ...wirePayload } = payload;
|
|
2300
|
-
const res = await this.post({
|
|
2301
|
-
type: "PM_REFRESH_EMAIL_OTP_SIGNING_SESSION",
|
|
2302
|
-
payload: wirePayload,
|
|
2303
|
-
options: { onProgress: this.wrapOnEvent(onEvent, isUnlockFlowEvent) }
|
|
2304
|
-
}, {
|
|
2305
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2306
|
-
progressTimeoutExtensionFactor: 1
|
|
2307
|
-
});
|
|
2308
|
-
await this.refreshExactSessionAndEmitLoginStatus("current", { kind: "current" });
|
|
2309
|
-
return sanitizeEmailOtpIframeResult(res.result);
|
|
2310
|
-
}
|
|
2311
|
-
async getWalletRecoveryCodeStatus(payload) {
|
|
2312
|
-
return (await this.post({
|
|
2313
|
-
type: "PM_GET_WALLET_RECOVERY_CODE_STATUS",
|
|
2314
|
-
payload
|
|
2315
|
-
})).result;
|
|
2316
|
-
}
|
|
2317
|
-
async acknowledgeWalletRecoveryCodeBackup(payload) {
|
|
2318
|
-
await this.ensureConfigured();
|
|
2319
|
-
return (await this.post({
|
|
2320
|
-
type: "PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP",
|
|
2321
|
-
payload
|
|
2322
|
-
}, { timeout: "interactive" })).result;
|
|
2323
|
-
}
|
|
2324
|
-
async requestWalletCustodyEmailOtpChallenge(payload) {
|
|
2325
|
-
return (await this.post({
|
|
2326
|
-
type: "PM_REQUEST_WALLET_CUSTODY_EMAIL_OTP_CHALLENGE",
|
|
2327
|
-
payload
|
|
2328
|
-
})).result;
|
|
2329
|
-
}
|
|
2330
|
-
async rotateWalletRecoveryCodes(payload) {
|
|
2331
|
-
return (await this.post({
|
|
2332
|
-
type: "PM_ROTATE_WALLET_RECOVERY_CODES",
|
|
2333
|
-
payload
|
|
2334
|
-
})).result;
|
|
2335
|
-
}
|
|
2336
|
-
async checkLoginStatus() {
|
|
2337
|
-
return {
|
|
2338
|
-
ok: true,
|
|
2339
|
-
result: walletIframeLoginStatusFromExactSession(await this.getExactSessionState())
|
|
2340
|
-
};
|
|
2341
|
-
}
|
|
2342
|
-
async lock() {
|
|
2343
|
-
this.invalidateReviews();
|
|
2344
|
-
await this.post({ type: "PM_LOCK" });
|
|
2345
|
-
this.exactSessionState = { kind: "wallet_locked" };
|
|
2346
|
-
this.emitLoginStatusChanged({
|
|
2347
|
-
isLoggedIn: false,
|
|
2348
|
-
walletId: null
|
|
2349
|
-
});
|
|
2350
|
-
return {
|
|
2351
|
-
ok: true,
|
|
2352
|
-
result: void 0
|
|
2353
|
-
};
|
|
2354
|
-
}
|
|
2355
|
-
async logout() {
|
|
2356
|
-
this.invalidateReviews();
|
|
2357
|
-
await this.post({ type: "PM_LOGOUT" });
|
|
2358
|
-
this.exactSessionState = { kind: "wallet_locked" };
|
|
2359
|
-
this.emitLoginStatusChanged({
|
|
2360
|
-
isLoggedIn: false,
|
|
2361
|
-
walletId: null
|
|
2362
|
-
});
|
|
2363
|
-
return {
|
|
2364
|
-
ok: true,
|
|
2365
|
-
result: void 0
|
|
2366
|
-
};
|
|
2367
|
-
}
|
|
2368
|
-
async lockExactSession(expected) {
|
|
2369
|
-
this.invalidateReviews();
|
|
2370
|
-
const result = parseWalletIframeExactSessionLockResult((await this.post({
|
|
2371
|
-
type: "PM_LOCK_EXACT_WALLET_SESSION",
|
|
2372
|
-
payload: expected
|
|
2373
|
-
})).result);
|
|
2374
|
-
if (result.kind === "locked") {
|
|
2375
|
-
this.exactSessionState = { kind: "wallet_locked" };
|
|
2376
|
-
this.emitLoginStatusChanged({
|
|
2377
|
-
isLoggedIn: false,
|
|
2378
|
-
walletId: null
|
|
2379
|
-
});
|
|
2380
|
-
} else {
|
|
2381
|
-
this.exactSessionState = result.current;
|
|
2382
|
-
this.emitLoginStatusChanged(walletIframeLoginStatusFromExactSession(result.current));
|
|
2383
|
-
}
|
|
2384
|
-
return result;
|
|
2385
|
-
}
|
|
2386
|
-
async signNep413Message(payload) {
|
|
2387
|
-
const safeOptions = {
|
|
2388
|
-
...typeof payload.options.signerSlot === "number" ? { signerSlot: payload.options.signerSlot } : {},
|
|
2389
|
-
...payload.options.confirmerText ? { confirmerText: payload.options.confirmerText } : {},
|
|
2390
|
-
...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {}
|
|
2391
|
-
};
|
|
2392
|
-
return (await this.post({
|
|
2393
|
-
type: "PM_SIGN_NEP413",
|
|
2394
|
-
payload: {
|
|
2395
|
-
walletId: payload.walletId,
|
|
2396
|
-
nearAccountId: payload.nearAccountId,
|
|
2397
|
-
params: {
|
|
2398
|
-
message: payload.message,
|
|
2399
|
-
recipient: payload.recipient,
|
|
2400
|
-
state: payload.state
|
|
2401
|
-
},
|
|
2402
|
-
options: safeOptions
|
|
2403
|
-
},
|
|
2404
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2405
|
-
})).result;
|
|
2406
|
-
}
|
|
2407
|
-
async signTempo(payload, transactionDispatch = { kind: "ordinary" }) {
|
|
2408
|
-
if (transactionDispatch.kind === "reviewed") payload = {
|
|
2409
|
-
...payload,
|
|
2410
|
-
options: {
|
|
2411
|
-
...payload.options,
|
|
2412
|
-
confirmationConfig: transactionDispatch.reservation.confirmationConfig
|
|
2413
|
-
}
|
|
2414
|
-
};
|
|
2415
|
-
return (await this.post({
|
|
2416
|
-
type: "PM_SIGN_TEMPO",
|
|
2417
|
-
payload: buildSignTempoIframePayload({
|
|
2418
|
-
walletSession: payload.walletSession,
|
|
2419
|
-
request: payload.request,
|
|
2420
|
-
chainTarget: payload.chainTarget,
|
|
2421
|
-
options: payload.options ? { ...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {} } : void 0
|
|
2422
|
-
}),
|
|
2423
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2424
|
-
}, {
|
|
2425
|
-
timeout: "interactive",
|
|
2426
|
-
transactionDispatch
|
|
2427
|
-
})).result;
|
|
2428
|
-
}
|
|
2429
|
-
async reportTempoBroadcastAccepted(payload) {
|
|
2430
|
-
await this.post({
|
|
2431
|
-
type: "PM_REPORT_TEMPO_BROADCAST_ACCEPTED",
|
|
2432
|
-
payload: {
|
|
2433
|
-
walletSession: payload.walletSession,
|
|
2434
|
-
signedResult: payload.signedResult,
|
|
2435
|
-
txHash: payload.txHash
|
|
2436
|
-
},
|
|
2437
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2438
|
-
});
|
|
2439
|
-
}
|
|
2440
|
-
notifyTransactionBroadcastStarted(signedResult) {
|
|
2441
|
-
this.state.port?.postMessage({
|
|
2442
|
-
type: "PM_TRANSACTION_BROADCAST_STARTED",
|
|
2443
|
-
payload: { signedTransaction: signedResult.rawTxHex }
|
|
2444
|
-
});
|
|
2445
|
-
}
|
|
2446
|
-
async reportTempoBroadcastRejected(payload) {
|
|
2447
|
-
await this.post({
|
|
2448
|
-
type: "PM_REPORT_TEMPO_BROADCAST_REJECTED",
|
|
2449
|
-
payload: {
|
|
2450
|
-
walletSession: payload.walletSession,
|
|
2451
|
-
signedResult: payload.signedResult,
|
|
2452
|
-
...payload.error ? { error: payload.error } : {}
|
|
2453
|
-
},
|
|
2454
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2455
|
-
});
|
|
2456
|
-
}
|
|
2457
|
-
async reportTempoFinalized(payload) {
|
|
2458
|
-
await this.post({
|
|
2459
|
-
type: "PM_REPORT_TEMPO_FINALIZED",
|
|
2460
|
-
payload: {
|
|
2461
|
-
walletSession: payload.walletSession,
|
|
2462
|
-
signedResult: payload.signedResult,
|
|
2463
|
-
...payload.txHash ? { txHash: payload.txHash } : {},
|
|
2464
|
-
...payload.receiptStatus ? { receiptStatus: payload.receiptStatus } : {}
|
|
2465
|
-
},
|
|
2466
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2467
|
-
});
|
|
2468
|
-
}
|
|
2469
|
-
async reportTempoDroppedOrReplaced(payload) {
|
|
2470
|
-
await this.post({
|
|
2471
|
-
type: "PM_REPORT_TEMPO_DROPPED_OR_REPLACED",
|
|
2472
|
-
payload: {
|
|
2473
|
-
walletSession: payload.walletSession,
|
|
2474
|
-
signedResult: payload.signedResult,
|
|
2475
|
-
reason: payload.reason,
|
|
2476
|
-
...payload.txHash ? { txHash: payload.txHash } : {}
|
|
2477
|
-
},
|
|
2478
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2479
|
-
});
|
|
2480
|
-
}
|
|
2481
|
-
async reconcileTempoNonceLane(payload) {
|
|
2482
|
-
return (await this.post({
|
|
2483
|
-
type: "PM_RECONCILE_TEMPO_NONCE_LANE",
|
|
2484
|
-
payload: {
|
|
2485
|
-
walletSession: payload.walletSession,
|
|
2486
|
-
signedResult: payload.signedResult
|
|
2487
|
-
},
|
|
2488
|
-
options: { onProgress: this.wrapOnEvent(payload.options?.onEvent, isSigningFlowEvent) }
|
|
2489
|
-
})).result;
|
|
2490
|
-
}
|
|
2491
|
-
async executeAction(payload, transactionDispatch = { kind: "ordinary" }) {
|
|
2492
|
-
if (transactionDispatch.kind === "reviewed") payload = {
|
|
2493
|
-
...payload,
|
|
2494
|
-
options: {
|
|
2495
|
-
...payload.options,
|
|
2496
|
-
confirmationConfig: transactionDispatch.reservation.confirmationConfig
|
|
2497
|
-
}
|
|
2498
|
-
};
|
|
2499
|
-
const { options } = payload;
|
|
2500
|
-
const safeOptions = {
|
|
2501
|
-
waitUntil: options.waitUntil,
|
|
2502
|
-
confirmationConfig: options.confirmationConfig,
|
|
2503
|
-
...typeof options.signerSlot === "number" ? { signerSlot: options.signerSlot } : {},
|
|
2504
|
-
...options.confirmerText ? { confirmerText: options.confirmerText } : {}
|
|
2505
|
-
};
|
|
2506
|
-
return (await this.post({
|
|
2507
|
-
type: "PM_EXECUTE_ACTION",
|
|
2508
|
-
payload: {
|
|
2509
|
-
walletId: payload.walletId,
|
|
2510
|
-
nearAccountId: payload.nearAccountId,
|
|
2511
|
-
receiverId: payload.receiverId,
|
|
2512
|
-
actionArgs: payload.actionArgs,
|
|
2513
|
-
options: safeOptions
|
|
2514
|
-
},
|
|
2515
|
-
options: { onProgress: this.wrapOnEvent(options?.onEvent, isSigningFlowEvent) }
|
|
2516
|
-
}, { transactionDispatch })).result;
|
|
2517
|
-
}
|
|
2518
|
-
async setConfirmBehavior(behavior, walletId) {
|
|
2519
|
-
await this.post({
|
|
2520
|
-
type: "PM_SET_CONFIRM_BEHAVIOR",
|
|
2521
|
-
payload: {
|
|
2522
|
-
behavior,
|
|
2523
|
-
...walletId ? { walletId } : {}
|
|
2524
|
-
}
|
|
2525
|
-
});
|
|
2526
|
-
}
|
|
2527
|
-
async setConfirmationConfig(config, walletId) {
|
|
2528
|
-
await this.post({
|
|
2529
|
-
type: "PM_SET_CONFIRMATION_CONFIG",
|
|
2530
|
-
payload: {
|
|
2531
|
-
config,
|
|
2532
|
-
...walletId ? { walletId } : {}
|
|
2533
|
-
}
|
|
2534
|
-
});
|
|
2535
|
-
if (config.uiMode === "none" || config.uiMode === "modal" || config.uiMode === "drawer") this.mirroredConfirmationUiMode = config.uiMode;
|
|
2536
|
-
}
|
|
2537
|
-
async getConfirmationConfig() {
|
|
2538
|
-
const res = await this.post({ type: "PM_GET_CONFIRMATION_CONFIG" });
|
|
2539
|
-
this.mirroredConfirmationUiMode = res.result.uiMode;
|
|
2540
|
-
return res.result;
|
|
2541
|
-
}
|
|
2542
|
-
/**
|
|
2543
|
-
* Push appearance (theme name and/or color token overrides) to the wallet
|
|
2544
|
-
* host at runtime. The host merges this with prior config and re-applies the
|
|
2545
|
-
* document-owned wallet UI token stylesheet, so embedded components (tx confirmer, etc.)
|
|
2546
|
-
* re-theme without a re-init. Appearance is excluded from the runtime-reset
|
|
2547
|
-
* fingerprint, so this never drops warm signing-session state.
|
|
2548
|
-
*/
|
|
2549
|
-
async setAppearance(appearance) {
|
|
2550
|
-
await this.post({
|
|
2551
|
-
type: "PM_SET_CONFIG",
|
|
2552
|
-
payload: { appearance }
|
|
2553
|
-
});
|
|
2554
|
-
}
|
|
2555
|
-
async prefetchBlockheight() {
|
|
2556
|
-
await this.post({ type: "PM_PREFETCH_BLOCKHEIGHT" });
|
|
2557
|
-
}
|
|
2558
|
-
async prefillRouterAbEcdsaDerivationPresignaturePool(payload) {
|
|
2559
|
-
return (await this.post({
|
|
2560
|
-
type: "PM_PREFILL_ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL",
|
|
2561
|
-
payload: {
|
|
2562
|
-
walletSession: payload.walletSession,
|
|
2563
|
-
...payload.options ? { options: payload.options } : {}
|
|
2564
|
-
}
|
|
2565
|
-
}, {
|
|
2566
|
-
timeoutMs: WALLET_IFRAME_THRESHOLD_SIGNING_TIMEOUT_MS,
|
|
2567
|
-
progressTimeoutExtensionFactor: 1
|
|
2568
|
-
})).result;
|
|
2569
|
-
}
|
|
2570
|
-
async getRecentUnlocks() {
|
|
2571
|
-
return (await this.post({ type: "PM_GET_RECENT_UNLOCKS" })).result;
|
|
2572
|
-
}
|
|
2573
|
-
async syncAccount(payload) {
|
|
2574
|
-
return (await this.post({
|
|
2575
|
-
type: "PM_SYNC_ACCOUNT_FLOW",
|
|
2576
|
-
payload: { ...payload?.walletId ? { walletId: payload.walletId } : {} },
|
|
2577
|
-
options: { onProgress: this.wrapOnEvent(payload?.onEvent, isAccountSyncFlowEvent) }
|
|
2578
|
-
})).result;
|
|
2579
|
-
}
|
|
2580
|
-
async scanAndLinkDevice(payload) {
|
|
2581
|
-
const requestId = this.allocateRequestId();
|
|
2582
|
-
return (await this.post({
|
|
2583
|
-
type: "PM_SCAN_AND_LINK_DEVICE",
|
|
2584
|
-
payload: {
|
|
2585
|
-
qrData: payload.qrData,
|
|
2586
|
-
...payload.options ? { options: {
|
|
2587
|
-
...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {},
|
|
2588
|
-
...payload.options.confirmerText ? { confirmerText: payload.options.confirmerText } : {}
|
|
2589
|
-
} } : {}
|
|
2590
|
-
},
|
|
2591
|
-
options: { onProgress: (progress) => {
|
|
2592
|
-
if (isDeviceLinkEmailOtpBaseFactorSelectionProgressV1(progress)) {
|
|
2593
|
-
this.handleEmailOtpBaseFactorSelectionProgressV1(requestId, payload.options?.onEmailOtpBaseFactorRequired, progress);
|
|
2594
|
-
return;
|
|
2595
|
-
}
|
|
2596
|
-
if (isLinkDeviceFlowEvent(progress)) payload.options?.onEvent?.(progress);
|
|
2597
|
-
} }
|
|
2598
|
-
}, {
|
|
2599
|
-
requestId,
|
|
2600
|
-
timeout: "interactive"
|
|
2601
|
-
})).result;
|
|
2602
|
-
}
|
|
2603
|
-
async handleEmailOtpBaseFactorSelectionProgressV1(scanRequestId, selector, progress) {
|
|
2604
|
-
try {
|
|
2605
|
-
if (!selector) throw new Error("Choose the Email OTP method to use for the linked device");
|
|
2606
|
-
const baseWalletAuthMethodId = await selector(progress.choices);
|
|
2607
|
-
await this.post({
|
|
2608
|
-
type: "PM_DEVICE_LINK_EMAIL_OTP_BASE_FACTOR_ACTION",
|
|
2609
|
-
payload: {
|
|
2610
|
-
scanRequestId,
|
|
2611
|
-
action: {
|
|
2612
|
-
kind: "select",
|
|
2613
|
-
baseWalletAuthMethodId
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
});
|
|
2617
|
-
} catch {
|
|
2618
|
-
await this.post({
|
|
2619
|
-
type: "PM_DEVICE_LINK_EMAIL_OTP_BASE_FACTOR_ACTION",
|
|
2620
|
-
payload: {
|
|
2621
|
-
scanRequestId,
|
|
2622
|
-
action: { kind: "cancel" }
|
|
2623
|
-
}
|
|
2624
|
-
}).catch(() => void 0);
|
|
2625
|
-
}
|
|
2626
|
-
}
|
|
2627
|
-
async startDevice2LinkingFlow(payload) {
|
|
2628
|
-
return (await this.post({
|
|
2629
|
-
type: "PM_START_DEVICE2_LINKING_FLOW",
|
|
2630
|
-
payload: {
|
|
2631
|
-
targetFactor: payload.targetFactor,
|
|
2632
|
-
...payload.targetFactor.kind === "email_otp" ? { targetEmail: payload.targetEmail } : {},
|
|
2633
|
-
...payload.ui ? { ui: payload.ui } : {},
|
|
2634
|
-
...payload.cameraId ? { cameraId: payload.cameraId } : {},
|
|
2635
|
-
...payload.options ? { options: {
|
|
2636
|
-
...payload.options.confirmationConfig ? { confirmationConfig: payload.options.confirmationConfig } : {},
|
|
2637
|
-
...payload.options.confirmerText ? { confirmerText: payload.options.confirmerText } : {}
|
|
2638
|
-
} } : {}
|
|
2639
|
-
},
|
|
2640
|
-
options: {
|
|
2641
|
-
sticky: true,
|
|
2642
|
-
onProgress: this.handleDeviceLinkProgressV1.bind(this, payload.options)
|
|
2643
|
-
}
|
|
2644
|
-
})).result;
|
|
2645
|
-
}
|
|
2646
|
-
handleDeviceLinkProgressV1(options, progress) {
|
|
2647
|
-
if (isDeviceLinkTargetFactorActivationProgressV1(progress)) {
|
|
2648
|
-
options?.onTargetFactorRequired?.(this.deviceLinkTargetFactorActivationV1(progress));
|
|
2649
|
-
return;
|
|
2650
|
-
}
|
|
2651
|
-
if (!isLinkDeviceFlowEvent(progress)) return;
|
|
2652
|
-
options?.onEvent?.(progress);
|
|
2653
|
-
const outcome = classifyLinkDeviceFlowEvent(progress);
|
|
2654
|
-
if (outcome.kind !== "active") return;
|
|
2655
|
-
this.refreshExactSessionAndEmitLoginStatus("current", {
|
|
2656
|
-
kind: "exact",
|
|
2657
|
-
walletId: outcome.walletId
|
|
2658
|
-
}).catch((error) => {
|
|
2659
|
-
console.warn("[WalletIframeRouter] Exact session refresh after device linking failed:", error);
|
|
2660
|
-
});
|
|
2661
|
-
}
|
|
2662
|
-
deviceLinkTargetFactorActivationV1(progress) {
|
|
2663
|
-
switch (progress.activation.kind) {
|
|
2664
|
-
case "linked_device_target_passkey_activation_v1": return {
|
|
2665
|
-
kind: progress.activation.kind,
|
|
2666
|
-
createPasskey: this.createLinkedDeviceTargetPasskeyV1.bind(this, progress.activationId)
|
|
2667
|
-
};
|
|
2668
|
-
case "linked_device_target_email_otp_activation_v1": return {
|
|
2669
|
-
kind: progress.activation.kind,
|
|
2670
|
-
state: progress.activation.state,
|
|
2671
|
-
sendCode: this.sendLinkedDeviceTargetEmailOtpV1.bind(this, progress.activationId),
|
|
2672
|
-
submitCode: this.submitLinkedDeviceTargetEmailOtpV1.bind(this, progress.activationId),
|
|
2673
|
-
resendCode: this.resendLinkedDeviceTargetEmailOtpV1.bind(this, progress.activationId)
|
|
2674
|
-
};
|
|
2675
|
-
default:
|
|
2676
|
-
progress.activation;
|
|
2677
|
-
throw new Error("Unsupported linked-device target-factor activation");
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
async createLinkedDeviceTargetPasskeyV1(activationId) {
|
|
2681
|
-
await this.post({
|
|
2682
|
-
type: "PM_DEVICE_LINK_TARGET_FACTOR_ACTION",
|
|
2683
|
-
payload: {
|
|
2684
|
-
activationId,
|
|
2685
|
-
action: { kind: "create_passkey" }
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
}
|
|
2689
|
-
async sendLinkedDeviceTargetEmailOtpV1(activationId) {
|
|
2690
|
-
await this.post({
|
|
2691
|
-
type: "PM_DEVICE_LINK_TARGET_FACTOR_ACTION",
|
|
2692
|
-
payload: {
|
|
2693
|
-
activationId,
|
|
2694
|
-
action: { kind: "send_email_otp" }
|
|
2695
|
-
}
|
|
2696
|
-
});
|
|
2697
|
-
}
|
|
2698
|
-
async resendLinkedDeviceTargetEmailOtpV1(activationId) {
|
|
2699
|
-
await this.post({
|
|
2700
|
-
type: "PM_DEVICE_LINK_TARGET_FACTOR_ACTION",
|
|
2701
|
-
payload: {
|
|
2702
|
-
activationId,
|
|
2703
|
-
action: { kind: "resend_email_otp" }
|
|
2704
|
-
}
|
|
2705
|
-
});
|
|
2706
|
-
}
|
|
2707
|
-
async submitLinkedDeviceTargetEmailOtpV1(activationId, otpCode) {
|
|
2708
|
-
await this.post({
|
|
2709
|
-
type: "PM_DEVICE_LINK_TARGET_FACTOR_ACTION",
|
|
2710
|
-
payload: {
|
|
2711
|
-
activationId,
|
|
2712
|
-
action: {
|
|
2713
|
-
kind: "submit_email_otp",
|
|
2714
|
-
otpCode
|
|
2715
|
-
}
|
|
2716
|
-
}
|
|
2717
|
-
});
|
|
2718
|
-
}
|
|
2719
|
-
async cancelDeviceLinking() {
|
|
2720
|
-
await this.post({ type: "PM_CANCEL_DEVICE_LINKING" });
|
|
2721
|
-
this.finishDeviceLinkQrSurface();
|
|
2722
|
-
}
|
|
2723
|
-
wrapOnEvent(onEvent, isExpectedEvent) {
|
|
2724
|
-
if (!onEvent) return void 0;
|
|
2725
|
-
return (progress) => {
|
|
2726
|
-
try {
|
|
2727
|
-
if (isExpectedEvent(progress)) onEvent(progress);
|
|
2728
|
-
} catch {}
|
|
2729
|
-
};
|
|
2730
|
-
}
|
|
2731
|
-
async signAndSendTransaction(payload, transactionDispatch = { kind: "ordinary" }) {
|
|
2732
|
-
if (transactionDispatch.kind === "reviewed") payload = {
|
|
2733
|
-
...payload,
|
|
2734
|
-
options: {
|
|
2735
|
-
...payload.options,
|
|
2736
|
-
confirmationConfig: transactionDispatch.reservation.confirmationConfig
|
|
2737
|
-
}
|
|
2738
|
-
};
|
|
2739
|
-
const { options } = payload;
|
|
2740
|
-
const safeOptions = {
|
|
2741
|
-
waitUntil: options.waitUntil,
|
|
2742
|
-
confirmationConfig: options.confirmationConfig,
|
|
2743
|
-
...typeof options.signerSlot === "number" ? { signerSlot: options.signerSlot } : {},
|
|
2744
|
-
...options.confirmerText ? { confirmerText: options.confirmerText } : {}
|
|
2745
|
-
};
|
|
2746
|
-
return (await this.post({
|
|
2747
|
-
type: "PM_SIGN_AND_SEND_TX",
|
|
2748
|
-
payload: {
|
|
2749
|
-
walletId: payload.walletId,
|
|
2750
|
-
nearAccountId: payload.nearAccountId,
|
|
2751
|
-
transaction: payload.transaction,
|
|
2752
|
-
options: safeOptions
|
|
2753
|
-
},
|
|
2754
|
-
options: { onProgress: this.wrapOnEvent(options?.onEvent, isSigningFlowEvent) }
|
|
2755
|
-
}, { transactionDispatch })).result;
|
|
2756
|
-
}
|
|
2757
|
-
async fundImplicitNearAccountForTesting(payload) {
|
|
2758
|
-
return (await this.post({
|
|
2759
|
-
type: "PM_FUND_IMPLICIT_NEAR_ACCOUNT_FOR_TESTING",
|
|
2760
|
-
payload
|
|
2761
|
-
})).result;
|
|
2762
|
-
}
|
|
2763
|
-
async hasPasskeyCredential(walletId) {
|
|
2764
|
-
return !!(await this.post({
|
|
2765
|
-
type: "PM_HAS_PASSKEY",
|
|
2766
|
-
payload: { walletId }
|
|
2767
|
-
}))?.result;
|
|
2768
|
-
}
|
|
2769
|
-
async listLinkedDevices(payload) {
|
|
2770
|
-
const request = parseLinkedDeviceListRequestV1({
|
|
2771
|
-
kind: "linked_device_list_request_v1",
|
|
2772
|
-
walletId: payload.walletId,
|
|
2773
|
-
limit: payload.limit,
|
|
2774
|
-
cursor: payload.cursor
|
|
2775
|
-
});
|
|
2776
|
-
return parseLinkedDeviceListResultV1((await this.post({
|
|
2777
|
-
type: "PM_LIST_LINKED_DEVICES",
|
|
2778
|
-
payload: {
|
|
2779
|
-
walletId: String(request.walletId),
|
|
2780
|
-
limit: request.limit,
|
|
2781
|
-
cursor: request.cursor
|
|
2782
|
-
}
|
|
2783
|
-
})).result);
|
|
2784
|
-
}
|
|
2785
|
-
async revokeLinkedDevice(payload) {
|
|
2786
|
-
const request = parseLinkedDeviceRevokeRequestV1({
|
|
2787
|
-
kind: "linked_device_revoke_request_v1",
|
|
2788
|
-
walletId: payload.walletId,
|
|
2789
|
-
walletAuthMethodId: payload.walletAuthMethodId,
|
|
2790
|
-
requestedAtMs: payload.requestedAtMs
|
|
2791
|
-
});
|
|
2792
|
-
return parseLinkedDeviceRevokeResultV1((await this.post({
|
|
2793
|
-
type: "PM_REVOKE_LINKED_DEVICE",
|
|
2794
|
-
payload: {
|
|
2795
|
-
walletId: String(request.walletId),
|
|
2796
|
-
walletAuthMethodId: String(request.walletAuthMethodId),
|
|
2797
|
-
requestedAtMs: request.requestedAtMs,
|
|
2798
|
-
sourceProof: payload.sourceProof
|
|
2799
|
-
}
|
|
2800
|
-
})).result);
|
|
2801
|
-
}
|
|
2802
|
-
async sendTransaction(args) {
|
|
2803
|
-
const { options } = args;
|
|
2804
|
-
const safeOptions = options ? { waitUntil: options.waitUntil } : void 0;
|
|
2805
|
-
return (await this.post({
|
|
2806
|
-
type: "PM_SEND_TRANSACTION",
|
|
2807
|
-
payload: {
|
|
2808
|
-
walletId: args.walletId,
|
|
2809
|
-
nearAccountId: args.nearAccountId,
|
|
2810
|
-
signedTransaction: args.signedTransaction,
|
|
2811
|
-
options: safeOptions
|
|
2812
|
-
},
|
|
2813
|
-
options: { onProgress: this.wrapOnEvent(options?.onEvent, isSigningFlowEvent) }
|
|
2814
|
-
})).result;
|
|
2815
|
-
}
|
|
2816
|
-
async resolveExactKeyExportLane(input) {
|
|
2817
|
-
return parseResolveExactKeyExportLaneResult((await this.post({
|
|
2818
|
-
type: "PM_RESOLVE_EXACT_KEY_EXPORT_LANE",
|
|
2819
|
-
payload: input
|
|
2820
|
-
})).result);
|
|
2821
|
-
}
|
|
2822
|
-
async exportKeypairWithUI(input) {
|
|
2823
|
-
const { onEvent, ...messageOptions } = input.options;
|
|
2824
|
-
if (!messageOptions.variant && this.mirroredConfirmationUiMode === null) await this.getConfirmationConfig();
|
|
2825
|
-
const payload = walletIframeExportPayload(input, {
|
|
2826
|
-
...messageOptions,
|
|
2827
|
-
variant: messageOptions.variant ?? (this.mirroredConfirmationUiMode === "drawer" ? "drawer" : "modal")
|
|
2828
|
-
});
|
|
2829
|
-
await this.post({
|
|
2830
|
-
type: "PM_EXPORT_KEYPAIR_UI",
|
|
2831
|
-
payload,
|
|
2832
|
-
options: {
|
|
2833
|
-
sticky: true,
|
|
2834
|
-
onProgress: this.wrapOnEvent(onEvent, isKeyExportFlowEvent)
|
|
2835
|
-
}
|
|
2836
|
-
});
|
|
2837
|
-
}
|
|
2838
|
-
async openHostedAuthMenu(request, anchorElement) {
|
|
2839
|
-
await this.ensureConfigured();
|
|
2840
|
-
const normalized = parseHostedAuthMenuOpenRequest(request);
|
|
2841
|
-
if (!normalized) throw new Error("Hosted auth-menu open request is invalid");
|
|
2842
|
-
if (this.hostedAuthMenuRequestIds.has(normalized.authMenuSessionId)) throw new Error("Hosted auth-menu session is already active");
|
|
2843
|
-
const requestId = this.allocateRequestId();
|
|
2844
|
-
this.hostedAuthMenuRequestIds.set(normalized.authMenuSessionId, requestId);
|
|
2845
|
-
if (anchorElement) this.hostedAuthMenuAnchors.set(normalized.authMenuSessionId, anchorElement);
|
|
2846
|
-
try {
|
|
2847
|
-
const outcome = parseHostedAuthMenuOutcome((await this.post({
|
|
2848
|
-
type: "PM_OPEN_AUTH_MENU",
|
|
2849
|
-
payload: normalized
|
|
2850
|
-
}, {
|
|
2851
|
-
requestId,
|
|
2852
|
-
timeout: "interactive",
|
|
2853
|
-
shouldContinue: () => !this.cancelledHostedAuthMenuSessions.has(normalized.authMenuSessionId)
|
|
2854
|
-
})).result);
|
|
2855
|
-
if (!outcome || outcome.authMenuSessionId !== normalized.authMenuSessionId) throw new Error("Hosted auth-menu returned an invalid terminal outcome");
|
|
2856
|
-
return outcome;
|
|
2857
|
-
} finally {
|
|
2858
|
-
this.stopHostedAuthMenuAnchorTracking(normalized.authMenuSessionId);
|
|
2859
|
-
this.hostedAuthMenuRequestIds.delete(normalized.authMenuSessionId);
|
|
2860
|
-
this.hostedAuthMenuConnectionIds.delete(normalized.authMenuSessionId);
|
|
2861
|
-
this.hostedAuthMenuAnchors.delete(normalized.authMenuSessionId);
|
|
2862
|
-
this.cancelledHostedAuthMenuSessions.delete(normalized.authMenuSessionId);
|
|
2863
|
-
}
|
|
2864
|
-
}
|
|
2865
|
-
async cancelHostedAuthMenu(args) {
|
|
2866
|
-
await this.cancelHostedAuthMenuWithReason(args.authMenuSessionId, "component_unmounted");
|
|
2867
|
-
}
|
|
2868
|
-
async cancelHostedAuthMenuWithReason(rawAuthMenuSessionId, reason) {
|
|
2869
|
-
const authMenuSessionId = hostedAuthMenuSessionIdFromBoundary(rawAuthMenuSessionId);
|
|
2870
|
-
if (!authMenuSessionId) throw new Error("authMenuSessionId must be a non-empty string");
|
|
2871
|
-
const activeRequestId = this.hostedAuthMenuRequestIds.get(authMenuSessionId);
|
|
2872
|
-
if (!activeRequestId) return;
|
|
2873
|
-
const payload = buildHostedAuthMenuCancelPayload({
|
|
2874
|
-
authMenuSessionId,
|
|
2875
|
-
requestId: activeRequestId,
|
|
2876
|
-
reason
|
|
2877
|
-
});
|
|
2878
|
-
this.settleHostedAuthMenuCancellation(authMenuSessionId, reason);
|
|
2879
|
-
this.sendBestEffortHostedAuthMenuCancel(payload);
|
|
2880
|
-
}
|
|
2881
|
-
async cancelRequest(requestId) {
|
|
2882
|
-
const review = this.reviews.get(requestId);
|
|
2883
|
-
if (review) {
|
|
2884
|
-
review.reservation.cancel(new TransactionReviewError("cancelled", "Review cancelled"));
|
|
2885
|
-
return;
|
|
2886
|
-
}
|
|
2887
|
-
this.transactionSurfaceQueue.cancel(requestId);
|
|
2888
|
-
const authMenuSessionId = this.hostedAuthMenuSessionIdForRequestId(requestId);
|
|
2889
|
-
if (authMenuSessionId) this.settleHostedAuthMenuCancellation(authMenuSessionId, "component_unmounted");
|
|
2890
|
-
else if (!this.reviews.has(requestId)) this.settlePendingRequestCancellation(requestId, true);
|
|
2891
|
-
this.sendBestEffortCancel(requestId);
|
|
2892
|
-
}
|
|
2893
|
-
async cancelAll() {
|
|
2894
|
-
this.transactionSurfaceQueue.cancelAll(/* @__PURE__ */ new Error("Wallet requests cancelled"));
|
|
2895
|
-
for (const entry of this.reviews.values()) entry.reservation.cancel(new TransactionReviewError("cancelled", "Wallet requests cancelled"));
|
|
2896
|
-
for (const authMenuSessionId of Array.from(this.hostedAuthMenuRequestIds.keys())) this.settleHostedAuthMenuCancellation(authMenuSessionId, "component_unmounted");
|
|
2897
|
-
for (const requestId of Array.from(this.state.pending.keys())) {
|
|
2898
|
-
if (this.reviews.has(requestId)) continue;
|
|
2899
|
-
this.settlePendingRequestCancellation(requestId, true);
|
|
2900
|
-
this.sendBestEffortCancel(requestId);
|
|
2901
|
-
}
|
|
2902
|
-
if (this.walletIframeSurface.kind !== "hidden" && !this.reviews.has(this.walletIframeSurface.identity.requestId)) this.transitionWalletIframeSurface({
|
|
2903
|
-
kind: "request_cancelled",
|
|
2904
|
-
connectionId: this.walletIframeSurface.connectionId,
|
|
2905
|
-
identity: this.walletIframeSurface.identity
|
|
2906
|
-
});
|
|
2907
|
-
if (this.reviews.size === 0) {
|
|
2908
|
-
this.sendBestEffortCancel();
|
|
2909
|
-
this.progressBus.clearAll();
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
onPortMessage(e, connectionId) {
|
|
2913
|
-
if (this.state.connectionId !== connectionId) return;
|
|
2914
|
-
const lifecycleEnvelope = parseSdkLifecycleEnvelope(e.data);
|
|
2915
|
-
switch (lifecycleEnvelope.kind) {
|
|
2916
|
-
case "lifecycle_event":
|
|
2917
|
-
this.emitSdkLifecycleEvent(lifecycleEnvelope.event);
|
|
2918
|
-
return;
|
|
2919
|
-
case "invalid_lifecycle_event":
|
|
2920
|
-
if (this.debug) console.warn("[WalletIframeRouter] Ignored invalid SDK lifecycle event");
|
|
2921
|
-
return;
|
|
2922
|
-
case "not_lifecycle_event": break;
|
|
2923
|
-
}
|
|
2924
|
-
const msg = parseClientChildToParentEnvelope(e.data);
|
|
2925
|
-
if (!msg) return;
|
|
2926
|
-
if (msg.type === "PREFERENCES_CHANGED") {
|
|
2927
|
-
const payload = msg.payload;
|
|
2928
|
-
this.handlePreferencesChanged(payload);
|
|
2929
|
-
return;
|
|
2930
|
-
}
|
|
2931
|
-
if (msg.type === "AUTH_MENU_EXTERNAL_AUTH_REQUEST") {
|
|
2932
|
-
const payload = parseHostedAuthMenuExternalAuthRequest(msg.payload);
|
|
2933
|
-
if (!payload) return;
|
|
2934
|
-
const activeRequestId = this.hostedAuthMenuRequestIds.get(payload.authMenuSessionId);
|
|
2935
|
-
if (!activeRequestId || typeof msg.requestId !== "string" || msg.requestId !== activeRequestId) return;
|
|
2936
|
-
for (const listener of Array.from(this.listeners.hostedAuthMenuExternalAuthRequest)) try {
|
|
2937
|
-
listener(payload);
|
|
2938
|
-
} catch {}
|
|
2939
|
-
return;
|
|
2940
|
-
}
|
|
2941
|
-
if (msg.type === "AUTH_MENU_DEMO_EMAIL_OTP_DELIVERY") {
|
|
2942
|
-
const payload = parseHostedAuthMenuDemoEmailOtpDelivery(msg.payload);
|
|
2943
|
-
if (!payload) return;
|
|
2944
|
-
const activeRequestId = this.hostedAuthMenuRequestIds.get(payload.authMenuSessionId);
|
|
2945
|
-
if (!activeRequestId || typeof msg.requestId !== "string" || msg.requestId !== activeRequestId) return;
|
|
2946
|
-
for (const listener of Array.from(this.listeners.hostedAuthMenuDemoEmailOtpDelivery)) try {
|
|
2947
|
-
listener(payload);
|
|
2948
|
-
} catch {}
|
|
2949
|
-
return;
|
|
2950
|
-
}
|
|
2951
|
-
if (msg.type === "AUTH_MENU_ERROR") {
|
|
2952
|
-
const payload = parseHostedAuthMenuErrorEvent(msg.payload);
|
|
2953
|
-
if (!payload) return;
|
|
2954
|
-
const activeRequestId = this.hostedAuthMenuRequestIds.get(payload.authMenuSessionId);
|
|
2955
|
-
const anchorElement = this.hostedAuthMenuAnchors.get(payload.authMenuSessionId);
|
|
2956
|
-
if (!activeRequestId || !anchorElement || typeof msg.requestId !== "string" || msg.requestId !== activeRequestId) return;
|
|
2957
|
-
dispatchHostedAuthMenuError(anchorElement, payload);
|
|
2958
|
-
return;
|
|
2959
|
-
}
|
|
2960
|
-
if (msg.type === "TRANSACTION_REVIEW_STATE") {
|
|
2961
|
-
this.handleReviewState(msg.payload);
|
|
2962
|
-
return;
|
|
2963
|
-
}
|
|
2964
|
-
if (msg.type === "SURFACE_MEASUREMENT") {
|
|
2965
|
-
this.handleSurfaceMeasurement(msg.payload);
|
|
2966
|
-
return;
|
|
2967
|
-
}
|
|
2968
|
-
if (msg.type === "TRANSACTION_ACTIVITY") {
|
|
2969
|
-
const surface = this.walletIframeSurface;
|
|
2970
|
-
if (surface.kind !== "modal_transaction_confirm" || surface.identity.requestId !== msg.requestId) return;
|
|
2971
|
-
if (msg.payload === "closed") {
|
|
2972
|
-
this.transactionReceipt = null;
|
|
2973
|
-
this.finishRequestSurface(surface.identity.requestId, false);
|
|
2974
|
-
} else {
|
|
2975
|
-
this.transactionReceipt = {
|
|
2976
|
-
requestId: msg.requestId,
|
|
2977
|
-
view: msg.payload
|
|
2978
|
-
};
|
|
2979
|
-
this.renderActiveWalletIframeSurface();
|
|
2980
|
-
}
|
|
2981
|
-
return;
|
|
2982
|
-
}
|
|
2983
|
-
const requestId = msg.requestId;
|
|
2984
|
-
if (!requestId) return;
|
|
2985
|
-
if (msg.type === "PROGRESS") {
|
|
2986
|
-
const payload = msg.payload;
|
|
2987
|
-
this.progressBus.dispatch({
|
|
2988
|
-
requestId,
|
|
2989
|
-
payload
|
|
2990
|
-
});
|
|
2991
|
-
if (!this.reviews.has(requestId) && isWalletFlowEvent(payload) && payload.status === "cancelled") {
|
|
2992
|
-
this.settlePendingRequestCancellation(requestId, false);
|
|
2993
|
-
this.sendBestEffortCancel(requestId);
|
|
2994
|
-
return;
|
|
2995
|
-
}
|
|
2996
|
-
this.extendMeasurementFallbackOnProgress(requestId);
|
|
2997
|
-
if (!this.reviews.has(requestId) && shouldHideWalletIframeSurface(payload)) this.hideRequestSurface(requestId);
|
|
2998
|
-
if (this.progressBus.isSticky(requestId) && isTerminalStickyWalletFlowProgress(payload)) {
|
|
2999
|
-
this.progressBus.unregister(requestId);
|
|
3000
|
-
this.finishRequestSurface(requestId, isWalletFlowEvent(payload) && payload.status === "cancelled");
|
|
3001
|
-
}
|
|
3002
|
-
const pend = this.state.pending.get(requestId);
|
|
3003
|
-
if (pend?.timeout.kind === "deadline") {
|
|
3004
|
-
if (pend.timer) window.clearTimeout(pend.timer);
|
|
3005
|
-
const remainingLifetimeMs = Math.max(0, pend.timeout.deadlineAtMs - Date.now());
|
|
3006
|
-
if (remainingLifetimeMs === 0) {
|
|
3007
|
-
const err = pend.onTimeout();
|
|
3008
|
-
pend.reject(err);
|
|
3009
|
-
return;
|
|
3010
|
-
}
|
|
3011
|
-
const nextTimeoutMs = Math.max(1, Math.min(pend.timeout.timeoutMs, remainingLifetimeMs));
|
|
3012
|
-
pend.timer = window.setTimeout(() => {
|
|
3013
|
-
const err = pend.onTimeout();
|
|
3014
|
-
pend.reject(err);
|
|
3015
|
-
}, nextTimeoutMs);
|
|
3016
|
-
}
|
|
3017
|
-
return;
|
|
3018
|
-
}
|
|
3019
|
-
const pending = this.state.pending.get(requestId);
|
|
3020
|
-
if (!pending) {
|
|
3021
|
-
if (this.debug) console.debug("[WalletIframeRouter] Non-PROGRESS without pending", {
|
|
3022
|
-
requestId,
|
|
3023
|
-
type: msg.type
|
|
3024
|
-
});
|
|
3025
|
-
this.progressBus.unregister(requestId);
|
|
3026
|
-
this.finishRequestSurface(requestId, msg.type === "ERROR");
|
|
3027
|
-
return;
|
|
3028
|
-
}
|
|
3029
|
-
this.state.pending.delete(requestId);
|
|
3030
|
-
if (pending.timer) window.clearTimeout(pending.timer);
|
|
3031
|
-
if (msg.type === "ERROR") {
|
|
3032
|
-
const message = resolveCanonicalSignerBoundaryMessage(msg.payload?.code, msg.payload?.message);
|
|
3033
|
-
const err = new Error(message);
|
|
3034
|
-
err.code = msg.payload?.code;
|
|
3035
|
-
err.details = msg.payload?.details;
|
|
3036
|
-
if (isTerminalWalletStateErrorCode(msg.payload?.code)) {
|
|
3037
|
-
this.exactSessionState = { kind: "wallet_locked" };
|
|
3038
|
-
this.emitLoginStatusChanged({
|
|
3039
|
-
isLoggedIn: false,
|
|
3040
|
-
walletId: null
|
|
3041
|
-
});
|
|
3042
|
-
}
|
|
3043
|
-
pending.reject(err);
|
|
3044
|
-
const terminalStatus = isWalletOperationCancellationCode(msg.payload?.code) ? "cancelled" : "failed";
|
|
3045
|
-
const fallbackProgress = createTerminalProgressForRequest({
|
|
3046
|
-
requestType: pending.requestType,
|
|
3047
|
-
requestId,
|
|
3048
|
-
status: terminalStatus,
|
|
3049
|
-
message,
|
|
3050
|
-
errorCode: msg.payload?.code
|
|
3051
|
-
});
|
|
3052
|
-
if (fallbackProgress) this.progressBus.dispatch({
|
|
3053
|
-
requestId,
|
|
3054
|
-
payload: fallbackProgress
|
|
3055
|
-
});
|
|
3056
|
-
this.progressBus.unregister(requestId);
|
|
3057
|
-
this.finishRequestSurface(requestId, terminalStatus === "cancelled");
|
|
3058
|
-
return;
|
|
3059
|
-
}
|
|
3060
|
-
pending.resolve(msg.type === "PONG" ? void 0 : msg.payload);
|
|
3061
|
-
if (this.progressBus.isSticky(requestId)) return;
|
|
3062
|
-
this.progressBus.unregister(requestId);
|
|
3063
|
-
this.finishRequestSurface(requestId, false);
|
|
3064
|
-
}
|
|
3065
|
-
/**
|
|
3066
|
-
* Post a typed envelope over the MessagePort with robust readiness handling.
|
|
3067
|
-
* This is the core method that handles all communication with the iframe.
|
|
3068
|
-
*
|
|
3069
|
-
* Flow:
|
|
3070
|
-
* 1. Ensure iframe is ready (lazy initialization)
|
|
3071
|
-
* 2. Generate unique request ID for correlation
|
|
3072
|
-
* 3. Set up timeout and progress handling
|
|
3073
|
-
* 4. Send message to iframe via MessagePort
|
|
3074
|
-
* 5. Wait for response (PM_RESULT or ERROR)
|
|
3075
|
-
* 6. Clean up on completion or timeout
|
|
3076
|
-
*/
|
|
3077
|
-
async post(envelope, postOpts) {
|
|
3078
|
-
if (!this.state.ready || !this.state.port) await this.init();
|
|
3079
|
-
const connectionId = this.state.connectionId;
|
|
3080
|
-
if (!connectionId || !this.state.port) throw new Error("Wallet iframe connection is unavailable");
|
|
3081
|
-
if (postOpts?.shouldContinue && !postOpts.shouldContinue()) throw new Error("Wallet iframe request was cancelled before dispatch");
|
|
3082
|
-
const reservation = postOpts?.transactionDispatch?.kind === "reviewed" ? postOpts.transactionDispatch.reservation : null;
|
|
3083
|
-
if (reservation) {
|
|
3084
|
-
if (this.reviews.get(reservation.identity.requestId)?.reservation !== reservation || reservation.connectionId !== connectionId) throw new TransactionReviewError("review_identity_changed", "The review reservation is no longer valid");
|
|
3085
|
-
await this.refreshExactSessionState("current", { kind: "current" });
|
|
3086
|
-
reservation.beginDispatch();
|
|
3087
|
-
}
|
|
3088
|
-
const requestId = reservation?.identity.requestId ?? postOpts?.requestId ?? this.allocateRequestId();
|
|
3089
|
-
const full = reservation ? {
|
|
3090
|
-
...envelope,
|
|
3091
|
-
requestId,
|
|
3092
|
-
transactionReview: reservation.metadata
|
|
3093
|
-
} : {
|
|
3094
|
-
...envelope,
|
|
3095
|
-
requestId
|
|
3096
|
-
};
|
|
3097
|
-
const sessionBinding = this.sessionBindingForRequest(full);
|
|
3098
|
-
const { options } = full;
|
|
3099
|
-
const requestStartMs = Date.now();
|
|
3100
|
-
const timeoutPolicy = postOpts?.timeout === "interactive" ? { kind: "interactive" } : (() => {
|
|
3101
|
-
const timeoutMs = postOpts?.timeoutMs ?? this.opts.requestTimeoutMs;
|
|
3102
|
-
const parsedProgressTimeoutExtensionFactor = Number(postOpts?.progressTimeoutExtensionFactor);
|
|
3103
|
-
const progressTimeoutExtensionFactor = Number.isFinite(parsedProgressTimeoutExtensionFactor) && parsedProgressTimeoutExtensionFactor >= 1 ? parsedProgressTimeoutExtensionFactor : WALLET_IFRAME_PROGRESS_TIMEOUT_EXTENSION_FACTOR;
|
|
3104
|
-
return {
|
|
3105
|
-
kind: "deadline",
|
|
3106
|
-
timeoutMs,
|
|
3107
|
-
deadlineAtMs: requestStartMs + Math.max(timeoutMs, timeoutMs * progressTimeoutExtensionFactor)
|
|
3108
|
-
};
|
|
3109
|
-
})();
|
|
3110
|
-
const deadlineAtMs = timeoutPolicy.kind === "deadline" ? timeoutPolicy.deadlineAtMs : null;
|
|
3111
|
-
const surfaceKind = requestSurfaceKindForMessage(envelope.type, full.payload);
|
|
3112
|
-
let transactionSurfaceLease = null;
|
|
3113
|
-
if (!reservation && (surfaceKind === "transaction" || surfaceKind === "email_otp_enrollment")) {
|
|
3114
|
-
const queueDeadline = timeoutPolicy.kind === "deadline" ? {
|
|
3115
|
-
kind: "deadline",
|
|
3116
|
-
atMs: timeoutPolicy.deadlineAtMs
|
|
3117
|
-
} : { kind: "interactive" };
|
|
3118
|
-
transactionSurfaceLease = await this.transactionSurfaceQueue.acquire({
|
|
3119
|
-
requestId,
|
|
3120
|
-
deadline: queueDeadline
|
|
3121
|
-
});
|
|
3122
|
-
}
|
|
3123
|
-
try {
|
|
3124
|
-
if (this.state.connectionId !== connectionId || !this.state.port) throw new WalletIframeConnectionClosedRequestError(requestId, connectionId, envelope.type);
|
|
3125
|
-
const admission = this.requestAdmission(sessionBinding);
|
|
3126
|
-
if (admission.kind === "expired") throw new WalletIframeSessionExpiredRequestError({
|
|
3127
|
-
kind: "wallet_iframe_request_failure",
|
|
3128
|
-
code: "wallet_session_expired",
|
|
3129
|
-
walletId: admission.identity.walletId,
|
|
3130
|
-
walletSessionId: admission.identity.walletSessionId
|
|
3131
|
-
});
|
|
3132
|
-
if (surfaceKind && !reservation) this.beginRequestSurface({
|
|
3133
|
-
kind: surfaceKind,
|
|
3134
|
-
requestId,
|
|
3135
|
-
deadlineAtMs,
|
|
3136
|
-
payload: full.payload,
|
|
3137
|
-
authMenuSessionId: authMenuSessionIdForMessage(envelope.type, full.payload) ?? void 0
|
|
3138
|
-
});
|
|
3139
|
-
return await new Promise((resolve, reject) => {
|
|
3140
|
-
const onTimeout = () => {
|
|
3141
|
-
const pending = this.state.pending.get(requestId);
|
|
3142
|
-
if (pending?.timer !== void 0) window.clearTimeout(pending.timer);
|
|
3143
|
-
this.state.pending.delete(requestId);
|
|
3144
|
-
this.progressBus.unregister(requestId);
|
|
3145
|
-
this.finishRequestSurface(requestId, true);
|
|
3146
|
-
this.sendBestEffortCancel(requestId);
|
|
3147
|
-
const elapsedMs = Math.max(0, Date.now() - requestStartMs);
|
|
3148
|
-
return /* @__PURE__ */ new Error(`Wallet request timeout for ${envelope.type} after ${elapsedMs}ms`);
|
|
3149
|
-
};
|
|
3150
|
-
const timer = timeoutPolicy.kind === "deadline" ? window.setTimeout(() => {
|
|
3151
|
-
reject(onTimeout());
|
|
3152
|
-
}, Math.max(1, Math.min(timeoutPolicy.timeoutMs, timeoutPolicy.deadlineAtMs - Date.now()))) : void 0;
|
|
3153
|
-
this.state.pending.set(requestId, {
|
|
3154
|
-
requestId,
|
|
3155
|
-
connectionId,
|
|
3156
|
-
resolve: (v) => resolve(v),
|
|
3157
|
-
reject,
|
|
3158
|
-
timer,
|
|
3159
|
-
timeout: timeoutPolicy,
|
|
3160
|
-
onProgress: options?.onProgress,
|
|
3161
|
-
requestType: envelope.type,
|
|
3162
|
-
onTimeout,
|
|
3163
|
-
sessionBinding: admission.binding
|
|
3164
|
-
});
|
|
3165
|
-
this.progressBus.register({
|
|
3166
|
-
requestId,
|
|
3167
|
-
sticky: !!options?.sticky,
|
|
3168
|
-
onProgress: (payload) => {
|
|
3169
|
-
try {
|
|
3170
|
-
options?.onProgress?.(payload);
|
|
3171
|
-
} catch {}
|
|
3172
|
-
}
|
|
3173
|
-
});
|
|
3174
|
-
try {
|
|
3175
|
-
const stickyVal = isObject(options) ? options.sticky : void 0;
|
|
3176
|
-
const wireOptions = isBoolean(stickyVal) ? { sticky: stickyVal } : void 0;
|
|
3177
|
-
const serializableFull = wireOptions ? {
|
|
3178
|
-
...full,
|
|
3179
|
-
options: wireOptions
|
|
3180
|
-
} : {
|
|
3181
|
-
...full,
|
|
3182
|
-
options: void 0
|
|
3183
|
-
};
|
|
3184
|
-
this.state.port.postMessage(serializableFull);
|
|
3185
|
-
} catch (err) {
|
|
3186
|
-
this.state.pending.delete(requestId);
|
|
3187
|
-
window.clearTimeout(timer);
|
|
3188
|
-
this.progressBus.unregister(requestId);
|
|
3189
|
-
this.finishRequestSurface(requestId, true);
|
|
3190
|
-
reject(toError(err));
|
|
3191
|
-
}
|
|
3192
|
-
});
|
|
3193
|
-
} finally {
|
|
3194
|
-
transactionSurfaceLease?.release();
|
|
3195
|
-
}
|
|
3196
|
-
}
|
|
3197
|
-
sessionBindingForRequest(envelope) {
|
|
3198
|
-
const requestWalletId = exactSessionRequestWalletId(envelope);
|
|
3199
|
-
if (requestWalletId === null) return { kind: "unbound" };
|
|
3200
|
-
const state = this.exactSessionState;
|
|
3201
|
-
if (state === null || state.kind !== "active_session" || state.walletId !== requestWalletId) return { kind: "unbound" };
|
|
3202
|
-
return {
|
|
3203
|
-
kind: "exact_session",
|
|
3204
|
-
walletId: state.walletId,
|
|
3205
|
-
authorizationId: state.authorizationId,
|
|
3206
|
-
walletSessionId: state.walletSessionId,
|
|
3207
|
-
authMethod: state.authMethod,
|
|
3208
|
-
expiresAtMs: state.expiresAtMs
|
|
3209
|
-
};
|
|
3210
|
-
}
|
|
3211
|
-
requestAdmission(binding) {
|
|
3212
|
-
if (binding.kind === "unbound") return {
|
|
3213
|
-
kind: "admitted",
|
|
3214
|
-
binding
|
|
3215
|
-
};
|
|
3216
|
-
if (!this.expiredSigningSessionsByWallet.get(binding.walletId)?.has(binding.walletSessionId)) return {
|
|
3217
|
-
kind: "admitted",
|
|
3218
|
-
binding
|
|
3219
|
-
};
|
|
3220
|
-
const { kind: _kind, ...identity } = binding;
|
|
3221
|
-
return {
|
|
3222
|
-
kind: "expired",
|
|
3223
|
-
identity
|
|
3224
|
-
};
|
|
3225
|
-
}
|
|
3226
|
-
allocateRequestId() {
|
|
3227
|
-
return `${Date.now()}-${++this.state.reqCounter}`;
|
|
3228
|
-
}
|
|
3229
|
-
sendBestEffortCancel(targetRequestId, reviewError) {
|
|
3230
|
-
const port = this.state.port;
|
|
3231
|
-
if (!port) return;
|
|
3232
|
-
const cancelEnvelope = {
|
|
3233
|
-
type: "PM_CANCEL",
|
|
3234
|
-
requestId: `cancel-${Date.now()}-${secureRandomBase36(12, "wallet iframe cancel request IDs")}`,
|
|
3235
|
-
payload: targetRequestId ? {
|
|
3236
|
-
requestId: targetRequestId,
|
|
3237
|
-
...this.reviews.get(targetRequestId) ? {
|
|
3238
|
-
transactionReview: this.reviews.get(targetRequestId).reservation.metadata,
|
|
3239
|
-
reviewErrorCode: transactionReviewCancellationCode(reviewError && "code" in reviewError ? reviewError.code : void 0)
|
|
3240
|
-
} : {}
|
|
3241
|
-
} : {}
|
|
3242
|
-
};
|
|
3243
|
-
try {
|
|
3244
|
-
port.postMessage(cancelEnvelope);
|
|
3245
|
-
} catch {}
|
|
3246
|
-
}
|
|
3247
|
-
sendBestEffortHostedAuthMenuCancel(payload) {
|
|
3248
|
-
const port = this.state.port;
|
|
3249
|
-
if (!port) return;
|
|
3250
|
-
try {
|
|
3251
|
-
port.postMessage({
|
|
3252
|
-
type: "PM_CANCEL_AUTH_MENU",
|
|
3253
|
-
requestId: `cancel-auth-menu-${Date.now()}-${secureRandomBase36(12, "wallet iframe auth menu cancel request IDs")}`,
|
|
3254
|
-
payload
|
|
3255
|
-
});
|
|
3256
|
-
} catch {}
|
|
3257
|
-
}
|
|
3258
|
-
/** Public helper for tests/tools: get the underlying iframe element. */
|
|
3259
|
-
getIframeEl() {
|
|
3260
|
-
return this.transport.getIframeEl();
|
|
3261
|
-
}
|
|
3262
|
-
/** Public helper for tests/tools: inspect current overlay state. */
|
|
3263
|
-
getOverlayState() {
|
|
3264
|
-
return this.overlayState.controller.getState();
|
|
3265
|
-
}
|
|
3266
|
-
};
|
|
3267
|
-
function requestPayloadWalletId(payload) {
|
|
3268
|
-
if (payload === null || typeof payload !== "object" || Array.isArray(payload)) return null;
|
|
3269
|
-
const walletId = Reflect.get(payload, "walletId");
|
|
3270
|
-
return typeof walletId === "string" ? walletId : null;
|
|
3271
|
-
}
|
|
3272
|
-
function requestPayloadSessionWalletId(payload) {
|
|
3273
|
-
if (payload === null || typeof payload !== "object" || Array.isArray(payload)) return null;
|
|
3274
|
-
const walletSession = Reflect.get(payload, "walletSession");
|
|
3275
|
-
if (walletSession === null || typeof walletSession !== "object" || Array.isArray(walletSession)) return null;
|
|
3276
|
-
const walletId = Reflect.get(walletSession, "walletId");
|
|
3277
|
-
return typeof walletId === "string" ? walletId : null;
|
|
3278
|
-
}
|
|
3279
|
-
function exactSessionRequestWalletId(envelope) {
|
|
3280
|
-
const payload = envelope.payload;
|
|
3281
|
-
switch (envelope.type) {
|
|
3282
|
-
case "PM_SIGN_TX_WITH_ACTIONS":
|
|
3283
|
-
case "PM_SIGN_AND_SEND_TX":
|
|
3284
|
-
case "PM_EXECUTE_ACTION":
|
|
3285
|
-
case "PM_SIGN_DELEGATE_ACTION":
|
|
3286
|
-
case "PM_SIGN_NEP413": return requestPayloadWalletId(payload);
|
|
3287
|
-
case "PM_SIGN_TEMPO": return requestPayloadSessionWalletId(payload);
|
|
3288
|
-
case "PM_REVOKE_LINKED_DEVICE":
|
|
3289
|
-
case "PM_ROTATE_WALLET_RECOVERY_CODES": return requestPayloadWalletId(payload);
|
|
3290
|
-
default: return null;
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
function parseRequestedWalletId(value) {
|
|
3294
|
-
const normalized = value.trim();
|
|
3295
|
-
if (!normalized) throw new Error("Wallet Session request walletId is required");
|
|
3296
|
-
return walletIdFromString(normalized);
|
|
3297
|
-
}
|
|
3298
|
-
function isRegistrationFlowEvent(progress) {
|
|
3299
|
-
return isWalletFlowEvent(progress) && progress.flow === "registration";
|
|
3300
|
-
}
|
|
3301
|
-
function bridgeRegistrationProgress(onEvent, onTimingSpan) {
|
|
3302
|
-
if (!onEvent && !onTimingSpan) return void 0;
|
|
3303
|
-
return (progress) => {
|
|
3304
|
-
try {
|
|
3305
|
-
if (isRegistrationFlowEvent(progress)) onEvent?.(progress);
|
|
3306
|
-
else if (isRegistrationTimingSpanV1(progress)) onTimingSpan?.(progress);
|
|
3307
|
-
} catch {}
|
|
3308
|
-
};
|
|
3309
|
-
}
|
|
3310
|
-
function isUnlockFlowEvent(p) {
|
|
3311
|
-
return isWalletFlowEvent(p) && p.flow === "unlock";
|
|
3312
|
-
}
|
|
3313
|
-
function isSigningFlowEvent(p) {
|
|
3314
|
-
return isWalletFlowEvent(p) && p.flow === "signing";
|
|
3315
|
-
}
|
|
3316
|
-
function isLinkDeviceFlowEvent(p) {
|
|
3317
|
-
return isWalletFlowEvent(p) && p.flow === "link_device";
|
|
3318
|
-
}
|
|
3319
|
-
function isAccountSyncFlowEvent(p) {
|
|
3320
|
-
return isWalletFlowEvent(p) && p.flow === "account_sync";
|
|
3321
|
-
}
|
|
3322
|
-
function isKeyExportFlowEvent(p) {
|
|
3323
|
-
return isWalletFlowEvent(p) && p.flow === "key_export";
|
|
3324
|
-
}
|
|
3325
|
-
/**
|
|
3326
|
-
* Strips out class functions as they cannot be sent over postMessage to iframe
|
|
3327
|
-
*/
|
|
3328
|
-
function normalizeSignedTransactionResult(result) {
|
|
3329
|
-
const signedTransaction = result.signedTransaction;
|
|
3330
|
-
if (!isPlainSignedTransactionLike(signedTransaction)) return result;
|
|
3331
|
-
const nonceLease = signedTransaction.nonceLease || result.nonceLease;
|
|
3332
|
-
const serverDispatch = signedTransaction.serverDispatch;
|
|
3333
|
-
return {
|
|
3334
|
-
...result,
|
|
3335
|
-
signedTransaction: SignedTransaction.fromPlain({
|
|
3336
|
-
transaction: signedTransaction.transaction,
|
|
3337
|
-
signature: signedTransaction.signature,
|
|
3338
|
-
borsh_bytes: extractBorshBytesFromPlainSignedTx(signedTransaction),
|
|
3339
|
-
...nonceLease ? { nonceLease } : {},
|
|
3340
|
-
...serverDispatch ? { serverDispatch } : {}
|
|
3341
|
-
})
|
|
3342
|
-
};
|
|
3343
|
-
}
|
|
3344
|
-
function unlockOnEventFromRequest(request) {
|
|
3345
|
-
switch (request.kind) {
|
|
3346
|
-
case "default_options": return;
|
|
3347
|
-
case "custom_options": return request.options.onEvent;
|
|
3348
|
-
}
|
|
3349
|
-
return assertNeverLoginUnlockRequest(request);
|
|
3350
|
-
}
|
|
3351
|
-
function removeFunctionsFromOptions(options) {
|
|
3352
|
-
if (!options || !isObject(options)) return void 0;
|
|
3353
|
-
return stripFunctionsShallow(options);
|
|
3354
|
-
}
|
|
3355
|
-
function assertNeverLoginUnlockRequest(value) {
|
|
3356
|
-
throw new Error(`Unhandled wallet iframe unlock request: ${String(value)}`);
|
|
3357
|
-
}
|
|
3358
|
-
function sameReviewSession(left, right) {
|
|
3359
|
-
if (left.kind !== right.kind) return false;
|
|
3360
|
-
if (left.kind === "wallet_locked" || right.kind === "wallet_locked") return true;
|
|
3361
|
-
if (left.walletId !== right.walletId) return false;
|
|
3362
|
-
if ("walletSessionId" in left || "walletSessionId" in right) return "walletSessionId" in left && "walletSessionId" in right && left.walletSessionId === right.walletSessionId && left.authorizationId === right.authorizationId;
|
|
3363
|
-
return true;
|
|
3364
|
-
}
|
|
3365
|
-
//#endregion
|
|
3366
|
-
export { WalletIframeRouter };
|
|
3367
|
-
|
|
3368
|
-
//# sourceMappingURL=router.js.map
|