@dynamic-labs-sdk/client 1.17.1 → 1.19.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/dist/client/createDynamicClient/createDynamicClient.d.ts +11 -1
- package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
- package/dist/client/defaultClient/defaultClient.d.ts +12 -1
- package/dist/client/defaultClient/defaultClient.d.ts.map +1 -1
- package/dist/core.cjs +7 -5
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +6 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/APIError/APIError.d.ts +11 -1
- package/dist/errors/APIError/APIError.d.ts.map +1 -1
- package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts +26 -0
- package/dist/errors/DeviceRegistrationIdentityMismatchError.d.ts.map +1 -0
- package/dist/errors/MergeAccountsConfirmationError.d.ts +49 -0
- package/dist/errors/MergeAccountsConfirmationError.d.ts.map +1 -0
- package/dist/errors/UnsafeDeeplinkUrlError.d.ts +17 -0
- package/dist/errors/UnsafeDeeplinkUrlError.d.ts.map +1 -0
- package/dist/errors/UnsafeNavigationUrlError.d.ts +16 -0
- package/dist/errors/UnsafeNavigationUrlError.d.ts.map +1 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts +27 -0
- package/dist/errors/WalletScreeningBlockedError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +4 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +18 -3
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +2 -0
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CS4r9hi7.cjs → getNetworkProviderFromNetworkId-BJX2AMGR.cjs} +190 -19
- package/dist/getNetworkProviderFromNetworkId-BJX2AMGR.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js → getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js} +165 -10
- package/dist/getNetworkProviderFromNetworkId-Bsv12Q6B.native.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-pknqqhk1.esm.js → getNetworkProviderFromNetworkId-D3uwhdMN.esm.js} +166 -19
- package/dist/getNetworkProviderFromNetworkId-D3uwhdMN.esm.js.map +1 -0
- package/dist/{getSignedSessionId-cMGkmojJ.cjs → getSignedSessionId-BIZJGg61.cjs} +3 -3
- package/dist/{getSignedSessionId-cMGkmojJ.cjs.map → getSignedSessionId-BIZJGg61.cjs.map} +1 -1
- package/dist/{getSignedSessionId-CUw7LJ35.esm.js → getSignedSessionId-CnSAMO3P.esm.js} +3 -3
- package/dist/{getSignedSessionId-CUw7LJ35.esm.js.map → getSignedSessionId-CnSAMO3P.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js → getSignedSessionId-DXDi7NkE.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Cl3PEqa8.native.esm.js.map → getSignedSessionId-DXDi7NkE.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs → getWalletProviderByKey-C6aS7KgD.cjs} +2 -2
- package/dist/{getWalletProviderByKey-CP9Te5Sz.cjs.map → getWalletProviderByKey-C6aS7KgD.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js → getWalletProviderByKey-Cr8m-Nax.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-lQVfIGFi.esm.js.map → getWalletProviderByKey-Cr8m-Nax.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js → getWalletProviderByKey-DVk2t98D.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-24co0tBE.native.esm.js.map → getWalletProviderByKey-DVk2t98D.native.esm.js.map} +1 -1
- package/dist/index.cjs +950 -111
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +940 -112
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +867 -111
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-BwP1oowd.cjs → isDynamicWaasEnabled-BawttOeb.cjs} +21 -9
- package/dist/isDynamicWaasEnabled-BawttOeb.cjs.map +1 -0
- package/dist/{isDynamicWaasEnabled-BYaqAOml.esm.js → isDynamicWaasEnabled-DDrg89y1.esm.js} +20 -8
- package/dist/isDynamicWaasEnabled-DDrg89y1.esm.js.map +1 -0
- package/dist/{isDynamicWaasEnabled-BXe0VyI4.native.esm.js → isDynamicWaasEnabled-Dj_sLoBO.native.esm.js} +20 -8
- package/dist/isDynamicWaasEnabled-Dj_sLoBO.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-Btejc5g3.cjs → isMfaRequiredForAction-BuvyBN_r.cjs} +21 -6
- package/dist/isMfaRequiredForAction-BuvyBN_r.cjs.map +1 -0
- package/dist/{isMfaRequiredForAction-CqEcCTIe.esm.js → isMfaRequiredForAction-DTp4CZBt.esm.js} +21 -6
- package/dist/isMfaRequiredForAction-DTp4CZBt.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-Demz9zlH.native.esm.js → isMfaRequiredForAction-EY-OQORc.native.esm.js} +3 -5
- package/dist/isMfaRequiredForAction-EY-OQORc.native.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-C86NDY7I.cjs → isUserOnboardingComplete-CkyzRYrg.cjs} +14 -4
- package/dist/isUserOnboardingComplete-CkyzRYrg.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-CBrAH0ZF.esm.js → isUserOnboardingComplete-D3HrBYje.native.esm.js} +13 -3
- package/dist/isUserOnboardingComplete-D3HrBYje.native.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-Cr-YTpcU.native.esm.js → isUserOnboardingComplete-Dy2Ygp0u.esm.js} +13 -3
- package/dist/isUserOnboardingComplete-Dy2Ygp0u.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js → migrateFromFireblocks-B5qWGLCM.native.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-D-J6-gRo.native.esm.js.map → migrateFromFireblocks-B5qWGLCM.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-B_q8Oawb.cjs → migrateFromFireblocks-Dp-QA9hi.cjs} +3 -3
- package/dist/{migrateFromFireblocks-B_q8Oawb.cjs.map → migrateFromFireblocks-Dp-QA9hi.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js → migrateFromFireblocks-MAatsk_w.esm.js} +3 -3
- package/dist/{migrateFromFireblocks-Bbx2wHZD.esm.js.map → migrateFromFireblocks-MAatsk_w.esm.js.map} +1 -1
- package/dist/modules/apiClient/constants.d.ts +8 -0
- package/dist/modules/apiClient/constants.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +0 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +11 -2
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts +9 -0
- package/dist/modules/auth/isSignedIn/isSignedIn.d.ts.map +1 -1
- package/dist/modules/auth/logout/logout.d.ts +13 -0
- package/dist/modules/auth/logout/logout.d.ts.map +1 -1
- package/dist/modules/auth/logoutWithReason/logoutWithReason.d.ts.map +1 -1
- package/dist/modules/auth/mergeUserAccounts/index.d.ts +3 -0
- package/dist/modules/auth/mergeUserAccounts/index.d.ts.map +1 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +62 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts +78 -0
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.types.d.ts.map +1 -0
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +7 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +9 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts +8 -0
- package/dist/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts +34 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/clearSocialRedirectParams.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts +2 -0
- package/dist/modules/auth/social/oauth/clearSocialRedirectParams/index.d.ts.map +1 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts +11 -0
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts +0 -1
- package/dist/modules/auth/social/oauth/detectSocialRedirectUrl/detectSocialRedirectUrl.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts +12 -0
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts +10 -0
- package/dist/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +0 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
- package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts +37 -0
- package/dist/modules/captcha/CaptchaProviderEnum/CaptchaProviderEnum.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts +50 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts +22 -0
- package/dist/modules/captcha/getCaptchaSettings/getCaptchaSettings.types.d.ts.map +1 -0
- package/dist/modules/captcha/getCaptchaSettings/index.d.ts +3 -0
- package/dist/modules/captcha/getCaptchaSettings/index.d.ts.map +1 -0
- package/dist/modules/captcha/isCaptchaRequired/isCaptchaRequired.d.ts.map +1 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts +0 -1
- package/dist/modules/captcha/setCaptchaToken/setCaptchaToken.d.ts.map +1 -1
- package/dist/modules/clientEvents/clientEvents.d.ts +34 -0
- package/dist/modules/clientEvents/clientEvents.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts +35 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/clearDeviceRegistrationRedirectParams.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts +2 -0
- package/dist/modules/deviceRegistration/clearDeviceRegistrationRedirectParams/index.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +8 -1
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts +1 -0
- package/dist/modules/deviceRegistration/isDeviceRegistrationRequired/isDeviceRegistrationRequired.d.ts.map +1 -1
- package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts +9 -0
- package/dist/modules/flow/attachFlowSource/attachFlowSource.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts +9 -0
- package/dist/modules/flow/broadcastFlow/broadcastFlow.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/cancelFlow/cancelFlow.d.ts +10 -3
- package/dist/modules/flow/cancelFlow/cancelFlow.d.ts.map +1 -1
- package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts +8 -0
- package/dist/modules/flow/cancelFlow/cancelFlow.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/getFlow/getFlow.d.ts +11 -3
- package/dist/modules/flow/getFlow/getFlow.d.ts.map +1 -1
- package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts +16 -3
- package/dist/modules/flow/getFlowQuote/getFlowQuote.d.ts.map +1 -1
- package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts +9 -0
- package/dist/modules/flow/prepareFlowSigning/prepareFlowSigning.instrumentation.d.ts.map +1 -0
- package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts +9 -0
- package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.instrumentation.d.ts.map +1 -0
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts +0 -4
- package/dist/modules/funding/moonpay/getMoonPayUrl/getMoonPayUrl.d.ts.map +1 -1
- package/dist/modules/initializeClient/initializeClient.d.ts +16 -0
- package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
- package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts +12 -2
- package/dist/modules/initializeClient/waitForClientInitialized/waitForClientInitialized.d.ts.map +1 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts +0 -1
- package/dist/modules/mfa/consumeMfaToken/consumeMfaToken.d.ts.map +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +0 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts +1 -0
- package/dist/modules/mfa/isPendingRecoveryCodesAcknowledgment/isPendingRecoveryCodesAcknowledgment.d.ts.map +1 -1
- package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts +1 -0
- package/dist/modules/mfa/isUserMissingMfaAuth/isUserMissingMfaAuth.d.ts.map +1 -1
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts +0 -3
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts +14 -1
- package/dist/modules/otp/sendEmailOTP/sendEmailOTP.d.ts.map +1 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts +12 -1
- package/dist/modules/otp/sendSmsOTP/sendSmsOTP.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +33 -2
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.d.ts.map +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts +8 -0
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts +28 -0
- package/dist/modules/user/checkUserScopes/checkUserScopes.d.ts.map +1 -0
- package/dist/modules/user/checkUserScopes/index.d.ts +2 -0
- package/dist/modules/user/checkUserScopes/index.d.ts.map +1 -0
- package/dist/modules/user/deleteUser/deleteUser.d.ts +8 -0
- package/dist/modules/user/deleteUser/deleteUser.d.ts.map +1 -1
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts +9 -1
- package/dist/modules/user/isUserOnboardingComplete/isUserOnboardingComplete.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +17 -4
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/user/refreshUser/refreshUser.d.ts +16 -3
- package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
- package/dist/modules/user/updateUser/updateUser.d.ts +0 -1
- package/dist/modules/user/updateUser/updateUser.d.ts.map +1 -1
- package/dist/modules/user/user.types.d.ts +9 -1
- package/dist/modules/user/user.types.d.ts.map +1 -1
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts +30 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/getEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
- package/dist/modules/waas/getEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts +23 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/hasEmbeddedWalletsRequiringUpgrade.d.ts.map +1 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts +2 -0
- package/dist/modules/waas/hasEmbeddedWalletsRequiringUpgrade/index.d.ts.map +1 -0
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts +11 -1
- package/dist/modules/wallets/connectAndVerifyWithWalletProvider/connectAndVerifyWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +11 -3
- package/dist/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
- package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts +16 -3
- package/dist/modules/wallets/disconnectWalletAccount/disconnectWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts +9 -1
- package/dist/modules/wallets/getConnectedAddresses/getConnectedAddresses.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts +11 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts +2 -1
- package/dist/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts.map +1 -1
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts +9 -0
- package/dist/modules/wallets/isAnyWalletAccountConnected/isAnyWalletAccountConnected.d.ts.map +1 -1
- package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +10 -2
- package/dist/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts +8 -0
- package/dist/modules/wallets/networks/getBalance/getBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts +8 -0
- package/dist/modules/wallets/networks/getNativeBalance/getNativeBalance.d.ts.map +1 -1
- package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts +11 -1
- package/dist/modules/wallets/networks/switchActiveNetwork/switchActiveNetwork.d.ts.map +1 -1
- package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +10 -0
- package/dist/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts +9 -1
- package/dist/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +24 -0
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getPrimaryWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts +30 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/getSelectedWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts +2 -0
- package/dist/modules/wallets/selectedWalletAccount/getSelectedWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +28 -0
- package/dist/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts +2 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/index.d.ts.map +1 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts +34 -0
- package/dist/modules/wallets/selectedWalletAccount/setSelectedWalletAccount/setSelectedWalletAccount.d.ts.map +1 -0
- package/dist/modules/wallets/signMessage/signMessage.d.ts +12 -1
- package/dist/modules/wallets/signMessage/signMessage.d.ts.map +1 -1
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts +13 -2
- package/dist/modules/wallets/transferAmount/transferAmount.d.ts.map +1 -1
- package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts +10 -1
- package/dist/modules/wallets/transferWalletAccount/transferWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts +11 -1
- package/dist/modules/wallets/utils/getWalletAccountFromAddress/getWalletAccountFromAddress.d.ts.map +1 -1
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +3 -0
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +12 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
- package/dist/services/instrumentation/createInstrumentation/createInstrumentation.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts +40 -34
- package/dist/services/instrumentation/instrumentFunction/instrumentFunction.d.ts.map +1 -1
- package/dist/services/instrumentation/instrumentation.types.d.ts +50 -19
- package/dist/services/instrumentation/instrumentation.types.d.ts.map +1 -1
- package/dist/services/keychain/createKeychainService/createKeychainService.d.ts.map +1 -1
- package/dist/services/navigate/createNavigationHandler/createNavigationHandler.d.ts.map +1 -1
- package/dist/services/openDeeplink/createWebDeeplinkOpener/createWebDeeplinkOpener.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js → updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js} +235 -159
- package/dist/updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-azIi_3FB.esm.js → updateAuthFromVerifyResponse-_oYRLK_w.esm.js} +235 -159
- package/dist/updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-CElYpi97.cjs → updateAuthFromVerifyResponse-pgYXvDvj.cjs} +241 -159
- package/dist/updateAuthFromVerifyResponse-pgYXvDvj.cjs.map +1 -0
- package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts +12 -0
- package/dist/utils/assertSafeDeeplinkUrl/assertSafeDeeplinkUrl.d.ts.map +1 -0
- package/dist/utils/assertSafeDeeplinkUrl/index.d.ts +2 -0
- package/dist/utils/assertSafeDeeplinkUrl/index.d.ts.map +1 -0
- package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts +12 -0
- package/dist/utils/assertSafeNavigationUrl/assertSafeNavigationUrl.d.ts.map +1 -0
- package/dist/utils/assertSafeNavigationUrl/index.d.ts +2 -0
- package/dist/utils/assertSafeNavigationUrl/index.d.ts.map +1 -0
- package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts +18 -0
- package/dist/utils/getSecureCookieAttribute/getSecureCookieAttribute.d.ts.map +1 -0
- package/dist/utils/getSecureCookieAttribute/index.d.ts +2 -0
- package/dist/utils/getSecureCookieAttribute/index.d.ts.map +1 -0
- package/dist/waas.cjs +72 -5
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +70 -5
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +70 -5
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +6 -6
- package/dist/waasCore.esm.js +6 -6
- package/dist/waasCore.native.esm.js +6 -6
- package/package.json +3 -3
- package/dist/getNetworkProviderFromNetworkId-Bfg-NkNJ.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CS4r9hi7.cjs.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-pknqqhk1.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BXe0VyI4.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BYaqAOml.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-BwP1oowd.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-Btejc5g3.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-CqEcCTIe.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-Demz9zlH.native.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-C86NDY7I.cjs.map +0 -1
- package/dist/isUserOnboardingComplete-CBrAH0ZF.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-Cr-YTpcU.native.esm.js.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts +0 -10
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/getPrimaryWalletAccount.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/getPrimaryWalletAccount/index.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/index.d.ts.map +0 -1
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts +0 -12
- package/dist/modules/wallets/primaryWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.d.ts.map +0 -1
- package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts +0 -28
- package/dist/services/instrumentation/instrumentFunction/extractParams/extractParams.d.ts.map +0 -1
- package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts +0 -15
- package/dist/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.d.ts.map +0 -1
- package/dist/updateAuthFromVerifyResponse-CElYpi97.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-D1w-Aw9P.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-azIi_3FB.esm.js.map +0 -1
- /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/getPrimaryWalletAccount/index.d.ts +0 -0
- /package/dist/modules/wallets/{primaryWalletAccount → selectedWalletAccount}/selectPrimaryWalletAccount/index.d.ts +0 -0
|
@@ -2,7 +2,7 @@ import { AuthStorageEnum, Configuration, JwtVerifiedCredentialFormatEnum, SDKApi
|
|
|
2
2
|
|
|
3
3
|
//#region package.json
|
|
4
4
|
var name = "@dynamic-labs-sdk/client";
|
|
5
|
-
var version = "1.
|
|
5
|
+
var version = "1.19.0";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"@dynamic-labs-sdk/assert-package-version": "workspace:*",
|
|
8
8
|
"@dynamic-labs-wallet/browser-wallet-client": "1.0.46",
|
|
@@ -108,6 +108,17 @@ let numOfInitializedClients = 0;
|
|
|
108
108
|
*
|
|
109
109
|
* If more than one instance of DynamicClient was initialized, you should not use this function.
|
|
110
110
|
* Instead, you should pass the client instance you stored to the function that needs it.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* const client = getDefaultClient();
|
|
115
|
+
* console.log('User:', client.user);
|
|
116
|
+
* ```
|
|
117
|
+
*
|
|
118
|
+
* @returns The default DynamicClient instance.
|
|
119
|
+
* @throws ClientNotFoundError If no client has been initialized yet.
|
|
120
|
+
* @see createDynamicClient
|
|
121
|
+
* @see initializeClient
|
|
111
122
|
* @notInstrumented
|
|
112
123
|
*/
|
|
113
124
|
const getDefaultClient = () => {
|
|
@@ -136,8 +147,28 @@ const MFA_TOKEN_HEADER = "x-mfa-auth-token";
|
|
|
136
147
|
const SESSION_PUBLIC_KEY_HEADER = "x-dyn-session-public-key";
|
|
137
148
|
const DYNAMIC_SDK_API_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
|
|
138
149
|
const DYNAMIC_SDK_SESSION_ID_HEADER = "x-dyn-session-id";
|
|
150
|
+
/**
|
|
151
|
+
* Reports the runtime platform (`web` or `react-native`) to the Dynamic API.
|
|
152
|
+
*
|
|
153
|
+
* Named `x-dynamic-platform` (not `x-dyn-*`) to match the header the legacy
|
|
154
|
+
* webview-controller already sends, so the backend receives a consistent
|
|
155
|
+
* platform signal across SDK generations.
|
|
156
|
+
*/
|
|
157
|
+
const DYNAMIC_PLATFORM_HEADER = "x-dynamic-platform";
|
|
139
158
|
const CLIENT_SDK_NAME = "ClientSDK";
|
|
140
159
|
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/utils/getPlatform/getPlatform.ts
|
|
162
|
+
/**
|
|
163
|
+
* Returns the platform the SDK is running on.
|
|
164
|
+
*
|
|
165
|
+
* This is the web implementation — the React Native bundler resolves
|
|
166
|
+
* `getPlatform.native.ts` instead when building for React Native, which
|
|
167
|
+
* returns `'react-native'`.
|
|
168
|
+
* @notInstrumented
|
|
169
|
+
*/
|
|
170
|
+
const getPlatform = () => "web";
|
|
171
|
+
|
|
141
172
|
//#endregion
|
|
142
173
|
//#region src/utils/randomString/randomString.ts
|
|
143
174
|
const DEFAULT_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
@@ -256,7 +287,17 @@ const getSessionKeys = (client) => {
|
|
|
256
287
|
//#region src/errors/APIError/APIError.ts
|
|
257
288
|
var APIError = class APIError extends BaseError {
|
|
258
289
|
status;
|
|
259
|
-
|
|
290
|
+
/**
|
|
291
|
+
* The `payload` object from the API error response body, when present.
|
|
292
|
+
*
|
|
293
|
+
* Some error responses carry structured context beyond the `error`/`code`
|
|
294
|
+
* pair (e.g. `merge_accounts_confirmation` returns the field-level merge
|
|
295
|
+
* conflicts under `payload.mergeConflicts`). It is preserved here so that
|
|
296
|
+
* downstream error mappers can surface that context as typed errors instead
|
|
297
|
+
* of discarding it.
|
|
298
|
+
*/
|
|
299
|
+
payload;
|
|
300
|
+
constructor(message, code, status, payload) {
|
|
260
301
|
super({
|
|
261
302
|
cause: null,
|
|
262
303
|
code,
|
|
@@ -265,13 +306,15 @@ var APIError = class APIError extends BaseError {
|
|
|
265
306
|
shortMessage: message
|
|
266
307
|
});
|
|
267
308
|
this.status = status;
|
|
309
|
+
this.payload = payload;
|
|
268
310
|
}
|
|
269
311
|
static async fromResponse(response) {
|
|
270
312
|
try {
|
|
271
313
|
const errorBody = await response.clone().json();
|
|
272
314
|
if (errorBody && "error" in errorBody && typeof errorBody.error === "string") {
|
|
273
315
|
const errorCode = "code" in errorBody && typeof errorBody.code === "string" ? errorBody.code : "unknown_error";
|
|
274
|
-
|
|
316
|
+
const payload = "payload" in errorBody && typeof errorBody.payload === "object" && errorBody.payload !== null ? errorBody.payload : void 0;
|
|
317
|
+
return new APIError(errorBody.error, errorCode, response.status, payload);
|
|
275
318
|
}
|
|
276
319
|
return null;
|
|
277
320
|
} catch {
|
|
@@ -544,6 +587,7 @@ const createApiClient = (options = {}, client) => {
|
|
|
544
587
|
headers: {
|
|
545
588
|
"Content-Type": "application/json",
|
|
546
589
|
[DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
|
|
590
|
+
[DYNAMIC_PLATFORM_HEADER]: getPlatform(),
|
|
547
591
|
[DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
|
|
548
592
|
[DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
|
|
549
593
|
[DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
|
|
@@ -616,6 +660,28 @@ const fetchAndStoreNonces = async (client) => {
|
|
|
616
660
|
return fetchPromise;
|
|
617
661
|
};
|
|
618
662
|
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/utils/getSecureCookieAttribute/getSecureCookieAttribute.ts
|
|
665
|
+
/**
|
|
666
|
+
* Returns the cookie `Secure` attribute suffix (`'; Secure'`) when the current
|
|
667
|
+
* document is running in a secure context, or an empty string otherwise.
|
|
668
|
+
*
|
|
669
|
+
* The `Secure` attribute prevents the browser from ever transmitting the cookie
|
|
670
|
+
* over an unencrypted `http://` connection, which mitigates cleartext token
|
|
671
|
+
* capture (CWE-614). It is intentionally omitted on insecure/localhost dev,
|
|
672
|
+
* because browsers reject `Secure` cookies set over `http://` and that would
|
|
673
|
+
* silently break local testing.
|
|
674
|
+
*
|
|
675
|
+
* Used when building the Dynamic auth JWT cookie string so the attribute is
|
|
676
|
+
* applied consistently on both the write (sign-in/refresh) and clear (logout)
|
|
677
|
+
* paths.
|
|
678
|
+
*
|
|
679
|
+
* @notInstrumented
|
|
680
|
+
*/
|
|
681
|
+
const getSecureCookieAttribute = () => {
|
|
682
|
+
return Boolean(globalThis.window?.isSecureContext) || globalThis.location?.protocol === "https:" ? "; Secure" : "";
|
|
683
|
+
};
|
|
684
|
+
|
|
619
685
|
//#endregion
|
|
620
686
|
//#region src/utils/setCookie/setCookie.ts
|
|
621
687
|
/**
|
|
@@ -634,10 +700,25 @@ const setCookie = (cookie) => {
|
|
|
634
700
|
* This function allows you to listen for various events emitted by the Dynamic client,
|
|
635
701
|
* such as authentication state changes, wallet connections, and more.
|
|
636
702
|
*
|
|
703
|
+
* @example
|
|
704
|
+
* ```ts
|
|
705
|
+
* const unsubscribe = onEvent({
|
|
706
|
+
* event: 'walletAdded',
|
|
707
|
+
* listener: ({ walletAccount }) => {
|
|
708
|
+
* console.log('Wallet added:', walletAccount.address);
|
|
709
|
+
* },
|
|
710
|
+
* });
|
|
711
|
+
*
|
|
712
|
+
* // Later: clean up
|
|
713
|
+
* unsubscribe();
|
|
714
|
+
* ```
|
|
715
|
+
*
|
|
637
716
|
* @param params.event - The event name to listen for.
|
|
638
717
|
* @param params.listener - The callback function to execute when the event is fired.
|
|
639
718
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
640
719
|
* @returns A function that can be called to remove the listener.
|
|
720
|
+
* @see offEvent
|
|
721
|
+
* @see onceEvent
|
|
641
722
|
* @notInstrumented
|
|
642
723
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
643
724
|
*/
|
|
@@ -654,9 +735,16 @@ const onEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
|
654
735
|
* This function unsubscribes a previously registered event listener
|
|
655
736
|
* from the specified Dynamic client event.
|
|
656
737
|
*
|
|
738
|
+
* @example
|
|
739
|
+
* ```ts
|
|
740
|
+
* offEvent({ event: 'walletAdded', listener: myListener });
|
|
741
|
+
* ```
|
|
742
|
+
*
|
|
657
743
|
* @param params.event - The event name to remove the listener from.
|
|
658
744
|
* @param params.listener - The callback function to remove.
|
|
659
745
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
746
|
+
* @see onEvent
|
|
747
|
+
* @see onceEvent
|
|
660
748
|
* @notInstrumented
|
|
661
749
|
*/
|
|
662
750
|
const offEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
@@ -669,10 +757,22 @@ const offEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
|
669
757
|
* This function listens for an event that will automatically remove itself
|
|
670
758
|
* after being triggered once.
|
|
671
759
|
*
|
|
760
|
+
* @example
|
|
761
|
+
* ```ts
|
|
762
|
+
* onceEvent({
|
|
763
|
+
* event: 'logout',
|
|
764
|
+
* listener: () => {
|
|
765
|
+
* console.log('User logged out');
|
|
766
|
+
* },
|
|
767
|
+
* });
|
|
768
|
+
* ```
|
|
769
|
+
*
|
|
672
770
|
* @param params.event - The event name to listen for.
|
|
673
771
|
* @param params.listener - The callback function to execute when the event is fired.
|
|
674
772
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
675
773
|
* @returns A function that can be called to remove the listener before it fires.
|
|
774
|
+
* @see onEvent
|
|
775
|
+
* @see offEvent
|
|
676
776
|
* @notInstrumented
|
|
677
777
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
678
778
|
*/
|
|
@@ -994,8 +1094,18 @@ const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client)
|
|
|
994
1094
|
* You can differentiate between verified and unverified wallet accounts by
|
|
995
1095
|
* checking the `verifiedCredentialId` property.
|
|
996
1096
|
*
|
|
1097
|
+
* @example
|
|
1098
|
+
* ```ts
|
|
1099
|
+
* const wallets = getWalletAccounts();
|
|
1100
|
+
* const verified = wallets.filter((walletAccount) =>
|
|
1101
|
+
* isWalletAccountVerified({ walletAccount }),
|
|
1102
|
+
* );
|
|
1103
|
+
* ```
|
|
1104
|
+
*
|
|
997
1105
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
998
1106
|
* @returns An array of wallet accounts associated with the session.
|
|
1107
|
+
* @see isWalletAccountVerified
|
|
1108
|
+
* @see verifyWalletAccount
|
|
999
1109
|
* @notInstrumented
|
|
1000
1110
|
* @hook Exposed as a hook so consumers get the reactive list of wallet accounts.
|
|
1001
1111
|
*/
|
|
@@ -1214,18 +1324,6 @@ const getOperatingSystem = () => {
|
|
|
1214
1324
|
}
|
|
1215
1325
|
};
|
|
1216
1326
|
|
|
1217
|
-
//#endregion
|
|
1218
|
-
//#region src/utils/getPlatform/getPlatform.ts
|
|
1219
|
-
/**
|
|
1220
|
-
* Returns the platform the SDK is running on.
|
|
1221
|
-
*
|
|
1222
|
-
* This is the web implementation — the React Native bundler resolves
|
|
1223
|
-
* `getPlatform.native.ts` instead when building for React Native, which
|
|
1224
|
-
* returns `'react-native'`.
|
|
1225
|
-
* @notInstrumented
|
|
1226
|
-
*/
|
|
1227
|
-
const getPlatform = () => "web";
|
|
1228
|
-
|
|
1229
1327
|
//#endregion
|
|
1230
1328
|
//#region src/utils/getUserAgent/getUserAgent.ts
|
|
1231
1329
|
/**
|
|
@@ -1416,193 +1514,170 @@ const scrubParameters = ({ piiFields, redactAll, value }) => {
|
|
|
1416
1514
|
});
|
|
1417
1515
|
};
|
|
1418
1516
|
|
|
1419
|
-
//#endregion
|
|
1420
|
-
//#region src/services/instrumentation/instrumentFunction/extractParams/extractParams.ts
|
|
1421
|
-
/**
|
|
1422
|
-
* Normalises the raw positional arguments of an instrumented function call
|
|
1423
|
-
* into a flat `Record<string, unknown>` suitable for structured logging.
|
|
1424
|
-
*
|
|
1425
|
-
* ## Why this is needed
|
|
1426
|
-
*
|
|
1427
|
-
* Instrumented functions are wrapped with `(...args: unknown[])`, so their
|
|
1428
|
-
* parameters arrive as an array. Logging a raw array loses the semantic names
|
|
1429
|
-
* of each argument. This function recovers a named representation:
|
|
1430
|
-
*
|
|
1431
|
-
* - **No arguments** → `{}`
|
|
1432
|
-
* - **Single plain-object argument** → that object is returned as-is, because
|
|
1433
|
-
* SDK functions follow the single-object-parameter convention, so the object
|
|
1434
|
-
* already carries named keys (`{ amount, to }`, etc.).
|
|
1435
|
-
* - **Everything else** (multiple args, a single primitive, a single array) →
|
|
1436
|
-
* each value is indexed as `arg0`, `arg1`, …
|
|
1437
|
-
*
|
|
1438
|
-
* ## Why arrays are NOT treated as plain objects
|
|
1439
|
-
*
|
|
1440
|
-
* `typeof [] === 'object'` and `[] !== null`, so without the `Array.isArray`
|
|
1441
|
-
* guard a single-array argument would be returned as-is. That would produce
|
|
1442
|
-
* an object with numeric string keys (`{ '0': ..., '1': ... }`), which is
|
|
1443
|
-
* misleading and inconsistent with how multi-arg calls are handled. Instead,
|
|
1444
|
-
* arrays fall through to the indexed `arg0` path.
|
|
1445
|
-
* @notInstrumented
|
|
1446
|
-
*/
|
|
1447
|
-
const extractParams = (args) => {
|
|
1448
|
-
if (args.length === 0) return {};
|
|
1449
|
-
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0])) return args[0];
|
|
1450
|
-
const result = {};
|
|
1451
|
-
for (let i = 0; i < args.length; i++) result[`arg${i}`] = args[i];
|
|
1452
|
-
return result;
|
|
1453
|
-
};
|
|
1454
|
-
|
|
1455
|
-
//#endregion
|
|
1456
|
-
//#region src/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.ts
|
|
1457
|
-
/**
|
|
1458
|
-
* Scrubs a resolved return value of any type before logging it.
|
|
1459
|
-
* Routes through `scrubParameters` by wrapping the value so that strings,
|
|
1460
|
-
* arrays, Dates, Errors, and all other types are handled identically to
|
|
1461
|
-
* nested object fields.
|
|
1462
|
-
* @notInstrumented
|
|
1463
|
-
*/
|
|
1464
|
-
const scrubResolvedValue = ({ piiFields, redactAll, value }) => scrubParameters({
|
|
1465
|
-
piiFields,
|
|
1466
|
-
redactAll,
|
|
1467
|
-
value: { result: value }
|
|
1468
|
-
}).result;
|
|
1469
|
-
|
|
1470
1517
|
//#endregion
|
|
1471
1518
|
//#region src/services/instrumentation/instrumentFunction/instrumentFunction.ts
|
|
1472
|
-
const
|
|
1473
|
-
if (error instanceof
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
stack: error.stack
|
|
1519
|
+
const toErrorFields = (error) => {
|
|
1520
|
+
if (error instanceof BaseError) return {
|
|
1521
|
+
errorCode: error.code,
|
|
1522
|
+
errorName: error.name
|
|
1477
1523
|
};
|
|
1524
|
+
if (error instanceof Error) return { errorName: error.name };
|
|
1525
|
+
return { errorName: "UnknownError" };
|
|
1526
|
+
};
|
|
1527
|
+
const buildContext = (core) => {
|
|
1528
|
+
const state = core.state.get();
|
|
1478
1529
|
return {
|
|
1479
|
-
|
|
1480
|
-
|
|
1530
|
+
environmentId: core.environmentId,
|
|
1531
|
+
operatingSystem: getOperatingSystem(),
|
|
1532
|
+
platform: getPlatform(),
|
|
1533
|
+
registeredExtensionKeys: Array.from(core.extensions),
|
|
1534
|
+
sdkSessionId: core.sdkSessionId,
|
|
1535
|
+
sdkVersion: core.version,
|
|
1536
|
+
tokenSessionId: state.token ? extractSessionId(state.token) : null,
|
|
1537
|
+
userAgent: getUserAgent(),
|
|
1538
|
+
userId: state.user?.id ?? null
|
|
1481
1539
|
};
|
|
1482
1540
|
};
|
|
1483
1541
|
/**
|
|
1542
|
+
* Runs an explicit payload selector and scrubs its output. Returns `undefined`
|
|
1543
|
+
* when there is no selector. Selector (and scrub) errors are swallowed so a
|
|
1544
|
+
* faulty selector can never break the wrapped function or fabricate a
|
|
1545
|
+
* 'rejected' event — instrumentation stays purely observational. The swallowed
|
|
1546
|
+
* error is surfaced on the `debug` logger so internal devs can still spot a
|
|
1547
|
+
* broken selector without it ever reaching a transport.
|
|
1548
|
+
*/
|
|
1549
|
+
const safeSelect = ({ functionName, logger, piiFields, selector, value }) => {
|
|
1550
|
+
if (!selector) return;
|
|
1551
|
+
try {
|
|
1552
|
+
return scrubParameters({
|
|
1553
|
+
piiFields,
|
|
1554
|
+
value: selector(value)
|
|
1555
|
+
});
|
|
1556
|
+
} catch (error) {
|
|
1557
|
+
logger.debug(`[instrumentFunction] payload selector for "${functionName}" threw; emitting event without payload`, error);
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
/**
|
|
1484
1562
|
* Wraps a function so that each invocation emits a structured
|
|
1485
1563
|
* `FunctionInstrumentationEvent` at three lifecycle points:
|
|
1486
1564
|
*
|
|
1487
|
-
* - **started** — immediately before the function body executes
|
|
1488
|
-
* PII-scrubbed call parameters.
|
|
1565
|
+
* - **started** — immediately before the function body executes.
|
|
1489
1566
|
* - **resolved** — after the function (or its returned Promise) settles
|
|
1490
|
-
* successfully, with the
|
|
1567
|
+
* successfully, with the call duration.
|
|
1491
1568
|
* - **rejected** — if the function throws synchronously or its returned
|
|
1492
|
-
* Promise rejects.
|
|
1569
|
+
* Promise rejects, with the duration and the error's class name/code.
|
|
1570
|
+
*
|
|
1571
|
+
* Events carry only the safe envelope (function name, phase, timing, error
|
|
1572
|
+
* class, SDK/runtime metadata, identifiers). **Raw arguments and return values
|
|
1573
|
+
* are never captured.** A function that needs additional fields supplies
|
|
1574
|
+
* `selectors` that build an explicit, primitive-only {@link SafePayload} — the
|
|
1575
|
+
* only path from arguments/return value into a log.
|
|
1493
1576
|
*
|
|
1494
1577
|
* The original return value (or thrown error) is always forwarded to the
|
|
1495
|
-
* caller unchanged — instrumentation is purely observational
|
|
1578
|
+
* caller unchanged — instrumentation is purely observational, and a throwing
|
|
1579
|
+
* selector cannot change that.
|
|
1580
|
+
*
|
|
1581
|
+
* ## Providing selectors
|
|
1496
1582
|
*
|
|
1497
|
-
*
|
|
1583
|
+
* A function opts into a payload by supplying selectors that map its arguments
|
|
1584
|
+
* (`started`) and/or its awaited return value (`resolved`) to a primitive-only
|
|
1585
|
+
* {@link SafePayload}. Pick individual known-safe fields — never spread a whole
|
|
1586
|
+
* object, which is exactly what the model prevents.
|
|
1498
1587
|
*
|
|
1499
1588
|
* ```ts
|
|
1500
1589
|
* const transfer = instrumentFunction({
|
|
1501
1590
|
* fn: rawTransfer,
|
|
1502
1591
|
* functionName: 'transfer',
|
|
1503
1592
|
* getCore: () => core,
|
|
1593
|
+
* selectors: {
|
|
1594
|
+
* // `args` is the argument tuple the wrapped function was called with.
|
|
1595
|
+
* started: ([{ chainId, amount }]) => ({ amount, chainId }),
|
|
1596
|
+
* // `result` is the awaited return value (never the Promise).
|
|
1597
|
+
* resolved: ({ txHash }) => ({ txHash }),
|
|
1598
|
+
* },
|
|
1504
1599
|
* });
|
|
1505
|
-
*
|
|
1506
|
-
* // When called, three events are emitted automatically:
|
|
1507
|
-
* await transfer({ amount: 1, to: '0xabc' });
|
|
1508
1600
|
* ```
|
|
1509
1601
|
*
|
|
1602
|
+
* A selector that throws (or whose output fails scrubbing) is swallowed: the
|
|
1603
|
+
* event is still emitted without a payload, and the error is logged at `debug`.
|
|
1604
|
+
*
|
|
1510
1605
|
* ## How functions are wrapped
|
|
1511
1606
|
*
|
|
1512
|
-
* `instrumentFunction` is not called manually in application code.
|
|
1513
|
-
*
|
|
1514
|
-
*
|
|
1515
|
-
* JSDoc is automatically wrapped by the plugin during the build step.
|
|
1516
|
-
* The plugin strips the original `export`, renames the function, and re-exports
|
|
1517
|
-
* it under the original name via `instrumentFunction(...)` — so the public API
|
|
1518
|
-
* is unchanged and no call sites need to be updated.
|
|
1607
|
+
* `instrumentFunction` is not called manually in application code. The esbuild
|
|
1608
|
+
* instrumentation plugin (`tools/instrumentation-plugin`) injects it at build
|
|
1609
|
+
* time for any exported function annotated with `@instrumented` in its JSDoc.
|
|
1519
1610
|
*
|
|
1520
1611
|
* ## Opting out
|
|
1521
1612
|
*
|
|
1522
|
-
* Instrumentation is skipped entirely when
|
|
1523
|
-
*
|
|
1524
|
-
*
|
|
1525
|
-
*
|
|
1526
|
-
* In both cases the original function is called directly with no overhead.
|
|
1527
|
-
*
|
|
1528
|
-
* ## PII scrubbing
|
|
1529
|
-
*
|
|
1530
|
-
* All string values whose key appears in `piiFields` are replaced with
|
|
1531
|
-
* `"[redacted]"` before events are emitted. Pass `redactAll: true` to redact
|
|
1532
|
-
* every field, regardless of key name.
|
|
1613
|
+
* Instrumentation is skipped entirely when `getCore()` returns `undefined`
|
|
1614
|
+
* (SDK not initialised) or when `core.instrumentation.config.enabled` is
|
|
1615
|
+
* `false`; in both cases the original function is called directly.
|
|
1533
1616
|
* @notInstrumented
|
|
1534
1617
|
*/
|
|
1535
|
-
const instrumentFunction = ({ fn, functionName, getCore: getCore$1,
|
|
1618
|
+
const instrumentFunction = ({ fn, functionName, getCore: getCore$1, selectors }) => {
|
|
1536
1619
|
const wrapped = (...args) => {
|
|
1537
1620
|
const core = getCore$1();
|
|
1538
|
-
if (!core) return fn(...args);
|
|
1539
|
-
|
|
1540
|
-
const
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
functionName,
|
|
1545
|
-
operatingSystem: getOperatingSystem(),
|
|
1546
|
-
parameters: scrubParameters({
|
|
1547
|
-
piiFields: instrumentation.config.piiFields,
|
|
1548
|
-
redactAll,
|
|
1549
|
-
value: extractParams(args)
|
|
1550
|
-
}),
|
|
1551
|
-
platform: getPlatform(),
|
|
1552
|
-
registeredExtensionKeys: Array.from(core.extensions),
|
|
1553
|
-
sdkSessionId: core.sdkSessionId,
|
|
1554
|
-
sdkVersion: core.version,
|
|
1555
|
-
status: "info",
|
|
1556
|
-
tokenSessionId: state.token ? extractSessionId(state.token) : null,
|
|
1557
|
-
userAgent: getUserAgent(),
|
|
1558
|
-
userId: state.user?.id ?? null
|
|
1621
|
+
if (!core?.instrumentation.config.enabled) return fn(...args);
|
|
1622
|
+
const { instrumentation, logger } = core;
|
|
1623
|
+
const { piiFields } = instrumentation.config;
|
|
1624
|
+
const base = {
|
|
1625
|
+
...buildContext(core),
|
|
1626
|
+
functionName
|
|
1559
1627
|
};
|
|
1628
|
+
const startedAt = Date.now();
|
|
1560
1629
|
instrumentation.logFunction({
|
|
1561
|
-
...
|
|
1630
|
+
...base,
|
|
1631
|
+
payload: safeSelect({
|
|
1632
|
+
functionName,
|
|
1633
|
+
logger,
|
|
1634
|
+
piiFields,
|
|
1635
|
+
selector: selectors?.started,
|
|
1636
|
+
value: args
|
|
1637
|
+
}),
|
|
1562
1638
|
phase: "started",
|
|
1639
|
+
status: "info",
|
|
1563
1640
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1564
1641
|
});
|
|
1565
|
-
|
|
1566
|
-
const result = fn(...args);
|
|
1567
|
-
if (result instanceof Promise) return result.then((value) => {
|
|
1568
|
-
instrumentation.logFunction({
|
|
1569
|
-
...baseEvent,
|
|
1570
|
-
phase: "resolved",
|
|
1571
|
-
resolvedValue: scrubResolvedValue({
|
|
1572
|
-
piiFields: instrumentation.config.piiFields,
|
|
1573
|
-
redactAll,
|
|
1574
|
-
value
|
|
1575
|
-
}),
|
|
1576
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1577
|
-
});
|
|
1578
|
-
return value;
|
|
1579
|
-
}).catch((error) => {
|
|
1580
|
-
instrumentation.logFunction({
|
|
1581
|
-
...baseEvent,
|
|
1582
|
-
phase: "rejected",
|
|
1583
|
-
rejectedError: serializeError(error),
|
|
1584
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1585
|
-
});
|
|
1586
|
-
throw error;
|
|
1587
|
-
});
|
|
1642
|
+
const emitResolved = (value) => {
|
|
1588
1643
|
instrumentation.logFunction({
|
|
1589
|
-
...
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1644
|
+
...base,
|
|
1645
|
+
durationMs: Date.now() - startedAt,
|
|
1646
|
+
payload: safeSelect({
|
|
1647
|
+
functionName,
|
|
1648
|
+
logger,
|
|
1649
|
+
piiFields,
|
|
1650
|
+
selector: selectors?.resolved,
|
|
1651
|
+
value
|
|
1595
1652
|
}),
|
|
1653
|
+
phase: "resolved",
|
|
1654
|
+
status: "info",
|
|
1596
1655
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1597
1656
|
});
|
|
1598
|
-
|
|
1599
|
-
|
|
1657
|
+
};
|
|
1658
|
+
const emitRejected = (error) => {
|
|
1600
1659
|
instrumentation.logFunction({
|
|
1601
|
-
...
|
|
1660
|
+
...base,
|
|
1661
|
+
...toErrorFields(error),
|
|
1662
|
+
durationMs: Date.now() - startedAt,
|
|
1602
1663
|
phase: "rejected",
|
|
1603
|
-
|
|
1664
|
+
status: "error",
|
|
1604
1665
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1605
1666
|
});
|
|
1667
|
+
};
|
|
1668
|
+
try {
|
|
1669
|
+
const result = fn(...args);
|
|
1670
|
+
if (result instanceof Promise) return result.then((value) => {
|
|
1671
|
+
emitResolved(value);
|
|
1672
|
+
return value;
|
|
1673
|
+
}, (error) => {
|
|
1674
|
+
emitRejected(error);
|
|
1675
|
+
throw error;
|
|
1676
|
+
});
|
|
1677
|
+
emitResolved(result);
|
|
1678
|
+
return result;
|
|
1679
|
+
} catch (error) {
|
|
1680
|
+
emitRejected(error);
|
|
1606
1681
|
throw error;
|
|
1607
1682
|
}
|
|
1608
1683
|
};
|
|
@@ -1647,6 +1722,7 @@ const getWalletAccountsHash = (state, client) => getWalletAccountsFromState(stat
|
|
|
1647
1722
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1648
1723
|
* @returns True if the user needs additional MFA authentication, false otherwise.
|
|
1649
1724
|
* @notInstrumented
|
|
1725
|
+
* @hook Exposed as a hook so consumers reactively know when MFA is still required, updated when the user changes.
|
|
1650
1726
|
*/
|
|
1651
1727
|
const isUserMissingMfaAuth = (client = getDefaultClient()) => {
|
|
1652
1728
|
const user = client.user;
|
|
@@ -1892,11 +1968,11 @@ const updateAuthFromVerifyResponse = ({ response }, client) => {
|
|
|
1892
1968
|
* programmatically because Redcoast won't set the cookie via headers. We set the cookie programmatically
|
|
1893
1969
|
* so customers can access the cookie from document.cookie consistently between sandbox and live environments.
|
|
1894
1970
|
*/
|
|
1895
|
-
if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax`);
|
|
1971
|
+
if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax${getSecureCookieAttribute()}`);
|
|
1896
1972
|
checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);
|
|
1897
1973
|
if (!previousState.user && Boolean(newState.user)) initializeWaasClientsForEagerRecovery(client);
|
|
1898
1974
|
};
|
|
1899
1975
|
|
|
1900
1976
|
//#endregion
|
|
1901
|
-
export { MfaRateLimitedError as $,
|
|
1902
|
-
//# sourceMappingURL=updateAuthFromVerifyResponse-
|
|
1977
|
+
export { MfaRateLimitedError as $, getWalletAccounts as A, offEvent as B, extractSessionId as C, getWalletProviderRegistry as D, WalletProviderPriority as E, formatWalletAccountId as F, fetchAndStoreNonces as G, onceEvent as H, normalizeAddress as I, createDeviceSignatureHeadersMiddleware as J, createApiClient as K, splitWalletProviderKey as L, normalizeWalletNameWithChain as M, getChainFromVerifiedCredentialChain as N, createRuntimeServiceAccessKey as O, CHAINS_INFO_MAP as P, SandboxMaximumThresholdReachedError as Q, InvalidWalletProviderKeyError as R, getOperatingSystem as S, getWalletProviderFromWalletAccount as T, setCookie as U, onEvent as V, getSecureCookieAttribute as W, getDeviceSigner as X, getHeadersForNonceSignedByDeviceSigners as Y, getNonce as Z, SDK_API_CORE_VERSION as _, BaseError as _t, initializeWaasClientsForEagerRecovery as a, isCookieEnabled as at, DEFAULT_PII_FIELDS as b, version as bt, isWaasWalletProvider as c, getElevatedAccessToken as ct, DYNAMIC_WAAS_METADATA as d, CLIENT_SDK_NAME as dt, MfaInvalidOtpError as et, getWalletProviders as f, DYNAMIC_SDK_API_VERSION as ft, DYNAMIC_ICONIC_SPRITE_URL as g, ClientNotFoundError as gt, emitWalletAccountsChangedEvent as h, setDefaultClient as ht, InvalidParamError as i, getSessionKeys as it, formatWalletProviderKey as j, NoWalletProviderFoundError as k, DEFAULT_WAAS_BASE_API_URL as l, randomString as lt, checkAndRaiseWalletAccountsChangedEvent as m, getDefaultClient as mt, upsertElevatedAccessToken as n, InvalidExternalAuthError as nt, isWaasWalletAccount as o, assertDefined as ot, isUserMissingMfaAuth as p, NONCE_POOL_SIZE as pt, UnauthorizedError as q, parseElevatedAccessToken as r, APIError as rt, findWaasWalletProviderByChain as s, ValueMustBeDefinedError as st, updateAuthFromVerifyResponse as t, LinkCredentialError as tt, DEFAULT_WAAS_BASE_MPC_RELAY_API_URL as u, getPlatform as ut, instrumentFunction as v, getCore as vt, DYNAMIC_AUTH_COOKIE_NAME as w, getUserAgent as x, scrubParameters as y, name as yt, emitEvent as z };
|
|
1978
|
+
//# sourceMappingURL=updateAuthFromVerifyResponse-_oYRLK_w.esm.js.map
|