@dynamic-labs-sdk/client 0.1.0-alpha.9 → 0.1.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 (314) hide show
  1. package/CHANGELOG.md +302 -0
  2. package/InvalidParamError.cjs.js +2 -2
  3. package/InvalidParamError.esm.js +1 -1
  4. package/NotWaasWalletAccountError.cjs.js +7 -7
  5. package/NotWaasWalletAccountError.esm.js +2 -2
  6. package/constants.cjs.js +493 -9
  7. package/constants.cjs2.js +15 -0
  8. package/constants.esm.js +468 -7
  9. package/constants.esm2.js +11 -0
  10. package/core.cjs.js +96 -41
  11. package/core.esm.js +47 -10
  12. package/filterDuplicates.cjs.js +8 -0
  13. package/filterDuplicates.esm.js +6 -0
  14. package/getNetworkProviderFromNetworkId.cjs.js +178 -20
  15. package/getNetworkProviderFromNetworkId.esm.js +150 -3
  16. package/getSignedSessionId.cjs.js +7 -7
  17. package/getSignedSessionId.esm.js +2 -2
  18. package/getVerifiedCredentialForWalletAccount.cjs.js +515 -0
  19. package/getVerifiedCredentialForWalletAccount.esm.js +491 -0
  20. package/index.cjs.js +1231 -470
  21. package/index.esm.js +1028 -280
  22. package/isMfaRequiredForAction.cjs.js +15 -8
  23. package/isMfaRequiredForAction.esm.js +8 -2
  24. package/package.json +4 -4
  25. package/src/client/core/createCore/createCore.d.ts.map +1 -1
  26. package/src/client/core/createCore/getInitialState.d.ts.map +1 -1
  27. package/src/client/core/types/DynamicCore.d.ts +8 -0
  28. package/src/client/core/types/DynamicCore.d.ts.map +1 -1
  29. package/src/client/createDynamicClient/createDynamicClient.d.ts.map +1 -1
  30. package/src/client/types/DynamicClientConfig.d.ts +6 -1
  31. package/src/client/types/DynamicClientConfig.d.ts.map +1 -1
  32. package/src/constants.d.ts +1 -0
  33. package/src/constants.d.ts.map +1 -1
  34. package/src/errors/APIError/APIError.d.ts.map +1 -1
  35. package/src/errors/InvalidWalletProviderKeyError.d.ts +5 -0
  36. package/src/errors/InvalidWalletProviderKeyError.d.ts.map +1 -0
  37. package/src/errors/MissingUserVerificationError.d.ts +12 -0
  38. package/src/errors/MissingUserVerificationError.d.ts.map +1 -0
  39. package/src/errors/NoSmartWalletAccountSignerFoundError.d.ts +5 -0
  40. package/src/errors/NoSmartWalletAccountSignerFoundError.d.ts.map +1 -0
  41. package/src/errors/WalletAccountNotSelectedError.d.ts.map +1 -1
  42. package/src/exports/core.d.ts +102 -2
  43. package/src/exports/core.d.ts.map +1 -1
  44. package/src/exports/index.d.ts +25 -7
  45. package/src/exports/index.d.ts.map +1 -1
  46. package/src/exports/waas.d.ts +2 -0
  47. package/src/exports/waas.d.ts.map +1 -1
  48. package/src/modules/apiClient/createApiClient.d.ts.map +1 -1
  49. package/src/modules/auth/createVisit/createVisit.d.ts.map +1 -1
  50. package/src/modules/auth/logout/logout.d.ts.map +1 -1
  51. package/src/modules/auth/passkeys/getPasskeyAuthenticationOptions/getPasskeyAuthenticationOptions.d.ts +4 -1
  52. package/src/modules/auth/passkeys/getPasskeyAuthenticationOptions/getPasskeyAuthenticationOptions.d.ts.map +1 -1
  53. package/src/modules/auth/passkeys/getPasskeyAuthenticationSignInOptions/getPasskeyAuthenticationSignInOptions.d.ts +4 -1
  54. package/src/modules/auth/passkeys/getPasskeyAuthenticationSignInOptions/getPasskeyAuthenticationSignInOptions.d.ts.map +1 -1
  55. package/src/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts +4 -1
  56. package/src/modules/auth/passkeys/signInWithPasskey/signInWithPasskey.d.ts.map +1 -1
  57. package/src/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts +9 -0
  58. package/src/modules/auth/social/getUserSocialAccounts/getUserSocialAccounts.d.ts.map +1 -0
  59. package/src/modules/auth/social/getUserSocialAccounts/index.d.ts +2 -0
  60. package/src/modules/auth/social/getUserSocialAccounts/index.d.ts.map +1 -0
  61. package/src/modules/auth/social/oauth/{signInWithSocialRedirect/signInWithSocialRedirect.d.ts → authenticateWithSocial/authenticateWithSocial.d.ts} +5 -3
  62. package/src/modules/auth/social/oauth/authenticateWithSocial/authenticateWithSocial.d.ts.map +1 -0
  63. package/src/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts.map +1 -0
  64. package/src/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/addOAuthUrlParams/index.d.ts.map +1 -0
  65. package/src/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/buildOAuthUrl.d.ts.map +1 -0
  66. package/src/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +1 -0
  67. package/src/modules/auth/social/oauth/authenticateWithSocial/buildOAuthUrl/getOAuthBaseUrl/index.d.ts.map +1 -0
  68. package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/index.d.ts.map +1 -1
  69. package/src/modules/auth/social/oauth/authenticateWithSocial/index.d.ts +2 -0
  70. package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/index.d.ts.map +1 -1
  71. package/src/modules/auth/social/oauth/{completeSocialRedirectSignIn/completeSocialRedirectSignIn.d.ts → completeSocialAuthentication/completeSocialAuthentication.d.ts} +3 -3
  72. package/src/modules/auth/social/oauth/completeSocialAuthentication/completeSocialAuthentication.d.ts.map +1 -0
  73. package/src/modules/auth/social/oauth/completeSocialAuthentication/index.d.ts +2 -0
  74. package/src/modules/auth/social/oauth/{completeSocialRedirectSignIn → completeSocialAuthentication}/index.d.ts.map +1 -1
  75. package/src/modules/auth/social/oauth/redirectStateStorageSchema/index.d.ts +1 -1
  76. package/src/modules/auth/social/oauth/redirectStateStorageSchema/index.d.ts.map +1 -1
  77. package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts +1 -1
  78. package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts.map +1 -1
  79. package/src/modules/auth/social/oauth/unlinkSocialAccount/index.d.ts +2 -0
  80. package/src/modules/auth/social/oauth/unlinkSocialAccount/index.d.ts.map +1 -0
  81. package/src/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts +14 -0
  82. package/src/modules/auth/social/oauth/unlinkSocialAccount/unlinkSocialAccount.d.ts.map +1 -0
  83. package/src/modules/auth/social/removeDynamicOauthParamsFromUrl/index.d.ts +2 -0
  84. package/src/modules/auth/social/removeDynamicOauthParamsFromUrl/index.d.ts.map +1 -0
  85. package/src/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.d.ts +2 -0
  86. package/src/modules/auth/social/removeDynamicOauthParamsFromUrl/removeDynamicOauthParamsFromUrl.d.ts.map +1 -0
  87. package/src/modules/auth/social/social.types.d.ts +9 -0
  88. package/src/modules/auth/social/social.types.d.ts.map +1 -1
  89. package/src/modules/auth/updateAuthFromVerifyResponse/checkAndRaiseWalletAccountsChangedEvent/checkAndRaiseWalletAccountsChangedEvent.d.ts.map +1 -1
  90. package/src/modules/auth/updateAuthFromVerifyResponse/updateAuthFromVerifyResponse.d.ts.map +1 -1
  91. package/src/modules/balances/getMultichainBalances/getMultichainBalances.d.ts +1 -2
  92. package/src/modules/balances/getMultichainBalances/getMultichainBalances.d.ts.map +1 -1
  93. package/src/modules/balances/getMultichainBalances/index.d.ts +1 -1
  94. package/src/modules/balances/getMultichainBalances/index.d.ts.map +1 -1
  95. package/src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts +18 -0
  96. package/src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/addCoinbaseOnrampOrderEventListener.d.ts.map +1 -0
  97. package/src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/index.d.ts +2 -0
  98. package/src/modules/funding/coinbase/addCoinbaseOnrampOrderEventListener/index.d.ts.map +1 -0
  99. package/src/modules/funding/coinbase/coinbase.types.d.ts +269 -0
  100. package/src/modules/funding/coinbase/coinbase.types.d.ts.map +1 -0
  101. package/src/modules/funding/coinbase/createCoinbaseOnrampOrder/createCoinbaseOnrampOrder.d.ts +11 -0
  102. package/src/modules/funding/coinbase/createCoinbaseOnrampOrder/createCoinbaseOnrampOrder.d.ts.map +1 -0
  103. package/src/modules/funding/coinbase/createCoinbaseOnrampOrder/index.d.ts +2 -0
  104. package/src/modules/funding/coinbase/createCoinbaseOnrampOrder/index.d.ts.map +1 -0
  105. package/src/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts +10 -0
  106. package/src/modules/funding/coinbase/getCoinbaseBuyUrl/getCoinbaseBuyUrl.d.ts.map +1 -0
  107. package/src/modules/funding/coinbase/getCoinbaseBuyUrl/index.d.ts +2 -0
  108. package/src/modules/funding/coinbase/getCoinbaseBuyUrl/index.d.ts.map +1 -0
  109. package/src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.d.ts +23 -0
  110. package/src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/getMissingVerificationForCoinbaseOnrampOrder.d.ts.map +1 -0
  111. package/src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/index.d.ts +2 -0
  112. package/src/modules/funding/coinbase/getMissingVerificationForCoinbaseOnrampOrder/index.d.ts.map +1 -0
  113. package/src/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/index.d.ts +2 -0
  114. package/src/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/index.d.ts.map +1 -0
  115. package/src/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts +4 -0
  116. package/src/modules/funding/coinbase/utils/validateUserCredentialsForCoinbaseOnrampOrder/validateUserCredentialsForCoinbaseOnrampOrder.d.ts.map +1 -0
  117. package/src/modules/funding/cryptoDotCom/createCryptoDotComPayment/createCryptoDotComPayment.d.ts +10 -0
  118. package/src/modules/funding/cryptoDotCom/createCryptoDotComPayment/createCryptoDotComPayment.d.ts.map +1 -0
  119. package/src/modules/funding/cryptoDotCom/createCryptoDotComPayment/index.d.ts +2 -0
  120. package/src/modules/funding/cryptoDotCom/createCryptoDotComPayment/index.d.ts.map +1 -0
  121. package/src/modules/funding/cryptoDotCom/cryptoDotCom.types.d.ts +8 -0
  122. package/src/modules/funding/cryptoDotCom/cryptoDotCom.types.d.ts.map +1 -0
  123. package/src/modules/initializeClient/consts.d.ts +5 -0
  124. package/src/modules/initializeClient/consts.d.ts.map +1 -0
  125. package/src/modules/initializeClient/initializeClient.d.ts.map +1 -1
  126. package/src/modules/initializeClient/waitForProjectSettings/index.d.ts +2 -0
  127. package/src/modules/initializeClient/waitForProjectSettings/index.d.ts.map +1 -0
  128. package/src/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts +3 -0
  129. package/src/modules/initializeClient/waitForProjectSettings/waitForProjectSettings.d.ts.map +1 -0
  130. package/src/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts +2 -1
  131. package/src/modules/mfa/authenticatePasskeyMFA/authenticatePasskeyMFA.d.ts.map +1 -1
  132. package/src/modules/otp/verifyOTP/verifyOTP.d.ts +3 -2
  133. package/src/modules/otp/verifyOTP/verifyOTP.d.ts.map +1 -1
  134. package/src/modules/projectSettings/fetchProjectSettings/fetchProjectSettings.d.ts.map +1 -1
  135. package/src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts +1 -1
  136. package/src/modules/projectSettings/fetchProjectSettings/projectSettingsExpirationScheme.d.ts.map +1 -1
  137. package/src/modules/storageSync/hydrateStateWithStorage/hydrateStateWithStorage.d.ts.map +1 -1
  138. package/src/modules/storageSync/schema.d.ts +15 -2
  139. package/src/modules/storageSync/schema.d.ts.map +1 -1
  140. package/src/modules/storageSync/syncStateWithStorage/syncStateWithStorage.d.ts.map +1 -1
  141. package/src/modules/user/deleteUser/deleteUser.d.ts +11 -0
  142. package/src/modules/user/deleteUser/deleteUser.d.ts.map +1 -0
  143. package/src/modules/user/deleteUser/index.d.ts +2 -0
  144. package/src/modules/user/deleteUser/index.d.ts.map +1 -0
  145. package/src/modules/waas/constants.d.ts +2 -2
  146. package/src/modules/waas/constants.d.ts.map +1 -1
  147. package/src/modules/waas/createWaasProvider/createWaasProvider.d.ts.map +1 -1
  148. package/src/modules/waas/createWaasWalletAccounts/createWaasWalletAccounts.d.ts.map +1 -1
  149. package/src/modules/waas/delegateWaasKeyShares/delegateWaasKeyShares.d.ts.map +1 -1
  150. package/src/modules/waas/getWaasWalletProviderByChain/getWaasWalletProviderByChain.d.ts.map +1 -1
  151. package/src/modules/waas/hasDelegatedAccess/hasDelegatedAccess.d.ts +14 -0
  152. package/src/modules/waas/hasDelegatedAccess/hasDelegatedAccess.d.ts.map +1 -0
  153. package/src/modules/waas/hasDelegatedAccess/index.d.ts +2 -0
  154. package/src/modules/waas/hasDelegatedAccess/index.d.ts.map +1 -0
  155. package/src/modules/waas/isWaasWalletAccount/isWaasWalletAccount.d.ts.map +1 -1
  156. package/src/modules/waas/isWaasWalletProvider/isWaasWalletProvider.d.ts.map +1 -1
  157. package/src/modules/waas/revokeWaasDelegation/index.d.ts +2 -0
  158. package/src/modules/waas/revokeWaasDelegation/index.d.ts.map +1 -0
  159. package/src/modules/waas/revokeWaasDelegation/revokeWaasDelegation.d.ts +16 -0
  160. package/src/modules/waas/revokeWaasDelegation/revokeWaasDelegation.d.ts.map +1 -0
  161. package/src/modules/waas/waas.types.d.ts +4 -0
  162. package/src/modules/waas/waas.types.d.ts.map +1 -1
  163. package/src/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts +4 -3
  164. package/src/modules/wallets/connectWithWalletProvider/connectWithWalletProvider.d.ts.map +1 -1
  165. package/src/modules/wallets/constants.d.ts.map +1 -1
  166. package/src/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts +2 -6
  167. package/src/modules/wallets/getAvailableWalletProvidersData/getAvailableWalletProvidersData.d.ts.map +1 -1
  168. package/src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts +7 -0
  169. package/src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/getOwnerWalletAccountForSmartWalletAccount.d.ts.map +1 -0
  170. package/src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/index.d.ts +2 -0
  171. package/src/modules/wallets/getOwnerWalletAccountForSmartWalletAccount/index.d.ts.map +1 -0
  172. package/src/modules/wallets/getWalletAccountAddressByType/getWalletAccountAddressByType.d.ts +8 -0
  173. package/src/modules/wallets/getWalletAccountAddressByType/getWalletAccountAddressByType.d.ts.map +1 -0
  174. package/src/modules/wallets/getWalletAccountAddressByType/index.d.ts +2 -0
  175. package/src/modules/wallets/getWalletAccountAddressByType/index.d.ts.map +1 -0
  176. package/src/modules/wallets/getWalletAccounts/getWalletAccounts.d.ts.map +1 -1
  177. package/src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts +9 -1
  178. package/src/modules/wallets/getWalletAccounts/getWalletAccountsFromState/getWalletAccountsFromState.d.ts.map +1 -1
  179. package/src/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts +14 -0
  180. package/src/modules/wallets/getWalletProviderDataByKey/getWalletProviderDataByKey.d.ts.map +1 -0
  181. package/src/modules/wallets/getWalletProviderDataByKey/index.d.ts +2 -0
  182. package/src/modules/wallets/getWalletProviderDataByKey/index.d.ts.map +1 -0
  183. package/src/modules/wallets/isWalletAccountVerified/index.d.ts +2 -0
  184. package/src/modules/wallets/isWalletAccountVerified/index.d.ts.map +1 -0
  185. package/src/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts +13 -0
  186. package/src/modules/wallets/isWalletAccountVerified/isWalletAccountVerified.d.ts.map +1 -0
  187. package/src/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts +10 -0
  188. package/src/modules/wallets/networks/getNetworkDataForNetworkId/getNetworkDataForNetworkId.d.ts.map +1 -0
  189. package/src/modules/wallets/networks/getNetworkDataForNetworkId/index.d.ts +2 -0
  190. package/src/modules/wallets/networks/getNetworkDataForNetworkId/index.d.ts.map +1 -0
  191. package/src/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts +26 -0
  192. package/src/modules/wallets/networks/getTransactionHistory/getTransactionHistory.d.ts.map +1 -0
  193. package/src/modules/wallets/networks/getTransactionHistory/index.d.ts +3 -0
  194. package/src/modules/wallets/networks/getTransactionHistory/index.d.ts.map +1 -0
  195. package/src/modules/wallets/networks/lastKnownNetworkRegistry/createLastKnownNetworkRegistry/createLastKnownNetworkRegistry.d.ts.map +1 -1
  196. package/src/modules/wallets/networks/lastKnownNetworkRegistry/createLastKnownNetworkRegistry/schema.d.ts +1 -1
  197. package/src/modules/wallets/networks/lastKnownNetworkRegistry/createLastKnownNetworkRegistry/schema.d.ts.map +1 -1
  198. package/src/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts +1 -1
  199. package/src/modules/wallets/proveWalletAccountOwnership/proveWalletAccountOwnership.d.ts.map +1 -1
  200. package/src/modules/wallets/removeWalletAccount/removeWalletAccount.d.ts.map +1 -1
  201. package/src/modules/wallets/unverifiedWalletAccounts/removeUnverifiedWalletAccount/removeUnverifiedWalletAccount.d.ts.map +1 -1
  202. package/src/modules/wallets/unverifiedWalletAccounts/schema.d.ts +5 -0
  203. package/src/modules/wallets/unverifiedWalletAccounts/schema.d.ts.map +1 -1
  204. package/src/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.d.ts +2 -0
  205. package/src/modules/wallets/unverifiedWalletAccounts/setUnverifiedWalletAccounts/setUnverifiedWalletAccounts.d.ts.map +1 -1
  206. package/src/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.d.ts +5 -1
  207. package/src/modules/wallets/utils/convertUnverifiedWalletAccountToWalletAccount/convertUnverifiedWalletAccountToWalletAccount.d.ts.map +1 -1
  208. package/src/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts +6 -1
  209. package/src/modules/wallets/utils/convertVerifiedCredentialToWalletAccount/convertVerifiedCredentialToWalletAccount.d.ts.map +1 -1
  210. package/src/modules/wallets/utils/formatSignInMessage/formatSignInMessage.d.ts +9 -7
  211. package/src/modules/wallets/utils/formatSignInMessage/formatSignInMessage.d.ts.map +1 -1
  212. package/src/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.d.ts +9 -0
  213. package/src/modules/wallets/utils/formatWalletAccountId/formatWalletAccountId.d.ts.map +1 -0
  214. package/src/modules/wallets/utils/formatWalletAccountId/index.d.ts +2 -0
  215. package/src/modules/wallets/utils/formatWalletAccountId/index.d.ts.map +1 -0
  216. package/src/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.d.ts +17 -2
  217. package/src/modules/wallets/utils/formatWalletProviderKey/formatWalletProviderKey.d.ts.map +1 -1
  218. package/src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.d.ts +4 -0
  219. package/src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/getAddressesWithTypesFromConnectionResult.d.ts.map +1 -0
  220. package/src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/index.d.ts +2 -0
  221. package/src/modules/wallets/utils/getAddressesWithTypesFromConnectionResult/index.d.ts.map +1 -0
  222. package/src/modules/wallets/utils/getChainIdForAccountVerification/getChainIdForAccountVerification.d.ts.map +1 -1
  223. package/src/modules/wallets/utils/getInjectedProviderFromWindow/getInjectedProviderFromWindow.d.ts +2 -0
  224. package/src/modules/wallets/utils/getInjectedProviderFromWindow/getInjectedProviderFromWindow.d.ts.map +1 -0
  225. package/src/modules/wallets/utils/getInjectedProviderFromWindow/index.d.ts +2 -0
  226. package/src/modules/wallets/utils/getInjectedProviderFromWindow/index.d.ts.map +1 -0
  227. package/src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts +3 -0
  228. package/src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/createSignInMessageStatement.d.ts.map +1 -0
  229. package/src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/index.d.ts +2 -0
  230. package/src/modules/wallets/utils/getSignInMessage/createSignInMessageStatement/index.d.ts.map +1 -0
  231. package/src/modules/wallets/utils/getSignInMessage/getSignInMessage.d.ts.map +1 -1
  232. package/src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts +8 -0
  233. package/src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/getVerifiedCredentialForWalletAccount.d.ts.map +1 -0
  234. package/src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/index.d.ts +2 -0
  235. package/src/modules/wallets/utils/getVerifiedCredentialForWalletAccount/index.d.ts.map +1 -0
  236. package/src/modules/wallets/utils/normalizeWalletNameWithChain/index.d.ts +2 -0
  237. package/src/modules/wallets/utils/normalizeWalletNameWithChain/index.d.ts.map +1 -0
  238. package/src/modules/wallets/utils/normalizeWalletNameWithChain/normalizeWalletNameWithChain.d.ts +12 -0
  239. package/src/modules/wallets/utils/normalizeWalletNameWithChain/normalizeWalletNameWithChain.d.ts.map +1 -0
  240. package/src/modules/wallets/verifySignInMessage/index.d.ts +2 -0
  241. package/src/modules/wallets/verifySignInMessage/index.d.ts.map +1 -0
  242. package/src/modules/wallets/verifySignInMessage/verifySignInMessage.d.ts +22 -0
  243. package/src/modules/wallets/verifySignInMessage/verifySignInMessage.d.ts.map +1 -0
  244. package/src/modules/wallets/verifyWalletAccount/verifyWalletAccount.d.ts.map +1 -1
  245. package/src/modules/wallets/walletAccount/index.d.ts +1 -1
  246. package/src/modules/wallets/walletAccount/index.d.ts.map +1 -1
  247. package/src/modules/wallets/walletAccount/walletAccount.types.d.ts +8 -0
  248. package/src/modules/wallets/walletAccount/walletAccount.types.d.ts.map +1 -1
  249. package/src/modules/wallets/walletProvider/index.d.ts +1 -1
  250. package/src/modules/wallets/walletProvider/index.d.ts.map +1 -1
  251. package/src/modules/wallets/walletProvider/splitWalletProviderKey/index.d.ts +2 -0
  252. package/src/modules/wallets/walletProvider/splitWalletProviderKey/index.d.ts.map +1 -0
  253. package/src/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.d.ts +9 -0
  254. package/src/modules/wallets/walletProvider/splitWalletProviderKey/splitWalletProviderKey.d.ts.map +1 -0
  255. package/src/modules/wallets/walletProvider/walletProvider.types.d.ts +24 -8
  256. package/src/modules/wallets/walletProvider/walletProvider.types.d.ts.map +1 -1
  257. package/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.d.ts +10 -0
  258. package/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.d.ts.map +1 -0
  259. package/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/index.d.ts +2 -0
  260. package/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/index.d.ts.map +1 -0
  261. package/src/modules/wallets/walletProvider/walletProviderKeyMap/schema.d.ts +3 -0
  262. package/src/modules/wallets/walletProvider/walletProviderKeyMap/schema.d.ts.map +1 -0
  263. package/src/modules/wallets/walletProvider/walletProviderKeyMap/state.d.ts +16 -0
  264. package/src/modules/wallets/walletProvider/walletProviderKeyMap/state.d.ts.map +1 -0
  265. package/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/index.d.ts +2 -0
  266. package/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/index.d.ts.map +1 -0
  267. package/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts +7 -0
  268. package/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.d.ts.map +1 -0
  269. package/src/modules/wallets/walletProvider/walletProviderKeyMap/walletProviderKeyMap.types.d.ts +12 -0
  270. package/src/modules/wallets/walletProvider/walletProviderKeyMap/walletProviderKeyMap.types.d.ts.map +1 -0
  271. package/src/services/asyncTrack/asyncTrack.types.d.ts +5 -1
  272. package/src/services/asyncTrack/asyncTrack.types.d.ts.map +1 -1
  273. package/src/services/asyncTrack/createAsyncTrack.d.ts.map +1 -1
  274. package/src/services/storage/index.d.ts +1 -1
  275. package/src/services/storage/index.d.ts.map +1 -1
  276. package/src/utils/debouncedMutex/createDebouncedMutex/createDebouncedMutex.d.ts +3 -0
  277. package/src/utils/debouncedMutex/createDebouncedMutex/createDebouncedMutex.d.ts.map +1 -0
  278. package/src/utils/debouncedMutex/createDebouncedMutex/index.d.ts +2 -0
  279. package/src/utils/debouncedMutex/createDebouncedMutex/index.d.ts.map +1 -0
  280. package/src/utils/debouncedMutex/debouncedMutex.types.d.ts +39 -0
  281. package/src/utils/debouncedMutex/debouncedMutex.types.d.ts.map +1 -0
  282. package/src/utils/debouncedMutex/index.d.ts +2 -0
  283. package/src/utils/debouncedMutex/index.d.ts.map +1 -0
  284. package/waas.cjs.js +86 -38
  285. package/waas.esm.js +62 -16
  286. package/waasCore.cjs.js +21 -10
  287. package/waasCore.esm.js +15 -4
  288. package/getWalletProviderByKey.cjs.js +0 -74
  289. package/getWalletProviderByKey.esm.js +0 -69
  290. package/logout.cjs.js +0 -1086
  291. package/logout.esm.js +0 -1020
  292. package/src/modules/apiClient/utils/logoutOnUnauthorizedRequestMiddleware/index.d.ts +0 -2
  293. package/src/modules/apiClient/utils/logoutOnUnauthorizedRequestMiddleware/index.d.ts.map +0 -1
  294. package/src/modules/apiClient/utils/logoutOnUnauthorizedRequestMiddleware/logoutOnUnauthorizedRequestMiddleware.d.ts +0 -4
  295. package/src/modules/apiClient/utils/logoutOnUnauthorizedRequestMiddleware/logoutOnUnauthorizedRequestMiddleware.d.ts.map +0 -1
  296. package/src/modules/auth/social/oauth/completeSocialRedirectSignIn/completeSocialRedirectSignIn.d.ts.map +0 -1
  297. package/src/modules/auth/social/oauth/completeSocialRedirectSignIn/index.d.ts +0 -2
  298. package/src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts.map +0 -1
  299. package/src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/addOAuthUrlParams/index.d.ts.map +0 -1
  300. package/src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/buildOAuthUrl.d.ts.map +0 -1
  301. package/src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts.map +0 -1
  302. package/src/modules/auth/social/oauth/signInWithSocialRedirect/buildOAuthUrl/getOAuthBaseUrl/index.d.ts.map +0 -1
  303. package/src/modules/auth/social/oauth/signInWithSocialRedirect/index.d.ts +0 -2
  304. package/src/modules/auth/social/oauth/signInWithSocialRedirect/signInWithSocialRedirect.d.ts.map +0 -1
  305. package/src/modules/wallets/utils/createWalletAccountId/createWalletAccountId.d.ts +0 -3
  306. package/src/modules/wallets/utils/createWalletAccountId/createWalletAccountId.d.ts.map +0 -1
  307. package/src/modules/wallets/utils/createWalletAccountId/index.d.ts +0 -2
  308. package/src/modules/wallets/utils/createWalletAccountId/index.d.ts.map +0 -1
  309. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/addOAuthUrlParams/addOAuthUrlParams.d.ts +0 -0
  310. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/addOAuthUrlParams/index.d.ts +0 -0
  311. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/buildOAuthUrl.d.ts +0 -0
  312. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/getOAuthBaseUrl/getOAuthBaseUrl.d.ts +0 -0
  313. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/getOAuthBaseUrl/index.d.ts +0 -0
  314. /package/src/modules/auth/social/oauth/{signInWithSocialRedirect → authenticateWithSocial}/buildOAuthUrl/index.d.ts +0 -0
