@dynamic-labs-sdk/client 1.20.0 → 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.
Files changed (165) hide show
  1. package/dist/{updateAuthFromVerifyResponse-DGrmo9MJ.native.esm.js → NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js} +33 -4
  2. package/dist/NativeModuleNotLinkedError-Ds_t3AZQ.native.esm.js.map +1 -0
  3. package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts +16 -0
  4. package/dist/client/createDynamicClient/assertClientProps/assertClientProps.d.ts.map +1 -0
  5. package/dist/client/createDynamicClient/assertClientProps/index.d.ts +2 -0
  6. package/dist/client/createDynamicClient/assertClientProps/index.d.ts.map +1 -0
  7. package/dist/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  8. package/dist/client/types/DynamicClientConfig.d.ts +35 -0
  9. package/dist/client/types/DynamicClientConfig.d.ts.map +1 -1
  10. package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs +17 -0
  11. package/dist/consumeMfaTokenIfRequiredForAction-CWVbmQ2A.cjs.map +1 -0
  12. package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js +12 -0
  13. package/dist/consumeMfaTokenIfRequiredForAction-C_IvLTH6.esm.js.map +1 -0
  14. package/dist/core.cjs +9 -8
  15. package/dist/core.cjs.map +1 -1
  16. package/dist/core.esm.js +6 -5
  17. package/dist/core.esm.js.map +1 -1
  18. package/dist/core.native.esm.js +5 -5
  19. package/dist/errors/WaasLoadFailedError.d.ts +45 -0
  20. package/dist/errors/WaasLoadFailedError.d.ts.map +1 -0
  21. package/dist/exports/index.d.ts +1 -0
  22. package/dist/exports/index.d.ts.map +1 -1
  23. package/dist/exports/waas.d.ts +10 -0
  24. package/dist/exports/waas.d.ts.map +1 -1
  25. package/dist/{getNetworkProviderFromNetworkId-DaVOUpiF.cjs → getNetworkProviderFromNetworkId-5V4Cf8A_.cjs} +48 -13
  26. package/dist/getNetworkProviderFromNetworkId-5V4Cf8A_.cjs.map +1 -0
  27. package/dist/{getNetworkProviderFromNetworkId-BlBx4Zh2.esm.js → getNetworkProviderFromNetworkId-DhS1snCk.esm.js} +48 -13
  28. package/dist/getNetworkProviderFromNetworkId-DhS1snCk.esm.js.map +1 -0
  29. package/dist/{getNetworkProviderFromNetworkId-xmoBE1cZ.native.esm.js → getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js} +2 -3
  30. package/dist/{getNetworkProviderFromNetworkId-xmoBE1cZ.native.esm.js.map → getNetworkProviderFromNetworkId-DudGvTmd.native.esm.js.map} +1 -1
  31. package/dist/{getSignedSessionId-3L_aMxVD.cjs → getSignedSessionId-E6FIx5aj.cjs} +2 -17
  32. package/dist/getSignedSessionId-E6FIx5aj.cjs.map +1 -0
  33. package/dist/{getSignedSessionId-DlmNVy-g.native.esm.js → getSignedSessionId-ekp3lswQ.esm.js} +3 -12
  34. package/dist/getSignedSessionId-ekp3lswQ.esm.js.map +1 -0
  35. package/dist/{getSignedSessionId-BVc-sgeN.esm.js → getSignedSessionId-xZGFa4nS.native.esm.js} +3 -3
  36. package/dist/{getSignedSessionId-DlmNVy-g.native.esm.js.map → getSignedSessionId-xZGFa4nS.native.esm.js.map} +1 -1
  37. package/dist/{getWalletProviderByKey-BilyW5Jr.cjs → getWalletProviderByKey-BwivhTYu.cjs} +2 -2
  38. package/dist/{getWalletProviderByKey-BilyW5Jr.cjs.map → getWalletProviderByKey-BwivhTYu.cjs.map} +1 -1
  39. package/dist/{getWalletProviderByKey-PIO1ygzj.esm.js → getWalletProviderByKey-CS299i1V.esm.js} +2 -2
  40. package/dist/{getWalletProviderByKey-PIO1ygzj.esm.js.map → getWalletProviderByKey-CS299i1V.esm.js.map} +1 -1
  41. package/dist/{getWalletProviderByKey-Ccx26JsF.native.esm.js → getWalletProviderByKey-CYGDw6-5.native.esm.js} +2 -2
  42. package/dist/{getWalletProviderByKey-Ccx26JsF.native.esm.js.map → getWalletProviderByKey-CYGDw6-5.native.esm.js.map} +1 -1
  43. package/dist/index.cjs +48 -20
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.esm.js +34 -7
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/index.native.esm.js +34 -7
  48. package/dist/index.native.esm.js.map +1 -1
  49. package/dist/{isDynamicWaasEnabled-DXVcXa66.cjs → isDynamicWaasEnabled-BEVAshnS.cjs} +2 -2
  50. package/dist/{isDynamicWaasEnabled-DXVcXa66.cjs.map → isDynamicWaasEnabled-BEVAshnS.cjs.map} +1 -1
  51. package/dist/{isDynamicWaasEnabled-C4oPJ0fw.native.esm.js → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js} +2 -2
  52. package/dist/{isDynamicWaasEnabled-C4oPJ0fw.native.esm.js.map → isDynamicWaasEnabled-C8Fb1xHn.native.esm.js.map} +1 -1
  53. package/dist/{isDynamicWaasEnabled-JpnXC0f7.esm.js → isDynamicWaasEnabled-D5e2K02u.esm.js} +2 -2
  54. package/dist/{isDynamicWaasEnabled-JpnXC0f7.esm.js.map → isDynamicWaasEnabled-D5e2K02u.esm.js.map} +1 -1
  55. package/dist/{isMfaRequiredForAction-D6rt_Tzn.native.esm.js → isMfaRequiredForAction-A02NFVt8.esm.js} +3 -32
  56. package/dist/isMfaRequiredForAction-A02NFVt8.esm.js.map +1 -0
  57. package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js +77 -0
  58. package/dist/isMfaRequiredForAction-D4TSMQ4m.native.esm.js.map +1 -0
  59. package/dist/isMfaRequiredForAction-odpvykkm.cjs +94 -0
  60. package/dist/isMfaRequiredForAction-odpvykkm.cjs.map +1 -0
  61. package/dist/{isUserOnboardingComplete-CsoV3ae7.cjs → isUserOnboardingComplete-CEVSIxJC.cjs} +49 -3
  62. package/dist/isUserOnboardingComplete-CEVSIxJC.cjs.map +1 -0
  63. package/dist/{isUserOnboardingComplete-diGA1wlX.esm.js → isUserOnboardingComplete-Cgkw21XZ.esm.js} +44 -4
  64. package/dist/isUserOnboardingComplete-Cgkw21XZ.esm.js.map +1 -0
  65. package/dist/{isUserOnboardingComplete-DnExOJu7.native.esm.js → isUserOnboardingComplete-CvQShE05.native.esm.js} +44 -4
  66. package/dist/{isUserOnboardingComplete-CsoV3ae7.cjs.map → isUserOnboardingComplete-CvQShE05.native.esm.js.map} +1 -1
  67. package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js +321 -0
  68. package/dist/migrateFromFireblocks-BMtelH1a.native.esm.js.map +1 -0
  69. package/dist/{migrateFromFireblocks-BrWXstt8.cjs → migrateFromFireblocks-CLUkVcFT.cjs} +54 -3
  70. package/dist/migrateFromFireblocks-CLUkVcFT.cjs.map +1 -0
  71. package/dist/{migrateFromFireblocks-CqL5l58Q.native.esm.js → migrateFromFireblocks-DcKrquTE.esm.js} +43 -4
  72. package/dist/migrateFromFireblocks-DcKrquTE.esm.js.map +1 -0
  73. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts +25 -0
  74. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/addBusinessAccountMember.d.ts.map +1 -0
  75. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts +2 -0
  76. package/dist/modules/waas/businessAccounts/addBusinessAccountMember/index.d.ts.map +1 -0
  77. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +35 -0
  78. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -0
  79. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts +2 -0
  80. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/index.d.ts.map +1 -0
  81. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts +19 -0
  82. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/addWalletToBusinessAccount.d.ts.map +1 -0
  83. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts +2 -0
  84. package/dist/modules/waas/businessAccounts/addWalletToBusinessAccount/index.d.ts.map +1 -0
  85. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts +184 -0
  86. package/dist/modules/waas/businessAccounts/businessAccounts.types.d.ts.map +1 -0
  87. package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts +16 -0
  88. package/dist/modules/waas/businessAccounts/createBusinessAccount/createBusinessAccount.d.ts.map +1 -0
  89. package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts +2 -0
  90. package/dist/modules/waas/businessAccounts/createBusinessAccount/index.d.ts.map +1 -0
  91. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts +36 -0
  92. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/createWalletForBusinessAccount.d.ts.map +1 -0
  93. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts +2 -0
  94. package/dist/modules/waas/businessAccounts/createWalletForBusinessAccount/index.d.ts.map +1 -0
  95. package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts +15 -0
  96. package/dist/modules/waas/businessAccounts/getBusinessAccount/getBusinessAccount.d.ts.map +1 -0
  97. package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts +2 -0
  98. package/dist/modules/waas/businessAccounts/getBusinessAccount/index.d.ts.map +1 -0
  99. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts +12 -0
  100. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/getBusinessAccountsClient.d.ts.map +1 -0
  101. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts +2 -0
  102. package/dist/modules/waas/businessAccounts/getBusinessAccountsClient/index.d.ts.map +1 -0
  103. package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts +2 -0
  104. package/dist/modules/waas/businessAccounts/listBusinessAccounts/index.d.ts.map +1 -0
  105. package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts +10 -0
  106. package/dist/modules/waas/businessAccounts/listBusinessAccounts/listBusinessAccounts.d.ts.map +1 -0
  107. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts +2 -0
  108. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/index.d.ts.map +1 -0
  109. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts +33 -0
  110. package/dist/modules/waas/businessAccounts/removeBusinessAccountMember/removeBusinessAccountMember.d.ts.map +1 -0
  111. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts +2 -0
  112. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/index.d.ts.map +1 -0
  113. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts +37 -0
  114. package/dist/modules/waas/businessAccounts/removeBusinessAccountSigner/removeBusinessAccountSigner.d.ts.map +1 -0
  115. package/dist/modules/waas/createWaasClient/createWaasClient.d.ts.map +1 -1
  116. package/dist/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
  117. package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts +11 -0
  118. package/dist/modules/waas/createWaasProvider/isWaasLoadExhaustionError.d.ts.map +1 -0
  119. package/dist/modules/waas/waas.types.d.ts +11 -0
  120. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  121. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts +9 -1
  122. package/dist/services/keychain/createKeychainService/utils/openDatabase.d.ts.map +1 -1
  123. package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts +2 -1
  124. package/dist/services/keychain/createKeychainService/utils/withDatabase/withDatabase.d.ts.map +1 -1
  125. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  126. package/dist/{updateAuthFromVerifyResponse-B0K1VJ8b.cjs → updateAuthFromVerifyResponse-CSqnGlh3.cjs} +289 -19
  127. package/dist/updateAuthFromVerifyResponse-CSqnGlh3.cjs.map +1 -0
  128. package/dist/{updateAuthFromVerifyResponse-CVDQVEQM.esm.js → updateAuthFromVerifyResponse-C_YKKAIX.esm.js} +262 -4
  129. package/dist/updateAuthFromVerifyResponse-C_YKKAIX.esm.js.map +1 -0
  130. package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts +29 -0
  131. package/dist/utils/createTranslateRejection/createTranslateRejection.d.ts.map +1 -0
  132. package/dist/utils/createTranslateRejection/index.d.ts +3 -0
  133. package/dist/utils/createTranslateRejection/index.d.ts.map +1 -0
  134. package/dist/waas.cjs +281 -17
  135. package/dist/waas.cjs.map +1 -1
  136. package/dist/waas.esm.js +273 -18
  137. package/dist/waas.esm.js.map +1 -1
  138. package/dist/waas.native.esm.js +272 -18
  139. package/dist/waas.native.esm.js.map +1 -1
  140. package/dist/waasCore.cjs +291 -170
  141. package/dist/waasCore.cjs.map +1 -1
  142. package/dist/waasCore.esm.js +285 -164
  143. package/dist/waasCore.esm.js.map +1 -1
  144. package/dist/waasCore.native.esm.js +273 -371
  145. package/dist/waasCore.native.esm.js.map +1 -1
  146. package/ios/DynamicClientScreenshotProtection.mm +70 -32
  147. package/package.json +4 -4
  148. package/dist/getNetworkProviderFromNetworkId-BlBx4Zh2.esm.js.map +0 -1
  149. package/dist/getNetworkProviderFromNetworkId-DaVOUpiF.cjs.map +0 -1
  150. package/dist/getSignedSessionId-3L_aMxVD.cjs.map +0 -1
  151. package/dist/getSignedSessionId-BVc-sgeN.esm.js.map +0 -1
  152. package/dist/isMfaRequiredForAction-20E6GsSc.esm.js +0 -336
  153. package/dist/isMfaRequiredForAction-20E6GsSc.esm.js.map +0 -1
  154. package/dist/isMfaRequiredForAction-9bYtZcve.cjs +0 -384
  155. package/dist/isMfaRequiredForAction-9bYtZcve.cjs.map +0 -1
  156. package/dist/isMfaRequiredForAction-D6rt_Tzn.native.esm.js.map +0 -1
  157. package/dist/isUserOnboardingComplete-DnExOJu7.native.esm.js.map +0 -1
  158. package/dist/isUserOnboardingComplete-diGA1wlX.esm.js.map +0 -1
  159. package/dist/migrateFromFireblocks--G-432sl.esm.js +0 -65
  160. package/dist/migrateFromFireblocks--G-432sl.esm.js.map +0 -1
  161. package/dist/migrateFromFireblocks-BrWXstt8.cjs.map +0 -1
  162. package/dist/migrateFromFireblocks-CqL5l58Q.native.esm.js.map +0 -1
  163. package/dist/updateAuthFromVerifyResponse-B0K1VJ8b.cjs.map +0 -1
  164. package/dist/updateAuthFromVerifyResponse-CVDQVEQM.esm.js.map +0 -1
  165. package/dist/updateAuthFromVerifyResponse-DGrmo9MJ.native.esm.js.map +0 -1
