@dynamic-labs-sdk/client 1.27.2 → 1.29.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 (279) hide show
  1. package/android/src/main/java/xyz/dynamic/client/webview/DynamicWebViewHost.kt +8 -3
  2. package/android/src/main/java/xyz/dynamic/client/webview/DynamicWebViewModule.kt +27 -0
  3. package/dist/core.cjs +30 -7
  4. package/dist/core.cjs.map +1 -1
  5. package/dist/core.esm.js +30 -7
  6. package/dist/core.esm.js.map +1 -1
  7. package/dist/core.native.esm.js +30 -7
  8. package/dist/core.native.esm.js.map +1 -1
  9. package/dist/exports/waas.d.ts +26 -2
  10. package/dist/exports/waas.d.ts.map +1 -1
  11. package/dist/{getNetworkProviderFromNetworkId-DbRI7rjs.esm.js → getNetworkProviderFromNetworkId-Be2CBFTv.esm.js} +2 -2
  12. package/dist/{getNetworkProviderFromNetworkId-DbRI7rjs.esm.js.map → getNetworkProviderFromNetworkId-Be2CBFTv.esm.js.map} +1 -1
  13. package/dist/{getNetworkProviderFromNetworkId-D9YJPaN-.cjs → getNetworkProviderFromNetworkId-BsmqXKF_.cjs} +2 -2
  14. package/dist/{getNetworkProviderFromNetworkId-D9YJPaN-.cjs.map → getNetworkProviderFromNetworkId-BsmqXKF_.cjs.map} +1 -1
  15. package/dist/{getNetworkProviderFromNetworkId-BZiHmVr2.native.esm.js → getNetworkProviderFromNetworkId-DReHSnab.native.esm.js} +3 -3
  16. package/dist/{getNetworkProviderFromNetworkId-BZiHmVr2.native.esm.js.map → getNetworkProviderFromNetworkId-DReHSnab.native.esm.js.map} +1 -1
  17. package/dist/{getSignedSessionId-Cp3O7r7g.esm.js → getSignedSessionId-CLvqM34v.esm.js} +3 -3
  18. package/dist/{getSignedSessionId-Cp3O7r7g.esm.js.map → getSignedSessionId-CLvqM34v.esm.js.map} +1 -1
  19. package/dist/{getSignedSessionId-DhjV1Fqf.cjs → getSignedSessionId-CcV_jWux.cjs} +3 -3
  20. package/dist/{getSignedSessionId-DhjV1Fqf.cjs.map → getSignedSessionId-CcV_jWux.cjs.map} +1 -1
  21. package/dist/{getSignedSessionId-CmrVr3iy.native.esm.js → getSignedSessionId-DdslNjRv.native.esm.js} +3 -3
  22. package/dist/{getSignedSessionId-CmrVr3iy.native.esm.js.map → getSignedSessionId-DdslNjRv.native.esm.js.map} +1 -1
  23. package/dist/{getWalletProviderByKey-B4k_2uv2.cjs → getWalletProviderByKey-BMsrnfN2.cjs} +2 -2
  24. package/dist/{getWalletProviderByKey-B4k_2uv2.cjs.map → getWalletProviderByKey-BMsrnfN2.cjs.map} +1 -1
  25. package/dist/{getWalletProviderByKey-D2v00w6U.native.esm.js → getWalletProviderByKey-BtcGKhh6.native.esm.js} +2 -2
  26. package/dist/{getWalletProviderByKey-D2v00w6U.native.esm.js.map → getWalletProviderByKey-BtcGKhh6.native.esm.js.map} +1 -1
  27. package/dist/{getWalletProviderByKey-DEPcBE0p.esm.js → getWalletProviderByKey-FfQmRcK1.esm.js} +2 -2
  28. package/dist/{getWalletProviderByKey-DEPcBE0p.esm.js.map → getWalletProviderByKey-FfQmRcK1.esm.js.map} +1 -1
  29. package/dist/index.cjs +43 -6
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.esm.js +43 -6
  32. package/dist/index.esm.js.map +1 -1
  33. package/dist/index.native.esm.js +43 -6
  34. package/dist/index.native.esm.js.map +1 -1
  35. package/dist/{isDynamicWaasEnabled-D5isSrbk.esm.js → isDynamicWaasEnabled-B8e0N7Bb.esm.js} +2 -2
  36. package/dist/{isDynamicWaasEnabled-D5isSrbk.esm.js.map → isDynamicWaasEnabled-B8e0N7Bb.esm.js.map} +1 -1
  37. package/dist/{isDynamicWaasEnabled-CivDFwvA.cjs → isDynamicWaasEnabled-DT4jhqkC.cjs} +2 -2
  38. package/dist/{isDynamicWaasEnabled-CivDFwvA.cjs.map → isDynamicWaasEnabled-DT4jhqkC.cjs.map} +1 -1
  39. package/dist/{isDynamicWaasEnabled-Ci15huyb.native.esm.js → isDynamicWaasEnabled-GTkHpRu6.native.esm.js} +2 -2
  40. package/dist/{isDynamicWaasEnabled-Ci15huyb.native.esm.js.map → isDynamicWaasEnabled-GTkHpRu6.native.esm.js.map} +1 -1
  41. package/dist/{isMfaRequiredForAction-BtFx8pFs.cjs → isMfaRequiredForAction-9ZrKcsTN.cjs} +2 -2
  42. package/dist/{isMfaRequiredForAction-BtFx8pFs.cjs.map → isMfaRequiredForAction-9ZrKcsTN.cjs.map} +1 -1
  43. package/dist/{isMfaRequiredForAction-Dek3pHGj.esm.js → isMfaRequiredForAction-DRqf4xyv.esm.js} +2 -2
  44. package/dist/{isMfaRequiredForAction-Dek3pHGj.esm.js.map → isMfaRequiredForAction-DRqf4xyv.esm.js.map} +1 -1
  45. package/dist/{isMfaRequiredForAction-DRvYZbyp.native.esm.js → isMfaRequiredForAction-e4Bdq2tD.native.esm.js} +2 -2
  46. package/dist/{isMfaRequiredForAction-DRvYZbyp.native.esm.js.map → isMfaRequiredForAction-e4Bdq2tD.native.esm.js.map} +1 -1
  47. package/dist/{isUserOnboardingComplete-BDDx34rh.esm.js → isUserOnboardingComplete-Bq_7_Fck.esm.js} +3 -3
  48. package/dist/{isUserOnboardingComplete-BDDx34rh.esm.js.map → isUserOnboardingComplete-Bq_7_Fck.esm.js.map} +1 -1
  49. package/dist/{isUserOnboardingComplete-syj63-y3.cjs → isUserOnboardingComplete-DINsEIfi.cjs} +3 -3
  50. package/dist/{isUserOnboardingComplete-syj63-y3.cjs.map → isUserOnboardingComplete-DINsEIfi.cjs.map} +1 -1
  51. package/dist/{isUserOnboardingComplete-DSSsynlf.native.esm.js → isUserOnboardingComplete-DKt0bwXg.native.esm.js} +3 -3
  52. package/dist/{isUserOnboardingComplete-DSSsynlf.native.esm.js.map → isUserOnboardingComplete-DKt0bwXg.native.esm.js.map} +1 -1
  53. package/dist/{migrateFromFireblocks-CQHXClD2.native.esm.js → migrateFromFireblocks-3naM4iCQ.native.esm.js} +3 -3
  54. package/dist/{migrateFromFireblocks-CQHXClD2.native.esm.js.map → migrateFromFireblocks-3naM4iCQ.native.esm.js.map} +1 -1
  55. package/dist/{migrateFromFireblocks-Dg5FgBgT.esm.js → migrateFromFireblocks-DbTnFE38.esm.js} +3 -3
  56. package/dist/{migrateFromFireblocks-Dg5FgBgT.esm.js.map → migrateFromFireblocks-DbTnFE38.esm.js.map} +1 -1
  57. package/dist/{migrateFromFireblocks-Ch5uks7o.cjs → migrateFromFireblocks-Dyh2dGWB.cjs} +3 -3
  58. package/dist/{migrateFromFireblocks-Ch5uks7o.cjs.map → migrateFromFireblocks-Dyh2dGWB.cjs.map} +1 -1
  59. package/dist/modules/auth/decodeJwt/decodeJwt.d.ts +2 -1
  60. package/dist/modules/auth/decodeJwt/decodeJwt.d.ts.map +1 -1
  61. package/dist/modules/auth/logoutReason.d.ts +1 -1
  62. package/dist/modules/auth/logoutReason.d.ts.map +1 -1
  63. package/dist/modules/flow/submitFlowTransaction/submitFlowTransaction.d.ts.map +1 -1
  64. package/dist/modules/initializeClient/initializeClient.d.ts.map +1 -1
  65. package/dist/modules/initializeClient/logoutIfSessionPublicKeyMismatched/logoutIfSessionPublicKeyMismatched.d.ts +18 -0
  66. package/dist/modules/initializeClient/logoutIfSessionPublicKeyMismatched/logoutIfSessionPublicKeyMismatched.d.ts.map +1 -0
  67. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts +2 -2
  68. package/dist/modules/waas/businessAccounts/addBusinessAccountSigner/addBusinessAccountSigner.d.ts.map +1 -1
  69. package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts +27 -0
  70. package/dist/modules/waas/getWalletAccountShareSets/getWalletAccountShareSets.d.ts.map +1 -0
  71. package/dist/modules/waas/getWalletAccountShareSets/index.d.ts +3 -0
  72. package/dist/modules/waas/getWalletAccountShareSets/index.d.ts.map +1 -0
  73. package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts +25 -0
  74. package/dist/modules/waas/injectWaasVerifiedCredentialFields/injectWaasVerifiedCredentialFields.d.ts.map +1 -0
  75. package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts +18 -0
  76. package/dist/modules/waas/policies/applyPolicyLayerBatch/applyPolicyLayerBatch.d.ts.map +1 -0
  77. package/dist/modules/waas/policies/applyPolicyLayerBatch/index.d.ts +2 -0
  78. package/dist/modules/waas/policies/applyPolicyLayerBatch/index.d.ts.map +1 -0
  79. package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts +10 -0
  80. package/dist/modules/waas/policies/buildAllowAddressesRule/buildAllowAddressesRule.d.ts.map +1 -0
  81. package/dist/modules/waas/policies/buildAllowAddressesRule/index.d.ts +2 -0
  82. package/dist/modules/waas/policies/buildAllowAddressesRule/index.d.ts.map +1 -0
  83. package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts +11 -0
  84. package/dist/modules/waas/policies/buildAllowPolicyRule/buildAllowPolicyRule.d.ts.map +1 -0
  85. package/dist/modules/waas/policies/buildAllowPolicyRule/index.d.ts +2 -0
  86. package/dist/modules/waas/policies/buildAllowPolicyRule/index.d.ts.map +1 -0
  87. package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts +11 -0
  88. package/dist/modules/waas/policies/buildBlockExportRule/buildBlockExportRule.d.ts.map +1 -0
  89. package/dist/modules/waas/policies/buildBlockExportRule/index.d.ts +2 -0
  90. package/dist/modules/waas/policies/buildBlockExportRule/index.d.ts.map +1 -0
  91. package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts +8 -0
  92. package/dist/modules/waas/policies/buildDenyAddressesRule/buildDenyAddressesRule.d.ts.map +1 -0
  93. package/dist/modules/waas/policies/buildDenyAddressesRule/index.d.ts +2 -0
  94. package/dist/modules/waas/policies/buildDenyAddressesRule/index.d.ts.map +1 -0
  95. package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts +11 -0
  96. package/dist/modules/waas/policies/buildDenyPolicyRule/buildDenyPolicyRule.d.ts.map +1 -0
  97. package/dist/modules/waas/policies/buildDenyPolicyRule/index.d.ts +2 -0
  98. package/dist/modules/waas/policies/buildDenyPolicyRule/index.d.ts.map +1 -0
  99. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts +10 -0
  100. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/buildMaxAmountPerTransactionRule.d.ts.map +1 -0
  101. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/index.d.ts +2 -0
  102. package/dist/modules/waas/policies/buildMaxAmountPerTransactionRule/index.d.ts.map +1 -0
  103. package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts +26 -0
  104. package/dist/modules/waas/policies/buildOperationForExistingRule/buildOperationForExistingRule.d.ts.map +1 -0
  105. package/dist/modules/waas/policies/buildOperationForExistingRule/index.d.ts +2 -0
  106. package/dist/modules/waas/policies/buildOperationForExistingRule/index.d.ts.map +1 -0
  107. package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts +24 -0
  108. package/dist/modules/waas/policies/buildOperationsForRule/buildOperationsForRule.d.ts.map +1 -0
  109. package/dist/modules/waas/policies/buildOperationsForRule/index.d.ts +2 -0
  110. package/dist/modules/waas/policies/buildOperationsForRule/index.d.ts.map +1 -0
  111. package/dist/modules/waas/policies/buildValueLimit/buildValueLimit.d.ts +10 -0
  112. package/dist/modules/waas/policies/buildValueLimit/buildValueLimit.d.ts.map +1 -0
  113. package/dist/modules/waas/policies/buildValueLimit/index.d.ts +2 -0
  114. package/dist/modules/waas/policies/buildValueLimit/index.d.ts.map +1 -0
  115. package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts +39 -0
  116. package/dist/modules/waas/policies/createPolicy/createPolicy.d.ts.map +1 -0
  117. package/dist/modules/waas/policies/createPolicy/index.d.ts +2 -0
  118. package/dist/modules/waas/policies/createPolicy/index.d.ts.map +1 -0
  119. package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts +23 -0
  120. package/dist/modules/waas/policies/desugarPolicyRules/desugarPolicyRules.d.ts.map +1 -0
  121. package/dist/modules/waas/policies/desugarPolicyRules/index.d.ts +2 -0
  122. package/dist/modules/waas/policies/desugarPolicyRules/index.d.ts.map +1 -0
  123. package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts +22 -0
  124. package/dist/modules/waas/policies/expandPolicyRules/expandPolicyRules.d.ts.map +1 -0
  125. package/dist/modules/waas/policies/expandPolicyRules/index.d.ts +2 -0
  126. package/dist/modules/waas/policies/expandPolicyRules/index.d.ts.map +1 -0
  127. package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts +26 -0
  128. package/dist/modules/waas/policies/fillOmittedRuleValues/fillOmittedRuleValues.d.ts.map +1 -0
  129. package/dist/modules/waas/policies/fillOmittedRuleValues/index.d.ts +2 -0
  130. package/dist/modules/waas/policies/fillOmittedRuleValues/index.d.ts.map +1 -0
  131. package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts +22 -0
  132. package/dist/modules/waas/policies/findMatchedRuleKind/findMatchedRuleKind.d.ts.map +1 -0
  133. package/dist/modules/waas/policies/findMatchedRuleKind/index.d.ts +3 -0
  134. package/dist/modules/waas/policies/findMatchedRuleKind/index.d.ts.map +1 -0
  135. package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts +18 -0
  136. package/dist/modules/waas/policies/getAccountPolicyLayer/getAccountPolicyLayer.d.ts.map +1 -0
  137. package/dist/modules/waas/policies/getAccountPolicyLayer/index.d.ts +2 -0
  138. package/dist/modules/waas/policies/getAccountPolicyLayer/index.d.ts.map +1 -0
  139. package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts +34 -0
  140. package/dist/modules/waas/policies/getPolicy/getPolicy.d.ts.map +1 -0
  141. package/dist/modules/waas/policies/getPolicy/index.d.ts +2 -0
  142. package/dist/modules/waas/policies/getPolicy/index.d.ts.map +1 -0
  143. package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts +16 -0
  144. package/dist/modules/waas/policies/getResolvedPolicyLayer/getResolvedPolicyLayer.d.ts.map +1 -0
  145. package/dist/modules/waas/policies/getResolvedPolicyLayer/index.d.ts +2 -0
  146. package/dist/modules/waas/policies/getResolvedPolicyLayer/index.d.ts.map +1 -0
  147. package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts +25 -0
  148. package/dist/modules/waas/policies/getSignerPolicyLayer/getSignerPolicyLayer.d.ts.map +1 -0
  149. package/dist/modules/waas/policies/getSignerPolicyLayer/index.d.ts +2 -0
  150. package/dist/modules/waas/policies/getSignerPolicyLayer/index.d.ts.map +1 -0
  151. package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts +20 -0
  152. package/dist/modules/waas/policies/getWalletPolicyLayer/getWalletPolicyLayer.d.ts.map +1 -0
  153. package/dist/modules/waas/policies/getWalletPolicyLayer/index.d.ts +2 -0
  154. package/dist/modules/waas/policies/getWalletPolicyLayer/index.d.ts.map +1 -0
  155. package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts +7 -0
  156. package/dist/modules/waas/policies/hasAddresses/hasAddresses.d.ts.map +1 -0
  157. package/dist/modules/waas/policies/hasAddresses/index.d.ts +2 -0
  158. package/dist/modules/waas/policies/hasAddresses/index.d.ts.map +1 -0
  159. package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts +6 -0
  160. package/dist/modules/waas/policies/hasUnrecognizedFields/hasUnrecognizedFields.d.ts.map +1 -0
  161. package/dist/modules/waas/policies/hasUnrecognizedFields/index.d.ts +2 -0
  162. package/dist/modules/waas/policies/hasUnrecognizedFields/index.d.ts.map +1 -0
  163. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/index.d.ts +2 -0
  164. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/index.d.ts.map +1 -0
  165. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts +14 -0
  166. package/dist/modules/waas/policies/isPolicyRuleDeletionMarker/isPolicyRuleDeletionMarker.d.ts.map +1 -0
  167. package/dist/modules/waas/policies/matchExistingRules/index.d.ts +3 -0
  168. package/dist/modules/waas/policies/matchExistingRules/index.d.ts.map +1 -0
  169. package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts +33 -0
  170. package/dist/modules/waas/policies/matchExistingRules/matchExistingRules.d.ts.map +1 -0
  171. package/dist/modules/waas/policies/policies.types.d.ts +91 -0
  172. package/dist/modules/waas/policies/policies.types.d.ts.map +1 -0
  173. package/dist/modules/waas/policies/policyRuleDefaultNames.d.ts +10 -0
  174. package/dist/modules/waas/policies/policyRuleDefaultNames.d.ts.map +1 -0
  175. package/dist/modules/waas/policies/policyRuleKinds.d.ts +34 -0
  176. package/dist/modules/waas/policies/policyRuleKinds.d.ts.map +1 -0
  177. package/dist/modules/waas/policies/readAllowAddressesRule/index.d.ts +2 -0
  178. package/dist/modules/waas/policies/readAllowAddressesRule/index.d.ts.map +1 -0
  179. package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts +9 -0
  180. package/dist/modules/waas/policies/readAllowAddressesRule/readAllowAddressesRule.d.ts.map +1 -0
  181. package/dist/modules/waas/policies/readBlockExportRule/index.d.ts +2 -0
  182. package/dist/modules/waas/policies/readBlockExportRule/index.d.ts.map +1 -0
  183. package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts +8 -0
  184. package/dist/modules/waas/policies/readBlockExportRule/readBlockExportRule.d.ts.map +1 -0
  185. package/dist/modules/waas/policies/readCoveredRule/index.d.ts +3 -0
  186. package/dist/modules/waas/policies/readCoveredRule/index.d.ts.map +1 -0
  187. package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts +31 -0
  188. package/dist/modules/waas/policies/readCoveredRule/readCoveredRule.d.ts.map +1 -0
  189. package/dist/modules/waas/policies/readDenyAddressesRule/index.d.ts +2 -0
  190. package/dist/modules/waas/policies/readDenyAddressesRule/index.d.ts.map +1 -0
  191. package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts +8 -0
  192. package/dist/modules/waas/policies/readDenyAddressesRule/readDenyAddressesRule.d.ts.map +1 -0
  193. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/index.d.ts +2 -0
  194. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/index.d.ts.map +1 -0
  195. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts +8 -0
  196. package/dist/modules/waas/policies/readMaxAmountPerTransactionRule/readMaxAmountPerTransactionRule.d.ts.map +1 -0
  197. package/dist/modules/waas/policies/readValueLimit/index.d.ts +2 -0
  198. package/dist/modules/waas/policies/readValueLimit/index.d.ts.map +1 -0
  199. package/dist/modules/waas/policies/readValueLimit/readValueLimit.d.ts +10 -0
  200. package/dist/modules/waas/policies/readValueLimit/readValueLimit.d.ts.map +1 -0
  201. package/dist/modules/waas/policies/removeAccountPolicyRule/index.d.ts +2 -0
  202. package/dist/modules/waas/policies/removeAccountPolicyRule/index.d.ts.map +1 -0
  203. package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts +20 -0
  204. package/dist/modules/waas/policies/removeAccountPolicyRule/removeAccountPolicyRule.d.ts.map +1 -0
  205. package/dist/modules/waas/policies/removePolicyRules/index.d.ts +2 -0
  206. package/dist/modules/waas/policies/removePolicyRules/index.d.ts.map +1 -0
  207. package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts +30 -0
  208. package/dist/modules/waas/policies/removePolicyRules/removePolicyRules.d.ts.map +1 -0
  209. package/dist/modules/waas/policies/removeSignerPolicyRule/index.d.ts +2 -0
  210. package/dist/modules/waas/policies/removeSignerPolicyRule/index.d.ts.map +1 -0
  211. package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts +25 -0
  212. package/dist/modules/waas/policies/removeSignerPolicyRule/removeSignerPolicyRule.d.ts.map +1 -0
  213. package/dist/modules/waas/policies/removeWalletPolicyRule/index.d.ts +2 -0
  214. package/dist/modules/waas/policies/removeWalletPolicyRule/index.d.ts.map +1 -0
  215. package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts +22 -0
  216. package/dist/modules/waas/policies/removeWalletPolicyRule/removeWalletPolicyRule.d.ts.map +1 -0
  217. package/dist/modules/waas/policies/resolvePolicyScope/index.d.ts +3 -0
  218. package/dist/modules/waas/policies/resolvePolicyScope/index.d.ts.map +1 -0
  219. package/dist/modules/waas/policies/resolvePolicyScope/resolvePolicyScope.d.ts +31 -0
  220. package/dist/modules/waas/policies/resolvePolicyScope/resolvePolicyScope.d.ts.map +1 -0
  221. package/dist/modules/waas/policies/resolveRuleName/index.d.ts +2 -0
  222. package/dist/modules/waas/policies/resolveRuleName/index.d.ts.map +1 -0
  223. package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts +20 -0
  224. package/dist/modules/waas/policies/resolveRuleName/resolveRuleName.d.ts.map +1 -0
  225. package/dist/modules/waas/policies/sameChainIds/index.d.ts +2 -0
  226. package/dist/modules/waas/policies/sameChainIds/index.d.ts.map +1 -0
  227. package/dist/modules/waas/policies/sameChainIds/sameChainIds.d.ts +14 -0
  228. package/dist/modules/waas/policies/sameChainIds/sameChainIds.d.ts.map +1 -0
  229. package/dist/modules/waas/policies/sortRulesByRuleId/index.d.ts +2 -0
  230. package/dist/modules/waas/policies/sortRulesByRuleId/index.d.ts.map +1 -0
  231. package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts +12 -0
  232. package/dist/modules/waas/policies/sortRulesByRuleId/sortRulesByRuleId.d.ts.map +1 -0
  233. package/dist/modules/waas/policies/upsertAccountPolicyRule/index.d.ts +2 -0
  234. package/dist/modules/waas/policies/upsertAccountPolicyRule/index.d.ts.map +1 -0
  235. package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts +24 -0
  236. package/dist/modules/waas/policies/upsertAccountPolicyRule/upsertAccountPolicyRule.d.ts.map +1 -0
  237. package/dist/modules/waas/policies/upsertSignerPolicyRule/index.d.ts +2 -0
  238. package/dist/modules/waas/policies/upsertSignerPolicyRule/index.d.ts.map +1 -0
  239. package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts +28 -0
  240. package/dist/modules/waas/policies/upsertSignerPolicyRule/upsertSignerPolicyRule.d.ts.map +1 -0
  241. package/dist/modules/waas/policies/upsertWalletPolicyRule/index.d.ts +2 -0
  242. package/dist/modules/waas/policies/upsertWalletPolicyRule/index.d.ts.map +1 -0
  243. package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts +25 -0
  244. package/dist/modules/waas/policies/upsertWalletPolicyRule/upsertWalletPolicyRule.d.ts.map +1 -0
  245. package/dist/modules/waas/signSerializedTransaction/index.d.ts +2 -0
  246. package/dist/modules/waas/signSerializedTransaction/index.d.ts.map +1 -0
  247. package/dist/modules/waas/signSerializedTransaction/signSerializedTransaction.d.ts +23 -0
  248. package/dist/modules/waas/signSerializedTransaction/signSerializedTransaction.d.ts.map +1 -0
  249. package/dist/modules/waas/waas.types.d.ts +22 -1
  250. package/dist/modules/waas/waas.types.d.ts.map +1 -1
  251. package/dist/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts.map +1 -1
  252. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts +0 -2
  253. package/dist/modules/wallets/walletAccount/walletAccount.types.d.ts.map +1 -1
  254. package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts +1 -0
  255. package/dist/modules/wallets/walletProvider/events/createWalletProviderEventEmitter/createWalletProviderEventEmitter.d.ts.map +1 -1
  256. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  257. package/dist/{updateAuthFromVerifyResponse-B3V0ynwL.esm.js → updateAuthFromVerifyResponse-B42kkGLd.esm.js} +38 -15
  258. package/dist/updateAuthFromVerifyResponse-B42kkGLd.esm.js.map +1 -0
  259. package/dist/{updateAuthFromVerifyResponse-BcKzypsw.cjs → updateAuthFromVerifyResponse-CePaJzru.cjs} +43 -14
  260. package/dist/updateAuthFromVerifyResponse-CePaJzru.cjs.map +1 -0
  261. package/dist/{updateAuthFromVerifyResponse-DphOSQfK.native.esm.js → updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js} +38 -15
  262. package/dist/updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js.map +1 -0
  263. package/dist/utils/objectKeys/index.d.ts +2 -0
  264. package/dist/utils/objectKeys/index.d.ts.map +1 -0
  265. package/dist/utils/objectKeys/objectKeys.d.ts +8 -0
  266. package/dist/utils/objectKeys/objectKeys.d.ts.map +1 -0
  267. package/dist/waas.cjs +1198 -4
  268. package/dist/waas.cjs.map +1 -1
  269. package/dist/waas.esm.js +1176 -7
  270. package/dist/waas.esm.js.map +1 -1
  271. package/dist/waas.native.esm.js +1176 -7
  272. package/dist/waas.native.esm.js.map +1 -1
  273. package/dist/waasCore.cjs +6 -6
  274. package/dist/waasCore.esm.js +6 -6
  275. package/dist/waasCore.native.esm.js +6 -6
  276. package/package.json +4 -4
  277. package/dist/updateAuthFromVerifyResponse-B3V0ynwL.esm.js.map +0 -1
  278. package/dist/updateAuthFromVerifyResponse-BcKzypsw.cjs.map +0 -1
  279. package/dist/updateAuthFromVerifyResponse-DphOSQfK.native.esm.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { G as getNonce, dt as assertDefined, xt as getCore } from "./updateAuthFromVerifyResponse-DphOSQfK.native.esm.js";
