@dynamic-labs-sdk/client 1.19.1 → 1.21.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-D4au3jUv.native.esm.js → NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js} +158 -27
- package/dist/NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js.map +1 -0
- package/dist/client/core/createCore/getInitialState.d.ts.map +1 -1
- package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts +16 -0
- package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts.map +1 -0
- package/dist/client/createDynamicClient/assertClientProps/index.d.ts +2 -0
- package/dist/client/createDynamicClient/assertClientProps/index.d.ts.map +1 -0
- package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
- package/dist/client/types/DynamicClientConfig.d.ts +88 -6
- package/dist/client/types/DynamicClientConfig.d.ts.map +1 -1
- package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs +17 -0
- package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs.map +1 -0
- package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js +12 -0
- package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js.map +1 -0
- package/dist/core.cjs +13 -12
- package/dist/core.cjs.map +1 -1
- package/dist/core.esm.js +6 -5
- package/dist/core.esm.js.map +1 -1
- package/dist/core.native.esm.js +5 -5
- package/dist/errors/WaasLoadFailedError.d.ts +45 -0
- package/dist/errors/WaasLoadFailedError.d.ts.map +1 -0
- package/dist/exports/index.d.ts +1 -0
- package/dist/exports/index.d.ts.map +1 -1
- package/dist/exports/waas.d.ts +10 -0
- package/dist/exports/waas.d.ts.map +1 -1
- package/dist/{getNetworkProviderFromNetworkId-DmH039jx.cjs → getNetworkProviderFromNetworkId-5V4Cf8A_.cjs} +150 -70
- package/dist/getNetworkProviderFromNetworkId-5V4Cf8A_.cjs.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js → getNetworkProviderFromNetworkId-DhS1snCk.esm.js} +149 -68
- package/dist/getNetworkProviderFromNetworkId-DhS1snCk.esm.js.map +1 -0
- package/dist/{getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js → getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js} +151 -146
- package/dist/getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js.map +1 -0
- package/dist/{getSignedSessionId-Dz4U61DG.cjs → getSignedSessionId-E6FIx5aj.cjs} +2 -17
- package/dist/getSignedSessionId-E6FIx5aj.cjs.map +1 -0
- package/dist/{getSignedSessionId-CPautem1.native.esm.js → getSignedSessionId-ekp3lswQ.esm.js} +3 -12
- package/dist/getSignedSessionId-ekp3lswQ.esm.js.map +1 -0
- package/dist/{getSignedSessionId-CAQwZYYk.esm.js → getSignedSessionId-xZGFa4nS.native.esm.js} +3 -3
- package/dist/{getSignedSessionId-CPautem1.native.esm.js.map → getSignedSessionId-xZGFa4nS.native.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-CSVSMios.cjs → getWalletProviderByKey-BwivhTYu.cjs} +2 -2
- package/dist/{getWalletProviderByKey-CSVSMios.cjs.map → getWalletProviderByKey-BwivhTYu.cjs.map} +1 -1
- package/dist/{getWalletProviderByKey-DTBGx_qd.esm.js → getWalletProviderByKey-CS299i1V.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-DTBGx_qd.esm.js.map → getWalletProviderByKey-CS299i1V.esm.js.map} +1 -1
- package/dist/{getWalletProviderByKey-BKveb5Rh.native.esm.js → getWalletProviderByKey-CYGDw6-5.native.esm.js} +2 -2
- package/dist/{getWalletProviderByKey-BKveb5Rh.native.esm.js.map → getWalletProviderByKey-CYGDw6-5.native.esm.js.map} +1 -1
- package/dist/index.cjs +58 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +36 -18
- package/dist/index.esm.js.map +1 -1
- package/dist/index.native.esm.js +36 -18
- package/dist/index.native.esm.js.map +1 -1
- package/dist/{isDynamicWaasEnabled-Dmbdiybh.cjs → isDynamicWaasEnabled-BEVAshnS.cjs} +2 -3
- package/dist/{isDynamicWaasEnabled-Dmbdiybh.cjs.map → isDynamicWaasEnabled-BEVAshnS.cjs.map} +1 -1
- package/dist/{isDynamicWaasEnabled-gu-9QF8-.native.esm.js → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-gu-9QF8-.native.esm.js.map → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js.map} +1 -1
- package/dist/{isDynamicWaasEnabled-Bb9e8w3u.esm.js → isDynamicWaasEnabled-D5e2K02u.esm.js} +2 -2
- package/dist/{isDynamicWaasEnabled-Bb9e8w3u.esm.js.map → isDynamicWaasEnabled-D5e2K02u.esm.js.map} +1 -1
- package/dist/{isMfaRequiredForAction-BkrwKqo1.native.esm.js → isMfaRequiredForAction-A02NFVt8.esm.js} +3 -32
- package/dist/isMfaRequiredForAction-A02NFVt8.esm.js.map +1 -0
- package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js +77 -0
- package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js.map +1 -0
- package/dist/isMfaRequiredForAction-odpvykkm.cjs +94 -0
- package/dist/isMfaRequiredForAction-odpvykkm.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-CruwjMvs.cjs → isUserOnboardingComplete-CEVSIxJC.cjs} +49 -4
- package/dist/isUserOnboardingComplete-CEVSIxJC.cjs.map +1 -0
- package/dist/{isUserOnboardingComplete-DAesufca.esm.js → isUserOnboardingComplete-Cgkw21XZ.esm.js} +44 -4
- package/dist/isUserOnboardingComplete-Cgkw21XZ.esm.js.map +1 -0
- package/dist/{isUserOnboardingComplete-BLm0JQ_z.native.esm.js → isUserOnboardingComplete-CvQShE05.native.esm.js} +44 -4
- package/dist/{isUserOnboardingComplete-CruwjMvs.cjs.map → isUserOnboardingComplete-CvQShE05.native.esm.js.map} +1 -1
- package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js +321 -0
- package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js.map +1 -0
- package/dist/{migrateFromFireblocks-DrHwloUB.cjs → migrateFromFireblocks-CLUkVcFT.cjs} +54 -3
- package/dist/migrateFromFireblocks-CLUkVcFT.cjs.map +1 -0
- package/dist/{migrateFromFireblocks-Do4mQTl7.native.esm.js → migrateFromFireblocks-DcKrquTE.esm.js} +43 -4
- package/dist/migrateFromFireblocks-DcKrquTE.esm.js.map +1 -0
- package/dist/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.d.ts.map +1 -1
- package/dist/modules/storageSync/schema.d.ts +0 -2
- package/dist/modules/storageSync/schema.d.ts.map +1 -1
- package/dist/modules/storageSync/syncStateWithStorage/syncStateWithStorage.d.ts.map +1 -1
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +25 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +35 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +19 -0
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +184 -0
- package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts +16 -0
- package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts +36 -0
- package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts +15 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts +12 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts +10 -0
- package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +33 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts +2 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts.map +1 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +37 -0
- package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -0
- package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
- package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts +11 -0
- package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts.map +1 -0
- package/dist/modules/waas/waas.types.d.ts +11 -0
- package/dist/modules/waas/waas.types.d.ts.map +1 -1
- package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts +4 -0
- package/dist/modules/wallets/networks/getNetworksData/getNetworksData.d.ts.map +1 -1
- package/dist/modules/wallets/networks/networkDataSchema/index.d.ts +2 -0
- package/dist/modules/wallets/networks/networkDataSchema/index.d.ts.map +1 -0
- package/dist/modules/wallets/networks/networkDataSchema/networkDataSchema.d.ts +23 -0
- package/dist/modules/wallets/networks/networkDataSchema/networkDataSchema.d.ts.map +1 -0
- package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts +2 -0
- package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts.map +1 -1
- package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts +9 -1
- package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts.map +1 -1
- package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts +2 -1
- package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/{updateAuthFromVerifyResponse-CY0xTIXF.cjs → updateAuthFromVerifyResponse-CSqnGlh3.cjs} +427 -43
- package/dist/updateAuthFromVerifyResponse-CSqnGlh3.cjs.map +1 -0
- package/dist/{updateAuthFromVerifyResponse-inxvMWJB.esm.js → updateAuthFromVerifyResponse-C_YKKAIX.esm.js} +354 -27
- package/dist/updateAuthFromVerifyResponse-C_YKKAIX.esm.js.map +1 -0
- package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts +29 -0
- package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts.map +1 -0
- package/dist/utils/createTranslateRejection/index.d.ts +3 -0
- package/dist/utils/createTranslateRejection/index.d.ts.map +1 -0
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts +7 -5
- package/dist/utils/getNonce/fetchAndStoreNonces/fetchAndStoreNonces.d.ts.map +1 -1
- package/dist/utils/getNonce/getNonce.d.ts +10 -4
- package/dist/utils/getNonce/getNonce.d.ts.map +1 -1
- package/dist/utils/getNonce/noncePoolStorage/schema.d.ts +19 -0
- package/dist/utils/getNonce/noncePoolStorage/schema.d.ts.map +1 -0
- package/dist/utils/getNonce/noncePoolStorage/updateNoncePoolStorage/updateNoncePoolStorage.d.ts +18 -0
- package/dist/utils/getNonce/noncePoolStorage/updateNoncePoolStorage/updateNoncePoolStorage.d.ts.map +1 -0
- package/dist/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.d.ts.map +1 -1
- package/dist/utils/getNonce/state.d.ts +5 -9
- package/dist/utils/getNonce/state.d.ts.map +1 -1
- package/dist/waas.cjs +281 -18
- package/dist/waas.cjs.map +1 -1
- package/dist/waas.esm.js +273 -18
- package/dist/waas.esm.js.map +1 -1
- package/dist/waas.native.esm.js +272 -18
- package/dist/waas.native.esm.js.map +1 -1
- package/dist/waasCore.cjs +291 -170
- package/dist/waasCore.cjs.map +1 -1
- package/dist/waasCore.esm.js +285 -164
- package/dist/waasCore.esm.js.map +1 -1
- package/dist/waasCore.native.esm.js +273 -371
- package/dist/waasCore.native.esm.js.map +1 -1
- package/ios/DynamicClientScreenshotProtection.mm +70 -32
- package/package.json +5 -5
- package/dist/getNetworkProviderFromNetworkId-Ct6nH2tC.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DL6OXPUn.native.esm.js.map +0 -1
- package/dist/getNetworkProviderFromNetworkId-DmH039jx.cjs.map +0 -1
- package/dist/getSignedSessionId-CAQwZYYk.esm.js.map +0 -1
- package/dist/getSignedSessionId-Dz4U61DG.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-BkrwKqo1.native.esm.js.map +0 -1
- package/dist/isMfaRequiredForAction-CHeYEkjj.cjs +0 -430
- package/dist/isMfaRequiredForAction-CHeYEkjj.cjs.map +0 -1
- package/dist/isMfaRequiredForAction-DxJQm48x.esm.js +0 -343
- package/dist/isMfaRequiredForAction-DxJQm48x.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-BLm0JQ_z.native.esm.js.map +0 -1
- package/dist/isUserOnboardingComplete-DAesufca.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-C-lXWvvo.esm.js +0 -65
- package/dist/migrateFromFireblocks-C-lXWvvo.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-Do4mQTl7.native.esm.js.map +0 -1
- package/dist/migrateFromFireblocks-DrHwloUB.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-CY0xTIXF.cjs.map +0 -1
- package/dist/updateAuthFromVerifyResponse-D4au3jUv.native.esm.js.map +0 -1
- package/dist/updateAuthFromVerifyResponse-inxvMWJB.esm.js.map +0 -1
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CY0xTIXF.cjs');
|
|
1
|
+
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
|
|
3
2
|
|
|
4
|
-
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
|
-
/** @notInstrumented */
|
|
6
|
-
const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
|
|
7
|
-
if (!await require_isMfaRequiredForAction.isMfaRequiredForAction({ mfaAction }, client)) return;
|
|
8
|
-
return require_isMfaRequiredForAction.__consumeMfaToken_wrapped(client);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
3
|
//#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
|
|
13
4
|
/** @notInstrumented */
|
|
14
5
|
const generateNonceSignature = async ({ nonce }, client) => {
|
|
@@ -39,16 +30,10 @@ const getSignedSessionId = async (client) => {
|
|
|
39
30
|
};
|
|
40
31
|
|
|
41
32
|
//#endregion
|
|
42
|
-
Object.defineProperty(exports, 'consumeMfaTokenIfRequiredForAction', {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return consumeMfaTokenIfRequiredForAction;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
33
|
Object.defineProperty(exports, 'getSignedSessionId', {
|
|
49
34
|
enumerable: true,
|
|
50
35
|
get: function () {
|
|
51
36
|
return getSignedSessionId;
|
|
52
37
|
}
|
|
53
38
|
});
|
|
54
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
39
|
+
//# sourceMappingURL=getSignedSessionId-E6FIx5aj.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-E6FIx5aj.cjs","names":["getCore","getCore","getCore","getNonce"],"sources":["../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["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\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\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":";;;;AASA,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,MAAM,OAAOA,6CAAQ,OAAO;AAE5B,oDAAc,KAAK,UAAU,iCAAiC;AAI9D,QAAO,EAAE,WAFS,MAAM,KAAK,SAAS,KAAK,WAAW,MAAM,EAExC;;;;;;ACXtB,MAAa,2BAA2B,OACtC,EAAE,aACF,WACG;AAKH,QAAO,EAAE,WAFS,MAFLC,6CAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,MAAM,YAFOC,6CAAQ,OAAO,CAEL,MAAM,KAAK,CAAC,MAAM;AACzC,oDAAc,WAAW,yBAAyB;CAElD,MAAM,EAAE,WAAW,oBAAoB,MAAM,yBAC3C,EACE,WACD,EACD,OACD;AAED,oDAAc,iBAAiB,gCAAgC;CAE/D,MAAM,QAAQ,MAAMC,8CAAS,OAAO;CAEpC,MAAM,EAAE,WAAW,mBAAmB,MAAM,uBAC1C,EACE,OACD,EACD,OACD;AAED,oDAAc,gBAAgB,8BAA8B;AAI5D,QAAO,EAAE,WAFS,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAEtC"}
|
package/dist/{getSignedSessionId-CPautem1.native.esm.js → getSignedSessionId-ekp3lswQ.esm.js}
RENAMED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-BkrwKqo1.native.esm.js";
|
|
1
|
+
import { $ as getNonce, St as getCore, ut as assertDefined } from "./updateAuthFromVerifyResponse-C_YKKAIX.esm.js";
|
|
3
2
|
|
|
4
|
-
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
|
-
/** @notInstrumented */
|
|
6
|
-
const consumeMfaTokenIfRequiredForAction = async ({ mfaAction }, client) => {
|
|
7
|
-
if (!await isMfaRequiredForAction({ mfaAction }, client)) return;
|
|
8
|
-
return __consumeMfaToken_wrapped(client);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
3
|
//#region src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts
|
|
13
4
|
/** @notInstrumented */
|
|
14
5
|
const generateNonceSignature = async ({ nonce }, client) => {
|
|
@@ -39,5 +30,5 @@ const getSignedSessionId = async (client) => {
|
|
|
39
30
|
};
|
|
40
31
|
|
|
41
32
|
//#endregion
|
|
42
|
-
export {
|
|
43
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
33
|
+
export { getSignedSessionId as t };
|
|
34
|
+
//# sourceMappingURL=getSignedSessionId-ekp3lswQ.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-ekp3lswQ.esm.js","names":[],"sources":["../src/modules/sessionKeys/generateNonceSignature/generateNonceSignature.ts","../src/modules/sessionKeys/generateSessionSignature/generateSessionSignature.ts","../src/modules/sessionKeys/getSignedSessionId/getSignedSessionId.ts"],"sourcesContent":["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\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\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":";;;;AASA,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,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,WACG;AAKH,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,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"}
|
package/dist/{getSignedSessionId-CAQwZYYk.esm.js → getSignedSessionId-xZGFa4nS.native.esm.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-
|
|
1
|
+
import { Q as getNonce, St as getCore, ut as assertDefined } from "./NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js";
|
|
2
|
+
import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D4TSMQ4m.native.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.ts
|
|
5
5
|
/** @notInstrumented */
|
|
@@ -40,4 +40,4 @@ const getSignedSessionId = async (client) => {
|
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
export { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
|
|
43
|
-
//# sourceMappingURL=getSignedSessionId-
|
|
43
|
+
//# sourceMappingURL=getSignedSessionId-xZGFa4nS.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSignedSessionId-
|
|
1
|
+
{"version":3,"file":"getSignedSessionId-xZGFa4nS.native.esm.js","names":["consumeMfaToken"],"sources":["../src/modules/mfa/consumeMfaTokenIfRequiredForAction/consumeMfaTokenIfRequiredForAction.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 { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\n\ntype GenerateNonceSignatureParams = {\n nonce: string;\n};\n\n/** @notInstrumented */\nexport const generateNonceSignature = async (\n { nonce }: GenerateNonceSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const generateSessionSignature = async (\n { sessionId }: GenerateSessionSignatureParams,\n client: DynamicClient\n) => {\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\n/** @notInstrumented */\nexport const getSignedSessionId = async (client: DynamicClient) => {\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;;;;;;ACfhC,MAAa,yBAAyB,OACpC,EAAE,SACF,WACG;CACH,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,WACG;AAKH,QAAO,EAAE,WAFS,MAFL,QAAQ,OAAO,CAEC,SAAS,KAAK,WAAW,UAAU,EAE5C;;;;;;ACRtB,MAAa,qBAAqB,OAAO,WAA0B;CAGjE,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
|
-
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-
|
|
1
|
+
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts
|
|
4
4
|
/** @notInstrumented */
|
|
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'getWalletProviderByKey', {
|
|
|
28
28
|
return getWalletProviderByKey;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
//# sourceMappingURL=getWalletProviderByKey-
|
|
31
|
+
//# sourceMappingURL=getWalletProviderByKey-BwivhTYu.cjs.map
|
package/dist/{getWalletProviderByKey-CSVSMios.cjs.map → getWalletProviderByKey-BwivhTYu.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWalletProviderByKey-
|
|
1
|
+
{"version":3,"file":"getWalletProviderByKey-BwivhTYu.cjs","names":["getWalletProviders","walletProvider","NoWalletProviderFoundError"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import 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) => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n) => {\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"],"mappings":";;;;AAQA,MAAa,yCACX,EAAE,iBACF,WACG;AACH,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACLH,MAAa,0BACX,EAAE,qBACF,WACG;CAGH,MAAM,iBAFkBA,wDAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAIC,gEAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
|
package/dist/{getWalletProviderByKey-DTBGx_qd.esm.js → getWalletProviderByKey-CS299i1V.esm.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as getWalletProviders, k as NoWalletProviderFoundError } from "./updateAuthFromVerifyResponse-
|
|
1
|
+
import { f as getWalletProviders, k as NoWalletProviderFoundError } from "./updateAuthFromVerifyResponse-C_YKKAIX.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts
|
|
4
4
|
/** @notInstrumented */
|
|
@@ -17,4 +17,4 @@ const getWalletProviderByKey = ({ walletProviderKey }, client) => {
|
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { getVerifiedCredentialForWalletAccount as n, getWalletProviderByKey as t };
|
|
20
|
-
//# sourceMappingURL=getWalletProviderByKey-
|
|
20
|
+
//# sourceMappingURL=getWalletProviderByKey-CS299i1V.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWalletProviderByKey-
|
|
1
|
+
{"version":3,"file":"getWalletProviderByKey-CS299i1V.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import 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) => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n) => {\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"],"mappings":";;;;AAQA,MAAa,yCACX,EAAE,iBACF,WACG;AACH,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACLH,MAAa,0BACX,EAAE,qBACF,WACG;CAGH,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBA,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as NoWalletProviderFoundError, p as getWalletProviders } from "./NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts
|
|
4
4
|
/** @notInstrumented */
|
|
@@ -17,4 +17,4 @@ const getWalletProviderByKey = ({ walletProviderKey }, client) => {
|
|
|
17
17
|
|
|
18
18
|
//#endregion
|
|
19
19
|
export { getVerifiedCredentialForWalletAccount as n, getWalletProviderByKey as t };
|
|
20
|
-
//# sourceMappingURL=getWalletProviderByKey-
|
|
20
|
+
//# sourceMappingURL=getWalletProviderByKey-CYGDw6-5.native.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWalletProviderByKey-
|
|
1
|
+
{"version":3,"file":"getWalletProviderByKey-CYGDw6-5.native.esm.js","names":["walletProvider"],"sources":["../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import 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) => {\n return client.user?.verifiedCredentials.find(\n (vc) => vc.id === walletAccount.verifiedCredentialId\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { NoWalletProviderFoundError } from '../../../errors/NoWalletProviderFoundError';\nimport { getWalletProviders } from '../getWalletProviders';\n\ntype GetWalletProviderByKeyParams = {\n walletProviderKey: string;\n};\n\n/** @notInstrumented */\nexport const getWalletProviderByKey = (\n { walletProviderKey }: GetWalletProviderByKeyParams,\n client: DynamicClient\n) => {\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"],"mappings":";;;;AAQA,MAAa,yCACX,EAAE,iBACF,WACG;AACH,QAAO,OAAO,MAAM,oBAAoB,MACrC,OAAO,GAAG,OAAO,cAAc,qBACjC;;;;;;ACLH,MAAa,0BACX,EAAE,qBACF,WACG;CAGH,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBA,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
1
|
+
const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CSqnGlh3.cjs');
|
|
2
|
+
const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-5V4Cf8A_.cjs');
|
|
3
|
+
const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-BEVAshnS.cjs');
|
|
4
|
+
const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-CEVSIxJC.cjs');
|
|
5
|
+
const require_getWalletProviderByKey = require('./getWalletProviderByKey-BwivhTYu.cjs');
|
|
6
|
+
const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-odpvykkm.cjs');
|
|
7
7
|
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
8
8
|
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
9
9
|
let zod_mini = require("zod/mini");
|
|
10
|
-
zod_mini =
|
|
10
|
+
zod_mini = require_updateAuthFromVerifyResponse.__toESM(zod_mini);
|
|
11
11
|
let eventemitter3 = require("eventemitter3");
|
|
12
|
-
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
|
|
@@ -33,7 +33,8 @@ const stateChangeEvents = {
|
|
|
33
33
|
//#region src/utils/getNonce/prefetchNoncesIfNeeded/prefetchNoncesIfNeeded.ts
|
|
34
34
|
/** @notInstrumented */
|
|
35
35
|
const prefetchNoncesIfNeeded = async (client) => {
|
|
36
|
-
|
|
36
|
+
const stored = await require_updateAuthFromVerifyResponse.updateNoncePoolStorage({ update: () => null }, client);
|
|
37
|
+
if (stored !== null && stored.expiration > Date.now() && stored.nonces.length >= require_updateAuthFromVerifyResponse.NONCE_POOL_SIZE) return;
|
|
37
38
|
await require_updateAuthFromVerifyResponse.fetchAndStoreNonces(client);
|
|
38
39
|
};
|
|
39
40
|
|
|
@@ -94,7 +95,7 @@ const initializeAuth = (client) => {
|
|
|
94
95
|
const now = /* @__PURE__ */ new Date();
|
|
95
96
|
const timeUntilExpiration = expiration.getTime() - now.getTime();
|
|
96
97
|
if (timeUntilExpiration <= 0) {
|
|
97
|
-
|
|
98
|
+
require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "token-expired" }, client);
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
100
101
|
clearExpirationTimeout = setLongTimeout({
|
|
@@ -159,19 +160,17 @@ const walletProviderKeyMapSchema = zod_mini.record(zod_mini.string(), zod_mini.s
|
|
|
159
160
|
|
|
160
161
|
//#endregion
|
|
161
162
|
//#region src/modules/storageSync/schema.ts
|
|
162
|
-
const stateStorageKeySchema =
|
|
163
|
+
const stateStorageKeySchema = require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
163
164
|
key: "state",
|
|
164
165
|
schema: zod_mini.object({
|
|
165
166
|
apiVersion: zod_mini.string(),
|
|
166
|
-
prefetchedNonces: zod_mini.array(zod_mini.string()),
|
|
167
|
-
prefetchedNoncesExpiration: zod_mini.nullable(zod_mini.number()),
|
|
168
167
|
projectSettings: zod_mini.custom(),
|
|
169
168
|
unverifiedWalletAccounts: zod_mini.array(unverifiedWalletAccountSchema),
|
|
170
169
|
user: zod_mini.custom(),
|
|
171
170
|
walletProviderKeyMap: walletProviderKeyMapSchema
|
|
172
171
|
})
|
|
173
172
|
});
|
|
174
|
-
const sessionStorageKeySchema =
|
|
173
|
+
const sessionStorageKeySchema = require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
175
174
|
config: { storageTier: "secure" },
|
|
176
175
|
key: "session",
|
|
177
176
|
schema: zod_mini.object({
|
|
@@ -300,10 +299,6 @@ const hydrateStateWithStorage = async (client) => {
|
|
|
300
299
|
if (storedState?.apiVersion === require_updateAuthFromVerifyResponse.SDK_API_CORE_VERSION) {
|
|
301
300
|
stateChanges.unverifiedWalletAccounts = storedState.unverifiedWalletAccounts;
|
|
302
301
|
stateChanges.walletProviderKeyMap = storedState.walletProviderKeyMap;
|
|
303
|
-
if (storedState.prefetchedNoncesExpiration && storedState.prefetchedNoncesExpiration > Date.now()) {
|
|
304
|
-
stateChanges.prefetchedNonces = storedState.prefetchedNonces;
|
|
305
|
-
stateChanges.prefetchedNoncesExpiration = storedState.prefetchedNoncesExpiration;
|
|
306
|
-
}
|
|
307
302
|
if (isSessionValid) stateChanges.user = storedState.user;
|
|
308
303
|
if (isSessionValid || (storedState.unverifiedWalletAccounts ?? []).length > 0) stateChanges.projectSettings = storedState.projectSettings;
|
|
309
304
|
}
|
|
@@ -334,8 +329,6 @@ const syncStateWithStorage = (client) => {
|
|
|
334
329
|
});
|
|
335
330
|
core.storage.setItem(stateStorageKeySchema, {
|
|
336
331
|
apiVersion: require_updateAuthFromVerifyResponse.SDK_API_CORE_VERSION,
|
|
337
|
-
prefetchedNonces: state.prefetchedNonces,
|
|
338
|
-
prefetchedNoncesExpiration: state.prefetchedNoncesExpiration,
|
|
339
332
|
projectSettings: state.projectSettings,
|
|
340
333
|
unverifiedWalletAccounts: state.unverifiedWalletAccounts,
|
|
341
334
|
user: state.user,
|
|
@@ -465,10 +458,10 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
465
458
|
logger: core.logger,
|
|
466
459
|
state: core.state,
|
|
467
460
|
storage: core.storage
|
|
468
|
-
}).catch(() =>
|
|
469
|
-
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await
|
|
461
|
+
}).catch(() => require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
|
|
462
|
+
if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
|
|
470
463
|
}).then(async () => {
|
|
471
|
-
if (!core.state.get().projectSettings) await
|
|
464
|
+
if (!core.state.get().projectSettings) await require_updateAuthFromVerifyResponse.fetchProjectSettings(client);
|
|
472
465
|
});
|
|
473
466
|
fetchProjectSettingsPromise.then(() => prefetchNoncesIfNeeded(client)).catch((error) => {
|
|
474
467
|
core.logger.error("Failed to prefetch nonces:", error);
|
|
@@ -477,7 +470,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
477
470
|
* Generate session keys if they don't exist
|
|
478
471
|
*/
|
|
479
472
|
const generateSessionKeysPromise = fetchProjectSettingsPromise.then(async () => {
|
|
480
|
-
if (!core.state.get().sessionKeys) await
|
|
473
|
+
if (!core.state.get().sessionKeys) await require_updateAuthFromVerifyResponse.generateSessionKeys(client);
|
|
481
474
|
});
|
|
482
475
|
/**
|
|
483
476
|
* Refresh user state on initialization when cookie is enabled.
|
|
@@ -502,7 +495,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
502
495
|
if (require_updateAuthFromVerifyResponse.isCookieEnabled(client)) await require_isDynamicWaasEnabled.__refreshAuth_wrapped(client).catch(async (error) => {
|
|
503
496
|
if (error.status === 401) {
|
|
504
497
|
core.logger.error("Session expired during initialization", error);
|
|
505
|
-
if (client.user) await
|
|
498
|
+
if (client.user) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "session-refresh-unauthorized" }, client);
|
|
506
499
|
} else throw error;
|
|
507
500
|
});
|
|
508
501
|
});
|
|
@@ -513,7 +506,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
|
|
|
513
506
|
*/
|
|
514
507
|
const refreshUserStateFromValidTokenPromise = refreshUserStateFromCookiePromise.then(async () => {
|
|
515
508
|
if (core.state.get().token && !core.state.get().user) await __refreshUser_wrapped(client).catch(async () => {
|
|
516
|
-
await
|
|
509
|
+
await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-refresh-failed" }, client);
|
|
517
510
|
});
|
|
518
511
|
});
|
|
519
512
|
core.initTrack.track({
|
|
@@ -1013,8 +1006,6 @@ const getInitialState = () => ({
|
|
|
1013
1006
|
legacyToken: null,
|
|
1014
1007
|
mfaToken: null,
|
|
1015
1008
|
nonceFetchInFlight: null,
|
|
1016
|
-
prefetchedNonces: [],
|
|
1017
|
-
prefetchedNoncesExpiration: null,
|
|
1018
1009
|
projectSettings: null,
|
|
1019
1010
|
sessionExpiresAt: null,
|
|
1020
1011
|
sessionKeys: null,
|
|
@@ -1100,6 +1091,32 @@ const createCore = (config) => {
|
|
|
1100
1091
|
};
|
|
1101
1092
|
};
|
|
1102
1093
|
|
|
1094
|
+
//#endregion
|
|
1095
|
+
//#region src/client/createDynamicClient/assertClientProps/assertClientProps.ts
|
|
1096
|
+
const MIN_LOAD_TIMEOUT_MS = 1e3;
|
|
1097
|
+
const MAX_LOAD_TIMEOUT_MS = 6e4;
|
|
1098
|
+
const MIN_MAX_LOAD_RETRIES = 0;
|
|
1099
|
+
const MAX_MAX_LOAD_RETRIES = 10;
|
|
1100
|
+
/**
|
|
1101
|
+
* Validates the props passed to {@link createDynamicClient}, throwing before any
|
|
1102
|
+
* client/core is constructed so a malformed config fails fast at the call site
|
|
1103
|
+
* rather than turning into a silent runtime fallback.
|
|
1104
|
+
*
|
|
1105
|
+
* Currently this only covers the waas load tuning options: the underlying wallet
|
|
1106
|
+
* client silently clamps or ignores invalid values, which would otherwise turn a
|
|
1107
|
+
* config bug (e.g. `NaN` from an unset env var) into an invisible fallback.
|
|
1108
|
+
*
|
|
1109
|
+
* @param config - The configuration passed to {@link createDynamicClient}.
|
|
1110
|
+
* @throws {InvalidParamError} If `waas.loadTimeoutMs` or `waas.maxLoadRetries` is outside its supported range.
|
|
1111
|
+
* @notInstrumented
|
|
1112
|
+
*/
|
|
1113
|
+
const assertClientProps = (config) => {
|
|
1114
|
+
const loadTimeoutMs = config.waas?.loadTimeoutMs;
|
|
1115
|
+
if (loadTimeoutMs !== void 0 && (!Number.isFinite(loadTimeoutMs) || loadTimeoutMs < MIN_LOAD_TIMEOUT_MS || loadTimeoutMs > MAX_LOAD_TIMEOUT_MS)) throw new require_updateAuthFromVerifyResponse.InvalidParamError(`waas.loadTimeoutMs must be a number between ${MIN_LOAD_TIMEOUT_MS} and ${MAX_LOAD_TIMEOUT_MS}`);
|
|
1116
|
+
const maxLoadRetries = config.waas?.maxLoadRetries;
|
|
1117
|
+
if (maxLoadRetries !== void 0 && (!Number.isInteger(maxLoadRetries) || maxLoadRetries < MIN_MAX_LOAD_RETRIES || maxLoadRetries > MAX_MAX_LOAD_RETRIES)) throw new require_updateAuthFromVerifyResponse.InvalidParamError(`waas.maxLoadRetries must be an integer between ${MIN_MAX_LOAD_RETRIES} and ${MAX_MAX_LOAD_RETRIES}`);
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1103
1120
|
//#endregion
|
|
1104
1121
|
//#region src/client/createDynamicClient/createDynamicClient.ts
|
|
1105
1122
|
/**
|
|
@@ -1128,6 +1145,7 @@ const createCore = (config) => {
|
|
|
1128
1145
|
* @instrumented
|
|
1129
1146
|
*/
|
|
1130
1147
|
const createDynamicClient = (config) => {
|
|
1148
|
+
assertClientProps(config);
|
|
1131
1149
|
const core = createCore(config);
|
|
1132
1150
|
const client = {
|
|
1133
1151
|
get __core() {
|
|
@@ -1803,7 +1821,7 @@ const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultCl
|
|
|
1803
1821
|
* `logoutWithReason` — this wrapper is intentionally not instrumented so that
|
|
1804
1822
|
* Datadog sees a single function name per logout regardless of entry point.
|
|
1805
1823
|
*/
|
|
1806
|
-
return
|
|
1824
|
+
return require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
|
|
1807
1825
|
};
|
|
1808
1826
|
|
|
1809
1827
|
//#endregion
|
|
@@ -2090,7 +2108,7 @@ const removeDynamicOauthParamsFromUrl = (url) => {
|
|
|
2090
2108
|
//#endregion
|
|
2091
2109
|
//#region src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts
|
|
2092
2110
|
/** The schema to track the state of the OAuth flow. */
|
|
2093
|
-
const redirectStateStorageKeySchema =
|
|
2111
|
+
const redirectStateStorageKeySchema = require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
2094
2112
|
key: "redirectState",
|
|
2095
2113
|
schema: zod_mini.object({
|
|
2096
2114
|
codeVerifier: zod_mini.optional(zod_mini.string()),
|
|
@@ -2786,7 +2804,7 @@ const getCaptchaSettings = (client = require_updateAuthFromVerifyResponse.getDef
|
|
|
2786
2804
|
//#region src/modules/checkout/utils/createCheckoutSessionTokenStorageKey/createCheckoutSessionTokenStorageKey.ts
|
|
2787
2805
|
/** @notInstrumented */
|
|
2788
2806
|
const createCheckoutSessionTokenStorageKey = (transactionId) => {
|
|
2789
|
-
return
|
|
2807
|
+
return require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
2790
2808
|
key: `checkoutSessionToken:${transactionId}`,
|
|
2791
2809
|
schema: zod_mini.string()
|
|
2792
2810
|
});
|
|
@@ -3485,7 +3503,7 @@ const getRegisteredDevices = async (client = require_updateAuthFromVerifyRespons
|
|
|
3485
3503
|
const revokeAllRegisteredDevices = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
3486
3504
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
3487
3505
|
await require_updateAuthFromVerifyResponse.createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
|
|
3488
|
-
await
|
|
3506
|
+
await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "all-devices-revoked" }, client);
|
|
3489
3507
|
};
|
|
3490
3508
|
const __revokeAllRegisteredDevices_impl = revokeAllRegisteredDevices;
|
|
3491
3509
|
const __revokeAllRegisteredDevices_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
@@ -3509,7 +3527,7 @@ const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = require
|
|
|
3509
3527
|
if ((await require_updateAuthFromVerifyResponse.createApiClient({}, client).deleteDeviceRegistration({
|
|
3510
3528
|
deviceRegistrationId,
|
|
3511
3529
|
environmentId: core.environmentId
|
|
3512
|
-
})).currentDeviceRevoked) await
|
|
3530
|
+
})).currentDeviceRevoked) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "device-revoked" }, client);
|
|
3513
3531
|
};
|
|
3514
3532
|
const __revokeRegisteredDevice_impl = revokeRegisteredDevice;
|
|
3515
3533
|
const __revokeRegisteredDevice_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
@@ -3528,7 +3546,7 @@ const __revokeRegisteredDevice_wrapped = require_updateAuthFromVerifyResponse.in
|
|
|
3528
3546
|
//#region src/modules/flow/utils/createFlowSessionTokenStorageKey/createFlowSessionTokenStorageKey.ts
|
|
3529
3547
|
/** @notInstrumented */
|
|
3530
3548
|
const createFlowSessionTokenStorageKey = (flowId) => {
|
|
3531
|
-
return
|
|
3549
|
+
return require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
3532
3550
|
key: `flowSessionToken:${flowId}`,
|
|
3533
3551
|
schema: zod_mini.string()
|
|
3534
3552
|
});
|
|
@@ -4564,7 +4582,7 @@ const fetchWithTimeout = async (client) => {
|
|
|
4564
4582
|
/**
|
|
4565
4583
|
* The schema to store the cached wallet book data.
|
|
4566
4584
|
*/
|
|
4567
|
-
const walletBookCacheStorageKeySchema =
|
|
4585
|
+
const walletBookCacheStorageKeySchema = require_updateAuthFromVerifyResponse.createStorageKeySchema({
|
|
4568
4586
|
key: "legacyWalletBookCache",
|
|
4569
4587
|
schema: zod_mini.object({
|
|
4570
4588
|
groups: zod_mini.record(zod_mini.string(), zod_mini.any()),
|
|
@@ -4599,7 +4617,7 @@ const fetchLegacyWalletBook = async (client) => {
|
|
|
4599
4617
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
4600
4618
|
core.logger.debug("[fetchLegacyWalletBook] Fetching wallet book...");
|
|
4601
4619
|
try {
|
|
4602
|
-
const walletBook = await
|
|
4620
|
+
const walletBook = await require_updateAuthFromVerifyResponse.retryOnFail({
|
|
4603
4621
|
delay: RETRY_DELAY_MS,
|
|
4604
4622
|
fn: async () => fetchWithTimeout(client),
|
|
4605
4623
|
maxRetries: MAX_RETRIES
|
|
@@ -6600,7 +6618,7 @@ const checkUserScopes = ({ scopes, user }) => {
|
|
|
6600
6618
|
const deleteUser = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
|
|
6601
6619
|
const core = require_updateAuthFromVerifyResponse.getCore(client);
|
|
6602
6620
|
await require_updateAuthFromVerifyResponse.createApiClient({ includeMfaToken: true }, client).hardDeleteUser({ environmentId: core.environmentId });
|
|
6603
|
-
await
|
|
6621
|
+
await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-deleted" }, client);
|
|
6604
6622
|
};
|
|
6605
6623
|
const __deleteUser_impl = deleteUser;
|
|
6606
6624
|
const __deleteUser_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
|
|
@@ -9291,6 +9309,7 @@ exports.UnrecognizedNetworkError = UnrecognizedNetworkError;
|
|
|
9291
9309
|
exports.UserCancelledSocialPopUpError = UserCancelledSocialPopUpError;
|
|
9292
9310
|
exports.UserNotAuthenticatedError = UserNotAuthenticatedError;
|
|
9293
9311
|
exports.UserRejectedError = UserRejectedError;
|
|
9312
|
+
exports.WaasLoadFailedError = require_isUserOnboardingComplete.WaasLoadFailedError;
|
|
9294
9313
|
exports.WaasOnboardingIncompleteError = require_isUserOnboardingComplete.WaasOnboardingIncompleteError;
|
|
9295
9314
|
exports.WalletAccountAlreadyVerifiedError = WalletAccountAlreadyVerifiedError;
|
|
9296
9315
|
exports.WalletAccountNotSelectedError = WalletAccountNotSelectedError;
|
|
@@ -9339,7 +9358,7 @@ exports.detectOAuthRedirect = detectOAuthRedirect;
|
|
|
9339
9358
|
exports.detectSocialRedirectUrl = detectSocialRedirectUrl;
|
|
9340
9359
|
exports.excludeInstalledFromCatalog = excludeInstalledFromCatalog;
|
|
9341
9360
|
exports.executeSwapTransaction = __executeSwapTransaction_wrapped;
|
|
9342
|
-
exports.fetchProjectSettings =
|
|
9361
|
+
exports.fetchProjectSettings = require_updateAuthFromVerifyResponse.fetchProjectSettings;
|
|
9343
9362
|
exports.findMissingGoogleDriveBackupScopes = findMissingGoogleDriveBackupScopes;
|
|
9344
9363
|
exports.getActiveNetworkData = getActiveNetworkData;
|
|
9345
9364
|
exports.getActiveNetworkId = getActiveNetworkId;
|
|
@@ -9401,7 +9420,7 @@ exports.isMfaRequiredForAction = require_isMfaRequiredForAction.isMfaRequiredFor
|
|
|
9401
9420
|
exports.isMobile = isMobile;
|
|
9402
9421
|
exports.isPendingRecoveryCodesAcknowledgment = require_isUserOnboardingComplete.isPendingRecoveryCodesAcknowledgment;
|
|
9403
9422
|
exports.isProgrammaticNetworkSwitchAvailable = isProgrammaticNetworkSwitchAvailable;
|
|
9404
|
-
exports.isSignedIn =
|
|
9423
|
+
exports.isSignedIn = require_updateAuthFromVerifyResponse.isSignedIn;
|
|
9405
9424
|
exports.isUserMissingMfaAuth = require_updateAuthFromVerifyResponse.isUserMissingMfaAuth;
|
|
9406
9425
|
exports.isUserOnboardingComplete = require_isUserOnboardingComplete.isUserOnboardingComplete;
|
|
9407
9426
|
exports.isWalletAccountVerified = isWalletAccountVerified;
|