@@ -1,14 +1,5 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-B0K1VJ8b.cjs');
2
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-9bYtZcve.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-3L_aMxVD.cjs.map
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"}
@@ -1,14 +1,5 @@
1
- import { Z as getNonce, lt as assertDefined, xt as getCore } from "./updateAuthFromVerifyResponse-DGrmo9MJ.native.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-D6rt_Tzn.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 { consumeMfaTokenIfRequiredForAction as n, getSignedSessionId as t };
43
- //# sourceMappingURL=getSignedSessionId-DlmNVy-g.native.esm.js.map
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"}
@@ -1,5 +1,5 @@
1
- import { Z as getNonce, bt as getCore, ct as assertDefined } from "./updateAuthFromVerifyResponse-CVDQVEQM.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-20E6GsSc.esm.js";
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-BVc-sgeN.esm.js.map
43
+ //# sourceMappingURL=getSignedSessionId-xZGFa4nS.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSignedSessionId-DlmNVy-g.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
+ {"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-B0K1VJ8b.cjs');
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-BilyW5Jr.cjs.map
31
+ //# sourceMappingURL=getWalletProviderByKey-BwivhTYu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-BilyW5Jr.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"}
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"}
@@ -1,4 +1,4 @@
1
- import { f as getWalletProviders, k as NoWalletProviderFoundError } from "./updateAuthFromVerifyResponse-CVDQVEQM.esm.js";
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-PIO1ygzj.esm.js.map
20
+ //# sourceMappingURL=getWalletProviderByKey-CS299i1V.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-PIO1ygzj.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
+ {"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 { f as getWalletProviders, k as NoWalletProviderFoundError } from "./updateAuthFromVerifyResponse-DGrmo9MJ.native.esm.js";
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-Ccx26JsF.native.esm.js.map
20
+ //# sourceMappingURL=getWalletProviderByKey-CYGDw6-5.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-Ccx26JsF.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"}
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,9 +1,9 @@
1
- const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-B0K1VJ8b.cjs');
2
- const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-DaVOUpiF.cjs');
3
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-9bYtZcve.cjs');
4
- const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-DXVcXa66.cjs');
5
- const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-CsoV3ae7.cjs');
6
- const require_getWalletProviderByKey = require('./getWalletProviderByKey-BilyW5Jr.cjs');
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");
@@ -95,7 +95,7 @@ const initializeAuth = (client) => {
95
95
  const now = /* @__PURE__ */ new Date();
96
96
  const timeUntilExpiration = expiration.getTime() - now.getTime();
97
97
  if (timeUntilExpiration <= 0) {
98
- require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "token-expired" }, client);
98
+ require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "token-expired" }, client);
99
99
  return;