@@ -2,7 +2,7 @@ import type { WalletProviderEnum } from '@dynamic-labs/sdk-api-core';
2
2
  import type EventEmitter from 'eventemitter3';
3
3
  import type { Chain } from '../../chain';
4
4
  import type { NetworkData } from '../networks/networkProvider/networkProvider.types';
5
- import type { WalletAccount } from '../walletAccount';
5
+ import type { WalletAccount, WalletAddressType } from '../walletAccount';
6
6
  import type { WalletProviderEvents } from './events/walletProviderEvents.types';
7
7
  export type WalletProviderMetadata = {
8
8
  /**
@@ -36,6 +36,19 @@ export type WalletProviderData = {
36
36
  * The metadata of the wallet provider like icon and display name
37
37
  */
38
38
  metadata: WalletProviderMetadata;
39
+ /**
40
+ * The type of the wallet provider.
41
+ * This is used to identify the wallet provider type in the backend (browser extension, wallet connect, etc.)
42
+ */
43
+ walletProviderType: WalletProviderEnum;
44
+ };
45
+ export type WalletProviderConnectAddress = {
46
+ address: string;
47
+ publicKey?: string;
48
+ type?: WalletAddressType;
49
+ };
50
+ export type WalletProviderConnectResult = {
51
+ addresses: WalletProviderConnectAddress[];
39
52
  };
