@getpara/react-sdk 2.0.0-alpha.7 → 2.0.0-alpha.71

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 (311) hide show
  1. package/README.md +21 -0
  2. package/dist/cosmos/actions/getCosmjsAminoSigner.d.ts +8 -0
  3. package/dist/cosmos/actions/getCosmjsAminoSigner.js +16 -0
  4. package/dist/cosmos/actions/getCosmjsProtoSigner.d.ts +8 -0
  5. package/dist/cosmos/actions/getCosmjsProtoSigner.js +16 -0
  6. package/dist/cosmos/actions/index.d.ts +2 -0
  7. package/dist/cosmos/actions/index.js +3 -0
  8. package/dist/cosmos/hooks/index.d.ts +2 -0
  9. package/dist/cosmos/hooks/index.js +3 -0
  10. package/dist/cosmos/hooks/useCosmjsAminoSigner.d.ts +11 -0
  11. package/dist/cosmos/hooks/useCosmjsAminoSigner.js +37 -0
  12. package/dist/cosmos/hooks/useCosmjsProtoSigner.d.ts +11 -0
  13. package/dist/cosmos/hooks/useCosmjsProtoSigner.js +37 -0
  14. package/dist/cosmos/index.d.ts +2 -0
  15. package/dist/cosmos/index.js +3 -0
  16. package/dist/css/modal.css +14 -1
  17. package/dist/evm/actions/getViemAccount.d.ts +22 -0
  18. package/dist/evm/actions/getViemAccount.js +20 -0
  19. package/dist/evm/actions/getViemClient.d.ts +17993 -0
  20. package/dist/evm/actions/getViemClient.js +25 -0
  21. package/dist/evm/actions/index.d.ts +2 -0
  22. package/dist/evm/actions/index.js +3 -0
  23. package/dist/evm/hooks/index.d.ts +2 -0
  24. package/dist/evm/hooks/index.js +3 -0
  25. package/dist/evm/hooks/useViemAccount.d.ts +26 -0
  26. package/dist/evm/hooks/useViemAccount.js +32 -0
  27. package/dist/evm/hooks/useViemClient.d.ts +17997 -0
  28. package/dist/evm/hooks/useViemClient.js +30 -0
  29. package/dist/evm/index.d.ts +2 -0
  30. package/dist/evm/index.js +3 -0
  31. package/dist/index.d.ts +3 -6
  32. package/dist/index.js +4 -9
  33. package/dist/provider/ParaProvider.d.ts +1 -2
  34. package/dist/provider/ParaProvider.js +17 -76
  35. package/dist/public/PPMori-Regular.woff2 +0 -0
  36. package/dist/public/PPMori-SemiBold.woff2 +0 -0
  37. package/dist/solana/actions/getSolanaSigner.d.ts +8 -0
  38. package/dist/solana/actions/getSolanaSigner.js +15 -0
  39. package/dist/solana/actions/index.d.ts +1 -0
  40. package/dist/solana/actions/index.js +2 -0
  41. package/dist/solana/hooks/index.d.ts +1 -0
  42. package/dist/solana/hooks/index.js +2 -0
  43. package/dist/solana/hooks/useSolanaSigner.d.ts +12 -0
  44. package/dist/solana/hooks/useSolanaSigner.js +32 -0
  45. package/dist/solana/index.d.ts +2 -0
  46. package/dist/solana/index.js +3 -0
  47. package/package.json +37 -51
  48. package/styles.css/package.json +1 -1
  49. package/dist/cli/cli.mjs +0 -35
  50. package/dist/modal/ParaModal.d.ts +0 -2
  51. package/dist/modal/ParaModal.js +0 -262
  52. package/dist/modal/components/Account/Account.d.ts +0 -5
  53. package/dist/modal/components/Account/Account.js +0 -139
  54. package/dist/modal/components/AddFunds/AddFunds.d.ts +0 -1
  55. package/dist/modal/components/AddFunds/AddFunds.js +0 -69
  56. package/dist/modal/components/AddFunds/AddFundsAsset.d.ts +0 -1
  57. package/dist/modal/components/AddFunds/AddFundsAsset.js +0 -125
  58. package/dist/modal/components/AddFunds/AddFundsAwaiting.d.ts +0 -1
  59. package/dist/modal/components/AddFunds/AddFundsAwaiting.js +0 -78
  60. package/dist/modal/components/AddFunds/AddFundsContext.d.ts +0 -31
  61. package/dist/modal/components/AddFunds/AddFundsContext.js +0 -160
  62. package/dist/modal/components/AddFunds/AddFundsDone.d.ts +0 -6
  63. package/dist/modal/components/AddFunds/AddFundsDone.js +0 -49
  64. package/dist/modal/components/AddFunds/AddFundsProvider.d.ts +0 -1
  65. package/dist/modal/components/AddFunds/AddFundsProvider.js +0 -109
  66. package/dist/modal/components/AddFunds/AddFundsReceive.d.ts +0 -1
  67. package/dist/modal/components/AddFunds/AddFundsReceive.js +0 -83
  68. package/dist/modal/components/AddFunds/AddFundsSettings.d.ts +0 -1
  69. package/dist/modal/components/AddFunds/AddFundsSettings.js +0 -237
  70. package/dist/modal/components/AddFunds/MoonPayEmbed.d.ts +0 -2
  71. package/dist/modal/components/AddFunds/MoonPayEmbed.js +0 -7
  72. package/dist/modal/components/AddFunds/common.d.ts +0 -19
  73. package/dist/modal/components/AddFunds/common.js +0 -24
  74. package/dist/modal/components/AddFunds/index.d.ts +0 -3
  75. package/dist/modal/components/AddFunds/index.js +0 -4
  76. package/dist/modal/components/AuthInput/AuthInput.d.ts +0 -6
  77. package/dist/modal/components/AuthInput/AuthInput.js +0 -262
  78. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.d.ts +0 -7
  79. package/dist/modal/components/AuthInput/hooks/useDropdownPosition.js +0 -33
  80. package/dist/modal/components/AuthInput/phoneMasks.d.ts +0 -247
  81. package/dist/modal/components/AuthInput/phoneMasks.js +0 -253
  82. package/dist/modal/components/AuthMainStep/AuthMainStep.d.ts +0 -9
  83. package/dist/modal/components/AuthMainStep/AuthMainStep.js +0 -50
  84. package/dist/modal/components/AuthMainStep/AuthMainStepContent.d.ts +0 -9
  85. package/dist/modal/components/AuthMainStep/AuthMainStepContent.js +0 -157
  86. package/dist/modal/components/AuthOptions/AuthOptions.d.ts +0 -9
  87. package/dist/modal/components/AuthOptions/AuthOptions.js +0 -67
  88. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.d.ts +0 -1
  89. package/dist/modal/components/AwaitingBiometricsStep/AwaitingBiometricsStep.js +0 -18
  90. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.d.ts +0 -1
  91. package/dist/modal/components/AwaitingOAuthStep/AwaitingOAuthStep.js +0 -10
  92. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.d.ts +0 -1
  93. package/dist/modal/components/AwaitingPasswordStep/AwaitingPasswordStep.js +0 -18
  94. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.d.ts +0 -5
  95. package/dist/modal/components/AwaitingWalletCreationStep/AwaitingWalletCreationStep.js +0 -49
  96. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.d.ts +0 -1
  97. package/dist/modal/components/BiometricCreationStep/BiometricCreationStep.js +0 -63
  98. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.d.ts +0 -1
  99. package/dist/modal/components/BiometricLoginStep/BiometricLoginStep.js +0 -55
  100. package/dist/modal/components/Body/AnimatedHeightWrapper.d.ts +0 -6
  101. package/dist/modal/components/Body/AnimatedHeightWrapper.js +0 -29
  102. package/dist/modal/components/Body/Body.d.ts +0 -11
  103. package/dist/modal/components/Body/Body.js +0 -327
  104. package/dist/modal/components/ChainSwitch/ChainSwitch.d.ts +0 -1
  105. package/dist/modal/components/ChainSwitch/ChainSwitch.js +0 -95
  106. package/dist/modal/components/ChainSwitch/config.d.ts +0 -7
  107. package/dist/modal/components/ChainSwitch/config.js +0 -17
  108. package/dist/modal/components/Controls/Controls.d.ts +0 -5
  109. package/dist/modal/components/Controls/Controls.js +0 -77
  110. package/dist/modal/components/Controls/Selects.d.ts +0 -2
  111. package/dist/modal/components/Controls/Selects.js +0 -189
  112. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.d.ts +0 -1
  113. package/dist/modal/components/ExternalWalletStep/ExternalWalletStep.js +0 -144
  114. package/dist/modal/components/ExternalWalletStep/config.d.ts +0 -7
  115. package/dist/modal/components/ExternalWalletStep/config.js +0 -17
  116. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.d.ts +0 -1
  117. package/dist/modal/components/ExternalWalletVerificationStep/ExternalWalletVerificationStep.js +0 -34
  118. package/dist/modal/components/ExternalWallets/ExternalWallets.d.ts +0 -1
  119. package/dist/modal/components/ExternalWallets/ExternalWallets.js +0 -173
  120. package/dist/modal/components/Footer/Footer.d.ts +0 -1
  121. package/dist/modal/components/Footer/Footer.js +0 -95
  122. package/dist/modal/components/Header/Header.d.ts +0 -1
  123. package/dist/modal/components/Header/Header.js +0 -43
  124. package/dist/modal/components/Header/hooks/useStepTitle.d.ts +0 -3
  125. package/dist/modal/components/Header/hooks/useStepTitle.js +0 -54
  126. package/dist/modal/components/Hero/Hero.d.ts +0 -1
  127. package/dist/modal/components/Hero/Hero.js +0 -116
  128. package/dist/modal/components/IFrameStep/IFrameStep.d.ts +0 -1
  129. package/dist/modal/components/IFrameStep/IFrameStep.js +0 -59
  130. package/dist/modal/components/LoginDoneStep/LoginDoneStep.d.ts +0 -1
  131. package/dist/modal/components/LoginDoneStep/LoginDoneStep.js +0 -31
  132. package/dist/modal/components/ModalContent/ModalContent.d.ts +0 -10
  133. package/dist/modal/components/ModalContent/ModalContent.js +0 -95
  134. package/dist/modal/components/OAuth/FarcasterOAuthStep.d.ts +0 -2
  135. package/dist/modal/components/OAuth/FarcasterOAuthStep.js +0 -27
  136. package/dist/modal/components/OAuth/OAuth.d.ts +0 -6
  137. package/dist/modal/components/OAuth/OAuth.js +0 -79
  138. package/dist/modal/components/OAuth/TelegramOAuthStep.d.ts +0 -1
  139. package/dist/modal/components/OAuth/TelegramOAuthStep.js +0 -90
  140. package/dist/modal/components/OnRampComponents/AddingFunds.d.ts +0 -1
  141. package/dist/modal/components/OnRampComponents/AddingFunds.js +0 -23
  142. package/dist/modal/components/OnRampComponents/OnRampProviderButton.d.ts +0 -9
  143. package/dist/modal/components/OnRampComponents/OnRampProviderButton.js +0 -77
  144. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.d.ts +0 -6
  145. package/dist/modal/components/RecoverySecretStep/RecoverySecretStep.js +0 -107
  146. package/dist/modal/components/Setup2FAStep/Setup2FAStep.d.ts +0 -5
  147. package/dist/modal/components/Setup2FAStep/Setup2FAStep.js +0 -132
  148. package/dist/modal/components/StripeComponents/StripeComponents.d.ts +0 -16
  149. package/dist/modal/components/StripeComponents/StripeComponents.js +0 -88
  150. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.d.ts +0 -5
  151. package/dist/modal/components/TwoFactorDoneStep/TwoFactorDoneStep.js +0 -27
  152. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.d.ts +0 -1
  153. package/dist/modal/components/VerificationCodeStep/VerificationCodeStep.js +0 -143
  154. package/dist/modal/components/Waiting/Waiting.d.ts +0 -6
  155. package/dist/modal/components/Waiting/Waiting.js +0 -17
  156. package/dist/modal/components/WalletCard/PartnerIcon.d.ts +0 -6
  157. package/dist/modal/components/WalletCard/PartnerIcon.js +0 -34
  158. package/dist/modal/components/WalletCard/WalletCard.d.ts +0 -18
  159. package/dist/modal/components/WalletCard/WalletCard.js +0 -128
  160. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.d.ts +0 -6
  161. package/dist/modal/components/WalletCreationDoneStep/WalletCreationDoneStep.js +0 -73
  162. package/dist/modal/components/common.d.ts +0 -42
  163. package/dist/modal/components/common.js +0 -175
  164. package/dist/modal/components/index.d.ts +0 -1
  165. package/dist/modal/components/index.js +0 -2
  166. package/dist/modal/constants/constants.d.ts +0 -39
  167. package/dist/modal/constants/constants.js +0 -138
  168. package/dist/modal/constants/defaults.d.ts +0 -5
  169. package/dist/modal/constants/defaults.js +0 -10
  170. package/dist/modal/constants/oAuthLogos.d.ts +0 -8
  171. package/dist/modal/constants/oAuthLogos.js +0 -24
  172. package/dist/modal/hooks/useGoBack.d.ts +0 -1
  173. package/dist/modal/hooks/useGoBack.js +0 -43
  174. package/dist/modal/index.d.ts +0 -8
  175. package/dist/modal/index.js +0 -29
  176. package/dist/modal/stores/index.d.ts +0 -1
  177. package/dist/modal/stores/index.js +0 -2
  178. package/dist/modal/stores/modal/actions.d.ts +0 -3
  179. package/dist/modal/stores/modal/actions.js +0 -133
  180. package/dist/modal/stores/modal/useModalStore.d.ts +0 -102
  181. package/dist/modal/stores/modal/useModalStore.js +0 -68
  182. package/dist/modal/types/commonTypes.d.ts +0 -6
  183. package/dist/modal/types/commonTypes.js +0 -1
  184. package/dist/modal/types/externalWallets.d.ts +0 -33
  185. package/dist/modal/types/externalWallets.js +0 -32
  186. package/dist/modal/types/modalProps.d.ts +0 -124
  187. package/dist/modal/types/modalProps.js +0 -12
  188. package/dist/modal/utils/authInputHelpers.d.ts +0 -7
  189. package/dist/modal/utils/authInputHelpers.js +0 -38
  190. package/dist/modal/utils/authLayoutHelpers.d.ts +0 -3
  191. package/dist/modal/utils/authLayoutHelpers.js +0 -8
  192. package/dist/modal/utils/countryCodes.d.ts +0 -8
  193. package/dist/modal/utils/countryCodes.js +0 -45
  194. package/dist/modal/utils/getMailtoLink.d.ts +0 -1
  195. package/dist/modal/utils/getMailtoLink.js +0 -10
  196. package/dist/modal/utils/getTileButtonFlex.d.ts +0 -1
  197. package/dist/modal/utils/getTileButtonFlex.js +0 -20
  198. package/dist/modal/utils/isPasskeySupported.d.ts +0 -1
  199. package/dist/modal/utils/isPasskeySupported.js +0 -15
  200. package/dist/modal/utils/openPopup.d.ts +0 -6
  201. package/dist/modal/utils/openPopup.js +0 -60
  202. package/dist/modal/utils/routeMobileExternalWallet.d.ts +0 -1
  203. package/dist/modal/utils/routeMobileExternalWallet.js +0 -31
  204. package/dist/modal/utils/steps.d.ts +0 -120
  205. package/dist/modal/utils/steps.js +0 -247
  206. package/dist/modal/utils/stringFormatters.d.ts +0 -5
  207. package/dist/modal/utils/stringFormatters.js +0 -19
  208. package/dist/modal/utils/validateOnRampConfig.d.ts +0 -5
  209. package/dist/modal/utils/validateOnRampConfig.js +0 -32
  210. package/dist/provider/actions/getAccount.d.ts +0 -26
  211. package/dist/provider/actions/getAccount.js +0 -51
  212. package/dist/provider/actions/getWallet.d.ts +0 -5
  213. package/dist/provider/actions/getWallet.js +0 -14
  214. package/dist/provider/actions/index.d.ts +0 -27
  215. package/dist/provider/actions/index.js +0 -59
  216. package/dist/provider/actions/utils.d.ts +0 -3
  217. package/dist/provider/actions/utils.js +0 -15
  218. package/dist/provider/components/CosmosWalletWrapper.d.ts +0 -11
  219. package/dist/provider/components/CosmosWalletWrapper.js +0 -34
  220. package/dist/provider/components/EvmWalletWrapper.d.ts +0 -12
  221. package/dist/provider/components/EvmWalletWrapper.js +0 -34
  222. package/dist/provider/components/ExternalWalletWrapper.d.ts +0 -8
  223. package/dist/provider/components/ExternalWalletWrapper.js +0 -139
  224. package/dist/provider/components/SolanaWalletWrapper.d.ts +0 -9
  225. package/dist/provider/components/SolanaWalletWrapper.js +0 -36
  226. package/dist/provider/external/getParaCosmosConnector.d.ts +0 -7
  227. package/dist/provider/external/getParaCosmosConnector.js +0 -22
  228. package/dist/provider/external/getParaEvmConnector.d.ts +0 -7
  229. package/dist/provider/external/getParaEvmConnector.js +0 -22
  230. package/dist/provider/external/getParaSolanaConnector.d.ts +0 -7
  231. package/dist/provider/external/getParaSolanaConnector.js +0 -22
  232. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.d.ts +0 -12
  233. package/dist/provider/external/stubs/CosmosExternalWalletContextStub.js +0 -18
  234. package/dist/provider/external/stubs/EvmExternalWalletContextStub.d.ts +0 -3
  235. package/dist/provider/external/stubs/EvmExternalWalletContextStub.js +0 -21
  236. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.d.ts +0 -8
  237. package/dist/provider/external/stubs/SolanaExternalWalletContextStub.js +0 -14
  238. package/dist/provider/hooks/index.d.ts +0 -3
  239. package/dist/provider/hooks/index.js +0 -4
  240. package/dist/provider/hooks/mutations/index.d.ts +0 -26
  241. package/dist/provider/hooks/mutations/index.js +0 -61
  242. package/dist/provider/hooks/mutations/utils.d.ts +0 -4
  243. package/dist/provider/hooks/mutations/utils.js +0 -22
  244. package/dist/provider/hooks/queries/index.d.ts +0 -3
  245. package/dist/provider/hooks/queries/index.js +0 -10
  246. package/dist/provider/hooks/queries/useAccount.d.ts +0 -5
  247. package/dist/provider/hooks/queries/useAccount.js +0 -21
  248. package/dist/provider/hooks/queries/useWallet.d.ts +0 -5
  249. package/dist/provider/hooks/queries/useWallet.js +0 -22
  250. package/dist/provider/hooks/queries/useWalletBalance.d.ts +0 -6
  251. package/dist/provider/hooks/queries/useWalletBalance.js +0 -55
  252. package/dist/provider/hooks/utils/index.d.ts +0 -3
  253. package/dist/provider/hooks/utils/index.js +0 -10
  254. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.d.ts +0 -3
  255. package/dist/provider/hooks/utils/useAutoSessionKeepAlive.js +0 -74
  256. package/dist/provider/hooks/utils/useClient.d.ts +0 -5
  257. package/dist/provider/hooks/utils/useClient.js +0 -10
  258. package/dist/provider/hooks/utils/useEventListeners.d.ts +0 -2
  259. package/dist/provider/hooks/utils/useEventListeners.js +0 -147
  260. package/dist/provider/hooks/utils/useInternalClient.d.ts +0 -5
  261. package/dist/provider/hooks/utils/useInternalClient.js +0 -10
  262. package/dist/provider/hooks/utils/useModal.d.ts +0 -8
  263. package/dist/provider/hooks/utils/useModal.js +0 -17
  264. package/dist/provider/hooks/utils/useWalletState.d.ts +0 -15
  265. package/dist/provider/hooks/utils/useWalletState.js +0 -48
  266. package/dist/provider/index.d.ts +0 -4
  267. package/dist/provider/index.js +0 -9
  268. package/dist/provider/providers/AuthProvider.d.ts +0 -35
  269. package/dist/provider/providers/AuthProvider.js +0 -498
  270. package/dist/provider/providers/CosmosExternalWalletProvider.d.ts +0 -7
  271. package/dist/provider/providers/CosmosExternalWalletProvider.js +0 -66
  272. package/dist/provider/providers/EvmExternalWalletProvider.d.ts +0 -7
  273. package/dist/provider/providers/EvmExternalWalletProvider.js +0 -74
  274. package/dist/provider/providers/ExternalWalletProvider.d.ts +0 -76
  275. package/dist/provider/providers/ExternalWalletProvider.js +0 -428
  276. package/dist/provider/providers/SolanaExternalWalletProvider.d.ts +0 -7
  277. package/dist/provider/providers/SolanaExternalWalletProvider.js +0 -66
  278. package/dist/provider/stores/getters.d.ts +0 -4
  279. package/dist/provider/stores/getters.js +0 -13
  280. package/dist/provider/stores/setters.d.ts +0 -1
  281. package/dist/provider/stores/setters.js +0 -7
  282. package/dist/provider/stores/slices/client.d.ts +0 -3
  283. package/dist/provider/stores/slices/client.js +0 -9
  284. package/dist/provider/stores/slices/config.d.ts +0 -3
  285. package/dist/provider/stores/slices/config.js +0 -9
  286. package/dist/provider/stores/slices/externalWallets.d.ts +0 -3
  287. package/dist/provider/stores/slices/externalWallets.js +0 -40
  288. package/dist/provider/stores/slices/index.d.ts +0 -4
  289. package/dist/provider/stores/slices/index.js +0 -5
  290. package/dist/provider/stores/slices/modal.d.ts +0 -3
  291. package/dist/provider/stores/slices/modal.js +0 -16
  292. package/dist/provider/stores/slices/wallet.d.ts +0 -3
  293. package/dist/provider/stores/slices/wallet.js +0 -13
  294. package/dist/provider/stores/types.d.ts +0 -64
  295. package/dist/provider/stores/types.js +0 -1
  296. package/dist/provider/stores/useStore.d.ts +0 -17
  297. package/dist/provider/stores/useStore.js +0 -28
  298. package/dist/provider/types/externalWalletProviders.d.ts +0 -12
  299. package/dist/provider/types/externalWalletProviders.js +0 -1
  300. package/dist/provider/types/provider.d.ts +0 -147
  301. package/dist/provider/types/provider.js +0 -1
  302. package/dist/provider/types/query.d.ts +0 -3
  303. package/dist/provider/types/query.js +0 -1
  304. package/dist/provider/types/utils.d.ts +0 -22
  305. package/dist/provider/types/utils.js +0 -1
  306. package/dist/provider/utils/constants.d.ts +0 -5
  307. package/dist/provider/utils/constants.js +0 -10
  308. package/dist/provider/utils/paraConfigTypeGuards.d.ts +0 -7
  309. package/dist/provider/utils/paraConfigTypeGuards.js +0 -13
  310. package/dist/provider/utils/renameMutations.d.ts +0 -5
  311. package/dist/provider/utils/renameMutations.js +0 -18