100
100
  }
101
101
  clearExpirationTimeout = setLongTimeout({
@@ -458,10 +458,10 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
458
458
  logger: core.logger,
459
459
  state: core.state,
460
460
  storage: core.storage
461
- }).catch(() => require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
462
- if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
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);
463
463
  }).then(async () => {
464
- if (!core.state.get().projectSettings) await require_isMfaRequiredForAction.fetchProjectSettings(client);
464
+ if (!core.state.get().projectSettings) await require_updateAuthFromVerifyResponse.fetchProjectSettings(client);
465
465
  });
466
466
  fetchProjectSettingsPromise.then(() => prefetchNoncesIfNeeded(client)).catch((error) => {
467
467
  core.logger.error("Failed to prefetch nonces:", error);
@@ -470,7 +470,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
470
470
  * Generate session keys if they don't exist
471
471
  */
472
472
  const generateSessionKeysPromise = fetchProjectSettingsPromise.then(async () => {
473
- if (!core.state.get().sessionKeys) await require_isMfaRequiredForAction.generateSessionKeys(client);
473
+ if (!core.state.get().sessionKeys) await require_updateAuthFromVerifyResponse.generateSessionKeys(client);
474
474
  });
475
475
  /**
476
476
  * Refresh user state on initialization when cookie is enabled.
@@ -495,7 +495,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
495
495
  if (require_updateAuthFromVerifyResponse.isCookieEnabled(client)) await require_isDynamicWaasEnabled.__refreshAuth_wrapped(client).catch(async (error) => {
496
496
  if (error.status === 401) {
497
497
  core.logger.error("Session expired during initialization", error);
498
- if (client.user) await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "session-refresh-unauthorized" }, client);
498
+ if (client.user) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "session-refresh-unauthorized" }, client);
499
499
  } else throw error;
500
500
  });
501
501
  });
@@ -506,7 +506,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
506
506
  */
507
507
  const refreshUserStateFromValidTokenPromise = refreshUserStateFromCookiePromise.then(async () => {
508
508
  if (core.state.get().token && !core.state.get().user) await __refreshUser_wrapped(client).catch(async () => {
509
- await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "user-refresh-failed" }, client);
509
+ await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-refresh-failed" }, client);
510
510
  });
511
511
  });
