@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
|
@@ -3,7 +3,7 @@ import { Platform } from "react-native";
|
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "@dynamic-labs-sdk/client";
|
|
6
|
-
var version = "1.
|
|
6
|
+
var version = "1.19.0";
|
|
7
7
|
var dependencies = {
|
|
8
8
|
"@dynamic-labs-sdk/assert-package-version": "workspace:*",
|
|
9
9
|
"@dynamic-labs-wallet/browser-wallet-client": "1.0.46",
|
|
@@ -109,6 +109,17 @@ let numOfInitializedClients = 0;
|
|
|
109
109
|
*
|
|
110
110
|
* If more than one instance of DynamicClient was initialized, you should not use this function.
|
|
111
111
|
* Instead, you should pass the client instance you stored to the function that needs it.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* const client = getDefaultClient();
|
|
116
|
+
* console.log('User:', client.user);
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* @returns The default DynamicClient instance.
|
|
120
|
+
* @throws ClientNotFoundError If no client has been initialized yet.
|
|
121
|
+
* @see createDynamicClient
|
|
122
|
+
* @see initializeClient
|
|
112
123
|
* @notInstrumented
|
|
113
124
|
*/
|
|
114
125
|
const getDefaultClient = () => {
|
|
@@ -137,8 +148,28 @@ const MFA_TOKEN_HEADER = "x-mfa-auth-token";
|
|
|
137
148
|
const SESSION_PUBLIC_KEY_HEADER = "x-dyn-session-public-key";
|
|
138
149
|
const DYNAMIC_SDK_API_VERSION = dependencies["@dynamic-labs/sdk-api-core"];
|
|
139
150
|
const DYNAMIC_SDK_SESSION_ID_HEADER = "x-dyn-session-id";
|
|
151
|
+
/**
|
|
152
|
+
* Reports the runtime platform (`web` or `react-native`) to the Dynamic API.
|
|
153
|
+
*
|
|
154
|
+
* Named `x-dynamic-platform` (not `x-dyn-*`) to match the header the legacy
|
|
155
|
+
* webview-controller already sends, so the backend receives a consistent
|
|
156
|
+
* platform signal across SDK generations.
|
|
157
|
+
*/
|
|
158
|
+
const DYNAMIC_PLATFORM_HEADER = "x-dynamic-platform";
|
|
140
159
|
const CLIENT_SDK_NAME = "ClientSDK";
|
|
141
160
|
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/utils/getPlatform/getPlatform.native.ts
|
|
163
|
+
/**
|
|
164
|
+
* Returns the platform the SDK is running on.
|
|
165
|
+
*
|
|
166
|
+
* This file is the React Native variant — the bundler (Metro) resolves
|
|
167
|
+
* `.native.ts` files over the plain `.ts` counterpart when building for
|
|
168
|
+
* React Native, so this implementation is used exclusively in RN environments.
|
|
169
|
+
* @notInstrumented
|
|
170
|
+
*/
|
|
171
|
+
const getPlatform = () => "react-native";
|
|
172
|
+
|
|
142
173
|
//#endregion
|
|
143
174
|
//#region src/utils/randomString/randomString.ts
|
|
144
175
|
const DEFAULT_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
@@ -257,7 +288,17 @@ const getSessionKeys = (client) => {
|
|
|
257
288
|
//#region src/errors/APIError/APIError.ts
|
|
258
289
|
var APIError = class APIError extends BaseError {
|
|
259
290
|
status;
|
|
260
|
-
|
|
291
|
+
/**
|
|
292
|
+
* The `payload` object from the API error response body, when present.
|
|
293
|
+
*
|
|
294
|
+
* Some error responses carry structured context beyond the `error`/`code`
|
|
295
|
+
* pair (e.g. `merge_accounts_confirmation` returns the field-level merge
|
|
296
|
+
* conflicts under `payload.mergeConflicts`). It is preserved here so that
|
|
297
|
+
* downstream error mappers can surface that context as typed errors instead
|
|
298
|
+
* of discarding it.
|
|
299
|
+
*/
|
|
300
|
+
payload;
|
|
301
|
+
constructor(message, code, status, payload) {
|
|
261
302
|
super({
|
|
262
303
|
cause: null,
|
|
263
304
|
code,
|
|
@@ -266,13 +307,15 @@ var APIError = class APIError extends BaseError {
|
|
|
266
307
|
shortMessage: message
|
|
267
308
|
});
|
|
268
309
|
this.status = status;
|
|
310
|
+
this.payload = payload;
|
|
269
311
|
}
|
|
270
312
|
static async fromResponse(response) {
|
|
271
313
|
try {
|
|
272
314
|
const errorBody = await response.clone().json();
|
|
273
315
|
if (errorBody && "error" in errorBody && typeof errorBody.error === "string") {
|
|
274
316
|
const errorCode = "code" in errorBody && typeof errorBody.code === "string" ? errorBody.code : "unknown_error";
|
|
275
|
-
|
|
317
|
+
const payload = "payload" in errorBody && typeof errorBody.payload === "object" && errorBody.payload !== null ? errorBody.payload : void 0;
|
|
318
|
+
return new APIError(errorBody.error, errorCode, response.status, payload);
|
|
276
319
|
}
|
|
277
320
|
return null;
|
|
278
321
|
} catch {
|
|
@@ -545,6 +588,7 @@ const createApiClient = (options = {}, client) => {
|
|
|
545
588
|
headers: {
|
|
546
589
|
"Content-Type": "application/json",
|
|
547
590
|
[DYNAMIC_API_VERSION_HEADER]: `API/${DYNAMIC_SDK_API_VERSION}`,
|
|
591
|
+
[DYNAMIC_PLATFORM_HEADER]: getPlatform(),
|
|
548
592
|
[DYNAMIC_REQUEST_ID_HEADER]: randomString({ length: 50 }),
|
|
549
593
|
[DYNAMIC_SDK_SESSION_ID_HEADER]: core.sdkSessionId,
|
|
550
594
|
[DYNAMIC_SDK_VERSION_HEADER]: `${CLIENT_SDK_NAME}/${version}`,
|
|
@@ -617,6 +661,28 @@ const fetchAndStoreNonces = async (client) => {
|
|
|
617
661
|
return fetchPromise;
|
|
618
662
|
};
|
|
619
663
|
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region src/utils/getSecureCookieAttribute/getSecureCookieAttribute.ts
|
|
666
|
+
/**
|
|
667
|
+
* Returns the cookie `Secure` attribute suffix (`'; Secure'`) when the current
|
|
668
|
+
* document is running in a secure context, or an empty string otherwise.
|
|
669
|
+
*
|
|
670
|
+
* The `Secure` attribute prevents the browser from ever transmitting the cookie
|
|
671
|
+
* over an unencrypted `http://` connection, which mitigates cleartext token
|
|
672
|
+
* capture (CWE-614). It is intentionally omitted on insecure/localhost dev,
|
|
673
|
+
* because browsers reject `Secure` cookies set over `http://` and that would
|
|
674
|
+
* silently break local testing.
|
|
675
|
+
*
|
|
676
|
+
* Used when building the Dynamic auth JWT cookie string so the attribute is
|
|
677
|
+
* applied consistently on both the write (sign-in/refresh) and clear (logout)
|
|
678
|
+
* paths.
|
|
679
|
+
*
|
|
680
|
+
* @notInstrumented
|
|
681
|
+
*/
|
|
682
|
+
const getSecureCookieAttribute = () => {
|
|
683
|
+
return Boolean(globalThis.window?.isSecureContext) || globalThis.location?.protocol === "https:" ? "; Secure" : "";
|
|
684
|
+
};
|
|
685
|
+
|
|
620
686
|
//#endregion
|
|
621
687
|
//#region src/utils/setCookie/setCookie.ts
|
|
622
688
|
/**
|
|
@@ -635,10 +701,25 @@ const setCookie = (cookie) => {
|
|
|
635
701
|
* This function allows you to listen for various events emitted by the Dynamic client,
|
|
636
702
|
* such as authentication state changes, wallet connections, and more.
|
|
637
703
|
*
|
|
704
|
+
* @example
|
|
705
|
+
* ```ts
|
|
706
|
+
* const unsubscribe = onEvent({
|
|
707
|
+
* event: 'walletAdded',
|
|
708
|
+
* listener: ({ walletAccount }) => {
|
|
709
|
+
* console.log('Wallet added:', walletAccount.address);
|
|
710
|
+
* },
|
|
711
|
+
* });
|
|
712
|
+
*
|
|
713
|
+
* // Later: clean up
|
|
714
|
+
* unsubscribe();
|
|
715
|
+
* ```
|
|
716
|
+
*
|
|
638
717
|
* @param params.event - The event name to listen for.
|
|
639
718
|
* @param params.listener - The callback function to execute when the event is fired.
|
|
640
719
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
641
720
|
* @returns A function that can be called to remove the listener.
|
|
721
|
+
* @see offEvent
|
|
722
|
+
* @see onceEvent
|
|
642
723
|
* @notInstrumented
|
|
643
724
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
644
725
|
*/
|
|
@@ -655,9 +736,16 @@ const onEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
|
655
736
|
* This function unsubscribes a previously registered event listener
|
|
656
737
|
* from the specified Dynamic client event.
|
|
657
738
|
*
|
|
739
|
+
* @example
|
|
740
|
+
* ```ts
|
|
741
|
+
* offEvent({ event: 'walletAdded', listener: myListener });
|
|
742
|
+
* ```
|
|
743
|
+
*
|
|
658
744
|
* @param params.event - The event name to remove the listener from.
|
|
659
745
|
* @param params.listener - The callback function to remove.
|
|
660
746
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
747
|
+
* @see onEvent
|
|
748
|
+
* @see onceEvent
|
|
661
749
|
* @notInstrumented
|
|
662
750
|
*/
|
|
663
751
|
const offEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
@@ -670,10 +758,22 @@ const offEvent = ({ event, listener }, client = getDefaultClient()) => {
|
|
|
670
758
|
* This function listens for an event that will automatically remove itself
|
|
671
759
|
* after being triggered once.
|
|
672
760
|
*
|
|
761
|
+
* @example
|
|
762
|
+
* ```ts
|
|
763
|
+
* onceEvent({
|
|
764
|
+
* event: 'logout',
|
|
765
|
+
* listener: () => {
|
|
766
|
+
* console.log('User logged out');
|
|
767
|
+
* },
|
|
768
|
+
* });
|
|
769
|
+
* ```
|
|
770
|
+
*
|
|
673
771
|
* @param params.event - The event name to listen for.
|
|
674
772
|
* @param params.listener - The callback function to execute when the event is fired.
|
|
675
773
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
676
774
|
* @returns A function that can be called to remove the listener before it fires.
|
|
775
|
+
* @see onEvent
|
|
776
|
+
* @see offEvent
|
|
677
777
|
* @notInstrumented
|
|
678
778
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
679
779
|
*/
|
|
@@ -995,8 +1095,18 @@ const getWalletAccountsFromState = ({ unverifiedWalletAccounts, user }, client)
|
|
|
995
1095
|
* You can differentiate between verified and unverified wallet accounts by
|
|
996
1096
|
* checking the `verifiedCredentialId` property.
|
|
997
1097
|
*
|
|
1098
|
+
* @example
|
|
1099
|
+
* ```ts
|
|
1100
|
+
* const wallets = getWalletAccounts();
|
|
1101
|
+
* const verified = wallets.filter((walletAccount) =>
|
|
1102
|
+
* isWalletAccountVerified({ walletAccount }),
|
|
1103
|
+
* );
|
|
1104
|
+
* ```
|
|
1105
|
+
*
|
|
998
1106
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
999
1107
|
* @returns An array of wallet accounts associated with the session.
|
|
1108
|
+
* @see isWalletAccountVerified
|
|
1109
|
+
* @see verifyWalletAccount
|
|
1000
1110
|
* @notInstrumented
|
|
1001
1111
|
* @hook Exposed as a hook so consumers get the reactive list of wallet accounts.
|
|
1002
1112
|
*/
|
|
@@ -1209,18 +1319,6 @@ const getOperatingSystem = () => {
|
|
|
1209
1319
|
return "unknown";
|
|
1210
1320
|
};
|
|
1211
1321
|
|
|
1212
|
-
//#endregion
|
|
1213
|
-
//#region src/utils/getPlatform/getPlatform.native.ts
|
|
1214
|
-
/**
|
|
1215
|
-
* Returns the platform the SDK is running on.
|
|
1216
|
-
*
|
|
1217
|
-
* This file is the React Native variant — the bundler (Metro) resolves
|
|
1218
|
-
* `.native.ts` files over the plain `.ts` counterpart when building for
|
|
1219
|
-
* React Native, so this implementation is used exclusively in RN environments.
|
|
1220
|
-
* @notInstrumented
|
|
1221
|
-
*/
|
|
1222
|
-
const getPlatform = () => "react-native";
|
|
1223
|
-
|
|
1224
1322
|
//#endregion
|
|
1225
1323
|
//#region src/utils/getUserAgent/getUserAgent.ts
|
|
1226
1324
|
/**
|
|
@@ -1411,193 +1509,170 @@ const scrubParameters = ({ piiFields, redactAll, value }) => {
|
|
|
1411
1509
|
});
|
|
1412
1510
|
};
|
|
1413
1511
|
|
|
1414
|
-
//#endregion
|
|
1415
|
-
//#region src/services/instrumentation/instrumentFunction/extractParams/extractParams.ts
|
|
1416
|
-
/**
|
|
1417
|
-
* Normalises the raw positional arguments of an instrumented function call
|
|
1418
|
-
* into a flat `Record<string, unknown>` suitable for structured logging.
|
|
1419
|
-
*
|
|
1420
|
-
* ## Why this is needed
|
|
1421
|
-
*
|
|
1422
|
-
* Instrumented functions are wrapped with `(...args: unknown[])`, so their
|
|
1423
|
-
* parameters arrive as an array. Logging a raw array loses the semantic names
|
|
1424
|
-
* of each argument. This function recovers a named representation:
|
|
1425
|
-
*
|
|
1426
|
-
* - **No arguments** → `{}`
|
|
1427
|
-
* - **Single plain-object argument** → that object is returned as-is, because
|
|
1428
|
-
* SDK functions follow the single-object-parameter convention, so the object
|
|
1429
|
-
* already carries named keys (`{ amount, to }`, etc.).
|
|
1430
|
-
* - **Everything else** (multiple args, a single primitive, a single array) →
|
|
1431
|
-
* each value is indexed as `arg0`, `arg1`, …
|
|
1432
|
-
*
|
|
1433
|
-
* ## Why arrays are NOT treated as plain objects
|
|
1434
|
-
*
|
|
1435
|
-
* `typeof [] === 'object'` and `[] !== null`, so without the `Array.isArray`
|
|
1436
|
-
* guard a single-array argument would be returned as-is. That would produce
|
|
1437
|
-
* an object with numeric string keys (`{ '0': ..., '1': ... }`), which is
|
|
1438
|
-
* misleading and inconsistent with how multi-arg calls are handled. Instead,
|
|
1439
|
-
* arrays fall through to the indexed `arg0` path.
|
|
1440
|
-
* @notInstrumented
|
|
1441
|
-
*/
|
|
1442
|
-
const extractParams = (args) => {
|
|
1443
|
-
if (args.length === 0) return {};
|
|
1444
|
-
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && !Array.isArray(args[0])) return args[0];
|
|
1445
|
-
const result = {};
|
|
1446
|
-
for (let i = 0; i < args.length; i++) result[`arg${i}`] = args[i];
|
|
1447
|
-
return result;
|
|
1448
|
-
};
|
|
1449
|
-
|
|
1450
|
-
//#endregion
|
|
1451
|
-
//#region src/services/instrumentation/instrumentFunction/scrubResolvedValue/scrubResolvedValue.ts
|
|
1452
|
-
/**
|
|
1453
|
-
* Scrubs a resolved return value of any type before logging it.
|
|
1454
|
-
* Routes through `scrubParameters` by wrapping the value so that strings,
|
|
1455
|
-
* arrays, Dates, Errors, and all other types are handled identically to
|
|
1456
|
-
* nested object fields.
|
|
1457
|
-
* @notInstrumented
|
|
1458
|
-
*/
|
|
1459
|
-
const scrubResolvedValue = ({ piiFields, redactAll, value }) => scrubParameters({
|
|
1460
|
-
piiFields,
|
|
1461
|
-
redactAll,
|
|
1462
|
-
value: { result: value }
|
|
1463
|
-
}).result;
|
|
1464
|
-
|
|
1465
1512
|
//#endregion
|
|
1466
1513
|
//#region src/services/instrumentation/instrumentFunction/instrumentFunction.ts
|
|
1467
|
-
const
|
|
1468
|
-
if (error instanceof
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
stack: error.stack
|
|
1514
|
+
const toErrorFields = (error) => {
|
|
1515
|
+
if (error instanceof BaseError) return {
|
|
1516
|
+
errorCode: error.code,
|
|
1517
|
+
errorName: error.name
|
|
1472
1518
|
};
|
|
1519
|
+
if (error instanceof Error) return { errorName: error.name };
|
|
1520
|
+
return { errorName: "UnknownError" };
|
|
1521
|
+
};
|
|
1522
|
+
const buildContext = (core) => {
|
|
1523
|
+
const state = core.state.get();
|
|
1473
1524
|
return {
|
|
1474
|
-
|
|
1475
|
-
|
|
1525
|
+
environmentId: core.environmentId,
|
|
1526
|
+
operatingSystem: getOperatingSystem(),
|
|
1527
|
+
platform: getPlatform(),
|
|
1528
|
+
registeredExtensionKeys: Array.from(core.extensions),
|
|
1529
|
+
sdkSessionId: core.sdkSessionId,
|
|
1530
|
+
sdkVersion: core.version,
|
|
1531
|
+
tokenSessionId: state.token ? extractSessionId(state.token) : null,
|
|
1532
|
+
userAgent: getUserAgent(),
|
|
1533
|
+
userId: state.user?.id ?? null
|
|
1476
1534
|
};
|
|
1477
1535
|
};
|
|
1478
1536
|
/**
|
|
1537
|
+
* Runs an explicit payload selector and scrubs its output. Returns `undefined`
|
|
1538
|
+
* when there is no selector. Selector (and scrub) errors are swallowed so a
|
|
1539
|
+
* faulty selector can never break the wrapped function or fabricate a
|
|
1540
|
+
* 'rejected' event — instrumentation stays purely observational. The swallowed
|
|
1541
|
+
* error is surfaced on the `debug` logger so internal devs can still spot a
|
|
1542
|
+
* broken selector without it ever reaching a transport.
|
|
1543
|
+
*/
|
|
1544
|
+
const safeSelect = ({ functionName, logger, piiFields, selector, value }) => {
|
|
1545
|
+
if (!selector) return;
|
|
1546
|
+
try {
|
|
1547
|
+
return scrubParameters({
|
|
1548
|
+
piiFields,
|
|
1549
|
+
value: selector(value)
|
|
1550
|
+
});
|
|
1551
|
+
} catch (error) {
|
|
1552
|
+
logger.debug(`[instrumentFunction] payload selector for "${functionName}" threw; emitting event without payload`, error);
|
|
1553
|
+
return;
|
|
1554
|
+
}
|
|
1555
|
+
};
|
|
1556
|
+
/**
|
|
1479
1557
|
* Wraps a function so that each invocation emits a structured
|
|
1480
1558
|
* `FunctionInstrumentationEvent` at three lifecycle points:
|
|
1481
1559
|
*
|
|
1482
|
-
* - **started** — immediately before the function body executes
|
|
1483
|
-
* PII-scrubbed call parameters.
|
|
1560
|
+
* - **started** — immediately before the function body executes.
|
|
1484
1561
|
* - **resolved** — after the function (or its returned Promise) settles
|
|
1485
|
-
* successfully, with the
|
|
1562
|
+
* successfully, with the call duration.
|
|
1486
1563
|
* - **rejected** — if the function throws synchronously or its returned
|
|
1487
|
-
* Promise rejects.
|
|
1564
|
+
* Promise rejects, with the duration and the error's class name/code.
|
|
1565
|
+
*
|
|
1566
|
+
* Events carry only the safe envelope (function name, phase, timing, error
|
|
1567
|
+
* class, SDK/runtime metadata, identifiers). **Raw arguments and return values
|
|
1568
|
+
* are never captured.** A function that needs additional fields supplies
|
|
1569
|
+
* `selectors` that build an explicit, primitive-only {@link SafePayload} — the
|
|
1570
|
+
* only path from arguments/return value into a log.
|
|
1488
1571
|
*
|
|
1489
1572
|
* The original return value (or thrown error) is always forwarded to the
|
|
1490
|
-
* caller unchanged — instrumentation is purely observational
|
|
1573
|
+
* caller unchanged — instrumentation is purely observational, and a throwing
|
|
1574
|
+
* selector cannot change that.
|
|
1575
|
+
*
|
|
1576
|
+
* ## Providing selectors
|
|
1491
1577
|
*
|
|
1492
|
-
*
|
|
1578
|
+
* A function opts into a payload by supplying selectors that map its arguments
|
|
1579
|
+
* (`started`) and/or its awaited return value (`resolved`) to a primitive-only
|
|
1580
|
+
* {@link SafePayload}. Pick individual known-safe fields — never spread a whole
|
|
1581
|
+
* object, which is exactly what the model prevents.
|
|
1493
1582
|
*
|
|
1494
1583
|
* ```ts
|
|
1495
1584
|
* const transfer = instrumentFunction({
|
|
1496
1585
|
* fn: rawTransfer,
|
|
1497
1586
|
* functionName: 'transfer',
|
|
1498
1587
|
* getCore: () => core,
|
|
1588
|
+
* selectors: {
|
|
1589
|
+
* // `args` is the argument tuple the wrapped function was called with.
|
|
1590
|
+
* started: ([{ chainId, amount }]) => ({ amount, chainId }),
|
|
1591
|
+
* // `result` is the awaited return value (never the Promise).
|
|
1592
|
+
* resolved: ({ txHash }) => ({ txHash }),
|
|
1593
|
+
* },
|
|
1499
1594
|
* });
|
|
1500
|
-
*
|
|
1501
|
-
* // When called, three events are emitted automatically:
|
|
1502
|
-
* await transfer({ amount: 1, to: '0xabc' });
|
|
1503
1595
|
* ```
|
|
1504
1596
|
*
|
|
1597
|
+
* A selector that throws (or whose output fails scrubbing) is swallowed: the
|
|
1598
|
+
* event is still emitted without a payload, and the error is logged at `debug`.
|
|
1599
|
+
*
|
|
1505
1600
|
* ## How functions are wrapped
|
|
1506
1601
|
*
|
|
1507
|
-
* `instrumentFunction` is not called manually in application code.
|
|
1508
|
-
*
|
|
1509
|
-
*
|
|
1510
|
-
* JSDoc is automatically wrapped by the plugin during the build step.
|
|
1511
|
-
* The plugin strips the original `export`, renames the function, and re-exports
|
|
1512
|
-
* it under the original name via `instrumentFunction(...)` — so the public API
|
|
1513
|
-
* is unchanged and no call sites need to be updated.
|
|
1602
|
+
* `instrumentFunction` is not called manually in application code. The esbuild
|
|
1603
|
+
* instrumentation plugin (`tools/instrumentation-plugin`) injects it at build
|
|
1604
|
+
* time for any exported function annotated with `@instrumented` in its JSDoc.
|
|
1514
1605
|
*
|
|
1515
1606
|
* ## Opting out
|
|
1516
1607
|
*
|
|
1517
|
-
* Instrumentation is skipped entirely when
|
|
1518
|
-
*
|
|
1519
|
-
*
|
|
1520
|
-
*
|
|
1521
|
-
* In both cases the original function is called directly with no overhead.
|
|
1522
|
-
*
|
|
1523
|
-
* ## PII scrubbing
|
|
1524
|
-
*
|
|
1525
|
-
* All string values whose key appears in `piiFields` are replaced with
|
|
1526
|
-
* `"[redacted]"` before events are emitted. Pass `redactAll: true` to redact
|
|
1527
|
-
* every field, regardless of key name.
|
|
1608
|
+
* Instrumentation is skipped entirely when `getCore()` returns `undefined`
|
|
1609
|
+
* (SDK not initialised) or when `core.instrumentation.config.enabled` is
|
|
1610
|
+
* `false`; in both cases the original function is called directly.
|
|
1528
1611
|
* @notInstrumented
|
|
1529
1612
|
*/
|
|
1530
|
-
const instrumentFunction = ({ fn, functionName, getCore: getCore$1,
|
|
1613
|
+
const instrumentFunction = ({ fn, functionName, getCore: getCore$1, selectors }) => {
|
|
1531
1614
|
const wrapped = (...args) => {
|
|
1532
1615
|
const core = getCore$1();
|
|
1533
|
-
if (!core) return fn(...args);
|
|
1534
|
-
|
|
1535
|
-
const
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
functionName,
|
|
1540
|
-
operatingSystem: getOperatingSystem(),
|
|
1541
|
-
parameters: scrubParameters({
|
|
1542
|
-
piiFields: instrumentation.config.piiFields,
|
|
1543
|
-
redactAll,
|
|
1544
|
-
value: extractParams(args)
|
|
1545
|
-
}),
|
|
1546
|
-
platform: getPlatform(),
|
|
1547
|
-
registeredExtensionKeys: Array.from(core.extensions),
|
|
1548
|
-
sdkSessionId: core.sdkSessionId,
|
|
1549
|
-
sdkVersion: core.version,
|
|
1550
|
-
status: "info",
|
|
1551
|
-
tokenSessionId: state.token ? extractSessionId(state.token) : null,
|
|
1552
|
-
userAgent: getUserAgent(),
|
|
1553
|
-
userId: state.user?.id ?? null
|
|
1616
|
+
if (!core?.instrumentation.config.enabled) return fn(...args);
|
|
1617
|
+
const { instrumentation, logger } = core;
|
|
1618
|
+
const { piiFields } = instrumentation.config;
|
|
1619
|
+
const base = {
|
|
1620
|
+
...buildContext(core),
|
|
1621
|
+
functionName
|
|
1554
1622
|
};
|
|
1623
|
+
const startedAt = Date.now();
|
|
1555
1624
|
instrumentation.logFunction({
|
|
1556
|
-
...
|
|
1625
|
+
...base,
|
|
1626
|
+
payload: safeSelect({
|
|
1627
|
+
functionName,
|
|
1628
|
+
logger,
|
|
1629
|
+
piiFields,
|
|
1630
|
+
selector: selectors?.started,
|
|
1631
|
+
value: args
|
|
1632
|
+
}),
|
|
1557
1633
|
phase: "started",
|
|
1634
|
+
status: "info",
|
|
1558
1635
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1559
1636
|
});
|
|
1560
|
-
|
|
1561
|
-
const result = fn(...args);
|
|
1562
|
-
if (result instanceof Promise) return result.then((value) => {
|
|
1563
|
-
instrumentation.logFunction({
|
|
1564
|
-
...baseEvent,
|
|
1565
|
-
phase: "resolved",
|
|
1566
|
-
resolvedValue: scrubResolvedValue({
|
|
1567
|
-
piiFields: instrumentation.config.piiFields,
|
|
1568
|
-
redactAll,
|
|
1569
|
-
value
|
|
1570
|
-
}),
|
|
1571
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1572
|
-
});
|
|
1573
|
-
return value;
|
|
1574
|
-
}).catch((error) => {
|
|
1575
|
-
instrumentation.logFunction({
|
|
1576
|
-
...baseEvent,
|
|
1577
|
-
phase: "rejected",
|
|
1578
|
-
rejectedError: serializeError(error),
|
|
1579
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1580
|
-
});
|
|
1581
|
-
throw error;
|
|
1582
|
-
});
|
|
1637
|
+
const emitResolved = (value) => {
|
|
1583
1638
|
instrumentation.logFunction({
|
|
1584
|
-
...
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1639
|
+
...base,
|
|
1640
|
+
durationMs: Date.now() - startedAt,
|
|
1641
|
+
payload: safeSelect({
|
|
1642
|
+
functionName,
|
|
1643
|
+
logger,
|
|
1644
|
+
piiFields,
|
|
1645
|
+
selector: selectors?.resolved,
|
|
1646
|
+
value
|
|
1590
1647
|
}),
|
|
1648
|
+
phase: "resolved",
|
|
1649
|
+
status: "info",
|
|
1591
1650
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1592
1651
|
});
|
|
1593
|
-
|
|
1594
|
-
|
|
1652
|
+
};
|
|
1653
|
+
const emitRejected = (error) => {
|
|
1595
1654
|
instrumentation.logFunction({
|
|
1596
|
-
...
|
|
1655
|
+
...base,
|
|
1656
|
+
...toErrorFields(error),
|
|
1657
|
+
durationMs: Date.now() - startedAt,
|
|
1597
1658
|
phase: "rejected",
|
|
1598
|
-
|
|
1659
|
+
status: "error",
|
|
1599
1660
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1600
1661
|
});
|
|
1662
|
+
};
|
|
1663
|
+
try {
|
|
1664
|
+
const result = fn(...args);
|
|
1665
|
+
if (result instanceof Promise) return result.then((value) => {
|
|
1666
|
+
emitResolved(value);
|
|
1667
|
+
return value;
|
|
1668
|
+
}, (error) => {
|
|
1669
|
+
emitRejected(error);
|
|
1670
|
+
throw error;
|
|
1671
|
+
});
|
|
1672
|
+
emitResolved(result);
|
|
1673
|
+
return result;
|
|
1674
|
+
} catch (error) {
|
|
1675
|
+
emitRejected(error);
|
|
1601
1676
|
throw error;
|
|
1602
1677
|
}
|
|
1603
1678
|
};
|
|
@@ -1642,6 +1717,7 @@ const getWalletAccountsHash = (state, client) => getWalletAccountsFromState(stat
|
|
|
1642
1717
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
1643
1718
|
* @returns True if the user needs additional MFA authentication, false otherwise.
|
|
1644
1719
|
* @notInstrumented
|
|
1720
|
+
* @hook Exposed as a hook so consumers reactively know when MFA is still required, updated when the user changes.
|
|
1645
1721
|
*/
|
|
1646
1722
|
const isUserMissingMfaAuth = (client = getDefaultClient()) => {
|
|
1647
1723
|
const user = client.user;
|
|
@@ -1887,11 +1963,11 @@ const updateAuthFromVerifyResponse = ({ response }, client) => {
|
|
|
1887
1963
|
* programmatically because Redcoast won't set the cookie via headers. We set the cookie programmatically
|
|
1888
1964
|
* so customers can access the cookie from document.cookie consistently between sandbox and live environments.
|
|
1889
1965
|
*/
|
|
1890
|
-
if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax`);
|
|
1966
|
+
if (minifiedJwt && isCookieEnabled(client)) setCookie(`${DYNAMIC_AUTH_COOKIE_NAME}=${minifiedJwt}; expires=${sessionExpiresAt.toUTCString()}; path=/; SameSite=Lax${getSecureCookieAttribute()}`);
|
|
1891
1967
|
checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);
|
|
1892
1968
|
if (!previousState.user && Boolean(newState.user)) initializeWaasClientsForEagerRecovery(client);
|
|
1893
1969
|
};
|
|
1894
1970
|
|
|
1895
1971
|
//#endregion
|
|
1896
|
-
export { MfaRateLimitedError as $,
|
|
1897
|
-
//# sourceMappingURL=updateAuthFromVerifyResponse-
|
|
1972
|
+
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 };
|
|
1973
|
+
//# sourceMappingURL=updateAuthFromVerifyResponse-DFjqCSu2.native.esm.js.map
|