@@ -1,139 +0,0 @@
1
- "use client";
2
- import {
3
- __spreadProps,
4
- __spreadValues
5
- } from "../../chunk-MMUBH76A.js";
6
- import { jsx } from "react/jsx-runtime";
7
- import { useCallback, useEffect, useMemo } from "react";
8
- import { useModalStore } from "../../modal/stores/index.js";
9
- import { ExternalWalletProvider } from "../providers/ExternalWalletProvider.js";
10
- import { EvmWalletWrapper } from "./EvmWalletWrapper.js";
11
- import { CosmosWalletWrapper } from "./CosmosWalletWrapper.js";
12
- import { SolanaWalletWrapper } from "./SolanaWalletWrapper.js";
13
- import { useStore } from "../stores/useStore.js";
14
- const ExternalWalletWrapper = ({
15
- children,
16
- config
17
- }) => {
18
- var _a;
19
- const { appDescription, appIcon, appUrl, walletConnect, evmConnector, cosmosConnector, solanaConnector } = config != null ? config : {};
20
- const appName = useStore((state) => state.appName);
21
- const resetModalState = useModalStore((state) => state.resetState);
22
- const wallets = useStore((state) => state.externalWallets);
23
- useEffect(() => {
24
- if (!!wallets.length && !(walletConnect == null ? void 0 : walletConnect.projectId)) {
25
- console.warn(
26
- "It is recommended to provide a WalletConnect project id to ensure wallet connection works as expected. Sign up for your free key at https://cloud.walletconnect.com/sign-in"
27
- );
28
- }
29
- }, [wallets, walletConnect]);
30
- const evmProviderConfig = useMemo(
31
- () => {
32
- var _a2, _b;
33
- return !evmConnector ? {
34
- appName,
35
- chains: [
36
- {
37
- id: 11155111,
38
- name: "Sepolia",
39
- nativeCurrency: { name: "Sepolia Ether", symbol: "ETH", decimals: 18 },
40
- rpcUrls: { default: { http: ["https://rpc.sepolia.org"] } },
41
- blockExplorers: {
42
- default: {
43
- name: "Etherscan",
44
- url: "https://sepolia.etherscan.io",
45
- apiUrl: "https://api-sepolia.etherscan.io/api"
46
- }
47
- },
48
- contracts: {
49
- multicall3: { address: "0xca11bde05977b3631167028862be2a173976ca11", blockCreated: 751532 },
50
- ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
51
- ensUniversalResolver: { address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC", blockCreated: 5317080 }
52
- },
53
- testnet: true
54
- }
55
- ],
56
- projectId: (_a2 = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _a2 : ""
57
- } : __spreadValues({ appName, appDescription, appIcon, appUrl, projectId: (_b = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _b : "" }, evmConnector == null ? void 0 : evmConnector.config);
58
- },
59
- [appName, appDescription, appIcon, appUrl, walletConnect == null ? void 0 : walletConnect.projectId, evmConnector]
60
- );
61
- const solanaProviderConfig = useMemo(() => {
62
- var _a2, _b, _c, _d, _e, _f;
63
- const appIdentity = {
64
- name: (_b = (_a2 = solanaConnector == null ? void 0 : solanaConnector.config.appIdentity) == null ? void 0 : _a2.name) != null ? _b : appName,
65
- uri: (_d = (_c = solanaConnector == null ? void 0 : solanaConnector.config.appIdentity) == null ? void 0 : _c.uri) != null ? _d : appUrl,
66
- icon: (_f = (_e = solanaConnector == null ? void 0 : solanaConnector.config.appIdentity) == null ? void 0 : _e.icon) != null ? _f : appIcon
67
- };
68
- return !solanaConnector ? { appIdentity, chain: "devnet", endpoint: "https://api.devnet.solana.com" } : __spreadValues({ appIdentity }, solanaConnector == null ? void 0 : solanaConnector.config);
69
- }, [solanaConnector]);
70
- const cosmosProviderConfig = useMemo(
71
- () => !cosmosConnector ? {
72
- chains: [
73
- {
74
- chainId: "theta-testnet-001",
75
- currencies: [{ coinDenom: "atom", coinMinimalDenom: "uatom", coinDecimals: 6 }],
76
- rest: "https://cosmoshubt.lava.build",
77
- rpc: "https://cosmoshubt.tendermintrpc.lava.build:443",
78
- bech32Config: {
79
- bech32PrefixAccAddr: "cosmos",
80
- bech32PrefixAccPub: "cosmospub",
81
- bech32PrefixValAddr: "cosmosvaloper",
82
- bech32PrefixValPub: "cosmosvaloperpub",
83
- bech32PrefixConsAddr: "cosmosvalcons",
84
- bech32PrefixConsPub: "cosmosvalconspub"
85
- },
86
- chainName: "cosmoshubtestnet",
87
- feeCurrencies: [
88
- {
89
- coinDenom: "atom",
90
- coinMinimalDenom: "uatom",
91
- coinDecimals: 6,
92
- coinGeckoId: "",
93
- gasPriceStep: { low: 0.01, average: 0.025, high: 0.03 }
94
- }
95
- ],
96
- stakeCurrency: { coinDenom: "atom", coinMinimalDenom: "uatom", coinDecimals: 6 },
97
- bip44: { coinType: 118 }
98
- }
99
- ],
100
- onSwitchChain: () => {
101
- }
102
- } : cosmosConnector.config,
103
- [cosmosConnector]
104
- );
105
- const grazProviderProps = useMemo(() => {
106
- var _a2, _b;
107
- const connectorsGrazProviderProps = cosmosConnector == null ? void 0 : cosmosConnector.grazProviderProps;
108
- return __spreadProps(__spreadValues({}, connectorsGrazProviderProps), {
109
- walletConnect: __spreadProps(__spreadValues({}, connectorsGrazProviderProps == null ? void 0 : connectorsGrazProviderProps.walletConnect), {
110
- options: __spreadProps(__spreadValues({}, (_a2 = connectorsGrazProviderProps == null ? void 0 : connectorsGrazProviderProps.walletConnect) == null ? void 0 : _a2.options), { projectId: (_b = walletConnect == null ? void 0 : walletConnect.projectId) != null ? _b : "" })
111
- })
112
- });
113
- }, [cosmosConnector, walletConnect == null ? void 0 : walletConnect.projectId]);
114
- const handleSwitchWallet = useCallback(({ address, error }) => {
115
- if (error || !address) {
116
- resetModalState();
117
- }
118
- }, []);
119
- return /* @__PURE__ */ jsx(
120
- EvmWalletWrapper,
121
- {
122
- evmProviderConfig,
123
- wagmiProviderProps: (_a = evmConnector == null ? void 0 : evmConnector.wagmiProviderProps) != null ? _a : {},
124
- onSwitchWallet: handleSwitchWallet,
125
- children: /* @__PURE__ */ jsx(
126
- CosmosWalletWrapper,
127
- {
128
- cosmosConnectorConfig: cosmosProviderConfig,
129
- grazProviderProps,
130
- onSwitchWallet: handleSwitchWallet,
131
- children: /* @__PURE__ */ jsx(SolanaWalletWrapper, { onSwitchWallet: handleSwitchWallet, solanaProviderConfig, children: /* @__PURE__ */ jsx(ExternalWalletProvider, { children }) })
132
- }
133
- )
134
- }
135
- );
136
- };
137
- export {
138
- ExternalWalletWrapper
139
- };
@@ -1,9 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { ParaSolanaProviderConfigNoWallets } from '../types/externalWalletProviders.js';
3
- export declare const SolanaWalletWrapper: ({ children, solanaProviderConfig, onSwitchWallet, }: {
4
- solanaProviderConfig: ParaSolanaProviderConfigNoWallets;
5
- onSwitchWallet: ({ address, error }: {
6
- address?: string;
7
- error?: string;
8
- }) => void;
9
- } & PropsWithChildren) => string | number | boolean | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
@@ -1,36 +0,0 @@
1
- "use client";
2
- import "../../chunk-MMUBH76A.js";
3
- import { jsx } from "react/jsx-runtime";
4
- import { SolanaExternalWalletProvider } from "../providers/SolanaExternalWalletProvider.js";
5
- import { useInternalClient } from "../hooks/utils/useInternalClient.js";
6
- import { useStore } from "../stores/useStore.js";
7
- import { SolanaWallet } from "@getpara/react-common";
8
- const SolanaWalletWrapper = ({
9
- children,
10
- solanaProviderConfig,
11
- onSwitchWallet
12
- }) => {
13
- const externalWalletsWithFullAuth = useStore((state) => state.externalWalletsWithFullAuth);
14
- const para = useInternalClient();
15
- const wallets = useStore((state) => state.externalWallets);
16
- const isUsing = wallets.some((w) => w in SolanaWallet);
17
- if (!solanaProviderConfig) {
18
- if (isUsing) {
19
- throw new Error("A valid solanaConnector config is required to use an external Solana wallet.");
20
- }
21
- return children;
22
- }
23
- return /* @__PURE__ */ jsx(
24
- SolanaExternalWalletProvider,
25
- {
26
- config: solanaProviderConfig,
27
- internalConfig: { onSwitchWallet, para, walletsWithFullAuth: externalWalletsWithFullAuth },
28
- isUsing,
29
- wallets,
30
- children
31
- }
32
- );
33
- };
34
- export {
35
- SolanaWalletWrapper
36
- };
@@ -1,7 +0,0 @@
1
- import { Context } from 'react';
2
- import { CosmosExternalWalletContextType, ParaCosmosProvider, WalletList } from '@getpara/cosmos-wallet-connectors';
3
- export declare const getParaCosmosConnector: () => Promise<{
4
- Provider: typeof ParaCosmosProvider | undefined;
5
- context: Context<CosmosExternalWalletContextType>;
6
- wallets: WalletList;
7
- }>;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { CosmosExternalWalletContext } from "./stubs/CosmosExternalWalletContextStub.js";
6
- const getParaCosmosConnector = () => __async(void 0, null, function* () {
7
- let Provider, context, wallets;
8
- try {
9
- const lib = yield import("@getpara/cosmos-wallet-connectors");
10
- Provider = lib.ParaCosmosProvider;
11
- context = lib.CosmosExternalWalletContext;
12
- wallets = lib.allWallets;
13
- } catch (e) {
14
- Provider = void 0;
15
- context = CosmosExternalWalletContext;
16
- wallets = [];
17
- }
18
- return { Provider, context, wallets };
19
- });
20
- export {
21
- getParaCosmosConnector
22
- };
@@ -1,7 +0,0 @@
1
- import { Context } from 'react';
2
- import { EvmExternalWalletContextType, ParaEvmProvider, WalletList } from '@getpara/evm-wallet-connectors';
3
- export declare const getParaEvmConnector: () => Promise<{
4
- Provider: typeof ParaEvmProvider | undefined;
5
- context: Context<EvmExternalWalletContextType>;
6
- wallets: WalletList;
7
- }>;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { EvmExternalWalletContext } from "./stubs/EvmExternalWalletContextStub.js";
6
- const getParaEvmConnector = () => __async(void 0, null, function* () {
7
- let Provider, context, wallets;
8
- try {
9
- const lib = yield import("@getpara/evm-wallet-connectors");
10
- Provider = lib.ParaEvmProvider;
11
- context = lib.EvmExternalWalletContext;
12
- wallets = lib.allWallets;
13
- } catch (e) {
14
- Provider = void 0;
15
- context = EvmExternalWalletContext;
16
- wallets = [];
17
- }
18
- return { Provider, context, wallets };
19
- });
20
- export {
21
- getParaEvmConnector
22
- };
@@ -1,7 +0,0 @@
1
- import { Context } from 'react';
2
- import { ParaSolanaProvider, SolanaExternalWalletContextType, WalletList } from '@getpara/solana-wallet-connectors';
3
- export declare const getParaSolanaConnector: () => Promise<{
4
- Provider: typeof ParaSolanaProvider | undefined;
5
- context: Context<SolanaExternalWalletContextType>;
6
- wallets: WalletList;
7
- }>;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../chunk-MMUBH76A.js";
5
- import { SolanaExternalWalletContext } from "./stubs/SolanaExternalWalletContextStub.js";
6
- const getParaSolanaConnector = () => __async(void 0, null, function* () {
7
- let Provider, context, wallets;
8
- try {
9
- const lib = yield import("@getpara/solana-wallet-connectors");
10
- Provider = lib.ParaSolanaProvider;
11
- context = lib.SolanaExternalWalletContext;
12
- wallets = lib.allWallets;
13
- } catch (e) {
14
- Provider = void 0;
15
- context = SolanaExternalWalletContext;
16
- wallets = [];
17
- }
18
- return { Provider, context, wallets };
19
- });
20
- export {
21
- getParaSolanaConnector
22
- };
@@ -1,12 +0,0 @@
1
- import { CosmosExternalWalletContextType } from '@getpara/cosmos-wallet-connectors';
2
- export declare const defaultCosmosExternalWallet: {
3
- wallets: never[];
4
- chains: never[];
5
- chainId: undefined;
6
- disconnect: () => Promise<void>;
7
- switchChain: () => Promise<{}>;
8
- connectParaEmbedded: () => Promise<{}>;
9
- signMessage: () => Promise<{}>;
10
- signVerificationMessage: () => Promise<{}>;
11
- };
12
- export declare const CosmosExternalWalletContext: import("react").Context<CosmosExternalWalletContextType>;
@@ -1,18 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { createContext } from "react";
4
- const defaultCosmosExternalWallet = {
5
- wallets: [],
6
- chains: [],
7
- chainId: void 0,
8
- disconnect: () => Promise.resolve(),
9
- switchChain: () => Promise.resolve({}),
10
- connectParaEmbedded: () => Promise.resolve({}),
11
- signMessage: () => Promise.resolve({}),
12
- signVerificationMessage: () => Promise.resolve({})
13
- };
14
- const CosmosExternalWalletContext = createContext(defaultCosmosExternalWallet);
15
- export {
16
- CosmosExternalWalletContext,
17
- defaultCosmosExternalWallet
18
- };
@@ -1,3 +0,0 @@
1
- import { EvmExternalWalletContextType } from '@getpara/evm-wallet-connectors';
2
- export declare const defaultEvmExternalWallet: EvmExternalWalletContextType;
3
- export declare const EvmExternalWalletContext: import("react").Context<EvmExternalWalletContextType>;
@@ -1,21 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { createContext } from "react";
4
- const defaultEvmExternalWallet = {
5
- wallets: [],
6
- chains: [],
7
- chainId: void 0,
8
- username: void 0,
9
- avatar: void 0,
10
- disconnect: () => Promise.resolve(),
11
- switchChain: () => Promise.resolve({}),
12
- connectParaEmbedded: () => Promise.resolve({}),
13
- signMessage: () => Promise.resolve({}),
14
- signVerificationMessage: () => Promise.resolve({}),
15
- getWalletBalance: () => Promise.resolve(void 0)
16
- };
17
- const EvmExternalWalletContext = createContext(defaultEvmExternalWallet);
18
- export {
19
- EvmExternalWalletContext,
20
- defaultEvmExternalWallet
21
- };
@@ -1,8 +0,0 @@
1
- import { SolanaExternalWalletContextType } from '@getpara/solana-wallet-connectors';
2
- export declare const defaultSolanaExternalWallet: {
3
- wallets: never[];
4
- disconnect: () => Promise<void>;
5
- signMessage: () => Promise<{}>;
6
- signVerificationMessage: () => Promise<{}>;
7
- };
8
- export declare const SolanaExternalWalletContext: import("react").Context<SolanaExternalWalletContextType>;
@@ -1,14 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { createContext } from "react";
4
- const defaultSolanaExternalWallet = {
5
- wallets: [],
6
- disconnect: () => Promise.resolve(),
7
- signMessage: () => Promise.resolve({}),
8
- signVerificationMessage: () => Promise.resolve({})
9
- };
10
- const SolanaExternalWalletContext = createContext(defaultSolanaExternalWallet);
11
- export {
12
- SolanaExternalWalletContext,
13
- defaultSolanaExternalWallet
14
- };
@@ -1,3 +0,0 @@
1
- export * from './utils/index.js';
2
- export * from './queries/index.js';
3
- export * from './mutations/index.js';
@@ -1,4 +0,0 @@
1
- "use client";
2
- export * from "./utils/index.js";
3
- export * from "./queries/index.js";
4
- export * from "./mutations/index.js";
@@ -1,26 +0,0 @@
1
- export declare const useSignUpOrLogIn: () => import("../../types/utils.js").CoreMethodHook<"signUpOrLogIn">;
2
- export declare const useVerifyNewAccount: () => import("../../types/utils.js").CoreMethodHook<"verifyNewAccount">;
3
- export declare const useWaitForLogin: () => import("../../types/utils.js").CoreMethodHook<"waitForLogin">;
4
- export declare const useWaitForSignup: () => import("../../types/utils.js").CoreMethodHook<"waitForSignup">;
5
- export declare const useWaitForWalletCreation: () => import("../../types/utils.js").CoreMethodHook<"waitForWalletCreation">;
6
- export declare const useVerifyOAuth: () => import("../../types/utils.js").CoreMethodHook<"verifyOAuth">;
7
- export declare const useVerifyFarcaster: () => import("../../types/utils.js").CoreMethodHook<"verifyFarcaster">;
8
- export declare const useVerifyTelegram: () => import("../../types/utils.js").CoreMethodHook<"verifyTelegram">;
9
- export declare const useLoginExternalWallet: () => import("../../types/utils.js").CoreMethodHook<"loginExternalWallet">;
10
- export declare const useVerifyExternalWallet: () => import("../../types/utils.js").CoreMethodHook<"verifyExternalWallet">;
11
- export declare const useSetup2fa: () => import("../../types/utils.js").CoreMethodHook<"setup2fa">;
12
- export declare const useEnable2fa: () => import("../../types/utils.js").CoreMethodHook<"enable2fa">;
13
- export declare const useVerify2fa: () => import("../../types/utils.js").CoreMethodHook<"verify2fa">;
14
- export declare const useKeepSessionAlive: () => import("../../types/utils.js").CoreMethodHook<"keepSessionAlive">;
15
- export declare const useLogout: () => import("../../types/utils.js").CoreMethodHook<"logout">;
16
- export declare const useResendVerificationCode: () => import("../../types/utils.js").CoreMethodHook<"resendVerificationCode">;
17
- export declare const useCreateWallet: () => import("../../types/utils.js").CoreMethodHook<"createWallet">;
18
- export declare const useCreateWalletPerType: () => import("../../types/utils.js").CoreMethodHook<"createWalletPerType">;
19
- export declare const useCreatePregenWallet: () => import("../../types/utils.js").CoreMethodHook<"createPregenWallet">;
20
- export declare const useCreatePregenWalletPerType: () => import("../../types/utils.js").CoreMethodHook<"createPregenWalletPerType">;
21
- export declare const useClaimPregenWallets: () => import("../../types/utils.js").CoreMethodHook<"claimPregenWallets">;
22
- export declare const useHasPregenWallet: () => import("../../types/utils.js").CoreMethodHook<"hasPregenWallet">;
23
- export declare const useUpdatePregenWalletIdentifier: () => import("../../types/utils.js").CoreMethodHook<"updatePregenWalletIdentifier">;
24
- export declare const useCreateGuestWallets: () => import("../../types/utils.js").CoreMethodHook<"createGuestWallets">;
25
- export declare const useSignMessage: () => import("../../types/utils.js").CoreMethodHook<"signMessage">;
26
- export declare const useSignTransaction: () => import("../../types/utils.js").CoreMethodHook<"signTransaction">;
@@ -1,61 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import * as actions from "../../actions/index.js";
4
- import { generateHook } from "./utils.js";
5
- const useSignUpOrLogIn = generateHook("signUpOrLogIn", actions.signUpOrLogIn);
6
- const useVerifyNewAccount = generateHook("verifyNewAccount", actions.verifyNewAccount);
7
- const useWaitForLogin = generateHook("waitForLogin", actions.waitForLogin);
8
- const useWaitForSignup = generateHook("waitForSignup", actions.waitForSignup);
9
- const useWaitForWalletCreation = generateHook("waitForWalletCreation", actions.waitForWalletCreation);
10
- const useVerifyOAuth = generateHook("verifyOAuth", actions.verifyOAuth);
11
- const useVerifyFarcaster = generateHook("verifyFarcaster", actions.verifyFarcaster);
12
- const useVerifyTelegram = generateHook("verifyTelegram", actions.verifyTelegram);
13
- const useLoginExternalWallet = generateHook("loginExternalWallet", actions.loginExternalWallet);
14
- const useVerifyExternalWallet = generateHook("verifyExternalWallet", actions.verifyExternalWallet);
15
- const useSetup2fa = generateHook("setup2fa", actions.setup2fa);
16
- const useEnable2fa = generateHook("enable2fa", actions.enable2fa);
17
- const useVerify2fa = generateHook("verify2fa", actions.verify2fa);
18
- const useKeepSessionAlive = generateHook("keepSessionAlive", actions.keepSessionAlive);
19
- const useLogout = generateHook("logout", actions.logout);
20
- const useResendVerificationCode = generateHook("resendVerificationCode", actions.resendVerificationCode);
21
- const useCreateWallet = generateHook("createWallet", actions.createWallet);
22
- const useCreateWalletPerType = generateHook("createWalletPerType", actions.createWalletPerType);
23
- const useCreatePregenWallet = generateHook("createPregenWallet", actions.createPregenWallet);
24
- const useCreatePregenWalletPerType = generateHook("createPregenWalletPerType", actions.createPregenWalletPerType);
25
- const useClaimPregenWallets = generateHook("claimPregenWallets", actions.claimPregenWallets);
26
- const useHasPregenWallet = generateHook("hasPregenWallet", actions.hasPregenWallet);
27
- const useUpdatePregenWalletIdentifier = generateHook(
28
- "updatePregenWalletIdentifier",
29
- actions.updatePregenWalletIdentifier
30
- );
31
- const useCreateGuestWallets = generateHook("createGuestWallets", actions.createGuestWallets);
32
- const useSignMessage = generateHook("signMessage", actions.signMessage);
33
- const useSignTransaction = generateHook("signTransaction", actions.signTransaction);
34
- export {
35
- useClaimPregenWallets,
36
- useCreateGuestWallets,
37
- useCreatePregenWallet,
38
- useCreatePregenWalletPerType,
39
- useCreateWallet,
40
- useCreateWalletPerType,
41
- useEnable2fa,
42
- useHasPregenWallet,
43
- useKeepSessionAlive,
44
- useLoginExternalWallet,
45
- useLogout,
46
- useResendVerificationCode,
47
- useSetup2fa,
48
- useSignMessage,
49
- useSignTransaction,
50
- useSignUpOrLogIn,
51
- useUpdatePregenWalletIdentifier,
52
- useVerify2fa,
53
- useVerifyExternalWallet,
54
- useVerifyFarcaster,
55
- useVerifyNewAccount,
56
- useVerifyOAuth,
57
- useVerifyTelegram,
58
- useWaitForLogin,
59
- useWaitForSignup,
60
- useWaitForWalletCreation
61
- };
@@ -1,4 +0,0 @@
1
- import { CoreMethodName, CoreMethodParams, CoreMethods } from '@getpara/web-sdk';
2
- import { CoreMethodHook } from '../../types/utils.js';
3
- import { CoreAction } from '../../actions/utils.js';
4
- export declare function generateHook<const method extends CoreMethodName & keyof CoreMethods>(method: method, action: CoreAction<method>, defaultParams?: CoreMethodParams<method>): () => CoreMethodHook<method>;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { renameCoreMutations } from "../../utils/renameMutations.js";
6
- import { useClient } from "../utils/index.js";
7
- import { useMutation } from "@tanstack/react-query";
8
- function generateHook(method, action, defaultParams) {
9
- return () => {
10
- const para = useClient();
11
- const mutation = useMutation({
12
- mutationFn: (args) => __async(this, null, function* () {
13
- const result = yield action(para, args != null ? args : defaultParams);
14
- return result;
15
- })
16
- });
17
- return renameCoreMutations(mutation, method);
18
- };
19
- }
20
- export {
21
- generateHook
22
- };
@@ -1,3 +0,0 @@
1
- export { useAccount } from './useAccount.js';
2
- export { useWallet } from './useWallet.js';
3
- export { useWalletBalance } from './useWalletBalance.js';
@@ -1,10 +0,0 @@
1
- "use client";
2
- import "../../../chunk-MMUBH76A.js";
3
- import { useAccount } from "./useAccount.js";
4
- import { useWallet } from "./useWallet.js";
5
- import { useWalletBalance } from "./useWalletBalance.js";
6
- export {
7
- useAccount,
8
- useWallet,
9
- useWalletBalance
10
- };
@@ -1,5 +0,0 @@
1
- export declare const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
2
- /**
3
- * Hook for retrieving a user account
4
- */
5
- export declare const useAccount: () => import("@tanstack/react-query").UseQueryResult<import("../../actions/getAccount.js").Account, Error>;
@@ -1,21 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { useQuery } from "@tanstack/react-query";
6
- import { getAccount } from "../../actions/getAccount.js";
7
- import { useInternalClient } from "../utils/useInternalClient.js";
8
- const ACCOUNT_BASE_KEY = "PARA_ACCOUNT";
9
- const useAccount = () => {
10
- const client = useInternalClient();
11
- return useQuery({
12
- queryKey: [ACCOUNT_BASE_KEY, client == null ? void 0 : client.getUserId()],
13
- queryFn: () => __async(void 0, null, function* () {
14
- return yield getAccount(client);
15
- })
16
- });
17
- };
18
- export {
19
- ACCOUNT_BASE_KEY,
20
- useAccount
21
- };
@@ -1,5 +0,0 @@
1
- export declare const WALLET_BASE_KEY = "PARA_WALLET";
2
- /**
3
- * Hook for retrieving the selected wallet
4
- */
5
- export declare const useWallet: () => import("@tanstack/react-query").UseQueryResult<Omit<import("@getpara/core-sdk").Wallet, "signer"> | null | undefined, Error>;
@@ -1,22 +0,0 @@
1
- "use client";
2
- import {
3
- __async
4
- } from "../../../chunk-MMUBH76A.js";
5
- import { useQuery } from "@tanstack/react-query";
6
- import { useClient, useWalletState } from "../index.js";
7
- import { getWallet } from "../../actions/getWallet.js";
8
- const WALLET_BASE_KEY = "PARA_WALLET";
9
- const useWallet = () => {
10
- const client = useClient();
11
- const { selectedWallet } = useWalletState();
12
- return useQuery({
13
- queryKey: [WALLET_BASE_KEY, client == null ? void 0 : client.getUserId(), selectedWallet.id, selectedWallet.type],
14
- queryFn: () => __async(void 0, null, function* () {
15
- return yield getWallet(client, selectedWallet);
16
- })
17
- });
18
- };
19
- export {
20
- WALLET_BASE_KEY,
21
- useWallet
22
- };
@@ -1,6 +0,0 @@
1
- import { GetWalletBalanceParams } from '@getpara/web-sdk';
2
- export declare const WALLET_BALANCE_BASE_KEY = "PARA_WALLET_BALANCE";
3
- /**
4
- * Hook for retrieving a wallet balance
5
- */
6
- export declare const useWalletBalance: (args?: Partial<GetWalletBalanceParams>) => import("@tanstack/react-query").UseQueryResult<string | null, Error>;
@@ -1,55 +0,0 @@
1
- "use client";
2
- import {
3
- __async,
4
- __spreadValues
5
- } from "../../../chunk-MMUBH76A.js";
6
- import { useQuery } from "@tanstack/react-query";
7
- import { useAccount, useClient, useWallet, useWalletState } from "../index.js";
8
- import { useStore } from "../../stores/useStore.js";
9
- import { getWalletBalance } from "../../actions/index.js";
10
- import { useExternalWallets } from "../../providers/ExternalWalletProvider.js";
11
- import { useCallback } from "react";
12
- const WALLET_BALANCE_BASE_KEY = "PARA_WALLET_BALANCE";
13
- const useWalletBalance = (args) => {
14
- const client = useClient();
15
- const { data: selectedWallet } = useWallet();
16
- const {
17
- selectedWallet: { type: selectedWalletType }
18
- } = useWalletState();
19
- const { data: account } = useAccount();
20
- const rpcUrl = useStore((state) => state.rpcUrl);
21
- const { getWalletBalance: getExternalWalletBalance, chainId } = useExternalWallets();
22
- const queryFn = useCallback(() => __async(void 0, null, function* () {
23
- var _a, _b, _c;
24
- const skipGetBalance = !selectedWallet || selectedWalletType && ["COSMOS", "SOLANA"].includes(selectedWalletType);
25
- if (skipGetBalance) {
26
- return null;
27
- }
28
- try {
29
- if (selectedWallet.isExternal) {
30
- return (_a = yield getExternalWalletBalance()) != null ? _a : null;
31
- } else {
32
- const completeArgs = __spreadValues({ walletId: (_b = selectedWallet == null ? void 0 : selectedWallet.id) != null ? _b : "", rpcUrl }, args);
33
- return (_c = yield getWalletBalance(client, completeArgs)) != null ? _c : null;
34
- }
35
- } catch (err) {
36
- console.error("Error fetching wallet balance: ", err);
37
- return null;
38
- }
39
- }), [account, selectedWallet, selectedWalletType, rpcUrl, getExternalWalletBalance]);
40
- return useQuery({
41
- queryKey: [
42
- WALLET_BALANCE_BASE_KEY,
43
- client == null ? void 0 : client.userId,
44
- selectedWallet == null ? void 0 : selectedWallet.id,
45
- selectedWallet == null ? void 0 : selectedWallet.type,
46
- (selectedWallet == null ? void 0 : selectedWallet.isExternal) ? chainId : ""
47
- ],
48
- queryFn,
49
- enabled: !!selectedWallet && !!rpcUrl && !!(account == null ? void 0 : account.isConnected)
50
- });
51
- };
52
- export {
53
- WALLET_BALANCE_BASE_KEY,
54
- useWalletBalance
55
- };
@@ -1,3 +0,0 @@
1
- export { useClient } from './useClient.js';
2
- export { useModal } from './useModal.js';
3
- export { useWalletState } from './useWalletState.js';