512
512
  core.initTrack.track({
@@ -1091,6 +1091,32 @@ const createCore = (config) => {
1091
1091
  };
1092
1092
  };
1093
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
+
1094
1120
  //#endregion
1095
1121
  //#region src/client/createDynamicClient/createDynamicClient.ts
1096
1122
  /**
@@ -1119,6 +1145,7 @@ const createCore = (config) => {
1119
1145
  * @instrumented
1120
1146
  */
1121
1147
  const createDynamicClient = (config) => {
1148
+ assertClientProps(config);
1122
1149
  const core = createCore(config);
1123
1150
  const client = {
1124
1151
  get __core() {
@@ -1794,7 +1821,7 @@ const logout = async (client = require_updateAuthFromVerifyResponse.getDefaultCl
1794
1821
  * `logoutWithReason` — this wrapper is intentionally not instrumented so that
1795
1822
  * Datadog sees a single function name per logout regardless of entry point.
1796
1823
  */
1797
- return require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
1824
+ return require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-intent" }, client);
1798
1825
  };
1799
1826
 
1800
1827
  //#endregion
@@ -3476,7 +3503,7 @@ const getRegisteredDevices = async (client = require_updateAuthFromVerifyRespons
3476
3503
  const revokeAllRegisteredDevices = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
3477
3504
  const core = require_updateAuthFromVerifyResponse.getCore(client);
3478
3505
  await require_updateAuthFromVerifyResponse.createApiClient({}, client).deleteAllDeviceRegistrations({ environmentId: core.environmentId });
3479
- await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "all-devices-revoked" }, client);
3506
+ await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "all-devices-revoked" }, client);
3480
3507
  };
