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