2
- import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-DRvYZbyp.native.esm.js";
1
+ import { K as getNonce, St as getCore, ft as assertDefined } from "./updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js";
2
+ import { r as __consumeMfaToken_wrapped, t as isMfaRequiredForAction } from "./isMfaRequiredForAction-e4Bdq2tD.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-CmrVr3iy.native.esm.js.map
43
+ //# sourceMappingURL=getSignedSessionId-DdslNjRv.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getSignedSessionId-CmrVr3iy.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-DdslNjRv.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-BcKzypsw.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CePaJzru.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-B4k_2uv2.cjs.map
31
+ //# sourceMappingURL=getWalletProviderByKey-BMsrnfN2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-B4k_2uv2.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-BMsrnfN2.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 { C as getWalletProviderFromWalletAccount, D as NoWalletProviderFoundError, K as setCookie, L as emitEvent, O as getWalletAccounts, S as DYNAMIC_AUTH_COOKIE_NAME, V as createApiClient, X as createStorageKeySchema, _t as getDefaultClient, at as CLIENT_SDK_NAME, bt as BaseError, dt as assertDefined, f as getWalletProviders, g as instrumentFunction, ot as DYNAMIC_LOGOUT_REASON_HEADER, q as getSecureCookieAttribute, ut as isCookieEnabled, xt as getCore } from "./updateAuthFromVerifyResponse-DphOSQfK.native.esm.js";
1
+ import { C as DYNAMIC_AUTH_COOKIE_NAME, H as createApiClient, J as getSecureCookieAttribute, O as NoWalletProviderFoundError, R as emitEvent, St as getCore, Z as createStorageKeySchema, _ as instrumentFunction, dt as isCookieEnabled, ft as assertDefined, k as getWalletAccounts, ot as CLIENT_SDK_NAME, p as getWalletProviders, q as setCookie, st as DYNAMIC_LOGOUT_REASON_HEADER, vt as getDefaultClient, w as getWalletProviderFromWalletAccount, xt as BaseError } from "./updateAuthFromVerifyResponse-Dd0q0rPX.native.esm.js";
2
2
  import * as z from "zod/mini";
