@dynamic-labs-sdk/client 1.30.2 → 1.31.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/{updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js → apiClient-DpzKqY39.native.esm.js} +557 -465
- package/dist/apiClient-DpzKqY39.native.esm.js.map +1 -0
- package/dist/client/types/DynamicClient.d.ts +1 -1
- package/dist/client/types/DynamicClient.d.ts.map +1 -1
- package/dist/core.cjs +121 -61
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +64 -6
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +64 -6
- package/dist/core.native.esm.js.map +1 -1
- package/dist/errors/WaasRbacStaleRetryUnsafeError.d.ts +36 -0
- package/dist/errors/WaasRbacStaleRetryUnsafeError.d.ts.map +1 -0
- package/dist/exports/core.d.ts +6 -0
- package/dist/exports/core.d.ts.map +1 -1
- package/dist/exports/index.d.ts +16 -4
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +3 -2
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CamHn2s3.esm.js → getNetworkProviderFromNetworkId-BN2jUhHm.esm.js} +8 -3
- package/dist/getNetworkProviderFromNetworkId-BN2jUhHm.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-igDf2OPy.cjs → getNetworkProviderFromNetworkId-BoNAPSjx.cjs} +62 -51
- package/dist/getNetworkProviderFromNetworkId-BoNAPSjx.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId--X0cb1ad.native.esm.js → getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js} +9 -4
- package/dist/getNetworkProviderFromNetworkId-DUym3Qq0.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-DGa_pu-i.cjs → getSignedSessionId-9ADIJCl1.cjs} +11 -11
- package/dist/{getSignedSessionId-DGa_pu-i.cjs.map → getSignedSessionId-9ADIJCl1.cjs.map} +1 -1
- package/dist/{getSignedSessionId--XNTxNFo.native.esm.js → getSignedSessionId-Dr4Ic68X.native.esm.js} +3 -3
- package/dist/{getSignedSessionId--XNTxNFo.native.esm.js.map → getSignedSessionId-Dr4Ic68X.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DY-ietfO.esm.js → getSignedSessionId-DxpqG4pv.esm.js} +3 -3
- package/dist/{getSignedSessionId-DY-ietfO.esm.js.map → getSignedSessionId-DxpqG4pv.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-DzpmoNlv.cjs → getVerifiedCredentialForWalletAccount-C2o5idph.cjs} +10 -10
- package/dist/getVerifiedCredentialForWalletAccount-C2o5idph.cjs.map +1 -0
- package/dist/{getWalletProviderByKey-xqyD3ybv.esm.js → getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js} +10 -10
- package/dist/getVerifiedCredentialForWalletAccount-Cjwoeej7.esm.js.map +1 -0
- package/dist/index.cjs +677 -672
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +47 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +47 -23
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-CatS60F6.esm.js → isMfaRequiredForAction-BIBmJbV9.esm.js} +2 -2
- package/dist/isMfaRequiredForAction-BIBmJbV9.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-BcJvy7Gw.native.esm.js → isMfaRequiredForAction-DuSU67yq.native.esm.js} +2 -2
- package/dist/isMfaRequiredForAction-DuSU67yq.native.esm.js.map +1 -0
- package/dist/{isMfaRequiredForAction-DKfoMhEk.cjs → isMfaRequiredForAction-yM84r7l7.cjs} +11 -11
- package/dist/isMfaRequiredForAction-yM84r7l7.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-BWVuE4Jg.native.esm.js → isUserOnboardingComplete-B2Ha2dkP.esm.js} +47 -4
- package/dist/isUserOnboardingComplete-B2Ha2dkP.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-jv_idxWY.cjs → isUserOnboardingComplete-BRTOnK8V.cjs} +63 -14
- package/dist/isUserOnboardingComplete-BRTOnK8V.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-jkAQQVdP.esm.js → isUserOnboardingComplete-DCIlkCub.native.esm.js} +47 -4
- package/dist/isUserOnboardingComplete-DCIlkCub.native.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-BLgNMqwN.esm.js → logoutWithReason-DV89zJmJ.esm.js} +679 -587
- package/dist/logoutWithReason-DV89zJmJ.esm.js.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-Dsw-eAro.cjs → logoutWithReason-DlA15deT.cjs} +691 -587
- package/dist/logoutWithReason-DlA15deT.cjs.map +1 -0
- package/dist/{getWalletProviderByKey-Cl6WDOoD.native.esm.js → logoutWithReason-HqGlUccb.native.esm.js} +19 -19
- package/dist/logoutWithReason-HqGlUccb.native.esm.js.map +1 -0
- package/dist/migrateFromFireblocks-CiOS4_Nq.esm.js +128 -0
- package/dist/migrateFromFireblocks-CiOS4_Nq.esm.js.map +1 -0
- package/dist/migrateFromFireblocks-CqIpxGRS.cjs +163 -0
- package/dist/migrateFromFireblocks-CqIpxGRS.cjs.map +1 -0
- package/dist/migrateFromFireblocks-DnQsGmIW.native.esm.js +128 -0
- package/dist/migrateFromFireblocks-DnQsGmIW.native.esm.js.map +1 -0
- package/dist/modules/apiClient/apiClient.types.d.ts +1 -1
- package/dist/modules/apiClient/apiClient.types.d.ts.map +1 -1
- package/dist/modules/apiClient/createApiClient.d.ts.map +1 -1
- package/dist/modules/apiClient/utils/rbacStaleMiddleware/createRbacStaleMiddleware.d.ts +10 -0
- package/dist/modules/apiClient/utils/rbacStaleMiddleware/createRbacStaleMiddleware.d.ts.map +1 -0
- package/dist/modules/auth/auth.types.d.ts +45 -0
- package/dist/modules/auth/auth.types.d.ts.map +1 -0
- package/dist/modules/auth/checkStepUpAuth/checkStepUpAuth.d.ts +2 -1
- package/dist/modules/auth/checkStepUpAuth/checkStepUpAuth.d.ts.map +1 -1
- package/dist/modules/auth/consts.d.ts +9 -0
- package/dist/modules/auth/consts.d.ts.map +1 -1
- package/dist/modules/auth/createVisit/createVisit.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts +1 -1
- package/dist/modules/auth/externalAuth/requestExternalAuthElevatedToken/requestExternalAuthElevatedToken.d.ts.map +1 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts +1 -1
- package/dist/modules/auth/externalAuth/signInWithExternalJwt/signInWithExternalJwt.d.ts.map +1 -1
- package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts +2 -1
- package/dist/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.d.ts.map +1 -1
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts +4 -3
- package/dist/modules/auth/mergeUserAccounts/mergeUserAccounts.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/getPasskeys/getPasskeys.d.ts +1 -1
- package/dist/modules/auth/passkeys/getPasskeys/getPasskeys.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts +2 -1
- package/dist/modules/auth/passkeys/registerPasskey/registerPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts +3 -1
- package/dist/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.d.ts +2 -1
- package/dist/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.d.ts.map +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +1 -1
- package/dist/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts +1 -1
- package/dist/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.types.d.ts +1 -1
- package/dist/modules/auth/social/oauth/completeSocialRedirect/completeSocialRedirect.types.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/processSocialCallback/processSocialCallback.d.ts +1 -1
- package/dist/modules/auth/social/oauth/processSocialCallback/processSocialCallback.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.types.d.ts +1 -1
- package/dist/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.types.d.ts.map +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +1 -1
- package/dist/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts +1 -1
- package/dist/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
- package/dist/modules/balances/balances.types.d.ts +59 -0
- package/dist/modules/balances/balances.types.d.ts.map +1 -0
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts +1 -1
- package/dist/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.d.ts.map +1 -1
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts +1 -1
- package/dist/modules/balances/getTokenBalances/getTokenBalances.d.ts.map +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts +1 -1
- package/dist/modules/checkout/broadcastCheckoutTransaction/broadcastCheckoutTransaction.d.ts.map +1 -1
- package/dist/modules/checkout/checkout.types.d.ts +10 -2
- package/dist/modules/checkout/checkout.types.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts +1 -1
- package/dist/modules/deviceRegistration/completeDeviceRegistration/completeDeviceRegistration.d.ts.map +1 -1
- package/dist/modules/deviceRegistration/deviceRegistration.types.d.ts +9 -0
- package/dist/modules/deviceRegistration/deviceRegistration.types.d.ts.map +1 -0
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts +1 -1
- package/dist/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.d.ts.map +1 -1
- package/dist/modules/funding/coinbase/coinbase.types.d.ts +2 -40
- package/dist/modules/funding/coinbase/coinbase.types.d.ts.map +1 -1
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.d.ts +1 -1
- package/dist/modules/funding/coinbase/createCoinbaseExchangeTransfer/createCoinbaseExchangeTransfer.d.ts.map +1 -1
- package/dist/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts +2 -2
- package/dist/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts.map +1 -1
- package/dist/modules/funding/cryptoDotCom/cryptoDotCom.types.d.ts +2 -2
- package/dist/modules/funding/cryptoDotCom/cryptoDotCom.types.d.ts.map +1 -1
- package/dist/modules/funding/funding.types.d.ts +26 -0
- package/dist/modules/funding/funding.types.d.ts.map +1 -0
- package/dist/modules/funding/kraken/createKrakenExchangeTransfer/createKrakenExchangeTransfer.d.ts +4 -4
- package/dist/modules/funding/kraken/createKrakenExchangeTransfer/createKrakenExchangeTransfer.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts +3 -1
- package/dist/modules/mfa/authenticateMfaRecoveryCode/authenticateMfaRecoveryCode.d.ts.map +1 -1
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts +3 -1
- package/dist/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts.map +1 -1
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts +3 -1
- package/dist/modules/mfa/authenticateTotpMfaDevice/authenticateTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts +1 -1
- package/dist/modules/mfa/createNewMfaRecoveryCodes/createNewMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/mfa/getMfaDevices/getMfaDevices.d.ts +1 -1
- package/dist/modules/mfa/getMfaDevices/getMfaDevices.d.ts.map +1 -1
- package/dist/modules/mfa/getMfaMethods/getMfaMethods.d.ts +1 -1
- package/dist/modules/mfa/getMfaMethods/getMfaMethods.d.ts.map +1 -1
- package/dist/modules/mfa/getMfaRecoveryCodes/getMfaRecoveryCodes.d.ts +1 -1
- package/dist/modules/mfa/getMfaRecoveryCodes/getMfaRecoveryCodes.d.ts.map +1 -1
- package/dist/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.d.ts +1 -1
- package/dist/modules/mfa/isMfaRequiredForAction/isMfaRequiredForAction.d.ts.map +1 -1
- package/dist/modules/mfa/mfa.consts.d.ts +10 -0
- package/dist/modules/mfa/mfa.consts.d.ts.map +1 -0
- package/dist/modules/mfa/mfa.types.d.ts +66 -1
- package/dist/modules/mfa/mfa.types.d.ts.map +1 -1
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts +1 -1
- package/dist/modules/mfa/registerTotpMfaDevice/registerTotpMfaDevice.d.ts.map +1 -1
- package/dist/modules/otp/verifyOTP/verifyOTP.d.ts +2 -1
- 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 +1 -1
- package/dist/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
- package/dist/modules/projectSettings/projectSettings.types.d.ts +15 -0
- package/dist/modules/projectSettings/projectSettings.types.d.ts.map +1 -0
- package/dist/modules/simulation/simulation.types.d.ts +27 -1
- package/dist/modules/simulation/simulation.types.d.ts.map +1 -1
- package/dist/modules/storageSync/schema.d.ts +2 -2
- package/dist/modules/storageSync/schema.d.ts.map +1 -1
- package/dist/modules/swap/swap.types.d.ts +15 -2
- package/dist/modules/swap/swap.types.d.ts.map +1 -1
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts +2 -2
- package/dist/modules/user/refreshAuth/refreshAuth.d.ts.map +1 -1
- package/dist/modules/user/refreshUser/refreshUser.d.ts +3 -3
- package/dist/modules/user/refreshUser/refreshUser.d.ts.map +1 -1
- package/dist/modules/user/user.consts.d.ts +19 -0
- package/dist/modules/user/user.consts.d.ts.map +1 -0
- package/dist/modules/user/user.types.d.ts +22 -2
- package/dist/modules/user/user.types.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +4 -2
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +1 -1
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts +2 -2
- package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts.map +1 -1
- package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts +3 -1
- package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts.map +1 -1
- package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts +2 -1
- package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts +1 -2
- package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts +3 -2
- package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts +2 -2
- package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts +2 -1
- package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts.map +1 -1
- package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts +1 -2
- package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts.map +1 -1
- package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts +2 -2
- package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts.map +1 -1
- package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts +1 -2
- package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts.map +1 -1
- package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts +1 -2
- package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts.map +1 -1
- package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts +1 -1
- package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts.map +1 -1
- package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts +2 -2
- package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts.map +1 -1
- package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts +1 -1
- package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts.map +1 -1
- package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts +1 -1
- package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts.map +1 -1
- package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts +1 -1
- package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts.map +1 -1
- package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts +1 -1
- package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts.map +1 -1
- package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts +1 -1
- package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts.map +1 -1
- package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts +1 -2
- package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts.map +1 -1
- package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts +1 -1
- package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts.map +1 -1
- package/dist/modules/waas/policies/policies.types.d.ts +17 -1
- package/dist/modules/waas/policies/policies.types.d.ts.map +1 -1
- package/dist/modules/waas/policies/policyRuleKinds.d.ts +1 -2
- package/dist/modules/waas/policies/policyRuleKinds.d.ts.map +1 -1
- package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts +1 -2
- package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts +1 -2
- package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts +1 -2
- package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts +1 -2
- package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts +1 -2
- package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts +1 -1
- package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts +2 -1
- package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts.map +1 -1
- package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts +1 -1
- package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts +1 -1
- package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts +1 -2
- package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts.map +1 -1
- package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts +1 -1
- package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts.map +1 -1
- package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts +2 -1
- package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts +2 -1
- package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts +2 -1
- package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts.map +1 -1
- package/dist/modules/waas/waas.consts.d.ts +23 -0
- package/dist/modules/waas/waas.consts.d.ts.map +1 -0
- package/dist/modules/waas/waas.types.d.ts +30 -1
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts +2 -2
- package/dist/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts +2 -2
- package/dist/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts.map +1 -1
- package/dist/modules/wallets/screenTransaction/screenTransaction.d.ts +1 -1
- package/dist/modules/wallets/screenTransaction/screenTransaction.d.ts.map +1 -1
- package/dist/modules/wallets/userHasEmbeddedWalletForChain/userHasEmbeddedWalletForChain.d.ts +2 -2
- package/dist/modules/wallets/userHasEmbeddedWalletForChain/userHasEmbeddedWalletForChain.d.ts.map +1 -1
- package/dist/modules/wallets/userHasExternalWallet/userHasExternalWallet.d.ts +2 -2
- package/dist/modules/wallets/userHasExternalWallet/userHasExternalWallet.d.ts.map +1 -1
- package/dist/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.d.ts +1 -1
- package/dist/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.d.ts.map +1 -1
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts +5 -3
- package/dist/modules/wallets/verifyMessageSignatureOwnership/verifyMessageSignatureOwnership.d.ts.map +1 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts +1 -1
- package/dist/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
- package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts +1 -1
- package/dist/modules/wallets/verifyWalletAccountForSignInOrTransfer/verifyWalletAccountForSignInOrTransfer.d.ts.map +1 -1
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts +4 -2
- package/dist/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
- package/dist/modules/wallets/wallets.types.d.ts +47 -0
- package/dist/modules/wallets/wallets.types.d.ts.map +1 -0
- package/dist/modules/yield/yield.types.d.ts +8 -0
- package/dist/modules/yield/yield.types.d.ts.map +1 -1
- package/dist/services/eventEmitter/createEventEmitter.d.ts +3 -2
- package/dist/services/eventEmitter/createEventEmitter.d.ts.map +1 -1
- package/dist/services/eventEmitter/index.d.ts +1 -1
- package/dist/services/eventEmitter/index.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/createSequenceQueue/createSequenceQueue.d.ts +52 -0
- package/dist/utils/createSequenceQueue/createSequenceQueue.d.ts.map +1 -0
- package/dist/utils/createSequenceQueue/index.d.ts +3 -0
- package/dist/utils/createSequenceQueue/index.d.ts.map +1 -0
- package/dist/waas-BOKafCeH.cjs +2467 -0
- package/dist/waas-BOKafCeH.cjs.map +1 -0
- package/dist/waas-CUDgU2pl.esm.js +2150 -0
- package/dist/waas-CUDgU2pl.esm.js.map +1 -0
- package/dist/waas-CkQYVo6U.native.esm.js +2150 -0
- package/dist/waas-CkQYVo6U.native.esm.js.map +1 -0
- package/dist/waas.cjs +60 -2185
- package/dist/waas.esm.js +5 -2126
- package/dist/waas.native.esm.js +5 -2126
- package/dist/waasCore.cjs +76 -44
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +56 -24
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +56 -24
- package/dist/waasCore.native.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/getNetworkProviderFromNetworkId--X0cb1ad.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-CamHn2s3.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-igDf2OPy.cjs.map +0 -1
- package/dist/getWalletProviderByKey-Cl6WDOoD.native.esm.js.map +0 -1
- package/dist/getWalletProviderByKey-DzpmoNlv.cjs.map +0 -1
- package/dist/getWalletProviderByKey-xqyD3ybv.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-CMccs1-6.cjs +0 -136
- package/dist/isDynamicWaasEnabled-CMccs1-6.cjs.map +0 -1
- package/dist/isDynamicWaasEnabled-DSqgpEcX.native.esm.js +0 -113
- package/dist/isDynamicWaasEnabled-DSqgpEcX.native.esm.js.map +0 -1
- package/dist/isDynamicWaasEnabled-DYORq7Jc.esm.js +0 -113
- package/dist/isDynamicWaasEnabled-DYORq7Jc.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-BcJvy7Gw.native.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-CatS60F6.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-DKfoMhEk.cjs.map +0 -1
- package/dist/isUserOnboardingComplete-BWVuE4Jg.native.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-jkAQQVdP.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-jv_idxWY.cjs.map +0 -1
- package/dist/migrateFromFireblocks-B-WUs34v.native.esm.js +0 -65
- package/dist/migrateFromFireblocks-B-WUs34v.native.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-D4E9bT2H.esm.js +0 -65
- package/dist/migrateFromFireblocks-D4E9bT2H.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-zp5Jbq2J.cjs +0 -82
- package/dist/migrateFromFireblocks-zp5Jbq2J.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-BLgNMqwN.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-CTvWpZLa.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-Dsw-eAro.cjs.map +0 -1
- package/dist/waas.cjs.map +0 -1
- package/dist/waas.esm.js.map +0 -1
- package/dist/waas.native.esm.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
const require_logoutWithReason = require('./logoutWithReason-DlA15deT.cjs');
|
|
2
|
+
const require_migrateFromFireblocks = require('./migrateFromFireblocks-CqIpxGRS.cjs');
|
|
3
|
+
const require_waas = require('./waas-BOKafCeH.cjs');
|
|
4
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-BoNAPSjx.cjs');
|
|
5
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-C2o5idph.cjs');
|
|
6
|
+
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-BRTOnK8V.cjs');
|
|
7
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-yM84r7l7.cjs');
|
|
7
8
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
8
9
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
9
10
|
let zod_mini = require("zod/mini");
|
|
10
|
-
zod_mini =
|
|
11
|
+
zod_mini = require_logoutWithReason.__toESM(zod_mini);
|
|
11
12
|
let eventemitter3 = require("eventemitter3");
|
|
12
|
-
eventemitter3 = require_updateAuthFromVerifyResponse.__toESM(eventemitter3);
|
|
13
13
|
let _simplewebauthn_browser = require("@simplewebauthn/browser");
|
|
14
14
|
|
|
15
15
|
//#region src/modules/state/raiseStateEvents/events.ts
|
|
@@ -30,13 +30,32 @@ const stateChangeEvents = {
|
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
|
-
//#region src/
|
|
34
|
-
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
//#region src/modules/mfa/mfa.consts.ts
|
|
34
|
+
/**
|
|
35
|
+
* Identifies the MFA action required by WaaS authentication operations.
|
|
36
|
+
*
|
|
37
|
+
* @see createWaasProvider
|
|
38
|
+
* @see consumeMfaTokenIfRequiredForAction
|
|
39
|
+
*/
|
|
40
|
+
const MFAAction = _dynamic_labs_sdk_api_core.MFAAction;
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/modules/user/user.consts.ts
|
|
44
|
+
/**
|
|
45
|
+
* Identifies the format of a verified credential returned for an authenticated
|
|
46
|
+
* user.
|
|
47
|
+
*
|
|
48
|
+
* @see User
|
|
49
|
+
* @see getUserSocialAccounts
|
|
50
|
+
*/
|
|
51
|
+
const JwtVerifiedCredentialFormatEnum = _dynamic_labs_sdk_api_core.JwtVerifiedCredentialFormatEnum;
|
|
52
|
+
/**
|
|
53
|
+
* Identifies the social provider associated with an authenticated credential.
|
|
54
|
+
*
|
|
55
|
+
* @see User
|
|
56
|
+
* @see signInWithSocialPopUp
|
|
57
|
+
*/
|
|
58
|
+
const ProviderEnum = _dynamic_labs_sdk_api_core.ProviderEnum;
|
|
40
59
|
|
|
41
60
|
//#endregion
|
|
42
61
|
//#region src/services/runtimeServices/createRuntimeServices/createRuntimeServices.ts
|
|
@@ -55,6 +74,15 @@ const createRuntimeServices = () => {
|
|
|
55
74
|
};
|
|
56
75
|
};
|
|
57
76
|
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.ts
|
|
79
|
+
/** @notInstrumented */
|
|
80
|
+
const prefetchNoncesIfNeeded = async (client) => {
|
|
81
|
+
const stored = await require_logoutWithReason.updateNoncePoolStorage({ update: () => null }, client);
|
|
82
|
+
if (stored !== null && stored.expiration > Date.now() && stored.nonces.length >= require_logoutWithReason.NONCE_POOL_SIZE) return;
|
|
83
|
+
await require_logoutWithReason.fetchAndStoreNonces(client);
|
|
84
|
+
};
|
|
85
|
+
|
|
58
86
|
//#endregion
|
|
59
87
|
//#region src/modules/auth/initializeAuth/setLongTimeout/setLongTimeout.ts
|
|
60
88
|
/**
|
|
@@ -85,7 +113,7 @@ const setLongTimeout = ({ callback, delay }) => {
|
|
|
85
113
|
* @notInstrumented
|
|
86
114
|
*/
|
|
87
115
|
const initializeAuth = (client) => {
|
|
88
|
-
const core =
|
|
116
|
+
const core = require_logoutWithReason.getCore(client);
|
|
89
117
|
let clearExpirationTimeout = null;
|
|
90
118
|
const onChangeExpiration = require_getNetworkProviderFromNetworkId.subscribeWithSelector(core.state, (state) => state.sessionExpiresAt);
|
|
91
119
|
const checkExpiration = () => {
|
|
@@ -95,7 +123,7 @@ const initializeAuth = (client) => {
|
|
|
95
123
|
const now = /* @__PURE__ */ new Date();
|
|
96
124
|
const timeUntilExpiration = expiration.getTime() - now.getTime();
|
|
97
125
|
if (timeUntilExpiration <= 0) {
|
|
98
|
-
|
|
126
|
+
require_logoutWithReason.__logoutWithReason_wrapped({ reason: "token-expired" }, client);
|
|
99
127
|
return;
|
|
100
128
|
}
|
|
101
129
|
clearExpirationTimeout = setLongTimeout({
|
|
@@ -127,13 +155,13 @@ const initializeAuth = (client) => {
|
|
|
127
155
|
* @notInstrumented
|
|
128
156
|
*/
|
|
129
157
|
const setupCrossTabEventSync = (client) => {
|
|
130
|
-
const core =
|
|
158
|
+
const core = require_logoutWithReason.getCore(client);
|
|
131
159
|
const handleDeviceRegistrationCompleted = () => {
|
|
132
160
|
core.crossTabBroadcast.send({ event: "deviceRegistrationCompleted" });
|
|
133
161
|
};
|
|
134
162
|
core.eventEmitter.on("deviceRegistrationCompleted", handleDeviceRegistrationCompleted);
|
|
135
163
|
const handleCrossTabDeviceRegistrationCompleted = () => {
|
|
136
|
-
|
|
164
|
+
require_logoutWithReason.emitEvent({ event: "deviceRegistrationCompletedInAnotherTab" }, client);
|
|
137
165
|
};
|
|
138
166
|
core.crossTabBroadcast.on("deviceRegistrationCompleted", handleCrossTabDeviceRegistrationCompleted);
|
|
139
167
|
};
|
|
@@ -160,7 +188,7 @@ const walletProviderKeyMapSchema = zod_mini.record(zod_mini.string(), zod_mini.s
|
|
|
160
188
|
|
|
161
189
|
//#endregion
|
|
162
190
|
//#region src/modules/storageSync/schema.ts
|
|
163
|
-
const stateStorageKeySchema =
|
|
191
|
+
const stateStorageKeySchema = require_logoutWithReason.createStorageKeySchema({
|
|
164
192
|
key: "state",
|
|
165
193
|
schema: zod_mini.object({
|
|
166
194
|
apiVersion: zod_mini.string(),
|
|
@@ -170,7 +198,7 @@ const stateStorageKeySchema = require_updateAuthFromVerifyResponse.createStorage
|
|
|
170
198
|
walletProviderKeyMap: walletProviderKeyMapSchema
|
|
171
199
|
})
|
|
172
200
|
});
|
|
173
|
-
const sessionStorageKeySchema =
|
|
201
|
+
const sessionStorageKeySchema = require_logoutWithReason.createStorageKeySchema({
|
|
174
202
|
config: { storageTier: "secure" },
|
|
175
203
|
key: "session",
|
|
176
204
|
schema: zod_mini.object({
|
|
@@ -191,7 +219,7 @@ const sessionStorageKeySchema = require_updateAuthFromVerifyResponse.createStora
|
|
|
191
219
|
|
|
192
220
|
//#endregion
|
|
193
221
|
//#region src/modules/keychainMigration/migrateSessionKeyToKeychain/KeyMigrationError.ts
|
|
194
|
-
var KeyMigrationError = class extends
|
|
222
|
+
var KeyMigrationError = class extends require_logoutWithReason.BaseError {
|
|
195
223
|
constructor(expectedPublicKey, importedPublicKey) {
|
|
196
224
|
super({
|
|
197
225
|
cause: null,
|
|
@@ -261,10 +289,10 @@ const migrateSessionKeyToKeychain = async ({ keychain, logger, state, storage })
|
|
|
261
289
|
//#region src/modules/state/raiseStateEvents/raiseStateEvents.ts
|
|
262
290
|
/** @notInstrumented */
|
|
263
291
|
const raiseStateEvents = (client) => {
|
|
264
|
-
|
|
292
|
+
require_logoutWithReason.getCore(client).state.subscribe((value, previous) => {
|
|
265
293
|
Object.entries(stateChangeEvents).forEach(([key, event]) => {
|
|
266
294
|
if (require_getNetworkProviderFromNetworkId.isEqualShallow(value[key], previous[key])) return;
|
|
267
|
-
|
|
295
|
+
require_logoutWithReason.emitEvent({
|
|
268
296
|
args: { [key]: value[key] },
|
|
269
297
|
event
|
|
270
298
|
}, client);
|
|
@@ -276,7 +304,7 @@ const raiseStateEvents = (client) => {
|
|
|
276
304
|
//#region src/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.ts
|
|
277
305
|
/** @notInstrumented */
|
|
278
306
|
const hydrateStateWithStorage = async (client) => {
|
|
279
|
-
const core =
|
|
307
|
+
const core = require_logoutWithReason.getCore(client);
|
|
280
308
|
const previousState = core.state.get();
|
|
281
309
|
const stateChanges = {};
|
|
282
310
|
const session = await core.storage.getItem(sessionStorageKeySchema);
|
|
@@ -296,21 +324,21 @@ const hydrateStateWithStorage = async (client) => {
|
|
|
296
324
|
stateChanges.sessionKeys = session.sessionKeys;
|
|
297
325
|
}
|
|
298
326
|
const storedState = await core.storage.getItem(stateStorageKeySchema);
|
|
299
|
-
if (storedState?.apiVersion ===
|
|
327
|
+
if (storedState?.apiVersion === require_logoutWithReason.SDK_API_CORE_VERSION) {
|
|
300
328
|
stateChanges.unverifiedWalletAccounts = storedState.unverifiedWalletAccounts;
|
|
301
329
|
stateChanges.walletProviderKeyMap = storedState.walletProviderKeyMap;
|
|
302
330
|
if (isSessionValid) stateChanges.user = storedState.user;
|
|
303
331
|
if (isSessionValid || (storedState.unverifiedWalletAccounts ?? []).length > 0) stateChanges.projectSettings = storedState.projectSettings;
|
|
304
332
|
}
|
|
305
333
|
if (Object.keys(stateChanges).length > 0) core.state.set(stateChanges);
|
|
306
|
-
|
|
334
|
+
require_logoutWithReason.checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);
|
|
307
335
|
};
|
|
308
336
|
|
|
309
337
|
//#endregion
|
|
310
338
|
//#region src/modules/storageSync/syncStateWithStorage/syncStateWithStorage.ts
|
|
311
339
|
/** @notInstrumented */
|
|
312
340
|
const syncStateWithStorage = (client) => {
|
|
313
|
-
const core =
|
|
341
|
+
const core = require_logoutWithReason.getCore(client);
|
|
314
342
|
core.state.subscribe((state) => {
|
|
315
343
|
if (state.sessionExpiresAt === null) core.storage.removeItem(sessionStorageKeySchema);
|
|
316
344
|
else core.storage.setItem(sessionStorageKeySchema, {
|
|
@@ -328,7 +356,7 @@ const syncStateWithStorage = (client) => {
|
|
|
328
356
|
token: state.token
|
|
329
357
|
});
|
|
330
358
|
core.storage.setItem(stateStorageKeySchema, {
|
|
331
|
-
apiVersion:
|
|
359
|
+
apiVersion: require_logoutWithReason.SDK_API_CORE_VERSION,
|
|
332
360
|
projectSettings: state.projectSettings,
|
|
333
361
|
unverifiedWalletAccounts: state.unverifiedWalletAccounts,
|
|
334
362
|
user: state.user,
|
|
@@ -351,7 +379,7 @@ const initializeStorageSync = async (client) => {
|
|
|
351
379
|
* Refreshes the current user's profile from the server.
|
|
352
380
|
*
|
|
353
381
|
* This fetches the latest authenticated user from the backend and updates only
|
|
354
|
-
* the local user state, returning the `
|
|
382
|
+
* the local user state, returning the `User`. It does not touch the auth
|
|
355
383
|
* token — use it when you just need up-to-date user data.
|
|
356
384
|
*
|
|
357
385
|
* Prefer `refreshAuth` when you need to rotate the auth token as well: it runs
|
|
@@ -371,22 +399,22 @@ const initializeStorageSync = async (client) => {
|
|
|
371
399
|
* @instrumented
|
|
372
400
|
* @noHook Low-level refresh primitive that is not exposed as a React hook.
|
|
373
401
|
*/
|
|
374
|
-
const refreshUser = async (client =
|
|
375
|
-
const core =
|
|
376
|
-
const apiClient =
|
|
402
|
+
const refreshUser = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
403
|
+
const core = require_logoutWithReason.getCore(client);
|
|
404
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
377
405
|
const previousState = { ...core.state.get() };
|
|
378
406
|
const user = await apiClient.getAuthenticatedUser({ environmentId: core.environmentId });
|
|
379
407
|
core.state.set({ user });
|
|
380
|
-
|
|
408
|
+
require_logoutWithReason.checkAndRaiseWalletAccountsChangedEvent({ previousState }, client);
|
|
381
409
|
return user;
|
|
382
410
|
};
|
|
383
411
|
const __refreshUser_impl = refreshUser;
|
|
384
|
-
const __refreshUser_wrapped =
|
|
412
|
+
const __refreshUser_wrapped = require_logoutWithReason.instrumentFunction({
|
|
385
413
|
fn: __refreshUser_impl,
|
|
386
414
|
functionName: "refreshUser",
|
|
387
415
|
getCore: () => {
|
|
388
416
|
try {
|
|
389
|
-
return
|
|
417
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
390
418
|
} catch {
|
|
391
419
|
return;
|
|
392
420
|
}
|
|
@@ -395,7 +423,7 @@ const __refreshUser_wrapped = require_updateAuthFromVerifyResponse.instrumentFun
|
|
|
395
423
|
|
|
396
424
|
//#endregion
|
|
397
425
|
//#region src/errors/ClientAlreadyInitializedError.ts
|
|
398
|
-
var ClientAlreadyInitializedError = class extends
|
|
426
|
+
var ClientAlreadyInitializedError = class extends require_logoutWithReason.BaseError {
|
|
399
427
|
constructor() {
|
|
400
428
|
super({
|
|
401
429
|
cause: null,
|
|
@@ -425,19 +453,19 @@ var ClientAlreadyInitializedError = class extends require_updateAuthFromVerifyRe
|
|
|
425
453
|
* @notInstrumented
|
|
426
454
|
*/
|
|
427
455
|
const logoutIfSessionPublicKeyMismatched = async (client) => {
|
|
428
|
-
const core =
|
|
456
|
+
const core = require_logoutWithReason.getCore(client);
|
|
429
457
|
const { sessionKeys, token } = core.state.get();
|
|
430
458
|
if (!sessionKeys || !token) return;
|
|
431
459
|
let tokenSessionPublicKey;
|
|
432
460
|
try {
|
|
433
|
-
({sessionPublicKey: tokenSessionPublicKey} =
|
|
461
|
+
({sessionPublicKey: tokenSessionPublicKey} = require_logoutWithReason.decodeJwt(token));
|
|
434
462
|
} catch (error) {
|
|
435
463
|
core.logger.error("[logoutIfSessionPublicKeyMismatched] Failed to decode token", error);
|
|
436
464
|
return;
|
|
437
465
|
}
|
|
438
466
|
if (tokenSessionPublicKey && tokenSessionPublicKey !== sessionKeys) {
|
|
439
467
|
core.logger.error("[logoutIfSessionPublicKeyMismatched] Session key does not match token claim");
|
|
440
|
-
await
|
|
468
|
+
await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "session-public-key-mismatch" }, client);
|
|
441
469
|
}
|
|
442
470
|
};
|
|
443
471
|
|
|
@@ -474,8 +502,8 @@ const logoutIfSessionPublicKeyMismatched = async (client) => {
|
|
|
474
502
|
* @instrumented
|
|
475
503
|
* @noHook Client lifecycle management is not exposed as a React hook.
|
|
476
504
|
*/
|
|
477
|
-
const initializeClient = async (client =
|
|
478
|
-
const core =
|
|
505
|
+
const initializeClient = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
506
|
+
const core = require_logoutWithReason.getCore(client);
|
|
479
507
|
core.logger.debug("[initializeClient] Initializing client. Current init status", core.state.get().initStatus);
|
|
480
508
|
if (core.state.get().initStatus !== "uninitialized") throw new ClientAlreadyInitializedError();
|
|
481
509
|
core.state.set({
|
|
@@ -492,11 +520,11 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
492
520
|
logger: core.logger,
|
|
493
521
|
state: core.state,
|
|
494
522
|
storage: core.storage
|
|
495
|
-
}).catch(() =>
|
|
496
|
-
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await
|
|
523
|
+
}).catch(() => require_logoutWithReason.__logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
|
|
524
|
+
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
|
|
497
525
|
await logoutIfSessionPublicKeyMismatched(client);
|
|
498
526
|
}).then(async () => {
|
|
499
|
-
if (!core.state.get().projectSettings) await
|
|
527
|
+
if (!core.state.get().projectSettings) await require_logoutWithReason.fetchProjectSettings(client);
|
|
500
528
|
});
|
|
501
529
|
fetchProjectSettingsPromise.then(() => prefetchNoncesIfNeeded(client)).catch((error) => {
|
|
502
530
|
core.logger.error("Failed to prefetch nonces:", error);
|
|
@@ -505,7 +533,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
505
533
|
* Generate session keys if they don't exist
|
|
506
534
|
*/
|
|
507
535
|
const generateSessionKeysPromise = fetchProjectSettingsPromise.then(async () => {
|
|
508
|
-
if (!core.state.get().sessionKeys) await
|
|
536
|
+
if (!core.state.get().sessionKeys) await require_logoutWithReason.generateSessionKeys(client);
|
|
509
537
|
});
|
|
510
538
|
/**
|
|
511
539
|
* Refresh user state on initialization when cookie is enabled.
|
|
@@ -527,10 +555,10 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
527
555
|
* This call can fail with a 401 error if the user is not logged in and the SDK should finish its initialization process
|
|
528
556
|
* without throwing an error because that is an expected behavior.
|
|
529
557
|
*/
|
|
530
|
-
if (
|
|
558
|
+
if (require_logoutWithReason.isCookieEnabled(client)) await require_logoutWithReason.__refreshAuth_wrapped(client).catch(async (error) => {
|
|
531
559
|
if (error.status === 401) {
|
|
532
560
|
core.logger.error("Session expired during initialization", error);
|
|
533
|
-
if (client.user) await
|
|
561
|
+
if (client.user) await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "session-refresh-unauthorized" }, client);
|
|
534
562
|
} else throw error;
|
|
535
563
|
});
|
|
536
564
|
});
|
|
@@ -541,7 +569,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
541
569
|
*/
|
|
542
570
|
const refreshUserStateFromValidTokenPromise = refreshUserStateFromCookiePromise.then(async () => {
|
|
543
571
|
if (core.state.get().token && !core.state.get().user) await __refreshUser_wrapped(client).catch(async () => {
|
|
544
|
-
await
|
|
572
|
+
await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "user-refresh-failed" }, client);
|
|
545
573
|
});
|
|
546
574
|
});
|
|
547
575
|
core.initTrack.track({
|
|
@@ -575,15 +603,15 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
575
603
|
});
|
|
576
604
|
throw error;
|
|
577
605
|
}
|
|
578
|
-
if (client.user)
|
|
606
|
+
if (client.user) require_logoutWithReason.initializeWaasClientsForEagerRecovery(client);
|
|
579
607
|
};
|
|
580
608
|
const __initializeClient_impl = initializeClient;
|
|
581
|
-
const __initializeClient_wrapped =
|
|
609
|
+
const __initializeClient_wrapped = require_logoutWithReason.instrumentFunction({
|
|
582
610
|
fn: __initializeClient_impl,
|
|
583
611
|
functionName: "initializeClient",
|
|
584
612
|
getCore: () => {
|
|
585
613
|
try {
|
|
586
|
-
return
|
|
614
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
587
615
|
} catch {
|
|
588
616
|
return;
|
|
589
617
|
}
|
|
@@ -648,11 +676,6 @@ const createAsyncTrack = () => {
|
|
|
648
676
|
};
|
|
649
677
|
};
|
|
650
678
|
|
|
651
|
-
//#endregion
|
|
652
|
-
//#region src/services/eventEmitter/createEventEmitter.ts
|
|
653
|
-
/** @notInstrumented */
|
|
654
|
-
const createEventEmitter = () => new eventemitter3.default();
|
|
655
|
-
|
|
656
679
|
//#endregion
|
|
657
680
|
//#region src/services/fetch/createWebFetch.ts
|
|
658
681
|
/**
|
|
@@ -681,22 +704,22 @@ const connectLoggerToInstrumentation = ({ environmentId, extensions, instrumenta
|
|
|
681
704
|
const { token, user } = state.get();
|
|
682
705
|
instrumentation.log({
|
|
683
706
|
environmentId,
|
|
684
|
-
operatingSystem:
|
|
685
|
-
parameters:
|
|
707
|
+
operatingSystem: require_logoutWithReason.getOperatingSystem(),
|
|
708
|
+
parameters: require_logoutWithReason.scrubParameters({
|
|
686
709
|
piiFields: instrumentation.config.piiFields,
|
|
687
710
|
value: {
|
|
688
711
|
args,
|
|
689
712
|
message
|
|
690
713
|
}
|
|
691
714
|
}),
|
|
692
|
-
platform:
|
|
715
|
+
platform: require_logoutWithReason.getPlatform(),
|
|
693
716
|
registeredExtensionKeys: Array.from(extensions),
|
|
694
717
|
sdkSessionId,
|
|
695
718
|
sdkVersion,
|
|
696
719
|
status: "error",
|
|
697
720
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
698
|
-
tokenSessionId: token ?
|
|
699
|
-
userAgent:
|
|
721
|
+
tokenSessionId: token ? require_logoutWithReason.extractSessionId(token) : null,
|
|
722
|
+
userAgent: require_logoutWithReason.getUserAgent(),
|
|
700
723
|
userId: user?.id ?? null
|
|
701
724
|
});
|
|
702
725
|
});
|
|
@@ -705,7 +728,7 @@ const connectLoggerToInstrumentation = ({ environmentId, extensions, instrumenta
|
|
|
705
728
|
//#endregion
|
|
706
729
|
//#region src/services/instrumentation/createInstrumentation/createInstrumentation.ts
|
|
707
730
|
const buildPiiFields = (customFields = []) => {
|
|
708
|
-
const merged = [...
|
|
731
|
+
const merged = [...require_logoutWithReason.DEFAULT_PII_FIELDS, ...customFields];
|
|
709
732
|
return [...new Set(merged)];
|
|
710
733
|
};
|
|
711
734
|
/**
|
|
@@ -862,7 +885,7 @@ const createDebouncedMutex = () => {
|
|
|
862
885
|
timer: null
|
|
863
886
|
});
|
|
864
887
|
const currentState = mutexState.get(lockKey);
|
|
865
|
-
|
|
888
|
+
require_logoutWithReason.assertDefined(currentState, `Mutex state for key ${lockKey} not found`);
|
|
866
889
|
currentState.resolutionPromises.push(resolutionPromise);
|
|
867
890
|
if (currentState.timer) clearTimeout(currentState.timer);
|
|
868
891
|
currentState.nextCallback = callback;
|
|
@@ -889,7 +912,7 @@ const createDebouncedMutex = () => {
|
|
|
889
912
|
|
|
890
913
|
//#endregion
|
|
891
914
|
//#region src/errors/InvalidStorageValue.ts
|
|
892
|
-
var InvalidStorageValue = class extends
|
|
915
|
+
var InvalidStorageValue = class extends require_logoutWithReason.BaseError {
|
|
893
916
|
constructor(key, value) {
|
|
894
917
|
super({
|
|
895
918
|
cause: null,
|
|
@@ -1018,9 +1041,9 @@ const createCore = (config) => {
|
|
|
1018
1041
|
const navigate = config.coreConfig?.navigate ?? createNavigationHandler();
|
|
1019
1042
|
const state = createObservableState(getInitialState);
|
|
1020
1043
|
const debouncedMutex = createDebouncedMutex();
|
|
1021
|
-
const eventEmitter = createEventEmitter();
|
|
1044
|
+
const eventEmitter = require_getNetworkProviderFromNetworkId.createEventEmitter();
|
|
1022
1045
|
const initTrack = createAsyncTrack();
|
|
1023
|
-
const sdkSessionId =
|
|
1046
|
+
const sdkSessionId = require_logoutWithReason.randomString({ length: 32 });
|
|
1024
1047
|
const instrumentation = createInstrumentation({ config: config.instrumentation });
|
|
1025
1048
|
const extensions = /* @__PURE__ */ new Set();
|
|
1026
1049
|
connectLoggerToInstrumentation({
|
|
@@ -1029,7 +1052,7 @@ const createCore = (config) => {
|
|
|
1029
1052
|
instrumentation,
|
|
1030
1053
|
logger,
|
|
1031
1054
|
sdkSessionId,
|
|
1032
|
-
sdkVersion:
|
|
1055
|
+
sdkVersion: require_logoutWithReason.version,
|
|
1033
1056
|
state
|
|
1034
1057
|
});
|
|
1035
1058
|
if (!require_getNetworkProviderFromNetworkId.isServerSideRendering()) instrumentation.setTransport(createDynamicTransport({
|
|
@@ -1071,7 +1094,7 @@ const createCore = (config) => {
|
|
|
1071
1094
|
storage,
|
|
1072
1095
|
subscribeToAppForeground,
|
|
1073
1096
|
transformers: config.transformers,
|
|
1074
|
-
version:
|
|
1097
|
+
version: require_logoutWithReason.version,
|
|
1075
1098
|
waas: config.waas
|
|
1076
1099
|
};
|
|
1077
1100
|
};
|
|
@@ -1097,9 +1120,9 @@ const MAX_MAX_LOAD_RETRIES = 10;
|
|
|
1097
1120
|
*/
|
|
1098
1121
|
const assertClientProps = (config) => {
|
|
1099
1122
|
const loadTimeoutMs = config.waas?.loadTimeoutMs;
|
|
1100
|
-
if (loadTimeoutMs !== void 0 && (!Number.isFinite(loadTimeoutMs) || loadTimeoutMs < MIN_LOAD_TIMEOUT_MS || loadTimeoutMs > MAX_LOAD_TIMEOUT_MS)) throw new
|
|
1123
|
+
if (loadTimeoutMs !== void 0 && (!Number.isFinite(loadTimeoutMs) || loadTimeoutMs < MIN_LOAD_TIMEOUT_MS || loadTimeoutMs > MAX_LOAD_TIMEOUT_MS)) throw new require_logoutWithReason.InvalidParamError(`waas.loadTimeoutMs must be a number between ${MIN_LOAD_TIMEOUT_MS} and ${MAX_LOAD_TIMEOUT_MS}`);
|
|
1101
1124
|
const maxLoadRetries = config.waas?.maxLoadRetries;
|
|
1102
|
-
if (maxLoadRetries !== void 0 && (!Number.isInteger(maxLoadRetries) || maxLoadRetries < MIN_MAX_LOAD_RETRIES || maxLoadRetries > MAX_MAX_LOAD_RETRIES)) throw new
|
|
1125
|
+
if (maxLoadRetries !== void 0 && (!Number.isInteger(maxLoadRetries) || maxLoadRetries < MIN_MAX_LOAD_RETRIES || maxLoadRetries > MAX_MAX_LOAD_RETRIES)) throw new require_logoutWithReason.InvalidParamError(`waas.maxLoadRetries must be an integer between ${MIN_MAX_LOAD_RETRIES} and ${MAX_MAX_LOAD_RETRIES}`);
|
|
1103
1126
|
};
|
|
1104
1127
|
|
|
1105
1128
|
//#endregion
|
|
@@ -1165,16 +1188,16 @@ const createDynamicClient = (config) => {
|
|
|
1165
1188
|
core.logger.debug("[createDynamicClient] Initializing client...");
|
|
1166
1189
|
__initializeClient_wrapped(client);
|
|
1167
1190
|
}
|
|
1168
|
-
|
|
1191
|
+
require_logoutWithReason.setDefaultClient(client);
|
|
1169
1192
|
return client;
|
|
1170
1193
|
};
|
|
1171
1194
|
const __createDynamicClient_impl = createDynamicClient;
|
|
1172
|
-
const __createDynamicClient_wrapped =
|
|
1195
|
+
const __createDynamicClient_wrapped = require_logoutWithReason.instrumentFunction({
|
|
1173
1196
|
fn: __createDynamicClient_impl,
|
|
1174
1197
|
functionName: "createDynamicClient",
|
|
1175
1198
|
getCore: () => {
|
|
1176
1199
|
try {
|
|
1177
|
-
return
|
|
1200
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
1178
1201
|
} catch {
|
|
1179
1202
|
return;
|
|
1180
1203
|
}
|
|
@@ -1183,7 +1206,7 @@ const __createDynamicClient_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
1183
1206
|
|
|
1184
1207
|
//#endregion
|
|
1185
1208
|
//#region src/errors/CheckoutSessionTokenMissingError.ts
|
|
1186
|
-
var CheckoutSessionTokenMissingError = class extends
|
|
1209
|
+
var CheckoutSessionTokenMissingError = class extends require_logoutWithReason.BaseError {
|
|
1187
1210
|
constructor({ transactionId }) {
|
|
1188
1211
|
super({
|
|
1189
1212
|
cause: null,
|
|
@@ -1226,7 +1249,7 @@ var CheckoutSessionTokenMissingError = class extends require_updateAuthFromVerif
|
|
|
1226
1249
|
* @see createCoinbaseExchangeTransfer
|
|
1227
1250
|
* @see CoinbaseTransferMfaRequiredError
|
|
1228
1251
|
*/
|
|
1229
|
-
var CoinbaseTransferMfaFailedError = class extends
|
|
1252
|
+
var CoinbaseTransferMfaFailedError = class extends require_logoutWithReason.BaseError {
|
|
1230
1253
|
constructor({ cause }) {
|
|
1231
1254
|
super({
|
|
1232
1255
|
cause,
|
|
@@ -1272,7 +1295,7 @@ var CoinbaseTransferMfaFailedError = class extends require_updateAuthFromVerifyR
|
|
|
1272
1295
|
* @see createCoinbaseExchangeTransfer
|
|
1273
1296
|
* @see CoinbaseTransferMfaFailedError
|
|
1274
1297
|
*/
|
|
1275
|
-
var CoinbaseTransferMfaRequiredError = class extends
|
|
1298
|
+
var CoinbaseTransferMfaRequiredError = class extends require_logoutWithReason.BaseError {
|
|
1276
1299
|
constructor({ cause }) {
|
|
1277
1300
|
super({
|
|
1278
1301
|
cause,
|
|
@@ -1324,7 +1347,7 @@ var CoinbaseTransferMfaRequiredError = class extends require_updateAuthFromVerif
|
|
|
1324
1347
|
* @see CoinbaseTravelRuleFieldName
|
|
1325
1348
|
* @see https://docs.cdp.coinbase.com/coinbase-app/transfer-apis/travel-rule
|
|
1326
1349
|
*/
|
|
1327
|
-
var CoinbaseTravelRuleRequiredError = class extends
|
|
1350
|
+
var CoinbaseTravelRuleRequiredError = class extends require_logoutWithReason.BaseError {
|
|
1328
1351
|
missingFields;
|
|
1329
1352
|
constructor({ cause, missingFields }) {
|
|
1330
1353
|
super({
|
|
@@ -1341,7 +1364,7 @@ var CoinbaseTravelRuleRequiredError = class extends require_updateAuthFromVerify
|
|
|
1341
1364
|
|
|
1342
1365
|
//#endregion
|
|
1343
1366
|
//#region src/errors/DeeplinkConnectAndVerifyUnsupportedError.ts
|
|
1344
|
-
var DeeplinkConnectAndVerifyUnsupportedError = class extends
|
|
1367
|
+
var DeeplinkConnectAndVerifyUnsupportedError = class extends require_logoutWithReason.BaseError {
|
|
1345
1368
|
constructor({ walletProviderKey }) {
|
|
1346
1369
|
super({
|
|
1347
1370
|
cause: null,
|
|
@@ -1383,7 +1406,7 @@ var DeeplinkConnectAndVerifyUnsupportedError = class extends require_updateAuthF
|
|
|
1383
1406
|
* @see completeDeviceRegistration
|
|
1384
1407
|
* @see InvalidDeviceRegistrationRedirectError
|
|
1385
1408
|
*/
|
|
1386
|
-
var DeviceRegistrationIdentityMismatchError = class extends
|
|
1409
|
+
var DeviceRegistrationIdentityMismatchError = class extends require_logoutWithReason.BaseError {
|
|
1387
1410
|
constructor() {
|
|
1388
1411
|
super({
|
|
1389
1412
|
cause: null,
|
|
@@ -1398,7 +1421,7 @@ var DeviceRegistrationIdentityMismatchError = class extends require_updateAuthFr
|
|
|
1398
1421
|
|
|
1399
1422
|
//#endregion
|
|
1400
1423
|
//#region src/errors/FeeEstimationFailedError.ts
|
|
1401
|
-
var FeeEstimationFailedError = class extends
|
|
1424
|
+
var FeeEstimationFailedError = class extends require_logoutWithReason.BaseError {
|
|
1402
1425
|
constructor(params) {
|
|
1403
1426
|
super({
|
|
1404
1427
|
cause: params.cause || null,
|
|
@@ -1412,7 +1435,7 @@ var FeeEstimationFailedError = class extends require_updateAuthFromVerifyRespons
|
|
|
1412
1435
|
|
|
1413
1436
|
//#endregion
|
|
1414
1437
|
//#region src/errors/FlowSessionTokenMissingError.ts
|
|
1415
|
-
var FlowSessionTokenMissingError = class extends
|
|
1438
|
+
var FlowSessionTokenMissingError = class extends require_logoutWithReason.BaseError {
|
|
1416
1439
|
constructor({ flowId }) {
|
|
1417
1440
|
super({
|
|
1418
1441
|
cause: null,
|
|
@@ -1426,7 +1449,7 @@ var FlowSessionTokenMissingError = class extends require_updateAuthFromVerifyRes
|
|
|
1426
1449
|
|
|
1427
1450
|
//#endregion
|
|
1428
1451
|
//#region src/errors/InvalidDeviceRegistrationRedirectError.ts
|
|
1429
|
-
var InvalidDeviceRegistrationRedirectError = class extends
|
|
1452
|
+
var InvalidDeviceRegistrationRedirectError = class extends require_logoutWithReason.BaseError {
|
|
1430
1453
|
constructor() {
|
|
1431
1454
|
super({
|
|
1432
1455
|
cause: null,
|
|
@@ -1441,7 +1464,7 @@ var InvalidDeviceRegistrationRedirectError = class extends require_updateAuthFro
|
|
|
1441
1464
|
|
|
1442
1465
|
//#endregion
|
|
1443
1466
|
//#region src/errors/InvalidRedirectStorageStateError.ts
|
|
1444
|
-
var InvalidRedirectStorageStateError = class extends
|
|
1467
|
+
var InvalidRedirectStorageStateError = class extends require_logoutWithReason.BaseError {
|
|
1445
1468
|
constructor() {
|
|
1446
1469
|
super({
|
|
1447
1470
|
cause: null,
|
|
@@ -1455,7 +1478,7 @@ var InvalidRedirectStorageStateError = class extends require_updateAuthFromVerif
|
|
|
1455
1478
|
|
|
1456
1479
|
//#endregion
|
|
1457
1480
|
//#region src/errors/InvalidSocialCallbackOriginError.ts
|
|
1458
|
-
var InvalidSocialCallbackOriginError = class extends
|
|
1481
|
+
var InvalidSocialCallbackOriginError = class extends require_logoutWithReason.BaseError {
|
|
1459
1482
|
constructor({ actualOrigin, expectedOrigin }) {
|
|
1460
1483
|
super({
|
|
1461
1484
|
cause: null,
|
|
@@ -1469,7 +1492,7 @@ var InvalidSocialCallbackOriginError = class extends require_updateAuthFromVerif
|
|
|
1469
1492
|
|
|
1470
1493
|
//#endregion
|
|
1471
1494
|
//#region src/errors/MissingRedirectStorageStateError.ts
|
|
1472
|
-
var MissingRedirectStorageStateError = class extends
|
|
1495
|
+
var MissingRedirectStorageStateError = class extends require_logoutWithReason.BaseError {
|
|
1473
1496
|
constructor() {
|
|
1474
1497
|
super({
|
|
1475
1498
|
cause: null,
|
|
@@ -1483,7 +1506,7 @@ var MissingRedirectStorageStateError = class extends require_updateAuthFromVerif
|
|
|
1483
1506
|
|
|
1484
1507
|
//#endregion
|
|
1485
1508
|
//#region src/errors/MissingSocialUrlParamError.ts
|
|
1486
|
-
var MissingSocialUrlParamError = class extends
|
|
1509
|
+
var MissingSocialUrlParamError = class extends require_logoutWithReason.BaseError {
|
|
1487
1510
|
constructor(param) {
|
|
1488
1511
|
super({
|
|
1489
1512
|
cause: null,
|
|
@@ -1497,7 +1520,7 @@ var MissingSocialUrlParamError = class extends require_updateAuthFromVerifyRespo
|
|
|
1497
1520
|
|
|
1498
1521
|
//#endregion
|
|
1499
1522
|
//#region src/errors/MissingUserVerificationError.ts
|
|
1500
|
-
var MissingUserVerificationError = class extends
|
|
1523
|
+
var MissingUserVerificationError = class extends require_logoutWithReason.BaseError {
|
|
1501
1524
|
informationToVerify;
|
|
1502
1525
|
constructor({ informationToVerify, message }) {
|
|
1503
1526
|
super({
|
|
@@ -1513,7 +1536,7 @@ var MissingUserVerificationError = class extends require_updateAuthFromVerifyRes
|
|
|
1513
1536
|
|
|
1514
1537
|
//#endregion
|
|
1515
1538
|
//#region src/errors/NetworkAddingUnavailableError.ts
|
|
1516
|
-
var NetworkAddingUnavailableError = class extends
|
|
1539
|
+
var NetworkAddingUnavailableError = class extends require_logoutWithReason.BaseError {
|
|
1517
1540
|
constructor({ walletProviderKey, originalError, extraMessages }) {
|
|
1518
1541
|
const cause = originalError instanceof Error ? originalError : null;
|
|
1519
1542
|
super({
|
|
@@ -1529,7 +1552,7 @@ var NetworkAddingUnavailableError = class extends require_updateAuthFromVerifyRe
|
|
|
1529
1552
|
|
|
1530
1553
|
//#endregion
|
|
1531
1554
|
//#region src/errors/NetworkNotAddedError.ts
|
|
1532
|
-
var NetworkNotAddedError = class extends
|
|
1555
|
+
var NetworkNotAddedError = class extends require_logoutWithReason.BaseError {
|
|
1533
1556
|
networkData;
|
|
1534
1557
|
constructor({ networkData, networkId, originalError, walletProviderKey }) {
|
|
1535
1558
|
const cause = originalError instanceof Error ? originalError : null;
|
|
@@ -1552,7 +1575,7 @@ var NetworkNotAddedError = class extends require_updateAuthFromVerifyResponse.Ba
|
|
|
1552
1575
|
|
|
1553
1576
|
//#endregion
|
|
1554
1577
|
//#region src/errors/NetworkSwitchingUnavailableError.ts
|
|
1555
|
-
var NetworkSwitchingUnavailableError = class extends
|
|
1578
|
+
var NetworkSwitchingUnavailableError = class extends require_logoutWithReason.BaseError {
|
|
1556
1579
|
constructor({ walletProviderKey, originalError, extraMessages }) {
|
|
1557
1580
|
const cause = originalError instanceof Error ? originalError : null;
|
|
1558
1581
|
super({
|
|
@@ -1568,7 +1591,7 @@ var NetworkSwitchingUnavailableError = class extends require_updateAuthFromVerif
|
|
|
1568
1591
|
|
|
1569
1592
|
//#endregion
|
|
1570
1593
|
//#region src/errors/NoAddressFoundError.ts
|
|
1571
|
-
var NoAddressFoundError = class extends
|
|
1594
|
+
var NoAddressFoundError = class extends require_logoutWithReason.BaseError {
|
|
1572
1595
|
constructor() {
|
|
1573
1596
|
super({
|
|
1574
1597
|
cause: null,
|
|
@@ -1582,7 +1605,7 @@ var NoAddressFoundError = class extends require_updateAuthFromVerifyResponse.Bas
|
|
|
1582
1605
|
|
|
1583
1606
|
//#endregion
|
|
1584
1607
|
//#region src/errors/NoPasskeyCredentialsFoundError.ts
|
|
1585
|
-
var NoPasskeyCredentialsFoundError = class extends
|
|
1608
|
+
var NoPasskeyCredentialsFoundError = class extends require_logoutWithReason.BaseError {
|
|
1586
1609
|
constructor() {
|
|
1587
1610
|
super({
|
|
1588
1611
|
cause: null,
|
|
@@ -1596,7 +1619,7 @@ var NoPasskeyCredentialsFoundError = class extends require_updateAuthFromVerifyR
|
|
|
1596
1619
|
|
|
1597
1620
|
//#endregion
|
|
1598
1621
|
//#region src/errors/NoSmartWalletAccountSignerFoundError.ts
|
|
1599
|
-
var NoSmartWalletAccountSignerFoundError = class extends
|
|
1622
|
+
var NoSmartWalletAccountSignerFoundError = class extends require_logoutWithReason.BaseError {
|
|
1600
1623
|
constructor(smartWalletAddress) {
|
|
1601
1624
|
super({
|
|
1602
1625
|
cause: null,
|
|
@@ -1610,7 +1633,7 @@ var NoSmartWalletAccountSignerFoundError = class extends require_updateAuthFromV
|
|
|
1610
1633
|
|
|
1611
1634
|
//#endregion
|
|
1612
1635
|
//#region src/errors/NoWebAuthNSupportError.ts
|
|
1613
|
-
var NoWebAuthNSupportError = class extends
|
|
1636
|
+
var NoWebAuthNSupportError = class extends require_logoutWithReason.BaseError {
|
|
1614
1637
|
constructor() {
|
|
1615
1638
|
super({
|
|
1616
1639
|
cause: null,
|
|
@@ -1642,7 +1665,7 @@ var NoWebAuthNSupportError = class extends require_updateAuthFromVerifyResponse.
|
|
|
1642
1665
|
* @see screenTransaction
|
|
1643
1666
|
* @see isExternalWalletScreeningEnabled
|
|
1644
1667
|
*/
|
|
1645
|
-
var ScreeningNotRequiredError = class extends
|
|
1668
|
+
var ScreeningNotRequiredError = class extends require_logoutWithReason.BaseError {
|
|
1646
1669
|
constructor() {
|
|
1647
1670
|
super({
|
|
1648
1671
|
cause: null,
|
|
@@ -1656,7 +1679,7 @@ var ScreeningNotRequiredError = class extends require_updateAuthFromVerifyRespon
|
|
|
1656
1679
|
|
|
1657
1680
|
//#endregion
|
|
1658
1681
|
//#region src/errors/SimulationFailedError.ts
|
|
1659
|
-
var SimulationFailedError = class extends
|
|
1682
|
+
var SimulationFailedError = class extends require_logoutWithReason.BaseError {
|
|
1660
1683
|
constructor(params) {
|
|
1661
1684
|
super({
|
|
1662
1685
|
cause: params.cause || null,
|
|
@@ -1670,7 +1693,7 @@ var SimulationFailedError = class extends require_updateAuthFromVerifyResponse.B
|
|
|
1670
1693
|
|
|
1671
1694
|
//#endregion
|
|
1672
1695
|
//#region src/errors/TokenSwapError.ts
|
|
1673
|
-
var TokenSwapError = class extends
|
|
1696
|
+
var TokenSwapError = class extends require_logoutWithReason.BaseError {
|
|
1674
1697
|
constructor({ message, originalError }) {
|
|
1675
1698
|
const cause = originalError && originalError instanceof Error ? originalError : null;
|
|
1676
1699
|
super({
|
|
@@ -1685,7 +1708,7 @@ var TokenSwapError = class extends require_updateAuthFromVerifyResponse.BaseErro
|
|
|
1685
1708
|
|
|
1686
1709
|
//#endregion
|
|
1687
1710
|
//#region src/errors/UnrecognizedNetworkError.ts
|
|
1688
|
-
var UnrecognizedNetworkError = class extends
|
|
1711
|
+
var UnrecognizedNetworkError = class extends require_logoutWithReason.BaseError {
|
|
1689
1712
|
constructor({ networkId, originalError, walletProviderKey }) {
|
|
1690
1713
|
const cause = originalError instanceof Error ? originalError : null;
|
|
1691
1714
|
super({
|
|
@@ -1701,7 +1724,7 @@ var UnrecognizedNetworkError = class extends require_updateAuthFromVerifyRespons
|
|
|
1701
1724
|
|
|
1702
1725
|
//#endregion
|
|
1703
1726
|
//#region src/errors/UserCancelledSocialPopUpError.ts
|
|
1704
|
-
var UserCancelledSocialPopUpError = class extends
|
|
1727
|
+
var UserCancelledSocialPopUpError = class extends require_logoutWithReason.BaseError {
|
|
1705
1728
|
constructor() {
|
|
1706
1729
|
super({
|
|
1707
1730
|
cause: null,
|
|
@@ -1715,7 +1738,7 @@ var UserCancelledSocialPopUpError = class extends require_updateAuthFromVerifyRe
|
|
|
1715
1738
|
|
|
1716
1739
|
//#endregion
|
|
1717
1740
|
//#region src/errors/UserNotAuthenticatedError.ts
|
|
1718
|
-
var UserNotAuthenticatedError = class extends
|
|
1741
|
+
var UserNotAuthenticatedError = class extends require_logoutWithReason.BaseError {
|
|
1719
1742
|
constructor({ shortMessage } = {}) {
|
|
1720
1743
|
super({
|
|
1721
1744
|
cause: null,
|
|
@@ -1729,7 +1752,7 @@ var UserNotAuthenticatedError = class extends require_updateAuthFromVerifyRespon
|
|
|
1729
1752
|
|
|
1730
1753
|
//#endregion
|
|
1731
1754
|
//#region src/errors/UserRejectedError.ts
|
|
1732
|
-
var UserRejectedError = class extends
|
|
1755
|
+
var UserRejectedError = class extends require_logoutWithReason.BaseError {
|
|
1733
1756
|
constructor({ action }) {
|
|
1734
1757
|
super({
|
|
1735
1758
|
cause: null,
|
|
@@ -1743,7 +1766,7 @@ var UserRejectedError = class extends require_updateAuthFromVerifyResponse.BaseE
|
|
|
1743
1766
|
|
|
1744
1767
|
//#endregion
|
|
1745
1768
|
//#region src/errors/WalletAccountAlreadyVerifiedError.ts
|
|
1746
|
-
var WalletAccountAlreadyVerifiedError = class extends
|
|
1769
|
+
var WalletAccountAlreadyVerifiedError = class extends require_logoutWithReason.BaseError {
|
|
1747
1770
|
constructor(address) {
|
|
1748
1771
|
super({
|
|
1749
1772
|
cause: null,
|
|
@@ -1757,7 +1780,7 @@ var WalletAccountAlreadyVerifiedError = class extends require_updateAuthFromVeri
|
|
|
1757
1780
|
|
|
1758
1781
|
//#endregion
|
|
1759
1782
|
//#region src/errors/WalletAccountNotSelectedError.ts
|
|
1760
|
-
var WalletAccountNotSelectedError = class extends
|
|
1783
|
+
var WalletAccountNotSelectedError = class extends require_logoutWithReason.BaseError {
|
|
1761
1784
|
expectedAddress;
|
|
1762
1785
|
selectedAddress;
|
|
1763
1786
|
constructor(params) {
|
|
@@ -1776,7 +1799,7 @@ var WalletAccountNotSelectedError = class extends require_updateAuthFromVerifyRe
|
|
|
1776
1799
|
|
|
1777
1800
|
//#endregion
|
|
1778
1801
|
//#region src/errors/WalletProviderMethodUnavailableError.ts
|
|
1779
|
-
var WalletProviderMethodUnavailableError = class extends
|
|
1802
|
+
var WalletProviderMethodUnavailableError = class extends require_logoutWithReason.BaseError {
|
|
1780
1803
|
constructor({ methodName, walletProviderKey }) {
|
|
1781
1804
|
super({
|
|
1782
1805
|
cause: null,
|
|
@@ -1823,8 +1846,8 @@ const STEP_UP_REQUIRED_DEFAULT = {
|
|
|
1823
1846
|
* ```
|
|
1824
1847
|
* @instrumented
|
|
1825
1848
|
*/
|
|
1826
|
-
const checkStepUpAuth = async ({ scope }, client =
|
|
1827
|
-
if (
|
|
1849
|
+
const checkStepUpAuth = async ({ scope }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
1850
|
+
if (require_logoutWithReason.getElevatedAccessToken({
|
|
1828
1851
|
consume: false,
|
|
1829
1852
|
scope
|
|
1830
1853
|
}, client)) return {
|
|
@@ -1832,8 +1855,8 @@ const checkStepUpAuth = async ({ scope }, client = require_updateAuthFromVerifyR
|
|
|
1832
1855
|
isRequired: false
|
|
1833
1856
|
};
|
|
1834
1857
|
try {
|
|
1835
|
-
const core =
|
|
1836
|
-
const response = await
|
|
1858
|
+
const core = require_logoutWithReason.getCore(client);
|
|
1859
|
+
const response = await require_logoutWithReason.createApiClient({}, client).stepUpCheck({
|
|
1837
1860
|
environmentId: core.environmentId,
|
|
1838
1861
|
stepUpCheckRequest: { scope }
|
|
1839
1862
|
});
|
|
@@ -1847,12 +1870,12 @@ const checkStepUpAuth = async ({ scope }, client = require_updateAuthFromVerifyR
|
|
|
1847
1870
|
}
|
|
1848
1871
|
};
|
|
1849
1872
|
const __checkStepUpAuth_impl = checkStepUpAuth;
|
|
1850
|
-
const __checkStepUpAuth_wrapped =
|
|
1873
|
+
const __checkStepUpAuth_wrapped = require_logoutWithReason.instrumentFunction({
|
|
1851
1874
|
fn: __checkStepUpAuth_impl,
|
|
1852
1875
|
functionName: "checkStepUpAuth",
|
|
1853
1876
|
getCore: () => {
|
|
1854
1877
|
try {
|
|
1855
|
-
return
|
|
1878
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
1856
1879
|
} catch {
|
|
1857
1880
|
return;
|
|
1858
1881
|
}
|
|
@@ -1876,16 +1899,16 @@ const __checkStepUpAuth_wrapped = require_updateAuthFromVerifyResponse.instrumen
|
|
|
1876
1899
|
* @returns A promise that resolves to the assertion response containing the elevated access token.
|
|
1877
1900
|
* @instrumented
|
|
1878
1901
|
*/
|
|
1879
|
-
const requestExternalAuthElevatedToken = async ({ externalJwt }, client =
|
|
1880
|
-
const core =
|
|
1881
|
-
const response = await
|
|
1902
|
+
const requestExternalAuthElevatedToken = async ({ externalJwt }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
1903
|
+
const core = require_logoutWithReason.getCore(client);
|
|
1904
|
+
const response = await require_logoutWithReason.createApiClient({}, client).externalAuthVerify({
|
|
1882
1905
|
environmentId: core.environmentId,
|
|
1883
1906
|
externalAuthSigninRequest: { jwt: externalJwt }
|
|
1884
1907
|
});
|
|
1885
|
-
const parsedToken =
|
|
1908
|
+
const parsedToken = require_logoutWithReason.parseElevatedAccessToken({ token: response.elevatedAccessToken });
|
|
1886
1909
|
if (parsedToken) {
|
|
1887
1910
|
const currentTokens = core.state.get().elevatedAccessTokens || [];
|
|
1888
|
-
core.state.set({ elevatedAccessTokens:
|
|
1911
|
+
core.state.set({ elevatedAccessTokens: require_logoutWithReason.upsertElevatedAccessToken({
|
|
1889
1912
|
currentTokens,
|
|
1890
1913
|
newToken: parsedToken
|
|
1891
1914
|
}) });
|
|
@@ -1893,12 +1916,12 @@ const requestExternalAuthElevatedToken = async ({ externalJwt }, client = requir
|
|
|
1893
1916
|
return response;
|
|
1894
1917
|
};
|
|
1895
1918
|
const __requestExternalAuthElevatedToken_impl = requestExternalAuthElevatedToken;
|
|
1896
|
-
const __requestExternalAuthElevatedToken_wrapped =
|
|
1919
|
+
const __requestExternalAuthElevatedToken_wrapped = require_logoutWithReason.instrumentFunction({
|
|
1897
1920
|
fn: __requestExternalAuthElevatedToken_impl,
|
|
1898
1921
|
functionName: "requestExternalAuthElevatedToken",
|
|
1899
1922
|
getCore: () => {
|
|
1900
1923
|
try {
|
|
1901
|
-
return
|
|
1924
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
1902
1925
|
} catch {
|
|
1903
1926
|
return;
|
|
1904
1927
|
}
|
|
@@ -1928,25 +1951,25 @@ const __requestExternalAuthElevatedToken_wrapped = require_updateAuthFromVerifyR
|
|
|
1928
1951
|
* @see refreshAuth
|
|
1929
1952
|
* @instrumented
|
|
1930
1953
|
*/
|
|
1931
|
-
const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client =
|
|
1932
|
-
const core =
|
|
1933
|
-
const response = await
|
|
1954
|
+
const signInWithExternalJwt = async ({ externalJwt, sessionPublicKey } = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
1955
|
+
const core = require_logoutWithReason.getCore(client);
|
|
1956
|
+
const response = await require_logoutWithReason.createApiClient({}, client).externalAuthSignin({
|
|
1934
1957
|
environmentId: core.environmentId,
|
|
1935
1958
|
externalAuthSigninRequest: {
|
|
1936
1959
|
jwt: externalJwt,
|
|
1937
1960
|
sessionPublicKey
|
|
1938
1961
|
}
|
|
1939
1962
|
});
|
|
1940
|
-
|
|
1963
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
1941
1964
|
return response;
|
|
1942
1965
|
};
|
|
1943
1966
|
const __signInWithExternalJwt_impl = signInWithExternalJwt;
|
|
1944
|
-
const __signInWithExternalJwt_wrapped =
|
|
1967
|
+
const __signInWithExternalJwt_wrapped = require_logoutWithReason.instrumentFunction({
|
|
1945
1968
|
fn: __signInWithExternalJwt_impl,
|
|
1946
1969
|
functionName: "signInWithExternalJwt",
|
|
1947
1970
|
getCore: () => {
|
|
1948
1971
|
try {
|
|
1949
|
-
return
|
|
1972
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
1950
1973
|
} catch {
|
|
1951
1974
|
return;
|
|
1952
1975
|
}
|
|
@@ -1975,14 +1998,14 @@ const __signInWithExternalJwt_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
1975
1998
|
* @see refreshAuth
|
|
1976
1999
|
* @notInstrumented
|
|
1977
2000
|
*/
|
|
1978
|
-
const logout = async (client =
|
|
2001
|
+
const logout = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
1979
2002
|
/**
|
|
1980
2003
|
* Delegates to `logoutWithReason` with `'user-intent'` so telemetry correctly
|
|
1981
2004
|
* attributes the logout to an explicit user action. Instrumentation lives on
|
|
1982
2005
|
* `logoutWithReason` — this wrapper is intentionally not instrumented so that
|
|
1983
2006
|
* Datadog sees a single function name per logout regardless of entry point.
|
|
1984
2007
|
*/
|
|
1985
|
-
return
|
|
2008
|
+
return require_logoutWithReason.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
|
|
1986
2009
|
};
|
|
1987
2010
|
|
|
1988
2011
|
//#endregion
|
|
@@ -2018,14 +2041,14 @@ const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultCl
|
|
|
2018
2041
|
* ```
|
|
2019
2042
|
* @param params.conflictResolutions - Optional per-field conflict resolutions.
|
|
2020
2043
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
2021
|
-
* @returns A promise that resolves to the merged
|
|
2044
|
+
* @returns A promise that resolves to the merged `User`.
|
|
2022
2045
|
* @see MergeAccountsConfirmationError
|
|
2023
2046
|
* @see MergeUserConflictResolution
|
|
2024
2047
|
* @notInstrumented
|
|
2025
2048
|
*/
|
|
2026
|
-
const mergeUserAccounts = async ({ conflictResolutions } = {}, client =
|
|
2027
|
-
const core =
|
|
2028
|
-
const apiClient =
|
|
2049
|
+
const mergeUserAccounts = async ({ conflictResolutions } = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2050
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2051
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
2029
2052
|
const hasConflictResolutions = conflictResolutions !== void 0 && conflictResolutions.length > 0;
|
|
2030
2053
|
let response;
|
|
2031
2054
|
if (hasConflictResolutions) response = await apiClient.verifyMergeUsers({
|
|
@@ -2033,7 +2056,7 @@ const mergeUserAccounts = async ({ conflictResolutions } = {}, client = require_
|
|
|
2033
2056
|
mergeUserConflictResolutions: { mergeUserResolutions: conflictResolutions }
|
|
2034
2057
|
});
|
|
2035
2058
|
else response = await apiClient.mergeUsers({ environmentId: core.environmentId });
|
|
2036
|
-
|
|
2059
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
2037
2060
|
return response.user;
|
|
2038
2061
|
};
|
|
2039
2062
|
|
|
@@ -2047,9 +2070,9 @@ const mergeUserAccounts = async ({ conflictResolutions } = {}, client = require_
|
|
|
2047
2070
|
* @returns A promise that resolves when the passkey is successfully deleted.
|
|
2048
2071
|
* @instrumented
|
|
2049
2072
|
*/
|
|
2050
|
-
const deletePasskey = async ({ passkeyId }, client =
|
|
2051
|
-
const core =
|
|
2052
|
-
await
|
|
2073
|
+
const deletePasskey = async ({ passkeyId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2074
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2075
|
+
await require_logoutWithReason.createApiClient({
|
|
2053
2076
|
elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink,
|
|
2054
2077
|
includeMfaToken: true
|
|
2055
2078
|
}, client).deletePasskey({
|
|
@@ -2058,12 +2081,12 @@ const deletePasskey = async ({ passkeyId }, client = require_updateAuthFromVerif
|
|
|
2058
2081
|
});
|
|
2059
2082
|
};
|
|
2060
2083
|
const __deletePasskey_impl = deletePasskey;
|
|
2061
|
-
const __deletePasskey_wrapped =
|
|
2084
|
+
const __deletePasskey_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2062
2085
|
fn: __deletePasskey_impl,
|
|
2063
2086
|
functionName: "deletePasskey",
|
|
2064
2087
|
getCore: () => {
|
|
2065
2088
|
try {
|
|
2066
|
-
return
|
|
2089
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2067
2090
|
} catch {
|
|
2068
2091
|
return;
|
|
2069
2092
|
}
|
|
@@ -2082,25 +2105,25 @@ const __deletePasskey_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
2082
2105
|
* @returns A promise that resolves to an array of the user's registered passkeys.
|
|
2083
2106
|
* @notInstrumented
|
|
2084
2107
|
*/
|
|
2085
|
-
const getPasskeys = async (client =
|
|
2086
|
-
const core =
|
|
2087
|
-
return (await
|
|
2108
|
+
const getPasskeys = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
2109
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2110
|
+
return (await require_logoutWithReason.createApiClient({}, client).getUserPasskeys({ environmentId: core.environmentId })).passkeys;
|
|
2088
2111
|
};
|
|
2089
2112
|
|
|
2090
2113
|
//#endregion
|
|
2091
2114
|
//#region src/modules/auth/passkeys/getPasskeyRegistrationOptions/getPasskeyRegistrationOptions.ts
|
|
2092
2115
|
/** @notInstrumented */
|
|
2093
2116
|
const getPasskeyRegistrationOptions = async (client) => {
|
|
2094
|
-
const core =
|
|
2095
|
-
return await
|
|
2117
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2118
|
+
return await require_logoutWithReason.createApiClient({}, client).getPasskeyRegistrationOptions({ environmentId: core.environmentId });
|
|
2096
2119
|
};
|
|
2097
2120
|
|
|
2098
2121
|
//#endregion
|
|
2099
2122
|
//#region src/modules/auth/passkeys/serverRegisterPasskey/serverRegisterPasskey.ts
|
|
2100
2123
|
/** @notInstrumented */
|
|
2101
2124
|
const serverRegisterPasskey = async ({ registration, createMfaToken }, client) => {
|
|
2102
|
-
const core =
|
|
2103
|
-
return await
|
|
2125
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2126
|
+
return await require_logoutWithReason.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentiallink }, client).registerPasskey({
|
|
2104
2127
|
environmentId: core.environmentId,
|
|
2105
2128
|
passkeyRegisterRequest: {
|
|
2106
2129
|
...registration,
|
|
@@ -2135,24 +2158,24 @@ const serverRegisterPasskey = async ({ registration, createMfaToken }, client) =
|
|
|
2135
2158
|
* @see getPasskeys
|
|
2136
2159
|
* @instrumented
|
|
2137
2160
|
*/
|
|
2138
|
-
const registerPasskey = async ({ createMfaToken } = {}, client =
|
|
2139
|
-
const core =
|
|
2161
|
+
const registerPasskey = async ({ createMfaToken } = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2162
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2140
2163
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
2141
2164
|
const options = await getPasskeyRegistrationOptions(client);
|
|
2142
2165
|
const response = await serverRegisterPasskey({
|
|
2143
2166
|
createMfaToken,
|
|
2144
2167
|
registration: await core.passkey.register({ optionsJSON: options })
|
|
2145
2168
|
}, client);
|
|
2146
|
-
|
|
2169
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
2147
2170
|
return response;
|
|
2148
2171
|
};
|
|
2149
2172
|
const __registerPasskey_impl = registerPasskey;
|
|
2150
|
-
const __registerPasskey_wrapped =
|
|
2173
|
+
const __registerPasskey_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2151
2174
|
fn: __registerPasskey_impl,
|
|
2152
2175
|
functionName: "registerPasskey",
|
|
2153
2176
|
getCore: () => {
|
|
2154
2177
|
try {
|
|
2155
|
-
return
|
|
2178
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2156
2179
|
} catch {
|
|
2157
2180
|
return;
|
|
2158
2181
|
}
|
|
@@ -2163,8 +2186,8 @@ const __registerPasskey_wrapped = require_updateAuthFromVerifyResponse.instrumen
|
|
|
2163
2186
|
//#region src/modules/auth/passkeys/getPasskeyAuthenticationSignInOptions/getPasskeyAuthenticationSignInOptions.ts
|
|
2164
2187
|
/** @notInstrumented */
|
|
2165
2188
|
const getPasskeyAuthenticationSignInOptions = async ({ relatedOriginRpId } = {}, client) => {
|
|
2166
|
-
const core =
|
|
2167
|
-
return await
|
|
2189
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2190
|
+
return await require_logoutWithReason.createApiClient({}, client).getPasskeyAuthenticationSigninOptions({
|
|
2168
2191
|
environmentId: core.environmentId,
|
|
2169
2192
|
relatedOriginRpId
|
|
2170
2193
|
});
|
|
@@ -2174,8 +2197,8 @@ const getPasskeyAuthenticationSignInOptions = async ({ relatedOriginRpId } = {},
|
|
|
2174
2197
|
//#region src/modules/auth/passkeys/serverSigninPasskey/serverSigninPasskey.ts
|
|
2175
2198
|
/** @notInstrumented */
|
|
2176
2199
|
const serverSigninPasskey = async ({ authentication, createMfaToken }, client) => {
|
|
2177
|
-
const core =
|
|
2178
|
-
return await
|
|
2200
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2201
|
+
return await require_logoutWithReason.createApiClient({}, client).signinWithPasskey({
|
|
2179
2202
|
environmentId: core.environmentId,
|
|
2180
2203
|
passkeyAuthRequest: {
|
|
2181
2204
|
...authentication,
|
|
@@ -2211,21 +2234,21 @@ const serverSigninPasskey = async ({ authentication, createMfaToken }, client) =
|
|
|
2211
2234
|
* @see getPasskeys
|
|
2212
2235
|
* @instrumented
|
|
2213
2236
|
*/
|
|
2214
|
-
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client =
|
|
2215
|
-
const core =
|
|
2237
|
+
const signInWithPasskey = async ({ relatedOriginRpId } = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2238
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2216
2239
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
2217
2240
|
const formattedOptions = { ...await getPasskeyAuthenticationSignInOptions({ relatedOriginRpId }, client) };
|
|
2218
2241
|
const response = await serverSigninPasskey({ authentication: await core.passkey.authenticate({ optionsJSON: formattedOptions }) }, client);
|
|
2219
|
-
|
|
2242
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
2220
2243
|
return response;
|
|
2221
2244
|
};
|
|
2222
2245
|
const __signInWithPasskey_impl = signInWithPasskey;
|
|
2223
|
-
const __signInWithPasskey_wrapped =
|
|
2246
|
+
const __signInWithPasskey_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2224
2247
|
fn: __signInWithPasskey_impl,
|
|
2225
2248
|
functionName: "signInWithPasskey",
|
|
2226
2249
|
getCore: () => {
|
|
2227
2250
|
try {
|
|
2228
|
-
return
|
|
2251
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2229
2252
|
} catch {
|
|
2230
2253
|
return;
|
|
2231
2254
|
}
|
|
@@ -2242,9 +2265,9 @@ const __signInWithPasskey_wrapped = require_updateAuthFromVerifyResponse.instrum
|
|
|
2242
2265
|
* @notInstrumented
|
|
2243
2266
|
* @hook Exposed as a hook so consumers get the reactive list of social accounts, updated when the user changes.
|
|
2244
2267
|
*/
|
|
2245
|
-
const getUserSocialAccounts = (client =
|
|
2268
|
+
const getUserSocialAccounts = (client = require_logoutWithReason.getDefaultClient()) => {
|
|
2246
2269
|
const { user } = client;
|
|
2247
|
-
|
|
2270
|
+
require_logoutWithReason.assertDefined(user, "User is not authenticated");
|
|
2248
2271
|
return (user.verifiedCredentials.filter((credential) => credential.format === _dynamic_labs_sdk_api_core.JwtVerifiedCredentialFormatEnum.Oauth) ?? []).map((credential) => ({
|
|
2249
2272
|
accountId: credential.oauthAccountId ?? void 0,
|
|
2250
2273
|
displayName: credential.oauthDisplayName ?? void 0,
|
|
@@ -2269,7 +2292,7 @@ const removeDynamicOauthParamsFromUrl = (url) => {
|
|
|
2269
2292
|
//#endregion
|
|
2270
2293
|
//#region src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts
|
|
2271
2294
|
/** The schema to track the state of the OAuth flow. */
|
|
2272
|
-
const redirectStateStorageKeySchema =
|
|
2295
|
+
const redirectStateStorageKeySchema = require_logoutWithReason.createStorageKeySchema({
|
|
2273
2296
|
key: "redirectState",
|
|
2274
2297
|
schema: zod_mini.object({
|
|
2275
2298
|
codeVerifier: zod_mini.optional(zod_mini.string()),
|
|
@@ -2308,9 +2331,9 @@ const APPLE_RESPONSE_TYPE = "code id_token";
|
|
|
2308
2331
|
/** Helper function to add OAuth URL parameters to a given base URL. * @notInstrumented
|
|
2309
2332
|
*/
|
|
2310
2333
|
const addOAuthUrlParams = ({ baseUrl, isGoogleDriveBackupEnabled, provider }) => {
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2334
|
+
require_logoutWithReason.assertDefined(provider.clientId, "Client ID not found");
|
|
2335
|
+
require_logoutWithReason.assertDefined(provider.provider, "Provider type not found");
|
|
2336
|
+
require_logoutWithReason.assertDefined(provider.redirectUrl, "Redirect URL not found");
|
|
2314
2337
|
const providerType = provider.provider;
|
|
2315
2338
|
baseUrl.searchParams.set("client_id", provider.clientId);
|
|
2316
2339
|
baseUrl.searchParams.set("response_type", "code");
|
|
@@ -2337,15 +2360,15 @@ const addOAuthUrlParams = ({ baseUrl, isGoogleDriveBackupEnabled, provider }) =>
|
|
|
2337
2360
|
* Resolves the raw base URL string for a provider before parsing/validation.
|
|
2338
2361
|
*/
|
|
2339
2362
|
const resolveBaseUrl = (provider) => {
|
|
2340
|
-
|
|
2363
|
+
require_logoutWithReason.assertDefined(provider.provider, "Provider type not found");
|
|
2341
2364
|
const providerType = provider.provider;
|
|
2342
2365
|
if (providerType === _dynamic_labs_sdk_api_core.ProviderEnum.Telegram) {
|
|
2343
|
-
|
|
2366
|
+
require_logoutWithReason.assertDefined(provider.authorizationUrl, "Telegram authorization URL not found");
|
|
2344
2367
|
return provider.authorizationUrl;
|
|
2345
2368
|
}
|
|
2346
|
-
|
|
2369
|
+
require_logoutWithReason.assertDefined(provider.baseAuthUrl, "Base auth URL not found");
|
|
2347
2370
|
if (providerType === _dynamic_labs_sdk_api_core.ProviderEnum.Shopify) {
|
|
2348
|
-
|
|
2371
|
+
require_logoutWithReason.assertDefined(provider.shopifyStore, "Shopify store value not found in provider");
|
|
2349
2372
|
return provider.baseAuthUrl.replace("{{shopifyStore}}", provider.shopifyStore);
|
|
2350
2373
|
}
|
|
2351
2374
|
return provider.baseAuthUrl;
|
|
@@ -2365,10 +2388,10 @@ const providersRequiringPkce = ["twitter", "github"];
|
|
|
2365
2388
|
*/
|
|
2366
2389
|
const buildOAuthUrl = async (core, provider) => {
|
|
2367
2390
|
const { projectSettings } = core.state.get();
|
|
2368
|
-
|
|
2369
|
-
|
|
2391
|
+
require_logoutWithReason.assertDefined(projectSettings, "Project settings not found");
|
|
2392
|
+
require_logoutWithReason.assertDefined(projectSettings.providers, "Project providers not found");
|
|
2370
2393
|
const socialProvider = projectSettings.providers.find((p) => p.provider === provider);
|
|
2371
|
-
|
|
2394
|
+
require_logoutWithReason.assertDefined(socialProvider, `Social provider ${provider} not supported`);
|
|
2372
2395
|
const isGoogleDriveBackupEnabled = projectSettings.sdk.waas?.backupOptions?.includes(_dynamic_labs_sdk_api_core.WaasBackupOptionsEnum.GoogleDrive);
|
|
2373
2396
|
const socialProviderUrl = addOAuthUrlParams({
|
|
2374
2397
|
baseUrl: getOAuthBaseUrl(socialProvider),
|
|
@@ -2376,8 +2399,8 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
2376
2399
|
provider: socialProvider
|
|
2377
2400
|
});
|
|
2378
2401
|
const usingPkce = providersRequiringPkce.includes(provider);
|
|
2379
|
-
const state =
|
|
2380
|
-
const codeVerifier =
|
|
2402
|
+
const state = require_logoutWithReason.randomString({ length: 32 });
|
|
2403
|
+
const codeVerifier = require_logoutWithReason.randomString({ length: 43 });
|
|
2381
2404
|
socialProviderUrl.searchParams.set("state", state);
|
|
2382
2405
|
socialProviderUrl.searchParams.set("response_type", "code");
|
|
2383
2406
|
if (usingPkce) {
|
|
@@ -2419,9 +2442,9 @@ const buildOAuthUrl = async (core, provider) => {
|
|
|
2419
2442
|
* @see detectSocialRedirectUrl
|
|
2420
2443
|
* @instrumented
|
|
2421
2444
|
*/
|
|
2422
|
-
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client =
|
|
2423
|
-
const core =
|
|
2424
|
-
const apiClient =
|
|
2445
|
+
const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2446
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2447
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
2425
2448
|
await core.initTrack.waitForAll();
|
|
2426
2449
|
const providerType = provider;
|
|
2427
2450
|
const { url, state, codeVerifier } = await buildOAuthUrl(core, providerType);
|
|
@@ -2441,12 +2464,12 @@ const signInWithSocialRedirect = async ({ provider, redirectUrl }, client = requ
|
|
|
2441
2464
|
await core.navigate(url.toString());
|
|
2442
2465
|
};
|
|
2443
2466
|
const __signInWithSocialRedirect_impl = signInWithSocialRedirect;
|
|
2444
|
-
const __signInWithSocialRedirect_wrapped =
|
|
2467
|
+
const __signInWithSocialRedirect_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2445
2468
|
fn: __signInWithSocialRedirect_impl,
|
|
2446
2469
|
functionName: "signInWithSocialRedirect",
|
|
2447
2470
|
getCore: () => {
|
|
2448
2471
|
try {
|
|
2449
|
-
return
|
|
2472
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2450
2473
|
} catch {
|
|
2451
2474
|
return;
|
|
2452
2475
|
}
|
|
@@ -2470,14 +2493,14 @@ const __signInWithSocialRedirect_wrapped = require_updateAuthFromVerifyResponse.
|
|
|
2470
2493
|
* @instrumented
|
|
2471
2494
|
* @noHook Deprecated alias that is not exposed as a React hook.
|
|
2472
2495
|
*/
|
|
2473
|
-
const authenticateWithSocial = (params, client =
|
|
2496
|
+
const authenticateWithSocial = (params, client = require_logoutWithReason.getDefaultClient()) => __signInWithSocialRedirect_wrapped(params, client);
|
|
2474
2497
|
const __authenticateWithSocial_impl = authenticateWithSocial;
|
|
2475
|
-
const __authenticateWithSocial_wrapped =
|
|
2498
|
+
const __authenticateWithSocial_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2476
2499
|
fn: __authenticateWithSocial_impl,
|
|
2477
2500
|
functionName: "authenticateWithSocial",
|
|
2478
2501
|
getCore: () => {
|
|
2479
2502
|
try {
|
|
2480
|
-
return
|
|
2503
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2481
2504
|
} catch {
|
|
2482
2505
|
return;
|
|
2483
2506
|
}
|
|
@@ -2545,8 +2568,8 @@ const clearSocialRedirectParams = () => {
|
|
|
2545
2568
|
* @instrumented
|
|
2546
2569
|
*/
|
|
2547
2570
|
const processSocialCallback = async ({ url, requestedScopes }, client) => {
|
|
2548
|
-
const core =
|
|
2549
|
-
const apiClient =
|
|
2571
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2572
|
+
const apiClient = require_logoutWithReason.createApiClient(client.user ? { elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentiallink } : {}, client);
|
|
2550
2573
|
await core.initTrack.waitForAll();
|
|
2551
2574
|
const dynamicOauthState = url.searchParams.get("dynamicOauthState");
|
|
2552
2575
|
const dynamicOauthCode = url.searchParams.get("dynamicOauthCode");
|
|
@@ -2579,16 +2602,16 @@ const processSocialCallback = async ({ url, requestedScopes }, client) => {
|
|
|
2579
2602
|
},
|
|
2580
2603
|
providerType: provider
|
|
2581
2604
|
});
|
|
2582
|
-
|
|
2605
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
2583
2606
|
return response.user;
|
|
2584
2607
|
};
|
|
2585
2608
|
const __processSocialCallback_impl = processSocialCallback;
|
|
2586
|
-
const __processSocialCallback_wrapped =
|
|
2609
|
+
const __processSocialCallback_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2587
2610
|
fn: __processSocialCallback_impl,
|
|
2588
2611
|
functionName: "processSocialCallback",
|
|
2589
2612
|
getCore: () => {
|
|
2590
2613
|
try {
|
|
2591
|
-
return
|
|
2614
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2592
2615
|
} catch {
|
|
2593
2616
|
return;
|
|
2594
2617
|
}
|
|
@@ -2623,17 +2646,17 @@ const __processSocialCallback_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2623
2646
|
* @see clearSocialRedirectParams
|
|
2624
2647
|
* @instrumented
|
|
2625
2648
|
*/
|
|
2626
|
-
const completeSocialRedirect = ({ url, requestedScopes }, client =
|
|
2649
|
+
const completeSocialRedirect = ({ url, requestedScopes }, client = require_logoutWithReason.getDefaultClient()) => __processSocialCallback_wrapped({
|
|
2627
2650
|
requestedScopes,
|
|
2628
2651
|
url
|
|
2629
2652
|
}, client);
|
|
2630
2653
|
const __completeSocialRedirect_impl = completeSocialRedirect;
|
|
2631
|
-
const __completeSocialRedirect_wrapped =
|
|
2654
|
+
const __completeSocialRedirect_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2632
2655
|
fn: __completeSocialRedirect_impl,
|
|
2633
2656
|
functionName: "completeSocialRedirect",
|
|
2634
2657
|
getCore: () => {
|
|
2635
2658
|
try {
|
|
2636
|
-
return
|
|
2659
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2637
2660
|
} catch {
|
|
2638
2661
|
return;
|
|
2639
2662
|
}
|
|
@@ -2649,14 +2672,14 @@ const __completeSocialRedirect_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
2649
2672
|
* @instrumented
|
|
2650
2673
|
* @noHook Deprecated alias; the replacement is exposed via its own hook.
|
|
2651
2674
|
*/
|
|
2652
|
-
const completeSocialAuthentication = (params, client =
|
|
2675
|
+
const completeSocialAuthentication = (params, client = require_logoutWithReason.getDefaultClient()) => __completeSocialRedirect_wrapped(params, client);
|
|
2653
2676
|
const __completeSocialAuthentication_impl = completeSocialAuthentication;
|
|
2654
|
-
const __completeSocialAuthentication_wrapped =
|
|
2677
|
+
const __completeSocialAuthentication_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2655
2678
|
fn: __completeSocialAuthentication_impl,
|
|
2656
2679
|
functionName: "completeSocialAuthentication",
|
|
2657
2680
|
getCore: () => {
|
|
2658
2681
|
try {
|
|
2659
|
-
return
|
|
2682
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2660
2683
|
} catch {
|
|
2661
2684
|
return;
|
|
2662
2685
|
}
|
|
@@ -2677,8 +2700,8 @@ const __completeSocialAuthentication_wrapped = require_updateAuthFromVerifyRespo
|
|
|
2677
2700
|
* @returns A promise that resolves to true if the URL is an OAuth redirect, false otherwise.
|
|
2678
2701
|
* @notInstrumented
|
|
2679
2702
|
*/
|
|
2680
|
-
const detectSocialRedirectUrl = async ({ url }, client =
|
|
2681
|
-
const core =
|
|
2703
|
+
const detectSocialRedirectUrl = async ({ url }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2704
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2682
2705
|
const dynamicOauthState = url.searchParams.get("dynamicOauthState");
|
|
2683
2706
|
const dynamicOauthCode = url.searchParams.get("dynamicOauthCode");
|
|
2684
2707
|
if (!dynamicOauthState || !dynamicOauthCode) return false;
|
|
@@ -2695,7 +2718,7 @@ const detectSocialRedirectUrl = async ({ url }, client = require_updateAuthFromV
|
|
|
2695
2718
|
* @notInstrumented
|
|
2696
2719
|
* @noHook Deprecated alias; the replacement is exposed via its own hook.
|
|
2697
2720
|
*/
|
|
2698
|
-
const detectOAuthRedirect = (params, client =
|
|
2721
|
+
const detectOAuthRedirect = (params, client = require_logoutWithReason.getDefaultClient()) => detectSocialRedirectUrl(params, client);
|
|
2699
2722
|
|
|
2700
2723
|
//#endregion
|
|
2701
2724
|
//#region src/modules/auth/social/oauth/signInWithSocialPopUp/signInWithSocialPopUp.ts
|
|
@@ -2722,16 +2745,16 @@ const detectOAuthRedirect = (params, client = require_updateAuthFromVerifyRespon
|
|
|
2722
2745
|
* @see completeSocialRedirect
|
|
2723
2746
|
* @instrumented
|
|
2724
2747
|
*/
|
|
2725
|
-
const signInWithSocialPopUp = async ({ provider, requestedScopes }, client =
|
|
2748
|
+
const signInWithSocialPopUp = async ({ provider, requestedScopes }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2726
2749
|
throw new require_getNetworkProviderFromNetworkId.MethodNotImplementedError("signInWithSocialPopUp (only available on React Native — use signInWithSocialRedirect on web)");
|
|
2727
2750
|
};
|
|
2728
2751
|
const __signInWithSocialPopUp_impl = signInWithSocialPopUp;
|
|
2729
|
-
const __signInWithSocialPopUp_wrapped =
|
|
2752
|
+
const __signInWithSocialPopUp_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2730
2753
|
fn: __signInWithSocialPopUp_impl,
|
|
2731
2754
|
functionName: "signInWithSocialPopUp",
|
|
2732
2755
|
getCore: () => {
|
|
2733
2756
|
try {
|
|
2734
|
-
return
|
|
2757
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2735
2758
|
} catch {
|
|
2736
2759
|
return;
|
|
2737
2760
|
}
|
|
@@ -2767,8 +2790,8 @@ const __signInWithSocialPopUp_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
2767
2790
|
* @see getWalletAccounts
|
|
2768
2791
|
* @notInstrumented
|
|
2769
2792
|
*/
|
|
2770
|
-
const getSelectedWalletAccount = (client =
|
|
2771
|
-
const sortedLastSelectedWalletAccounts =
|
|
2793
|
+
const getSelectedWalletAccount = (client = require_logoutWithReason.getDefaultClient()) => {
|
|
2794
|
+
const sortedLastSelectedWalletAccounts = require_logoutWithReason.getWalletAccounts(client).filter((walletAccount) => Boolean(walletAccount.lastSelectedAt)).sort((a, b) => b.lastSelectedAt.getTime() - a.lastSelectedAt.getTime());
|
|
2772
2795
|
if (sortedLastSelectedWalletAccounts.length === 0) return null;
|
|
2773
2796
|
const [selectedWallet] = sortedLastSelectedWalletAccounts;
|
|
2774
2797
|
return selectedWallet;
|
|
@@ -2790,12 +2813,12 @@ const getSelectedWalletAccount = (client = require_updateAuthFromVerifyResponse.
|
|
|
2790
2813
|
* @returns A promise that resolves to the verify response.
|
|
2791
2814
|
* @instrumented
|
|
2792
2815
|
*/
|
|
2793
|
-
const unlinkSocialAccount = async ({ verifiedCredentialId }, client =
|
|
2794
|
-
const core =
|
|
2795
|
-
const apiClient =
|
|
2816
|
+
const unlinkSocialAccount = async ({ verifiedCredentialId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2817
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2818
|
+
const apiClient = require_logoutWithReason.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink }, client);
|
|
2796
2819
|
const selectedWallet = getSelectedWalletAccount(client);
|
|
2797
2820
|
const walletId = selectedWallet?.verifiedCredentialId?.replace("-zerodev", "") ?? void 0;
|
|
2798
|
-
const isEmbeddedWallet = !!selectedWallet &&
|
|
2821
|
+
const isEmbeddedWallet = !!selectedWallet && require_getVerifiedCredentialForWalletAccount.getVerifiedCredentialForWalletAccount({ walletAccount: selectedWallet }, client)?.walletProvider === _dynamic_labs_sdk_api_core.WalletProviderEnum.EmbeddedWallet;
|
|
2799
2822
|
const response = await apiClient.verifyUnlink({
|
|
2800
2823
|
environmentId: core.environmentId,
|
|
2801
2824
|
verifyUnlinkRequest: {
|
|
@@ -2803,16 +2826,16 @@ const unlinkSocialAccount = async ({ verifiedCredentialId }, client = require_up
|
|
|
2803
2826
|
walletId: isEmbeddedWallet ? void 0 : walletId
|
|
2804
2827
|
}
|
|
2805
2828
|
});
|
|
2806
|
-
|
|
2829
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
2807
2830
|
return response;
|
|
2808
2831
|
};
|
|
2809
2832
|
const __unlinkSocialAccount_impl = unlinkSocialAccount;
|
|
2810
|
-
const __unlinkSocialAccount_wrapped =
|
|
2833
|
+
const __unlinkSocialAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
2811
2834
|
fn: __unlinkSocialAccount_impl,
|
|
2812
2835
|
functionName: "unlinkSocialAccount",
|
|
2813
2836
|
getCore: () => {
|
|
2814
2837
|
try {
|
|
2815
|
-
return
|
|
2838
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
2816
2839
|
} catch {
|
|
2817
2840
|
return;
|
|
2818
2841
|
}
|
|
@@ -2838,11 +2861,11 @@ const __unlinkSocialAccount_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
2838
2861
|
* @returns A promise that resolves to an array of token balances.
|
|
2839
2862
|
* @notInstrumented
|
|
2840
2863
|
*/
|
|
2841
|
-
const getTokenBalances = async ({ walletAccount, networkId, networkIds, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh }, client =
|
|
2842
|
-
const core =
|
|
2843
|
-
const apiClient =
|
|
2864
|
+
const getTokenBalances = async ({ walletAccount, networkId, networkIds, includePrices, includeNative, filterSpamTokens, whitelistedContracts, forceRefresh }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2865
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2866
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
2844
2867
|
if (!networkId && !networkIds) {
|
|
2845
|
-
const activeNetworkId = await
|
|
2868
|
+
const activeNetworkId = await require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client).getActiveNetworkId();
|
|
2846
2869
|
networkId = Number(activeNetworkId.networkId);
|
|
2847
2870
|
}
|
|
2848
2871
|
return await apiClient.getAccountBalances({
|
|
@@ -2870,7 +2893,7 @@ const getTokenBalances = async ({ walletAccount, networkId, networkIds, includeP
|
|
|
2870
2893
|
* @notInstrumented
|
|
2871
2894
|
* @noHook Deprecated; the replacement is exposed via its own hook.
|
|
2872
2895
|
*/
|
|
2873
|
-
const getBalances = (params, client =
|
|
2896
|
+
const getBalances = (params, client = require_logoutWithReason.getDefaultClient()) => getTokenBalances(params, client);
|
|
2874
2897
|
|
|
2875
2898
|
//#endregion
|
|
2876
2899
|
//#region src/modules/balances/getMultichainTokenBalances/getMultichainTokenBalances.ts
|
|
@@ -2888,9 +2911,9 @@ const getBalances = (params, client = require_updateAuthFromVerifyResponse.getDe
|
|
|
2888
2911
|
* @returns A promise that resolves to the chain balances across multiple networks.
|
|
2889
2912
|
* @notInstrumented
|
|
2890
2913
|
*/
|
|
2891
|
-
const getMultichainTokenBalances = async ({ balanceRequest }, client =
|
|
2892
|
-
const core =
|
|
2893
|
-
return (await
|
|
2914
|
+
const getMultichainTokenBalances = async ({ balanceRequest }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
2915
|
+
const core = require_logoutWithReason.getCore(client);
|
|
2916
|
+
return (await require_logoutWithReason.createApiClient({}, client).postMultichainAccountBalances({
|
|
2894
2917
|
environmentId: core.environmentId,
|
|
2895
2918
|
multichainAccountBalancesRequest: balanceRequest
|
|
2896
2919
|
})).chainBalances;
|
|
@@ -2906,7 +2929,7 @@ const getMultichainTokenBalances = async ({ balanceRequest }, client = require_u
|
|
|
2906
2929
|
* @notInstrumented
|
|
2907
2930
|
* @noHook Deprecated; the replacement is exposed via its own hook.
|
|
2908
2931
|
*/
|
|
2909
|
-
const getMultichainBalances = (params, client =
|
|
2932
|
+
const getMultichainBalances = (params, client = require_logoutWithReason.getDefaultClient()) => getMultichainTokenBalances(params, client);
|
|
2910
2933
|
|
|
2911
2934
|
//#endregion
|
|
2912
2935
|
//#region src/modules/captcha/getCaptchaSettings/getCaptchaSettings.ts
|
|
@@ -2944,7 +2967,7 @@ const CaptchaProviderEnum = _dynamic_labs_sdk_api_core.CaptchaProviderEnum;
|
|
|
2944
2967
|
* @returns The active captcha provider and site key, or undefined when captcha is not enabled.
|
|
2945
2968
|
* @notInstrumented
|
|
2946
2969
|
*/
|
|
2947
|
-
const getCaptchaSettings = (client =
|
|
2970
|
+
const getCaptchaSettings = (client = require_logoutWithReason.getDefaultClient()) => {
|
|
2948
2971
|
const projectSettings = client.projectSettings;
|
|
2949
2972
|
if (!projectSettings) return void 0;
|
|
2950
2973
|
const { security } = projectSettings;
|
|
@@ -2965,7 +2988,7 @@ const getCaptchaSettings = (client = require_updateAuthFromVerifyResponse.getDef
|
|
|
2965
2988
|
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
2966
2989
|
/** @notInstrumented */
|
|
2967
2990
|
const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
2968
|
-
return
|
|
2991
|
+
return require_logoutWithReason.createStorageKeySchema({
|
|
2969
2992
|
key: `checkoutSessionToken:${transactionId}`,
|
|
2970
2993
|
schema: zod_mini.string()
|
|
2971
2994
|
});
|
|
@@ -2975,8 +2998,8 @@ const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
|
2975
2998
|
//#region src/modules/checkout/utils/createCheckoutApiClient/createCheckoutApiClient.ts
|
|
2976
2999
|
/** @notInstrumented */
|
|
2977
3000
|
const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
2978
|
-
const core =
|
|
2979
|
-
const apiClient =
|
|
3001
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3002
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
2980
3003
|
const sessionToken = await core.storage.getItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
2981
3004
|
if (!sessionToken) throw new CheckoutSessionTokenMissingError({ transactionId });
|
|
2982
3005
|
return {
|
|
@@ -3005,7 +3028,7 @@ const createCheckoutApiClient = async ({ transactionId }, client) => {
|
|
|
3005
3028
|
* @notInstrumented
|
|
3006
3029
|
*/
|
|
3007
3030
|
const clearCheckoutSessionToken = async ({ transactionId }, client) => {
|
|
3008
|
-
await
|
|
3031
|
+
await require_logoutWithReason.getCore(client).storage.removeItem(createCheckoutSessionTokenStorageKey(transactionId));
|
|
3009
3032
|
};
|
|
3010
3033
|
|
|
3011
3034
|
//#endregion
|
|
@@ -3023,10 +3046,10 @@ const withCheckoutSessionTokenCleanupOn401 = async ({ call, transactionId }, cli
|
|
|
3023
3046
|
try {
|
|
3024
3047
|
return await call();
|
|
3025
3048
|
} catch (error) {
|
|
3026
|
-
if (error instanceof
|
|
3049
|
+
if (error instanceof require_logoutWithReason.APIError && error.status === 401) try {
|
|
3027
3050
|
await clearCheckoutSessionToken({ transactionId }, client);
|
|
3028
3051
|
} catch (cleanupError) {
|
|
3029
|
-
|
|
3052
|
+
require_logoutWithReason.getCore(client).logger.error("Failed to clear checkout session token after 401", cleanupError);
|
|
3030
3053
|
}
|
|
3031
3054
|
throw error;
|
|
3032
3055
|
}
|
|
@@ -3049,7 +3072,7 @@ const withCheckoutSessionTokenCleanupOn401 = async ({ call, transactionId }, cli
|
|
|
3049
3072
|
* @instrumented
|
|
3050
3073
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3051
3074
|
*/
|
|
3052
|
-
const attachCheckoutTransactionSource = async (params, client =
|
|
3075
|
+
const attachCheckoutTransactionSource = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3053
3076
|
const { transactionId, sourceType = "wallet" } = params;
|
|
3054
3077
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
3055
3078
|
const attachSourceRequest = { sourceType };
|
|
@@ -3070,12 +3093,12 @@ const attachCheckoutTransactionSource = async (params, client = require_updateAu
|
|
|
3070
3093
|
}, client);
|
|
3071
3094
|
};
|
|
3072
3095
|
const __attachCheckoutTransactionSource_impl = attachCheckoutTransactionSource;
|
|
3073
|
-
const __attachCheckoutTransactionSource_wrapped =
|
|
3096
|
+
const __attachCheckoutTransactionSource_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3074
3097
|
fn: __attachCheckoutTransactionSource_impl,
|
|
3075
3098
|
functionName: "attachCheckoutTransactionSource",
|
|
3076
3099
|
getCore: () => {
|
|
3077
3100
|
try {
|
|
3078
|
-
return
|
|
3101
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3079
3102
|
} catch {
|
|
3080
3103
|
return;
|
|
3081
3104
|
}
|
|
@@ -3099,7 +3122,7 @@ const __attachCheckoutTransactionSource_wrapped = require_updateAuthFromVerifyRe
|
|
|
3099
3122
|
* @instrumented
|
|
3100
3123
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3101
3124
|
*/
|
|
3102
|
-
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client =
|
|
3125
|
+
const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3103
3126
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
3104
3127
|
return withCheckoutSessionTokenCleanupOn401({
|
|
3105
3128
|
call: () => apiClient.recordCheckoutBroadcast({
|
|
@@ -3112,12 +3135,12 @@ const broadcastCheckoutTransaction = async ({ transactionId, txHash }, client =
|
|
|
3112
3135
|
}, client);
|
|
3113
3136
|
};
|
|
3114
3137
|
const __broadcastCheckoutTransaction_impl = broadcastCheckoutTransaction;
|
|
3115
|
-
const __broadcastCheckoutTransaction_wrapped =
|
|
3138
|
+
const __broadcastCheckoutTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3116
3139
|
fn: __broadcastCheckoutTransaction_impl,
|
|
3117
3140
|
functionName: "broadcastCheckoutTransaction",
|
|
3118
3141
|
getCore: () => {
|
|
3119
3142
|
try {
|
|
3120
|
-
return
|
|
3143
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3121
3144
|
} catch {
|
|
3122
3145
|
return;
|
|
3123
3146
|
}
|
|
@@ -3137,7 +3160,7 @@ const __broadcastCheckoutTransaction_wrapped = require_updateAuthFromVerifyRespo
|
|
|
3137
3160
|
* @instrumented
|
|
3138
3161
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3139
3162
|
*/
|
|
3140
|
-
const cancelCheckoutTransaction = async ({ transactionId }, client =
|
|
3163
|
+
const cancelCheckoutTransaction = async ({ transactionId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3141
3164
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
3142
3165
|
const result = await withCheckoutSessionTokenCleanupOn401({
|
|
3143
3166
|
call: () => apiClient.cancelCheckoutTransaction({
|
|
@@ -3151,12 +3174,12 @@ const cancelCheckoutTransaction = async ({ transactionId }, client = require_upd
|
|
|
3151
3174
|
return result;
|
|
3152
3175
|
};
|
|
3153
3176
|
const __cancelCheckoutTransaction_impl = cancelCheckoutTransaction;
|
|
3154
|
-
const __cancelCheckoutTransaction_wrapped =
|
|
3177
|
+
const __cancelCheckoutTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3155
3178
|
fn: __cancelCheckoutTransaction_impl,
|
|
3156
3179
|
functionName: "cancelCheckoutTransaction",
|
|
3157
3180
|
getCore: () => {
|
|
3158
3181
|
try {
|
|
3159
|
-
return
|
|
3182
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3160
3183
|
} catch {
|
|
3161
3184
|
return;
|
|
3162
3185
|
}
|
|
@@ -3168,7 +3191,7 @@ const __cancelCheckoutTransaction_wrapped = require_updateAuthFromVerifyResponse
|
|
|
3168
3191
|
/** @notInstrumented */
|
|
3169
3192
|
const getCheckouts = async (client) => {
|
|
3170
3193
|
const projectSettings = client.projectSettings;
|
|
3171
|
-
|
|
3194
|
+
require_logoutWithReason.assertDefined(projectSettings, "Project settings are not available");
|
|
3172
3195
|
return projectSettings.checkouts ?? [];
|
|
3173
3196
|
};
|
|
3174
3197
|
|
|
@@ -3185,12 +3208,12 @@ const getCheckouts = async (client) => {
|
|
|
3185
3208
|
* @instrumented
|
|
3186
3209
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3187
3210
|
*/
|
|
3188
|
-
const createCheckoutTransaction = async (params, client =
|
|
3189
|
-
const core =
|
|
3190
|
-
const apiClient =
|
|
3211
|
+
const createCheckoutTransaction = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3212
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3213
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
3191
3214
|
const checkouts = await getCheckouts(client);
|
|
3192
3215
|
const checkoutId = params.checkoutId || checkouts?.[0]?.id;
|
|
3193
|
-
|
|
3216
|
+
require_logoutWithReason.assertDefined(checkoutId, "No checkout found. Please make sure you have a Checkout setup in the Dashboard.");
|
|
3194
3217
|
const result = await apiClient.createCheckoutTransaction({
|
|
3195
3218
|
checkoutId,
|
|
3196
3219
|
checkoutTransactionCreateRequest: {
|
|
@@ -3209,12 +3232,12 @@ const createCheckoutTransaction = async (params, client = require_updateAuthFrom
|
|
|
3209
3232
|
return result;
|
|
3210
3233
|
};
|
|
3211
3234
|
const __createCheckoutTransaction_impl = createCheckoutTransaction;
|
|
3212
|
-
const __createCheckoutTransaction_wrapped =
|
|
3235
|
+
const __createCheckoutTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3213
3236
|
fn: __createCheckoutTransaction_impl,
|
|
3214
3237
|
functionName: "createCheckoutTransaction",
|
|
3215
3238
|
getCore: () => {
|
|
3216
3239
|
try {
|
|
3217
|
-
return
|
|
3240
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3218
3241
|
} catch {
|
|
3219
3242
|
return;
|
|
3220
3243
|
}
|
|
@@ -3234,9 +3257,9 @@ const __createCheckoutTransaction_wrapped = require_updateAuthFromVerifyResponse
|
|
|
3234
3257
|
* @notInstrumented
|
|
3235
3258
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3236
3259
|
*/
|
|
3237
|
-
const getCheckoutTransaction = async ({ transactionId }, client =
|
|
3238
|
-
const core =
|
|
3239
|
-
return
|
|
3260
|
+
const getCheckoutTransaction = async ({ transactionId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3261
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3262
|
+
return require_logoutWithReason.createApiClient({}, client).getCheckoutTransaction({
|
|
3240
3263
|
environmentId: core.environmentId,
|
|
3241
3264
|
transactionId
|
|
3242
3265
|
});
|
|
@@ -3255,7 +3278,7 @@ const getCheckoutTransaction = async ({ transactionId }, client = require_update
|
|
|
3255
3278
|
* @notInstrumented
|
|
3256
3279
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3257
3280
|
*/
|
|
3258
|
-
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client =
|
|
3281
|
+
const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slippage, transactionId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3259
3282
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
3260
3283
|
return withCheckoutSessionTokenCleanupOn401({
|
|
3261
3284
|
call: () => apiClient.quoteCheckoutTransaction({
|
|
@@ -3287,7 +3310,7 @@ const getCheckoutTransactionQuote = async ({ fromChainId, fromTokenAddress, slip
|
|
|
3287
3310
|
* @instrumented
|
|
3288
3311
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3289
3312
|
*/
|
|
3290
|
-
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client =
|
|
3313
|
+
const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, transactionId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3291
3314
|
const { apiClient, environmentId, sessionToken } = await createCheckoutApiClient({ transactionId }, client);
|
|
3292
3315
|
return withCheckoutSessionTokenCleanupOn401({
|
|
3293
3316
|
call: () => apiClient.prepareCheckoutTransaction({
|
|
@@ -3303,12 +3326,12 @@ const prepareCheckoutTransaction = async ({ assertBalanceForGasCost, assertBalan
|
|
|
3303
3326
|
}, client);
|
|
3304
3327
|
};
|
|
3305
3328
|
const __prepareCheckoutTransaction_impl = prepareCheckoutTransaction;
|
|
3306
|
-
const __prepareCheckoutTransaction_wrapped =
|
|
3329
|
+
const __prepareCheckoutTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3307
3330
|
fn: __prepareCheckoutTransaction_impl,
|
|
3308
3331
|
functionName: "prepareCheckoutTransaction",
|
|
3309
3332
|
getCore: () => {
|
|
3310
3333
|
try {
|
|
3311
|
-
return
|
|
3334
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3312
3335
|
} catch {
|
|
3313
3336
|
return;
|
|
3314
3337
|
}
|
|
@@ -3360,7 +3383,7 @@ const SWAP_SUPPORTED_CHAINS = [
|
|
|
3360
3383
|
* @notInstrumented
|
|
3361
3384
|
*/
|
|
3362
3385
|
const ensureCorrectActiveNetwork = async ({ requiredNetworkId, walletProvider }, client) => {
|
|
3363
|
-
const { logger } =
|
|
3386
|
+
const { logger } = require_logoutWithReason.getCore(client);
|
|
3364
3387
|
if (!requiredNetworkId || !walletProvider.switchActiveNetwork) return;
|
|
3365
3388
|
logger.debug("[ensureCorrectActiveNetwork] Required network id", requiredNetworkId);
|
|
3366
3389
|
let activeNetworkId;
|
|
@@ -3390,9 +3413,9 @@ const ensureCorrectActiveNetwork = async ({ requiredNetworkId, walletProvider },
|
|
|
3390
3413
|
* @returns The transaction hash.
|
|
3391
3414
|
* @instrumented
|
|
3392
3415
|
*/
|
|
3393
|
-
const executeSwapTransaction = async ({ walletAccount, signingPayload, onStepChange, sponsorshipMode }, client =
|
|
3394
|
-
if (!SWAP_SUPPORTED_CHAINS.includes(walletAccount.chain)) throw new
|
|
3395
|
-
const walletProvider =
|
|
3416
|
+
const executeSwapTransaction = async ({ walletAccount, signingPayload, onStepChange, sponsorshipMode }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3417
|
+
if (!SWAP_SUPPORTED_CHAINS.includes(walletAccount.chain)) throw new require_logoutWithReason.InvalidParamError(`Chain ${walletAccount.chain} is not supported for swap transactions`);
|
|
3418
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
3396
3419
|
assertWalletProviderMethodDefined(walletProvider, "executeSwapTransaction");
|
|
3397
3420
|
await ensureCorrectActiveNetwork({
|
|
3398
3421
|
requiredNetworkId: signingPayload.chainId,
|
|
@@ -3407,12 +3430,12 @@ const executeSwapTransaction = async ({ walletAccount, signingPayload, onStepCha
|
|
|
3407
3430
|
return { transactionHash };
|
|
3408
3431
|
};
|
|
3409
3432
|
const __executeSwapTransaction_impl = executeSwapTransaction;
|
|
3410
|
-
const __executeSwapTransaction_wrapped =
|
|
3433
|
+
const __executeSwapTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3411
3434
|
fn: __executeSwapTransaction_impl,
|
|
3412
3435
|
functionName: "executeSwapTransaction",
|
|
3413
3436
|
getCore: () => {
|
|
3414
3437
|
try {
|
|
3415
|
-
return
|
|
3438
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3416
3439
|
} catch {
|
|
3417
3440
|
return;
|
|
3418
3441
|
}
|
|
@@ -3438,13 +3461,13 @@ const __executeSwapTransaction_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
3438
3461
|
* @instrumented
|
|
3439
3462
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3440
3463
|
*/
|
|
3441
|
-
const submitCheckoutTransaction = async ({ onStepChange, transactionId, walletAccount, assertBalanceForGasCost, assertBalanceForTransferAmount }, client =
|
|
3464
|
+
const submitCheckoutTransaction = async ({ onStepChange, transactionId, walletAccount, assertBalanceForGasCost, assertBalanceForTransferAmount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3442
3465
|
const signingPayload = (await __prepareCheckoutTransaction_wrapped({
|
|
3443
3466
|
assertBalanceForGasCost,
|
|
3444
3467
|
assertBalanceForTransferAmount,
|
|
3445
3468
|
transactionId
|
|
3446
3469
|
}, client)).quote?.signingPayload;
|
|
3447
|
-
|
|
3470
|
+
require_logoutWithReason.assertDefined(signingPayload, "No signing payload returned from prepare — quote may be missing transaction data");
|
|
3448
3471
|
const { transactionHash } = await __executeSwapTransaction_wrapped({
|
|
3449
3472
|
onStepChange,
|
|
3450
3473
|
signingPayload,
|
|
@@ -3456,12 +3479,12 @@ const submitCheckoutTransaction = async ({ onStepChange, transactionId, walletAc
|
|
|
3456
3479
|
}, client);
|
|
3457
3480
|
};
|
|
3458
3481
|
const __submitCheckoutTransaction_impl = submitCheckoutTransaction;
|
|
3459
|
-
const __submitCheckoutTransaction_wrapped =
|
|
3482
|
+
const __submitCheckoutTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3460
3483
|
fn: __submitCheckoutTransaction_impl,
|
|
3461
3484
|
functionName: "submitCheckoutTransaction",
|
|
3462
3485
|
getCore: () => {
|
|
3463
3486
|
try {
|
|
3464
|
-
return
|
|
3487
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3465
3488
|
} catch {
|
|
3466
3489
|
return;
|
|
3467
3490
|
}
|
|
@@ -3491,7 +3514,7 @@ const __submitCheckoutTransaction_wrapped = require_updateAuthFromVerifyResponse
|
|
|
3491
3514
|
* @notInstrumented
|
|
3492
3515
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3493
3516
|
*/
|
|
3494
|
-
const trackCheckoutTransaction = (_params, client =
|
|
3517
|
+
const trackCheckoutTransaction = (_params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3495
3518
|
return Promise.resolve();
|
|
3496
3519
|
};
|
|
3497
3520
|
|
|
@@ -3514,10 +3537,10 @@ const trackCheckoutTransaction = (_params, client = require_updateAuthFromVerify
|
|
|
3514
3537
|
* @notInstrumented
|
|
3515
3538
|
* @noHook Legacy checkout function not exposed as a React hook; the checkout product is being renamed to flow.
|
|
3516
3539
|
*/
|
|
3517
|
-
const requiresConversion = async ({ transaction }, client =
|
|
3518
|
-
if (!transaction.fromChainId || !transaction.fromChainName || !transaction.fromToken) throw new
|
|
3540
|
+
const requiresConversion = async ({ transaction }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3541
|
+
if (!transaction.fromChainId || !transaction.fromChainName || !transaction.fromToken) throw new require_logoutWithReason.InvalidParamError("Transaction is missing source information. Make sure that attachCheckoutTransactionSource has been called before calling this function.");
|
|
3519
3542
|
const checkout = (await getCheckouts(client)).find((checkout$1) => checkout$1.id === transaction.checkoutId);
|
|
3520
|
-
|
|
3543
|
+
require_logoutWithReason.assertDefined(checkout, "Could not find checkout associated with transaction.");
|
|
3521
3544
|
return !checkout.settlementConfig.settlements.some((settlement) => settlement.chainName === transaction.fromChainName && settlement.chainId === transaction.fromChainId && settlement.tokenAddress === transaction.fromToken);
|
|
3522
3545
|
};
|
|
3523
3546
|
|
|
@@ -3574,23 +3597,23 @@ const DEVICE_REGISTRATION_TOKEN_HEADER = "x-dynamic-device-registration-token";
|
|
|
3574
3597
|
* @see clearDeviceRegistrationRedirectParams
|
|
3575
3598
|
* @instrumented
|
|
3576
3599
|
*/
|
|
3577
|
-
const completeDeviceRegistration = async ({ deviceToken }, client =
|
|
3578
|
-
|
|
3579
|
-
const core =
|
|
3600
|
+
const completeDeviceRegistration = async ({ deviceToken }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3601
|
+
require_logoutWithReason.assertDefined(deviceToken, "deviceToken is required");
|
|
3602
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3580
3603
|
const currentUser = core.state.get().user;
|
|
3581
|
-
const response = await
|
|
3604
|
+
const response = await require_logoutWithReason.createApiClient({ headers: { [DEVICE_REGISTRATION_TOKEN_HEADER]: deviceToken } }, client).deviceRegistration({ environmentId: core.environmentId });
|
|
3582
3605
|
if (currentUser && response.user?.id !== currentUser.id) throw new DeviceRegistrationIdentityMismatchError();
|
|
3583
|
-
|
|
3584
|
-
|
|
3606
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
3607
|
+
require_logoutWithReason.emitEvent({ event: "deviceRegistrationCompleted" }, client);
|
|
3585
3608
|
return response;
|
|
3586
3609
|
};
|
|
3587
3610
|
const __completeDeviceRegistration_impl = completeDeviceRegistration;
|
|
3588
|
-
const __completeDeviceRegistration_wrapped =
|
|
3611
|
+
const __completeDeviceRegistration_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3589
3612
|
fn: __completeDeviceRegistration_impl,
|
|
3590
3613
|
functionName: "completeDeviceRegistration",
|
|
3591
3614
|
getCore: () => {
|
|
3592
3615
|
try {
|
|
3593
|
-
return
|
|
3616
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3594
3617
|
} catch {
|
|
3595
3618
|
return;
|
|
3596
3619
|
}
|
|
@@ -3644,9 +3667,9 @@ const detectDeviceRegistrationRedirect = ({ url }) => {
|
|
|
3644
3667
|
//#endregion
|
|
3645
3668
|
//#region src/modules/deviceRegistration/getRegisteredDevices/getRegisteredDevices.ts
|
|
3646
3669
|
/** @notInstrumented */
|
|
3647
|
-
const getRegisteredDevices = async (client =
|
|
3648
|
-
const core =
|
|
3649
|
-
const apiClient =
|
|
3670
|
+
const getRegisteredDevices = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
3671
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3672
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
3650
3673
|
try {
|
|
3651
3674
|
return (await apiClient.listDeviceRegistrations({ environmentId: core.environmentId })).deviceRegistrations;
|
|
3652
3675
|
} catch (error) {
|
|
@@ -3654,7 +3677,7 @@ const getRegisteredDevices = async (client = require_updateAuthFromVerifyRespons
|
|
|
3654
3677
|
* The API will return 401 when no devices are registered when there are no
|
|
3655
3678
|
* devices registered. We need to handle this case gracefully.
|
|
3656
3679
|
*/
|
|
3657
|
-
if (error instanceof
|
|
3680
|
+
if (error instanceof require_logoutWithReason.UnauthorizedError) return [];
|
|
3658
3681
|
throw error;
|
|
3659
3682
|
}
|
|
3660
3683
|
};
|
|
@@ -3662,18 +3685,18 @@ const getRegisteredDevices = async (client = require_updateAuthFromVerifyRespons
|
|
|
3662
3685
|
//#endregion
|
|
3663
3686
|
//#region src/modules/deviceRegistration/revokeAllRegisteredDevices/revokeAllRegisteredDevices.ts
|
|
3664
3687
|
/** @instrumented */
|
|
3665
|
-
const revokeAllRegisteredDevices = async (client =
|
|
3666
|
-
const core =
|
|
3667
|
-
await
|
|
3668
|
-
await
|
|
3688
|
+
const revokeAllRegisteredDevices = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
3689
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3690
|
+
await require_logoutWithReason.createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
|
|
3691
|
+
await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "all-devices-revoked" }, client);
|
|
3669
3692
|
};
|
|
3670
3693
|
const __revokeAllRegisteredDevices_impl = revokeAllRegisteredDevices;
|
|
3671
|
-
const __revokeAllRegisteredDevices_wrapped =
|
|
3694
|
+
const __revokeAllRegisteredDevices_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3672
3695
|
fn: __revokeAllRegisteredDevices_impl,
|
|
3673
3696
|
functionName: "revokeAllRegisteredDevices",
|
|
3674
3697
|
getCore: () => {
|
|
3675
3698
|
try {
|
|
3676
|
-
return
|
|
3699
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3677
3700
|
} catch {
|
|
3678
3701
|
return;
|
|
3679
3702
|
}
|
|
@@ -3683,21 +3706,21 @@ const __revokeAllRegisteredDevices_wrapped = require_updateAuthFromVerifyRespons
|
|
|
3683
3706
|
//#endregion
|
|
3684
3707
|
//#region src/modules/deviceRegistration/revokeRegisteredDevice/revokeRegisteredDevice.ts
|
|
3685
3708
|
/** @instrumented */
|
|
3686
|
-
const revokeRegisteredDevice = async ({ deviceRegistrationId }, client =
|
|
3687
|
-
|
|
3688
|
-
const core =
|
|
3689
|
-
if ((await
|
|
3709
|
+
const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3710
|
+
require_logoutWithReason.assertDefined(deviceRegistrationId, "deviceRegistrationId is required");
|
|
3711
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3712
|
+
if ((await require_logoutWithReason.createApiClient({}, client).deleteDeviceRegistration({
|
|
3690
3713
|
deviceRegistrationId,
|
|
3691
3714
|
environmentId: core.environmentId
|
|
3692
|
-
})).currentDeviceRevoked) await
|
|
3715
|
+
})).currentDeviceRevoked) await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "device-revoked" }, client);
|
|
3693
3716
|
};
|
|
3694
3717
|
const __revokeRegisteredDevice_impl = revokeRegisteredDevice;
|
|
3695
|
-
const __revokeRegisteredDevice_wrapped =
|
|
3718
|
+
const __revokeRegisteredDevice_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3696
3719
|
fn: __revokeRegisteredDevice_impl,
|
|
3697
3720
|
functionName: "revokeRegisteredDevice",
|
|
3698
3721
|
getCore: () => {
|
|
3699
3722
|
try {
|
|
3700
|
-
return
|
|
3723
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3701
3724
|
} catch {
|
|
3702
3725
|
return;
|
|
3703
3726
|
}
|
|
@@ -3708,7 +3731,7 @@ const __revokeRegisteredDevice_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
3708
3731
|
//#region src/modules/flow/utils/createFlowSessionTokenStorageKey/createFlowSessionTokenStorageKey.ts
|
|
3709
3732
|
/** @notInstrumented */
|
|
3710
3733
|
const createFlowSessionTokenStorageKey = (flowId) => {
|
|
3711
|
-
return
|
|
3734
|
+
return require_logoutWithReason.createStorageKeySchema({
|
|
3712
3735
|
key: `flowSessionToken:${flowId}`,
|
|
3713
3736
|
schema: zod_mini.string()
|
|
3714
3737
|
});
|
|
@@ -3733,7 +3756,7 @@ const createFlowSessionTokenStorageKey = (flowId) => {
|
|
|
3733
3756
|
* @notInstrumented
|
|
3734
3757
|
*/
|
|
3735
3758
|
const clearFlowSessionToken = async ({ flowId }, client) => {
|
|
3736
|
-
await
|
|
3759
|
+
await require_logoutWithReason.getCore(client).storage.removeItem(createFlowSessionTokenStorageKey(flowId));
|
|
3737
3760
|
};
|
|
3738
3761
|
|
|
3739
3762
|
//#endregion
|
|
@@ -3751,10 +3774,10 @@ const withFlowSessionTokenCleanupOn401 = async ({ call, flowId }, client) => {
|
|
|
3751
3774
|
try {
|
|
3752
3775
|
return await call();
|
|
3753
3776
|
} catch (error) {
|
|
3754
|
-
if (error instanceof
|
|
3777
|
+
if (error instanceof require_logoutWithReason.APIError && error.status === 401) try {
|
|
3755
3778
|
await clearFlowSessionToken({ flowId }, client);
|
|
3756
3779
|
} catch (cleanupError) {
|
|
3757
|
-
|
|
3780
|
+
require_logoutWithReason.getCore(client).logger.error("Failed to clear flow session token after 401", cleanupError);
|
|
3758
3781
|
}
|
|
3759
3782
|
throw error;
|
|
3760
3783
|
}
|
|
@@ -3790,10 +3813,10 @@ const attachFlowSourceInstrumentation = { resolved: ({ flow }) => ({
|
|
|
3790
3813
|
* @returns The updated flow and session token
|
|
3791
3814
|
* @instrumented
|
|
3792
3815
|
*/
|
|
3793
|
-
const attachFlowSource = async (params, client =
|
|
3794
|
-
const core =
|
|
3816
|
+
const attachFlowSource = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3817
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3795
3818
|
const { flowId, sourceType = "wallet" } = params;
|
|
3796
|
-
const apiClient =
|
|
3819
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
3797
3820
|
const flowAttachSourceRequest = { sourceType };
|
|
3798
3821
|
if (params.sourceType === "exchange") flowAttachSourceRequest.exchangeProvider = params.exchangeProvider;
|
|
3799
3822
|
else if (params.sourceType === "deposit_address") {
|
|
@@ -3819,12 +3842,12 @@ const attachFlowSource = async (params, client = require_updateAuthFromVerifyRes
|
|
|
3819
3842
|
return result;
|
|
3820
3843
|
};
|
|
3821
3844
|
const __attachFlowSource_impl = attachFlowSource;
|
|
3822
|
-
const __attachFlowSource_wrapped =
|
|
3845
|
+
const __attachFlowSource_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3823
3846
|
fn: __attachFlowSource_impl,
|
|
3824
3847
|
functionName: "attachFlowSource",
|
|
3825
3848
|
getCore: () => {
|
|
3826
3849
|
try {
|
|
3827
|
-
return
|
|
3850
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3828
3851
|
} catch {
|
|
3829
3852
|
return;
|
|
3830
3853
|
}
|
|
@@ -3836,8 +3859,8 @@ const __attachFlowSource_wrapped = require_updateAuthFromVerifyResponse.instrume
|
|
|
3836
3859
|
//#region src/modules/flow/utils/createFlowApiClient/createFlowApiClient.ts
|
|
3837
3860
|
/** @notInstrumented */
|
|
3838
3861
|
const createFlowApiClient = async ({ flowId }, client) => {
|
|
3839
|
-
const core =
|
|
3840
|
-
const apiClient =
|
|
3862
|
+
const core = require_logoutWithReason.getCore(client);
|
|
3863
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
3841
3864
|
const sessionToken = await core.storage.getItem(createFlowSessionTokenStorageKey(flowId));
|
|
3842
3865
|
if (!sessionToken) throw new FlowSessionTokenMissingError({ flowId });
|
|
3843
3866
|
return {
|
|
@@ -3877,7 +3900,7 @@ const broadcastFlowInstrumentation = { resolved: (flow) => ({
|
|
|
3877
3900
|
* @returns The updated flow
|
|
3878
3901
|
* @instrumented
|
|
3879
3902
|
*/
|
|
3880
|
-
const broadcastFlow = async ({ flowId, txHash }, client =
|
|
3903
|
+
const broadcastFlow = async ({ flowId, txHash }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3881
3904
|
const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
|
|
3882
3905
|
return withFlowSessionTokenCleanupOn401({
|
|
3883
3906
|
call: () => apiClient.broadcastFlow({
|
|
@@ -3890,12 +3913,12 @@ const broadcastFlow = async ({ flowId, txHash }, client = require_updateAuthFrom
|
|
|
3890
3913
|
}, client);
|
|
3891
3914
|
};
|
|
3892
3915
|
const __broadcastFlow_impl = broadcastFlow;
|
|
3893
|
-
const __broadcastFlow_wrapped =
|
|
3916
|
+
const __broadcastFlow_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3894
3917
|
fn: __broadcastFlow_impl,
|
|
3895
3918
|
functionName: "broadcastFlow",
|
|
3896
3919
|
getCore: () => {
|
|
3897
3920
|
try {
|
|
3898
|
-
return
|
|
3921
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3899
3922
|
} catch {
|
|
3900
3923
|
return;
|
|
3901
3924
|
}
|
|
@@ -3935,7 +3958,7 @@ const cancelFlowInstrumentation = { resolved: (flow) => ({
|
|
|
3935
3958
|
* @see getFlowQuote
|
|
3936
3959
|
* @instrumented
|
|
3937
3960
|
*/
|
|
3938
|
-
const cancelFlow = async ({ flowId }, client =
|
|
3961
|
+
const cancelFlow = async ({ flowId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
3939
3962
|
const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
|
|
3940
3963
|
const result = await withFlowSessionTokenCleanupOn401({
|
|
3941
3964
|
call: () => apiClient.cancelFlow({
|
|
@@ -3949,12 +3972,12 @@ const cancelFlow = async ({ flowId }, client = require_updateAuthFromVerifyRespo
|
|
|
3949
3972
|
return result;
|
|
3950
3973
|
};
|
|
3951
3974
|
const __cancelFlow_impl = cancelFlow;
|
|
3952
|
-
const __cancelFlow_wrapped =
|
|
3975
|
+
const __cancelFlow_wrapped = require_logoutWithReason.instrumentFunction({
|
|
3953
3976
|
fn: __cancelFlow_impl,
|
|
3954
3977
|
functionName: "cancelFlow",
|
|
3955
3978
|
getCore: () => {
|
|
3956
3979
|
try {
|
|
3957
|
-
return
|
|
3980
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
3958
3981
|
} catch {
|
|
3959
3982
|
return;
|
|
3960
3983
|
}
|
|
@@ -3980,9 +4003,9 @@ const __cancelFlow_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
3980
4003
|
* @see getFlowQuote
|
|
3981
4004
|
* @notInstrumented
|
|
3982
4005
|
*/
|
|
3983
|
-
const getFlow = async ({ flowId }, client =
|
|
3984
|
-
const core =
|
|
3985
|
-
return
|
|
4006
|
+
const getFlow = async ({ flowId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4007
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4008
|
+
return require_logoutWithReason.createApiClient({}, client).getFlow({
|
|
3986
4009
|
environmentId: core.environmentId,
|
|
3987
4010
|
flowId
|
|
3988
4011
|
});
|
|
@@ -4011,7 +4034,7 @@ const getFlow = async ({ flowId }, client = require_updateAuthFromVerifyResponse
|
|
|
4011
4034
|
* @see cancelFlow
|
|
4012
4035
|
* @notInstrumented
|
|
4013
4036
|
*/
|
|
4014
|
-
const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client =
|
|
4037
|
+
const getFlowQuote = async ({ flowId, fromChainId, fromTokenAddress, slippage }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4015
4038
|
const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
|
|
4016
4039
|
return withFlowSessionTokenCleanupOn401({
|
|
4017
4040
|
call: () => apiClient.getFlowQuote({
|
|
@@ -4056,7 +4079,7 @@ const prepareFlowSigningInstrumentation = { resolved: (flow) => ({
|
|
|
4056
4079
|
* @returns The updated flow
|
|
4057
4080
|
* @instrumented
|
|
4058
4081
|
*/
|
|
4059
|
-
const prepareFlowSigning = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, flowId }, client =
|
|
4082
|
+
const prepareFlowSigning = async ({ assertBalanceForGasCost, assertBalanceForTransferAmount, flowId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4060
4083
|
const { apiClient, environmentId, sessionToken } = await createFlowApiClient({ flowId }, client);
|
|
4061
4084
|
return withFlowSessionTokenCleanupOn401({
|
|
4062
4085
|
call: () => apiClient.prepareFlowSigning({
|
|
@@ -4072,12 +4095,12 @@ const prepareFlowSigning = async ({ assertBalanceForGasCost, assertBalanceForTra
|
|
|
4072
4095
|
}, client);
|
|
4073
4096
|
};
|
|
4074
4097
|
const __prepareFlowSigning_impl = prepareFlowSigning;
|
|
4075
|
-
const __prepareFlowSigning_wrapped =
|
|
4098
|
+
const __prepareFlowSigning_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4076
4099
|
fn: __prepareFlowSigning_impl,
|
|
4077
4100
|
functionName: "prepareFlowSigning",
|
|
4078
4101
|
getCore: () => {
|
|
4079
4102
|
try {
|
|
4080
|
-
return
|
|
4103
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4081
4104
|
} catch {
|
|
4082
4105
|
return;
|
|
4083
4106
|
}
|
|
@@ -4117,32 +4140,32 @@ const submitFlowTransactionInstrumentation = { resolved: (flow) => ({
|
|
|
4117
4140
|
* @returns The broadcasted flow
|
|
4118
4141
|
* @instrumented
|
|
4119
4142
|
*/
|
|
4120
|
-
const submitFlowTransaction = async ({ onStepChange, flowId, walletAccount, assertBalanceForGasCost, assertBalanceForTransferAmount }, client =
|
|
4143
|
+
const submitFlowTransaction = async ({ onStepChange, flowId, walletAccount, assertBalanceForGasCost, assertBalanceForTransferAmount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4121
4144
|
const signingPayload = (await __prepareFlowSigning_wrapped({
|
|
4122
4145
|
assertBalanceForGasCost,
|
|
4123
4146
|
assertBalanceForTransferAmount,
|
|
4124
4147
|
flowId
|
|
4125
4148
|
}, client)).quote?.signingPayload;
|
|
4126
|
-
|
|
4149
|
+
require_logoutWithReason.assertDefined(signingPayload, "No signing payload returned from prepare — quote may be missing transaction data");
|
|
4127
4150
|
const { transactionHash } = await __executeSwapTransaction_wrapped({
|
|
4128
4151
|
onStepChange,
|
|
4129
4152
|
signingPayload,
|
|
4130
4153
|
walletAccount
|
|
4131
4154
|
}, client);
|
|
4132
|
-
|
|
4133
|
-
|
|
4155
|
+
require_logoutWithReason.getCore(client).logger.debug("[submitFlowTransaction] transaction hash returned from swap transaction execution", { transactionHash });
|
|
4156
|
+
require_logoutWithReason.assertDefined(transactionHash, "No transaction hash returned from transaction execution. Flow transaction may not have been executed successfully.");
|
|
4134
4157
|
return __broadcastFlow_wrapped({
|
|
4135
4158
|
flowId,
|
|
4136
4159
|
txHash: transactionHash
|
|
4137
4160
|
}, client);
|
|
4138
4161
|
};
|
|
4139
4162
|
const __submitFlowTransaction_impl = submitFlowTransaction;
|
|
4140
|
-
const __submitFlowTransaction_wrapped =
|
|
4163
|
+
const __submitFlowTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4141
4164
|
fn: __submitFlowTransaction_impl,
|
|
4142
4165
|
functionName: "submitFlowTransaction",
|
|
4143
4166
|
getCore: () => {
|
|
4144
4167
|
try {
|
|
4145
|
-
return
|
|
4168
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4146
4169
|
} catch {
|
|
4147
4170
|
return;
|
|
4148
4171
|
}
|
|
@@ -4163,9 +4186,9 @@ const __submitFlowTransaction_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
4163
4186
|
* @notInstrumented
|
|
4164
4187
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
4165
4188
|
*/
|
|
4166
|
-
const addCoinbaseOnrampOrderEventListener = ({ listener }, client =
|
|
4167
|
-
const core =
|
|
4168
|
-
if (typeof window === "undefined") throw new
|
|
4189
|
+
const addCoinbaseOnrampOrderEventListener = ({ listener }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4190
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4191
|
+
if (typeof window === "undefined") throw new require_logoutWithReason.ValueMustBeDefinedError("Window is not available to listen for Coinbase onramp order events");
|
|
4169
4192
|
const handleMessageEvent = (event) => {
|
|
4170
4193
|
if (event.origin !== "https://pay.coinbase.com") return;
|
|
4171
4194
|
core.logger.debug("[addCoinbaseOnrampOrderEventListener] pay.coinbase.com event received", { event });
|
|
@@ -4350,9 +4373,9 @@ const parseCoinbaseTravelRuleMissingFields = ({ message }) => {
|
|
|
4350
4373
|
* @see CoinbaseTravelRuleRequiredError
|
|
4351
4374
|
* @notInstrumented
|
|
4352
4375
|
*/
|
|
4353
|
-
const createCoinbaseExchangeTransfer = async (transferParams, client =
|
|
4354
|
-
const core =
|
|
4355
|
-
const apiClient =
|
|
4376
|
+
const createCoinbaseExchangeTransfer = async (transferParams, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4377
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4378
|
+
const apiClient = require_logoutWithReason.createApiClient({ includeMfaToken: true }, client);
|
|
4356
4379
|
const { accountId, ...createExchangeTransferRequest } = transferParams;
|
|
4357
4380
|
try {
|
|
4358
4381
|
return await apiClient.postExchangeAccountTransfer({
|
|
@@ -4362,7 +4385,7 @@ const createCoinbaseExchangeTransfer = async (transferParams, client = require_u
|
|
|
4362
4385
|
exchangeKey: _dynamic_labs_sdk_api_core.ExchangeKeyEnum.Coinbase
|
|
4363
4386
|
});
|
|
4364
4387
|
} catch (error) {
|
|
4365
|
-
if (!(error instanceof
|
|
4388
|
+
if (!(error instanceof require_logoutWithReason.APIError)) throw error;
|
|
4366
4389
|
if (error.code === "transfer_mfa_required") throw new CoinbaseTransferMfaRequiredError({ cause: error });
|
|
4367
4390
|
if (error.code === "transfer_mfa_failed") throw new CoinbaseTransferMfaFailedError({ cause: error });
|
|
4368
4391
|
if (error.code === "unknown_transfer_error") {
|
|
@@ -4394,10 +4417,10 @@ const createCoinbaseExchangeTransfer = async (transferParams, client = require_u
|
|
|
4394
4417
|
* @throws {ValueMustBeDefinedError} - If the user is not authenticated
|
|
4395
4418
|
* @notInstrumented
|
|
4396
4419
|
*/
|
|
4397
|
-
const getMissingVerificationForCoinbaseOnrampOrder = ({ paymentMethod }, client =
|
|
4398
|
-
if (paymentMethod !== "GUEST_CHECKOUT_APPLE_PAY") throw new
|
|
4420
|
+
const getMissingVerificationForCoinbaseOnrampOrder = ({ paymentMethod }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4421
|
+
if (paymentMethod !== "GUEST_CHECKOUT_APPLE_PAY") throw new require_logoutWithReason.InvalidParamError(`Invalid payment method: ${paymentMethod}`);
|
|
4399
4422
|
const { user } = client;
|
|
4400
|
-
|
|
4423
|
+
require_logoutWithReason.assertDefined(user, "User is not authenticated");
|
|
4401
4424
|
const fieldsMissingVerification = [];
|
|
4402
4425
|
const emailVerifiedCredential = user.verifiedCredentials.find((credential) => credential.format === _dynamic_labs_sdk_api_core.JwtVerifiedCredentialFormatEnum.Email);
|
|
4403
4426
|
if (!user.email) fieldsMissingVerification.push({
|
|
@@ -4433,7 +4456,7 @@ const getMissingVerificationForCoinbaseOnrampOrder = ({ paymentMethod }, client
|
|
|
4433
4456
|
/** @notInstrumented */
|
|
4434
4457
|
const validateUserCredentialsForCoinbaseOnrampOrder = (client) => {
|
|
4435
4458
|
const { user } = client;
|
|
4436
|
-
|
|
4459
|
+
require_logoutWithReason.assertDefined(user, "User is not authenticated");
|
|
4437
4460
|
const fieldsMissingVerification = getMissingVerificationForCoinbaseOnrampOrder({ paymentMethod: "GUEST_CHECKOUT_APPLE_PAY" }, client);
|
|
4438
4461
|
if (fieldsMissingVerification.find((field) => field.field === "email")) throw new MissingUserVerificationError({
|
|
4439
4462
|
informationToVerify: "email",
|
|
@@ -4462,10 +4485,10 @@ const validateUserCredentialsForCoinbaseOnrampOrder = (client) => {
|
|
|
4462
4485
|
* @throws {MissingUserVerificationError} If the user is missing verification for email or phone
|
|
4463
4486
|
* @instrumented
|
|
4464
4487
|
*/
|
|
4465
|
-
const createCoinbaseOnrampOrder = async (orderParams, client =
|
|
4488
|
+
const createCoinbaseOnrampOrder = async (orderParams, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4466
4489
|
const user = validateUserCredentialsForCoinbaseOnrampOrder(client);
|
|
4467
|
-
const core =
|
|
4468
|
-
const apiClient =
|
|
4490
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4491
|
+
const apiClient = require_logoutWithReason.createApiClient({ includeMfaToken: true }, client);
|
|
4469
4492
|
const { isSandbox, ...restOrderParams } = orderParams;
|
|
4470
4493
|
const orderResponse = await apiClient.createCoinbaseOnrampOrder({
|
|
4471
4494
|
coinbaseOnrampOrderCreateRequest: {
|
|
@@ -4485,12 +4508,12 @@ const createCoinbaseOnrampOrder = async (orderParams, client = require_updateAut
|
|
|
4485
4508
|
};
|
|
4486
4509
|
};
|
|
4487
4510
|
const __createCoinbaseOnrampOrder_impl = createCoinbaseOnrampOrder;
|
|
4488
|
-
const __createCoinbaseOnrampOrder_wrapped =
|
|
4511
|
+
const __createCoinbaseOnrampOrder_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4489
4512
|
fn: __createCoinbaseOnrampOrder_impl,
|
|
4490
4513
|
functionName: "createCoinbaseOnrampOrder",
|
|
4491
4514
|
getCore: () => {
|
|
4492
4515
|
try {
|
|
4493
|
-
return
|
|
4516
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4494
4517
|
} catch {
|
|
4495
4518
|
return;
|
|
4496
4519
|
}
|
|
@@ -4513,8 +4536,8 @@ const CHAIN_ENUM_VALUES = Object.values(_dynamic_labs_sdk_api_core.ChainEnum);
|
|
|
4513
4536
|
* @notInstrumented
|
|
4514
4537
|
*/
|
|
4515
4538
|
const assertChainName = (chainName) => {
|
|
4516
|
-
if (chainName === void 0) throw new
|
|
4517
|
-
if (!CHAIN_ENUM_VALUES.includes(chainName)) throw new
|
|
4539
|
+
if (chainName === void 0) throw new require_logoutWithReason.InvalidParamError("chainName is required");
|
|
4540
|
+
if (!CHAIN_ENUM_VALUES.includes(chainName)) throw new require_logoutWithReason.InvalidParamError(`Invalid chainName: ${chainName}`);
|
|
4518
4541
|
};
|
|
4519
4542
|
|
|
4520
4543
|
//#endregion
|
|
@@ -4535,13 +4558,13 @@ const assertChainName = (chainName) => {
|
|
|
4535
4558
|
* @see GetCoinbaseAccountsParams
|
|
4536
4559
|
* @notInstrumented
|
|
4537
4560
|
*/
|
|
4538
|
-
const getCoinbaseAccounts = async (params, client =
|
|
4539
|
-
const core =
|
|
4540
|
-
const apiClient =
|
|
4561
|
+
const getCoinbaseAccounts = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4562
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4563
|
+
const apiClient = require_logoutWithReason.createApiClient({ includeMfaToken: true }, client);
|
|
4541
4564
|
const chainName = params?.chainName;
|
|
4542
4565
|
if (chainName !== void 0) assertChainName(chainName);
|
|
4543
4566
|
const networkId = params?.networkId;
|
|
4544
|
-
if (networkId !== void 0 && (!Number.isInteger(networkId) || networkId < 0)) throw new
|
|
4567
|
+
if (networkId !== void 0 && (!Number.isInteger(networkId) || networkId < 0)) throw new require_logoutWithReason.InvalidParamError(`Invalid networkId: ${networkId}`);
|
|
4545
4568
|
return await apiClient.getUserAccounts({
|
|
4546
4569
|
chainName,
|
|
4547
4570
|
environmentId: core.environmentId,
|
|
@@ -4560,9 +4583,9 @@ const getCoinbaseAccounts = async (params, client = require_updateAuthFromVerify
|
|
|
4560
4583
|
* @returns an object containing the buy URL
|
|
4561
4584
|
* @notInstrumented
|
|
4562
4585
|
*/
|
|
4563
|
-
const getCoinbaseBuyUrl = async (buyUrlParams, client =
|
|
4564
|
-
const core =
|
|
4565
|
-
return await
|
|
4586
|
+
const getCoinbaseBuyUrl = async (buyUrlParams, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4587
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4588
|
+
return await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).generateCoinbaseOnrampBuyUrl({
|
|
4566
4589
|
coinbaseOnrampGetBuyUrlRequest: buyUrlParams,
|
|
4567
4590
|
environmentId: core.environmentId
|
|
4568
4591
|
});
|
|
@@ -4578,9 +4601,9 @@ const getCoinbaseBuyUrl = async (buyUrlParams, client = require_updateAuthFromVe
|
|
|
4578
4601
|
* @returns The created payment
|
|
4579
4602
|
* @instrumented
|
|
4580
4603
|
*/
|
|
4581
|
-
const createCryptoDotComPayment = async (paymentParams, client =
|
|
4582
|
-
const core =
|
|
4583
|
-
return await
|
|
4604
|
+
const createCryptoDotComPayment = async (paymentParams, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4605
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4606
|
+
return await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).createCryptoDotComPayment({
|
|
4584
4607
|
cryptoDotComPaymentCreateRequest: {
|
|
4585
4608
|
...paymentParams,
|
|
4586
4609
|
chain: paymentParams.chain
|
|
@@ -4589,12 +4612,12 @@ const createCryptoDotComPayment = async (paymentParams, client = require_updateA
|
|
|
4589
4612
|
});
|
|
4590
4613
|
};
|
|
4591
4614
|
const __createCryptoDotComPayment_impl = createCryptoDotComPayment;
|
|
4592
|
-
const __createCryptoDotComPayment_wrapped =
|
|
4615
|
+
const __createCryptoDotComPayment_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4593
4616
|
fn: __createCryptoDotComPayment_impl,
|
|
4594
4617
|
functionName: "createCryptoDotComPayment",
|
|
4595
4618
|
getCore: () => {
|
|
4596
4619
|
try {
|
|
4597
|
-
return
|
|
4620
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4598
4621
|
} catch {
|
|
4599
4622
|
return;
|
|
4600
4623
|
}
|
|
@@ -4611,9 +4634,9 @@ const __createCryptoDotComPayment_wrapped = require_updateAuthFromVerifyResponse
|
|
|
4611
4634
|
* @returns The created transfer
|
|
4612
4635
|
* @notInstrumented
|
|
4613
4636
|
*/
|
|
4614
|
-
const createKrakenExchangeTransfer = async (transferParams, client =
|
|
4615
|
-
const core =
|
|
4616
|
-
const apiClient =
|
|
4637
|
+
const createKrakenExchangeTransfer = async (transferParams, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4638
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4639
|
+
const apiClient = require_logoutWithReason.createApiClient({ includeMfaToken: true }, client);
|
|
4617
4640
|
const { accountId, ...createExchangeTransferRequest } = transferParams;
|
|
4618
4641
|
return await apiClient.postExchangeAccountTransfer({
|
|
4619
4642
|
accountId,
|
|
@@ -4633,9 +4656,9 @@ const createKrakenExchangeTransfer = async (transferParams, client = require_upd
|
|
|
4633
4656
|
* @returns Array of Kraken accounts with balances
|
|
4634
4657
|
* @notInstrumented
|
|
4635
4658
|
*/
|
|
4636
|
-
const getKrakenAccounts = async (params, client =
|
|
4637
|
-
const core =
|
|
4638
|
-
return await
|
|
4659
|
+
const getKrakenAccounts = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4660
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4661
|
+
return await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).getUserAccounts({
|
|
4639
4662
|
chainName: params?.chainName,
|
|
4640
4663
|
environmentId: core.environmentId,
|
|
4641
4664
|
exchangeKey: _dynamic_labs_sdk_api_core.ExchangeKeyEnum.Kraken,
|
|
@@ -4652,9 +4675,9 @@ const getKrakenAccounts = async (params, client = require_updateAuthFromVerifyRe
|
|
|
4652
4675
|
* @returns Transfer destinations response with whitelisted addresses
|
|
4653
4676
|
* @notInstrumented
|
|
4654
4677
|
*/
|
|
4655
|
-
const getKrakenWhitelistedAddresses = async (client =
|
|
4656
|
-
const core =
|
|
4657
|
-
return await
|
|
4678
|
+
const getKrakenWhitelistedAddresses = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
4679
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4680
|
+
return await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).getExchangeTransferDestinations({
|
|
4658
4681
|
environmentId: core.environmentId,
|
|
4659
4682
|
exchangeKey: _dynamic_labs_sdk_api_core.ExchangeKeyEnum.Kraken
|
|
4660
4683
|
});
|
|
@@ -4672,21 +4695,21 @@ const getKrakenWhitelistedAddresses = async (client = require_updateAuthFromVeri
|
|
|
4672
4695
|
* @returns An array of supported MoonPay currencies.
|
|
4673
4696
|
* @instrumented
|
|
4674
4697
|
*/
|
|
4675
|
-
const getMoonPayCurrencies = async (params, client =
|
|
4676
|
-
const core =
|
|
4677
|
-
return (await
|
|
4698
|
+
const getMoonPayCurrencies = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4699
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4700
|
+
return (await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).getMoonPayCurrencies({
|
|
4678
4701
|
chain: params.chain,
|
|
4679
4702
|
environmentId: core.environmentId,
|
|
4680
4703
|
...params.networkId ? { networkId: params.networkId } : {}
|
|
4681
4704
|
})).currencies ?? [];
|
|
4682
4705
|
};
|
|
4683
4706
|
const __getMoonPayCurrencies_impl = getMoonPayCurrencies;
|
|
4684
|
-
const __getMoonPayCurrencies_wrapped =
|
|
4707
|
+
const __getMoonPayCurrencies_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4685
4708
|
fn: __getMoonPayCurrencies_impl,
|
|
4686
4709
|
functionName: "getMoonPayCurrencies",
|
|
4687
4710
|
getCore: () => {
|
|
4688
4711
|
try {
|
|
4689
|
-
return
|
|
4712
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4690
4713
|
} catch {
|
|
4691
4714
|
return;
|
|
4692
4715
|
}
|
|
@@ -4695,7 +4718,7 @@ const __getMoonPayCurrencies_wrapped = require_updateAuthFromVerifyResponse.inst
|
|
|
4695
4718
|
|
|
4696
4719
|
//#endregion
|
|
4697
4720
|
//#region src/modules/funding/moonpay/errors/MoonPayInvalidUrlError.ts
|
|
4698
|
-
var MoonPayInvalidUrlError = class extends
|
|
4721
|
+
var MoonPayInvalidUrlError = class extends require_logoutWithReason.BaseError {
|
|
4699
4722
|
constructor() {
|
|
4700
4723
|
super({
|
|
4701
4724
|
cause: null,
|
|
@@ -4709,7 +4732,7 @@ var MoonPayInvalidUrlError = class extends require_updateAuthFromVerifyResponse.
|
|
|
4709
4732
|
|
|
4710
4733
|
//#endregion
|
|
4711
4734
|
//#region src/modules/funding/moonpay/errors/MoonPayProviderNotAvailableError.ts
|
|
4712
|
-
var MoonPayProviderNotAvailableError = class extends
|
|
4735
|
+
var MoonPayProviderNotAvailableError = class extends require_logoutWithReason.BaseError {
|
|
4713
4736
|
constructor() {
|
|
4714
4737
|
super({
|
|
4715
4738
|
cause: null,
|
|
@@ -4734,9 +4757,9 @@ var MoonPayProviderNotAvailableError = class extends require_updateAuthFromVerif
|
|
|
4734
4757
|
* @returns The signed MoonPay URL.
|
|
4735
4758
|
* @instrumented
|
|
4736
4759
|
*/
|
|
4737
|
-
const getMoonPayUrl = async (params, client =
|
|
4738
|
-
const core =
|
|
4739
|
-
const moonPayProvider = (await
|
|
4760
|
+
const getMoonPayUrl = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4761
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4762
|
+
const moonPayProvider = (await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).getSupportedOnramps({
|
|
4740
4763
|
chain: params.chain,
|
|
4741
4764
|
currency: params.currency,
|
|
4742
4765
|
environmentId: core.environmentId,
|
|
@@ -4757,12 +4780,12 @@ const getMoonPayUrl = async (params, client = require_updateAuthFromVerifyRespon
|
|
|
4757
4780
|
return moonPayProvider.url;
|
|
4758
4781
|
};
|
|
4759
4782
|
const __getMoonPayUrl_impl = getMoonPayUrl;
|
|
4760
|
-
const __getMoonPayUrl_wrapped =
|
|
4783
|
+
const __getMoonPayUrl_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4761
4784
|
fn: __getMoonPayUrl_impl,
|
|
4762
4785
|
functionName: "getMoonPayUrl",
|
|
4763
4786
|
getCore: () => {
|
|
4764
4787
|
try {
|
|
4765
|
-
return
|
|
4788
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4766
4789
|
} catch {
|
|
4767
4790
|
return;
|
|
4768
4791
|
}
|
|
@@ -4789,8 +4812,8 @@ const __getMoonPayUrl_wrapped = require_updateAuthFromVerifyResponse.instrumentF
|
|
|
4789
4812
|
* @notInstrumented
|
|
4790
4813
|
* @noHook Client lifecycle management is not exposed as a hook; use useInitStatus.
|
|
4791
4814
|
*/
|
|
4792
|
-
const waitForClientInitialized = async (client =
|
|
4793
|
-
await
|
|
4815
|
+
const waitForClientInitialized = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
4816
|
+
await require_logoutWithReason.getCore(client).initTrack.waitForAll();
|
|
4794
4817
|
};
|
|
4795
4818
|
|
|
4796
4819
|
//#endregion
|
|
@@ -4803,16 +4826,16 @@ const waitForClientInitialized = async (client = require_updateAuthFromVerifyRes
|
|
|
4803
4826
|
* normally but emit no telemetry.
|
|
4804
4827
|
* @instrumented
|
|
4805
4828
|
*/
|
|
4806
|
-
const setInstrumentationEnabled = ({ enabled }, client =
|
|
4807
|
-
|
|
4829
|
+
const setInstrumentationEnabled = ({ enabled }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
4830
|
+
require_logoutWithReason.getCore(client).instrumentation.setEnabled(enabled);
|
|
4808
4831
|
};
|
|
4809
4832
|
const __setInstrumentationEnabled_impl = setInstrumentationEnabled;
|
|
4810
|
-
const __setInstrumentationEnabled_wrapped =
|
|
4833
|
+
const __setInstrumentationEnabled_wrapped = require_logoutWithReason.instrumentFunction({
|
|
4811
4834
|
fn: __setInstrumentationEnabled_impl,
|
|
4812
4835
|
functionName: "setInstrumentationEnabled",
|
|
4813
4836
|
getCore: () => {
|
|
4814
4837
|
try {
|
|
4815
|
-
return
|
|
4838
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
4816
4839
|
} catch {
|
|
4817
4840
|
return;
|
|
4818
4841
|
}
|
|
@@ -4974,10 +4997,10 @@ const FETCH_TIMEOUT_MS = 3e4;
|
|
|
4974
4997
|
const fetchWithTimeout = async (client) => {
|
|
4975
4998
|
const controller = new AbortController();
|
|
4976
4999
|
const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
4977
|
-
const core =
|
|
5000
|
+
const core = require_logoutWithReason.getCore(client);
|
|
4978
5001
|
try {
|
|
4979
5002
|
const response = await core.fetch(getWalletBookCdnUrl(), { signal: controller.signal });
|
|
4980
|
-
if (!response.ok) throw new
|
|
5003
|
+
if (!response.ok) throw new require_logoutWithReason.APIError(`Failed to fetch wallet book: ${response.status} ${response.statusText}`, "wallet_book_fetch_error", response.status);
|
|
4981
5004
|
return await response.json();
|
|
4982
5005
|
} finally {
|
|
4983
5006
|
clearTimeout(timeoutId);
|
|
@@ -4989,7 +5012,7 @@ const fetchWithTimeout = async (client) => {
|
|
|
4989
5012
|
/**
|
|
4990
5013
|
* The schema to store the cached wallet book data.
|
|
4991
5014
|
*/
|
|
4992
|
-
const walletBookCacheStorageKeySchema =
|
|
5015
|
+
const walletBookCacheStorageKeySchema = require_logoutWithReason.createStorageKeySchema({
|
|
4993
5016
|
key: "legacyWalletBookCache",
|
|
4994
5017
|
schema: zod_mini.object({
|
|
4995
5018
|
groups: zod_mini.record(zod_mini.string(), zod_mini.any()),
|
|
@@ -5021,10 +5044,10 @@ const RETRY_DELAY_MS = 100;
|
|
|
5021
5044
|
* @notInstrumented
|
|
5022
5045
|
*/
|
|
5023
5046
|
const fetchLegacyWalletBook = async (client) => {
|
|
5024
|
-
const core =
|
|
5047
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5025
5048
|
core.logger.debug("[fetchLegacyWalletBook] Fetching wallet book...");
|
|
5026
5049
|
try {
|
|
5027
|
-
const walletBook = await
|
|
5050
|
+
const walletBook = await require_logoutWithReason.retryOnFail({
|
|
5028
5051
|
delay: RETRY_DELAY_MS,
|
|
5029
5052
|
fn: async () => fetchWithTimeout(client),
|
|
5030
5053
|
maxRetries: MAX_RETRIES
|
|
@@ -5119,7 +5142,7 @@ const shouldFilterWalletForWalletConnect = ({ wallet, walletKey }) => {
|
|
|
5119
5142
|
* @returns The full URL to the sprite icon
|
|
5120
5143
|
* @notInstrumented
|
|
5121
5144
|
*/
|
|
5122
|
-
const getSpriteUrl = ({ spriteId }) => `${
|
|
5145
|
+
const getSpriteUrl = ({ spriteId }) => `${require_logoutWithReason.DYNAMIC_ICONIC_SPRITE_URL}#${spriteId}`;
|
|
5123
5146
|
|
|
5124
5147
|
//#endregion
|
|
5125
5148
|
//#region src/modules/legacyWalletBook/getWalletConnectCatalog/transformGroup/transformGroup.ts
|
|
@@ -5156,8 +5179,8 @@ const transformGroup = ({ group }) => {
|
|
|
5156
5179
|
*/
|
|
5157
5180
|
const getChainFromWalletBookIdentifier = ({ identifier }) => {
|
|
5158
5181
|
const normalised = identifier.toLowerCase();
|
|
5159
|
-
return Object.keys(
|
|
5160
|
-
const info =
|
|
5182
|
+
return Object.keys(require_logoutWithReason.CHAINS_INFO_MAP).find((chain) => {
|
|
5183
|
+
const info = require_logoutWithReason.CHAINS_INFO_MAP[chain];
|
|
5161
5184
|
return info.apiChainName === normalised || info.legacyWalletBookAliases?.includes(normalised) === true;
|
|
5162
5185
|
});
|
|
5163
5186
|
};
|
|
@@ -5189,9 +5212,9 @@ const extractChainPrefix = ({ chainIdentifier }) => {
|
|
|
5189
5212
|
*/
|
|
5190
5213
|
const getChainFromWalletKey = ({ walletKey }) => {
|
|
5191
5214
|
const lowerKey = walletKey.toLowerCase();
|
|
5192
|
-
const chains = Object.keys(
|
|
5215
|
+
const chains = Object.keys(require_logoutWithReason.CHAINS_INFO_MAP);
|
|
5193
5216
|
for (const chain of chains) {
|
|
5194
|
-
const info =
|
|
5217
|
+
const info = require_logoutWithReason.CHAINS_INFO_MAP[chain];
|
|
5195
5218
|
if ([info.apiChainName, ...info.legacyWalletBookAliases ?? []].some((pattern) => lowerKey.includes(pattern))) return chain;
|
|
5196
5219
|
}
|
|
5197
5220
|
};
|
|
@@ -5217,7 +5240,7 @@ const getChainFromWalletSchema = ({ wallet, walletKey }) => {
|
|
|
5217
5240
|
const firstChain = wallet.chains[0];
|
|
5218
5241
|
const chainPrefix = extractChainPrefix({ chainIdentifier: firstChain });
|
|
5219
5242
|
try {
|
|
5220
|
-
return
|
|
5243
|
+
return require_logoutWithReason.getChainFromVerifiedCredentialChain(chainPrefix);
|
|
5221
5244
|
} catch {}
|
|
5222
5245
|
}
|
|
5223
5246
|
if (walletKey) {
|
|
@@ -5297,7 +5320,7 @@ const transformWalletBook = ({ walletBook }) => {
|
|
|
5297
5320
|
* @throws If unable to fetch the wallet book from the API (when both CDN fetch and cache retrieval fail).
|
|
5298
5321
|
* @notInstrumented
|
|
5299
5322
|
*/
|
|
5300
|
-
const getWalletConnectCatalog = async (client =
|
|
5323
|
+
const getWalletConnectCatalog = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5301
5324
|
return transformWalletBook({ walletBook: await fetchLegacyWalletBook(client) });
|
|
5302
5325
|
};
|
|
5303
5326
|
|
|
@@ -5313,7 +5336,7 @@ const getWalletConnectCatalog = async (client = require_updateAuthFromVerifyResp
|
|
|
5313
5336
|
*/
|
|
5314
5337
|
const extractChainFromNormalizedName = ({ normalizedWalletNameWithChain }) => {
|
|
5315
5338
|
const lowerName = normalizedWalletNameWithChain.toLowerCase();
|
|
5316
|
-
const chainSuffixes = Object.keys(
|
|
5339
|
+
const chainSuffixes = Object.keys(require_logoutWithReason.CHAINS_INFO_MAP).map((chain) => chain.toLowerCase()).sort((a, b) => b.length - a.length);
|
|
5317
5340
|
for (const suffix of chainSuffixes) if (lowerName.endsWith(suffix)) return suffix.toUpperCase();
|
|
5318
5341
|
};
|
|
5319
5342
|
|
|
@@ -5331,8 +5354,8 @@ const extractChainFromNormalizedName = ({ normalizedWalletNameWithChain }) => {
|
|
|
5331
5354
|
* @returns A promise that resolves to the WalletConnect catalog wallet entry, or undefined if not found.
|
|
5332
5355
|
* @notInstrumented
|
|
5333
5356
|
*/
|
|
5334
|
-
const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProviderKey }, client =
|
|
5335
|
-
const { normalizedWalletNameWithChain } =
|
|
5357
|
+
const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5358
|
+
const { normalizedWalletNameWithChain } = require_logoutWithReason.splitWalletProviderKey(walletProviderKey);
|
|
5336
5359
|
const chain = extractChainFromNormalizedName({ normalizedWalletNameWithChain });
|
|
5337
5360
|
if (!chain) return;
|
|
5338
5361
|
let walletProviderName = normalizedWalletNameWithChain.toLowerCase();
|
|
@@ -5361,13 +5384,13 @@ const getWalletConnectCatalogWalletByWalletProviderKey = async ({ walletProvider
|
|
|
5361
5384
|
* @returns A promise that resolves to OTP verification details if verification is required, or undefined.
|
|
5362
5385
|
* @instrumented
|
|
5363
5386
|
*/
|
|
5364
|
-
const updateUser = async ({ userFields }, client =
|
|
5365
|
-
const core =
|
|
5366
|
-
const response = await
|
|
5387
|
+
const updateUser = async ({ userFields }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5388
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5389
|
+
const response = await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).updateSelf({
|
|
5367
5390
|
environmentId: core.environmentId,
|
|
5368
5391
|
userFields
|
|
5369
5392
|
});
|
|
5370
|
-
|
|
5393
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
5371
5394
|
if (response.emailVerification) return {
|
|
5372
5395
|
email: response.emailVerification.email,
|
|
5373
5396
|
verificationUUID: response.emailVerification.verificationUUID
|
|
@@ -5380,12 +5403,12 @@ const updateUser = async ({ userFields }, client = require_updateAuthFromVerifyR
|
|
|
5380
5403
|
};
|
|
5381
5404
|
};
|
|
5382
5405
|
const __updateUser_impl = updateUser;
|
|
5383
|
-
const __updateUser_wrapped =
|
|
5406
|
+
const __updateUser_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5384
5407
|
fn: __updateUser_impl,
|
|
5385
5408
|
functionName: "updateUser",
|
|
5386
5409
|
getCore: () => {
|
|
5387
5410
|
try {
|
|
5388
|
-
return
|
|
5411
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5389
5412
|
} catch {
|
|
5390
5413
|
return;
|
|
5391
5414
|
}
|
|
@@ -5404,16 +5427,16 @@ const __updateUser_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
5404
5427
|
* @returns A promise that resolves when the acknowledgment is complete.
|
|
5405
5428
|
* @instrumented
|
|
5406
5429
|
*/
|
|
5407
|
-
const acknowledgeRecoveryCodes = async (client =
|
|
5430
|
+
const acknowledgeRecoveryCodes = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5408
5431
|
return __updateUser_wrapped({ userFields: { mfaBackupCodeAcknowledgement: _dynamic_labs_sdk_api_core.MfaBackupCodeAcknowledgement.Complete } }, client);
|
|
5409
5432
|
};
|
|
5410
5433
|
const __acknowledgeRecoveryCodes_impl = acknowledgeRecoveryCodes;
|
|
5411
|
-
const __acknowledgeRecoveryCodes_wrapped =
|
|
5434
|
+
const __acknowledgeRecoveryCodes_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5412
5435
|
fn: __acknowledgeRecoveryCodes_impl,
|
|
5413
5436
|
functionName: "acknowledgeRecoveryCodes",
|
|
5414
5437
|
getCore: () => {
|
|
5415
5438
|
try {
|
|
5416
|
-
return
|
|
5439
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5417
5440
|
} catch {
|
|
5418
5441
|
return;
|
|
5419
5442
|
}
|
|
@@ -5435,9 +5458,9 @@ const __acknowledgeRecoveryCodes_wrapped = require_updateAuthFromVerifyResponse.
|
|
|
5435
5458
|
* @returns A promise that resolves to the MFA authentication response.
|
|
5436
5459
|
* @notInstrumented
|
|
5437
5460
|
*/
|
|
5438
|
-
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, requestedScopes }, client =
|
|
5439
|
-
const core =
|
|
5440
|
-
const apiClient =
|
|
5461
|
+
const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, requestedScopes }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5462
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5463
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
5441
5464
|
try {
|
|
5442
5465
|
const response = await apiClient.authMfaRecovery({
|
|
5443
5466
|
environmentId: core.environmentId,
|
|
@@ -5447,14 +5470,14 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, reques
|
|
|
5447
5470
|
requestedScopes
|
|
5448
5471
|
}
|
|
5449
5472
|
});
|
|
5450
|
-
|
|
5451
|
-
|
|
5473
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
5474
|
+
require_logoutWithReason.emitEvent({
|
|
5452
5475
|
args: { mfaToken: response.mfaToken },
|
|
5453
5476
|
event: "mfaCompletionSuccess"
|
|
5454
5477
|
}, client);
|
|
5455
5478
|
return response;
|
|
5456
5479
|
} catch (error) {
|
|
5457
|
-
|
|
5480
|
+
require_logoutWithReason.emitEvent({
|
|
5458
5481
|
args: { error },
|
|
5459
5482
|
event: "mfaCompletionFailure"
|
|
5460
5483
|
}, client);
|
|
@@ -5466,8 +5489,8 @@ const authenticateMfaRecoveryCode = async ({ code, createMfaTokenOptions, reques
|
|
|
5466
5489
|
//#region src/modules/auth/passkeys/getPasskeyAuthenticationOptions/getPasskeyAuthenticationOptions.ts
|
|
5467
5490
|
/** @notInstrumented */
|
|
5468
5491
|
const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, client) => {
|
|
5469
|
-
const core =
|
|
5470
|
-
return await
|
|
5492
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5493
|
+
return await require_logoutWithReason.createApiClient({}, client).getPasskeyAuthenticationOptions({
|
|
5471
5494
|
environmentId: core.environmentId,
|
|
5472
5495
|
relatedOriginRpId
|
|
5473
5496
|
});
|
|
@@ -5477,8 +5500,8 @@ const getPasskeyAuthenticationOptions = async ({ relatedOriginRpId } = {}, clien
|
|
|
5477
5500
|
//#region src/modules/auth/passkeys/serverAuthenticatePasskey/serverAuthenticatePasskey.ts
|
|
5478
5501
|
/** @notInstrumented */
|
|
5479
5502
|
const serverAuthenticatePasskey = async ({ authentication, createMfaToken, requestedScopes }, client) => {
|
|
5480
|
-
const core =
|
|
5481
|
-
return await
|
|
5503
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5504
|
+
return await require_logoutWithReason.createApiClient({}, client).authenticateMfaPasskeyDevice({
|
|
5482
5505
|
environmentId: core.environmentId,
|
|
5483
5506
|
passkeyAuthRequest: {
|
|
5484
5507
|
...authentication,
|
|
@@ -5508,8 +5531,8 @@ const serverAuthenticatePasskey = async ({ authentication, createMfaToken, reque
|
|
|
5508
5531
|
* @throws NoPasskeyCredentialsFoundError If no passkey credentials are found.
|
|
5509
5532
|
* @notInstrumented
|
|
5510
5533
|
*/
|
|
5511
|
-
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, requestedScopes } = {}, client =
|
|
5512
|
-
const core =
|
|
5534
|
+
const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, requestedScopes } = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5535
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5513
5536
|
try {
|
|
5514
5537
|
if (!core.passkey.isSupported()) throw new NoWebAuthNSupportError();
|
|
5515
5538
|
const options = await getPasskeyAuthenticationOptions({ relatedOriginRpId }, client);
|
|
@@ -5527,14 +5550,14 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, reque
|
|
|
5527
5550
|
createMfaToken,
|
|
5528
5551
|
requestedScopes
|
|
5529
5552
|
}, client);
|
|
5530
|
-
|
|
5531
|
-
|
|
5553
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
5554
|
+
require_logoutWithReason.emitEvent({
|
|
5532
5555
|
args: { mfaToken: response.mfaToken },
|
|
5533
5556
|
event: "mfaCompletionSuccess"
|
|
5534
5557
|
}, client);
|
|
5535
5558
|
return response;
|
|
5536
5559
|
} catch (error) {
|
|
5537
|
-
|
|
5560
|
+
require_logoutWithReason.emitEvent({
|
|
5538
5561
|
args: { error },
|
|
5539
5562
|
event: "mfaCompletionFailure"
|
|
5540
5563
|
}, client);
|
|
@@ -5558,9 +5581,9 @@ const authenticatePasskeyMFA = async ({ createMfaToken, relatedOriginRpId, reque
|
|
|
5558
5581
|
* @returns A promise that resolves to the MFA authentication response.
|
|
5559
5582
|
* @notInstrumented
|
|
5560
5583
|
*/
|
|
5561
|
-
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions, requestedScopes }, client =
|
|
5562
|
-
const core =
|
|
5563
|
-
const apiClient =
|
|
5584
|
+
const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions, requestedScopes }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5585
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5586
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
5564
5587
|
try {
|
|
5565
5588
|
const response = await apiClient.authMfaTotpDevice({
|
|
5566
5589
|
environmentId: core.environmentId,
|
|
@@ -5571,8 +5594,8 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
5571
5594
|
requestedScopes
|
|
5572
5595
|
}
|
|
5573
5596
|
});
|
|
5574
|
-
|
|
5575
|
-
|
|
5597
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
5598
|
+
require_logoutWithReason.emitEvent({
|
|
5576
5599
|
args: {
|
|
5577
5600
|
deviceId,
|
|
5578
5601
|
mfaToken: response.mfaToken
|
|
@@ -5581,7 +5604,7 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
5581
5604
|
}, client);
|
|
5582
5605
|
return response;
|
|
5583
5606
|
} catch (error) {
|
|
5584
|
-
|
|
5607
|
+
require_logoutWithReason.emitEvent({
|
|
5585
5608
|
args: {
|
|
5586
5609
|
deviceId,
|
|
5587
5610
|
error
|
|
@@ -5604,17 +5627,17 @@ const authenticateTotpMfaDevice = async ({ deviceId, code, createMfaTokenOptions
|
|
|
5604
5627
|
* @returns A promise that resolves to the newly generated recovery codes.
|
|
5605
5628
|
* @instrumented
|
|
5606
5629
|
*/
|
|
5607
|
-
const createNewMfaRecoveryCodes = async (client =
|
|
5608
|
-
const core =
|
|
5609
|
-
return
|
|
5630
|
+
const createNewMfaRecoveryCodes = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5631
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5632
|
+
return require_logoutWithReason.createApiClient({}, client).createNewRecoveryCodes({ environmentId: core.environmentId });
|
|
5610
5633
|
};
|
|
5611
5634
|
const __createNewMfaRecoveryCodes_impl = createNewMfaRecoveryCodes;
|
|
5612
|
-
const __createNewMfaRecoveryCodes_wrapped =
|
|
5635
|
+
const __createNewMfaRecoveryCodes_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5613
5636
|
fn: __createNewMfaRecoveryCodes_impl,
|
|
5614
5637
|
functionName: "createNewMfaRecoveryCodes",
|
|
5615
5638
|
getCore: () => {
|
|
5616
5639
|
try {
|
|
5617
|
-
return
|
|
5640
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5618
5641
|
} catch {
|
|
5619
5642
|
return;
|
|
5620
5643
|
}
|
|
@@ -5637,26 +5660,26 @@ const __createNewMfaRecoveryCodes_wrapped = require_updateAuthFromVerifyResponse
|
|
|
5637
5660
|
* @returns A promise that resolves when the MFA device is successfully deleted.
|
|
5638
5661
|
* @instrumented
|
|
5639
5662
|
*/
|
|
5640
|
-
const deleteMfaDevice = async ({ deviceId, mfaAuthToken }, client =
|
|
5641
|
-
const core =
|
|
5642
|
-
|
|
5643
|
-
if (!
|
|
5663
|
+
const deleteMfaDevice = async ({ deviceId, mfaAuthToken }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5664
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5665
|
+
require_logoutWithReason.assertDefined(deviceId, "deviceId is required");
|
|
5666
|
+
if (!require_logoutWithReason.getElevatedAccessToken({
|
|
5644
5667
|
consume: false,
|
|
5645
5668
|
scope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink
|
|
5646
|
-
}, client))
|
|
5647
|
-
return
|
|
5669
|
+
}, client)) require_logoutWithReason.assertDefined(mfaAuthToken, "mfaAuthToken is required");
|
|
5670
|
+
return require_logoutWithReason.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentialunlink }, client).deleteMfaDevice({
|
|
5648
5671
|
environmentId: core.environmentId,
|
|
5649
5672
|
mfaDeviceId: deviceId,
|
|
5650
5673
|
xMfaAuthToken: mfaAuthToken ?? ""
|
|
5651
5674
|
});
|
|
5652
5675
|
};
|
|
5653
5676
|
const __deleteMfaDevice_impl = deleteMfaDevice;
|
|
5654
|
-
const __deleteMfaDevice_wrapped =
|
|
5677
|
+
const __deleteMfaDevice_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5655
5678
|
fn: __deleteMfaDevice_impl,
|
|
5656
5679
|
functionName: "deleteMfaDevice",
|
|
5657
5680
|
getCore: () => {
|
|
5658
5681
|
try {
|
|
5659
|
-
return
|
|
5682
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5660
5683
|
} catch {
|
|
5661
5684
|
return;
|
|
5662
5685
|
}
|
|
@@ -5675,9 +5698,9 @@ const __deleteMfaDevice_wrapped = require_updateAuthFromVerifyResponse.instrumen
|
|
|
5675
5698
|
* @returns A promise that resolves to an array of the user's registered MFA devices.
|
|
5676
5699
|
* @notInstrumented
|
|
5677
5700
|
*/
|
|
5678
|
-
const getMfaDevices = async (client =
|
|
5679
|
-
const core =
|
|
5680
|
-
const { devices } = await
|
|
5701
|
+
const getMfaDevices = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5702
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5703
|
+
const { devices } = await require_logoutWithReason.createApiClient({}, client).getUserMfaDevices({ environmentId: core.environmentId });
|
|
5681
5704
|
return devices;
|
|
5682
5705
|
};
|
|
5683
5706
|
|
|
@@ -5695,9 +5718,9 @@ const getMfaDevices = async (client = require_updateAuthFromVerifyResponse.getDe
|
|
|
5695
5718
|
* @returns A promise that resolves to the user's MFA recovery codes.
|
|
5696
5719
|
* @notInstrumented
|
|
5697
5720
|
*/
|
|
5698
|
-
const getMfaRecoveryCodes = async (client =
|
|
5699
|
-
const core =
|
|
5700
|
-
return
|
|
5721
|
+
const getMfaRecoveryCodes = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5722
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5723
|
+
return require_logoutWithReason.createApiClient({}, client).getRecoveryCodes({ environmentId: core.environmentId });
|
|
5701
5724
|
};
|
|
5702
5725
|
|
|
5703
5726
|
//#endregion
|
|
@@ -5713,17 +5736,17 @@ const getMfaRecoveryCodes = async (client = require_updateAuthFromVerifyResponse
|
|
|
5713
5736
|
* like the secret key and the OTP Auth URI.
|
|
5714
5737
|
* @instrumented
|
|
5715
5738
|
*/
|
|
5716
|
-
const registerTotpMfaDevice = async (client =
|
|
5717
|
-
const core =
|
|
5718
|
-
return
|
|
5739
|
+
const registerTotpMfaDevice = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
5740
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5741
|
+
return require_logoutWithReason.createApiClient({ elevatedAccessTokenScope: _dynamic_labs_sdk_api_core.TokenScope.Credentiallink }, client).registerTotpMfaDevice({ environmentId: core.environmentId });
|
|
5719
5742
|
};
|
|
5720
5743
|
const __registerTotpMfaDevice_impl = registerTotpMfaDevice;
|
|
5721
|
-
const __registerTotpMfaDevice_wrapped =
|
|
5744
|
+
const __registerTotpMfaDevice_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5722
5745
|
fn: __registerTotpMfaDevice_impl,
|
|
5723
5746
|
functionName: "registerTotpMfaDevice",
|
|
5724
5747
|
getCore: () => {
|
|
5725
5748
|
try {
|
|
5726
|
-
return
|
|
5749
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5727
5750
|
} catch {
|
|
5728
5751
|
return;
|
|
5729
5752
|
}
|
|
@@ -5743,22 +5766,22 @@ const __registerTotpMfaDevice_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
5743
5766
|
* @returns A promise that resolves when the default MFA device is successfully set.
|
|
5744
5767
|
* @instrumented
|
|
5745
5768
|
*/
|
|
5746
|
-
const setDefaultMfaDevice = async ({ deviceId }, client =
|
|
5747
|
-
const core =
|
|
5748
|
-
const apiClient =
|
|
5749
|
-
|
|
5769
|
+
const setDefaultMfaDevice = async ({ deviceId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5770
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5771
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
5772
|
+
require_logoutWithReason.assertDefined(deviceId, "deviceId is required");
|
|
5750
5773
|
return apiClient.updateUserMfaDevice({
|
|
5751
5774
|
environmentId: core.environmentId,
|
|
5752
5775
|
mfaDeviceId: deviceId
|
|
5753
5776
|
});
|
|
5754
5777
|
};
|
|
5755
5778
|
const __setDefaultMfaDevice_impl = setDefaultMfaDevice;
|
|
5756
|
-
const __setDefaultMfaDevice_wrapped =
|
|
5779
|
+
const __setDefaultMfaDevice_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5757
5780
|
fn: __setDefaultMfaDevice_impl,
|
|
5758
5781
|
functionName: "setDefaultMfaDevice",
|
|
5759
5782
|
getCore: () => {
|
|
5760
5783
|
try {
|
|
5761
|
-
return
|
|
5784
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5762
5785
|
} catch {
|
|
5763
5786
|
return;
|
|
5764
5787
|
}
|
|
@@ -5791,9 +5814,9 @@ const __setDefaultMfaDevice_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
5791
5814
|
* @see sendSmsOTP
|
|
5792
5815
|
* @instrumented
|
|
5793
5816
|
*/
|
|
5794
|
-
const sendEmailOTP = async ({ email }, client =
|
|
5795
|
-
const core =
|
|
5796
|
-
const apiClient =
|
|
5817
|
+
const sendEmailOTP = async ({ email }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
5818
|
+
const core = require_logoutWithReason.getCore(client);
|
|
5819
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
5797
5820
|
require_isUserOnboardingComplete.preconnectWaasIframe(client);
|
|
5798
5821
|
const { verificationUUID } = await apiClient.createEmailVerification({
|
|
5799
5822
|
emailVerificationCreateRequest: {
|
|
@@ -5808,12 +5831,12 @@ const sendEmailOTP = async ({ email }, client = require_updateAuthFromVerifyResp
|
|
|
5808
5831
|
};
|
|
5809
5832
|
};
|
|
5810
5833
|
const __sendEmailOTP_impl = sendEmailOTP;
|
|
5811
|
-
const __sendEmailOTP_wrapped =
|
|
5834
|
+
const __sendEmailOTP_wrapped = require_logoutWithReason.instrumentFunction({
|
|
5812
5835
|
fn: __sendEmailOTP_impl,
|
|
5813
5836
|
functionName: "sendEmailOTP",
|
|
5814
5837
|
getCore: () => {
|
|
5815
5838
|
try {
|
|
5816
|
-
return
|
|
5839
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
5817
5840
|
} catch {
|
|
5818
5841
|
return;
|
|
5819
5842
|
}
|
|
@@ -6764,9 +6787,9 @@ const supportedCountries = {
|
|
|
6764
6787
|
* @see sendEmailOTP
|
|
6765
6788
|
* @instrumented
|
|
6766
6789
|
*/
|
|
6767
|
-
const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client =
|
|
6768
|
-
const core =
|
|
6769
|
-
const apiClient =
|
|
6790
|
+
const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
6791
|
+
const core = require_logoutWithReason.getCore(client);
|
|
6792
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
6770
6793
|
const phoneCountryCode = supportedCountries[isoCountryCode].code;
|
|
6771
6794
|
require_isUserOnboardingComplete.preconnectWaasIframe(client);
|
|
6772
6795
|
const { verificationUUID } = await apiClient.createSmsVerification({
|
|
@@ -6786,12 +6809,12 @@ const sendSmsOTP = async ({ isoCountryCode, phoneNumber }, client = require_upda
|
|
|
6786
6809
|
};
|
|
6787
6810
|
};
|
|
6788
6811
|
const __sendSmsOTP_impl = sendSmsOTP;
|
|
6789
|
-
const __sendSmsOTP_wrapped =
|
|
6812
|
+
const __sendSmsOTP_wrapped = require_logoutWithReason.instrumentFunction({
|
|
6790
6813
|
fn: __sendSmsOTP_impl,
|
|
6791
6814
|
functionName: "sendSmsOTP",
|
|
6792
6815
|
getCore: () => {
|
|
6793
6816
|
try {
|
|
6794
|
-
return
|
|
6817
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
6795
6818
|
} catch {
|
|
6796
6819
|
return;
|
|
6797
6820
|
}
|
|
@@ -6802,8 +6825,8 @@ const __sendSmsOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
6802
6825
|
//#region src/modules/otp/verifyOTP/verifyOTPForUserSignIn/verifyOTPForUserSignIn.ts
|
|
6803
6826
|
/** @notInstrumented */
|
|
6804
6827
|
const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, verificationToken }, client) => {
|
|
6805
|
-
const core =
|
|
6806
|
-
const apiClient =
|
|
6828
|
+
const core = require_logoutWithReason.getCore(client);
|
|
6829
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
6807
6830
|
const verifyRequest = {
|
|
6808
6831
|
...allowNewMFALinking !== void 0 && { allowNewMFALinking },
|
|
6809
6832
|
verificationToken,
|
|
@@ -6823,8 +6846,8 @@ const verifyOTPForUserSignIn = async ({ allowNewMFALinking, otpVerification, ver
|
|
|
6823
6846
|
//#region src/modules/otp/verifyOTP/verifyOTPForUserUpdate/verifyOTPForUserUpdate.ts
|
|
6824
6847
|
/** @notInstrumented */
|
|
6825
6848
|
const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requestedScopes }, client) => {
|
|
6826
|
-
const core =
|
|
6827
|
-
const apiClient =
|
|
6849
|
+
const core = require_logoutWithReason.getCore(client);
|
|
6850
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
6828
6851
|
const verifyRequest = {
|
|
6829
6852
|
verificationToken,
|
|
6830
6853
|
verificationUUID: otpVerification.verificationUUID
|
|
@@ -6867,7 +6890,7 @@ const verifyOTPForUserUpdate = async ({ otpVerification, verificationToken, requ
|
|
|
6867
6890
|
* @see sendSmsOTP
|
|
6868
6891
|
* @instrumented
|
|
6869
6892
|
*/
|
|
6870
|
-
const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client =
|
|
6893
|
+
const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes, verificationToken }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
6871
6894
|
require_isUserOnboardingComplete.preconnectWaasIframe(client);
|
|
6872
6895
|
let response;
|
|
6873
6896
|
if (client.user) response = await verifyOTPForUserUpdate({
|
|
@@ -6880,16 +6903,16 @@ const verifyOTP = async ({ allowNewMFALinking, otpVerification, requestedScopes,
|
|
|
6880
6903
|
otpVerification,
|
|
6881
6904
|
verificationToken
|
|
6882
6905
|
}, client);
|
|
6883
|
-
|
|
6906
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
6884
6907
|
return response;
|
|
6885
6908
|
};
|
|
6886
6909
|
const __verifyOTP_impl = verifyOTP;
|
|
6887
|
-
const __verifyOTP_wrapped =
|
|
6910
|
+
const __verifyOTP_wrapped = require_logoutWithReason.instrumentFunction({
|
|
6888
6911
|
fn: __verifyOTP_impl,
|
|
6889
6912
|
functionName: "verifyOTP",
|
|
6890
6913
|
getCore: () => {
|
|
6891
6914
|
try {
|
|
6892
|
-
return
|
|
6915
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
6893
6916
|
} catch {
|
|
6894
6917
|
return;
|
|
6895
6918
|
}
|
|
@@ -6906,11 +6929,11 @@ const __verifyOTP_wrapped = require_updateAuthFromVerifyResponse.instrumentFunct
|
|
|
6906
6929
|
* @returns The swap quote details. Use the `signingPayload` field to get the transaction data for the wallet to sign.
|
|
6907
6930
|
* @notInstrumented
|
|
6908
6931
|
*/
|
|
6909
|
-
const getSwapQuote = async (params, client =
|
|
6910
|
-
const core =
|
|
6911
|
-
const apiClient =
|
|
6912
|
-
if (!params.from.amount && !params.to.amount) throw new
|
|
6913
|
-
if (params.from.amount && params.to.amount) throw new
|
|
6932
|
+
const getSwapQuote = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
6933
|
+
const core = require_logoutWithReason.getCore(client);
|
|
6934
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
6935
|
+
if (!params.from.amount && !params.to.amount) throw new require_logoutWithReason.InvalidParamError("Either from.amount or to.amount is required");
|
|
6936
|
+
if (params.from.amount && params.to.amount) throw new require_logoutWithReason.InvalidParamError("Only one of from.amount or to.amount is allowed");
|
|
6914
6937
|
return await apiClient.swapQuote({
|
|
6915
6938
|
environmentId: core.environmentId,
|
|
6916
6939
|
swapQuoteRequest: {
|
|
@@ -6941,9 +6964,9 @@ const getSwapQuote = async (params, client = require_updateAuthFromVerifyRespons
|
|
|
6941
6964
|
* @returns The swap status.
|
|
6942
6965
|
* @notInstrumented
|
|
6943
6966
|
*/
|
|
6944
|
-
const getSwapStatus = async (params, client =
|
|
6945
|
-
const core =
|
|
6946
|
-
const apiClient =
|
|
6967
|
+
const getSwapStatus = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
6968
|
+
const core = require_logoutWithReason.getCore(client);
|
|
6969
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
6947
6970
|
let from;
|
|
6948
6971
|
if (params.from) from = {
|
|
6949
6972
|
chainId: params.from.networkId,
|
|
@@ -7022,18 +7045,18 @@ const checkUserScopes = ({ scopes, user }) => {
|
|
|
7022
7045
|
* @see refreshUser
|
|
7023
7046
|
* @instrumented
|
|
7024
7047
|
*/
|
|
7025
|
-
const deleteUser = async (client =
|
|
7026
|
-
const core =
|
|
7027
|
-
await
|
|
7028
|
-
await
|
|
7048
|
+
const deleteUser = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
7049
|
+
const core = require_logoutWithReason.getCore(client);
|
|
7050
|
+
await require_logoutWithReason.createApiClient({ includeMfaToken: true }, client).hardDeleteUser({ environmentId: core.environmentId });
|
|
7051
|
+
await require_logoutWithReason.__logoutWithReason_wrapped({ reason: "user-deleted" }, client);
|
|
7029
7052
|
};
|
|
7030
7053
|
const __deleteUser_impl = deleteUser;
|
|
7031
|
-
const __deleteUser_wrapped =
|
|
7054
|
+
const __deleteUser_wrapped = require_logoutWithReason.instrumentFunction({
|
|
7032
7055
|
fn: __deleteUser_impl,
|
|
7033
7056
|
functionName: "deleteUser",
|
|
7034
7057
|
getCore: () => {
|
|
7035
7058
|
try {
|
|
7036
|
-
return
|
|
7059
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
7037
7060
|
} catch {
|
|
7038
7061
|
return;
|
|
7039
7062
|
}
|
|
@@ -7091,8 +7114,8 @@ const findMissingGoogleDriveBackupScopes = (grantedScopes) => GOOGLE_DRIVE_BACKU
|
|
|
7091
7114
|
* @notInstrumented
|
|
7092
7115
|
*/
|
|
7093
7116
|
const fetchGoogleDriveOauthAccess = async ({ oauthAccountId }, client) => {
|
|
7094
|
-
const core =
|
|
7095
|
-
return
|
|
7117
|
+
const core = require_logoutWithReason.getCore(client);
|
|
7118
|
+
return require_logoutWithReason.createApiClient({}, client).getEndUserOauthAccessToken({
|
|
7096
7119
|
environmentId: core.environmentId,
|
|
7097
7120
|
oauthAccountId
|
|
7098
7121
|
});
|
|
@@ -7151,7 +7174,7 @@ const findGoogleOauthAccountId = (credentials) => credentials?.find((cred) => cr
|
|
|
7151
7174
|
* @returns The readiness result.
|
|
7152
7175
|
* @instrumented
|
|
7153
7176
|
*/
|
|
7154
|
-
const getGoogleDriveBackupReadiness = async (client =
|
|
7177
|
+
const getGoogleDriveBackupReadiness = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
7155
7178
|
const { user } = client;
|
|
7156
7179
|
const oauthAccountId = findGoogleOauthAccountId(user?.verifiedCredentials);
|
|
7157
7180
|
if (!oauthAccountId) return {
|
|
@@ -7177,12 +7200,12 @@ const getGoogleDriveBackupReadiness = async (client = require_updateAuthFromVeri
|
|
|
7177
7200
|
};
|
|
7178
7201
|
};
|
|
7179
7202
|
const __getGoogleDriveBackupReadiness_impl = getGoogleDriveBackupReadiness;
|
|
7180
|
-
const __getGoogleDriveBackupReadiness_wrapped =
|
|
7203
|
+
const __getGoogleDriveBackupReadiness_wrapped = require_logoutWithReason.instrumentFunction({
|
|
7181
7204
|
fn: __getGoogleDriveBackupReadiness_impl,
|
|
7182
7205
|
functionName: "getGoogleDriveBackupReadiness",
|
|
7183
7206
|
getCore: () => {
|
|
7184
7207
|
try {
|
|
7185
|
-
return
|
|
7208
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
7186
7209
|
} catch {
|
|
7187
7210
|
return;
|
|
7188
7211
|
}
|
|
@@ -7585,7 +7608,7 @@ const getChainsFromWalletSchema = ({ wallet, walletKey }) => {
|
|
|
7585
7608
|
for (const identifier of wallet.chains ?? []) {
|
|
7586
7609
|
const prefix = extractChainPrefix({ chainIdentifier: identifier });
|
|
7587
7610
|
try {
|
|
7588
|
-
const chain =
|
|
7611
|
+
const chain = require_logoutWithReason.getChainFromVerifiedCredentialChain(prefix);
|
|
7589
7612
|
chains.add(chain);
|
|
7590
7613
|
} catch {}
|
|
7591
7614
|
}
|
|
@@ -7760,9 +7783,9 @@ const hasWalletProviderConnectMethod = ({ walletProvider }) => Boolean(walletPro
|
|
|
7760
7783
|
*/
|
|
7761
7784
|
const classifyWithWalletProviderSource = ({ entry }) => {
|
|
7762
7785
|
const { priority } = entry;
|
|
7763
|
-
if (priority ===
|
|
7764
|
-
if (priority ===
|
|
7765
|
-
if (priority ===
|
|
7786
|
+
if (priority === require_logoutWithReason.WalletProviderPriority.WALLET_SDK) return "sdk";
|
|
7787
|
+
if (priority === require_logoutWithReason.WalletProviderPriority.WALLET_SELF_ANNOUNCEMENT_STANDARD) return "selfAnnounced";
|
|
7788
|
+
if (priority === require_logoutWithReason.WalletProviderPriority.WINDOW_INJECT) return "windowInjected";
|
|
7766
7789
|
};
|
|
7767
7790
|
|
|
7768
7791
|
//#endregion
|
|
@@ -7882,7 +7905,7 @@ const resolveWalletOptionKey = ({ fallback, wallet }) => wallet.group ?? wallet.
|
|
|
7882
7905
|
* @notInstrumented
|
|
7883
7906
|
*/
|
|
7884
7907
|
const findWalletOptionKeyForProviderKey = ({ chain, walletBook, walletProvider }) => {
|
|
7885
|
-
const { normalizedWalletNameWithChain } =
|
|
7908
|
+
const { normalizedWalletNameWithChain } = require_logoutWithReason.splitWalletProviderKey(walletProvider.key);
|
|
7886
7909
|
const candidates = [normalizedWalletNameWithChain, stripChainSuffix({
|
|
7887
7910
|
chain,
|
|
7888
7911
|
normalizedName: normalizedWalletNameWithChain
|
|
@@ -7935,7 +7958,7 @@ const buildWithWalletProviderOptions = ({ entries, walletBook }, client) => {
|
|
|
7935
7958
|
if (!hasWalletProviderConnectMethod({ walletProvider: entry.walletProvider })) continue;
|
|
7936
7959
|
const source = classifyWithWalletProviderSource({ entry });
|
|
7937
7960
|
if (!source) {
|
|
7938
|
-
|
|
7961
|
+
require_logoutWithReason.getCore(client).logger.error("buildWithWalletProviderOptions: registered wallet provider has an unrecognised priority — unable to identify how this wallet was registered", {
|
|
7939
7962
|
chain: entry.walletProvider.chain,
|
|
7940
7963
|
displayName: entry.walletProvider.metadata.displayName,
|
|
7941
7964
|
priority: entry.priority,
|
|
@@ -8237,14 +8260,14 @@ const EMPTY_WALLET_BOOK = {
|
|
|
8237
8260
|
* @returns A promise that resolves to the wallet options catalogue.
|
|
8238
8261
|
* @notInstrumented
|
|
8239
8262
|
*/
|
|
8240
|
-
const getWalletOptionsCatalogue = async (params = {}, client =
|
|
8263
|
+
const getWalletOptionsCatalogue = async (params = {}, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8241
8264
|
const includeMobileOptions = params.includeMobileOptions ?? false;
|
|
8242
8265
|
const walletOptionOrdering = params.walletOptionOrdering ?? "relevance";
|
|
8243
8266
|
const excludedConnectionOptionTypes = new Set(params.excludedConnectionOptionTypes ?? []);
|
|
8244
8267
|
const walletBook = includeMobileOptions ? await fetchLegacyWalletBook(client) : EMPTY_WALLET_BOOK;
|
|
8245
8268
|
const allConnectionOptions = [];
|
|
8246
8269
|
if (!excludedConnectionOptionTypes.has("withWalletProvider")) {
|
|
8247
|
-
const entries =
|
|
8270
|
+
const entries = require_logoutWithReason.getWalletProviderRegistry(client).listProviderEntries();
|
|
8248
8271
|
allConnectionOptions.push(...buildWithWalletProviderOptions({
|
|
8249
8272
|
entries,
|
|
8250
8273
|
walletBook
|
|
@@ -8294,8 +8317,8 @@ const getWalletOptionsCatalogue = async (params = {}, client = require_updateAut
|
|
|
8294
8317
|
* @throws WalletAccountNotSelectedError If the wallet account is not currently selected.
|
|
8295
8318
|
* @notInstrumented
|
|
8296
8319
|
*/
|
|
8297
|
-
const assertWalletAccountSigningAvailability = async ({ walletAccount }, client =
|
|
8298
|
-
const { addresses } = await
|
|
8320
|
+
const assertWalletAccountSigningAvailability = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8321
|
+
const { addresses } = await require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client).getConnectedAddresses();
|
|
8299
8322
|
if (addresses.length > 0 && !addresses.includes(walletAccount.address)) throw new WalletAccountNotSelectedError({
|
|
8300
8323
|
expectedAddress: walletAccount.address,
|
|
8301
8324
|
selectedAddress: addresses[0]
|
|
@@ -8318,8 +8341,8 @@ const assertWalletAccountSigningAvailability = async ({ walletAccount }, client
|
|
|
8318
8341
|
* @throws If the wallet provider does not support the confirmTransaction method.
|
|
8319
8342
|
* @instrumented
|
|
8320
8343
|
*/
|
|
8321
|
-
const confirmTransaction = async ({ walletAccount, transactionHash }, client =
|
|
8322
|
-
const walletProvider =
|
|
8344
|
+
const confirmTransaction = async ({ walletAccount, transactionHash }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8345
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
8323
8346
|
assertWalletProviderMethodDefined(walletProvider, "confirmTransaction");
|
|
8324
8347
|
await walletProvider.confirmTransaction({
|
|
8325
8348
|
transactionHash,
|
|
@@ -8327,12 +8350,12 @@ const confirmTransaction = async ({ walletAccount, transactionHash }, client = r
|
|
|
8327
8350
|
});
|
|
8328
8351
|
};
|
|
8329
8352
|
const __confirmTransaction_impl = confirmTransaction;
|
|
8330
|
-
const __confirmTransaction_wrapped =
|
|
8353
|
+
const __confirmTransaction_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8331
8354
|
fn: __confirmTransaction_impl,
|
|
8332
8355
|
functionName: "confirmTransaction",
|
|
8333
8356
|
getCore: () => {
|
|
8334
8357
|
try {
|
|
8335
|
-
return
|
|
8358
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8336
8359
|
} catch {
|
|
8337
8360
|
return;
|
|
8338
8361
|
}
|
|
@@ -8372,8 +8395,8 @@ const getAddressesWithTypesFromConnectionResult = (connectionResult) => {
|
|
|
8372
8395
|
* @see connectAndVerifyWithWalletProvider
|
|
8373
8396
|
* @instrumented
|
|
8374
8397
|
*/
|
|
8375
|
-
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client =
|
|
8376
|
-
const walletProvider =
|
|
8398
|
+
const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWalletAccounts = true, hardwareWalletVendor }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8399
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
8377
8400
|
assertWalletProviderMethodDefined(walletProvider, "connect");
|
|
8378
8401
|
const { addresses } = await walletProvider.connect();
|
|
8379
8402
|
const mainAddress = addresses?.length ? addresses[0].address : null;
|
|
@@ -8390,7 +8413,7 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
8390
8413
|
addressesWithTypes: getAddressesWithTypesFromConnectionResult({ addresses }),
|
|
8391
8414
|
chain: walletProvider.chain,
|
|
8392
8415
|
hardwareWalletVendor,
|
|
8393
|
-
id:
|
|
8416
|
+
id: require_logoutWithReason.formatWalletAccountId({
|
|
8394
8417
|
address: mainAddress,
|
|
8395
8418
|
chain: walletProvider.chain,
|
|
8396
8419
|
walletProviderKey
|
|
@@ -8404,12 +8427,12 @@ const connectWithWalletProvider = async ({ walletProviderKey, addToDynamicWallet
|
|
|
8404
8427
|
return reconciledWalletAccount;
|
|
8405
8428
|
};
|
|
8406
8429
|
const __connectWithWalletProvider_impl = connectWithWalletProvider;
|
|
8407
|
-
const __connectWithWalletProvider_wrapped =
|
|
8430
|
+
const __connectWithWalletProvider_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8408
8431
|
fn: __connectWithWalletProvider_impl,
|
|
8409
8432
|
functionName: "connectWithWalletProvider",
|
|
8410
8433
|
getCore: () => {
|
|
8411
8434
|
try {
|
|
8412
|
-
return
|
|
8435
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8413
8436
|
} catch {
|
|
8414
8437
|
return;
|
|
8415
8438
|
}
|
|
@@ -8468,13 +8491,13 @@ const getChainIdForAccountVerification = async ({ walletProvider }) => {
|
|
|
8468
8491
|
//#region src/modules/wallets/utils/getSignInMessage/getSignInMessage.ts
|
|
8469
8492
|
/** @notInstrumented */
|
|
8470
8493
|
const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client) => {
|
|
8471
|
-
const core =
|
|
8494
|
+
const core = require_logoutWithReason.getCore(client);
|
|
8472
8495
|
const { appUniversalLink } = require_getNetworkProviderFromNetworkId.getAppMetadata(client);
|
|
8473
|
-
|
|
8496
|
+
require_logoutWithReason.assertDefined(appUniversalLink, "Universal link is not set");
|
|
8474
8497
|
const url = new URL(appUniversalLink);
|
|
8475
8498
|
const domain = url.host;
|
|
8476
|
-
const nonce = nonceOverride ?? await
|
|
8477
|
-
const walletProvider =
|
|
8499
|
+
const nonce = nonceOverride ?? await require_logoutWithReason.getNonce(client);
|
|
8500
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
8478
8501
|
if (walletProvider.chain === "STARK")
|
|
8479
8502
|
/**
|
|
8480
8503
|
* Starknet requires the strings to be 31 chars long
|
|
@@ -8488,7 +8511,7 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
8488
8511
|
const statement = require_getNetworkProviderFromNetworkId.createSignInMessageStatement(client);
|
|
8489
8512
|
return await require_getNetworkProviderFromNetworkId.formatSignInMessage({
|
|
8490
8513
|
address: walletAccount.address,
|
|
8491
|
-
blockchainName:
|
|
8514
|
+
blockchainName: require_logoutWithReason.CHAINS_INFO_MAP[walletProvider.chain].blockchainName,
|
|
8492
8515
|
chainId: await getChainIdForAccountVerification({ walletProvider }),
|
|
8493
8516
|
domain,
|
|
8494
8517
|
issuedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -8522,8 +8545,8 @@ const getSignInMessage = async ({ nonce: nonceOverride, walletAccount }, client)
|
|
|
8522
8545
|
* @see verifyWalletAccount
|
|
8523
8546
|
* @instrumented
|
|
8524
8547
|
*/
|
|
8525
|
-
const proveWalletAccountOwnership = async ({ walletAccount }, client =
|
|
8526
|
-
const walletProvider =
|
|
8548
|
+
const proveWalletAccountOwnership = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8549
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
8527
8550
|
assertWalletProviderMethodDefined(walletProvider, "signMessage");
|
|
8528
8551
|
const messageToSign = await getSignInMessage({
|
|
8529
8552
|
nonce: walletProvider.getConnectProofNonce?.(),
|
|
@@ -8539,12 +8562,12 @@ const proveWalletAccountOwnership = async ({ walletAccount }, client = require_u
|
|
|
8539
8562
|
};
|
|
8540
8563
|
};
|
|
8541
8564
|
const __proveWalletAccountOwnership_impl = proveWalletAccountOwnership;
|
|
8542
|
-
const __proveWalletAccountOwnership_wrapped =
|
|
8565
|
+
const __proveWalletAccountOwnership_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8543
8566
|
fn: __proveWalletAccountOwnership_impl,
|
|
8544
8567
|
functionName: "proveWalletAccountOwnership",
|
|
8545
8568
|
getCore: () => {
|
|
8546
8569
|
try {
|
|
8547
|
-
return
|
|
8570
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8548
8571
|
} catch {
|
|
8549
8572
|
return;
|
|
8550
8573
|
}
|
|
@@ -8554,10 +8577,10 @@ const __proveWalletAccountOwnership_wrapped = require_updateAuthFromVerifyRespon
|
|
|
8554
8577
|
//#endregion
|
|
8555
8578
|
//#region src/modules/wallets/utils/isSameAddress/isSameAddress.ts
|
|
8556
8579
|
/** @notInstrumented */
|
|
8557
|
-
const isSameAddress = ({ chain, left, right }) =>
|
|
8580
|
+
const isSameAddress = ({ chain, left, right }) => require_logoutWithReason.normalizeAddress({
|
|
8558
8581
|
address: left,
|
|
8559
8582
|
chain
|
|
8560
|
-
}) ===
|
|
8583
|
+
}) === require_logoutWithReason.normalizeAddress({
|
|
8561
8584
|
address: right,
|
|
8562
8585
|
chain
|
|
8563
8586
|
});
|
|
@@ -8573,7 +8596,7 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
8573
8596
|
* when scopes are provided so the call reaches walletsVerify.
|
|
8574
8597
|
*/
|
|
8575
8598
|
if (walletAccount.verifiedCredentialId && !requestedScopes) throw new WalletAccountAlreadyVerifiedError(walletAccount.address);
|
|
8576
|
-
const walletProvider =
|
|
8599
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
8577
8600
|
const { messageToSign, signature } = await __proveWalletAccountOwnership_wrapped({ walletAccount }, client);
|
|
8578
8601
|
const formattedSignature = walletAccount.hardwareWalletVendor ? formatSignatureForHardwareWallet({
|
|
8579
8602
|
hardwareWalletVendor: walletAccount.hardwareWalletVendor,
|
|
@@ -8594,30 +8617,30 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
8594
8617
|
}, client);
|
|
8595
8618
|
const response = walletProvider.shouldRetryVerificationOnNetworkError ? await retryOnFetchError({
|
|
8596
8619
|
fn: verify,
|
|
8597
|
-
onRetry: ({ error }) =>
|
|
8620
|
+
onRetry: ({ error }) => require_logoutWithReason.getCore(client).logger.warn("Retrying wallet verification after network error", error)
|
|
8598
8621
|
}) : await verify();
|
|
8599
8622
|
const walletVerifiedCredential = response.user?.verifiedCredentials.find((verifiedCredential) => isSameAddress({
|
|
8600
8623
|
chain: walletAccount.chain,
|
|
8601
8624
|
left: verifiedCredential.address ?? "",
|
|
8602
8625
|
right: walletAccount.address
|
|
8603
8626
|
}));
|
|
8604
|
-
|
|
8627
|
+
require_logoutWithReason.assertDefined(walletVerifiedCredential, `After verifying, still unable to find verified wallet credential for wallet account ${walletAccount.address} on chain ${walletAccount.chain}`);
|
|
8605
8628
|
require_getNetworkProviderFromNetworkId.updateWalletProviderKeysForVerifiedCredentials({ keysToUpdate: { [walletVerifiedCredential.id]: walletProvider.key } }, client);
|
|
8606
8629
|
/**
|
|
8607
8630
|
* Adds the user with the new wallet verified credential
|
|
8608
8631
|
* This will add the new verified wallet account to the client`s state
|
|
8609
8632
|
*/
|
|
8610
|
-
|
|
8633
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response }, client);
|
|
8611
8634
|
/**
|
|
8612
8635
|
* Remove the now verified wallet account from the unverified wallet accounts
|
|
8613
8636
|
*/
|
|
8614
8637
|
require_getNetworkProviderFromNetworkId.removeUnverifiedWalletAccount({ unverifiedWalletAccount: walletAccount }, client);
|
|
8615
|
-
const verifiedWalletAccount =
|
|
8638
|
+
const verifiedWalletAccount = require_logoutWithReason.getWalletAccounts(client).find(({ address }) => isSameAddress({
|
|
8616
8639
|
chain: walletAccount.chain,
|
|
8617
8640
|
left: address,
|
|
8618
8641
|
right: walletAccount.address
|
|
8619
8642
|
}));
|
|
8620
|
-
|
|
8643
|
+
require_logoutWithReason.assertDefined(verifiedWalletAccount, `Unable to find wallet account ${walletAccount.address} on chain ${walletAccount.chain} for verified credential ${walletVerifiedCredential.id}`);
|
|
8621
8644
|
return verifiedWalletAccount;
|
|
8622
8645
|
};
|
|
8623
8646
|
|
|
@@ -8647,7 +8670,7 @@ const verifyWalletAccountForSignInOrTransfer = async ({ walletAccount, isTransfe
|
|
|
8647
8670
|
* @see connectAndVerifyWithWalletProvider
|
|
8648
8671
|
* @instrumented
|
|
8649
8672
|
*/
|
|
8650
|
-
const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
8673
|
+
const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8651
8674
|
return verifyWalletAccountForSignInOrTransfer({
|
|
8652
8675
|
isTransfer: false,
|
|
8653
8676
|
requestedScopes,
|
|
@@ -8655,12 +8678,12 @@ const verifyWalletAccount = async ({ walletAccount, requestedScopes }, client =
|
|
|
8655
8678
|
}, client);
|
|
8656
8679
|
};
|
|
8657
8680
|
const __verifyWalletAccount_impl = verifyWalletAccount;
|
|
8658
|
-
const __verifyWalletAccount_wrapped =
|
|
8681
|
+
const __verifyWalletAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8659
8682
|
fn: __verifyWalletAccount_impl,
|
|
8660
8683
|
functionName: "verifyWalletAccount",
|
|
8661
8684
|
getCore: () => {
|
|
8662
8685
|
try {
|
|
8663
|
-
return
|
|
8686
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8664
8687
|
} catch {
|
|
8665
8688
|
return;
|
|
8666
8689
|
}
|
|
@@ -8710,8 +8733,8 @@ const isDeeplinkWalletProvider = ({ walletProvider }) => walletProvider.walletPr
|
|
|
8710
8733
|
* @see verifyWalletAccount
|
|
8711
8734
|
* @instrumented
|
|
8712
8735
|
*/
|
|
8713
|
-
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client =
|
|
8714
|
-
const walletProvider =
|
|
8736
|
+
const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareWalletVendor }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8737
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
8715
8738
|
if (isMobile() && isDeeplinkWalletProvider({ walletProvider })) throw new DeeplinkConnectAndVerifyUnsupportedError({ walletProviderKey });
|
|
8716
8739
|
const walletAccount = await __connectWithWalletProvider_wrapped({
|
|
8717
8740
|
addToDynamicWalletAccounts: false,
|
|
@@ -8726,12 +8749,12 @@ const connectAndVerifyWithWalletProvider = async ({ walletProviderKey, hardwareW
|
|
|
8726
8749
|
return walletAccount;
|
|
8727
8750
|
};
|
|
8728
8751
|
const __connectAndVerifyWithWalletProvider_impl = connectAndVerifyWithWalletProvider;
|
|
8729
|
-
const __connectAndVerifyWithWalletProvider_wrapped =
|
|
8752
|
+
const __connectAndVerifyWithWalletProvider_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8730
8753
|
fn: __connectAndVerifyWithWalletProvider_impl,
|
|
8731
8754
|
functionName: "connectAndVerifyWithWalletProvider",
|
|
8732
8755
|
getCore: () => {
|
|
8733
8756
|
try {
|
|
8734
|
-
return
|
|
8757
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8735
8758
|
} catch {
|
|
8736
8759
|
return;
|
|
8737
8760
|
}
|
|
@@ -8751,8 +8774,8 @@ const __connectAndVerifyWithWalletProvider_wrapped = require_updateAuthFromVerif
|
|
|
8751
8774
|
* @notInstrumented
|
|
8752
8775
|
* @hook Exposed as a hook so consumers get the reactive list of available wallet providers, updated when wallet providers change.
|
|
8753
8776
|
*/
|
|
8754
|
-
const getAvailableWalletProvidersData = (client =
|
|
8755
|
-
return
|
|
8777
|
+
const getAvailableWalletProvidersData = (client = require_logoutWithReason.getDefaultClient()) => {
|
|
8778
|
+
return require_logoutWithReason.getWalletProviders(client).filter((walletProvider) => hasWalletProviderConnectMethod({ walletProvider })).map((walletProvider) => ({
|
|
8756
8779
|
chain: walletProvider.chain,
|
|
8757
8780
|
groupKey: walletProvider.groupKey,
|
|
8758
8781
|
key: walletProvider.key,
|
|
@@ -8782,17 +8805,17 @@ const getAvailableWalletProvidersData = (client = require_updateAuthFromVerifyRe
|
|
|
8782
8805
|
* @see getWalletAccounts
|
|
8783
8806
|
* @notInstrumented
|
|
8784
8807
|
*/
|
|
8785
|
-
const getConnectedAddresses = ({ walletProviderKey }, client =
|
|
8786
|
-
return
|
|
8808
|
+
const getConnectedAddresses = ({ walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8809
|
+
return require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client).getConnectedAddresses();
|
|
8787
8810
|
};
|
|
8788
8811
|
|
|
8789
8812
|
//#endregion
|
|
8790
8813
|
//#region src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.ts
|
|
8791
8814
|
/** @notInstrumented */
|
|
8792
|
-
const getOwnerWalletAccountForSmartWalletAccount = ({ smartWalletAccount }, client =
|
|
8793
|
-
const smartWalletVerifiedCredential =
|
|
8794
|
-
|
|
8795
|
-
return
|
|
8815
|
+
const getOwnerWalletAccountForSmartWalletAccount = ({ smartWalletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8816
|
+
const smartWalletVerifiedCredential = require_getVerifiedCredentialForWalletAccount.getVerifiedCredentialForWalletAccount({ walletAccount: smartWalletAccount }, client);
|
|
8817
|
+
require_logoutWithReason.assertDefined(smartWalletVerifiedCredential?.signerRefId, "Invalid smart wallet account");
|
|
8818
|
+
return require_logoutWithReason.getWalletAccounts(client).find((walletAccount) => walletAccount.verifiedCredentialId === smartWalletVerifiedCredential.signerRefId);
|
|
8796
8819
|
};
|
|
8797
8820
|
|
|
8798
8821
|
//#endregion
|
|
@@ -8813,8 +8836,8 @@ const getWalletAccountAddressByType = ({ type, walletAccount }) => {
|
|
|
8813
8836
|
* @notInstrumented
|
|
8814
8837
|
* @hook Exposed as a hook so consumers get reactive wallet provider data, updated when the wallet provider registry changes.
|
|
8815
8838
|
*/
|
|
8816
|
-
const getWalletProviderDataByKey = ({ walletProviderKey }, client =
|
|
8817
|
-
const { chain, groupKey, key, metadata, walletProviderType } =
|
|
8839
|
+
const getWalletProviderDataByKey = ({ walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8840
|
+
const { chain, groupKey, key, metadata, walletProviderType } = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
8818
8841
|
return {
|
|
8819
8842
|
chain,
|
|
8820
8843
|
groupKey,
|
|
@@ -8835,8 +8858,8 @@ const getWalletProviderDataByKey = ({ walletProviderKey }, client = require_upda
|
|
|
8835
8858
|
* @returns Whether the wallet provider supports the specified hardware wallet vendor.
|
|
8836
8859
|
* @notInstrumented
|
|
8837
8860
|
*/
|
|
8838
|
-
const canConnectWithHardwareWallet = ({ walletProviderKey, hardwareWalletVendor }, client =
|
|
8839
|
-
return
|
|
8861
|
+
const canConnectWithHardwareWallet = ({ walletProviderKey, hardwareWalletVendor }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8862
|
+
return require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client).metadata.supportedHardwareWalletVendors?.includes(hardwareWalletVendor) ?? false;
|
|
8840
8863
|
};
|
|
8841
8864
|
|
|
8842
8865
|
//#endregion
|
|
@@ -8873,7 +8896,7 @@ const isHardwareWalletAccount = ({ walletAccount }) => walletAccount.hardwareWal
|
|
|
8873
8896
|
* @see isWalletAccountVerified
|
|
8874
8897
|
* @notInstrumented
|
|
8875
8898
|
*/
|
|
8876
|
-
const isAnyWalletAccountConnected = (client =
|
|
8899
|
+
const isAnyWalletAccountConnected = (client = require_logoutWithReason.getDefaultClient()) => require_logoutWithReason.getWalletAccounts(client).length > 0;
|
|
8877
8900
|
|
|
8878
8901
|
//#endregion
|
|
8879
8902
|
//#region src/modules/wallets/isExternalWalletScreeningEnabled/isExternalWalletScreeningEnabled.ts
|
|
@@ -8903,8 +8926,8 @@ const isAnyWalletAccountConnected = (client = require_updateAuthFromVerifyRespon
|
|
|
8903
8926
|
* @see isSolanaGasSponsorshipEnabled
|
|
8904
8927
|
* @notInstrumented
|
|
8905
8928
|
*/
|
|
8906
|
-
const isExternalWalletScreeningEnabled = (client =
|
|
8907
|
-
|
|
8929
|
+
const isExternalWalletScreeningEnabled = (client = require_logoutWithReason.getDefaultClient()) => {
|
|
8930
|
+
require_logoutWithReason.assertDefined(client.projectSettings, "Project settings are not defined");
|
|
8908
8931
|
return client.projectSettings.sdk.featureFlags?.enableExternalWalletOnTransactionSanctions ?? false;
|
|
8909
8932
|
};
|
|
8910
8933
|
|
|
@@ -8944,8 +8967,8 @@ const isWalletAccountVerified = ({ walletAccount }) => {
|
|
|
8944
8967
|
* @throws NetworkAddingUnavailableError If the wallet provider doesn't support adding networks.
|
|
8945
8968
|
* @instrumented
|
|
8946
8969
|
*/
|
|
8947
|
-
const addNetwork = async ({ networkData, walletAccount }, client =
|
|
8948
|
-
const walletProvider =
|
|
8970
|
+
const addNetwork = async ({ networkData, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
8971
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey: walletAccount.walletProviderKey }, client);
|
|
8949
8972
|
if (walletProvider.addNetwork === void 0) throw new NetworkAddingUnavailableError({
|
|
8950
8973
|
extraMessages: [`Wallet provider ${walletAccount.walletProviderKey} does not have addNetwork method`],
|
|
8951
8974
|
originalError: null,
|
|
@@ -8954,12 +8977,12 @@ const addNetwork = async ({ networkData, walletAccount }, client = require_updat
|
|
|
8954
8977
|
return walletProvider.addNetwork({ networkData });
|
|
8955
8978
|
};
|
|
8956
8979
|
const __addNetwork_impl = addNetwork;
|
|
8957
|
-
const __addNetwork_wrapped =
|
|
8980
|
+
const __addNetwork_wrapped = require_logoutWithReason.instrumentFunction({
|
|
8958
8981
|
fn: __addNetwork_impl,
|
|
8959
8982
|
functionName: "addNetwork",
|
|
8960
8983
|
getCore: () => {
|
|
8961
8984
|
try {
|
|
8962
|
-
return
|
|
8985
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
8963
8986
|
} catch {
|
|
8964
8987
|
return;
|
|
8965
8988
|
}
|
|
@@ -8980,8 +9003,8 @@ const __addNetwork_wrapped = require_updateAuthFromVerifyResponse.instrumentFunc
|
|
|
8980
9003
|
* @returns A promise that resolves to the network data, or undefined if not found.
|
|
8981
9004
|
* @notInstrumented
|
|
8982
9005
|
*/
|
|
8983
|
-
const getActiveNetworkData = async ({ walletAccount }, client =
|
|
8984
|
-
const walletProvider =
|
|
9006
|
+
const getActiveNetworkData = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9007
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
8985
9008
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
8986
9009
|
return { networkData: require_getNetworkProviderFromNetworkId.getNetworksData(client).find((data) => data.networkId === networkId && data.chain === walletProvider.chain) };
|
|
8987
9010
|
};
|
|
@@ -8996,8 +9019,8 @@ const getActiveNetworkData = async ({ walletAccount }, client = require_updateAu
|
|
|
8996
9019
|
* @returns A promise that resolves to the active network ID for the wallet account.
|
|
8997
9020
|
* @notInstrumented
|
|
8998
9021
|
*/
|
|
8999
|
-
const getActiveNetworkId = ({ walletAccount }, client =
|
|
9000
|
-
return
|
|
9022
|
+
const getActiveNetworkId = ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9023
|
+
return require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client).getActiveNetworkId();
|
|
9001
9024
|
};
|
|
9002
9025
|
|
|
9003
9026
|
//#endregion
|
|
@@ -9025,8 +9048,8 @@ const getActiveNetworkId = ({ walletAccount }, client = require_updateAuthFromVe
|
|
|
9025
9048
|
* @see switchActiveNetwork
|
|
9026
9049
|
* @notInstrumented
|
|
9027
9050
|
*/
|
|
9028
|
-
const getNativeBalance = async ({ walletAccount }, client =
|
|
9029
|
-
const walletProvider =
|
|
9051
|
+
const getNativeBalance = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9052
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
9030
9053
|
const { networkId } = await walletProvider.getActiveNetworkId();
|
|
9031
9054
|
return require_getNetworkProviderFromNetworkId.getNetworkProviderFromNetworkId({
|
|
9032
9055
|
chain: walletProvider.chain,
|
|
@@ -9053,7 +9076,7 @@ const getNativeBalance = async ({ walletAccount }, client = require_updateAuthFr
|
|
|
9053
9076
|
* @notInstrumented
|
|
9054
9077
|
* @noHook Deprecated; the replacement is exposed via its own hook.
|
|
9055
9078
|
*/
|
|
9056
|
-
const getBalance = (params, client =
|
|
9079
|
+
const getBalance = (params, client = require_logoutWithReason.getDefaultClient()) => getNativeBalance(params, client);
|
|
9057
9080
|
|
|
9058
9081
|
//#endregion
|
|
9059
9082
|
//#region src/modules/wallets/networks/getBalanceForAddress/getBalanceForAddress.ts
|
|
@@ -9070,12 +9093,12 @@ const getBalance = (params, client = require_updateAuthFromVerifyResponse.getDef
|
|
|
9070
9093
|
* @returns A promise that resolves to an object containing the balance as a string or null.
|
|
9071
9094
|
* @notInstrumented
|
|
9072
9095
|
*/
|
|
9073
|
-
const getBalanceForAddress = async ({ address, chain, networkId }, client =
|
|
9096
|
+
const getBalanceForAddress = async ({ address, chain, networkId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9074
9097
|
const networkProvider = require_getNetworkProviderFromNetworkId.getNetworkProviderFromNetworkId({
|
|
9075
9098
|
chain,
|
|
9076
9099
|
networkId
|
|
9077
9100
|
}, client);
|
|
9078
|
-
|
|
9101
|
+
require_logoutWithReason.assertDefined(networkProvider, `No network found for chain ${chain} and network id ${networkId}. Please ensure you've enabled this network in the Dashboard.`);
|
|
9079
9102
|
return networkProvider.getBalance({ address });
|
|
9080
9103
|
};
|
|
9081
9104
|
|
|
@@ -9097,9 +9120,9 @@ const getBalanceForAddress = async ({ address, chain, networkId }, client = requ
|
|
|
9097
9120
|
* @returns A promise that resolves to the transaction history along with nextOffset for the given wallet address and chain.
|
|
9098
9121
|
* @notInstrumented
|
|
9099
9122
|
*/
|
|
9100
|
-
const getTransactionHistory = async (params, client =
|
|
9101
|
-
const core =
|
|
9102
|
-
return await
|
|
9123
|
+
const getTransactionHistory = async (params, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9124
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9125
|
+
return await require_logoutWithReason.createApiClient({}, client).getWalletTransactions({
|
|
9103
9126
|
address: params.address,
|
|
9104
9127
|
chainName: params.chain,
|
|
9105
9128
|
environmentId: core.environmentId,
|
|
@@ -9123,8 +9146,8 @@ const getTransactionHistory = async (params, client = require_updateAuthFromVeri
|
|
|
9123
9146
|
* @returns True if programmatic network switching is available, false otherwise.
|
|
9124
9147
|
* @notInstrumented
|
|
9125
9148
|
*/
|
|
9126
|
-
const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client =
|
|
9127
|
-
return
|
|
9149
|
+
const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9150
|
+
return require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey: walletAccount.walletProviderKey }, client).switchActiveNetwork !== void 0;
|
|
9128
9151
|
};
|
|
9129
9152
|
|
|
9130
9153
|
//#endregion
|
|
@@ -9152,8 +9175,8 @@ const isProgrammaticNetworkSwitchAvailable = ({ walletAccount }, client = requir
|
|
|
9152
9175
|
* @see isProgrammaticNetworkSwitchAvailable
|
|
9153
9176
|
* @instrumented
|
|
9154
9177
|
*/
|
|
9155
|
-
const switchActiveNetwork = async ({ networkId, walletAccount }, client =
|
|
9156
|
-
const walletProvider =
|
|
9178
|
+
const switchActiveNetwork = async ({ networkId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9179
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey: walletAccount.walletProviderKey }, client);
|
|
9157
9180
|
if (walletProvider.switchActiveNetwork === void 0) throw new NetworkSwitchingUnavailableError({
|
|
9158
9181
|
extraMessages: [`Wallet provider ${walletAccount.walletProviderKey} does not have switchActiveNetwork method`],
|
|
9159
9182
|
originalError: null,
|
|
@@ -9162,12 +9185,12 @@ const switchActiveNetwork = async ({ networkId, walletAccount }, client = requir
|
|
|
9162
9185
|
return walletProvider.switchActiveNetwork({ networkId });
|
|
9163
9186
|
};
|
|
9164
9187
|
const __switchActiveNetwork_impl = switchActiveNetwork;
|
|
9165
|
-
const __switchActiveNetwork_wrapped =
|
|
9188
|
+
const __switchActiveNetwork_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9166
9189
|
fn: __switchActiveNetwork_impl,
|
|
9167
9190
|
functionName: "switchActiveNetwork",
|
|
9168
9191
|
getCore: () => {
|
|
9169
9192
|
try {
|
|
9170
|
-
return
|
|
9193
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9171
9194
|
} catch {
|
|
9172
9195
|
return;
|
|
9173
9196
|
}
|
|
@@ -9209,8 +9232,8 @@ const __switchActiveNetwork_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
9209
9232
|
* @see screenSolanaTransactions
|
|
9210
9233
|
* @notInstrumented
|
|
9211
9234
|
*/
|
|
9212
|
-
const screenTransaction = async ({ chain, context, networkId, senderAddress, signal }, client =
|
|
9213
|
-
environmentId:
|
|
9235
|
+
const screenTransaction = async ({ chain, context, networkId, senderAddress, signal }, client = require_logoutWithReason.getDefaultClient()) => require_logoutWithReason.createApiClient({}, client).screenTransaction({
|
|
9236
|
+
environmentId: require_logoutWithReason.getCore(client).environmentId,
|
|
9214
9237
|
screenTransactionRequest: {
|
|
9215
9238
|
chain,
|
|
9216
9239
|
chainId: networkId,
|
|
@@ -9248,10 +9271,10 @@ const screenTransaction = async ({ chain, context, networkId, senderAddress, sig
|
|
|
9248
9271
|
* @instrumented
|
|
9249
9272
|
* @noHook The selected-wallet concept is not exposed as a hook.
|
|
9250
9273
|
*/
|
|
9251
|
-
const setSelectedWalletAccount = async ({ walletAccount }, client =
|
|
9252
|
-
const core =
|
|
9274
|
+
const setSelectedWalletAccount = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9275
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9253
9276
|
if (getSelectedWalletAccount(client)?.id === walletAccount.id) return;
|
|
9254
|
-
if (walletAccount.verifiedCredentialId)
|
|
9277
|
+
if (walletAccount.verifiedCredentialId) require_logoutWithReason.updateAuthFromVerifyResponse({ response: await require_logoutWithReason.createApiClient({}, client).selectUserWallet({
|
|
9255
9278
|
environmentId: core.environmentId,
|
|
9256
9279
|
userWalletSelectionRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
9257
9280
|
}) }, client);
|
|
@@ -9261,12 +9284,12 @@ const setSelectedWalletAccount = async ({ walletAccount }, client = require_upda
|
|
|
9261
9284
|
}] }, client);
|
|
9262
9285
|
};
|
|
9263
9286
|
const __setSelectedWalletAccount_impl = setSelectedWalletAccount;
|
|
9264
|
-
const __setSelectedWalletAccount_wrapped =
|
|
9287
|
+
const __setSelectedWalletAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9265
9288
|
fn: __setSelectedWalletAccount_impl,
|
|
9266
9289
|
functionName: "setSelectedWalletAccount",
|
|
9267
9290
|
getCore: () => {
|
|
9268
9291
|
try {
|
|
9269
|
-
return
|
|
9292
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9270
9293
|
} catch {
|
|
9271
9294
|
return;
|
|
9272
9295
|
}
|
|
@@ -9296,7 +9319,7 @@ const __setSelectedWalletAccount_wrapped = require_updateAuthFromVerifyResponse.
|
|
|
9296
9319
|
* @returns The primary wallet account, or null if no wallet has been selected.
|
|
9297
9320
|
* @notInstrumented
|
|
9298
9321
|
*/
|
|
9299
|
-
const getPrimaryWalletAccount = (client =
|
|
9322
|
+
const getPrimaryWalletAccount = (client = require_logoutWithReason.getDefaultClient()) => getSelectedWalletAccount(client);
|
|
9300
9323
|
|
|
9301
9324
|
//#endregion
|
|
9302
9325
|
//#region src/modules/wallets/selectedWalletAccount/selectPrimaryWalletAccount/selectPrimaryWalletAccount.ts
|
|
@@ -9321,14 +9344,14 @@ const getPrimaryWalletAccount = (client = require_updateAuthFromVerifyResponse.g
|
|
|
9321
9344
|
* @instrumented
|
|
9322
9345
|
* @noHook The selected-wallet concept is not exposed as a hook.
|
|
9323
9346
|
*/
|
|
9324
|
-
const selectPrimaryWalletAccount = async ({ walletAccount }, client =
|
|
9347
|
+
const selectPrimaryWalletAccount = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => __setSelectedWalletAccount_wrapped({ walletAccount }, client);
|
|
9325
9348
|
const __selectPrimaryWalletAccount_impl = selectPrimaryWalletAccount;
|
|
9326
|
-
const __selectPrimaryWalletAccount_wrapped =
|
|
9349
|
+
const __selectPrimaryWalletAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9327
9350
|
fn: __selectPrimaryWalletAccount_impl,
|
|
9328
9351
|
functionName: "selectPrimaryWalletAccount",
|
|
9329
9352
|
getCore: () => {
|
|
9330
9353
|
try {
|
|
9331
|
-
return
|
|
9354
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9332
9355
|
} catch {
|
|
9333
9356
|
return;
|
|
9334
9357
|
}
|
|
@@ -9359,9 +9382,9 @@ const __selectPrimaryWalletAccount_wrapped = require_updateAuthFromVerifyRespons
|
|
|
9359
9382
|
*/
|
|
9360
9383
|
const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
9361
9384
|
try {
|
|
9362
|
-
await
|
|
9385
|
+
await require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client).disconnectWalletAccount?.({ walletAccount });
|
|
9363
9386
|
} catch (error) {
|
|
9364
|
-
if (error instanceof
|
|
9387
|
+
if (error instanceof require_logoutWithReason.NoWalletProviderFoundError) return;
|
|
9365
9388
|
throw error;
|
|
9366
9389
|
}
|
|
9367
9390
|
};
|
|
@@ -9388,26 +9411,26 @@ const disconnectWalletAccount = async ({ walletAccount }, client) => {
|
|
|
9388
9411
|
* @see disconnectWalletAccount
|
|
9389
9412
|
* @instrumented
|
|
9390
9413
|
*/
|
|
9391
|
-
const removeWalletAccount = async ({ walletAccount }, client =
|
|
9392
|
-
const core =
|
|
9393
|
-
const apiClient =
|
|
9414
|
+
const removeWalletAccount = async ({ walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9415
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9416
|
+
const apiClient = require_logoutWithReason.createApiClient({}, client);
|
|
9394
9417
|
await disconnectWalletAccount({ walletAccount }, client);
|
|
9395
9418
|
if (!walletAccount.verifiedCredentialId) {
|
|
9396
9419
|
require_getNetworkProviderFromNetworkId.removeUnverifiedWalletAccount({ unverifiedWalletAccount: walletAccount }, client);
|
|
9397
9420
|
return;
|
|
9398
9421
|
}
|
|
9399
|
-
|
|
9422
|
+
require_logoutWithReason.updateAuthFromVerifyResponse({ response: await apiClient.verifyUnlink({
|
|
9400
9423
|
environmentId: core.environmentId,
|
|
9401
9424
|
verifyUnlinkRequest: { walletId: walletAccount.verifiedCredentialId }
|
|
9402
9425
|
}) }, client);
|
|
9403
9426
|
};
|
|
9404
9427
|
const __removeWalletAccount_impl = removeWalletAccount;
|
|
9405
|
-
const __removeWalletAccount_wrapped =
|
|
9428
|
+
const __removeWalletAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9406
9429
|
fn: __removeWalletAccount_impl,
|
|
9407
9430
|
functionName: "removeWalletAccount",
|
|
9408
9431
|
getCore: () => {
|
|
9409
9432
|
try {
|
|
9410
|
-
return
|
|
9433
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9411
9434
|
} catch {
|
|
9412
9435
|
return;
|
|
9413
9436
|
}
|
|
@@ -9439,8 +9462,8 @@ const __removeWalletAccount_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
9439
9462
|
* @see connectWithWalletProvider
|
|
9440
9463
|
* @instrumented
|
|
9441
9464
|
*/
|
|
9442
|
-
const signMessage = async ({ walletAccount, message }, client =
|
|
9443
|
-
const walletProvider =
|
|
9465
|
+
const signMessage = async ({ walletAccount, message }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9466
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
9444
9467
|
assertWalletProviderMethodDefined(walletProvider, "signMessage");
|
|
9445
9468
|
const { signature } = await walletProvider.signMessage({
|
|
9446
9469
|
message,
|
|
@@ -9449,12 +9472,12 @@ const signMessage = async ({ walletAccount, message }, client = require_updateAu
|
|
|
9449
9472
|
return { signature };
|
|
9450
9473
|
};
|
|
9451
9474
|
const __signMessage_impl = signMessage;
|
|
9452
|
-
const __signMessage_wrapped =
|
|
9475
|
+
const __signMessage_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9453
9476
|
fn: __signMessage_impl,
|
|
9454
9477
|
functionName: "signMessage",
|
|
9455
9478
|
getCore: () => {
|
|
9456
9479
|
try {
|
|
9457
|
-
return
|
|
9480
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9458
9481
|
} catch {
|
|
9459
9482
|
return;
|
|
9460
9483
|
}
|
|
@@ -9489,8 +9512,8 @@ const __signMessage_wrapped = require_updateAuthFromVerifyResponse.instrumentFun
|
|
|
9489
9512
|
* @see signMessage
|
|
9490
9513
|
* @instrumented
|
|
9491
9514
|
*/
|
|
9492
|
-
const transferAmount = async ({ walletAccount, amount, recipient, token }, client =
|
|
9493
|
-
const walletProvider =
|
|
9515
|
+
const transferAmount = async ({ walletAccount, amount, recipient, token }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9516
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
9494
9517
|
assertWalletProviderMethodDefined(walletProvider, "transferAmount");
|
|
9495
9518
|
const { transactionHash } = await walletProvider.transferAmount({
|
|
9496
9519
|
amount,
|
|
@@ -9501,12 +9524,12 @@ const transferAmount = async ({ walletAccount, amount, recipient, token }, clien
|
|
|
9501
9524
|
return { transactionHash };
|
|
9502
9525
|
};
|
|
9503
9526
|
const __transferAmount_impl = transferAmount;
|
|
9504
|
-
const __transferAmount_wrapped =
|
|
9527
|
+
const __transferAmount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9505
9528
|
fn: __transferAmount_impl,
|
|
9506
9529
|
functionName: "transferAmount",
|
|
9507
9530
|
getCore: () => {
|
|
9508
9531
|
try {
|
|
9509
|
-
return
|
|
9532
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9510
9533
|
} catch {
|
|
9511
9534
|
return;
|
|
9512
9535
|
}
|
|
@@ -9535,7 +9558,7 @@ const __transferAmount_wrapped = require_updateAuthFromVerifyResponse.instrument
|
|
|
9535
9558
|
* @see verifyWalletAccount
|
|
9536
9559
|
* @instrumented
|
|
9537
9560
|
*/
|
|
9538
|
-
const transferWalletAccount = async ({ walletProviderKey }, client =
|
|
9561
|
+
const transferWalletAccount = async ({ walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9539
9562
|
return verifyWalletAccountForSignInOrTransfer({
|
|
9540
9563
|
isTransfer: true,
|
|
9541
9564
|
walletAccount: await __connectWithWalletProvider_wrapped({
|
|
@@ -9545,12 +9568,12 @@ const transferWalletAccount = async ({ walletProviderKey }, client = require_upd
|
|
|
9545
9568
|
}, client);
|
|
9546
9569
|
};
|
|
9547
9570
|
const __transferWalletAccount_impl = transferWalletAccount;
|
|
9548
|
-
const __transferWalletAccount_wrapped =
|
|
9571
|
+
const __transferWalletAccount_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9549
9572
|
fn: __transferWalletAccount_impl,
|
|
9550
9573
|
functionName: "transferWalletAccount",
|
|
9551
9574
|
getCore: () => {
|
|
9552
9575
|
try {
|
|
9553
|
-
return
|
|
9576
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9554
9577
|
} catch {
|
|
9555
9578
|
return;
|
|
9556
9579
|
}
|
|
@@ -9581,8 +9604,8 @@ const __transferWalletAccount_wrapped = require_updateAuthFromVerifyResponse.ins
|
|
|
9581
9604
|
* @see isWalletAccountVerified
|
|
9582
9605
|
* @notInstrumented
|
|
9583
9606
|
*/
|
|
9584
|
-
const getWalletAccountFromAddress = ({ address, chain }, client =
|
|
9585
|
-
return
|
|
9607
|
+
const getWalletAccountFromAddress = ({ address, chain }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9608
|
+
return require_logoutWithReason.getWalletAccounts(client).find((walletAccount) => walletAccount.address === address && walletAccount.chain === chain);
|
|
9586
9609
|
};
|
|
9587
9610
|
|
|
9588
9611
|
//#endregion
|
|
@@ -9598,8 +9621,8 @@ const getWalletAccountFromAddress = ({ address, chain }, client = require_update
|
|
|
9598
9621
|
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
9599
9622
|
* @notInstrumented
|
|
9600
9623
|
*/
|
|
9601
|
-
const offWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
9602
|
-
const walletProvider =
|
|
9624
|
+
const offWalletProviderEvent = ({ callback, event, walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9625
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
9603
9626
|
assertWalletProviderMethodDefined(walletProvider, "events");
|
|
9604
9627
|
walletProvider.events.off(event, callback);
|
|
9605
9628
|
};
|
|
@@ -9617,8 +9640,8 @@ const offWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
|
9617
9640
|
* @notInstrumented
|
|
9618
9641
|
* @hook Event listeners are error-prone to wire up by hand with useEffect.
|
|
9619
9642
|
*/
|
|
9620
|
-
const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
9621
|
-
const walletProvider =
|
|
9643
|
+
const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9644
|
+
const walletProvider = require_getVerifiedCredentialForWalletAccount.getWalletProviderByKey({ walletProviderKey }, client);
|
|
9622
9645
|
assertWalletProviderMethodDefined(walletProvider, "events");
|
|
9623
9646
|
walletProvider.events.on(event, callback);
|
|
9624
9647
|
return () => {
|
|
@@ -9643,7 +9666,7 @@ const onWalletProviderEvent = ({ callback, event, walletProviderKey }, client =
|
|
|
9643
9666
|
* @notInstrumented
|
|
9644
9667
|
*/
|
|
9645
9668
|
const executeYieldTransaction = async ({ onStepChange, signingPayload, walletAccount }, client) => {
|
|
9646
|
-
const walletProvider =
|
|
9669
|
+
const walletProvider = require_logoutWithReason.getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
9647
9670
|
assertWalletProviderMethodDefined(walletProvider, "executeYieldTransaction");
|
|
9648
9671
|
await ensureCorrectActiveNetwork({
|
|
9649
9672
|
requiredNetworkId: signingPayload.chainId,
|
|
@@ -9681,9 +9704,9 @@ const executeYieldTransaction = async ({ onStepChange, signingPayload, walletAcc
|
|
|
9681
9704
|
* @see depositToYieldVault
|
|
9682
9705
|
* @instrumented
|
|
9683
9706
|
*/
|
|
9684
|
-
const claimYieldRewards = async ({ vaultId, walletAccount }, client =
|
|
9685
|
-
const core =
|
|
9686
|
-
const { signingPayload } = await
|
|
9707
|
+
const claimYieldRewards = async ({ vaultId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9708
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9709
|
+
const { signingPayload } = await require_logoutWithReason.createApiClient({}, client).yieldVaultClaim({
|
|
9687
9710
|
environmentId: core.environmentId,
|
|
9688
9711
|
vaultId,
|
|
9689
9712
|
yieldVaultClaimRequest: { ownerAddress: walletAccount.address }
|
|
@@ -9694,12 +9717,12 @@ const claimYieldRewards = async ({ vaultId, walletAccount }, client = require_up
|
|
|
9694
9717
|
}, client);
|
|
9695
9718
|
};
|
|
9696
9719
|
const __claimYieldRewards_impl = claimYieldRewards;
|
|
9697
|
-
const __claimYieldRewards_wrapped =
|
|
9720
|
+
const __claimYieldRewards_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9698
9721
|
fn: __claimYieldRewards_impl,
|
|
9699
9722
|
functionName: "claimYieldRewards",
|
|
9700
9723
|
getCore: () => {
|
|
9701
9724
|
try {
|
|
9702
|
-
return
|
|
9725
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9703
9726
|
} catch {
|
|
9704
9727
|
return;
|
|
9705
9728
|
}
|
|
@@ -9734,9 +9757,9 @@ const __claimYieldRewards_wrapped = require_updateAuthFromVerifyResponse.instrum
|
|
|
9734
9757
|
* @see getYieldPosition
|
|
9735
9758
|
* @instrumented
|
|
9736
9759
|
*/
|
|
9737
|
-
const depositToYieldVault = async ({ amount, onStepChange, receiverAddress, vaultId, walletAccount }, client =
|
|
9738
|
-
const core =
|
|
9739
|
-
const { signingPayload } = await
|
|
9760
|
+
const depositToYieldVault = async ({ amount, onStepChange, receiverAddress, vaultId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9761
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9762
|
+
const { signingPayload } = await require_logoutWithReason.createApiClient({}, client).yieldVaultDeposit({
|
|
9740
9763
|
environmentId: core.environmentId,
|
|
9741
9764
|
vaultId,
|
|
9742
9765
|
yieldVaultActionRequest: {
|
|
@@ -9752,12 +9775,12 @@ const depositToYieldVault = async ({ amount, onStepChange, receiverAddress, vaul
|
|
|
9752
9775
|
}, client);
|
|
9753
9776
|
};
|
|
9754
9777
|
const __depositToYieldVault_impl = depositToYieldVault;
|
|
9755
|
-
const __depositToYieldVault_wrapped =
|
|
9778
|
+
const __depositToYieldVault_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9756
9779
|
fn: __depositToYieldVault_impl,
|
|
9757
9780
|
functionName: "depositToYieldVault",
|
|
9758
9781
|
getCore: () => {
|
|
9759
9782
|
try {
|
|
9760
|
-
return
|
|
9783
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9761
9784
|
} catch {
|
|
9762
9785
|
return;
|
|
9763
9786
|
}
|
|
@@ -9785,9 +9808,9 @@ const __depositToYieldVault_wrapped = require_updateAuthFromVerifyResponse.instr
|
|
|
9785
9808
|
* @see getYieldPosition
|
|
9786
9809
|
* @notInstrumented
|
|
9787
9810
|
*/
|
|
9788
|
-
const getYieldDetails = async ({ vaultId }, client =
|
|
9789
|
-
const core =
|
|
9790
|
-
return
|
|
9811
|
+
const getYieldDetails = async ({ vaultId }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9812
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9813
|
+
return require_logoutWithReason.createApiClient({}, client).getYieldVaultDetails({
|
|
9791
9814
|
environmentId: core.environmentId,
|
|
9792
9815
|
vaultId
|
|
9793
9816
|
});
|
|
@@ -9812,9 +9835,9 @@ const getYieldDetails = async ({ vaultId }, client = require_updateAuthFromVerif
|
|
|
9812
9835
|
* @see getYieldDetails
|
|
9813
9836
|
* @notInstrumented
|
|
9814
9837
|
*/
|
|
9815
|
-
const getYieldPosition = async ({ vaultId, walletAccount }, client =
|
|
9816
|
-
const core =
|
|
9817
|
-
return
|
|
9838
|
+
const getYieldPosition = async ({ vaultId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9839
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9840
|
+
return require_logoutWithReason.createApiClient({}, client).getYieldVaultPosition({
|
|
9818
9841
|
environmentId: core.environmentId,
|
|
9819
9842
|
ownerAddress: walletAccount.address,
|
|
9820
9843
|
vaultId
|
|
@@ -9842,9 +9865,9 @@ const getYieldPosition = async ({ vaultId, walletAccount }, client = require_upd
|
|
|
9842
9865
|
* @see getYieldPosition
|
|
9843
9866
|
* @notInstrumented
|
|
9844
9867
|
*/
|
|
9845
|
-
const getYieldRewards = async ({ vaultId, walletAccount }, client =
|
|
9846
|
-
const core =
|
|
9847
|
-
const { rewards } = await
|
|
9868
|
+
const getYieldRewards = async ({ vaultId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9869
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9870
|
+
const { rewards } = await require_logoutWithReason.createApiClient({}, client).getYieldVaultRewards({
|
|
9848
9871
|
environmentId: core.environmentId,
|
|
9849
9872
|
ownerAddress: walletAccount.address,
|
|
9850
9873
|
vaultId
|
|
@@ -9874,9 +9897,9 @@ const getYieldRewards = async ({ vaultId, walletAccount }, client = require_upda
|
|
|
9874
9897
|
* @see getYieldPosition
|
|
9875
9898
|
* @notInstrumented
|
|
9876
9899
|
*/
|
|
9877
|
-
const listYieldVaults = async (client =
|
|
9878
|
-
const core =
|
|
9879
|
-
const { vaults } = await
|
|
9900
|
+
const listYieldVaults = async (client = require_logoutWithReason.getDefaultClient()) => {
|
|
9901
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9902
|
+
const { vaults } = await require_logoutWithReason.createApiClient({}, client).listYieldVaults({ environmentId: core.environmentId });
|
|
9880
9903
|
return vaults;
|
|
9881
9904
|
};
|
|
9882
9905
|
|
|
@@ -9907,9 +9930,9 @@ const listYieldVaults = async (client = require_updateAuthFromVerifyResponse.get
|
|
|
9907
9930
|
* @see getYieldPosition
|
|
9908
9931
|
* @instrumented
|
|
9909
9932
|
*/
|
|
9910
|
-
const withdrawFromYieldVault = async ({ amount, receiverAddress, vaultId, walletAccount }, client =
|
|
9911
|
-
const core =
|
|
9912
|
-
const { signingPayload } = await
|
|
9933
|
+
const withdrawFromYieldVault = async ({ amount, receiverAddress, vaultId, walletAccount }, client = require_logoutWithReason.getDefaultClient()) => {
|
|
9934
|
+
const core = require_logoutWithReason.getCore(client);
|
|
9935
|
+
const { signingPayload } = await require_logoutWithReason.createApiClient({}, client).yieldVaultWithdraw({
|
|
9913
9936
|
environmentId: core.environmentId,
|
|
9914
9937
|
vaultId,
|
|
9915
9938
|
yieldVaultActionRequest: {
|
|
@@ -9924,12 +9947,12 @@ const withdrawFromYieldVault = async ({ amount, receiverAddress, vaultId, wallet
|
|
|
9924
9947
|
}, client);
|
|
9925
9948
|
};
|
|
9926
9949
|
const __withdrawFromYieldVault_impl = withdrawFromYieldVault;
|
|
9927
|
-
const __withdrawFromYieldVault_wrapped =
|
|
9950
|
+
const __withdrawFromYieldVault_wrapped = require_logoutWithReason.instrumentFunction({
|
|
9928
9951
|
fn: __withdrawFromYieldVault_impl,
|
|
9929
9952
|
functionName: "withdrawFromYieldVault",
|
|
9930
9953
|
getCore: () => {
|
|
9931
9954
|
try {
|
|
9932
|
-
return
|
|
9955
|
+
return require_logoutWithReason.getCore(require_logoutWithReason.getDefaultClient());
|
|
9933
9956
|
} catch {
|
|
9934
9957
|
return;
|
|
9935
9958
|
}
|
|
@@ -10044,10 +10067,10 @@ const parseUserAgent = ({ userAgent }) => {
|
|
|
10044
10067
|
|
|
10045
10068
|
//#endregion
|
|
10046
10069
|
//#region src/exports/index.ts
|
|
10047
|
-
(0, _dynamic_labs_sdk_assert_package_version.assertPackageVersion)(
|
|
10070
|
+
(0, _dynamic_labs_sdk_assert_package_version.assertPackageVersion)(require_logoutWithReason.name, require_logoutWithReason.version);
|
|
10048
10071
|
|
|
10049
10072
|
//#endregion
|
|
10050
|
-
exports.BaseError =
|
|
10073
|
+
exports.BaseError = require_logoutWithReason.BaseError;
|
|
10051
10074
|
exports.COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS = COINBASE_TRAVEL_RULE_FIELD_DESCRIPTIONS;
|
|
10052
10075
|
exports.CaptchaProviderEnum = CaptchaProviderEnum;
|
|
10053
10076
|
exports.CheckoutSessionTokenMissingError = CheckoutSessionTokenMissingError;
|
|
@@ -10064,26 +10087,16 @@ exports.FeeEstimationFailedError = FeeEstimationFailedError;
|
|
|
10064
10087
|
exports.FlowSessionTokenMissingError = FlowSessionTokenMissingError;
|
|
10065
10088
|
exports.GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES = GOOGLE_DRIVE_BACKUP_REQUIRED_SCOPES;
|
|
10066
10089
|
exports.InvalidDeviceRegistrationRedirectError = InvalidDeviceRegistrationRedirectError;
|
|
10067
|
-
exports.InvalidExternalAuthError =
|
|
10068
|
-
exports.InvalidParamError =
|
|
10090
|
+
exports.InvalidExternalAuthError = require_logoutWithReason.InvalidExternalAuthError;
|
|
10091
|
+
exports.InvalidParamError = require_logoutWithReason.InvalidParamError;
|
|
10069
10092
|
exports.InvalidRedirectStorageStateError = InvalidRedirectStorageStateError;
|
|
10070
10093
|
exports.InvalidSocialCallbackOriginError = InvalidSocialCallbackOriginError;
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
return _dynamic_labs_sdk_api_core.JwtVerifiedCredentialFormatEnum;
|
|
10075
|
-
}
|
|
10076
|
-
});
|
|
10077
|
-
exports.LinkCredentialError = require_updateAuthFromVerifyResponse.LinkCredentialError;
|
|
10078
|
-
Object.defineProperty(exports, 'MFAAction', {
|
|
10079
|
-
enumerable: true,
|
|
10080
|
-
get: function () {
|
|
10081
|
-
return _dynamic_labs_sdk_api_core.MFAAction;
|
|
10082
|
-
}
|
|
10083
|
-
});
|
|
10094
|
+
exports.JwtVerifiedCredentialFormatEnum = JwtVerifiedCredentialFormatEnum;
|
|
10095
|
+
exports.LinkCredentialError = require_logoutWithReason.LinkCredentialError;
|
|
10096
|
+
exports.MFAAction = MFAAction;
|
|
10084
10097
|
exports.MergeAccountsConfirmationError = require_getNetworkProviderFromNetworkId.MergeAccountsConfirmationError;
|
|
10085
|
-
exports.MfaInvalidOtpError =
|
|
10086
|
-
exports.MfaRateLimitedError =
|
|
10098
|
+
exports.MfaInvalidOtpError = require_logoutWithReason.MfaInvalidOtpError;
|
|
10099
|
+
exports.MfaRateLimitedError = require_logoutWithReason.MfaRateLimitedError;
|
|
10087
10100
|
exports.MissingRedirectStorageStateError = MissingRedirectStorageStateError;
|
|
10088
10101
|
exports.MissingSocialUrlParamError = MissingSocialUrlParamError;
|
|
10089
10102
|
exports.MissingUserVerificationError = MissingUserVerificationError;
|
|
@@ -10095,32 +10108,24 @@ exports.NoNetworkProvidersError = require_getNetworkProviderFromNetworkId.NoNetw
|
|
|
10095
10108
|
exports.NoPasskeyCredentialsFoundError = NoPasskeyCredentialsFoundError;
|
|
10096
10109
|
exports.NoSmartWalletAccountSignerFoundError = NoSmartWalletAccountSignerFoundError;
|
|
10097
10110
|
exports.NoWebAuthNSupportError = NoWebAuthNSupportError;
|
|
10098
|
-
exports.NotWaasWalletAccountError =
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
get: function () {
|
|
10102
|
-
return _dynamic_labs_sdk_api_core.ProviderEnum;
|
|
10103
|
-
}
|
|
10104
|
-
});
|
|
10105
|
-
exports.SandboxMaximumThresholdReachedError = require_updateAuthFromVerifyResponse.SandboxMaximumThresholdReachedError;
|
|
10111
|
+
exports.NotWaasWalletAccountError = require_migrateFromFireblocks.NotWaasWalletAccountError;
|
|
10112
|
+
exports.ProviderEnum = ProviderEnum;
|
|
10113
|
+
exports.SandboxMaximumThresholdReachedError = require_logoutWithReason.SandboxMaximumThresholdReachedError;
|
|
10106
10114
|
exports.ScreeningNotRequiredError = ScreeningNotRequiredError;
|
|
10107
10115
|
exports.SimulationFailedError = SimulationFailedError;
|
|
10108
|
-
|
|
10109
|
-
enumerable: true,
|
|
10110
|
-
get: function () {
|
|
10111
|
-
return _dynamic_labs_sdk_api_core.TokenScope;
|
|
10112
|
-
}
|
|
10113
|
-
});
|
|
10116
|
+
exports.TokenScope = require_logoutWithReason.TokenScope;
|
|
10114
10117
|
exports.TokenSwapError = TokenSwapError;
|
|
10115
|
-
exports.TransactionBroadcastError =
|
|
10116
|
-
exports.UnauthorizedError =
|
|
10118
|
+
exports.TransactionBroadcastError = require_migrateFromFireblocks.TransactionBroadcastError;
|
|
10119
|
+
exports.UnauthorizedError = require_logoutWithReason.UnauthorizedError;
|
|
10117
10120
|
exports.UnavailableInServerSideError = require_getNetworkProviderFromNetworkId.UnavailableInServerSideError;
|
|
10118
10121
|
exports.UnrecognizedNetworkError = UnrecognizedNetworkError;
|
|
10119
10122
|
exports.UserCancelledSocialPopUpError = UserCancelledSocialPopUpError;
|
|
10120
10123
|
exports.UserNotAuthenticatedError = UserNotAuthenticatedError;
|
|
10121
10124
|
exports.UserRejectedError = UserRejectedError;
|
|
10125
|
+
exports.WaasChainEnum = require_waas.WaasChainEnum;
|
|
10122
10126
|
exports.WaasLoadFailedError = require_isUserOnboardingComplete.WaasLoadFailedError;
|
|
10123
10127
|
exports.WaasOnboardingIncompleteError = require_isUserOnboardingComplete.WaasOnboardingIncompleteError;
|
|
10128
|
+
exports.WaasRbacStaleRetryUnsafeError = require_isUserOnboardingComplete.WaasRbacStaleRetryUnsafeError;
|
|
10124
10129
|
exports.WalletAccountAlreadyVerifiedError = WalletAccountAlreadyVerifiedError;
|
|
10125
10130
|
exports.WalletAccountNotSelectedError = WalletAccountNotSelectedError;
|
|
10126
10131
|
exports.WalletAlreadyLinkedToAnotherUserError = require_getNetworkProviderFromNetworkId.WalletAlreadyLinkedToAnotherUserError;
|
|
@@ -10171,7 +10176,7 @@ exports.detectOAuthRedirect = detectOAuthRedirect;
|
|
|
10171
10176
|
exports.detectSocialRedirectUrl = detectSocialRedirectUrl;
|
|
10172
10177
|
exports.excludeInstalledFromCatalog = excludeInstalledFromCatalog;
|
|
10173
10178
|
exports.executeSwapTransaction = __executeSwapTransaction_wrapped;
|
|
10174
|
-
exports.fetchProjectSettings =
|
|
10179
|
+
exports.fetchProjectSettings = require_logoutWithReason.fetchProjectSettings;
|
|
10175
10180
|
exports.findMissingGoogleDriveBackupScopes = findMissingGoogleDriveBackupScopes;
|
|
10176
10181
|
exports.getActiveNetworkData = getActiveNetworkData;
|
|
10177
10182
|
exports.getActiveNetworkId = getActiveNetworkId;
|
|
@@ -10185,9 +10190,9 @@ exports.getCheckoutTransactionQuote = getCheckoutTransactionQuote;
|
|
|
10185
10190
|
exports.getCoinbaseAccounts = getCoinbaseAccounts;
|
|
10186
10191
|
exports.getCoinbaseBuyUrl = getCoinbaseBuyUrl;
|
|
10187
10192
|
exports.getConnectedAddresses = getConnectedAddresses;
|
|
10188
|
-
exports.getDefaultClient =
|
|
10193
|
+
exports.getDefaultClient = require_logoutWithReason.getDefaultClient;
|
|
10189
10194
|
exports.getDeviceRegistrationTokenFromUrl = getDeviceRegistrationTokenFromUrl;
|
|
10190
|
-
exports.getElevatedAccessToken =
|
|
10195
|
+
exports.getElevatedAccessToken = require_logoutWithReason.getElevatedAccessToken;
|
|
10191
10196
|
exports.getFlow = getFlow;
|
|
10192
10197
|
exports.getFlowQuote = getFlowQuote;
|
|
10193
10198
|
exports.getGoogleDriveBackupReadiness = __getGoogleDriveBackupReadiness_wrapped;
|
|
@@ -10216,7 +10221,7 @@ exports.getTransactionHistory = getTransactionHistory;
|
|
|
10216
10221
|
exports.getUserSocialAccounts = getUserSocialAccounts;
|
|
10217
10222
|
exports.getWalletAccountAddressByType = getWalletAccountAddressByType;
|
|
10218
10223
|
exports.getWalletAccountFromAddress = getWalletAccountFromAddress;
|
|
10219
|
-
exports.getWalletAccounts =
|
|
10224
|
+
exports.getWalletAccounts = require_logoutWithReason.getWalletAccounts;
|
|
10220
10225
|
exports.getWalletConnectCatalog = getWalletConnectCatalog;
|
|
10221
10226
|
exports.getWalletConnectCatalogWalletByWalletProviderKey = getWalletConnectCatalogWalletByWalletProviderKey;
|
|
10222
10227
|
exports.getWalletOptionsCatalogue = getWalletOptionsCatalogue;
|
|
@@ -10238,24 +10243,24 @@ exports.isMfaRequiredForAction = require_isMfaRequiredForAction.isMfaRequiredFor
|
|
|
10238
10243
|
exports.isMobile = isMobile;
|
|
10239
10244
|
exports.isPendingRecoveryCodesAcknowledgment = require_isUserOnboardingComplete.isPendingRecoveryCodesAcknowledgment;
|
|
10240
10245
|
exports.isProgrammaticNetworkSwitchAvailable = isProgrammaticNetworkSwitchAvailable;
|
|
10241
|
-
exports.isSignedIn =
|
|
10242
|
-
exports.isUserMissingMfaAuth =
|
|
10246
|
+
exports.isSignedIn = require_logoutWithReason.isSignedIn;
|
|
10247
|
+
exports.isUserMissingMfaAuth = require_logoutWithReason.isUserMissingMfaAuth;
|
|
10243
10248
|
exports.isUserOnboardingComplete = require_isUserOnboardingComplete.isUserOnboardingComplete;
|
|
10244
10249
|
exports.isWalletAccountVerified = isWalletAccountVerified;
|
|
10245
10250
|
exports.listYieldVaults = listYieldVaults;
|
|
10246
10251
|
exports.logout = logout;
|
|
10247
10252
|
exports.matchWalletProvidersToCatalogGroup = matchWalletProvidersToCatalogGroup;
|
|
10248
10253
|
exports.mergeUserAccounts = mergeUserAccounts;
|
|
10249
|
-
exports.offEvent =
|
|
10254
|
+
exports.offEvent = require_logoutWithReason.offEvent;
|
|
10250
10255
|
exports.offWalletProviderEvent = offWalletProviderEvent;
|
|
10251
|
-
exports.onEvent =
|
|
10256
|
+
exports.onEvent = require_logoutWithReason.onEvent;
|
|
10252
10257
|
exports.onWalletProviderEvent = onWalletProviderEvent;
|
|
10253
|
-
exports.onceEvent =
|
|
10258
|
+
exports.onceEvent = require_logoutWithReason.onceEvent;
|
|
10254
10259
|
exports.parseUserAgent = parseUserAgent;
|
|
10255
10260
|
exports.prepareCheckoutTransaction = __prepareCheckoutTransaction_wrapped;
|
|
10256
10261
|
exports.prepareFlowSigning = __prepareFlowSigning_wrapped;
|
|
10257
10262
|
exports.proveWalletAccountOwnership = __proveWalletAccountOwnership_wrapped;
|
|
10258
|
-
exports.refreshAuth =
|
|
10263
|
+
exports.refreshAuth = require_logoutWithReason.__refreshAuth_wrapped;
|
|
10259
10264
|
exports.refreshUser = __refreshUser_wrapped;
|
|
10260
10265
|
exports.registerPasskey = __registerPasskey_wrapped;
|
|
10261
10266
|
exports.registerTotpMfaDevice = __registerTotpMfaDevice_wrapped;
|