@seams/wallet 0.28.0 → 0.30.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 +29 -4
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/SeamsWeb.js +2 -0
- package/dist/esm/SeamsWeb/publicApi/createPublicApi.js +11 -0
- package/dist/esm/SeamsWeb/publicApi/near.js +3 -0
- package/dist/esm/SeamsWeb/publicApi/ownerNearOperation.js +175 -0
- package/dist/esm/SeamsWeb/walletIframe/client/inboundMessages.js +9 -0
- package/dist/esm/SeamsWeb/walletIframe/client/nearCommands.js +4 -0
- package/dist/esm/SeamsWeb/walletIframe/client/ownerNearOperation.js +67 -0
- package/dist/esm/SeamsWeb/walletIframe/client/progress/on-events-progress-bus.js +27 -17
- package/dist/esm/SeamsWeb/walletIframe/client/router.js +60 -7
- package/dist/esm/SeamsWeb/walletIframe/client/sessionCommands.js +4 -0
- package/dist/esm/SeamsWeb/walletIframe/coordinator.js +18 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +88 -47
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/WalletAlternativesSection.js +67 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.js +13 -0
- package/dist/esm/SeamsWeb/walletIframe/host/walletMutationGuard.js +6 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/exactSessionState.js +15 -1
- package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +20 -6
- package/dist/esm/SeamsWeb/walletIframe/shared/ownerNearOperation.js +152 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/walletAlternatives.js +109 -0
- package/dist/esm/core/accountData/near/accountProjection.js +1 -1
- package/dist/esm/core/config/configBuilder.js +1 -1
- package/dist/esm/core/config/defaultConfigs.js +9 -2
- package/dist/esm/core/indexedDB/seamsWalletDB/repositories.js +4 -3
- package/dist/esm/core/rpcClients/relayer/walletRegistration.js +1 -1
- package/dist/esm/core/signingEngine/flows/registration/accountLifecycle.js +1 -1
- package/dist/esm/core/signingEngine/flows/shared/signingConfirmation.js +1 -1
- package/dist/esm/core/signingEngine/flows/signEvmFamily/signEvmFamily.js +1 -1
- package/dist/esm/core/signingEngine/flows/signEvmFamily/signingFlow.js +1 -1
- package/dist/esm/core/signingEngine/flows/signNear/shared/ed25519YaoNormalSigning.js +2 -2
- package/dist/esm/core/signingEngine/flows/signNear/signDelegate.js +2 -2
- package/dist/esm/core/signingEngine/flows/signNear/signNear.js +3 -8
- package/dist/esm/core/signingEngine/flows/signNear/signNep413.js +1 -1
- package/dist/esm/core/signingEngine/flows/signNear/signTransactions.js +3 -4
- package/dist/esm/core/signingEngine/session/identity/exactSigningLaneIdentity.js +1 -1
- package/dist/esm/core/ui/messages.js +3 -1
- package/dist/esm/core/ui/walletIcon.js +10 -0
- package/dist/esm/externalEvm/boundary.js +4 -2
- package/dist/esm/index.js +3 -2
- package/dist/esm/react/boundWallet.js +24 -0
- package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +26 -6
- package/dist/esm/react/components/HostedSeamsAuthMenu/walletAlternatives.js +178 -0
- package/dist/esm/react/context/useLoginStateRefresher.js +1 -0
- package/dist/esm/react/hooks/useAccountInput.js +1 -1
- package/dist/esm/react/hooks/useOwnerNearOperation.js +10 -0
- package/dist/esm/react/index.js +3 -3
- package/dist/esm/react/styles/styles.css +0 -183
- package/dist/esm/react/styles.css +0 -1
- package/dist/esm/sdk/{ConfirmationDrawer-MJoE0AAo.js → ConfirmationDrawer-fyl4IDRl.js} +1 -1
- package/dist/esm/sdk/NonceCoordinator-C1lw03Ce.js +1 -0
- package/dist/esm/sdk/{SeamsWordmark-DwvPx2UA.js → SeamsWordmark-CeEi2RlU.js} +1 -1
- package/dist/esm/sdk/accountLifecycle-B5a9SCM7.js +1 -0
- package/dist/{public/sdk/activeWalletSession-BJ4B-nJo.js → esm/sdk/activeWalletSession-HAOgRKzn.js} +1 -1
- package/dist/{public/sdk/adapters-C-g_hkkZ.js → esm/sdk/adapters-BY1wGpm5.js} +1 -1
- package/dist/esm/sdk/appearance-token-vars-CzlRDVQ7.js +1 -0
- package/dist/esm/sdk/authorization-D_NueqAv.js +1 -0
- package/dist/esm/sdk/clientSessionPersistenceState-B3gU3515.js +1 -0
- package/dist/esm/sdk/{collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js → collectAuthenticationCredentialForChallengeB64u-BoFVpdRS.js} +1 -1
- package/dist/esm/sdk/{commitQueue-CYruPlkm.js → commitQueue-CbyuhEW9.js} +1 -1
- package/dist/esm/sdk/confirm-ui-DWFcGTsT.js +2 -0
- package/dist/{public/sdk/device-linking-DiCNt3iA.js → esm/sdk/device-linking-BL2aDEUF.js} +1 -1
- package/dist/esm/sdk/{deviceLinkApproval-x3WkiYrd.js → deviceLinkApproval-C4T8XAmi.js} +1 -1
- package/dist/{public/sdk/digestEncoding-CqNXPZY9.js → esm/sdk/digestEncoding-Rx8Vjy4J.js} +1 -1
- package/dist/esm/sdk/{display-D0EPmU4w.js → display-8NGPOhQT.js} +1 -1
- package/dist/{public/sdk/ecdsaCapabilityManifest-DAJEVjlP.js → esm/sdk/ecdsaCapabilityManifest-BbPXL-qh.js} +1 -1
- package/dist/esm/sdk/{ecdsaDerivationClientWasm-AYOJgTJm.js → ecdsaDerivationClientWasm-GCt9yVsd.js} +1 -1
- package/dist/esm/sdk/ecdsaDerivationExport-jm2VBMz_.js +1 -0
- package/dist/esm/sdk/{ecdsaWalletRecords-WLyq414E.js → ecdsaWalletRecords-CKaXfsVu.js} +1 -1
- package/dist/esm/sdk/ed25519OperationFingerprint-Dev4P6Og.js +1 -0
- package/dist/esm/sdk/{emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js → emailOtpEcdsaDerivationIdentity-DJmMyqL-.js} +1 -1
- package/dist/esm/sdk/{enrichDisplayModelWithAbi-O6Mw4i2E.js → enrichDisplayModelWithAbi-JeAcpa7r.js} +1 -1
- package/dist/esm/sdk/{evmCryptoWasm-BUPb4hBH.js → evmCryptoWasm-CeH6Qeaa.js} +1 -1
- package/dist/esm/sdk/{export-viewer-host-BSTfHhau.js → export-viewer-host-TzgdJQuZ.js} +1 -1
- package/dist/esm/sdk/exportKeypairOperation-B9_ulzNz.js +1 -0
- package/dist/esm/sdk/host-Csu5L7VF.js +1 -0
- package/dist/{public/sdk/icons-BlMXolHv.js → esm/sdk/icons-pSZJ5Xrm.js} +1 -1
- package/dist/esm/sdk/indexedDB-BqsYXybq.js +1 -0
- package/dist/esm/sdk/{intentDigest-HvRsBQ1z.js → intentDigest-gM3r4SVX.js} +1 -1
- package/dist/esm/sdk/{lanes-BU-fGqY4.js → lanes-0WT2w1Xz.js} +1 -1
- package/dist/esm/sdk/{localOnly-Xs89Xajm.js → localOnly-DFrtrfdO.js} +1 -1
- package/dist/{public/sdk/mountExportPrivateKeySurface-CsUEKeum.js → esm/sdk/mountExportPrivateKeySurface-D8juRQJM.js} +1 -1
- package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-kFLo5zLk.js → mountRecoveryCodeBackupSurface-CMtByh-L.js} +1 -1
- package/dist/esm/sdk/nearEd25519YaoSigningPreparation-Cz2Gb95g.js +1 -0
- package/dist/esm/sdk/{nonceLaneKeys-BF_UpvIy.js → nonceLaneKeys-DtBpxubF.js} +1 -1
- package/dist/esm/sdk/{normalization-Df9fZWJC.js → normalization-DmfGvZ_3.js} +1 -1
- package/dist/esm/sdk/{operationFingerprint-Bas59T7L.js → operationFingerprint-GKEY-X5I.js} +1 -1
- package/dist/esm/sdk/ownerNearOperation-DCxxHcwX.js +1 -0
- package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js → esm/sdk/pendingWalletRecoveryCodeBackup-8iMhQU-E.js} +1 -1
- package/dist/esm/sdk/{presignaturePool-BbvqRWYw.js → presignaturePool-CaI45td2.js} +1 -1
- package/dist/{public/sdk/presignatures-BCeq56DG.js → esm/sdk/presignatures-B9KnQyfE.js} +1 -1
- package/dist/{public/sdk/recovery-entrypoint-DJbMDC_m.js → esm/sdk/recovery-entrypoint-DA2FGLG6.js} +1 -1
- package/dist/esm/sdk/registration-C7w_51wE.js +1 -0
- package/dist/esm/sdk/{registration-C2fb9kRQ.js → registration-XNyt1YRK.js} +1 -1
- package/dist/esm/sdk/{registrationAccounts-4r74gX1l.js → registrationAccounts-Bso0ntMs.js} +1 -1
- package/dist/{public/sdk/registrationIntent-Do1tD1V7.js → esm/sdk/registrationIntent-Cb3tggIM.js} +1 -1
- package/dist/{public/sdk/registrationSignerPlan-DK2b3N_p.js → esm/sdk/registrationSignerPlan-CeMidFme.js} +1 -1
- package/dist/esm/sdk/{requireStepUpAuth-COqCGb1i.js → requireStepUpAuth-ByMTPBu4.js} +1 -1
- package/dist/esm/sdk/resealedEnvelopeResult-DKY5fVNY.js +1 -0
- package/dist/esm/sdk/routerAbNormalSigning-CPLDkttX.js +1 -0
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/esm/sdk/runtime-auth-BMT_gIKI.js +1 -0
- package/dist/esm/sdk/runtime-device-link-DQe0aqRi.js +1 -0
- package/dist/esm/sdk/runtime-ecdsa-tempo-DKkeMMpm.js +1 -0
- package/dist/esm/sdk/runtime-email-otp-CzTe7r9I.js +1 -0
- package/dist/esm/sdk/runtime-export-BiyLbdCe.js +1 -0
- package/dist/esm/sdk/runtime-near-Kk0n1FSf.js +1 -0
- package/dist/esm/sdk/runtime-preferences-B-A3hddU.js +1 -0
- package/dist/esm/sdk/runtime-recovery-C9p1TU1w.js +1 -0
- package/dist/esm/sdk/{runtime-recovery-codes-si1fGktB.js → runtime-recovery-codes-CFOWDVd9.js} +1 -1
- package/dist/esm/sdk/runtimeContext-ChuvOC0h.js +7 -0
- package/dist/esm/sdk/{secp256k1-CE7-q9Sn.js → secp256k1-sDDAa4Ga.js} +1 -1
- package/dist/esm/sdk/signEvmFamily-CMrXkVsZ.js +1 -0
- package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js → signEvmFamilyWithUiConfirmForTempo-CnRoo0e8.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-CGrLtMV6.js → signEvmWithUiConfirm-yITc3ZvP.js} +1 -1
- package/dist/esm/sdk/signNear-DyFk--I3.js +1 -0
- package/dist/esm/sdk/{signatureUses-kSrUHSSH.js → signatureUses-BLOoPRsb.js} +1 -1
- package/dist/{public/sdk/signingFlow-BcetvUeS.js → esm/sdk/signingFlow-DTP4D19E.js} +2 -2
- package/dist/{public/sdk/signingQueue-dMFOFOP5.js → esm/sdk/signingQueue-Dy5mYMus.js} +1 -1
- package/dist/esm/sdk/{thresholdEcdsa-CqR1fFA-.js → thresholdEcdsa-CRfx6RP1.js} +1 -1
- package/dist/esm/sdk/{trace--mRP2OQc.js → trace-BA8jya7O.js} +1 -1
- package/dist/esm/sdk/{transaction-activity-DCzHGg3b.js → transaction-activity-BXSxMp1E.js} +1 -1
- package/dist/esm/sdk/{transactionState-29T9xfvL.js → transactionState-BCbaT2hO.js} +1 -1
- package/dist/esm/sdk/tx-confirm-ui.js +3 -1
- package/dist/esm/sdk/{types-f7dyj5N6.js → types-D2Zk1W7I.js} +1 -1
- package/dist/esm/sdk/{unlockedEd25519ExportRootCapability-yzxQjIFd.js → unlockedEd25519ExportRootCapability-BbGMlikr.js} +1 -1
- package/dist/esm/sdk/voiceid-host.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/{public/sdk/wallet-recovery-BZB2Vu3X.js → esm/sdk/wallet-recovery-Bfm-oUoP.js} +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/esm/sdk/{walletAuthMethodRecord-DLBB5fez.js → walletAuthMethodRecord--fvGr8r1.js} +1 -1
- package/dist/{public/sdk/walletAuthority-BTGAuOi8.js → esm/sdk/walletAuthority-CU9nO0Ze.js} +1 -1
- package/dist/esm/sdk/{walletCapabilityBindings-D5YYB7nN.js → walletCapabilityBindings-mPx-6_r-.js} +1 -1
- package/dist/{public/sdk/walletCustodyEcdsaContinuity-C31YQ9av.js → esm/sdk/walletCustodyEcdsaContinuity-BUdDyRl_.js} +1 -1
- package/dist/esm/sdk/{walletDbName-Ca0rCq5r.js → walletDbName-B6-CV_Rq.js} +1 -1
- package/dist/esm/sdk/{walletCustodyOperation-DimzAbCB.js → walletOwnerOperation-BJPxzo-k.js} +1 -1
- package/dist/{public/sdk/walletOwnershipGeneration-CgjCtPrV.js → esm/sdk/walletOwnershipGeneration-B3uE9GRG.js} +1 -1
- package/dist/esm/sdk/walletRecoveryAdminProof-BmZaP0Q8.js +1 -0
- package/dist/esm/sdk/walletRecoveryCommit-CSYNbYNd.js +1 -0
- package/dist/{public/sdk/walletSessionAuthorizationStatus-DG7DPcgR.js → esm/sdk/walletSessionAuthorizationStatus-CQ3qA9tI.js} +1 -1
- package/dist/esm/sdk/{walletSessionAuthorizationStore-B9Vwkshr.js → walletSessionAuthorizationStore-CGt-s5fX.js} +1 -1
- package/dist/esm/sdk/{webauthnP256-BsQQPurm.js → webauthnP256-BGHikiNl.js} +1 -1
- package/dist/esm/shared-ts/src/auth/externalAuth.js +2 -2
- package/dist/esm/shared-ts/src/utils/index.js +3 -3
- package/dist/esm/voiceid-host.js +1 -1
- 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_bg.wasm +0 -0
- 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-MJoE0AAo.js → ConfirmationDrawer-fyl4IDRl.js} +1 -1
- package/dist/public/sdk/NonceCoordinator-C1lw03Ce.js +1 -0
- package/dist/public/sdk/{SeamsWordmark-DwvPx2UA.js → SeamsWordmark-CeEi2RlU.js} +1 -1
- package/dist/public/sdk/accountLifecycle-B5a9SCM7.js +1 -0
- package/dist/{esm/sdk/activeWalletSession-BJ4B-nJo.js → public/sdk/activeWalletSession-HAOgRKzn.js} +1 -1
- package/dist/{esm/sdk/adapters-C-g_hkkZ.js → public/sdk/adapters-BY1wGpm5.js} +1 -1
- package/dist/public/sdk/appearance-token-vars-CzlRDVQ7.js +1 -0
- package/dist/public/sdk/authorization-D_NueqAv.js +1 -0
- package/dist/public/sdk/clientSessionPersistenceState-B3gU3515.js +1 -0
- package/dist/public/sdk/{collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js → collectAuthenticationCredentialForChallengeB64u-BoFVpdRS.js} +1 -1
- package/dist/public/sdk/{commitQueue-CYruPlkm.js → commitQueue-CbyuhEW9.js} +1 -1
- package/dist/public/sdk/confirm-ui-DWFcGTsT.js +2 -0
- package/dist/{esm/sdk/device-linking-DiCNt3iA.js → public/sdk/device-linking-BL2aDEUF.js} +1 -1
- package/dist/public/sdk/{deviceLinkApproval-x3WkiYrd.js → deviceLinkApproval-C4T8XAmi.js} +1 -1
- package/dist/{esm/sdk/digestEncoding-CqNXPZY9.js → public/sdk/digestEncoding-Rx8Vjy4J.js} +1 -1
- package/dist/public/sdk/{display-D0EPmU4w.js → display-8NGPOhQT.js} +1 -1
- package/dist/{esm/sdk/ecdsaCapabilityManifest-DAJEVjlP.js → public/sdk/ecdsaCapabilityManifest-BbPXL-qh.js} +1 -1
- package/dist/public/sdk/{ecdsaDerivationClientWasm-AYOJgTJm.js → ecdsaDerivationClientWasm-GCt9yVsd.js} +1 -1
- package/dist/public/sdk/ecdsaDerivationExport-jm2VBMz_.js +1 -0
- package/dist/public/sdk/{ecdsaWalletRecords-WLyq414E.js → ecdsaWalletRecords-CKaXfsVu.js} +1 -1
- package/dist/public/sdk/ed25519OperationFingerprint-Dev4P6Og.js +1 -0
- package/dist/public/sdk/{emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js → emailOtpEcdsaDerivationIdentity-DJmMyqL-.js} +1 -1
- package/dist/public/sdk/{enrichDisplayModelWithAbi-O6Mw4i2E.js → enrichDisplayModelWithAbi-JeAcpa7r.js} +1 -1
- package/dist/public/sdk/{evmCryptoWasm-BUPb4hBH.js → evmCryptoWasm-CeH6Qeaa.js} +1 -1
- package/dist/public/sdk/{export-viewer-host-BSTfHhau.js → export-viewer-host-TzgdJQuZ.js} +1 -1
- package/dist/public/sdk/exportKeypairOperation-B9_ulzNz.js +1 -0
- package/dist/public/sdk/host-Csu5L7VF.js +1 -0
- package/dist/{esm/sdk/icons-BlMXolHv.js → public/sdk/icons-pSZJ5Xrm.js} +1 -1
- package/dist/public/sdk/indexedDB-BqsYXybq.js +1 -0
- package/dist/public/sdk/{intentDigest-HvRsBQ1z.js → intentDigest-gM3r4SVX.js} +1 -1
- package/dist/public/sdk/{lanes-BU-fGqY4.js → lanes-0WT2w1Xz.js} +1 -1
- package/dist/public/sdk/{localOnly-Xs89Xajm.js → localOnly-DFrtrfdO.js} +1 -1
- package/dist/{esm/sdk/mountExportPrivateKeySurface-CsUEKeum.js → public/sdk/mountExportPrivateKeySurface-D8juRQJM.js} +1 -1
- package/dist/public/sdk/{mountRecoveryCodeBackupSurface-kFLo5zLk.js → mountRecoveryCodeBackupSurface-CMtByh-L.js} +1 -1
- package/dist/public/sdk/nearEd25519YaoSigningPreparation-Cz2Gb95g.js +1 -0
- package/dist/public/sdk/{nonceLaneKeys-BF_UpvIy.js → nonceLaneKeys-DtBpxubF.js} +1 -1
- package/dist/public/sdk/{normalization-Df9fZWJC.js → normalization-DmfGvZ_3.js} +1 -1
- package/dist/public/sdk/{operationFingerprint-Bas59T7L.js → operationFingerprint-GKEY-X5I.js} +1 -1
- package/dist/public/sdk/ownerNearOperation-DCxxHcwX.js +1 -0
- package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js → public/sdk/pendingWalletRecoveryCodeBackup-8iMhQU-E.js} +1 -1
- package/dist/public/sdk/{presignaturePool-BbvqRWYw.js → presignaturePool-CaI45td2.js} +1 -1
- package/dist/{esm/sdk/presignatures-BCeq56DG.js → public/sdk/presignatures-B9KnQyfE.js} +1 -1
- package/dist/{esm/sdk/recovery-entrypoint-DJbMDC_m.js → public/sdk/recovery-entrypoint-DA2FGLG6.js} +1 -1
- package/dist/public/sdk/registration-C7w_51wE.js +1 -0
- package/dist/public/sdk/{registration-C2fb9kRQ.js → registration-XNyt1YRK.js} +1 -1
- package/dist/public/sdk/{registrationAccounts-4r74gX1l.js → registrationAccounts-Bso0ntMs.js} +1 -1
- package/dist/{esm/sdk/registrationIntent-Do1tD1V7.js → public/sdk/registrationIntent-Cb3tggIM.js} +1 -1
- package/dist/{esm/sdk/registrationSignerPlan-DK2b3N_p.js → public/sdk/registrationSignerPlan-CeMidFme.js} +1 -1
- package/dist/public/sdk/{requireStepUpAuth-COqCGb1i.js → requireStepUpAuth-ByMTPBu4.js} +1 -1
- package/dist/public/sdk/resealedEnvelopeResult-DKY5fVNY.js +1 -0
- package/dist/public/sdk/routerAbNormalSigning-CPLDkttX.js +1 -0
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/runtime-auth-BMT_gIKI.js +1 -0
- package/dist/public/sdk/runtime-device-link-DQe0aqRi.js +1 -0
- package/dist/public/sdk/runtime-ecdsa-tempo-DKkeMMpm.js +1 -0
- package/dist/public/sdk/runtime-email-otp-CzTe7r9I.js +1 -0
- package/dist/public/sdk/runtime-export-BiyLbdCe.js +1 -0
- package/dist/public/sdk/runtime-near-Kk0n1FSf.js +1 -0
- package/dist/public/sdk/runtime-preferences-B-A3hddU.js +1 -0
- package/dist/public/sdk/runtime-recovery-C9p1TU1w.js +1 -0
- package/dist/public/sdk/{runtime-recovery-codes-si1fGktB.js → runtime-recovery-codes-CFOWDVd9.js} +1 -1
- package/dist/public/sdk/runtimeContext-ChuvOC0h.js +7 -0
- package/dist/public/sdk/{secp256k1-CE7-q9Sn.js → secp256k1-sDDAa4Ga.js} +1 -1
- package/dist/public/sdk/signEvmFamily-CMrXkVsZ.js +1 -0
- package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js → signEvmFamilyWithUiConfirmForTempo-CnRoo0e8.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-CGrLtMV6.js → signEvmWithUiConfirm-yITc3ZvP.js} +1 -1
- package/dist/public/sdk/signNear-DyFk--I3.js +1 -0
- package/dist/public/sdk/{signatureUses-kSrUHSSH.js → signatureUses-BLOoPRsb.js} +1 -1
- package/dist/{esm/sdk/signingFlow-BcetvUeS.js → public/sdk/signingFlow-DTP4D19E.js} +2 -2
- package/dist/{esm/sdk/signingQueue-dMFOFOP5.js → public/sdk/signingQueue-Dy5mYMus.js} +1 -1
- package/dist/public/sdk/{thresholdEcdsa-CqR1fFA-.js → thresholdEcdsa-CRfx6RP1.js} +1 -1
- package/dist/public/sdk/{trace--mRP2OQc.js → trace-BA8jya7O.js} +1 -1
- package/dist/public/sdk/{transaction-activity-DCzHGg3b.js → transaction-activity-BXSxMp1E.js} +1 -1
- package/dist/public/sdk/{transactionState-29T9xfvL.js → transactionState-BCbaT2hO.js} +1 -1
- package/dist/public/sdk/tx-confirm-ui.js +3 -1
- package/dist/public/sdk/{types-f7dyj5N6.js → types-D2Zk1W7I.js} +1 -1
- package/dist/public/sdk/{unlockedEd25519ExportRootCapability-yzxQjIFd.js → unlockedEd25519ExportRootCapability-BbGMlikr.js} +1 -1
- package/dist/public/sdk/voiceid-host.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/{esm/sdk/wallet-recovery-BZB2Vu3X.js → public/sdk/wallet-recovery-Bfm-oUoP.js} +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/public/sdk/{walletAuthMethodRecord-DLBB5fez.js → walletAuthMethodRecord--fvGr8r1.js} +1 -1
- package/dist/{esm/sdk/walletAuthority-BTGAuOi8.js → public/sdk/walletAuthority-CU9nO0Ze.js} +1 -1
- package/dist/public/sdk/{walletCapabilityBindings-D5YYB7nN.js → walletCapabilityBindings-mPx-6_r-.js} +1 -1
- package/dist/{esm/sdk/walletCustodyEcdsaContinuity-C31YQ9av.js → public/sdk/walletCustodyEcdsaContinuity-BUdDyRl_.js} +1 -1
- package/dist/public/sdk/{walletDbName-Ca0rCq5r.js → walletDbName-B6-CV_Rq.js} +1 -1
- package/dist/public/sdk/{walletCustodyOperation-DimzAbCB.js → walletOwnerOperation-BJPxzo-k.js} +1 -1
- package/dist/{esm/sdk/walletOwnershipGeneration-CgjCtPrV.js → public/sdk/walletOwnershipGeneration-B3uE9GRG.js} +1 -1
- package/dist/public/sdk/walletRecoveryAdminProof-BmZaP0Q8.js +1 -0
- package/dist/public/sdk/walletRecoveryCommit-CSYNbYNd.js +1 -0
- package/dist/{esm/sdk/walletSessionAuthorizationStatus-DG7DPcgR.js → public/sdk/walletSessionAuthorizationStatus-CQ3qA9tI.js} +1 -1
- package/dist/public/sdk/{walletSessionAuthorizationStore-B9Vwkshr.js → walletSessionAuthorizationStore-CGt-s5fX.js} +1 -1
- package/dist/public/sdk/{webauthnP256-BsQQPurm.js → webauthnP256-BGHikiNl.js} +1 -1
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- 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_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- 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 +264 -264
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/shared-ts/src/auth/externalAuth.d.ts +51 -8
- package/dist/types/shared-ts/src/authorization/index.d.ts +1 -1
- package/dist/types/shared-ts/src/authorization/walletOwnerOperation.d.ts +10 -0
- package/dist/types/shared-ts/src/utils/registrationEstablishedSession.d.ts +4 -0
- package/dist/types/shared-ts/src/utils/registrationIntent.d.ts +2 -0
- package/dist/types/shared-ts/src/utils/walletManagementProtocol.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/index.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/operations/registration/pendingRegistrationRecovery.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/operations/registration/registration.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/operations/registration/registrationPasskeyMaterial.d.ts +24 -0
- package/dist/types/wallet/src/SeamsWeb/publicApi/auth.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/publicApi/createPublicApi.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/publicApi/nearCommands.d.ts +2 -0
- package/dist/types/wallet/src/SeamsWeb/publicApi/ownerNearOperation.d.ts +58 -0
- package/dist/types/wallet/src/SeamsWeb/publicApi/types.d.ts +17 -6
- package/dist/types/wallet/src/SeamsWeb/signingSurface/BrowserSigningSurface.d.ts +57 -56
- package/dist/types/wallet/src/SeamsWeb/signingSurface/nearOwnerOperation.d.ts +16 -0
- package/dist/types/wallet/src/SeamsWeb/signingSurface/nearPasskeyOperationMaterial.d.ts +72 -0
- package/dist/types/wallet/src/SeamsWeb/signingSurface/types.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/inboundMessages.d.ts +5 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/ownerNearOperation.d.ts +25 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +7 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/coordinator.d.ts +6 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/WalletHostRuntime.d.ts +5 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/controller.d.ts +2 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/session.d.ts +4 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/createNearCommands.d.ts +2 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/createSessionCommands.d.ts +6 -2
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/externalAuth.d.ts +10 -8
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/externalOwnerApproval.d.ts +24 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ownerNearOperation.d.ts +12 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/requestRouter.d.ts +2 -2
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +5 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/WalletAlternativesSection.d.ts +13 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/exactSessionState.d.ts +8 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +26 -9
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/ownerNearOperation.d.ts +51 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/walletAlternatives.d.ts +52 -0
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/registrationSetup.d.ts +1 -0
- package/dist/types/wallet/src/core/indexedDB/seamsWalletDB/repositories.d.ts +4 -0
- package/dist/types/wallet/src/core/rpcClients/near/NearClient.d.ts +4 -0
- package/dist/types/wallet/src/core/rpcClients/relayer/walletRecoveryRotate.d.ts +2 -2
- package/dist/types/wallet/src/core/rpcClients/relayer/walletRegistration.d.ts +1 -0
- package/dist/types/wallet/src/core/signingEngine/session/passkey/ed25519YaoLocalMaterial.d.ts +21 -0
- package/dist/types/wallet/src/core/types/seams.d.ts +9 -2
- package/dist/types/wallet/src/core/ui/messages.d.ts +1 -1
- package/dist/types/wallet/src/core/ui/walletIcon.d.ts +3 -0
- package/dist/types/wallet/src/index.d.ts +3 -0
- package/dist/types/wallet/src/react/boundWallet.d.ts +21 -1
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/public.d.ts +1 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/types.d.ts +4 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/walletAlternatives.d.ts +48 -0
- package/dist/types/wallet/src/react/hooks/useOwnerNearOperation.d.ts +4 -0
- package/dist/types/wallet/src/react/index.d.ts +4 -2
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- 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_runtime_bg.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.css +0 -182
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.js +0 -315
- package/dist/esm/sdk/NonceCoordinator-3YhmDTS5.js +0 -1
- package/dist/esm/sdk/accountLifecycle-6DHYWf0v.js +0 -1
- package/dist/esm/sdk/appearance-token-vars-01eH9pgA.js +0 -1
- package/dist/esm/sdk/clientSessionPersistenceState-BCkJAYSz.js +0 -1
- package/dist/esm/sdk/confirm-ui-em0vkd2m.js +0 -2
- package/dist/esm/sdk/ecdsaDerivationExport-DJKOzDbS.js +0 -1
- package/dist/esm/sdk/exportKeypairOperation-CjST_NUK.js +0 -1
- package/dist/esm/sdk/host-C51z-AxP.js +0 -1
- package/dist/esm/sdk/indexedDB-C4SDsyOG.js +0 -1
- package/dist/esm/sdk/nearEd25519YaoMaterialActivation-BfXmy3Jr.js +0 -1
- package/dist/esm/sdk/nearEd25519YaoSigningPreparation-DHNk0F8e.js +0 -1
- package/dist/esm/sdk/registration-Byl4l4yZ.js +0 -1
- package/dist/esm/sdk/resealedEnvelopeResult-CLW00Vbw.js +0 -1
- package/dist/esm/sdk/routerAbNormalSigning-D-UZmCBS.js +0 -1
- package/dist/esm/sdk/runtime-auth-ufbVur2p.js +0 -1
- package/dist/esm/sdk/runtime-device-link-CagI2Q62.js +0 -1
- package/dist/esm/sdk/runtime-ecdsa-tempo-Rctxr0yM.js +0 -1
- package/dist/esm/sdk/runtime-email-otp-BQtcG-LF.js +0 -1
- package/dist/esm/sdk/runtime-export-wTeEaqlk.js +0 -1
- package/dist/esm/sdk/runtime-near-59yU_3ud.js +0 -1
- package/dist/esm/sdk/runtime-preferences-B9qLHX8W.js +0 -1
- package/dist/esm/sdk/runtime-recovery-DNyzdMBj.js +0 -1
- package/dist/esm/sdk/runtimeContext-ByeM6Z4Z.js +0 -6
- package/dist/esm/sdk/sessionObservationRevision-ihBwjS3y.js +0 -1
- package/dist/esm/sdk/signEvmFamily-BY5jlZEG.js +0 -1
- package/dist/esm/sdk/signNear-DMpJFkwF.js +0 -1
- package/dist/esm/sdk/signer-worker-BNodGJKY.js +0 -1
- package/dist/esm/sdk/walletRecoveryAdminProof-B4Ic07jY.js +0 -1
- package/dist/esm/sdk/walletRecoveryCommit-Cc2LAkCS.js +0 -1
- package/dist/public/sdk/NonceCoordinator-3YhmDTS5.js +0 -1
- package/dist/public/sdk/accountLifecycle-6DHYWf0v.js +0 -1
- package/dist/public/sdk/appearance-token-vars-01eH9pgA.js +0 -1
- package/dist/public/sdk/clientSessionPersistenceState-BCkJAYSz.js +0 -1
- package/dist/public/sdk/confirm-ui-em0vkd2m.js +0 -2
- package/dist/public/sdk/ecdsaDerivationExport-DJKOzDbS.js +0 -1
- package/dist/public/sdk/exportKeypairOperation-CjST_NUK.js +0 -1
- package/dist/public/sdk/host-C51z-AxP.js +0 -1
- package/dist/public/sdk/indexedDB-C4SDsyOG.js +0 -1
- package/dist/public/sdk/nearEd25519YaoMaterialActivation-BfXmy3Jr.js +0 -1
- package/dist/public/sdk/nearEd25519YaoSigningPreparation-DHNk0F8e.js +0 -1
- package/dist/public/sdk/registration-Byl4l4yZ.js +0 -1
- package/dist/public/sdk/resealedEnvelopeResult-CLW00Vbw.js +0 -1
- package/dist/public/sdk/routerAbNormalSigning-D-UZmCBS.js +0 -1
- package/dist/public/sdk/runtime-auth-ufbVur2p.js +0 -1
- package/dist/public/sdk/runtime-device-link-CagI2Q62.js +0 -1
- package/dist/public/sdk/runtime-ecdsa-tempo-Rctxr0yM.js +0 -1
- package/dist/public/sdk/runtime-email-otp-BQtcG-LF.js +0 -1
- package/dist/public/sdk/runtime-export-wTeEaqlk.js +0 -1
- package/dist/public/sdk/runtime-near-59yU_3ud.js +0 -1
- package/dist/public/sdk/runtime-preferences-B9qLHX8W.js +0 -1
- package/dist/public/sdk/runtime-recovery-DNyzdMBj.js +0 -1
- package/dist/public/sdk/runtimeContext-ByeM6Z4Z.js +0 -6
- package/dist/public/sdk/sessionObservationRevision-ihBwjS3y.js +0 -1
- package/dist/public/sdk/signEvmFamily-BY5jlZEG.js +0 -1
- package/dist/public/sdk/signNear-DMpJFkwF.js +0 -1
- package/dist/public/sdk/signer-worker-BNodGJKY.js +0 -1
- package/dist/public/sdk/walletRecoveryAdminProof-B4Ic07jY.js +0 -1
- package/dist/public/sdk/walletRecoveryCommit-Cc2LAkCS.js +0 -1
- package/dist/types/shared-ts/src/authorization/walletCustodyOperation.d.ts +0 -10
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.d.ts +0 -31
- /package/dist/esm/sdk/{accountIds-CW2BP-d9.js → accountIds-DGWFzEnw.js} +0 -0
- /package/dist/esm/sdk/{actions-DrtSTGus.js → actions-7SvZZut1.js} +0 -0
- /package/dist/esm/sdk/{authenticatorOptions-WCDKYRux.js → authenticatorOptions-B4q62CLs.js} +0 -0
- /package/dist/esm/sdk/{canonicalPrimitives-Jd3i_Ngz.js → canonicalPrimitives-DKeS3M40.js} +0 -0
- /package/dist/esm/sdk/{capabilityKinds-DVlGMspk.js → capabilityKinds-Cafn86Y1.js} +0 -0
- /package/dist/esm/sdk/{confirmTypes-BvVtQs-M.js → confirmTypes-DmEPoxys.js} +0 -0
- /package/dist/esm/sdk/{csp-stylesheet-DUSqfXvZ.js → csp-stylesheet-5LU6VGKK.js} +0 -0
- /package/dist/esm/sdk/{ecdsaChainTarget-Bm5X4k-V.js → ecdsaChainTarget-BoRVQtjQ.js} +0 -0
- /package/dist/esm/sdk/{executeWorkerOperation-C9FOCCR7.js → executeWorkerOperation-CAYSt0NA.js} +0 -0
- /package/dist/esm/sdk/{helpers-Dubwo5uK.js → helpers-B7c1zc7h.js} +0 -0
- /package/dist/esm/sdk/{jsonRpc-BVDv1wfm.js → jsonRpc-DGzeiNSa.js} +0 -0
- /package/dist/esm/sdk/{keccak-mS0Mejjx.js → keccak-DGHI1G6t.js} +0 -0
- /package/dist/esm/sdk/{keyMaterialEnvelope-Dm2ZEilb.js → keyMaterialEnvelope-Czkks9Ki.js} +0 -0
- /package/dist/esm/sdk/{profileAccountProjection-C5sNt-s2.js → profileAccountProjection-dvLchPBo.js} +0 -0
- /package/dist/esm/sdk/{registrationAuthMethodInput-BR1WVbK3.js → registrationAuthMethodInput-C4o7yFBJ.js} +0 -0
- /package/dist/esm/sdk/{sdkSentEvents-DjOlKtdW.js → sdkSentEvents-BFwv3mBw.js} +0 -0
- /package/dist/esm/sdk/{signerDomain-BAsLT3XN.js → signerDomain-D-EUTlLK.js} +0 -0
- /package/dist/esm/sdk/{signerSlot-D2RZnb27.js → signerSlot-BlijMq8C.js} +0 -0
- /package/dist/esm/sdk/{surface-measurement-reporter-DXsvq401.js → surface-measurement-reporter-DJ_dQhBV.js} +0 -0
- /package/dist/esm/sdk/{walletIframeIdentity-CpgyEnKg.js → walletIframeIdentity-Cz82I_Uh.js} +0 -0
- /package/dist/public/sdk/{accountIds-CW2BP-d9.js → accountIds-DGWFzEnw.js} +0 -0
- /package/dist/public/sdk/{actions-DrtSTGus.js → actions-7SvZZut1.js} +0 -0
- /package/dist/public/sdk/{authenticatorOptions-WCDKYRux.js → authenticatorOptions-B4q62CLs.js} +0 -0
- /package/dist/public/sdk/{canonicalPrimitives-Jd3i_Ngz.js → canonicalPrimitives-DKeS3M40.js} +0 -0
- /package/dist/public/sdk/{capabilityKinds-DVlGMspk.js → capabilityKinds-Cafn86Y1.js} +0 -0
- /package/dist/public/sdk/{confirmTypes-BvVtQs-M.js → confirmTypes-DmEPoxys.js} +0 -0
- /package/dist/public/sdk/{csp-stylesheet-DUSqfXvZ.js → csp-stylesheet-5LU6VGKK.js} +0 -0
- /package/dist/public/sdk/{ecdsaChainTarget-Bm5X4k-V.js → ecdsaChainTarget-BoRVQtjQ.js} +0 -0
- /package/dist/public/sdk/{executeWorkerOperation-C9FOCCR7.js → executeWorkerOperation-CAYSt0NA.js} +0 -0
- /package/dist/public/sdk/{helpers-Dubwo5uK.js → helpers-B7c1zc7h.js} +0 -0
- /package/dist/public/sdk/{jsonRpc-BVDv1wfm.js → jsonRpc-DGzeiNSa.js} +0 -0
- /package/dist/public/sdk/{keccak-mS0Mejjx.js → keccak-DGHI1G6t.js} +0 -0
- /package/dist/public/sdk/{keyMaterialEnvelope-Dm2ZEilb.js → keyMaterialEnvelope-Czkks9Ki.js} +0 -0
- /package/dist/public/sdk/{profileAccountProjection-C5sNt-s2.js → profileAccountProjection-dvLchPBo.js} +0 -0
- /package/dist/public/sdk/{registrationAuthMethodInput-BR1WVbK3.js → registrationAuthMethodInput-C4o7yFBJ.js} +0 -0
- /package/dist/public/sdk/{sdkSentEvents-DjOlKtdW.js → sdkSentEvents-BFwv3mBw.js} +0 -0
- /package/dist/public/sdk/{signerDomain-BAsLT3XN.js → signerDomain-D-EUTlLK.js} +0 -0
- /package/dist/public/sdk/{signerSlot-D2RZnb27.js → signerSlot-BlijMq8C.js} +0 -0
- /package/dist/public/sdk/{surface-measurement-reporter-DXsvq401.js → surface-measurement-reporter-DJ_dQhBV.js} +0 -0
- /package/dist/public/sdk/{walletIframeIdentity-CpgyEnKg.js → walletIframeIdentity-Cz82I_Uh.js} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { isPlainObject } from "../../../shared-ts/src/utils/validation.js";
|
|
2
|
+
import { parseWalletDataIcon } from "../../../core/ui/walletIcon.js";
|
|
3
|
+
import { walletIframeRequestIdFromBoundary } from "../../../core/types/walletIframeIdentity.js";
|
|
4
|
+
import { hostedAuthMenuSessionIdFromBoundary } from "./messages.js";
|
|
5
|
+
//#region src/SeamsWeb/walletIframe/shared/walletAlternatives.ts
|
|
6
|
+
function emptyWalletAlternatives() {
|
|
7
|
+
return {
|
|
8
|
+
primary: [],
|
|
9
|
+
secondary: []
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function boundedText(value) {
|
|
13
|
+
return typeof value === "string" && value.trim().length > 0 && value.length <= 512;
|
|
14
|
+
}
|
|
15
|
+
function parseWalletIcon(value) {
|
|
16
|
+
if (value === null) return {
|
|
17
|
+
ok: true,
|
|
18
|
+
value: null
|
|
19
|
+
};
|
|
20
|
+
const dataIcon = parseWalletDataIcon(value);
|
|
21
|
+
if (dataIcon !== null) return {
|
|
22
|
+
ok: true,
|
|
23
|
+
value: dataIcon
|
|
24
|
+
};
|
|
25
|
+
if (typeof value !== "string" || value.length > 131072) return { ok: false };
|
|
26
|
+
try {
|
|
27
|
+
if (new URL(value).protocol === "https:") return {
|
|
28
|
+
ok: true,
|
|
29
|
+
value
|
|
30
|
+
};
|
|
31
|
+
} catch {
|
|
32
|
+
return { ok: false };
|
|
33
|
+
}
|
|
34
|
+
return { ok: false };
|
|
35
|
+
}
|
|
36
|
+
function parseWalletRows(value, ids) {
|
|
37
|
+
if (!Array.isArray(value) || value.length > 32) return null;
|
|
38
|
+
const rows = [];
|
|
39
|
+
for (const row of value) {
|
|
40
|
+
if (!isPlainObject(row) || !boundedText(row.id) || !boundedText(row.label) || typeof row.description !== "string" || row.description.length > 512 || ids.has(row.id)) return null;
|
|
41
|
+
const icon = parseWalletIcon(row.icon);
|
|
42
|
+
if (!icon.ok) return null;
|
|
43
|
+
ids.add(row.id);
|
|
44
|
+
rows.push({
|
|
45
|
+
id: row.id,
|
|
46
|
+
label: row.label,
|
|
47
|
+
description: row.description,
|
|
48
|
+
icon: icon.value
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return rows;
|
|
52
|
+
}
|
|
53
|
+
function parseWalletAlternatives(value) {
|
|
54
|
+
if (!isPlainObject(value)) return null;
|
|
55
|
+
const ids = /* @__PURE__ */ new Set();
|
|
56
|
+
const primary = parseWalletRows(value.primary, ids);
|
|
57
|
+
const secondary = parseWalletRows(value.secondary, ids);
|
|
58
|
+
return primary && secondary ? {
|
|
59
|
+
primary,
|
|
60
|
+
secondary
|
|
61
|
+
} : null;
|
|
62
|
+
}
|
|
63
|
+
function parseWalletConnectionRequest(value) {
|
|
64
|
+
if (!isPlainObject(value)) return null;
|
|
65
|
+
const authMenuSessionId = hostedAuthMenuSessionIdFromBoundary(value.authMenuSessionId);
|
|
66
|
+
if (!authMenuSessionId || !boundedText(value.connectionRequestId) || !boundedText(value.alternativeId)) return null;
|
|
67
|
+
return {
|
|
68
|
+
authMenuSessionId,
|
|
69
|
+
connectionRequestId: value.connectionRequestId,
|
|
70
|
+
alternativeId: value.alternativeId
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function parseWalletConnectionResolution(value) {
|
|
74
|
+
if (!isPlainObject(value) || !isPlainObject(value.result)) return null;
|
|
75
|
+
const authMenuSessionId = hostedAuthMenuSessionIdFromBoundary(value.authMenuSessionId);
|
|
76
|
+
let requestId;
|
|
77
|
+
try {
|
|
78
|
+
requestId = walletIframeRequestIdFromBoundary(value.requestId);
|
|
79
|
+
} catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
if (!authMenuSessionId || !boundedText(value.connectionRequestId)) return null;
|
|
83
|
+
let result;
|
|
84
|
+
switch (value.result.kind) {
|
|
85
|
+
case "connected":
|
|
86
|
+
case "cancelled":
|
|
87
|
+
if (value.result.message !== void 0) return null;
|
|
88
|
+
result = { kind: value.result.kind };
|
|
89
|
+
break;
|
|
90
|
+
case "failed":
|
|
91
|
+
if (!boundedText(value.result.message)) return null;
|
|
92
|
+
result = {
|
|
93
|
+
kind: "failed",
|
|
94
|
+
message: value.result.message
|
|
95
|
+
};
|
|
96
|
+
break;
|
|
97
|
+
default: return null;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
authMenuSessionId,
|
|
101
|
+
requestId,
|
|
102
|
+
connectionRequestId: value.connectionRequestId,
|
|
103
|
+
result
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
export { emptyWalletAlternatives, parseWalletAlternatives, parseWalletConnectionRequest, parseWalletConnectionResolution };
|
|
108
|
+
|
|
109
|
+
//# sourceMappingURL=walletAlternatives.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeTrimmedString } from "../../../shared-ts/src/utils/normalize.js";
|
|
2
|
-
import { toAccountId } from "../../types/accountIds.js";
|
|
3
2
|
import { SIGNER_AUTH_METHODS, SIGNER_KINDS } from "../../../shared-ts/src/utils/signerDomain.js";
|
|
3
|
+
import { toAccountId } from "../../types/accountIds.js";
|
|
4
4
|
import { normalizeIndexedDbAccountAddress } from "../../indexedDB/normalization.js";
|
|
5
5
|
import { getLastSelectedProfileAccountByChain, resolveProfileAccountProjection } from "../../indexedDB/profileAccountProjection.js";
|
|
6
6
|
import { getNearChainCandidates } from "./accountRefs.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { normalizeTrimmedString } from "../../shared-ts/src/utils/normalize.js";
|
|
2
|
+
import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID } from "../../shared-ts/src/utils/signingSessionSeal.js";
|
|
2
3
|
import { normalizeWalletLocale } from "../ui/locale.js";
|
|
3
4
|
import { parseWalletAuthMethodPlugins } from "../authMethods/plugins.js";
|
|
4
5
|
import { copyEcdsaSignerProvisioningDefaults, resolveAppearanceTheme, resolveBoolean, resolveChains, resolveIntegerInRange, resolveThemePalette } from "./configHelpers.js";
|
|
5
6
|
import { normalizeWalletHostVariant } from "../browser/walletIframe/hostVariant.js";
|
|
6
|
-
import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID } from "../../shared-ts/src/utils/signingSessionSeal.js";
|
|
7
7
|
//#region src/core/config/configBuilder.ts
|
|
8
8
|
const THRESHOLD_ECDSA_PRESIGN_POOL_LIMITS = {
|
|
9
9
|
targetDepth: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { UserVerificationPolicy } from "../../shared-ts/src/utils/authenticatorOptions.js";
|
|
2
2
|
import "../../shared-ts/src/threshold/participants.js";
|
|
3
3
|
import { DEFAULT_THRESHOLD_SESSION_TTL_MS } from "../signingEngine/threshold/sessionPolicy.js";
|
|
4
|
+
import { SIGNING_SESSION_SEAL_ALG, SIGNING_SESSION_SEAL_GROUP_ID } from "../../shared-ts/src/utils/signingSessionSeal.js";
|
|
4
5
|
import { buildConfigsFromDefaults } from "./configBuilder.js";
|
|
5
6
|
//#region src/core/config/defaultConfigs.ts
|
|
6
7
|
const DEFAULT_ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_POLICY = {
|
|
@@ -57,8 +58,14 @@ const PASSKEY_MANAGER_DEFAULT_CONFIGS = {
|
|
|
57
58
|
remainingUses: 3
|
|
58
59
|
},
|
|
59
60
|
emailOtp: { authPolicy: "session" },
|
|
60
|
-
sessionPersistenceMode: "
|
|
61
|
-
sessionSeal: {
|
|
61
|
+
sessionPersistenceMode: "sealed_refresh_v1",
|
|
62
|
+
sessionSeal: {
|
|
63
|
+
mode: "sealed_refresh_v1",
|
|
64
|
+
protocol: {
|
|
65
|
+
algorithm: SIGNING_SESSION_SEAL_ALG,
|
|
66
|
+
groupId: SIGNING_SESSION_SEAL_GROUP_ID
|
|
67
|
+
}
|
|
68
|
+
},
|
|
62
69
|
routerAb: { normalSigning: { mode: "disabled" } },
|
|
63
70
|
routerAbEcdsaDerivation: { presignaturePool: DEFAULT_ROUTER_AB_ECDSA_DERIVATION_PRESIGNATURE_POOL_POLICY },
|
|
64
71
|
thresholdEcdsa: { provisioningDefaults: {
|
|
@@ -11,8 +11,8 @@ import { parseWalletAuthMethodRecordV2 } from "../../../shared-ts/src/utils/wall
|
|
|
11
11
|
import { encodeWalletSignerActivationSetV1, extendEcdsaWalletAuthorityWithEd25519, isActiveEcdsaWalletAuthorityV1, isActiveRecoveredWalletAuthorityV1, isEcdsaExtensionOfEd25519WalletAuthority, parseWalletAuthorityV1, walletAuthorityDigestsMatchV1 } from "../../../shared-ts/src/authorization/walletAuthority.js";
|
|
12
12
|
import { parseLocalAuthorityInstallationReceiptV1 } from "../../../shared-ts/src/device-linking/authorityActivation.js";
|
|
13
13
|
import "../../../shared-ts/src/device-linking/index.js";
|
|
14
|
-
import { toAccountId } from "../../types/accountIds.js";
|
|
15
14
|
import { SIGNER_KINDS } from "../../../shared-ts/src/utils/signerDomain.js";
|
|
15
|
+
import { toAccountId } from "../../types/accountIds.js";
|
|
16
16
|
import { parseNearProvisioningState } from "../../types/sdkSentEvents.js";
|
|
17
17
|
import { parseEcdsaThresholdKeyId } from "../../signingEngine/session/keyMaterialBrands.js";
|
|
18
18
|
import { walletIdFromString } from "../../../shared-ts/src/utils/registrationIds.js";
|
|
@@ -3719,7 +3719,7 @@ var SeamsWalletRepositories = class {
|
|
|
3719
3719
|
registration: input.registration
|
|
3720
3720
|
});
|
|
3721
3721
|
const walletSession = input.walletSessionPublication.walletSession;
|
|
3722
|
-
if (walletSession.walletId !== pending.walletId || walletSession.authorityId !== foundingAuthority.authority.authorityId || walletSession.authMethodId !== pending.walletAuthMethodId || walletSession.authorityDigestB64u !== foundingAuthority.authority.authorityDigestB64u || walletSession.authorityRevocationEpoch !== foundingAuthority.authority.revocationEpoch) throw new Error("registration Wallet Session identity does not match the pending wallet");
|
|
3722
|
+
if (walletSession !== void 0 && (walletSession.walletId !== pending.walletId || walletSession.authorityId !== foundingAuthority.authority.authorityId || walletSession.authMethodId !== pending.walletAuthMethodId || walletSession.authorityDigestB64u !== foundingAuthority.authority.authorityDigestB64u || walletSession.authorityRevocationEpoch !== foundingAuthority.authority.revocationEpoch)) throw new Error("registration Wallet Session identity does not match the pending wallet");
|
|
3723
3723
|
return this.manager.runTransaction(WALLET_REGISTRATION_PUBLICATION_STORES, "readwrite", this.publishPendingWalletRegistrationCommitInTransaction.bind(this, {
|
|
3724
3724
|
request: input.request,
|
|
3725
3725
|
pending,
|
|
@@ -3771,7 +3771,8 @@ var SeamsWalletRepositories = class {
|
|
|
3771
3771
|
active: input.walletSessionPublication.walletSession,
|
|
3772
3772
|
operationCredential: input.walletSessionPublication.operationCredential
|
|
3773
3773
|
});
|
|
3774
|
-
} else
|
|
3774
|
+
} else if (input.walletSessionPublication.kind === "owner_operations") sessionPublication = "locked_identity";
|
|
3775
|
+
else {
|
|
3775
3776
|
const existingSession = await readExactActiveWalletSessionForScopeInTransaction({
|
|
3776
3777
|
ctx,
|
|
3777
3778
|
walletId: input.pending.walletId,
|
|
@@ -80,7 +80,7 @@ async function postJson(args) {
|
|
|
80
80
|
const response = await fetch(`${normalizeRelayerBaseUrl(args.relayerUrl, { trim: false })}${args.path}`, buildRelayerJsonPostRequestInit({
|
|
81
81
|
headers: {
|
|
82
82
|
...args.headers,
|
|
83
|
-
[WALLET_MANAGEMENT_PROTOCOL_HEADER]: "
|
|
83
|
+
[WALLET_MANAGEMENT_PROTOCOL_HEADER]: "5"
|
|
84
84
|
},
|
|
85
85
|
body: args.body,
|
|
86
86
|
bodyJson: requestBody
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { base64UrlDecode, base64UrlEncode } from "../../../../shared-ts/src/utils/base64.js";
|
|
2
2
|
import { sha256HexUtf8 } from "../../../../shared-ts/src/utils/digests.js";
|
|
3
3
|
import { thresholdEcdsaChainTargetKey, toWalletId } from "../../interfaces/ecdsaChainTarget.js";
|
|
4
|
+
import { SIGNER_AUTH_METHODS, SIGNER_KINDS, SIGNER_SOURCES } from "../../../../shared-ts/src/utils/signerDomain.js";
|
|
4
5
|
import { compactImplicitNearAccountId } from "../../../../shared-ts/src/utils/near.js";
|
|
5
6
|
import { toAccountId } from "../../../types/accountIds.js";
|
|
6
|
-
import { SIGNER_AUTH_METHODS, SIGNER_KINDS, SIGNER_SOURCES } from "../../../../shared-ts/src/utils/signerDomain.js";
|
|
7
7
|
import { NEAR_ED25519_YAO_KEY_VERSION_V1 } from "../../../../shared-ts/src/utils/registrationSignerPlan.js";
|
|
8
8
|
import { nearEd25519SigningKeyIdFromString } from "../../../../shared-ts/src/utils/registrationIds.js";
|
|
9
9
|
import { parseSignerSlot } from "../../../../shared-ts/src/utils/signerSlot.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isUserCancellationError } from "../../../../shared-ts/src/utils/errors.js";
|
|
2
2
|
import { secureRandomId } from "../../../../shared-ts/src/utils/secureRandomId.js";
|
|
3
|
-
import { SigningEventPhase } from "../../../types/sdkSentEvents.js";
|
|
4
3
|
import { signingLaneAuthMethod } from "../../session/identity/signingLaneAuthBinding.js";
|
|
5
4
|
import { SigningKeyRefIntentKind, SigningSessionPlanKind } from "../../session/operationState/types.js";
|
|
5
|
+
import { SigningEventPhase } from "../../../types/sdkSentEvents.js";
|
|
6
6
|
import { SigningAuthPlanKind } from "../../stepUpConfirmation/types.js";
|
|
7
7
|
import { SigningOperationCancellationPhase, SigningOperationCommandKind, applySigningOperationInteractionEvent, cancelSigningOperation, planSigningOperationAttempt, runSigningOperationCommand } from "./signingStateMachine.js";
|
|
8
8
|
import { confirmSigningOperation } from "../../stepUpConfirmation/confirmOperation.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { thresholdEcdsaChainTargetKey, toWalletId } from "../../interfaces/ecdsaChainTarget.js";
|
|
2
2
|
import { SIGNER_AUTH_METHODS } from "../../../../shared-ts/src/utils/signerDomain.js";
|
|
3
|
-
import { SigningEventPhase } from "../../../types/sdkSentEvents.js";
|
|
4
3
|
import { signingLaneAuthBindingKey } from "../../session/identity/signingLaneAuthBinding.js";
|
|
5
4
|
import { SigningOperationIntent } from "../../session/operationState/types.js";
|
|
5
|
+
import { SigningEventPhase } from "../../../types/sdkSentEvents.js";
|
|
6
6
|
import { exactEcdsaSigningLaneIdentityFromSelectedLane, requireEvmFamilyEcdsaSigner } from "../../session/identity/exactSigningLaneIdentity.js";
|
|
7
7
|
import { reviewAdmissionForBinding } from "../../uiConfirm/transactionReviewAdmission.js";
|
|
8
8
|
import { buildEvmDisplayModel } from "../../chains/evm/display/evmTx.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { base64UrlEncode } from "../../../../shared-ts/src/utils/base64.js";
|
|
2
2
|
import { alphabetizeStringify } from "../../../../shared-ts/src/utils/digests.js";
|
|
3
3
|
import { parseDigestB64u, sha256Utf8DigestB64u } from "../../../../shared-ts/src/utils/canonicalPrimitives.js";
|
|
4
|
-
import { SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
5
4
|
import { SigningSessionIds } from "../../session/operationState/types.js";
|
|
5
|
+
import { SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
6
6
|
import { normalizeAuthenticationCredential } from "../../webauthnAuth/credentials/helpers.js";
|
|
7
7
|
import { bytesToHex } from "../../chains/evm/bytes.js";
|
|
8
8
|
import { isActiveWalletAuthoritySigningAuthPlan, isWarmSessionSigningAuthPlan } from "../../stepUpConfirmation/types.js";
|
|
@@ -5,15 +5,15 @@ import { WorkerResponseType } from "../../../../types/signer-worker.js";
|
|
|
5
5
|
import { resolveNearNetwork } from "../../../../config/chains.js";
|
|
6
6
|
import { PASSKEY_MANAGER_DEFAULT_CONFIGS } from "../../../../config/defaultConfigs.js";
|
|
7
7
|
import { activeWalletSessionV1RecordsEqual } from "../../../../../shared-ts/src/device-linking/activeWalletSession.js";
|
|
8
|
+
import { SigningSessionIds } from "../../../session/operationState/types.js";
|
|
8
9
|
import { base58Decode } from "../../../../../shared-ts/src/utils/base58.js";
|
|
9
10
|
import { ensureEd25519Prefix } from "../../../../../shared-ts/src/utils/near.js";
|
|
10
|
-
import { SigningSessionIds } from "../../../session/operationState/types.js";
|
|
11
11
|
import { ActionType, fromActionArgsWasm } from "../../../../../shared-ts/src/near/actions.js";
|
|
12
|
+
import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionOperationFingerprint } from "../../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
12
13
|
import { WalletSessionStatusReadScope } from "../../../../rpcClients/relayer/walletSessionAuthorizationStatus.js";
|
|
13
14
|
import { emitEd25519SigningTiming } from "../../../session/operationState/trace.js";
|
|
14
15
|
import { buildCapabilityOperationEnvelope, parseSigningOperationFingerprintDigest } from "../../../../../shared-ts/src/authorization/operationFingerprint.js";
|
|
15
16
|
import { buildRouterAbEd25519DelegateActionPrepareRequestV2, buildRouterAbEd25519NearTransactionPrepareRequestV2, buildRouterAbEd25519Nep413PrepareRequestV2, buildRouterAbEd25519NormalSigningFinalizeRequestV2, finalizeRouterAbNormalSigningV2, prepareRouterAbNormalSigningV2, routerAbCanonicalWireBytesToB64u, routerAbNormalSigningActionFingerprint } from "../../../../rpcClients/relayer/routerAbNormalSigning.js";
|
|
16
|
-
import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionOperationFingerprint } from "../../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
17
17
|
import { buildThresholdEd25519DelegateSigningPayloadWasm, buildThresholdEd25519NearTxUnsignedBorshWasm, decodeThresholdEd25519SignedNearTxBorshWasm, finalizeThresholdEd25519DelegateFromSignatureWasm, finalizeThresholdEd25519NearTxFromSignatureWasm } from "../../../chains/near/nearSignerWasm.js";
|
|
18
18
|
import { requireRouterAbNormalSigningPrepareMatchesRequest, requireRouterAbNormalSigningResponseMatchesRequest } from "../../../../rpcClients/relayer/routerAbNormalSigningValidation.js";
|
|
19
19
|
import { requireRouterAbEd25519NormalSigningReadyState } from "../../../session/warmCapabilities/routerAbWalletSessionCredential.js";
|
|
@@ -2,17 +2,17 @@ import { WorkerResponseType } from "../../../types/signer-worker.js";
|
|
|
2
2
|
import { resolveNearNetwork, resolvePrimaryNearRpcUrl } from "../../../config/chains.js";
|
|
3
3
|
import { normalizeThresholdEd25519ParticipantIds } from "../../../../shared-ts/src/threshold/participants.js";
|
|
4
4
|
import { PASSKEY_MANAGER_DEFAULT_CONFIGS } from "../../../config/defaultConfigs.js";
|
|
5
|
+
import { SigningOperationIntent, SigningSessionIds } from "../../session/operationState/types.js";
|
|
5
6
|
import { ensureEd25519Prefix } from "../../../../shared-ts/src/utils/near.js";
|
|
6
7
|
import { toAccountId } from "../../../types/accountIds.js";
|
|
8
|
+
import { parseThresholdEd25519NearAction, thresholdEd25519DelegateActionOperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
7
9
|
import { SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
8
|
-
import { SigningOperationIntent, SigningSessionIds } from "../../session/operationState/types.js";
|
|
9
10
|
import { computeUiIntentDigestFromTxs, orderActionForDigest } from "../../../../utils/intentDigest.js";
|
|
10
11
|
import { isWarmSessionSigningAuthPlan } from "../../stepUpConfirmation/types.js";
|
|
11
12
|
import { emitEd25519SigningTiming } from "../../session/operationState/trace.js";
|
|
12
13
|
import { SigningOperationCommandKind, runSigningOperationCommand } from "../shared/signingStateMachine.js";
|
|
13
14
|
import { resolveNearSigningMaterials } from "./shared/signingMaterials.js";
|
|
14
15
|
import { buildNearDelegateSigningPayloads } from "../../chains/near/payloads.js";
|
|
15
|
-
import { parseThresholdEd25519NearAction, thresholdEd25519DelegateActionOperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
16
16
|
import { computeThresholdEd25519DelegateSigningDigestWasm } from "../../chains/near/nearSignerWasm.js";
|
|
17
17
|
import { finalizeThresholdEd25519DelegateSignatureResult } from "./shared/ed25519YaoNormalSigning.js";
|
|
18
18
|
import { toPublicKeyString } from "../../workerManager/validation.js";
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { secureRandomBase64Url } from "../../../../shared-ts/src/utils/secureRandomId.js";
|
|
2
1
|
import { toWalletId } from "../../interfaces/ecdsaChainTarget.js";
|
|
3
2
|
import { parsePasskeyWalletAuthAuthority, walletAuthAuthorityRef } from "../../../../shared-ts/src/utils/walletAuthAuthority.js";
|
|
4
|
-
import { toAccountId } from "../../../types/accountIds.js";
|
|
5
3
|
import { SENSITIVE_OPERATION_POLICIES, SIGNER_AUTH_METHODS } from "../../../../shared-ts/src/utils/signerDomain.js";
|
|
6
|
-
import { SIGNING_SESSION_EXPIRY_DETECTION_SOURCES, SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
7
4
|
import { signingLaneAuthBindingKey, signingLaneAuthMethod } from "../../session/identity/signingLaneAuthBinding.js";
|
|
8
5
|
import { SigningOperationIntent, SigningSessionIds, SigningSessionPlanKind } from "../../session/operationState/types.js";
|
|
6
|
+
import { toAccountId } from "../../../types/accountIds.js";
|
|
7
|
+
import { SIGNING_SESSION_EXPIRY_DETECTION_SOURCES, SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
9
8
|
import { parseSignerSlot } from "../../../../shared-ts/src/utils/signerSlot.js";
|
|
10
9
|
import { exactEd25519SigningLaneIdentityFromSelectedLane, exactSigningLaneIdentityKey, nearEd25519SignerBindingFromBoundaryFields } from "../../session/identity/exactSigningLaneIdentity.js";
|
|
11
10
|
import { demoEmailOtpCodeFromDelivery } from "../../session/emailOtp/challengeDelivery.js";
|
|
@@ -80,10 +79,6 @@ function prepareReviewBoundNearMaterial(prepare, admission, input) {
|
|
|
80
79
|
admission?.assertAuthMethodPolicy(method);
|
|
81
80
|
return prepare(input);
|
|
82
81
|
}
|
|
83
|
-
function createNearTransactionSigningOperationId() {
|
|
84
|
-
const randomId = secureRandomBase64Url(32, "NEAR transaction signing operation IDs");
|
|
85
|
-
return SigningSessionIds.signingOperation(`near-transaction-sign:${randomId}`);
|
|
86
|
-
}
|
|
87
82
|
function summarizeNearEd25519Lane(lane) {
|
|
88
83
|
if (lane.state === "missing") return {
|
|
89
84
|
state: lane.state,
|
|
@@ -759,7 +754,7 @@ async function signTransaction(deps, args) {
|
|
|
759
754
|
confirmationConfigOverride: args.confirmationConfigOverride
|
|
760
755
|
});
|
|
761
756
|
try {
|
|
762
|
-
const operationId =
|
|
757
|
+
const operationId = SigningSessionIds.signingOperation(deps.createSigningSessionId("near-transaction-sign"));
|
|
763
758
|
emitEd25519SigningTiming(String(operationId), "preparation_modal", modalStartedAt);
|
|
764
759
|
return await signTransactionWithActionsAttempt(deps, args, { signingOperationState: createSigningOperationStateRef({ operationId }) });
|
|
765
760
|
} finally {
|
|
@@ -4,11 +4,11 @@ import { resolveNearNetwork } from "../../../config/chains.js";
|
|
|
4
4
|
import { normalizeThresholdEd25519ParticipantIds } from "../../../../shared-ts/src/threshold/participants.js";
|
|
5
5
|
import { PASSKEY_MANAGER_DEFAULT_CONFIGS } from "../../../config/defaultConfigs.js";
|
|
6
6
|
import { SigningOperationIntent, SigningSessionIds } from "../../session/operationState/types.js";
|
|
7
|
+
import { thresholdEd25519Nep413OperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
7
8
|
import { computeUiIntentDigestFromNep413 } from "../../../../utils/intentDigest.js";
|
|
8
9
|
import { emitEd25519SigningTiming } from "../../session/operationState/trace.js";
|
|
9
10
|
import { SigningOperationCommandKind, runSigningOperationCommand } from "../shared/signingStateMachine.js";
|
|
10
11
|
import { resolveNearSigningMaterials } from "./shared/signingMaterials.js";
|
|
11
|
-
import { thresholdEd25519Nep413OperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
12
12
|
import { computeThresholdEd25519Nep413SigningDigestWasm } from "../../chains/near/nearSignerWasm.js";
|
|
13
13
|
import { authorizeNearSignatureOnlyOperation, confirmNearSignatureOnlyOperation, prepareNearSignatureOnlyStepUp, resolveNearSignatureOnlySigningMaterial, resolveNearSignatureOnlySigningPlans, runNearSignatureOnlySignCommand, signNearSignatureOnlyOperation, startNearSignatureOnlyPrepare } from "./shared/signatureOnlySigning.js";
|
|
14
14
|
//#region src/core/signingEngine/flows/signNear/signNep413.ts
|
|
@@ -2,9 +2,10 @@ import { resolveNearNetwork, resolvePrimaryNearRpcUrl } from "../../../config/ch
|
|
|
2
2
|
import { normalizeThresholdEd25519ParticipantIds } from "../../../../shared-ts/src/threshold/participants.js";
|
|
3
3
|
import { PASSKEY_MANAGER_DEFAULT_CONFIGS } from "../../../config/defaultConfigs.js";
|
|
4
4
|
import { SignedTransaction } from "../../../rpcClients/near/NearClient.js";
|
|
5
|
+
import { SigningOperationIntent, SigningSessionIds, SigningSessionPlanKind } from "../../session/operationState/types.js";
|
|
5
6
|
import { toAccountId } from "../../../types/accountIds.js";
|
|
7
|
+
import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionPlanningOperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
6
8
|
import { SigningEventPhase, createSigningFlowEvent } from "../../../types/sdkSentEvents.js";
|
|
7
|
-
import { SigningOperationIntent, SigningSessionIds, SigningSessionPlanKind } from "../../session/operationState/types.js";
|
|
8
9
|
import { nearEd25519SignerBindingFromBoundaryFields } from "../../session/identity/exactSigningLaneIdentity.js";
|
|
9
10
|
import { computeUiIntentDigestFromTxs, orderActionForDigest } from "../../../../utils/intentDigest.js";
|
|
10
11
|
import { isWarmSessionSigningAuthPlan } from "../../stepUpConfirmation/types.js";
|
|
@@ -15,7 +16,6 @@ import { buildSigningConfirmationAuthParams } from "../../stepUpConfirmation/con
|
|
|
15
16
|
import { confirmationConfigForSigningAuthPlan, resolveSigningConfirmationAuthMethod, runTransactionSigningConfirmationCommand } from "../shared/signingConfirmation.js";
|
|
16
17
|
import { resolveNearSigningMaterials } from "./shared/signingMaterials.js";
|
|
17
18
|
import { buildNearTransactionSigningPayload } from "../../chains/near/payloads.js";
|
|
18
|
-
import { parseThresholdEd25519NearTransaction, thresholdEd25519NearTransactionPlanningOperationFingerprint } from "../../../../shared-ts/src/threshold/ed25519OperationFingerprint.js";
|
|
19
19
|
import { requireNearStepUpAuth, signingAuthPlanForNearMaterialRequirement } from "./requireNearStepUpAuth.js";
|
|
20
20
|
import { emitNearSigningConfirmationProgress } from "./shared/confirmationProgress.js";
|
|
21
21
|
import { buildNearEd25519StepUpAuthorization } from "./stepUpAuthorization.js";
|
|
@@ -415,12 +415,11 @@ async function runNearAuthorizationRequiredTransactionSigning(payload) {
|
|
|
415
415
|
});
|
|
416
416
|
await markNearNonceLeasesSigned(ctx, confirmation.readiness.nonceLeases);
|
|
417
417
|
return signed;
|
|
418
|
-
}
|
|
418
|
+
} finally {
|
|
419
419
|
disposeOwnedNearOperationStepUpMaterial({
|
|
420
420
|
resolved: resolvedOperationStepUpMaterial,
|
|
421
421
|
owned: operationStepUpMaterial.kind === "passkey_sealed" || operationStepUpMaterial.kind === "email_otp_sealed"
|
|
422
422
|
});
|
|
423
|
-
throw error;
|
|
424
423
|
}
|
|
425
424
|
}
|
|
426
425
|
async function runAuthorizedNearTransactionWithActionsSigning({ ctx, commandSubject, nearAccount, transaction, rpcCall, onEvent, confirmationConfigOverride, title, body, signerSlot, signingOperationState, signingSessionCoordinator: sessionCoordinator, transactionOperation, ed25519SigningBoundary, passkeyEd25519OperationStepUp, emailOtpEd25519StepUp, yaoSigningPreparation, yaoMaterialExecutor }) {
|
|
@@ -2,8 +2,8 @@ import { parseMpcMaterialActivationRef, parseWalletAuthMethodId } from "../../..
|
|
|
2
2
|
import { alphabetizeStringify } from "../../../../shared-ts/src/utils/digests.js";
|
|
3
3
|
import { parseDigestB64u } from "../../../../shared-ts/src/utils/canonicalPrimitives.js";
|
|
4
4
|
import { thresholdEcdsaChainTargetFromRequest, thresholdEcdsaChainTargetKey, toWalletId } from "../../interfaces/ecdsaChainTarget.js";
|
|
5
|
-
import { isImplicitNearAccountId, parseNearAccountId } from "../../../../shared-ts/src/utils/near.js";
|
|
6
5
|
import { SigningSessionIds } from "../operationState/types.js";
|
|
6
|
+
import { isImplicitNearAccountId, parseNearAccountId } from "../../../../shared-ts/src/utils/near.js";
|
|
7
7
|
import { buildImplicitNearAccountBinding, buildNamedNearAccountBinding, buildNearEd25519SignerBinding, buildWalletIdentity, nearEd25519SignerBindingFromRaw } from "../../../../shared-ts/src/utils/walletCapabilityBindings.js";
|
|
8
8
|
import { buildBaseEvmFamilyEcdsaKeyIdentity, toEvmFamilyEcdsaKeyHandle, toRpId } from "./evmFamilyEcdsaIdentity.js";
|
|
9
9
|
//#region src/core/signingEngine/session/identity/exactSigningLaneIdentity.ts
|
|
@@ -246,7 +246,9 @@ const walletMessages = [
|
|
|
246
246
|
["Unlock with email code", "メールのコードでロック解除"],
|
|
247
247
|
["Saved wallets", "保存済みウォレット"],
|
|
248
248
|
["Generate another name", "別の名前を生成"],
|
|
249
|
-
["
|
|
249
|
+
["Recover or link wallet", "ウォレットを復元または連携"],
|
|
250
|
+
["Or connect another wallet", "別のウォレットを接続"],
|
|
251
|
+
["More wallets", "その他のウォレット"],
|
|
250
252
|
["Link this device", "このデバイスを連携"],
|
|
251
253
|
["Scan a code with your other device", "別のデバイスでコードをスキャン"],
|
|
252
254
|
["Use your recovery code", "リカバリーコードを使用"],
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/core/ui/walletIcon.ts
|
|
2
|
+
const MAX_WALLET_ICON_LENGTH = 131072;
|
|
3
|
+
function parseWalletDataIcon(value) {
|
|
4
|
+
if (typeof value !== "string" || value.length > 131072 || !/^data:image\/(?:png|webp|jpeg|svg\+xml)[;,]/i.test(value)) return null;
|
|
5
|
+
return value;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { MAX_WALLET_ICON_LENGTH, parseWalletDataIcon };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=walletIcon.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseWalletDataIcon } from "../core/ui/walletIcon.js";
|
|
1
2
|
import { isHex } from "../node_modules/viem/_esm/utils/data/isHex.js";
|
|
2
3
|
import { numberToHex } from "../node_modules/viem/_esm/utils/encoding/toHex.js";
|
|
3
4
|
import { getAddress } from "../node_modules/viem/_esm/utils/address/getAddress.js";
|
|
@@ -26,12 +27,13 @@ function parseAnnouncement(value) {
|
|
|
26
27
|
if (typeof uuid !== "string" || !/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i.test(uuid)) return null;
|
|
27
28
|
if (typeof name !== "string" || !name.trim() || name.length > 128) return null;
|
|
28
29
|
if (typeof rdns !== "string" || !rdns.trim() || rdns.length > 253) return null;
|
|
29
|
-
|
|
30
|
+
const walletIcon = parseWalletDataIcon(icon);
|
|
31
|
+
if (walletIcon === null) return null;
|
|
30
32
|
return Object.freeze({
|
|
31
33
|
wallet: Object.freeze({
|
|
32
34
|
id: uuid.toLowerCase(),
|
|
33
35
|
name: name.trim(),
|
|
34
|
-
icon,
|
|
36
|
+
icon: walletIcon,
|
|
35
37
|
rdns: rdns.trim()
|
|
36
38
|
}),
|
|
37
39
|
provider
|
package/dist/esm/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import { PASSKEY_MANAGER_DEFAULT_CONFIGS, buildConfigsFromEnv } from "./core/con
|
|
|
4
4
|
import { configuredThresholdEcdsaChainTargets, nearAccountRefFromAccountId, thresholdEcdsaChainTargetFromChainFamily, thresholdEcdsaChainTargetFromConfig, thresholdEcdsaChainTargetFromConfiguredRequest, thresholdEcdsaChainTargetFromRequest, thresholdEcdsaChainTargetKey, thresholdEcdsaChainTargetsEqual, toWalletId, walletIdFromWalletProfile, walletSessionRefFromSession } from "./core/signingEngine/interfaces/ecdsaChainTarget.js";
|
|
5
5
|
import { BrowserCapabilityUnavailableError } from "./SeamsWeb/publicApi/capabilitySelection.js";
|
|
6
6
|
import { toAccountId } from "./core/types/accountIds.js";
|
|
7
|
+
import { ActionType } from "./shared-ts/src/near/actions.js";
|
|
8
|
+
import { parseOwnerNearRecovery } from "./SeamsWeb/walletIframe/shared/ownerNearOperation.js";
|
|
7
9
|
import { AccountSyncEventPhase, KeyExportEventPhase, LinkDeviceEventPhase, RegistrationEventPhase, SigningEventPhase, UnlockEventPhase, WALLET_FLOW_EVENT_MESSAGES, WALLET_FLOW_EVENT_STEPS, WALLET_FLOW_EVENT_VERSION, createAccountSyncFlowEvent, createKeyExportFlowEvent, createLinkDeviceFlowEvent, createRegistrationFlowEvent, createSigningFlowEvent, createUnlockFlowEvent, createWalletFlowEvent, isWalletFlowEvent } from "./core/types/sdkSentEvents.js";
|
|
8
10
|
import { buildHostedAuthMenuOpenRequest, hostedAuthMenuExternalAuthRequestIdFromBoundary, hostedAuthMenuSessionIdFromBoundary } from "./SeamsWeb/walletIframe/shared/messages.js";
|
|
9
11
|
import { SeamsWeb } from "./SeamsWeb/SeamsWeb.js";
|
|
@@ -11,8 +13,7 @@ import { ExternalEvmController } from "./externalEvm/controller.js";
|
|
|
11
13
|
import { DEVICE_LINKING_CONFIG, SIGNER_WORKER_MANAGER_CONFIG } from "./config.js";
|
|
12
14
|
import { defineSeamsConfig, seamsTestnetConfig } from "./core/config/defineConfig.js";
|
|
13
15
|
import { DEFAULT_WAIT_STATUS } from "./core/types/rpc.js";
|
|
14
|
-
import { ActionType } from "./shared-ts/src/near/actions.js";
|
|
15
16
|
import { AmountError, parseEther, parseNear, parseUnits, yoctoNear } from "./core/types/amounts.js";
|
|
16
17
|
import { addKey, createAccount, deleteAccount, deleteKey, deployContract, functionCall, stake, transfer } from "./core/types/actionBuilders.js";
|
|
17
18
|
import { logWalletEvents } from "./core/types/eventLogging.js";
|
|
18
|
-
export { AccountSyncEventPhase, ActionType, AmountError, BrowserCapabilityUnavailableError, DEFAULT_WAIT_STATUS, DEVICE_LINKING_CONFIG, ExternalEvmController, KeyExportEventPhase, LinkDeviceEventPhase, PASSKEY_MANAGER_DEFAULT_CONFIGS, RegistrationEventPhase, SIGNER_WORKER_MANAGER_CONFIG, SeamsWeb, SigningEventPhase, UnlockEventPhase, WALLET_FLOW_EVENT_MESSAGES, WALLET_FLOW_EVENT_STEPS, WALLET_FLOW_EVENT_VERSION, addKey, buildConfigsFromEnv, buildHostedAuthMenuOpenRequest, configuredThresholdEcdsaChainTargets, createAccount, createAccountSyncFlowEvent, createKeyExportFlowEvent, createLinkDeviceFlowEvent, createRegistrationFlowEvent, createSigningFlowEvent, createUnlockFlowEvent, createWalletFlowEvent, defineSeamsConfig, deleteAccount, deleteKey, deployContract, functionCall, hostedAuthMenuExternalAuthRequestIdFromBoundary, hostedAuthMenuSessionIdFromBoundary, isWalletFlowEvent, logWalletEvents, nearAccountRefFromAccountId, normalizeWalletLocale, parseEther, parseNear, parseUnits, parseWalletMoveId, seamsTestnetConfig, stake, thresholdEcdsaChainTargetFromChainFamily, thresholdEcdsaChainTargetFromConfig, thresholdEcdsaChainTargetFromConfiguredRequest, thresholdEcdsaChainTargetFromRequest, thresholdEcdsaChainTargetKey, thresholdEcdsaChainTargetsEqual, toAccountId, toWalletId, transfer, walletIdFromWalletProfile, walletSessionRefFromSession, yoctoNear };
|
|
19
|
+
export { AccountSyncEventPhase, ActionType, AmountError, BrowserCapabilityUnavailableError, DEFAULT_WAIT_STATUS, DEVICE_LINKING_CONFIG, ExternalEvmController, KeyExportEventPhase, LinkDeviceEventPhase, PASSKEY_MANAGER_DEFAULT_CONFIGS, RegistrationEventPhase, SIGNER_WORKER_MANAGER_CONFIG, SeamsWeb, SigningEventPhase, UnlockEventPhase, WALLET_FLOW_EVENT_MESSAGES, WALLET_FLOW_EVENT_STEPS, WALLET_FLOW_EVENT_VERSION, addKey, buildConfigsFromEnv, buildHostedAuthMenuOpenRequest, configuredThresholdEcdsaChainTargets, createAccount, createAccountSyncFlowEvent, createKeyExportFlowEvent, createLinkDeviceFlowEvent, createRegistrationFlowEvent, createSigningFlowEvent, createUnlockFlowEvent, createWalletFlowEvent, defineSeamsConfig, deleteAccount, deleteKey, deployContract, functionCall, hostedAuthMenuExternalAuthRequestIdFromBoundary, hostedAuthMenuSessionIdFromBoundary, isWalletFlowEvent, logWalletEvents, nearAccountRefFromAccountId, normalizeWalletLocale, parseEther, parseNear, parseOwnerNearRecovery, parseUnits, parseWalletMoveId, seamsTestnetConfig, stake, thresholdEcdsaChainTargetFromChainFamily, thresholdEcdsaChainTargetFromConfig, thresholdEcdsaChainTargetFromConfiguredRequest, thresholdEcdsaChainTargetFromRequest, thresholdEcdsaChainTargetKey, thresholdEcdsaChainTargetsEqual, toAccountId, toWalletId, transfer, walletIdFromWalletProfile, walletSessionRefFromSession, yoctoNear };
|
|
@@ -2,6 +2,16 @@ import { nearAccountRefFromAccountId, walletSessionRefFromSession } from "../cor
|
|
|
2
2
|
import { createReviewedBoundCalls } from "./transactionReview/boundCalls.js";
|
|
3
3
|
//#region src/react/boundWallet.ts
|
|
4
4
|
function createBoundWallet(seams, loginState, host, owner) {
|
|
5
|
+
if (loginState.access === "external") return {
|
|
6
|
+
access: "external",
|
|
7
|
+
walletId: loginState.walletId,
|
|
8
|
+
authentication: loginState.externalSettings.authentication,
|
|
9
|
+
near: loginState.nearAccountId ? {
|
|
10
|
+
accountId: loginState.nearAccountId,
|
|
11
|
+
prepareOwnerTransaction: prepareReadableOwnerTransaction.bind(null, seams, loginState.externalSettings.authentication, loginState.nearAccountId),
|
|
12
|
+
resumeOwnerTransaction: resumeReadableOwnerTransaction.bind(null, seams, loginState.externalSettings.authentication)
|
|
13
|
+
} : null
|
|
14
|
+
};
|
|
5
15
|
const { walletId, nearAccountId } = loginState;
|
|
6
16
|
const walletSession = walletSessionRefFromSession({ walletId });
|
|
7
17
|
const nearAccount = nearAccountId ? nearAccountRefFromAccountId(nearAccountId) : null;
|
|
@@ -14,6 +24,7 @@ function createBoundWallet(seams, loginState, host, owner) {
|
|
|
14
24
|
owner
|
|
15
25
|
});
|
|
16
26
|
return {
|
|
27
|
+
access: "wallet",
|
|
17
28
|
walletId,
|
|
18
29
|
walletSession,
|
|
19
30
|
near: nearAccount && nearAccountId ? {
|
|
@@ -50,6 +61,19 @@ function exportKey(seams, walletSession, nearAccount, input) {
|
|
|
50
61
|
walletSession
|
|
51
62
|
});
|
|
52
63
|
}
|
|
64
|
+
function prepareReadableOwnerTransaction(seams, authentication, nearAccountId, input) {
|
|
65
|
+
return seams.near.prepareOwnerTransaction({
|
|
66
|
+
authentication,
|
|
67
|
+
nearAccountId,
|
|
68
|
+
transaction: input.transaction
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function resumeReadableOwnerTransaction(seams, authentication, input) {
|
|
72
|
+
return seams.near.resumeOwnerTransaction({
|
|
73
|
+
authentication,
|
|
74
|
+
recovery: input.recovery
|
|
75
|
+
});
|
|
76
|
+
}
|
|
53
77
|
//#endregion
|
|
54
78
|
export { createBoundWallet };
|
|
55
79
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { buildHostedAuthMenuOpenRequest, hostedAuthMenuExternalAuthRequestIdFromBoundary, hostedAuthMenuSessionIdFromBoundary } from "../../../SeamsWeb/walletIframe/shared/messages.js";
|
|
2
2
|
import { useSeams } from "../../context/index.js";
|
|
3
3
|
import { SeamsAuthMenuMock } from "./SeamsAuthMenuMock.js";
|
|
4
|
+
import { WalletAlternativesBroker, describeWalletAlternatives, walletAlternativesControllerKey } from "./walletAlternatives.js";
|
|
4
5
|
import { endHostedAuthMenuAnchor, resetHostedAuthMenuAnchor } from "../../../SeamsWeb/walletIframe/client/authMenuAnchor.js";
|
|
5
6
|
import React from "react";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -83,7 +84,8 @@ function hostedAuthMenuEffectConfigKey(config) {
|
|
|
83
84
|
showRegistrationInput: config.showRegistrationInput,
|
|
84
85
|
showProgress: config.showProgress,
|
|
85
86
|
copy: config.copy,
|
|
86
|
-
enabledExternalProviders: config.enabledExternalProviders
|
|
87
|
+
enabledExternalProviders: config.enabledExternalProviders,
|
|
88
|
+
walletAlternatives: describeWalletAlternatives(config.walletAlternatives)
|
|
87
89
|
});
|
|
88
90
|
return JSON.stringify({
|
|
89
91
|
initialMode: normalized.initialMode,
|
|
@@ -92,7 +94,9 @@ function hostedAuthMenuEffectConfigKey(config) {
|
|
|
92
94
|
showRegistrationInput: normalized.showRegistrationInput,
|
|
93
95
|
showProgress: normalized.showProgress,
|
|
94
96
|
copy: normalized.copy,
|
|
95
|
-
enabledExternalProviders: normalized.enabledExternalProviders
|
|
97
|
+
enabledExternalProviders: normalized.enabledExternalProviders,
|
|
98
|
+
walletAlternatives: normalized.walletAlternatives,
|
|
99
|
+
walletControllers: walletAlternativesControllerKey(config.walletAlternatives)
|
|
96
100
|
});
|
|
97
101
|
} catch {
|
|
98
102
|
return "invalid";
|
|
@@ -109,6 +113,8 @@ var HostedAuthMenuSessionController = class {
|
|
|
109
113
|
showProgress;
|
|
110
114
|
copy;
|
|
111
115
|
externalAuthBroker;
|
|
116
|
+
walletAlternatives;
|
|
117
|
+
walletBroker;
|
|
112
118
|
onOutcome;
|
|
113
119
|
externalAuthRequestIds = /* @__PURE__ */ new Set();
|
|
114
120
|
handleExternalAuthRequestBound;
|
|
@@ -128,12 +134,15 @@ var HostedAuthMenuSessionController = class {
|
|
|
128
134
|
this.showProgress = args.showProgress;
|
|
129
135
|
this.copy = args.copy;
|
|
130
136
|
this.externalAuthBroker = args.externalAuthBroker;
|
|
137
|
+
this.walletAlternatives = args.walletAlternatives;
|
|
138
|
+
this.walletBroker = new WalletAlternativesBroker(args.seams.authMenu, args.authMenuSessionId, args.walletAlternatives);
|
|
131
139
|
this.onOutcome = args.onOutcome;
|
|
132
140
|
this.handleExternalAuthRequestBound = this.handleExternalAuthRequest.bind(this);
|
|
133
141
|
}
|
|
134
142
|
start() {
|
|
135
143
|
if (this.isActive) return;
|
|
136
144
|
this.isActive = true;
|
|
145
|
+
this.walletBroker.start();
|
|
137
146
|
resetHostedAuthMenuAnchor(this.anchorElement);
|
|
138
147
|
this.unsubscribeExternalAuthRequest = this.seams.authMenu.onExternalAuthRequest(this.handleExternalAuthRequestBound);
|
|
139
148
|
this.open();
|
|
@@ -142,6 +151,7 @@ var HostedAuthMenuSessionController = class {
|
|
|
142
151
|
if (this.hasFinalizedCleanup) return;
|
|
143
152
|
this.hasFinalizedCleanup = true;
|
|
144
153
|
this.isActive = false;
|
|
154
|
+
this.walletBroker.cleanup();
|
|
145
155
|
this.unsubscribeExternalAuthRequest?.();
|
|
146
156
|
this.unsubscribeExternalAuthRequest = null;
|
|
147
157
|
this.externalAuthRequestIds.clear();
|
|
@@ -161,7 +171,8 @@ var HostedAuthMenuSessionController = class {
|
|
|
161
171
|
showRegistrationInput: this.showRegistrationInput,
|
|
162
172
|
showProgress: this.showProgress,
|
|
163
173
|
copy: this.copy,
|
|
164
|
-
enabledExternalProviders: this.externalAuthBroker.current ? ["google"] : []
|
|
174
|
+
enabledExternalProviders: this.externalAuthBroker.current ? ["google"] : [],
|
|
175
|
+
walletAlternatives: describeWalletAlternatives(this.walletAlternatives.current)
|
|
165
176
|
});
|
|
166
177
|
} catch (error) {
|
|
167
178
|
this.emitFailure(failureCodeForError(error), errorMessage(error));
|
|
@@ -225,6 +236,10 @@ var HostedAuthMenuSessionController = class {
|
|
|
225
236
|
if (this.hasTerminalOutcome) return;
|
|
226
237
|
this.hasTerminalOutcome = true;
|
|
227
238
|
endHostedAuthMenuAnchor(this.anchorElement);
|
|
239
|
+
try {
|
|
240
|
+
if (outcome.kind === "wallet_connected") this.walletBroker.complete(outcome.alternativeId);
|
|
241
|
+
} catch {}
|
|
242
|
+
this.walletBroker.cleanup();
|
|
228
243
|
try {
|
|
229
244
|
this.onOutcome.current(outcome);
|
|
230
245
|
} catch {}
|
|
@@ -274,7 +289,7 @@ function forwardHostedAuthMenuOutcome(terminalGateRef, onOutcomeRef, outcome) {
|
|
|
274
289
|
if (isTerminalHostedAuthMenuSuccess(outcome) && terminalGateRef.current) terminalGateRef.current.completed = true;
|
|
275
290
|
onOutcomeRef.current(outcome);
|
|
276
291
|
}
|
|
277
|
-
const HostedSeamsAuthMenu = ({ initialMode = "login", initialHeightCssPx, placeholder, registrationAccountInput = "implicit_wallet", showRegistrationInput = false, showProgress = false, copy, externalAuthBroker = null, onOutcome }) => {
|
|
292
|
+
const HostedSeamsAuthMenu = ({ initialMode = "login", initialHeightCssPx, placeholder, registrationAccountInput = "implicit_wallet", showRegistrationInput = false, showProgress = false, copy, externalAuthBroker = null, walletAlternatives, onOutcome }) => {
|
|
278
293
|
const { seams, isLoggedIn } = useOptionalSeams();
|
|
279
294
|
const terminalGate = terminalGateFor(seams);
|
|
280
295
|
syncTerminalGate(terminalGate, isLoggedIn);
|
|
@@ -285,9 +300,12 @@ const HostedSeamsAuthMenu = ({ initialMode = "login", initialHeightCssPx, placeh
|
|
|
285
300
|
showRegistrationInput,
|
|
286
301
|
showProgress,
|
|
287
302
|
copy,
|
|
288
|
-
enabledExternalProviders: externalProvidersForBroker(externalAuthBroker)
|
|
303
|
+
enabledExternalProviders: externalProvidersForBroker(externalAuthBroker),
|
|
304
|
+
walletAlternatives
|
|
289
305
|
});
|
|
290
306
|
const externalAuthBrokerRef = React.useRef(externalAuthBroker);
|
|
307
|
+
const walletAlternativesRef = React.useRef(walletAlternatives);
|
|
308
|
+
walletAlternativesRef.current = walletAlternatives;
|
|
291
309
|
const onOutcomeRef = React.useRef(onOutcome);
|
|
292
310
|
const terminalGateRef = React.useRef(terminalGate);
|
|
293
311
|
const forwardedOutcomeRef = React.useRef(() => {});
|
|
@@ -299,7 +317,8 @@ const HostedSeamsAuthMenu = ({ initialMode = "login", initialHeightCssPx, placeh
|
|
|
299
317
|
showRegistrationInput,
|
|
300
318
|
showProgress,
|
|
301
319
|
copy,
|
|
302
|
-
enabledExternalProviders: externalProvidersForBroker(externalAuthBroker)
|
|
320
|
+
enabledExternalProviders: externalProvidersForBroker(externalAuthBroker),
|
|
321
|
+
walletAlternatives
|
|
303
322
|
};
|
|
304
323
|
externalAuthBrokerRef.current = externalAuthBroker;
|
|
305
324
|
onOutcomeRef.current = onOutcome;
|
|
@@ -323,6 +342,7 @@ const HostedSeamsAuthMenu = ({ initialMode = "login", initialHeightCssPx, placeh
|
|
|
323
342
|
showProgress: config.showProgress,
|
|
324
343
|
copy: config.copy,
|
|
325
344
|
externalAuthBroker: externalAuthBrokerRef,
|
|
345
|
+
walletAlternatives: walletAlternativesRef,
|
|
326
346
|
onOutcome: forwardedOutcomeRef
|
|
327
347
|
});
|
|
328
348
|
session.start();
|