3
3
 
4
4
  //#region src/utils/retryOnFail/InvalidRetryOnFailCallError.ts
@@ -276,4 +276,4 @@ const getWalletProviderByKey = ({ walletProviderKey }, client) => {
276
276
 
277
277
  //#endregion
278
278
  export { fetchProjectSettings as a, generateSessionKeys as i, getVerifiedCredentialForWalletAccount as n, isSignedIn as o, __logoutWithReason_wrapped as r, retryOnFail as s, getWalletProviderByKey as t };
279
- //# sourceMappingURL=getWalletProviderByKey-D2v00w6U.native.esm.js.map
279
+ //# sourceMappingURL=getWalletProviderByKey-BtcGKhh6.native.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-D2v00w6U.native.esm.js","names":["walletProvidersMap: Map<string, WalletProvider>","walletProvider"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>) => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @example\n * ```ts\n * if (isSignedIn()) {\n * console.log('User is authenticated or has a wallet connected');\n * }\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @see logout\n * @see isAnyWalletAccountConnected\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()) =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @example\n * ```ts\n * const settings = await fetchProjectSettings();\n * console.log('Enabled chains:', settings.chains);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @see createDynamicClient\n * @see initializeClient\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { DYNAMIC_LOGOUT_REASON_HEADER } from '../../apiClient/constants';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n // Forward the logout reason so the backend can attribute the revocation in\n // Datadog instead of it being inferred from downstream 401s.\n const apiClient = createApiClient(\n { headers: { [DYNAMIC_LOGOUT_REASON_HEADER]: reason } },\n client\n );\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\n};\n","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 === walletProvider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alletProviderByKey-BtcGKhh6.native.esm.js","names":["walletProvidersMap: Map<string, WalletProvider>","walletProvider"],"sources":["../src/utils/retryOnFail/InvalidRetryOnFailCallError.ts","../src/utils/retryOnFail/retryOnFail.ts","../src/modules/auth/isSignedIn/isSignedIn.ts","../src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.ts","../src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.ts","../src/modules/sessionKeys/generateSessionKeys/generateSessionKeys.ts","../src/modules/wallets/utils/getAvailableWalletProvidersFromWalletAccounts/getAvailableWalletProvidersFromWalletAccounts.ts","../src/modules/wallets/destroyWalletProviders/destroyWalletProviders.ts","../src/modules/auth/logoutWithReason/logoutWithReason.ts","../src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.ts","../src/modules/wallets/getWalletProviderByKey/getWalletProviderByKey.ts"],"sourcesContent":["import { BaseError } from '../../errors/base';\n\n/**\n * This error is thrown when the `retryOnFail` function is called with an invalid\n * number of retries (i.e. less than 0).\n */\nexport class InvalidRetryOnFailCallError extends BaseError {\n // eslint-disable-next-line custom-rules/require-single-object-param\n constructor(maxRetries: number) {\n super({\n cause: null,\n code: 'invalid_retry_on_fail_call_error',\n docsUrl: null,\n name: 'InvalidRetryOnFailCallError',\n shortMessage: `Invalid retries parameter for retryOnFail call: ${maxRetries}`,\n });\n }\n}\n","import { InvalidRetryOnFailCallError } from './InvalidRetryOnFailCallError';\n\nexport type RetryOnFailParams<T> = {\n /**\n * The delay between retries in milliseconds.\n */\n delay?: number;\n /**\n * The function to call.\n */\n fn: () => Promise<T>;\n /**\n * The maximum number of retries.\n *\n * When set to 0, the function will be called only once and is\n * therefore equivalent to calling the function directly.\n */\n maxRetries: number;\n};\n\n/** @notInstrumented */\nexport const retryOnFail = async <T>({\n delay = 0,\n fn,\n maxRetries,\n}: RetryOnFailParams<T>) => {\n for (let retry = 0; retry <= maxRetries; retry++) {\n try {\n return await fn();\n } catch (error) {\n if (retry >= maxRetries) {\n throw error;\n }\n\n if (delay > 0) {\n await new Promise((resolve) => setTimeout(resolve, delay));\n }\n }\n }\n\n /**\n * Reaching this point should never happen and this\n * error is thrown to help us debug the issue.\n */\n throw new InvalidRetryOnFailCallError(maxRetries);\n};\n","import { getDefaultClient } from '../../../client/defaultClient';\nimport { getWalletAccounts } from '../../wallets/getWalletAccounts';\n\n/**\n * Checks if the user is currently signed in to the Dynamic client.\n *\n * The client is considered to be in a signed in state if a user has\n * authenticated or if the client has at least one wallet connected.\n *\n * @deprecated What counts as \"signed in\" is your app's business logic, not the\n * SDK's. This helper bakes in one opinion (a user OR any connected wallet),\n * which rarely matches every app and forces a dependency on us for every\n * variation. Compose your own check from the underlying primitives instead —\n * e.g. `Boolean(client.user) || isAnyWalletAccountConnected(client)` — and\n * layer in whatever your app requires (device registration, completed\n * onboarding, satisfied MFA, a required embedded wallet, …). See the\n * \"Check if signed in\" guide:\n * https://www.dynamic.xyz/docs/javascript/user-session-management\n *\n * @example\n * ```ts\n * if (isSignedIn()) {\n * console.log('User is authenticated or has a wallet connected');\n * }\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns True if the user is signed in, false otherwise.\n * @see logout\n * @see isAnyWalletAccountConnected\n * @notInstrumented\n */\nexport const isSignedIn = (client = getDefaultClient()) =>\n Boolean(client.user || getWalletAccounts(client).length > 0);\n","import * as z from 'zod/mini';\n\nimport { createStorageKeySchema } from '../../../services/storage';\n\n/**\n * The schema to track the expiration time of the project settings.\n */\nexport const projectSettingsExpirationStorageKeySchema = createStorageKeySchema(\n {\n key: 'projectSettingsExpiration',\n schema: z.number(),\n }\n);\n","import { getCore } from '../../../client/core/getCore';\nimport { getDefaultClient } from '../../../client/defaultClient';\nimport { retryOnFail } from '../../../utils/retryOnFail';\nimport { createApiClient } from '../../apiClient';\nimport { CLIENT_SDK_NAME } from '../../apiClient/constants';\nimport { isSignedIn } from '../../auth/isSignedIn';\nimport { projectSettingsExpirationStorageKeySchema } from './projectSettingsExpirationScheme';\n\n/**\n * Expiration time of the project settings in milliseconds.\n */\nexport const PROJECT_SETTINGS_EXPIRATION_TIME = 1000 * 60 * 5; // 5 minutes\n\n/**\n * Fetches and updates the project settings from the API.\n *\n * This function retrieves the latest project configuration settings\n * from Dynamic's servers, including authentication options, enabled chains,\n * and security configurations. The settings are cached for performance.\n *\n * @example\n * ```ts\n * const settings = await fetchProjectSettings();\n * console.log('Enabled chains:', settings.chains);\n * ```\n *\n * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.\n * @returns A promise that resolves to the updated project settings.\n * @see createDynamicClient\n * @see initializeClient\n * @notInstrumented\n * @noHook Internal settings fetch that is not part of the public hook surface.\n */\nexport const fetchProjectSettings = async (client = getDefaultClient()) => {\n const core = getCore(client);\n\n const currentExpiration = await core.storage.getItem(\n projectSettingsExpirationStorageKeySchema\n );\n\n const hasProjectSettings = Boolean(client.projectSettings);\n const isExpired = currentExpiration && currentExpiration < Date.now();\n\n // We want to cache the project settings if its valid and user is connected.\n // This avoids unnecessary API calls and speeds up the initial load.\n if (hasProjectSettings && !isExpired && isSignedIn(client)) {\n return client.projectSettings;\n }\n\n const apiClient = createApiClient({}, client);\n\n core.logger.debug('[fetchProjectSettings] Fetching project settings...');\n\n const doFetch = async () =>\n apiClient.getEnvironmentSettings(\n {\n environmentId: core.environmentId,\n sdkVersion: `${CLIENT_SDK_NAME}/${core.version}`,\n },\n {\n credentials: 'omit',\n }\n );\n\n const projectSettings = await retryOnFail({\n fn: doFetch,\n maxRetries: 2,\n });\n\n core.state.set({ projectSettings: projectSettings ?? null });\n\n await core.storage.setItem(\n projectSettingsExpirationStorageKeySchema,\n Date.now() + PROJECT_SETTINGS_EXPIRATION_TIME\n );\n\n return projectSettings;\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types';\nimport { assertDefined } from '../../../utils/assertDefined';\nimport type { SessionKeys } from '../sessionKeys.types';\n\n/** @notInstrumented */\nexport const generateSessionKeys = async (\n client: DynamicClient\n): Promise<SessionKeys> => {\n const core = getCore(client);\n\n const currentState = core.state.get();\n\n const isRotation = Boolean(currentState.sessionKeys);\n\n const logContext = {\n environmentId: core.environmentId,\n operation: isRotation ? 'rotate' : 'create',\n userId: currentState.user?.id ?? null,\n };\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Rotating session key...'\n : '[generateSessionKeys] Creating session key...',\n logContext\n );\n\n await core.keychain.removeKey('session');\n\n const publicKey = await core.keychain.generateKey('session');\n\n assertDefined(publicKey, 'Public key not found');\n\n core.state.set({\n sessionKeys: publicKey,\n });\n\n core.logger.info(\n isRotation\n ? '[generateSessionKeys] Session key rotated'\n : '[generateSessionKeys] Session key created',\n logContext\n );\n\n return { publicKey };\n};\n","import { getCore } from '../../../../client/core/getCore';\nimport type { DynamicClient } from '../../../../client/types';\nimport { getWalletAccounts } from '../../getWalletAccounts';\nimport type { WalletProvider } from '../../walletProvider';\nimport { getWalletProviderFromWalletAccount } from '../getWalletProviderFromWalletAccount';\n\n/** @notInstrumented */\nexport const getAvailableWalletProvidersFromWalletAccounts = (\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProvidersMap: Map<string, WalletProvider> = new Map();\n\n const walletAccounts = getWalletAccounts(client);\n\n walletAccounts.forEach((walletAccount) => {\n if (walletProvidersMap.has(walletAccount.walletProviderKey)) {\n return;\n }\n\n try {\n const walletProvider = getWalletProviderFromWalletAccount(\n {\n walletAccount,\n },\n client\n );\n\n walletProvidersMap.set(walletAccount.walletProviderKey, walletProvider);\n } catch (error) {\n core.logger.debug('Wallet provider not found for wallet account', {\n error,\n walletAccount: walletAccount.address,\n });\n }\n });\n\n return Array.from(walletProvidersMap.values());\n};\n","import { getCore } from '../../../client/core/getCore';\nimport type { DynamicClient } from '../../../client/types/DynamicClient';\nimport type { LogoutReason } from '../../auth/logoutReason';\nimport { getAvailableWalletProvidersFromWalletAccounts } from '../utils/getAvailableWalletProvidersFromWalletAccounts';\n\n/**\n * Tear down every wallet provider on the client.\n *\n * Each provider's `destroy` is responsible for its own local + remote\n * cleanup. We swallow errors so a failing destroy on one provider does not\n * block teardown of the others (e.g. during logout).\n *\n * @notInstrumented\n */\nexport const destroyWalletProviders = async (\n { reason }: { reason?: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n const walletProviders = getAvailableWalletProvidersFromWalletAccounts(client);\n\n await Promise.all(\n walletProviders.map(async (walletProvider) => {\n if (!walletProvider.destroy) return;\n try {\n await walletProvider.destroy({ reason });\n } catch (err) {\n core.logger.error(\n `Error destroying wallet provider ${walletProvider.key}`,\n err\n );\n }\n })\n );\n};\n","import type { DynamicClient } from '../../../client/types';\nimport { getCore } from '../../../client/core/getCore';\nimport { getSecureCookieAttribute } from '../../../utils/getSecureCookieAttribute';\nimport { setCookie } from '../../../utils/setCookie';\nimport { createApiClient } from '../../apiClient';\nimport { DYNAMIC_LOGOUT_REASON_HEADER } from '../../apiClient/constants';\nimport { emitEvent } from '../../clientEvents';\nimport { fetchProjectSettings } from '../../projectSettings/fetchProjectSettings';\nimport { isCookieEnabled } from '../../projectSettings/isCookieEnabled';\nimport { generateSessionKeys } from '../../sessionKeys/generateSessionKeys';\nimport { destroyWalletProviders } from '../../wallets/destroyWalletProviders';\nimport { DYNAMIC_AUTH_COOKIE_NAME } from '../consts';\nimport type { LogoutReason } from '../logoutReason';\n\n/**\n * Logs the user out with an explicit reason.\n *\n * Revokes the session, clears auth state, terminates wallet providers, and\n * emits the `logout` client event with the given reason. The reason is also\n * captured as an argument on the function-instrumentation event, which is\n * how Datadog distinguishes between different logout causes.\n *\n * Use this instead of the public `logout` when triggering a logout from\n * internal or extension code — the caller owns the reason string, so the\n * telemetry correctly attributes *why* the logout happened.\n *\n * @param params - The logout params.\n * @param params.reason - Why the logout is being triggered. Extension authors\n * needing a reason outside the SDK catalog can cast with `as LogoutReason`.\n * @param client - The Dynamic client instance.\n * @instrumented\n */\nexport const logoutWithReason = async (\n { reason }: { reason: LogoutReason },\n client: DynamicClient\n) => {\n const core = getCore(client);\n\n core.logger.debug('[logoutWithReason] Logging out...', { reason });\n\n await destroyWalletProviders({ reason }, client);\n\n if (client.user !== null) {\n // Forward the logout reason so the backend can attribute the revocation in\n // Datadog instead of it being inferred from downstream 401s.\n const apiClient = createApiClient(\n { headers: { [DYNAMIC_LOGOUT_REASON_HEADER]: reason } },\n client\n );\n\n try {\n await apiClient.revokeSession({\n environmentId: core.environmentId,\n });\n } catch (error) {\n core.logger.error('Failed to revoke session', error);\n }\n\n /**\n * This deletes the auth cookie if it exists.\n * If the cookie doesn't exist, this sets a new cookie that expires immediately.\n */\n if (isCookieEnabled(client)) {\n // Match the Secure attribute used when the cookie was written so the\n // deletion cookie is accepted consistently in a secure context.\n const secureAttribute = getSecureCookieAttribute();\n\n setCookie(\n `${DYNAMIC_AUTH_COOKIE_NAME}=; Max-Age=-99999999; path=/; SameSite=Lax${secureAttribute}`\n );\n }\n }\n\n await core.keychain.removeKey('session');\n\n core.state.set({\n captchaToken: null,\n elevatedAccessTokens: [],\n legacyToken: null,\n mfaToken: null,\n sessionExpiresAt: null,\n sessionKeys: null,\n token: null,\n unverifiedWalletAccounts: [],\n user: null,\n });\n\n emitEvent({ args: { reason }, event: 'logout' }, client);\n\n // Refetch project settings\n void fetchProjectSettings(client);\n\n // Regenerate session keys\n void generateSessionKeys(client);\n};\n","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":";;;;;;;;AAMA,IAAa,8BAAb,cAAiD,UAAU;CAEzD,YAAY,YAAoB;AAC9B,QAAM;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,MAAM;GACN,cAAc,mDAAmD;GAClE,CAAC;;;;;;;ACMN,MAAa,cAAc,OAAU,EACnC,QAAQ,GACR,IACA,iBAC0B;AAC1B,MAAK,IAAI,QAAQ,GAAG,SAAS,YAAY,QACvC,KAAI;AACF,SAAO,MAAM,IAAI;UACV,OAAO;AACd,MAAI,SAAS,WACX,OAAM;AAGR,MAAI,QAAQ,EACV,OAAM,IAAI,SAAS,YAAY,WAAW,SAAS,MAAM,CAAC;;;;;;AAShE,OAAM,IAAI,4BAA4B,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACZnD,MAAa,cAAc,SAAS,kBAAkB,KACpD,QAAQ,OAAO,QAAQ,kBAAkB,OAAO,CAAC,SAAS,EAAE;;;;;;;AC1B9D,MAAa,4CAA4C,uBACvD;CACE,KAAK;CACL,QAAQ,EAAE,QAAQ;CACnB,CACF;;;;;;;ACDD,MAAa,mCAAmC,MAAO,KAAK;;;;;;;;;;;;;;;;;;;;;AAsB5D,MAAa,uBAAuB,OAAO,SAAS,kBAAkB,KAAK;CACzE,MAAM,OAAO,QAAQ,OAAO;CAE5B,MAAM,oBAAoB,MAAM,KAAK,QAAQ,QAC3C,0CACD;AAOD,KAL2B,QAAQ,OAAO,gBAAgB,IAKhC,EAJR,qBAAqB,oBAAoB,KA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C;;;;;;ACLH,MAAa,0BACX,EAAE,qBACF,WACG;CAGH,MAAM,iBAFkB,mBAAmB,OAAO,CAEX,MACpC,qBAAmBC,iBAAe,QAAQ,kBAC5C;AAED,KAAI,CAAC,eACH,OAAM,IAAI,2BAA2B,EAAE,mBAAmB,CAAC;AAG7D,QAAO"}
@@ -1,4 +1,4 @@
1
- import { D as NoWalletProviderFoundError, f as getWalletProviders } from "./updateAuthFromVerifyResponse-B3V0ynwL.esm.js";
1
+ import { O as NoWalletProviderFoundError, p as getWalletProviders } from "./updateAuthFromVerifyResponse-B42kkGLd.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-DEPcBE0p.esm.js.map
20
+ //# sourceMappingURL=getWalletProviderByKey-FfQmRcK1.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWalletProviderByKey-DEPcBE0p.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-FfQmRcK1.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-BcKzypsw.cjs');
2
- const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-D9YJPaN-.cjs');
3
- const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-CivDFwvA.cjs');
4
- const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-syj63-y3.cjs');
5
- const require_getWalletProviderByKey = require('./getWalletProviderByKey-B4k_2uv2.cjs');
6
- const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-BtFx8pFs.cjs');
1
+ const require_updateAuthFromVerifyResponse = require('./updateAuthFromVerifyResponse-CePaJzru.cjs');
2
+ const require_getNetworkProviderFromNetworkId = require('./getNetworkProviderFromNetworkId-BsmqXKF_.cjs');
3
+ const require_isDynamicWaasEnabled = require('./isDynamicWaasEnabled-DT4jhqkC.cjs');
4
+ const require_isUserOnboardingComplete = require('./isUserOnboardingComplete-DINsEIfi.cjs');
5
+ const require_getWalletProviderByKey = require('./getWalletProviderByKey-BMsrnfN2.cjs');
6
+ const require_isMfaRequiredForAction = require('./isMfaRequiredForAction-9ZrKcsTN.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");
@@ -407,6 +407,40 @@ var ClientAlreadyInitializedError = class extends require_updateAuthFromVerifyRe
407
407
  }
408
408
  };