3481
3508
  const __revokeAllRegisteredDevices_impl = revokeAllRegisteredDevices;
3482
3509
  const __revokeAllRegisteredDevices_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
@@ -3500,7 +3527,7 @@ const revokeRegisteredDevice = async ({ deviceRegistrationId }, client = require
3500
3527
  if ((await require_updateAuthFromVerifyResponse.createApiClient({}, client).deleteDeviceRegistration({
3501
3528
  deviceRegistrationId,
3502
3529
  environmentId: core.environmentId
3503
- })).currentDeviceRevoked) await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "device-revoked" }, client);
3530
+ })).currentDeviceRevoked) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "device-revoked" }, client);
3504
3531
  };
3505
3532
  const __revokeRegisteredDevice_impl = revokeRegisteredDevice;
3506
3533
  const __revokeRegisteredDevice_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
@@ -4590,7 +4617,7 @@ const fetchLegacyWalletBook = async (client) => {
4590
4617
  const core = require_updateAuthFromVerifyResponse.getCore(client);
4591
4618
  core.logger.debug("[fetchLegacyWalletBook] Fetching wallet book...");
4592
4619
  try {
4593
- const walletBook = await require_isMfaRequiredForAction.retryOnFail({
4620
+ const walletBook = await require_updateAuthFromVerifyResponse.retryOnFail({
4594
4621
  delay: RETRY_DELAY_MS,
4595
4622
  fn: async () => fetchWithTimeout(client),
4596
4623
  maxRetries: MAX_RETRIES
@@ -6591,7 +6618,7 @@ const checkUserScopes = ({ scopes, user }) => {
6591
6618
  const deleteUser = async (client = require_updateAuthFromVerifyResponse.getDefaultClient()) => {
6592
6619
  const core = require_updateAuthFromVerifyResponse.getCore(client);
6593
6620
  await require_updateAuthFromVerifyResponse.createApiClient({ includeMfaToken: true }, client).hardDeleteUser({ environmentId: core.environmentId });
6594
- await require_isMfaRequiredForAction.__logoutWithReason_wrapped({ reason: "user-deleted" }, client);
6621
+ await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "user-deleted" }, client);
6595
6622
  };
6596
6623
  const __deleteUser_impl = deleteUser;
6597
6624
  const __deleteUser_wrapped = require_updateAuthFromVerifyResponse.instrumentFunction({
@@ -9282,6 +9309,7 @@ exports.UnrecognizedNetworkError = UnrecognizedNetworkError;
9282
9309
  exports.UserCancelledSocialPopUpError = UserCancelledSocialPopUpError;
9283
9310
  exports.UserNotAuthenticatedError = UserNotAuthenticatedError;
9284
9311
  exports.UserRejectedError = UserRejectedError;
9312
+ exports.WaasLoadFailedError = require_isUserOnboardingComplete.WaasLoadFailedError;
9285
9313
  exports.WaasOnboardingIncompleteError = require_isUserOnboardingComplete.WaasOnboardingIncompleteError;
9286
9314
  exports.WalletAccountAlreadyVerifiedError = WalletAccountAlreadyVerifiedError;
9287
9315
  exports.WalletAccountNotSelectedError = WalletAccountNotSelectedError;
@@ -9330,7 +9358,7 @@ exports.detectOAuthRedirect = detectOAuthRedirect;
9330
9358
  exports.detectSocialRedirectUrl = detectSocialRedirectUrl;
9331
9359
  exports.excludeInstalledFromCatalog = excludeInstalledFromCatalog;
9332
9360
  exports.executeSwapTransaction = __executeSwapTransaction_wrapped;
9333
- exports.fetchProjectSettings = require_isMfaRequiredForAction.fetchProjectSettings;
9361
+ exports.fetchProjectSettings = require_updateAuthFromVerifyResponse.fetchProjectSettings;
9334
9362
  exports.findMissingGoogleDriveBackupScopes = findMissingGoogleDriveBackupScopes;
9335
9363
  exports.getActiveNetworkData = getActiveNetworkData;
9336
9364
  exports.getActiveNetworkId = getActiveNetworkId;
@@ -9392,7 +9420,7 @@ exports.isMfaRequiredForAction = require_isMfaRequiredForAction.isMfaRequiredFor
9392
9420
  exports.isMobile = isMobile;
9393
9421
  exports.isPendingRecoveryCodesAcknowledgment = require_isUserOnboardingComplete.isPendingRecoveryCodesAcknowledgment;
9394
9422
  exports.isProgrammaticNetworkSwitchAvailable = isProgrammaticNetworkSwitchAvailable;
9395
- exports.isSignedIn = require_isMfaRequiredForAction.isSignedIn;
9423
+ exports.isSignedIn = require_updateAuthFromVerifyResponse.isSignedIn;
9396
9424
  exports.isUserMissingMfaAuth = require_updateAuthFromVerifyResponse.isUserMissingMfaAuth;
9397
9425
  exports.isUserOnboardingComplete = require_isUserOnboardingComplete.isUserOnboardingComplete;
9398
9426
  exports.isWalletAccountVerified = isWalletAccountVerified;