@seams/wallet 0.28.0 → 0.29.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/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/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 +30 -7
- package/dist/esm/SeamsWeb/walletIframe/client/sessionCommands.js +4 -0
- package/dist/esm/SeamsWeb/walletIframe/host/walletMutationGuard.js +5 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/exactSessionState.js +15 -1
- package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +1 -1
- package/dist/esm/SeamsWeb/walletIframe/shared/ownerNearOperation.js +152 -0
- package/dist/esm/core/accountData/near/accountProjection.js +1 -1
- 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/index.js +3 -2
- package/dist/esm/react/boundWallet.js +24 -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 -2
- package/dist/esm/sdk/{ConfirmationDrawer-MJoE0AAo.js → ConfirmationDrawer-BRnd5SEf.js} +1 -1
- package/dist/esm/sdk/NonceCoordinator-CNXYrOoy.js +1 -0
- package/dist/{public/sdk/SeamsWordmark-DwvPx2UA.js → esm/sdk/SeamsWordmark-CeEi2RlU.js} +1 -1
- package/dist/esm/sdk/accountLifecycle-B5a9SCM7.js +1 -0
- package/dist/esm/sdk/{adapters-C-g_hkkZ.js → adapters-B2k8y0MB.js} +1 -1
- package/dist/{public/sdk/appearance-token-vars-01eH9pgA.js → esm/sdk/appearance-token-vars-DkF3EBbF.js} +1 -1
- package/dist/esm/sdk/authorization-gVWwKwav.js +1 -0
- package/dist/esm/sdk/clientSessionPersistenceState-BxpITYM_.js +1 -0
- package/dist/esm/sdk/{collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js → collectAuthenticationCredentialForChallengeB64u-BoFVpdRS.js} +1 -1
- package/dist/esm/sdk/{commitQueue-CYruPlkm.js → commitQueue-C1wkey4q.js} +1 -1
- package/dist/esm/sdk/confirm-ui-Dx6c4-Rk.js +2 -0
- package/dist/{public/sdk/device-linking-DiCNt3iA.js → esm/sdk/device-linking-_o3_fgiG.js} +1 -1
- package/dist/esm/sdk/{deviceLinkApproval-x3WkiYrd.js → deviceLinkApproval-CObsEWBa.js} +1 -1
- package/dist/esm/sdk/{display-D0EPmU4w.js → display-CUWg48tD.js} +1 -1
- package/dist/{public/sdk/ecdsaCapabilityManifest-DAJEVjlP.js → esm/sdk/ecdsaCapabilityManifest--1Ztngfx.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationClientWasm-AYOJgTJm.js → esm/sdk/ecdsaDerivationClientWasm-DJh2uN-q.js} +1 -1
- package/dist/esm/sdk/ecdsaDerivationExport-BUUUGc6o.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/{public/sdk/emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js → esm/sdk/emailOtpEcdsaDerivationIdentity-Qd4pBwHv.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-O0OV1Oou.js} +1 -1
- package/dist/esm/sdk/exportKeypairOperation-DkqY9Bpf.js +1 -0
- package/dist/esm/sdk/host-BeE2dIU4.js +1 -0
- package/dist/{public/sdk/icons-BlMXolHv.js → esm/sdk/icons-pSZJ5Xrm.js} +1 -1
- package/dist/esm/sdk/indexedDB-CA4tGqkr.js +1 -0
- package/dist/esm/sdk/{intentDigest-HvRsBQ1z.js → intentDigest-gM3r4SVX.js} +1 -1
- package/dist/esm/sdk/{lanes-BU-fGqY4.js → lanes-vBKm6yBJ.js} +1 -1
- package/dist/esm/sdk/{localOnly-Xs89Xajm.js → localOnly-U_MucUAe.js} +1 -1
- package/dist/{public/sdk/mountExportPrivateKeySurface-CsUEKeum.js → esm/sdk/mountExportPrivateKeySurface-C2-fnvP6.js} +1 -1
- package/dist/{public/sdk/mountRecoveryCodeBackupSurface-kFLo5zLk.js → esm/sdk/mountRecoveryCodeBackupSurface-C_tJNPJX.js} +1 -1
- package/dist/esm/sdk/nearEd25519YaoSigningPreparation-CnbgQfZc.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/ownerNearOperation-DjNDxW3_.js +1 -0
- package/dist/{public/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js → esm/sdk/pendingWalletRecoveryCodeBackup-DXFrQmO5.js} +1 -1
- package/dist/esm/sdk/{presignaturePool-BbvqRWYw.js → presignaturePool-Dq4RhzXn.js} +1 -1
- package/dist/{public/sdk/recovery-entrypoint-DJbMDC_m.js → esm/sdk/recovery-entrypoint-s9OoKBcl.js} +1 -1
- package/dist/esm/sdk/registration-CTtTocyo.js +1 -0
- package/dist/esm/sdk/{registration-C2fb9kRQ.js → registration-D3p7muCc.js} +1 -1
- package/dist/esm/sdk/{registrationAccounts-4r74gX1l.js → registrationAccounts-Bso0ntMs.js} +1 -1
- package/dist/esm/sdk/{registrationIntent-Do1tD1V7.js → registrationIntent-C1-Kyx_-.js} +1 -1
- package/dist/{public/sdk/registrationSignerPlan-DK2b3N_p.js → esm/sdk/registrationSignerPlan-CeMidFme.js} +1 -1
- package/dist/{public/sdk/requireStepUpAuth-COqCGb1i.js → esm/sdk/requireStepUpAuth-iVo6h_U-.js} +1 -1
- package/dist/esm/sdk/resealedEnvelopeResult-DXDo-72P.js +1 -0
- package/dist/{public/sdk/routerAbNormalSigning-D-UZmCBS.js → esm/sdk/routerAbNormalSigning-DVFFkNhJ.js} +1 -1
- package/dist/esm/sdk/runtime-auth-Dsmw_dUA.js +1 -0
- package/dist/esm/sdk/runtime-device-link-qmYvGep9.js +1 -0
- package/dist/esm/sdk/runtime-ecdsa-tempo-Zh95TuLV.js +1 -0
- package/dist/esm/sdk/runtime-email-otp-CnLuW4H1.js +1 -0
- package/dist/esm/sdk/runtime-export-m8lvrXtw.js +1 -0
- package/dist/esm/sdk/runtime-near-BiXzXXhH.js +1 -0
- package/dist/esm/sdk/runtime-preferences-DlKHDIjb.js +1 -0
- package/dist/esm/sdk/runtime-recovery-C6lS71Jp.js +1 -0
- package/dist/esm/sdk/{runtime-recovery-codes-si1fGktB.js → runtime-recovery-codes-B033ake_.js} +1 -1
- package/dist/esm/sdk/runtimeContext-RNS2E5wy.js +7 -0
- package/dist/{public/sdk/secp256k1-CE7-q9Sn.js → esm/sdk/secp256k1-DPeaOjM0.js} +1 -1
- package/dist/esm/sdk/signEvmFamily-Cksw3RpU.js +1 -0
- package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js → signEvmFamilyWithUiConfirmForTempo-B7p9UVix.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-CGrLtMV6.js → signEvmWithUiConfirm-B14zYdwE.js} +1 -1
- package/dist/esm/sdk/signNear-D0rFEYP1.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-Bd1X0e-1.js} +2 -2
- package/dist/{public/sdk/signingQueue-dMFOFOP5.js → esm/sdk/signingQueue-DoUBeaCv.js} +1 -1
- package/dist/esm/sdk/{thresholdEcdsa-CqR1fFA-.js → thresholdEcdsa-BxfOZmiR.js} +1 -1
- package/dist/esm/sdk/{trace--mRP2OQc.js → trace-BnhLKxcu.js} +1 -1
- package/dist/esm/sdk/{transaction-activity-DCzHGg3b.js → transaction-activity-BXSxMp1E.js} +1 -1
- package/dist/{public/sdk/transactionState-29T9xfvL.js → esm/sdk/transactionState-G_FPe-U8.js} +1 -1
- package/dist/esm/sdk/{types-f7dyj5N6.js → types-A-w1cYlJ.js} +1 -1
- package/dist/esm/sdk/{unlockedEd25519ExportRootCapability-yzxQjIFd.js → unlockedEd25519ExportRootCapability-5F1egCSv.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/esm/sdk/{wallet-recovery-BZB2Vu3X.js → wallet-recovery-DXdm68_Q.js} +1 -1
- package/dist/{public/sdk/walletAuthMethodRecord-DLBB5fez.js → esm/sdk/walletAuthMethodRecord-BW-XV4fv.js} +1 -1
- package/dist/{public/sdk/walletAuthority-BTGAuOi8.js → esm/sdk/walletAuthority-DbGaSw7D.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-BnyL1Ryu.js} +1 -1
- package/dist/{public/sdk/walletOwnershipGeneration-CgjCtPrV.js → esm/sdk/walletOwnershipGeneration-BZc6UKqX.js} +1 -1
- package/dist/esm/sdk/walletRecoveryAdminProof-DdwikrW3.js +1 -0
- package/dist/esm/sdk/walletRecoveryCommit-DbAoiJp5.js +1 -0
- package/dist/esm/sdk/{walletSessionAuthorizationStore-B9Vwkshr.js → walletSessionAuthorizationStore-BivTUoKY.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 +2 -2
- package/dist/esm/voiceid-host.js +1 -1
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{ConfirmationDrawer-MJoE0AAo.js → ConfirmationDrawer-BRnd5SEf.js} +1 -1
- package/dist/public/sdk/NonceCoordinator-CNXYrOoy.js +1 -0
- package/dist/{esm/sdk/SeamsWordmark-DwvPx2UA.js → public/sdk/SeamsWordmark-CeEi2RlU.js} +1 -1
- package/dist/public/sdk/accountLifecycle-B5a9SCM7.js +1 -0
- package/dist/public/sdk/{adapters-C-g_hkkZ.js → adapters-B2k8y0MB.js} +1 -1
- package/dist/{esm/sdk/appearance-token-vars-01eH9pgA.js → public/sdk/appearance-token-vars-DkF3EBbF.js} +1 -1
- package/dist/public/sdk/authorization-gVWwKwav.js +1 -0
- package/dist/public/sdk/clientSessionPersistenceState-BxpITYM_.js +1 -0
- package/dist/public/sdk/{collectAuthenticationCredentialForChallengeB64u-I4wq8OGq.js → collectAuthenticationCredentialForChallengeB64u-BoFVpdRS.js} +1 -1
- package/dist/public/sdk/{commitQueue-CYruPlkm.js → commitQueue-C1wkey4q.js} +1 -1
- package/dist/public/sdk/confirm-ui-Dx6c4-Rk.js +2 -0
- package/dist/{esm/sdk/device-linking-DiCNt3iA.js → public/sdk/device-linking-_o3_fgiG.js} +1 -1
- package/dist/public/sdk/{deviceLinkApproval-x3WkiYrd.js → deviceLinkApproval-CObsEWBa.js} +1 -1
- package/dist/public/sdk/{display-D0EPmU4w.js → display-CUWg48tD.js} +1 -1
- package/dist/{esm/sdk/ecdsaCapabilityManifest-DAJEVjlP.js → public/sdk/ecdsaCapabilityManifest--1Ztngfx.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationClientWasm-AYOJgTJm.js → public/sdk/ecdsaDerivationClientWasm-DJh2uN-q.js} +1 -1
- package/dist/public/sdk/ecdsaDerivationExport-BUUUGc6o.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/{esm/sdk/emailOtpEcdsaDerivationIdentity-HFQXc1Yw.js → public/sdk/emailOtpEcdsaDerivationIdentity-Qd4pBwHv.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-O0OV1Oou.js} +1 -1
- package/dist/public/sdk/exportKeypairOperation-DkqY9Bpf.js +1 -0
- package/dist/public/sdk/host-BeE2dIU4.js +1 -0
- package/dist/{esm/sdk/icons-BlMXolHv.js → public/sdk/icons-pSZJ5Xrm.js} +1 -1
- package/dist/public/sdk/indexedDB-CA4tGqkr.js +1 -0
- package/dist/public/sdk/{intentDigest-HvRsBQ1z.js → intentDigest-gM3r4SVX.js} +1 -1
- package/dist/public/sdk/{lanes-BU-fGqY4.js → lanes-vBKm6yBJ.js} +1 -1
- package/dist/public/sdk/{localOnly-Xs89Xajm.js → localOnly-U_MucUAe.js} +1 -1
- package/dist/{esm/sdk/mountExportPrivateKeySurface-CsUEKeum.js → public/sdk/mountExportPrivateKeySurface-C2-fnvP6.js} +1 -1
- package/dist/{esm/sdk/mountRecoveryCodeBackupSurface-kFLo5zLk.js → public/sdk/mountRecoveryCodeBackupSurface-C_tJNPJX.js} +1 -1
- package/dist/public/sdk/nearEd25519YaoSigningPreparation-CnbgQfZc.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/ownerNearOperation-DjNDxW3_.js +1 -0
- package/dist/{esm/sdk/pendingWalletRecoveryCodeBackup-B-R_U34I.js → public/sdk/pendingWalletRecoveryCodeBackup-DXFrQmO5.js} +1 -1
- package/dist/public/sdk/{presignaturePool-BbvqRWYw.js → presignaturePool-Dq4RhzXn.js} +1 -1
- package/dist/{esm/sdk/recovery-entrypoint-DJbMDC_m.js → public/sdk/recovery-entrypoint-s9OoKBcl.js} +1 -1
- package/dist/public/sdk/registration-CTtTocyo.js +1 -0
- package/dist/public/sdk/{registration-C2fb9kRQ.js → registration-D3p7muCc.js} +1 -1
- package/dist/public/sdk/{registrationAccounts-4r74gX1l.js → registrationAccounts-Bso0ntMs.js} +1 -1
- package/dist/public/sdk/{registrationIntent-Do1tD1V7.js → registrationIntent-C1-Kyx_-.js} +1 -1
- package/dist/{esm/sdk/registrationSignerPlan-DK2b3N_p.js → public/sdk/registrationSignerPlan-CeMidFme.js} +1 -1
- package/dist/{esm/sdk/requireStepUpAuth-COqCGb1i.js → public/sdk/requireStepUpAuth-iVo6h_U-.js} +1 -1
- package/dist/public/sdk/resealedEnvelopeResult-DXDo-72P.js +1 -0
- package/dist/{esm/sdk/routerAbNormalSigning-D-UZmCBS.js → public/sdk/routerAbNormalSigning-DVFFkNhJ.js} +1 -1
- package/dist/public/sdk/runtime-auth-Dsmw_dUA.js +1 -0
- package/dist/public/sdk/runtime-device-link-qmYvGep9.js +1 -0
- package/dist/public/sdk/runtime-ecdsa-tempo-Zh95TuLV.js +1 -0
- package/dist/public/sdk/runtime-email-otp-CnLuW4H1.js +1 -0
- package/dist/public/sdk/runtime-export-m8lvrXtw.js +1 -0
- package/dist/public/sdk/runtime-near-BiXzXXhH.js +1 -0
- package/dist/public/sdk/runtime-preferences-DlKHDIjb.js +1 -0
- package/dist/public/sdk/runtime-recovery-C6lS71Jp.js +1 -0
- package/dist/public/sdk/{runtime-recovery-codes-si1fGktB.js → runtime-recovery-codes-B033ake_.js} +1 -1
- package/dist/public/sdk/runtimeContext-RNS2E5wy.js +7 -0
- package/dist/{esm/sdk/secp256k1-CE7-q9Sn.js → public/sdk/secp256k1-DPeaOjM0.js} +1 -1
- package/dist/public/sdk/signEvmFamily-Cksw3RpU.js +1 -0
- package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-CrMIAXUe.js → signEvmFamilyWithUiConfirmForTempo-B7p9UVix.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-CGrLtMV6.js → signEvmWithUiConfirm-B14zYdwE.js} +1 -1
- package/dist/public/sdk/signNear-D0rFEYP1.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-Bd1X0e-1.js} +2 -2
- package/dist/{esm/sdk/signingQueue-dMFOFOP5.js → public/sdk/signingQueue-DoUBeaCv.js} +1 -1
- package/dist/public/sdk/{thresholdEcdsa-CqR1fFA-.js → thresholdEcdsa-BxfOZmiR.js} +1 -1
- package/dist/public/sdk/{trace--mRP2OQc.js → trace-BnhLKxcu.js} +1 -1
- package/dist/public/sdk/{transaction-activity-DCzHGg3b.js → transaction-activity-BXSxMp1E.js} +1 -1
- package/dist/{esm/sdk/transactionState-29T9xfvL.js → public/sdk/transactionState-G_FPe-U8.js} +1 -1
- package/dist/public/sdk/{types-f7dyj5N6.js → types-A-w1cYlJ.js} +1 -1
- package/dist/public/sdk/{unlockedEd25519ExportRootCapability-yzxQjIFd.js → unlockedEd25519ExportRootCapability-5F1egCSv.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/public/sdk/{wallet-recovery-BZB2Vu3X.js → wallet-recovery-DXdm68_Q.js} +1 -1
- package/dist/{esm/sdk/walletAuthMethodRecord-DLBB5fez.js → public/sdk/walletAuthMethodRecord-BW-XV4fv.js} +1 -1
- package/dist/{esm/sdk/walletAuthority-BTGAuOi8.js → public/sdk/walletAuthority-DbGaSw7D.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-BnyL1Ryu.js} +1 -1
- package/dist/{esm/sdk/walletOwnershipGeneration-CgjCtPrV.js → public/sdk/walletOwnershipGeneration-BZc6UKqX.js} +1 -1
- package/dist/public/sdk/walletRecoveryAdminProof-DdwikrW3.js +1 -0
- package/dist/public/sdk/walletRecoveryCommit-DbAoiJp5.js +1 -0
- package/dist/public/sdk/{walletSessionAuthorizationStore-B9Vwkshr.js → walletSessionAuthorizationStore-BivTUoKY.js} +1 -1
- package/dist/public/sdk/{webauthnP256-BsQQPurm.js → webauthnP256-BGHikiNl.js} +1 -1
- package/dist/public/wallet-assets.manifest.json +258 -258
- 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/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 +14 -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/ownerNearOperation.d.ts +25 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +4 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/WalletHostRuntime.d.ts +5 -1
- 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/shared/exactSessionState.d.ts +8 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +17 -7
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/ownerNearOperation.d.ts +51 -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 +7 -0
- package/dist/types/wallet/src/index.d.ts +2 -0
- package/dist/types/wallet/src/react/boundWallet.d.ts +21 -1
- package/dist/types/wallet/src/react/hooks/useOwnerNearOperation.d.ts +4 -0
- package/dist/types/wallet/src/react/index.d.ts +3 -0
- package/package.json +1 -1
- package/dist/esm/sdk/NonceCoordinator-3YhmDTS5.js +0 -1
- package/dist/esm/sdk/accountLifecycle-6DHYWf0v.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/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/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/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/{public/sdk/accountIds-CW2BP-d9.js → esm/sdk/accountIds-DGWFzEnw.js} +0 -0
- /package/dist/{public/sdk/actions-DrtSTGus.js → esm/sdk/actions-7SvZZut1.js} +0 -0
- /package/dist/{public/sdk/authenticatorOptions-WCDKYRux.js → esm/sdk/authenticatorOptions-B4q62CLs.js} +0 -0
- /package/dist/{public/sdk/confirmTypes-BvVtQs-M.js → esm/sdk/confirmTypes-DmEPoxys.js} +0 -0
- /package/dist/{public/sdk/csp-stylesheet-DUSqfXvZ.js → esm/sdk/csp-stylesheet-5LU6VGKK.js} +0 -0
- /package/dist/{public/sdk/digestEncoding-CqNXPZY9.js → esm/sdk/digestEncoding-34kXJoJr.js} +0 -0
- /package/dist/{public/sdk/ecdsaChainTarget-Bm5X4k-V.js → esm/sdk/ecdsaChainTarget-BoRVQtjQ.js} +0 -0
- /package/dist/{public/sdk/executeWorkerOperation-C9FOCCR7.js → esm/sdk/executeWorkerOperation-CAYSt0NA.js} +0 -0
- /package/dist/{public/sdk/helpers-Dubwo5uK.js → esm/sdk/helpers-B7c1zc7h.js} +0 -0
- /package/dist/{public/sdk/jsonRpc-BVDv1wfm.js → esm/sdk/jsonRpc-DGzeiNSa.js} +0 -0
- /package/dist/{public/sdk/keccak-mS0Mejjx.js → esm/sdk/keccak-DGHI1G6t.js} +0 -0
- /package/dist/{public/sdk/keyMaterialEnvelope-Dm2ZEilb.js → esm/sdk/keyMaterialEnvelope-Czkks9Ki.js} +0 -0
- /package/dist/{public/sdk/presignatures-BCeq56DG.js → esm/sdk/presignatures-CkhuZ0YQ.js} +0 -0
- /package/dist/{public/sdk/profileAccountProjection-C5sNt-s2.js → esm/sdk/profileAccountProjection-dvLchPBo.js} +0 -0
- /package/dist/{public/sdk/registrationAuthMethodInput-BR1WVbK3.js → esm/sdk/registrationAuthMethodInput-C4o7yFBJ.js} +0 -0
- /package/dist/{public/sdk/sdkSentEvents-DjOlKtdW.js → esm/sdk/sdkSentEvents-BFwv3mBw.js} +0 -0
- /package/dist/{public/sdk/signerDomain-BAsLT3XN.js → esm/sdk/signerDomain-D-EUTlLK.js} +0 -0
- /package/dist/{public/sdk/signerSlot-D2RZnb27.js → esm/sdk/signerSlot-BlijMq8C.js} +0 -0
- /package/dist/{public/sdk/surface-measurement-reporter-DXsvq401.js → esm/sdk/surface-measurement-reporter-DJ_dQhBV.js} +0 -0
- /package/dist/{public/sdk/walletCustodyOperation-DimzAbCB.js → esm/sdk/walletOwnerOperation-CScYv2K6.js} +0 -0
- /package/dist/{public/sdk/walletSessionAuthorizationStatus-DG7DPcgR.js → esm/sdk/walletSessionAuthorizationStatus-GhcGvDCX.js} +0 -0
- /package/dist/{esm/sdk/accountIds-CW2BP-d9.js → public/sdk/accountIds-DGWFzEnw.js} +0 -0
- /package/dist/{esm/sdk/actions-DrtSTGus.js → public/sdk/actions-7SvZZut1.js} +0 -0
- /package/dist/{esm/sdk/authenticatorOptions-WCDKYRux.js → public/sdk/authenticatorOptions-B4q62CLs.js} +0 -0
- /package/dist/{esm/sdk/confirmTypes-BvVtQs-M.js → public/sdk/confirmTypes-DmEPoxys.js} +0 -0
- /package/dist/{esm/sdk/csp-stylesheet-DUSqfXvZ.js → public/sdk/csp-stylesheet-5LU6VGKK.js} +0 -0
- /package/dist/{esm/sdk/digestEncoding-CqNXPZY9.js → public/sdk/digestEncoding-34kXJoJr.js} +0 -0
- /package/dist/{esm/sdk/ecdsaChainTarget-Bm5X4k-V.js → public/sdk/ecdsaChainTarget-BoRVQtjQ.js} +0 -0
- /package/dist/{esm/sdk/executeWorkerOperation-C9FOCCR7.js → public/sdk/executeWorkerOperation-CAYSt0NA.js} +0 -0
- /package/dist/{esm/sdk/helpers-Dubwo5uK.js → public/sdk/helpers-B7c1zc7h.js} +0 -0
- /package/dist/{esm/sdk/jsonRpc-BVDv1wfm.js → public/sdk/jsonRpc-DGzeiNSa.js} +0 -0
- /package/dist/{esm/sdk/keccak-mS0Mejjx.js → public/sdk/keccak-DGHI1G6t.js} +0 -0
- /package/dist/{esm/sdk/keyMaterialEnvelope-Dm2ZEilb.js → public/sdk/keyMaterialEnvelope-Czkks9Ki.js} +0 -0
- /package/dist/{esm/sdk/presignatures-BCeq56DG.js → public/sdk/presignatures-CkhuZ0YQ.js} +0 -0
- /package/dist/{esm/sdk/profileAccountProjection-C5sNt-s2.js → public/sdk/profileAccountProjection-dvLchPBo.js} +0 -0
- /package/dist/{esm/sdk/registrationAuthMethodInput-BR1WVbK3.js → public/sdk/registrationAuthMethodInput-C4o7yFBJ.js} +0 -0
- /package/dist/{esm/sdk/sdkSentEvents-DjOlKtdW.js → public/sdk/sdkSentEvents-BFwv3mBw.js} +0 -0
- /package/dist/{esm/sdk/signerDomain-BAsLT3XN.js → public/sdk/signerDomain-D-EUTlLK.js} +0 -0
- /package/dist/{esm/sdk/signerSlot-D2RZnb27.js → public/sdk/signerSlot-BlijMq8C.js} +0 -0
- /package/dist/{esm/sdk/surface-measurement-reporter-DXsvq401.js → public/sdk/surface-measurement-reporter-DJ_dQhBV.js} +0 -0
- /package/dist/{esm/sdk/walletCustodyOperation-DimzAbCB.js → public/sdk/walletOwnerOperation-CScYv2K6.js} +0 -0
- /package/dist/{esm/sdk/walletSessionAuthorizationStatus-DG7DPcgR.js → public/sdk/walletSessionAuthorizationStatus-GhcGvDCX.js} +0 -0
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Seams Wallet SDK
|
|
2
2
|
|
|
3
|
-
`@seams/wallet` **0.
|
|
3
|
+
`@seams/wallet` **0.29.0** provides browser wallet lifecycle, NEAR and EVM-family
|
|
4
4
|
threshold signing, React components, and hosted wallet runtime assets.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
8
|
```sh
|
|
9
|
-
pnpm add @seams/wallet@0.
|
|
9
|
+
pnpm add @seams/wallet@0.29.0
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
React integrations support React 18 and 19. Import the provider and UI from
|
|
13
13
|
`@seams/wallet/react` and its stylesheet from `@seams/wallet/react/styles`.
|
|
14
14
|
Keep the application package, wallet-origin assets, and
|
|
15
|
-
`@seams/wallet-server@0.
|
|
16
|
-
is `
|
|
15
|
+
`@seams/wallet-server@0.29.0` on the matching release. The wallet iframe protocol
|
|
16
|
+
is `19.0.0`. The application and wallet host must use the same protocol version.
|
|
17
17
|
|
|
18
18
|
## Current API
|
|
19
19
|
|
|
@@ -46,6 +46,31 @@ The SDK selects signers and completes pending activation internally.
|
|
|
46
46
|
Request email codes only after a user chooses that method. The wallet host owns
|
|
47
47
|
the challenge and its expiry. The application receives the typed challenge handle.
|
|
48
48
|
|
|
49
|
+
## Application sessions and fresh owner approval
|
|
50
|
+
|
|
51
|
+
SDK 0.29.0 accepts a handoff from an explicitly trusted application backend.
|
|
52
|
+
Google and app-passkey login can use the same stable application user ID.
|
|
53
|
+
Use `registration.registerOwnerWallet` for NEAR-only passkey onboarding and `near.prepareOwnerTransaction` for fresh approval of each transaction.
|
|
54
|
+
These operations create no reusable signing authority.
|
|
55
|
+
React read connections expose owner-operation handles separately from reusable signers.
|
|
56
|
+
See the [application-session guide](https://wallet.seams.sh/docs/guides/application-auth).
|
|
57
|
+
|
|
58
|
+
## Bring your own Google authentication
|
|
59
|
+
|
|
60
|
+
SDK 0.29.0 can reuse an application's Google ID token to open associated wallet settings.
|
|
61
|
+
Configure the environment's Google client ID and let the owner associate their wallet once.
|
|
62
|
+
Then pass the token after the application's existing Google login:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
const result = await seams.auth.authenticate({ method: 'google', walletId, idToken });
|
|
66
|
+
if (!result.ok) throw new Error(result.code);
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Apps that retain the token on their backend use `prepareExternalAuth` and a browser-bound handoff.
|
|
70
|
+
Call `seams.auth.lock()` when the app logs out or switches accounts.
|
|
71
|
+
These sessions grant settings reads. Signing, export, recovery, and security changes retain their owner authentication requirements.
|
|
72
|
+
See the [Google SSO guide](https://wallet.seams.sh/docs/guides/google-sso) for both exchange paths, association, expiry, and revocation.
|
|
73
|
+
|
|
49
74
|
## React quick start
|
|
50
75
|
|
|
51
76
|
The three required values are the wallet origin, Gateway/relayer URL, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
810cdbbc2f95b4a48d4b1ce36a3ab524ffd0f3efff7c5a8eeb00d48a8c98c70c
|
|
@@ -42,6 +42,7 @@ function createPublicApi(deps) {
|
|
|
42
42
|
setAuthMethodEnabled: deps.registration.setAuthMethodEnabled,
|
|
43
43
|
addEmail: deps.registration.addEmail,
|
|
44
44
|
removeAuthMethod: deps.registration.removeAuthMethod,
|
|
45
|
+
registerOwnerWallet: registerOwnerWallet.bind(null, deps.registration),
|
|
45
46
|
registerWallet: registerWallet.bind(null, deps.registration, deps.configs)
|
|
46
47
|
},
|
|
47
48
|
recovery: deps.recovery,
|
|
@@ -66,6 +67,7 @@ async function registerWallet(commands, configs, args) {
|
|
|
66
67
|
options: args.options ?? {}
|
|
67
68
|
}) : args.signerSelection;
|
|
68
69
|
command = {
|
|
70
|
+
completion: "wallet_session",
|
|
69
71
|
authMethod: args.authMethod,
|
|
70
72
|
wallet,
|
|
71
73
|
signerSelection,
|
|
@@ -120,6 +122,15 @@ function createReviewedCapabilities(deps, reservation) {
|
|
|
120
122
|
evm: evmFamily.evm
|
|
121
123
|
};
|
|
122
124
|
}
|
|
125
|
+
async function registerOwnerWallet(commands, args) {
|
|
126
|
+
return await commands.registerWallet({
|
|
127
|
+
completion: "owner_operations",
|
|
128
|
+
authMethod: args.authMethod,
|
|
129
|
+
wallet: args.wallet ?? { kind: "server_allocated" },
|
|
130
|
+
signerSelection: args.signerSelection,
|
|
131
|
+
options: args.options
|
|
132
|
+
});
|
|
133
|
+
}
|
|
123
134
|
//#endregion
|
|
124
135
|
export { createApplicationPublicApi };
|
|
125
136
|
|
|
@@ -2,12 +2,15 @@ import { CAPABILITY_KINDS, NEAR_ED25519_MPC_OPERATION_KINDS } from "../../shared
|
|
|
2
2
|
import { toError } from "../../shared-ts/src/utils/errors.js";
|
|
3
3
|
import { nearTransactionFailure } from "../../core/signingEngine/nearTransactionSubmission.js";
|
|
4
4
|
import { requireBrowserCapabilityOperation } from "./capabilitySelection.js";
|
|
5
|
+
import { prepareOwnerNearTransaction, resumeOwnerNearTransaction } from "./ownerNearOperation.js";
|
|
5
6
|
import { accountExists } from "../../core/rpcClients/near/accountExists.js";
|
|
6
7
|
import { delegateRelayerAuthFromConfigs, sendDelegateAction } from "../operations/near/delegateAction.js";
|
|
7
8
|
//#region src/SeamsWeb/publicApi/near.ts
|
|
8
9
|
function createNearSignerCapability(deps) {
|
|
9
10
|
const signer = new NearSigner(deps);
|
|
10
11
|
return {
|
|
12
|
+
prepareOwnerTransaction: prepareOwnerNearTransaction.bind(null, deps.commands.ownerOperation),
|
|
13
|
+
resumeOwnerTransaction: resumeOwnerNearTransaction.bind(null, deps.commands.ownerOperation),
|
|
11
14
|
accountExists: accountExists.bind(null, deps.nearClient),
|
|
12
15
|
signAndSendTransaction: signer.signAndSendTransaction.bind(signer),
|
|
13
16
|
signTransaction: signer.signTransaction.bind(signer),
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { secureRandomBase64Url } from "../../shared-ts/src/utils/secureRandomId.js";
|
|
2
|
+
import { SigningSessionIds } from "../../core/signingEngine/session/operationState/types.js";
|
|
3
|
+
import { toAccountId } from "../../core/types/accountIds.js";
|
|
4
|
+
import { toActionArgsWasm } from "../../shared-ts/src/near/actions.js";
|
|
5
|
+
import { parseOwnerNearCommand, parseOwnerNearRecovery } from "../walletIframe/shared/ownerNearOperation.js";
|
|
6
|
+
//#region src/SeamsWeb/publicApi/ownerNearOperation.ts
|
|
7
|
+
function prepareOwnerNearTransaction(execute, input) {
|
|
8
|
+
const recovery = {
|
|
9
|
+
operationId: SigningSessionIds.signingOperation(`owner-near:${secureRandomBase64Url(32, "owner NEAR operation IDs")}`),
|
|
10
|
+
walletId: input.authentication.walletId,
|
|
11
|
+
nearAccountId: toAccountId(input.nearAccountId)
|
|
12
|
+
};
|
|
13
|
+
const command = parseOwnerNearCommand({
|
|
14
|
+
action: "approve",
|
|
15
|
+
authentication: input.authentication,
|
|
16
|
+
recovery,
|
|
17
|
+
expiresAtMs: Math.min(input.authentication.expiresAtMs, Date.now() + 12e4),
|
|
18
|
+
transaction: {
|
|
19
|
+
receiverId: input.transaction.receiverId,
|
|
20
|
+
actions: input.transaction.actions.map(toActionArgsWasm)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
if (command.action !== "approve") throw new Error("Invalid prepared owner operation.");
|
|
24
|
+
return new OwnerNearTransaction(execute, command, {
|
|
25
|
+
kind: "prepared",
|
|
26
|
+
recovery,
|
|
27
|
+
expiresAtMs: command.expiresAtMs
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function resumeOwnerNearTransaction(execute, input) {
|
|
31
|
+
const recovery = parseOwnerNearRecovery(input.recovery);
|
|
32
|
+
return new OwnerNearTransaction(execute, parseOwnerNearCommand({
|
|
33
|
+
action: "recover",
|
|
34
|
+
authentication: input.authentication,
|
|
35
|
+
recovery
|
|
36
|
+
}), {
|
|
37
|
+
kind: "unknown",
|
|
38
|
+
recovery
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
var OwnerNearTransaction = class {
|
|
42
|
+
controller = new AbortController();
|
|
43
|
+
listeners = /* @__PURE__ */ new Set();
|
|
44
|
+
inFlight = null;
|
|
45
|
+
constructor(execute, command, state) {
|
|
46
|
+
this.execute = execute;
|
|
47
|
+
this.command = command;
|
|
48
|
+
this.state = state;
|
|
49
|
+
}
|
|
50
|
+
getState() {
|
|
51
|
+
return this.state;
|
|
52
|
+
}
|
|
53
|
+
subscribe(listener) {
|
|
54
|
+
this.listeners.add(listener);
|
|
55
|
+
return this.removeListener.bind(this, listener);
|
|
56
|
+
}
|
|
57
|
+
removeListener(listener) {
|
|
58
|
+
this.listeners.delete(listener);
|
|
59
|
+
}
|
|
60
|
+
transition(state) {
|
|
61
|
+
this.state = state;
|
|
62
|
+
for (const listener of this.listeners) try {
|
|
63
|
+
listener();
|
|
64
|
+
} catch {}
|
|
65
|
+
}
|
|
66
|
+
approve() {
|
|
67
|
+
if (this.inFlight) return this.inFlight;
|
|
68
|
+
if (this.command.action !== "approve" || this.state.kind !== "prepared") throw new Error("This operation cannot request another approval.");
|
|
69
|
+
if (this.command.expiresAtMs <= Date.now()) {
|
|
70
|
+
this.transition({
|
|
71
|
+
kind: "expired",
|
|
72
|
+
recovery: this.command.recovery
|
|
73
|
+
});
|
|
74
|
+
return Promise.resolve({ kind: "expired" });
|
|
75
|
+
}
|
|
76
|
+
this.transition({
|
|
77
|
+
kind: "approval",
|
|
78
|
+
recovery: this.command.recovery,
|
|
79
|
+
expiresAtMs: this.command.expiresAtMs
|
|
80
|
+
});
|
|
81
|
+
this.inFlight = this.run(this.command);
|
|
82
|
+
return this.inFlight;
|
|
83
|
+
}
|
|
84
|
+
cancel() {
|
|
85
|
+
if (this.state.kind === "prepared") {
|
|
86
|
+
this.controller.abort();
|
|
87
|
+
this.transition({
|
|
88
|
+
kind: "cancelled",
|
|
89
|
+
recovery: this.command.recovery
|
|
90
|
+
});
|
|
91
|
+
} else if (this.state.kind === "approval") this.controller.abort();
|
|
92
|
+
}
|
|
93
|
+
recover() {
|
|
94
|
+
if (this.inFlight) return this.inFlight;
|
|
95
|
+
if (this.state.kind !== "unknown") throw new Error("Only an unknown outcome requires recovery.");
|
|
96
|
+
this.inFlight = this.run({
|
|
97
|
+
action: "recover",
|
|
98
|
+
authentication: this.command.authentication,
|
|
99
|
+
recovery: this.state.recovery
|
|
100
|
+
});
|
|
101
|
+
return this.inFlight;
|
|
102
|
+
}
|
|
103
|
+
submitted() {
|
|
104
|
+
this.transition({
|
|
105
|
+
kind: "submitting",
|
|
106
|
+
recovery: this.command.recovery
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
async run(command) {
|
|
110
|
+
let outcome;
|
|
111
|
+
try {
|
|
112
|
+
outcome = await this.execute(command, {
|
|
113
|
+
signal: command.action === "recover" ? new AbortController().signal : this.controller.signal,
|
|
114
|
+
onSubmission: this.submitted.bind(this)
|
|
115
|
+
});
|
|
116
|
+
} catch {
|
|
117
|
+
outcome = {
|
|
118
|
+
kind: "unknown",
|
|
119
|
+
recovery: command.recovery
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
this.settle(outcome, command.recovery);
|
|
123
|
+
this.inFlight = null;
|
|
124
|
+
return outcome;
|
|
125
|
+
}
|
|
126
|
+
settle(outcome, recovery) {
|
|
127
|
+
switch (outcome.kind) {
|
|
128
|
+
case "completed":
|
|
129
|
+
this.transition({
|
|
130
|
+
kind: "completed",
|
|
131
|
+
recovery,
|
|
132
|
+
result: outcome.result
|
|
133
|
+
});
|
|
134
|
+
return;
|
|
135
|
+
case "reverted":
|
|
136
|
+
this.transition({
|
|
137
|
+
kind: "reverted",
|
|
138
|
+
recovery,
|
|
139
|
+
transactionId: outcome.transactionId,
|
|
140
|
+
error: outcome.error
|
|
141
|
+
});
|
|
142
|
+
return;
|
|
143
|
+
case "cancelled":
|
|
144
|
+
this.transition({
|
|
145
|
+
kind: "cancelled",
|
|
146
|
+
recovery
|
|
147
|
+
});
|
|
148
|
+
return;
|
|
149
|
+
case "expired":
|
|
150
|
+
this.transition({
|
|
151
|
+
kind: "expired",
|
|
152
|
+
recovery
|
|
153
|
+
});
|
|
154
|
+
return;
|
|
155
|
+
case "unknown":
|
|
156
|
+
this.transition({
|
|
157
|
+
kind: "unknown",
|
|
158
|
+
recovery: outcome.recovery
|
|
159
|
+
});
|
|
160
|
+
return;
|
|
161
|
+
case "failed":
|
|
162
|
+
this.transition({
|
|
163
|
+
kind: "failed",
|
|
164
|
+
recovery,
|
|
165
|
+
error: outcome.error
|
|
166
|
+
});
|
|
167
|
+
return;
|
|
168
|
+
default: throw new Error("Unsupported owner operation outcome.");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
//#endregion
|
|
173
|
+
export { prepareOwnerNearTransaction, resumeOwnerNearTransaction };
|
|
174
|
+
|
|
175
|
+
//# sourceMappingURL=ownerNearOperation.js.map
|
|
@@ -4,6 +4,7 @@ import { nearTransactionFailure, notifyNearTransactionResult } from "../../../co
|
|
|
4
4
|
function createApplicationNearCommands(walletIframe, beforeSigning, transactionDispatch) {
|
|
5
5
|
const commands = new ApplicationNearCommands(walletIframe, beforeSigning, transactionDispatch);
|
|
6
6
|
return {
|
|
7
|
+
ownerOperation: commands.ownerOperation.bind(commands),
|
|
7
8
|
signAndSendTransaction: commands.signAndSendTransaction.bind(commands),
|
|
8
9
|
signTransaction: commands.signTransaction.bind(commands),
|
|
9
10
|
sendTransaction: commands.sendTransaction.bind(commands),
|
|
@@ -17,6 +18,9 @@ var ApplicationNearCommands = class {
|
|
|
17
18
|
this.beforeSigning = beforeSigning;
|
|
18
19
|
this.transactionDispatch = transactionDispatch;
|
|
19
20
|
}
|
|
21
|
+
async ownerOperation(...args) {
|
|
22
|
+
return await (await this.walletIframe.requireRouter()).ownerNearOperation(...args);
|
|
23
|
+
}
|
|
20
24
|
async signAndSendTransaction(args) {
|
|
21
25
|
const walletIframe = this.walletIframe;
|
|
22
26
|
const nearAccountId = args.nearAccount.accountId;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { parseOwnerNearOutcome, parseOwnerNearSubmissionProgress } from "../shared/ownerNearOperation.js";
|
|
2
|
+
//#region src/SeamsWeb/walletIframe/client/ownerNearOperation.ts
|
|
3
|
+
async function executeOwnerNearRequest(ports, ...args) {
|
|
4
|
+
const [command, execution] = args;
|
|
5
|
+
return await new OwnerNearRequest(ports, command, execution).run();
|
|
6
|
+
}
|
|
7
|
+
var OwnerNearRequest = class {
|
|
8
|
+
requestId;
|
|
9
|
+
state = "preparing";
|
|
10
|
+
constructor(ports, command, execution) {
|
|
11
|
+
this.ports = ports;
|
|
12
|
+
this.command = command;
|
|
13
|
+
this.execution = execution;
|
|
14
|
+
this.requestId = ports.allocateRequestId();
|
|
15
|
+
}
|
|
16
|
+
current() {
|
|
17
|
+
return !this.execution.signal.aborted;
|
|
18
|
+
}
|
|
19
|
+
dispatched() {
|
|
20
|
+
this.state = "dispatched";
|
|
21
|
+
}
|
|
22
|
+
progress(payload) {
|
|
23
|
+
if (parseOwnerNearSubmissionProgress(payload)?.operationId === this.command.recovery.operationId) {
|
|
24
|
+
this.state = "submitting";
|
|
25
|
+
this.execution.onSubmission();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
cancel() {
|
|
29
|
+
this.ports.cancelRequest(this.requestId).catch(ignoreCancellationFailure);
|
|
30
|
+
}
|
|
31
|
+
async run() {
|
|
32
|
+
if (!this.current()) return { kind: "cancelled" };
|
|
33
|
+
const cancel = this.cancel.bind(this);
|
|
34
|
+
this.execution.signal.addEventListener("abort", cancel, { once: true });
|
|
35
|
+
try {
|
|
36
|
+
return parseOwnerNearOutcome((await this.ports.post({
|
|
37
|
+
type: "PM_OWNER_NEAR_TRANSACTION",
|
|
38
|
+
payload: this.command,
|
|
39
|
+
options: { onProgress: this.progress.bind(this) }
|
|
40
|
+
}, {
|
|
41
|
+
requestId: this.requestId,
|
|
42
|
+
timeout: "interactive",
|
|
43
|
+
shouldContinue: this.current.bind(this),
|
|
44
|
+
onDispatched: this.dispatched.bind(this)
|
|
45
|
+
})).result);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
if (this.state !== "submitting" && isOwnerRequestCancellation(error)) return { kind: "cancelled" };
|
|
48
|
+
if (this.state === "preparing" && !this.current()) return { kind: "cancelled" };
|
|
49
|
+
return {
|
|
50
|
+
kind: "unknown",
|
|
51
|
+
recovery: this.command.recovery
|
|
52
|
+
};
|
|
53
|
+
} finally {
|
|
54
|
+
this.execution.signal.removeEventListener("abort", cancel);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
function ignoreCancellationFailure() {}
|
|
59
|
+
function isOwnerRequestCancellation(error) {
|
|
60
|
+
if (!error || typeof error !== "object") return false;
|
|
61
|
+
const code = Reflect.get(error, "code");
|
|
62
|
+
return code === "cancelled" || code === "wallet_operation_step_up_cancelled";
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { executeOwnerNearRequest };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=ownerNearOperation.js.map
|
|
@@ -86,23 +86,7 @@ var OnEventsProgressBus = class {
|
|
|
86
86
|
});
|
|
87
87
|
return true;
|
|
88
88
|
}
|
|
89
|
-
this.log("dispatch-miss",
|
|
90
|
-
requestId,
|
|
91
|
-
flow: payload.flow,
|
|
92
|
-
phase: payload.phase,
|
|
93
|
-
status: payload.status
|
|
94
|
-
} : isDeviceLinkTargetFactorActivationProgressV1(payload) ? {
|
|
95
|
-
requestId,
|
|
96
|
-
event: payload.event,
|
|
97
|
-
activationKind: payload.activation.kind
|
|
98
|
-
} : isDeviceLinkEmailOtpBaseFactorSelectionProgressV1(payload) ? {
|
|
99
|
-
requestId,
|
|
100
|
-
event: payload.event,
|
|
101
|
-
choiceCount: payload.choices.length
|
|
102
|
-
} : {
|
|
103
|
-
requestId,
|
|
104
|
-
span: payload.span
|
|
105
|
-
});
|
|
89
|
+
this.log("dispatch-miss", progressDebugFields(requestId, payload));
|
|
106
90
|
return false;
|
|
107
91
|
}
|
|
108
92
|
findSticky(requestId) {
|
|
@@ -129,6 +113,32 @@ var OnEventsProgressBus = class {
|
|
|
129
113
|
} catch {}
|
|
130
114
|
}
|
|
131
115
|
};
|
|
116
|
+
function progressDebugFields(requestId, payload) {
|
|
117
|
+
if (isWalletFlowEvent(payload)) return {
|
|
118
|
+
requestId,
|
|
119
|
+
flow: payload.flow,
|
|
120
|
+
phase: payload.phase,
|
|
121
|
+
status: payload.status
|
|
122
|
+
};
|
|
123
|
+
if (isDeviceLinkTargetFactorActivationProgressV1(payload)) return {
|
|
124
|
+
requestId,
|
|
125
|
+
event: payload.event,
|
|
126
|
+
activationKind: payload.activation.kind
|
|
127
|
+
};
|
|
128
|
+
if (isDeviceLinkEmailOtpBaseFactorSelectionProgressV1(payload)) return {
|
|
129
|
+
requestId,
|
|
130
|
+
event: payload.event,
|
|
131
|
+
choiceCount: payload.choices.length
|
|
132
|
+
};
|
|
133
|
+
if (payload.event === "owner_near_submitting") return {
|
|
134
|
+
requestId,
|
|
135
|
+
event: payload.event
|
|
136
|
+
};
|
|
137
|
+
return {
|
|
138
|
+
requestId,
|
|
139
|
+
span: payload.span
|
|
140
|
+
};
|
|
141
|
+
}
|
|
132
142
|
//#endregion
|
|
133
143
|
export { OnEventsProgressBus };
|
|
134
144
|
|
|
@@ -25,6 +25,7 @@ import { resolveRuntimeAppearance } from "../shared/facadeBoundary.js";
|
|
|
25
25
|
import { TransactionReviewError, assertTransactionReviewValid, parseTransactionReviewState, reviewedConfirmationConfig, sameTransactionReviewIdentity, transactionReviewCancellationCode } from "../shared/transactionReview.js";
|
|
26
26
|
import { needsExplicitActivation } from "../../../utils/deviceDetection.js";
|
|
27
27
|
import { hostedAuthMenuAnchorMetrics, markHostedAuthMenuAnchorReady, publishHostedAuthMenuAnchorHeight } from "./authMenuAnchor.js";
|
|
28
|
+
import { executeOwnerNearRequest } from "./ownerNearOperation.js";
|
|
28
29
|
import { parseAuthMethodAvailability } from "../../../core/authMethods/availabilityTypes.js";
|
|
29
30
|
import { TransactionReviewReservation } from "./transactionReviewReservation.js";
|
|
30
31
|
import { OnEventsProgressBus } from "./progress/on-events-progress-bus.js";
|
|
@@ -44,6 +45,8 @@ function requestSurfaceKindForMessage(type, payload) {
|
|
|
44
45
|
case "PM_ADD_PASSKEY":
|
|
45
46
|
case "PM_ROTATE_WALLET_RECOVERY_CODES": return "registration";
|
|
46
47
|
case "PM_ACTIVATE_AUTH_METHOD": return "auth_method_activation";
|
|
48
|
+
case "PM_EXTERNAL_OWNER_AUTH":
|
|
49
|
+
case "PM_OWNER_NEAR_TRANSACTION": return "owner_approval";
|
|
47
50
|
case "PM_ADD_EMAIL_OTP": return "email_otp_enrollment";
|
|
48
51
|
case "PM_GET_WALLET_RECOVERY_CODE_STATUS":
|
|
49
52
|
case "PM_ACKNOWLEDGE_WALLET_RECOVERY_CODE_BACKUP": return "recovery_codes";
|
|
@@ -94,6 +97,7 @@ function requestSurfacePresentationFor(kind, payload, fallbackUiMode) {
|
|
|
94
97
|
case "registration": return modalWalletIframeSurfacePresentation("Confirm passkey registration");
|
|
95
98
|
case "email_otp_enrollment": return confirmationUiModeForRequest("PM_ADD_EMAIL_OTP", payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Enter email code") : modalWalletIframeSurfacePresentation("Enter email code");
|
|
96
99
|
case "auth_method_activation": return modalWalletIframeSurfacePresentation("Activate authentication method");
|
|
100
|
+
case "owner_approval": return modalWalletIframeSurfacePresentation("Approve wallet operation");
|
|
97
101
|
case "transaction": return effectiveTransactionSurfaceUiMode(payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Confirm transaction") : modalWalletIframeSurfacePresentation("Confirm transaction");
|
|
98
102
|
case "key_export_near":
|
|
99
103
|
case "key_export_threshold": return confirmationUiModeForRequest("PM_EXPORT_KEYPAIR_UI", payload, fallbackUiMode) === "drawer" ? drawerWalletIframeSurfacePresentation("Confirm key export") : modalWalletIframeSurfacePresentation("Confirm key export");
|
|
@@ -201,6 +205,7 @@ function walletIframeSessionStatesEqual(left, right) {
|
|
|
201
205
|
if (left === null || left.kind !== right.kind) return false;
|
|
202
206
|
switch (left.kind) {
|
|
203
207
|
case "wallet_locked": return right.kind === "wallet_locked";
|
|
208
|
+
case "external_read": return right.kind === "external_read" && left.walletId === right.walletId && left.externalSessionId === right.externalSessionId && left.expiresAtMs === right.expiresAtMs;
|
|
204
209
|
case "active_session":
|
|
205
210
|
case "expired_session": return (right.kind === "active_session" || right.kind === "expired_session") && exactSessionIdentitiesMatch(left, right) && left.authMethod === right.authMethod && left.expiresAtMs === right.expiresAtMs;
|
|
206
211
|
case "wallet_authenticated_identity_unresolvable": return right.kind === left.kind && left.walletId === right.walletId && left.reason === right.reason;
|
|
@@ -213,6 +218,7 @@ function walletIframeSessionStatesEqual(left, right) {
|
|
|
213
218
|
}
|
|
214
219
|
function walletIframeLoginStatusFromExactSession(state) {
|
|
215
220
|
switch (state.kind) {
|
|
221
|
+
case "external_read":
|
|
216
222
|
case "active_session":
|
|
217
223
|
case "expired_session":
|
|
218
224
|
case "wallet_authenticated_identity_unresolvable":
|
|
@@ -1155,6 +1161,7 @@ var WalletIframeRouter = class {
|
|
|
1155
1161
|
break;
|
|
1156
1162
|
case "email_otp_enrollment":
|
|
1157
1163
|
case "auth_method_activation":
|
|
1164
|
+
case "owner_approval":
|
|
1158
1165
|
result = this.transitionWalletIframeSurface({
|
|
1159
1166
|
kind: "transaction_modal_request_started",
|
|
1160
1167
|
connectionId,
|
|
@@ -1605,7 +1612,7 @@ var WalletIframeRouter = class {
|
|
|
1605
1612
|
acceptSessionSnapshot(snapshot) {
|
|
1606
1613
|
if (snapshot.revision <= this.sessionObservationRevision) return false;
|
|
1607
1614
|
const walletId = this.lastPreferencesChangedPayload?.walletId;
|
|
1608
|
-
if (walletId !== void 0 && walletId !== snapshot.walletId) return false;
|
|
1615
|
+
if (snapshot.state.kind !== "external_read" && walletId !== void 0 && walletId !== snapshot.walletId) return false;
|
|
1609
1616
|
const changed = !walletIframeSessionStatesEqual(this.exactSessionState, snapshot.state);
|
|
1610
1617
|
this.sessionObservationRevision = snapshot.revision;
|
|
1611
1618
|
this.updateReviewSession(snapshot.state);
|
|
@@ -1768,6 +1775,7 @@ var WalletIframeRouter = class {
|
|
|
1768
1775
|
return (await this.post({
|
|
1769
1776
|
type: "PM_REGISTER_WALLET",
|
|
1770
1777
|
payload: {
|
|
1778
|
+
completion: payload.completion,
|
|
1771
1779
|
authMethod: transport.authMethod,
|
|
1772
1780
|
wallet: payload.wallet,
|
|
1773
1781
|
signerSelection: registrationSignerSetRequestSelection(payload.signerSelection),
|
|
@@ -1923,23 +1931,31 @@ var WalletIframeRouter = class {
|
|
|
1923
1931
|
}
|
|
1924
1932
|
async removeExternalAuth(input) {
|
|
1925
1933
|
return (await this.post({
|
|
1926
|
-
type: "
|
|
1934
|
+
type: "PM_EXTERNAL_OWNER_AUTH",
|
|
1927
1935
|
payload: {
|
|
1928
1936
|
action: "unlink",
|
|
1929
1937
|
walletId: input.walletId,
|
|
1930
1938
|
associationId: input.associationId
|
|
1931
1939
|
}
|
|
1940
|
+
}, { timeout: "interactive" })).result;
|
|
1941
|
+
}
|
|
1942
|
+
async prepareExternalAssociation(walletId) {
|
|
1943
|
+
return (await this.post({
|
|
1944
|
+
type: "PM_EXTERNAL_AUTH",
|
|
1945
|
+
payload: {
|
|
1946
|
+
action: "prepare_association",
|
|
1947
|
+
walletId
|
|
1948
|
+
}
|
|
1932
1949
|
})).result;
|
|
1933
1950
|
}
|
|
1934
1951
|
async associateExternalAuth(input) {
|
|
1935
1952
|
return (await this.post({
|
|
1936
|
-
type: "
|
|
1953
|
+
type: "PM_EXTERNAL_OWNER_AUTH",
|
|
1937
1954
|
payload: {
|
|
1938
1955
|
action: "associate",
|
|
1939
|
-
|
|
1940
|
-
idToken: input.idToken
|
|
1956
|
+
input
|
|
1941
1957
|
}
|
|
1942
|
-
})).result;
|
|
1958
|
+
}, { timeout: "interactive" })).result;
|
|
1943
1959
|
}
|
|
1944
1960
|
async getWalletSession(walletId) {
|
|
1945
1961
|
const expectedWalletId = walletId === void 0 ? void 0 : parseRequestedWalletId(walletId);
|
|
@@ -2501,6 +2517,13 @@ var WalletIframeRouter = class {
|
|
|
2501
2517
|
} catch {}
|
|
2502
2518
|
};
|
|
2503
2519
|
}
|
|
2520
|
+
async ownerNearOperation(...args) {
|
|
2521
|
+
return await executeOwnerNearRequest({
|
|
2522
|
+
post: this.post.bind(this),
|
|
2523
|
+
cancelRequest: this.cancelRequest.bind(this),
|
|
2524
|
+
allocateRequestId: this.allocateRequestId.bind(this)
|
|
2525
|
+
}, ...args);
|
|
2526
|
+
}
|
|
2504
2527
|
async signAndSendTransaction(payload, transactionDispatch = { kind: "ordinary" }) {
|
|
2505
2528
|
const request = new NearTransactionRequest({ kind: "sign_and_send" });
|
|
2506
2529
|
try {
|
|
@@ -2885,7 +2908,7 @@ var WalletIframeRouter = class {
|
|
|
2885
2908
|
const deadlineAtMs = timeoutPolicy.kind === "deadline" ? timeoutPolicy.deadlineAtMs : null;
|
|
2886
2909
|
const surfaceKind = requestSurfaceKindForMessage(envelope.type, full.payload);
|
|
2887
2910
|
let transactionSurfaceLease = null;
|
|
2888
|
-
if (!reservation && (surfaceKind === "transaction" || surfaceKind === "email_otp_enrollment" || surfaceKind === "auth_method_activation")) {
|
|
2911
|
+
if (!reservation && (surfaceKind === "transaction" || surfaceKind === "email_otp_enrollment" || surfaceKind === "auth_method_activation" || surfaceKind === "owner_approval")) {
|
|
2889
2912
|
const queueDeadline = timeoutPolicy.kind === "deadline" ? {
|
|
2890
2913
|
kind: "deadline",
|
|
2891
2914
|
atMs: timeoutPolicy.deadlineAtMs
|
|
@@ -5,6 +5,7 @@ function createApplicationSessionCommands(walletIframe) {
|
|
|
5
5
|
return {
|
|
6
6
|
authenticate: authenticate.bind(null, walletIframe),
|
|
7
7
|
prepareExternalAuth: prepareExternalAuth.bind(null, walletIframe),
|
|
8
|
+
prepareExternalAssociation: prepareExternalAssociation.bind(null, walletIframe),
|
|
8
9
|
associateExternalAuth: associateExternalAuth.bind(null, walletIframe),
|
|
9
10
|
removeExternalAuth: removeExternalAuth.bind(null, walletIframe),
|
|
10
11
|
unlock: unlock.bind(null, walletIframe),
|
|
@@ -24,6 +25,9 @@ async function prepareExternalAuth(walletIframe, walletId) {
|
|
|
24
25
|
async function associateExternalAuth(walletIframe, input) {
|
|
25
26
|
return (await walletIframe.requireRouter()).associateExternalAuth(input);
|
|
26
27
|
}
|
|
28
|
+
async function prepareExternalAssociation(walletIframe, walletId) {
|
|
29
|
+
return (await walletIframe.requireRouter()).prepareExternalAssociation(walletId);
|
|
30
|
+
}
|
|
27
31
|
async function removeExternalAuth(walletIframe, input) {
|
|
28
32
|
return (await walletIframe.requireRouter()).removeExternalAuth(input);
|
|
29
33
|
}
|
|
@@ -29,6 +29,11 @@ function walletForHostRequest(request, currentWalletId) {
|
|
|
29
29
|
return walletId === null ? null : requiredWallet(walletId);
|
|
30
30
|
}
|
|
31
31
|
case "PM_SCAN_AND_LINK_DEVICE": return currentWalletId === null ? null : requiredWallet(currentWalletId);
|
|
32
|
+
case "PM_OWNER_NEAR_TRANSACTION": return request.payload.action === "approve" ? requiredWallet(request.payload.authentication.walletId) : null;
|
|
33
|
+
case "PM_EXTERNAL_OWNER_AUTH": {
|
|
34
|
+
const command = request.payload;
|
|
35
|
+
return requiredWallet(command.action === "associate" ? command.input.walletId : command.walletId);
|
|
36
|
+
}
|
|
32
37
|
case "PM_SET_TRANSACTION_VIEW":
|
|
33
38
|
case "PM_TRANSACTION_BROADCAST_STARTED":
|
|
34
39
|
case "PING":
|
|
@@ -4,8 +4,8 @@ import { parseWalletSessionAuthorizationId, parseWalletSessionId } from "../../.
|
|
|
4
4
|
import { thresholdEcdsaChainTargetFromRequest } from "../../../core/signingEngine/interfaces/ecdsaChainTarget.js";
|
|
5
5
|
import "../../../shared-ts/src/device-linking/activeWalletSession.js";
|
|
6
6
|
import { parseWalletAuthAuthorityRef } from "../../../shared-ts/src/utils/walletAuthAuthority.js";
|
|
7
|
-
import { toAccountId } from "../../../core/types/accountIds.js";
|
|
8
7
|
import { isWalletAuthMethod } from "../../../shared-ts/src/utils/signerDomain.js";
|
|
8
|
+
import { toAccountId } from "../../../core/types/accountIds.js";
|
|
9
9
|
import { parseExternalWalletAuthentication, parseExternalWalletSettings } from "../../../shared-ts/src/auth/externalAuth.js";
|
|
10
10
|
import { NonceCoordinatorDegradationReason, NonceCoordinatorFallback, NonceLeaseState } from "../../../core/signingEngine/nonce/nonceTypes.js";
|
|
11
11
|
import { parseEcdsaThresholdKeyId } from "../../../core/signingEngine/session/keyMaterialBrands.js";
|
|
@@ -30,6 +30,9 @@ function parseWalletIframeExactSessionSnapshot(value) {
|
|
|
30
30
|
const state = parseWalletIframeExactSessionState(record.state);
|
|
31
31
|
if (state.kind !== "wallet_locked" && state.walletId !== walletId) throw new Error("Wallet session snapshot identity differs from its projection");
|
|
32
32
|
const session = parseWalletSessionFromBoundary(record.session, state.kind === "wallet_locked" ? void 0 : state.walletId);
|
|
33
|
+
if (state.kind === "external_read") {
|
|
34
|
+
if (session.authentication.kind !== "external_authenticated" || session.authentication.walletId !== state.walletId || session.authentication.sessionId !== state.externalSessionId || session.authentication.expiresAtMs !== state.expiresAtMs) throw new Error("External read snapshot differs from its authenticated session");
|
|
35
|
+
} else if (session.authentication.kind === "external_authenticated") throw new Error("External authentication requires an external read state");
|
|
33
36
|
if (state.kind === "wallet_locked" && (session.authentication.kind !== "signed_out" || session.appIdentity.kind !== "anonymous")) throw new Error("Locked wallet snapshot must publish an anonymous session");
|
|
34
37
|
return {
|
|
35
38
|
revision: parseWalletIframeSessionRevision(record.revision),
|
|
@@ -42,6 +45,17 @@ function parseWalletIframeExactSessionState(value) {
|
|
|
42
45
|
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error("Wallet iframe exact session state must be an object");
|
|
43
46
|
switch (Reflect.get(value, "kind")) {
|
|
44
47
|
case "wallet_locked": return { kind: "wallet_locked" };
|
|
48
|
+
case "external_read": {
|
|
49
|
+
const expiresAtMs = Reflect.get(value, "expiresAtMs");
|
|
50
|
+
if (!isPositiveSafeInteger(expiresAtMs)) throw new Error("External read expiry is invalid");
|
|
51
|
+
if ("walletSessionId" in value || "authorizationId" in value || "authMethod" in value) throw new Error("External read state cannot contain signing authority");
|
|
52
|
+
return {
|
|
53
|
+
kind: "external_read",
|
|
54
|
+
walletId: requireWalletId(Reflect.get(value, "walletId")),
|
|
55
|
+
externalSessionId: requireNonEmptyString(Reflect.get(value, "externalSessionId"), "externalSessionId"),
|
|
56
|
+
expiresAtMs
|
|
57
|
+
};
|
|
58
|
+
}
|
|
45
59
|
case "wallet_authenticated_identity_unresolvable": return {
|
|
46
60
|
kind: "wallet_authenticated_identity_unresolvable",
|
|
47
61
|
walletId: requireWalletId(Reflect.get(value, "walletId")),
|
|
@@ -470,7 +470,7 @@ function parseHostedAuthMenuOutcome(value) {
|
|
|
470
470
|
default: return null;
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
|
-
const WALLET_PROTOCOL_VERSION = "
|
|
473
|
+
const WALLET_PROTOCOL_VERSION = "19.0.0";
|
|
474
474
|
const WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH = "WALLET_IFRAME_PROTOCOL_VERSION_MISMATCH";
|
|
475
475
|
const HOSTED_WALLET_REDEMPTION_PAYLOAD_FIELDS = [
|
|
476
476
|
"home",
|