409
409
 
410
+ //#endregion
411
+ //#region src/modules/initializeClient/logoutIfSessionPublicKeyMismatched/logoutIfSessionPublicKeyMismatched.ts
412
+ /**
413
+ * Signs the user out when the local session key no longer matches the
414
+ * `sessionPublicKey` claim carried by the current token.
415
+ *
416
+ * The claim is captured once at sign-in and carried forward unchanged on
417
+ * every token refresh (it is not re-derived from the client's current
418
+ * session key). If the local session key is regenerated afterwards — e.g. a
419
+ * re-init racing a token refresh, or storage being partially cleared — every
420
+ * subsequent request keeps signing with the new key while asserting the
421
+ * stale claim, and is rejected server-side with `invalid_nonce_signature`
422
+ * forever, since retrying never re-syncs the claim. Signing out forces a
423
+ * fresh sign-in, which is the only flow that re-captures the claim from the
424
+ * client's current key.
425
+ * @notInstrumented
426
+ */
427
+ const logoutIfSessionPublicKeyMismatched = async (client) => {
428
+ const core = require_updateAuthFromVerifyResponse.getCore(client);
429
+ const { sessionKeys, token } = core.state.get();
430
+ if (!sessionKeys || !token) return;
431
+ let tokenSessionPublicKey;
432
+ try {
433
+ ({sessionPublicKey: tokenSessionPublicKey} = require_updateAuthFromVerifyResponse.decodeJwt(token));
434
+ } catch (error) {
435
+ core.logger.error("[logoutIfSessionPublicKeyMismatched] Failed to decode token", error);
436
+ return;
437
+ }
438
+ if (tokenSessionPublicKey && tokenSessionPublicKey !== sessionKeys) {
439
+ core.logger.error("[logoutIfSessionPublicKeyMismatched] Session key does not match token claim");
440
+ await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "session-public-key-mismatch" }, client);
441
+ }
442
+ };
443
+
410
444
  //#endregion