40
53
  export type WalletProvider = WalletProviderData & {
41
54
  /**
@@ -48,14 +61,21 @@ export type WalletProvider = WalletProviderData & {
48
61
  * Connects the dapp to the wallet provider
49
62
  * This is optional for some wallet providers like Dynamic Waas
50
63
  */
51
- connect?: () => Promise<{
52
- addresses: string[];
53
- }>;
64
+ connect?: () => Promise<WalletProviderConnectResult>;
54
65
  /**
55
66
  * Disconnects the dapp from the wallet provider.
56
67
  * This is optional for some wallet providers like Dynamic Waas.
57
68
  */
58
69
  disconnect?: () => Promise<void>;
70
+ /**
71
+ * Performs clean up for when a wallet account is removed.
72
+ *
73
+ * For example: WalletConnect needs to actually close the entire WC session and clean up
74
+ * the related wallet providers.
75
+ */
76
+ disconnectWalletAccount?: (args: {
77
+ walletAccount: WalletAccount;
78
+ }) => Promise<void>;
59
79
  /**
60
80
  * Emitter of events that can be listened to for the wallet provider
61
81
  */
@@ -77,10 +97,6 @@ export type WalletProvider = WalletProviderData & {
77
97
  getConnectedAddresses: () => Promise<{
78
98
  addresses: string[];
79
99
  }>;
80
- /**
81
- * Gets the wallet provider type
82
- */
83
- getWalletProviderType: () => WalletProviderEnum;
84
100
  /**
85
101
  * Signs a message with the wallet account
86
102
  * This is optional, as weirdly some providers don't support this
@@ -1 +1 @@
1
- {"version":3,"file":"walletProvider.types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,sBAAsB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACjD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,GAAG;QAC5C;;WAEG;QACH,eAAe,EAAE,CAAC,MAAM,oBAAoB,CAAC,EAAE,CAAC;KACjD,CAAC;IACF;;OAEG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzD;;OAEG;IACH,qBAAqB,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC9D;;OAEG;IACH,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;IAChD;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,KAAK,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrC;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC"}
1
+ {"version":3,"file":"walletProvider.types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,QAAQ,EAAE,sBAAsB,CAAC;IACjC;;;OAGG;IACH,kBAAkB,EAAE,kBAAkB,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,4BAA4B,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACrD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE;QAC/B,aAAa,EAAE,aAAa,CAAC;KAC9B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB;;OAEG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,GAAG;QAC5C;;WAEG;QACH,eAAe,EAAE,CAAC,MAAM,oBAAoB,CAAC,EAAE,CAAC;KACjD,CAAC;IACF;;OAEG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzD;;OAEG;IACH,qBAAqB,EAAE,MAAM,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC9D;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B,KAAK,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrC;;OAEG;IACH,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
2
+ import type { DynamicClient } from '../../../../../client/types';
3
+ type GetWalletProviderKeyFromVerifiedCredentialParams = {
4
+ verifiedCredential: JwtVerifiedCredential;
5
+ };
6
+ export declare const getWalletProviderKeyFromVerifiedCredential: ({ verifiedCredential }: GetWalletProviderKeyFromVerifiedCredentialParams, client: DynamicClient) => {
7
+ walletProviderKey: string;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=getWalletProviderKeyFromVerifiedCredential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWalletProviderKeyFromVerifiedCredential.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/getWalletProviderKeyFromVerifiedCredential.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAKjE,KAAK,gDAAgD,GAAG;IACtD,kBAAkB,EAAE,qBAAqB,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,0CAA0C,2BAC7B,gDAAgD,UAChE,aAAa;;CAiDtB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getWalletProviderKeyFromVerifiedCredential } from './getWalletProviderKeyFromVerifiedCredential';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/getWalletProviderKeyFromVerifiedCredential/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,EAAE,MAAM,8CAA8C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import * as z from 'zod/mini';
2
+ export declare const walletProviderKeyMapSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniString<string>>;
3
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,eAAO,MAAM,0BAA0B,mEAAmC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { WalletProviderKeyMap } from './walletProviderKeyMap.types';
2
+ declare global {
3
+ interface DynamicCoreState {
4
+ /**
5
+ * Keeps records on which user's Wallet verified credential maps to which wallet provider key.
6
+ *
7
+ * Even though most wallet provider keys can be easily inferred from the verified credential's data alone
8
+ * (walletName + walletProvider), some kinds of wallet providers (such as Wallet Connect) need a special
9
+ * suffix added to their keys which will not be stored in the backend. Therefore this map is necessary for
10
+ * those wallet providers.
11
+ */
12
+ walletProviderKeyMap: WalletProviderKeyMap;
13
+ }
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,gBAAgB;QACxB;;;;;;;WAOG;QACH,oBAAoB,EAAE,oBAAoB,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { updateWalletProviderKeysForVerifiedCredentials } from './updateWalletProviderKeysForVerifiedCredentials';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8CAA8C,EAAE,MAAM,kDAAkD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { DynamicClient } from '../../../../../client/types';
2
+ type updateWalletProviderKeysForVerifiedCredentialsParams = {
3
+ keysToUpdate: Record<string, string>;
4
+ };
5
+ export declare const updateWalletProviderKeysForVerifiedCredentials: ({ keysToUpdate }: updateWalletProviderKeysForVerifiedCredentialsParams, client: DynamicClient) => void;
6
+ export {};
7
+ //# sourceMappingURL=updateWalletProviderKeysForVerifiedCredentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateWalletProviderKeysForVerifiedCredentials.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/updateWalletProviderKeysForVerifiedCredentials/updateWalletProviderKeysForVerifiedCredentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,KAAK,oDAAoD,GAAG;IAC1D,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,8CAA8C,qBACvC,oDAAoD,UAC9D,aAAa,SAUtB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type * as z from 'zod/mini';
2
+ import type { walletProviderKeyMapSchema } from './schema';
3
+ /**
4
+ * Keeps records on which user's Wallet verified credential maps to which wallet provider key.
5
+ *
6
+ * Even though most wallet provider keys can be easily inferred from the verified credential's data alone
7
+ * (walletName + walletProvider), some kinds of wallet providers (such as Wallet Connect) need a special
8
+ * suffix added to their keys which will not be stored in the backend. Therefore this map is necessary for
9
+ * those wallet providers.
10
+ */
11
+ export type WalletProviderKeyMap = z.infer<typeof walletProviderKeyMapSchema>;
12
+ //# sourceMappingURL=walletProviderKeyMap.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletProviderKeyMap.types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/wallets/walletProvider/walletProviderKeyMap/walletProviderKeyMap.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,UAAU,CAAC;AAEnC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -1,5 +1,9 @@
1
1
  import { type EventEmitter } from 'eventemitter3';
2
2
  export type AsyncProcessStatus = 'pending' | 'resolved' | 'failed';
3
+ export type AsyncProcessEntry<T = unknown> = {
4
+ promise: Promise<T>;
5
+ status: AsyncProcessStatus;
6
+ };
3
7
  export type AsyncTrackEmitter = EventEmitter<{
4
8
  /**
5
9
  * Emitted when a specific async process fails.
@@ -20,7 +24,7 @@ export type AsyncTrack = {
20
24
  /**
21
25
  * Gets the map of all registered async processes.
22
26
  */
23
- getTracker: () => Map<string, AsyncProcessStatus>;
27
+ getTracker: <T>(trackerKey: string) => AsyncProcessEntry<T>;
24
28
  /**
25
29
  * Tracks a specific async process.
26
30
  */
@@ -1 +1 @@
1
- {"version":3,"file":"asyncTrack.types.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/asyncTrack/asyncTrack.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC3C;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAElD;;OAEG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE;QACb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3B,KAAK,IAAI,CAAC;IAEX;;;;;OAKG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"asyncTrack.types.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/asyncTrack/asyncTrack.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEnE,MAAM,MAAM,iBAAiB,CAAC,CAAC,GAAG,OAAO,IAAI;IAC3C,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC3C;;;;OAIG;IACH,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAE5D;;OAEG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE;QACb;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QACb;;WAEG;QACH,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KAC3B,KAAK,IAAI,CAAC;IAEX;;;;;OAKG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createAsyncTrack.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/asyncTrack/createAsyncTrack.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,UAkEnC,CAAC"}
1
+ {"version":3,"file":"createAsyncTrack.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/asyncTrack/createAsyncTrack.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,UAmEnC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export { createLocalStorageAdapter } from './createLocalStorageAdapter';
2
2
  export { createStorage } from './createStorage';
3
3
  export { createStorageKeySchema } from './createStorageKeySchema';
4
- export type { Storage, StorageAdapter } from './storage.types';
4
+ export type { Storage, StorageAdapter, StorageKeySchema, } from './storage.types';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EACV,OAAO,EACP,cAAc,EACd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DebouncedMutex } from '../debouncedMutex.types';
2
+ export declare const createDebouncedMutex: () => DebouncedMutex;
3
+ //# sourceMappingURL=createDebouncedMutex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createDebouncedMutex.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/utils/debouncedMutex/createDebouncedMutex/createDebouncedMutex.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAyB9D,eAAO,MAAM,oBAAoB,QAAO,cA2EvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createDebouncedMutex } from './createDebouncedMutex';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/utils/debouncedMutex/createDebouncedMutex/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Runs an async callback for a given `lockKey` **one at a time**, while
3
+ * *debouncing* repeated calls:
4
+ *
5
+ * - If called again **before `debounceTime` elapses**, the pending call is
6
+ * cancelled and only the **latest** call will eventually run.
7
+ * - If a previous callback is **still running**, the new call waits until
8
+ * that run finishes, then executes (again only the latest call survives).
9
+ *
10
+ * This ensures:
11
+ * • No two callbacks with the same key run concurrently.
12
+ * • Rapid successive calls collapse into a single execution.
13
+ *
14
+ * Useful for throttling expensive operations (e.g. API requests, writes) in
15
+ * a concurrent environment without dropping the final intent.
16
+ *
17
+ * @param {string} lockKey Unique key to serialize by.
18
+ * @param {Function} callback Async function to run once ready.
19
+ * @param {number} [debounceTime] Delay (ms) to wait before triggering callback; new calls during this delay replace the pending one.
20
+ * @param {Function} onError Callback to run if the callback throws an error.
21
+ * @returns A promise that resolves when the callback has finished executing.
22
+ *
23
+ * @example
24
+ * const debouncedMutex = createDebouncedMutex();
25
+ *
26
+ * await debouncedMutex({
27
+ * lockKey: 'fetch-user-profile',
28
+ * debounceTime: 300,
29
+ * callback: async () => {
30
+ * await fetchUserProfile();
31
+ * }
32
+ * });
33
+ */
34
+ export type DebouncedMutex = (params: {
35
+ callback: () => Promise<void>;
36
+ debounceTime?: number;
37
+ lockKey: string;
38
+ }) => Promise<void>;
39
+ //# sourceMappingURL=debouncedMutex.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debouncedMutex.types.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/utils/debouncedMutex/debouncedMutex.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE;IACpC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type { DebouncedMutex } from './debouncedMutex.types';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/utils/debouncedMutex/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC"}
package/waas.cjs.js CHANGED
@@ -1,15 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var assertPackageVersion = require('@dynamic-labs-sdk/assert-package-version');
4
- var logout = require('./logout.cjs.js');
5
- var NotWaasWalletAccountError = require('./NotWaasWalletAccountError.cjs.js');
6
4
  var constants = require('./constants.cjs.js');
7
- var getWalletProviderByKey = require('./getWalletProviderByKey.cjs.js');
5
+ var NotWaasWalletAccountError = require('./NotWaasWalletAccountError.cjs.js');
6
+ var getVerifiedCredentialForWalletAccount = require('./getVerifiedCredentialForWalletAccount.cjs.js');
7
+ var constants$1 = require('./constants.cjs2.js');
8
8
  var sdkApiCore = require('@dynamic-labs/sdk-api-core');
9
+ var filterDuplicates = require('./filterDuplicates.cjs.js');
9
10
  require('buffer');
10
- require('zod/mini');
11
11
 
12
- class NotWaasWalletProviderError extends logout.BaseError {
12
+ class NotWaasWalletProviderError extends constants.BaseError {
13
13
  constructor({ walletProviderKey }){
14
14
  super({
15
15
  cause: null,
@@ -22,11 +22,11 @@ class NotWaasWalletProviderError extends logout.BaseError {
22
22
  }
23
23
 
24
24
  const isWaasWalletProvider = (walletProvider)=>{
25
- return walletProvider.key.includes(constants.DYNAMIC_WAAS_METADATA.key);
25
+ return walletProvider.key.includes(constants$1.DYNAMIC_WAAS_METADATA.normalizedWalletName);
26
26
  };
27
27
 
28
28
  const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
29
- const walletProvider = logout.getWalletProviderFromWalletAccount({
29
+ const walletProvider = getVerifiedCredentialForWalletAccount.getWalletProviderFromWalletAccount({
30
30
  walletAccount
31
31
  }, client);
32
32
  if (!isWaasWalletProvider(walletProvider)) {
@@ -47,7 +47,7 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
47
47
  * @param [params.password] - Optional password to encrypt the backup.
48
48
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
49
49
  * @returns A promise that resolves when the backup process is complete.
50
- */ const backupWaasKeySharesToGoogleDrive = async ({ password, walletAccount }, client = logout.getDefaultClient())=>{
50
+ */ const backupWaasKeySharesToGoogleDrive = async ({ password, walletAccount }, client = constants.getDefaultClient())=>{
51
51
  const provider = getWaasWalletProviderFromWalletAccount({
52
52
  walletAccount
53
53
  }, client);
@@ -57,11 +57,6 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
57
57
  });
58
58
  };
59
59
 
60
- /**
61
- * Filter duplicates from an array by equality.
62
- * Uses a Set internally.
63
- */ const filterDuplicates = (array)=>Array.from(new Set(array));
64
-
65
60
  /**
66
61
  * Creates wallet accounts for the specified chains.
67
62
  *
@@ -78,17 +73,29 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
78
73
  * @param params.chains - The chains to create wallet accounts for.
79
74
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
80
75
  * @returns A promise that resolves when all wallet accounts are created.
81
- */ const createWaasWalletAccounts = async ({ chains }, client = logout.getDefaultClient())=>{
82
- if (chains.length === 0) {
76
+ */ const createWaasWalletAccounts = async ({ chains }, client = constants.getDefaultClient())=>{
77
+ // we need this right now so we don't try to create wallet accounts for chains
78
+ // that we don't support Dynamid Waas yet in the JS SDK, like BTC
79
+ const supportedChains = [
80
+ 'EVM',
81
+ 'SOL',
82
+ 'SUI'
83
+ ];
84
+ const filteredSupportedChains = chains.filter((chain)=>supportedChains.includes(chain));
85
+ if (filteredSupportedChains.length === 0) {
83
86
  return;
84
87
  }
85
- const walletProviderKeys = chains.map((chain)=>logout.formatWalletProviderKey(constants.DYNAMIC_WAAS_METADATA.name, chain));
86
- const walletProviderEntries = filterDuplicates(walletProviderKeys).map((walletProviderKey)=>{
87
- const walletProvider = getWalletProviderByKey.getWalletProviderByKey({
88
+ const walletProviderKeys = filteredSupportedChains.map((chain)=>getVerifiedCredentialForWalletAccount.formatWalletProviderKey({
89
+ chain,
90
+ displayName: constants$1.DYNAMIC_WAAS_METADATA.displayName,
91
+ walletProviderType: sdkApiCore.WalletProviderEnum.EmbeddedWallet
92
+ }));
93
+ const walletProviderEntries = filterDuplicates.filterDuplicates(walletProviderKeys).map((walletProviderKey)=>{
94
+ const walletProvider = getVerifiedCredentialForWalletAccount.getWalletProviderByKey({
88
95
  walletProviderKey
89
96
  }, client);
90
97
  if (!walletProvider) {
91
- throw new logout.NoWalletProviderFoundError({
98
+ throw new getVerifiedCredentialForWalletAccount.NoWalletProviderFoundError({
92
99
  walletProviderKey
93
100
  });
94
101
  }
@@ -117,14 +124,15 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
117
124
  * @param [params.password] - Optional password for key share operations.
118
125
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
119
126
  * @returns A promise that resolves when the key delegation is complete.
120
- */ const delegateWaasKeyShares = async ({ password, walletAccount }, client = logout.getDefaultClient())=>{
127
+ */ const delegateWaasKeyShares = async ({ password, walletAccount }, client = constants.getDefaultClient())=>{
121
128
  const provider = getWaasWalletProviderFromWalletAccount({
122
129
  walletAccount
123
130
  }, client);
124
- return provider.delegateKeyShares({
131
+ await provider.delegateKeyShares({
125
132
  password,
126
133
  walletAccount
127
134
  });
135
+ await NotWaasWalletAccountError.refreshUser(client);
128
136
  };
129
137
 
130
138
  /**
@@ -137,7 +145,7 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
137
145
  * @param [params.password] - Optional password to encrypt the exported shares.
138
146
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
139
147
  * @returns A promise that resolves to the exported key shares.
140
- */ const exportWaasClientKeyshares = async ({ password, walletAccount }, client = logout.getDefaultClient())=>{
148
+ */ const exportWaasClientKeyshares = async ({ password, walletAccount }, client = constants.getDefaultClient())=>{
141
149
  const provider = getWaasWalletProviderFromWalletAccount({
142
150
  walletAccount
143
151
  }, client);
@@ -158,7 +166,7 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
158
166
  * @param [params.password] - Optional password to decrypt the private key.
159
167
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
160
168
  * @returns A promise that resolves when the private key export is complete.
161
- */ const exportWaasPrivateKey = async ({ displayContainer, password, walletAccount }, client = logout.getDefaultClient())=>{
169
+ */ const exportWaasPrivateKey = async ({ displayContainer, password, walletAccount }, client = constants.getDefaultClient())=>{
162
170
  const provider = getWaasWalletProviderFromWalletAccount({
163
171
  walletAccount
164
172
  }, client);
@@ -170,7 +178,7 @@ const getWaasWalletProviderFromWalletAccount = ({ walletAccount }, client)=>{
170
178
  };
171
179
 
172
180
  const userHasEmbeddedWalletForChain = ({ user, chain })=>{
173
- const hasEmbeddedWalletForChain = user.verifiedCredentials.some((vc)=>vc.walletProvider === sdkApiCore.WalletProviderEnum.EmbeddedWallet && vc.chain && logout.getChainFromVerifiedCredentialChain(vc.chain) === chain);
181
+ const hasEmbeddedWalletForChain = user.verifiedCredentials.some((vc)=>vc.walletProvider === sdkApiCore.WalletProviderEnum.EmbeddedWallet && vc.chain && constants.getChainFromVerifiedCredentialChain(vc.chain) === chain);
174
182
  return hasEmbeddedWalletForChain;
175
183
  };
176
184
 
@@ -182,9 +190,9 @@ const userHasEmbeddedWalletForChain = ({ user, chain })=>{
182
190
  *
183
191
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
184
192
  * @returns True if Dynamic WaaS is enabled, false otherwise.
185
- */ const isDynamicWaasEnabled = (client = logout.getDefaultClient())=>{
193
+ */ const isDynamicWaasEnabled = (client = constants.getDefaultClient())=>{
186
194
  const projectSettings = client.projectSettings;
187
- logout.assertDefined(projectSettings, 'Project settings are not available');
195
+ constants.assertDefined(projectSettings, 'Project settings are not available');
188
196
  const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;
189
197
  const dynamicWaasIsEnabled = (embeddedWalletSettings == null ? void 0 : embeddedWalletSettings.defaultWalletVersion) === sdkApiCore.EmbeddedWalletVersionEnum.V3;
190
198
  return dynamicWaasIsEnabled;
@@ -196,10 +204,10 @@ const userHasEmbeddedWalletForChain = ({ user, chain })=>{
196
204
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
197
205
  * @returns An array of all chains that have waas wallet accounts enabled
198
206
  * but for which the current user does not yet have an embedded wallet account.
199
- */ const getChainsMissingWaasWalletAccounts = (client = logout.getDefaultClient())=>{
207
+ */ const getChainsMissingWaasWalletAccounts = (client = constants.getDefaultClient())=>{
200
208
  var _embeddedWalletSettings_chainConfigurations;
201
209
  const projectSettings = client.projectSettings;
202
- logout.assertDefined(projectSettings, 'Project settings are not available');
210
+ constants.assertDefined(projectSettings, 'Project settings are not available');
203
211
  const embeddedWalletSettings = projectSettings.sdk.embeddedWallets;
204
212
  const isWaasEnabled = isDynamicWaasEnabled(client);
205
213
  const user = client.user;
@@ -215,12 +223,32 @@ const userHasEmbeddedWalletForChain = ({ user, chain })=>{
215
223
  }));
216
224
  };
217
225
 
226
+ /**
227
+ * Checks if a WaaS wallet account has delegated access.
228
+ *
229
+ * @param params.walletAccount - The WaaS wallet account to check for delegated access.
230
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
231
+ * @returns True if the wallet account has delegated access, false otherwise.
232
+ */ const hasDelegatedAccess = ({ walletAccount }, client = constants.getDefaultClient())=>{
233
+ var _verifiedCredential_walletProperties_keyShares, _verifiedCredential_walletProperties;
234
+ const verifiedCredential = getVerifiedCredentialForWalletAccount.getVerifiedCredentialForWalletAccount({
235
+ walletAccount
236
+ }, client);
237
+ constants.assertDefined(verifiedCredential, 'Verified credential not found for Waas wallet account');
238
+ const hasDelegatedKeyShare = (_verifiedCredential_walletProperties = verifiedCredential.walletProperties) == null ? void 0 : (_verifiedCredential_walletProperties_keyShares = _verifiedCredential_walletProperties.keyShares) == null ? void 0 : _verifiedCredential_walletProperties_keyShares.some((keyShare)=>keyShare.backupLocation === 'delegated');
239
+ return !!hasDelegatedKeyShare;
240
+ };
241
+
218
242
  const getWaasWalletProviderByChain = ({ chain }, client)=>{
219
- const providers = getWalletProviderByKey.getWalletProviders(client);
220
- const waasProviderKey = logout.formatWalletProviderKey(constants.DYNAMIC_WAAS_METADATA.name, chain);
243
+ const providers = getVerifiedCredentialForWalletAccount.getWalletProviders(client);
244
+ const waasProviderKey = getVerifiedCredentialForWalletAccount.formatWalletProviderKey({
245
+ chain,
246
+ displayName: constants$1.DYNAMIC_WAAS_METADATA.displayName,
247
+ walletProviderType: sdkApiCore.WalletProviderEnum.EmbeddedWallet
248
+ });
221
249
  const waasProvider = providers.find((provider)=>provider.key === waasProviderKey && provider.chain === chain);
222
250
  if (!waasProvider || !isWaasWalletProvider(waasProvider)) {
223
- throw new logout.NoWalletProviderFoundError({
251
+ throw new getVerifiedCredentialForWalletAccount.NoWalletProviderFoundError({
224
252
  walletProviderKey: waasProviderKey
225
253
  });
226
254
  }
@@ -238,7 +266,7 @@ const getWaasWalletProviderByChain = ({ chain }, client)=>{
238
266
  * @param [params.thresholdSignatureScheme] - Optional threshold signature scheme configuration. Default is TWO_OF_TWO.
239
267
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
240
268
  * @returns A promise that resolves when the private key is successfully imported.
241
- */ const importWaasPrivateKey = async ({ chain, privateKey, thresholdSignatureScheme }, client = logout.getDefaultClient())=>{
269
+ */ const importWaasPrivateKey = async ({ chain, privateKey, thresholdSignatureScheme }, client = constants.getDefaultClient())=>{
242
270
  const provider = getWaasWalletProviderByChain({
243
271
  chain
244
272
  }, client);
@@ -255,7 +283,7 @@ const getWaasWalletProviderByChain = ({ chain }, client)=>{
255
283
  * @param params.walletAccount - The wallet account to check.
256
284
  * @returns True if the wallet account is a WaaS wallet account, false otherwise.
257
285
  */ const isWaasWalletAccount = ({ walletAccount })=>{
258
- return walletAccount.walletProviderKey.includes(constants.DYNAMIC_WAAS_METADATA.key);
286
+ return walletAccount.walletProviderKey.includes(constants$1.DYNAMIC_WAAS_METADATA.normalizedWalletName);
259
287
  };
260
288
 
261
289
  /**
@@ -268,7 +296,7 @@ const getWaasWalletProviderByChain = ({ chain }, client)=>{
268
296
  * @param [params.password] - Optional password for key share operations.
269
297
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
270
298
  * @returns A promise that resolves when the key shares are refreshed.
271
- */ const refreshWaasWalletAccountShares = async ({ walletAccount, password }, client = logout.getDefaultClient())=>{
299
+ */ const refreshWaasWalletAccountShares = async ({ walletAccount, password }, client = constants.getDefaultClient())=>{
272
300
  const provider = getWaasWalletProviderFromWalletAccount({
273
301
  walletAccount
274
302
  }, client);
@@ -278,6 +306,24 @@ const getWaasWalletProviderByChain = ({ chain }, client)=>{
278
306
  });
279
307
  };
280
308
 
309
+ /**
310
+ * Revokes the delegation of a WaaS wallet account.
311
+ *
312
+ * @param params.walletAccount - The WaaS wallet account to revoke delegation for.
313
+ * @param [params.password] - Optional password for delegation operations.
314
+ * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
315
+ * @returns A promise that resolves when the delegation is revoked.
316
+ */ const revokeWaasDelegation = async ({ password, walletAccount }, client = constants.getDefaultClient())=>{
317
+ const provider = getWaasWalletProviderFromWalletAccount({
318
+ walletAccount
319
+ }, client);
320
+ await provider.revokeDelegation({
321
+ password,
322
+ walletAccount
323
+ });
324
+ await NotWaasWalletAccountError.refreshUser(client);
325
+ };
326
+
281
327
  const userHasExternalWallet = (user)=>{
282
328
  const hasExternalWallet = user == null ? void 0 : user.verifiedCredentials.some((vc)=>vc.format === sdkApiCore.JwtVerifiedCredentialFormatEnum.Blockchain && vc.walletProvider !== sdkApiCore.WalletProviderEnum.EmbeddedWallet);
283
329
  return hasExternalWallet;
@@ -293,8 +339,8 @@ const userHasExternalWallet = (user)=>{
293
339
  * @param params.chain - The blockchain network to check.
294
340
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
295
341
  * @returns True if a wallet should be auto-created for the chain, false otherwise.
296
- */ const shouldAutoCreateWalletForChain = ({ chain }, client = logout.getDefaultClient())=>{
297
- logout.assertDefined(client.projectSettings, 'Project settings are not available');
342
+ */ const shouldAutoCreateWalletForChain = ({ chain }, client = constants.getDefaultClient())=>{
343
+ constants.assertDefined(client.projectSettings, 'Project settings are not available');
298
344
  const embeddedWalletSettings = client.projectSettings.sdk.embeddedWallets;
299
345
  const automaticEmbeddedWalletCreationEnabled = embeddedWalletSettings == null ? void 0 : embeddedWalletSettings.automaticEmbeddedWalletCreation;
300
346
  if (!automaticEmbeddedWalletCreationEnabled || !client.user) {
@@ -322,7 +368,7 @@ const userHasExternalWallet = (user)=>{
322
368
  * @param params.newPassword - The new password to set for the wallet.
323
369
  * @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
324
370
  * @returns A promise that resolves when the password is successfully updated.
325
- */ const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount }, client = logout.getDefaultClient())=>{
371
+ */ const updateWaasPassword = async ({ currentPassword, newPassword, walletAccount }, client = constants.getDefaultClient())=>{
326
372
  const provider = getWaasWalletProviderFromWalletAccount({
327
373
  walletAccount
328
374
  }, client);
@@ -333,7 +379,7 @@ const userHasExternalWallet = (user)=>{
333
379
  });
334
380
  };
335
381
 
336
- assertPackageVersion.assertPackageVersion(logout.name, logout.version);
382
+ assertPackageVersion.assertPackageVersion(constants.name, constants.version);
337
383
 
338
384
  exports.NotWaasWalletProviderError = NotWaasWalletProviderError;
339
385
  exports.backupWaasKeySharesToGoogleDrive = backupWaasKeySharesToGoogleDrive;
@@ -342,9 +388,11 @@ exports.delegateWaasKeyShares = delegateWaasKeyShares;
342
388
  exports.exportWaasClientKeyshares = exportWaasClientKeyshares;
343
389
  exports.exportWaasPrivateKey = exportWaasPrivateKey;
344
390
  exports.getChainsMissingWaasWalletAccounts = getChainsMissingWaasWalletAccounts;
391
+ exports.hasDelegatedAccess = hasDelegatedAccess;
345
392
  exports.importWaasPrivateKey = importWaasPrivateKey;
346
393
  exports.isDynamicWaasEnabled = isDynamicWaasEnabled;
347
394
  exports.isWaasWalletAccount = isWaasWalletAccount;
348
395
  exports.refreshWaasWalletAccountShares = refreshWaasWalletAccountShares;
396
+ exports.revokeWaasDelegation = revokeWaasDelegation;
349
397
  exports.shouldAutoCreateWalletForChain = shouldAutoCreateWalletForChain;
350
398
  exports.updateWaasPassword = updateWaasPassword;