@dynamic-labs-sdk/client 1.33.3 → 1.33.4
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/{apiClient-CpfEx6Uc.native.esm.js → apiClient-BGh68_e6.native.esm.js} +2 -2
- package/dist/{apiClient-CpfEx6Uc.native.esm.js.map → apiClient-BGh68_e6.native.esm.js.map} +1 -1
- package/dist/core.cjs +5 -5
- package/dist/core.esm.js +5 -5
- package/dist/core.native.esm.js +5 -5
- package/dist/{getNetworkProviderFromNetworkId-Cf-CfYM4.esm.js → getNetworkProviderFromNetworkId-BqiVs3Ni.esm.js} +2 -2
- package/dist/{getNetworkProviderFromNetworkId-Cf-CfYM4.esm.js.map → getNetworkProviderFromNetworkId-BqiVs3Ni.esm.js.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-Cez8TM-n.cjs → getNetworkProviderFromNetworkId-C_bqlRFD.cjs} +2 -2
- package/dist/{getNetworkProviderFromNetworkId-Cez8TM-n.cjs.map → getNetworkProviderFromNetworkId-C_bqlRFD.cjs.map} +1 -1
- package/dist/{getNetworkProviderFromNetworkId-CuTEQ9dg.native.esm.js → getNetworkProviderFromNetworkId-TczZgKDH.native.esm.js} +3 -3
- package/dist/{getNetworkProviderFromNetworkId-CuTEQ9dg.native.esm.js.map → getNetworkProviderFromNetworkId-TczZgKDH.native.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-Cx7WP4ZJ.esm.js → getSignedSessionId-DRJW9tb8.esm.js} +3 -3
- package/dist/{getSignedSessionId-Cx7WP4ZJ.esm.js.map → getSignedSessionId-DRJW9tb8.esm.js.map} +1 -1
- package/dist/{getSignedSessionId-DiVxv0qz.cjs → getSignedSessionId-Dc6_q9ph.cjs} +3 -3
- package/dist/{getSignedSessionId-DiVxv0qz.cjs.map → getSignedSessionId-Dc6_q9ph.cjs.map} +1 -1
- package/dist/{getSignedSessionId-Bt4obN3w.native.esm.js → getSignedSessionId-h-zAmDnk.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-Bt4obN3w.native.esm.js.map → getSignedSessionId-h-zAmDnk.native.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-DfKRbqco.esm.js → getVerifiedCredentialForWalletAccount-BWtWpYjd.esm.js} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-DfKRbqco.esm.js.map → getVerifiedCredentialForWalletAccount-BWtWpYjd.esm.js.map} +1 -1
- package/dist/{getVerifiedCredentialForWalletAccount-UIcOv7IN.cjs → getVerifiedCredentialForWalletAccount-CgI__iTv.cjs} +2 -2
- package/dist/{getVerifiedCredentialForWalletAccount-UIcOv7IN.cjs.map → getVerifiedCredentialForWalletAccount-CgI__iTv.cjs.map} +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +8 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +8 -8
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isMfaRequiredForAction-Czx-uPFY.cjs → isMfaRequiredForAction-Aov24tU3.cjs} +2 -2
- package/dist/{isMfaRequiredForAction-Czx-uPFY.cjs.map → isMfaRequiredForAction-Aov24tU3.cjs.map} +1 -1
- package/dist/{isMfaRequiredForAction-CxYft5KR.native.esm.js → isMfaRequiredForAction-FW_GM4tb.native.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-CxYft5KR.native.esm.js.map → isMfaRequiredForAction-FW_GM4tb.native.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-DS8fcwxO.esm.js → isMfaRequiredForAction-mcAjTfRu.esm.js} +2 -2
- package/dist/{isMfaRequiredForAction-DS8fcwxO.esm.js.map → isMfaRequiredForAction-mcAjTfRu.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-COmYFW26.esm.js → isUserOnboardingComplete-BTvFsIW7.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-COmYFW26.esm.js.map → isUserOnboardingComplete-BTvFsIW7.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-DYnRDLep.native.esm.js → isUserOnboardingComplete-BzEm_9UF.native.esm.js} +3 -3
- package/dist/{isUserOnboardingComplete-DYnRDLep.native.esm.js.map → isUserOnboardingComplete-BzEm_9UF.native.esm.js.map} +1 -1
- package/dist/{isUserOnboardingComplete-FbjleMQm.cjs → isUserOnboardingComplete-Deq_CabI.cjs} +3 -3
- package/dist/{isUserOnboardingComplete-FbjleMQm.cjs.map → isUserOnboardingComplete-Deq_CabI.cjs.map} +1 -1
- package/dist/{logoutWithReason-BKwWBsCT.cjs → logoutWithReason-BqgbyO5j.cjs} +29 -3
- package/dist/logoutWithReason-BqgbyO5j.cjs.map +1 -0
- package/dist/{logoutWithReason-DO0kP7nf.esm.js → logoutWithReason-Demgc354.esm.js} +24 -4
- package/dist/logoutWithReason-Demgc354.esm.js.map +1 -0
- package/dist/{logoutWithReason-DWkIKoLk.native.esm.js → logoutWithReason-rupibyb3.native.esm.js} +24 -4
- package/dist/logoutWithReason-rupibyb3.native.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-ycJIYcrm.cjs → migrateFromFireblocks-C1El-Dce.cjs} +2 -2
- package/dist/{migrateFromFireblocks-ycJIYcrm.cjs.map → migrateFromFireblocks-C1El-Dce.cjs.map} +1 -1
- package/dist/{migrateFromFireblocks-BwYnNAAh.native.esm.js → migrateFromFireblocks-Cc6JO6e2.native.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-BwYnNAAh.native.esm.js.map → migrateFromFireblocks-Cc6JO6e2.native.esm.js.map} +1 -1
- package/dist/{migrateFromFireblocks-C_cap--b.esm.js → migrateFromFireblocks-DSgWzuHJ.esm.js} +2 -2
- package/dist/{migrateFromFireblocks-C_cap--b.esm.js.map → migrateFromFireblocks-DSgWzuHJ.esm.js.map} +1 -1
- package/dist/services/resilientIndexedDbStore/createResilientIndexedDbStore/createResilientIndexedDbStore.d.ts +44 -0
- package/dist/services/resilientIndexedDbStore/createResilientIndexedDbStore/createResilientIndexedDbStore.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/createResilientIndexedDbStore/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/createResilientIndexedDbStore/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/errors/TransactionNotCompletedError.d.ts +5 -0
- package/dist/services/resilientIndexedDbStore/errors/TransactionNotCompletedError.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/resilientIndexedDbStore.types.d.ts +79 -0
- package/dist/services/resilientIndexedDbStore/resilientIndexedDbStore.types.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/applyMutation/applyMutation.d.ts +29 -0
- package/dist/services/resilientIndexedDbStore/utils/applyMutation/applyMutation.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/applyMutation/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/applyMutation/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/constants.d.ts +24 -0
- package/dist/services/resilientIndexedDbStore/utils/constants.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/createTombstoneStore/createTombstoneStore.d.ts +61 -0
- package/dist/services/resilientIndexedDbStore/utils/createTombstoneStore/createTombstoneStore.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/createTombstoneStore/index.d.ts +3 -0
- package/dist/services/resilientIndexedDbStore/utils/createTombstoneStore/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/createWorkQueue/createWorkQueue.d.ts +60 -0
- package/dist/services/resilientIndexedDbStore/utils/createWorkQueue/createWorkQueue.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/createWorkQueue/index.d.ts +3 -0
- package/dist/services/resilientIndexedDbStore/utils/createWorkQueue/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/deleteRecord/deleteRecord.d.ts +35 -0
- package/dist/services/resilientIndexedDbStore/utils/deleteRecord/deleteRecord.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/deleteRecord/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/deleteRecord/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getBackoffDelay/getBackoffDelay.d.ts +22 -0
- package/dist/services/resilientIndexedDbStore/utils/getBackoffDelay/getBackoffDelay.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getBackoffDelay/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/getBackoffDelay/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecord/getRecord.d.ts +32 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecord/getRecord.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecord/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecord/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecordKey/getRecordKey.d.ts +27 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecordKey/getRecordKey.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecordKey/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/getRecordKey/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getTransactionError/getTransactionError.d.ts +28 -0
- package/dist/services/resilientIndexedDbStore/utils/getTransactionError/getTransactionError.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/getTransactionError/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/getTransactionError/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/isPermanentWriteError/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/isPermanentWriteError/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/isPermanentWriteError/isPermanentWriteError.d.ts +20 -0
- package/dist/services/resilientIndexedDbStore/utils/isPermanentWriteError/isPermanentWriteError.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/openDatabase/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/openDatabase/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/openDatabase/openDatabase.d.ts +31 -0
- package/dist/services/resilientIndexedDbStore/utils/openDatabase/openDatabase.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/putRecord/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/putRecord/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/putRecord/putRecord.d.ts +37 -0
- package/dist/services/resilientIndexedDbStore/utils/putRecord/putRecord.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/readStoredValue/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/readStoredValue/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/readStoredValue/readStoredValue.d.ts +42 -0
- package/dist/services/resilientIndexedDbStore/utils/readStoredValue/readStoredValue.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/replayTombstones/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/replayTombstones/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/replayTombstones/replayTombstones.d.ts +31 -0
- package/dist/services/resilientIndexedDbStore/utils/replayTombstones/replayTombstones.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/runWithTimeout/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/runWithTimeout/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/runWithTimeout/runWithTimeout.d.ts +34 -0
- package/dist/services/resilientIndexedDbStore/utils/runWithTimeout/runWithTimeout.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/withDatabase/index.d.ts +2 -0
- package/dist/services/resilientIndexedDbStore/utils/withDatabase/index.d.ts.map +1 -0
- package/dist/services/resilientIndexedDbStore/utils/withDatabase/withDatabase.d.ts +39 -0
- package/dist/services/resilientIndexedDbStore/utils/withDatabase/withDatabase.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/retryOnFail/retryOnFail.d.ts.map +1 -1
- package/dist/utils/retryOnFetchError/retryOnFetchError.d.ts.map +1 -1
- package/dist/utils/waitForDelay/index.d.ts +2 -0
- package/dist/utils/waitForDelay/index.d.ts.map +1 -0
- package/dist/utils/waitForDelay/waitForDelay.d.ts +21 -0
- package/dist/utils/waitForDelay/waitForDelay.d.ts.map +1 -0
- package/dist/{waas-DjivkzyT.esm.js → waas-BAcC_ZEU.esm.js} +4 -4
- package/dist/{waas-DjivkzyT.esm.js.map → waas-BAcC_ZEU.esm.js.map} +1 -1
- package/dist/{waas-C4jtRxx1.native.esm.js → waas-BnBxnaH4.native.esm.js} +4 -4
- package/dist/{waas-C4jtRxx1.native.esm.js.map → waas-BnBxnaH4.native.esm.js.map} +1 -1
- package/dist/{waas-CioG-_yp.cjs → waas-EJACWt9Q.cjs} +4 -4
- package/dist/{waas-CioG-_yp.cjs.map → waas-EJACWt9Q.cjs.map} +1 -1
- package/dist/waas.cjs +4 -4
- package/dist/waas.esm.js +4 -4
- package/dist/waas.native.esm.js +4 -4
- package/dist/waasCore.cjs +5 -5
- package/dist/waasCore.esm.js +5 -5
- package/dist/waasCore.native.esm.js +5 -5
- package/package.json +2 -2
- package/dist/logoutWithReason-BKwWBsCT.cjs.map +0 -1
- package/dist/logoutWithReason-DO0kP7nf.esm.js.map +0 -1
- package/dist/logoutWithReason-DWkIKoLk.native.esm.js.map +0 -1
package/dist/{getSignedSessionId-Cx7WP4ZJ.esm.js.map → getSignedSessionId-DRJW9tb8.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignedSessionId-
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-DRJW9tb8.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsB,uBAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_logoutWithReason = require('./logoutWithReason-
|
|
2
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_logoutWithReason = require('./logoutWithReason-BqgbyO5j.cjs');
|
|
2
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Aov24tU3.cjs');
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
5
|
/** @notInstrumented */
|
|
@@ -87,4 +87,4 @@ Object.defineProperty(exports, 'getSignedSessionId', {
|
|
|
87
87
|
return getSignedSessionId;
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
90
|
+
//# sourceMappingURL=getSignedSessionId-Dc6_q9ph.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignedSessionId-
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-Dc6_q9ph.cjs","names":["isMfaRequiredForAction","consumeMfaToken","getElevatedAccessToken","getCore","getCore","getCore","getNonce"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAMA,sDAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOC,yDAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsBC,gDAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAOC,iCAAQ,OAAO;AAE5B,wCAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFLC,iCAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFOC,iCAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,wCAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,wCAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,kCAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,wCAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
package/dist/{getSignedSessionId-Bt4obN3w.native.esm.js → getSignedSessionId-h-zAmDnk.native.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Ct as getCore, Y as getNonce, _t as getElevatedAccessToken, ht as assertDefined } from "./apiClient-
|
|
2
|
-
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { Ct as getCore, Y as getNonce, _t as getElevatedAccessToken, ht as assertDefined } from "./apiClient-BGh68_e6.native.esm.js";
|
|
2
|
+
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-FW_GM4tb.native.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
5
|
/** @notInstrumented */
|
|
@@ -70,4 +70,4 @@ const getSignedSessionId = async (client) => {
|
|
|
70
70
|
|
|
71
71
|
//#endregion
|
|
72
72
|
export { getActionAuthorizationTokens as n, consumeMfaTokenIfRequiredForAction as r, getSignedSessionId as t };
|
|
73
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
73
|
+
//# sourceMappingURL=getSignedSessionId-h-zAmDnk.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignedSessionId-
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-h-zAmDnk.native.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts","../src/modules/auth/getActionAuthorizationTokens/getActionAuthorizationTokens.ts","../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["import type { MFAAction } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport { consumeMfaToken } from '../consumeMfaToken';\nimport { isMfaRequiredForAction } from '../isMfaRequiredForAction';\n\ntype ConsumeMfaTokenIfRequiredForActionParams = {\n mfaAction: MFAAction;\n};\n\n/** @notInstrumented */\nexport const consumeMfaTokenIfRequiredForAction = async (\n { mfaAction }: ConsumeMfaTokenIfRequiredForActionParams,\n client: DynamicClient\n): Promise<string | undefined> => {\n const isRequiredForAction = await isMfaRequiredForAction(\n { mfaAction },\n client\n );\n\n if (!isRequiredForAction) {\n return;\n }\n\n return consumeMfaToken(client);\n};\n","import type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { TokenScope } from '../consts';\nimport type { MFAAction } from '../../mfa/mfa.consts';\nimport { consumeMfaTokenIfRequiredForAction } from '../../mfa/consumeMfaTokenIfRequiredForAction';\nimport { getElevatedAccessToken } from '../getElevatedAccessToken';\n\ntype GetActionAuthorizationTokensParams = {\n mfaAction: MFAAction;\n scope: TokenScope;\n};\n\ntype ActionAuthorizationTokens = {\n elevatedAccessToken: string | undefined;\n mfaToken: string | undefined;\n};\n\n/**\n * Resolves the tokens that authorize a verification-gated wallet action.\n *\n * An elevated access token for `scope` is the current proof of verification, so\n * it takes precedence: when one has been banked, the legacy per-action MFA token\n * is left untouched. Demanding both would break every user who has a verified\n * MFA method, because satisfying the challenge with `requestedScopes` mints an\n * elevated access token and no MFA token -- leaving nothing for\n * `consumeMfaTokenIfRequiredForAction` to consume, which then throws.\n *\n * @param params.mfaAction - The action whose legacy MFA requirement to evaluate.\n * @param params.scope - The scope of the elevated access token that authorizes the action.\n * @param client - The Dynamic client instance.\n * @returns The elevated access token, or the legacy MFA token when no elevated token exists.\n * @notInstrumented\n */\nexport const getActionAuthorizationTokens = async (\n { mfaAction, scope }: GetActionAuthorizationTokensParams,\n client: DynamicClient\n): Promise<ActionAuthorizationTokens> => {\n const elevatedAccessToken = getElevatedAccessToken({ scope }, client);\n\n if (elevatedAccessToken) {\n return { elevatedAccessToken, mfaToken: undefined };\n }\n\n const mfaToken = await consumeMfaTokenIfRequiredForAction(\n { mfaAction },\n client\n );\n\n return { elevatedAccessToken: undefined, mfaToken };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\ntype GenerateNonceSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n): Promise<GenerateNonceSignatureResult> => {\n const core = getCore(client);\n\n assertDefined(core.keychain, 'Keychain service not available');\n\n const signature = await core.keychain.sign('session', nonce);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\n\ntype GenerateSessionSignatureParams = {\n sessionId: string;\n};\n\ntype GenerateSessionSignatureResult = { signature: string };\n\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n): Promise<GenerateSessionSignatureResult> => {\n const core = getCore(client);\n\n const signature = await core.keychain.sign('session', sessionId);\n\n return { signature };\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport { getNonce } from '../../../utils/getNonce';\nimport { generateNonceSignature } from '../generateNonceSignature';\nimport { generateSessionSignature } from '../generateSessionSignature';\n\ntype GetSignedSessionIdResult = { signature: string };\n\n/** @notInstrumented */\nexport const getSignedSessionId = async (\n client: DynamicClient\n): Promise<GetSignedSessionIdResult> => {\n const core = getCore(client);\n\n const sessionId = core.state.get().user?.sessionId;\n assertDefined(sessionId, 'Session ID is required');\n\n const { signature: signedSessionId } = await generateSessionSignature(\n {\n sessionId,\n },\n client\n );\n\n assertDefined(signedSessionId, 'Signed session ID is required');\n\n const nonce = await getNonce(client);\n\n const { signature: nonceSignature } = await generateNonceSignature(\n {\n nonce,\n },\n client\n );\n\n assertDefined(nonceSignature, 'Nonce signature is required');\n\n const signature = `${signedSessionId}/${nonceSignature}/${nonce}`;\n\n return { signature };\n};\n"],"mappings":";;;;;AAWA,MAAa,qCAAqC,OAChD,EAAE,aACF,WACgC;AAMhC,KAAI,CALwB,MAAM,uBAChC,EAAE,WAAW,EACb,OACD,CAGC;AAGF,QAAOA,0BAAgB,OAAO;;;;;;;;;;;;;;;;;;;;;ACQhC,MAAa,+BAA+B,OAC1C,EAAE,WAAW,SACb,WACuC;CACvC,MAAM,sBAAsB,uBAAuB,EAAE,OAAO,EAAE,OAAO;AAErE,KAAI,oBACF,QAAO;EAAE;EAAqB,UAAU;EAAW;AAQrD,QAAO;EAAE,qBAAqB;EAAW,UALxB,MAAM,mCACrB,EAAE,WAAW,EACb,OACD;EAEkD;;;;;;ACpCrD,MAAa,yBAAyB,OACpC,EAAE,SACF,WAC0C;CAC1C,MAAM,OAAO,QAAQ,OAAO;AAE5B,eAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WAC4C;AAK5C,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAChC,WACsC;CAGtC,MAAM,YAFO,QAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,eAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,eAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAM,SAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,eAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as getWalletProviders, l as NoWalletProviderFoundError } from "./logoutWithReason-Demgc354.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts
|
|
4
4
|
/** @notInstrumented */
|
|
@@ -17,4 +17,4 @@ const getVerifiedCredentialForWalletAccount = ({ walletAccount }, client) => {
|
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { getWalletProviderByKey as n, getVerifiedCredentialForWalletAccount as t };
|
|
20
|
-
//# sourceMappingURL=getVerifiedCredentialForWalletAccount-
|
|
20
|
+
//# sourceMappingURL=getVerifiedCredentialForWalletAccount-BWtWpYjd.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerifiedCredentialForWalletAccount-
|
|
1
|
+
{"version":3,"file":"getVerifiedCredentialForWalletAccount-BWtWpYjd.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBA,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_logoutWithReason = require('./logoutWithReason-
|
|
1
|
+
const require_logoutWithReason = require('./logoutWithReason-BqgbyO5j.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts
|
|
4
4
|
/** @notInstrumented */
|
|
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'getWalletProviderByKey', {
|
|
|
28
28
|
return getWalletProviderByKey;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
//# sourceMappingURL=getVerifiedCredentialForWalletAccount-
|
|
31
|
+
//# sourceMappingURL=getVerifiedCredentialForWalletAccount-CgI__iTv.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVerifiedCredentialForWalletAccount-
|
|
1
|
+
{"version":3,"file":"getVerifiedCredentialForWalletAccount-CgI__iTv.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts"],"sourcesContent":["import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\nimport type { WalletProvider } from '../walletProvider';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n): WalletProvider => {\n const walletProviders = getWalletProviders(client);\n\n const walletProvider = walletProviders.find(\n (walletProvider) => walletProvider.key === walletProviderKey\n );\n\n if (!walletProvider) {\n throw new NoWalletProviderFoundError({ walletProviderKey });\n }\n\n return walletProvider;\n};\n","import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';\n\nimport type { DynamicClient } from '../../../../client/types/DynamicClient';\nimport type { WalletAccount } from '../../walletAccount';\n\ntype GetVerifiedCredentialForWalletAccountParams = {\n walletAccount: WalletAccount;\n};\n\n/** @notInstrumented */\nexport const getVerifiedCredentialForWalletAccount = (\n { walletAccount }: GetVerifiedCredentialForWalletAccountParams,\n client: DynamicClient\n): JwtVerifiedCredential | undefined => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n"],"mappings":";;;;AAUA,MAAa,0BACX,EAAE,qBACF,WACmB;CAGnB,MAAM,iBAFkBA,4CAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,oDAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO;;;;;;ACdT,MAAa,yCACX,EAAE,iBACF,WACsC;AACtC,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_logoutWithReason = require('./logoutWithReason-
|
|
2
|
-
const require_migrateFromFireblocks = require('./migrateFromFireblocks-
|
|
3
|
-
const require_waas = require('./waas-
|
|
4
|
-
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-
|
|
5
|
-
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-
|
|
6
|
-
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-
|
|
7
|
-
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-
|
|
1
|
+
const require_logoutWithReason = require('./logoutWithReason-BqgbyO5j.cjs');
|
|
2
|
+
const require_migrateFromFireblocks = require('./migrateFromFireblocks-C1El-Dce.cjs');
|
|
3
|
+
const require_waas = require('./waas-EJACWt9Q.cjs');
|
|
4
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-C_bqlRFD.cjs');
|
|
5
|
+
const require_getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount-CgI__iTv.cjs');
|
|
6
|
+
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-Deq_CabI.cjs');
|
|
7
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-Aov24tU3.cjs');
|
|
8
8
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
9
9
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
10
10
|
let zod_mini = require("zod/mini");
|
|
@@ -8681,7 +8681,7 @@ const retryOnFetchError = async ({ delay = 1e3, fn, maxRetries = 2, onRetry }) =
|
|
|
8681
8681
|
} catch (error) {
|
|
8682
8682
|
if (retry >= maxRetries || !(error instanceof TypeError)) throw error;
|
|
8683
8683
|
onRetry?.({ error });
|
|
8684
|
-
if (delay > 0) await
|
|
8684
|
+
if (delay > 0) await require_logoutWithReason.waitForDelay({ delayMs: delay });
|
|
8685
8685
|
}
|
|
8686
8686
|
};
|
|
8687
8687
|
|