411
445
  //#region src/modules/initializeClient/initializeClient.ts
412
446
  /**
@@ -460,6 +494,7 @@ const initializeClient = async (client = require_updateAuthFromVerifyResponse.ge
460
494
  storage: core.storage
461
495
  }).catch(() => require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "keychain-migration-failed" }, client));
462
496
  if (core.state.get().sessionKeys && !await core.keychain.hasKey("session")) await require_updateAuthFromVerifyResponse.__logoutWithReason_wrapped({ reason: "keychain-key-missing" }, client);
497
+ await logoutIfSessionPublicKeyMismatched(client);
463
498
  }).then(async () => {
464
499
  if (!core.state.get().projectSettings) await require_updateAuthFromVerifyResponse.fetchProjectSettings(client);
465
500
  });
@@ -4062,6 +4097,8 @@ const submitFlowTransaction = async ({ onStepChange, flowId, walletAccount, asse
4062
4097
  signingPayload,
4063
4098
  walletAccount
4064
4099
  }, client);
4100
+ require_updateAuthFromVerifyResponse.getCore(client).logger.debug("[submitFlowTransaction] transaction hash returned from swap transaction execution", { transactionHash });
4101
+ require_updateAuthFromVerifyResponse.assertDefined(transactionHash, "No transaction hash returned from transaction execution. Flow transaction may not have been executed successfully.");
4065
4102
  return __broadcastFlow_wrapped({
4066
4103
  flowId,
4067
4104
  txHash: transactionHash