@mezo-org/passport 0.4.0-dev.45 → 0.4.0-dev.46

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 (265) hide show
  1. package/dist/src/api/auth.d.ts +78 -0
  2. package/dist/src/api/auth.d.ts.map +1 -0
  3. package/dist/src/api/auth.js +77 -0
  4. package/dist/src/api/auth.js.map +1 -0
  5. package/dist/src/api/client.d.ts +24 -0
  6. package/dist/src/api/client.d.ts.map +1 -0
  7. package/dist/src/api/client.js +54 -0
  8. package/dist/src/api/client.js.map +1 -0
  9. package/dist/src/api/fetch-error.d.ts +5 -0
  10. package/dist/src/api/fetch-error.d.ts.map +1 -0
  11. package/dist/src/api/fetch-error.js +8 -0
  12. package/dist/src/api/fetch-error.js.map +1 -0
  13. package/dist/src/api/index.d.ts +3 -0
  14. package/dist/src/api/index.d.ts.map +1 -0
  15. package/dist/src/api/index.js +3 -0
  16. package/dist/src/api/index.js.map +1 -0
  17. package/dist/src/api/portal.d.ts +33 -0
  18. package/dist/src/api/portal.d.ts.map +1 -0
  19. package/dist/src/api/portal.js +23 -0
  20. package/dist/src/api/portal.js.map +1 -0
  21. package/dist/src/assets/DefaultAvatar.d.ts +5 -0
  22. package/dist/src/assets/DefaultAvatar.d.ts.map +1 -0
  23. package/dist/src/assets/DefaultAvatar.js +21 -0
  24. package/dist/src/assets/DefaultAvatar.js.map +1 -0
  25. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +8 -0
  26. package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +1 -0
  27. package/dist/src/components/Dropdown/ConnectedTrigger.js +39 -0
  28. package/dist/src/components/Dropdown/ConnectedTrigger.js.map +1 -0
  29. package/dist/src/components/Dropdown/Content.d.ts +23 -0
  30. package/dist/src/components/Dropdown/Content.d.ts.map +1 -0
  31. package/dist/src/components/Dropdown/Content.js +27 -0
  32. package/dist/src/components/Dropdown/Content.js.map +1 -0
  33. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +7 -0
  34. package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +1 -0
  35. package/dist/src/components/Dropdown/DisconnectedTrigger.js +13 -0
  36. package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +1 -0
  37. package/dist/src/components/Dropdown/Dropdown.d.ts +27 -0
  38. package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -0
  39. package/dist/src/components/Dropdown/Dropdown.js +68 -0
  40. package/dist/src/components/Dropdown/Dropdown.js.map +1 -0
  41. package/dist/src/components/Dropdown/ListingItem.d.ts +13 -0
  42. package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -0
  43. package/dist/src/components/Dropdown/ListingItem.js +34 -0
  44. package/dist/src/components/Dropdown/ListingItem.js.map +1 -0
  45. package/dist/src/components/Dropdown/NestedViewLayout.d.ts +7 -0
  46. package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -0
  47. package/dist/src/components/Dropdown/NestedViewLayout.js +34 -0
  48. package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -0
  49. package/dist/src/components/Dropdown/Receive/Receive.d.ts +7 -0
  50. package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +1 -0
  51. package/dist/src/components/Dropdown/Receive/Receive.js +53 -0
  52. package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -0
  53. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +7 -0
  54. package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +1 -0
  55. package/dist/src/components/Dropdown/Root/AccountAddressActions.js +48 -0
  56. package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -0
  57. package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts +11 -0
  58. package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts.map +1 -0
  59. package/dist/src/components/Dropdown/Root/AccountAssetItem.js +9 -0
  60. package/dist/src/components/Dropdown/Root/AccountAssetItem.js.map +1 -0
  61. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +8 -0
  62. package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -0
  63. package/dist/src/components/Dropdown/Root/AccountBalance.js +15 -0
  64. package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -0
  65. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +9 -0
  66. package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -0
  67. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +48 -0
  68. package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -0
  69. package/dist/src/components/Dropdown/Root/Root.d.ts +23 -0
  70. package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -0
  71. package/dist/src/components/Dropdown/Root/Root.js +57 -0
  72. package/dist/src/components/Dropdown/Root/Root.js.map +1 -0
  73. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +8 -0
  74. package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +1 -0
  75. package/dist/src/components/Dropdown/Root/WalletAddress.js +64 -0
  76. package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -0
  77. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +8 -0
  78. package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +1 -0
  79. package/dist/src/components/Dropdown/Root/WelcomeBlock.js +44 -0
  80. package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -0
  81. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +3 -0
  82. package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +1 -0
  83. package/dist/src/components/Dropdown/TestnetTopBanner.js +14 -0
  84. package/dist/src/components/Dropdown/TestnetTopBanner.js.map +1 -0
  85. package/dist/src/components/Dropdown/index.d.ts +3 -0
  86. package/dist/src/components/Dropdown/index.d.ts.map +1 -0
  87. package/dist/src/components/Dropdown/index.js +2 -0
  88. package/dist/src/components/Dropdown/index.js.map +1 -0
  89. package/dist/src/components/index.d.ts +2 -0
  90. package/dist/src/components/index.d.ts.map +1 -0
  91. package/dist/src/components/index.js +2 -0
  92. package/dist/src/components/index.js.map +1 -0
  93. package/dist/src/config.d.ts +33 -0
  94. package/dist/src/config.d.ts.map +1 -0
  95. package/dist/src/config.js +75 -0
  96. package/dist/src/config.js.map +1 -0
  97. package/dist/src/constants.d.ts +16 -0
  98. package/dist/src/constants.d.ts.map +1 -0
  99. package/dist/src/constants.js +17 -0
  100. package/dist/src/constants.js.map +1 -0
  101. package/dist/src/hooks/constants.d.ts +7 -0
  102. package/dist/src/hooks/constants.d.ts.map +1 -0
  103. package/dist/src/hooks/constants.js +7 -0
  104. package/dist/src/hooks/constants.js.map +1 -0
  105. package/dist/src/hooks/index.d.ts +15 -0
  106. package/dist/src/hooks/index.d.ts.map +1 -0
  107. package/dist/src/hooks/index.js +15 -0
  108. package/dist/src/hooks/index.js.map +1 -0
  109. package/dist/src/hooks/useAssetsConversionRates.d.ts +7 -0
  110. package/dist/src/hooks/useAssetsConversionRates.d.ts.map +1 -0
  111. package/dist/src/hooks/useAssetsConversionRates.js +24 -0
  112. package/dist/src/hooks/useAssetsConversionRates.js.map +1 -0
  113. package/dist/src/hooks/useAuthApiClient.d.ts +2 -0
  114. package/dist/src/hooks/useAuthApiClient.d.ts.map +1 -0
  115. package/dist/src/hooks/useAuthApiClient.js +6 -0
  116. package/dist/src/hooks/useAuthApiClient.js.map +1 -0
  117. package/dist/src/hooks/useAuthenticateWithWallet.d.ts +73 -0
  118. package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -0
  119. package/dist/src/hooks/useAuthenticateWithWallet.js +69 -0
  120. package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -0
  121. package/dist/src/hooks/useBorrowData.d.ts +60 -0
  122. package/dist/src/hooks/useBorrowData.d.ts.map +1 -0
  123. package/dist/src/hooks/useBorrowData.js +122 -0
  124. package/dist/src/hooks/useBorrowData.js.map +1 -0
  125. package/dist/src/hooks/useCreateAccount.d.ts +108 -0
  126. package/dist/src/hooks/useCreateAccount.d.ts.map +1 -0
  127. package/dist/src/hooks/useCreateAccount.js +21 -0
  128. package/dist/src/hooks/useCreateAccount.js.map +1 -0
  129. package/dist/src/hooks/useCreateSession.d.ts +76 -0
  130. package/dist/src/hooks/useCreateSession.d.ts.map +1 -0
  131. package/dist/src/hooks/useCreateSession.js +29 -0
  132. package/dist/src/hooks/useCreateSession.js.map +1 -0
  133. package/dist/src/hooks/useDropdownData.d.ts +47 -0
  134. package/dist/src/hooks/useDropdownData.d.ts.map +1 -0
  135. package/dist/src/hooks/useDropdownData.js +95 -0
  136. package/dist/src/hooks/useDropdownData.js.map +1 -0
  137. package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts +5 -0
  138. package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts.map +1 -0
  139. package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js +34 -0
  140. package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js.map +1 -0
  141. package/dist/src/hooks/useGetAccountByAddress.d.ts +4 -0
  142. package/dist/src/hooks/useGetAccountByAddress.d.ts.map +1 -0
  143. package/dist/src/hooks/useGetAccountByAddress.js +17 -0
  144. package/dist/src/hooks/useGetAccountByAddress.js.map +1 -0
  145. package/dist/src/hooks/useGetAccountByMezoId.d.ts +4 -0
  146. package/dist/src/hooks/useGetAccountByMezoId.d.ts.map +1 -0
  147. package/dist/src/hooks/useGetAccountByMezoId.js +17 -0
  148. package/dist/src/hooks/useGetAccountByMezoId.js.map +1 -0
  149. package/dist/src/hooks/useGetCurrentAccount.d.ts +18 -0
  150. package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -0
  151. package/dist/src/hooks/useGetCurrentAccount.js +37 -0
  152. package/dist/src/hooks/useGetCurrentAccount.js.map +1 -0
  153. package/dist/src/hooks/useGetSession.d.ts +4 -0
  154. package/dist/src/hooks/useGetSession.d.ts.map +1 -0
  155. package/dist/src/hooks/useGetSession.js +15 -0
  156. package/dist/src/hooks/useGetSession.js.map +1 -0
  157. package/dist/src/hooks/useLinkAccount.d.ts +72 -0
  158. package/dist/src/hooks/useLinkAccount.d.ts.map +1 -0
  159. package/dist/src/hooks/useLinkAccount.js +19 -0
  160. package/dist/src/hooks/useLinkAccount.js.map +1 -0
  161. package/dist/src/hooks/usePassportContext.d.ts +3 -0
  162. package/dist/src/hooks/usePassportContext.d.ts.map +1 -0
  163. package/dist/src/hooks/usePassportContext.js +10 -0
  164. package/dist/src/hooks/usePassportContext.js.map +1 -0
  165. package/dist/src/hooks/usePortalApiClient.d.ts +2 -0
  166. package/dist/src/hooks/usePortalApiClient.d.ts.map +1 -0
  167. package/dist/src/hooks/usePortalApiClient.js +6 -0
  168. package/dist/src/hooks/usePortalApiClient.js.map +1 -0
  169. package/dist/src/hooks/useRefreshPassport.d.ts +19 -0
  170. package/dist/src/hooks/useRefreshPassport.d.ts.map +1 -0
  171. package/dist/src/hooks/useRefreshPassport.js +44 -0
  172. package/dist/src/hooks/useRefreshPassport.js.map +1 -0
  173. package/dist/src/hooks/useSignInWithDiscord.d.ts +73 -0
  174. package/dist/src/hooks/useSignInWithDiscord.d.ts.map +1 -0
  175. package/dist/src/hooks/useSignInWithDiscord.js +25 -0
  176. package/dist/src/hooks/useSignInWithDiscord.js.map +1 -0
  177. package/dist/src/hooks/useSignInWithWallet.d.ts +73 -0
  178. package/dist/src/hooks/useSignInWithWallet.d.ts.map +1 -0
  179. package/dist/src/hooks/useSignInWithWallet.js +11 -0
  180. package/dist/src/hooks/useSignInWithWallet.js.map +1 -0
  181. package/dist/src/hooks/useSignOut.d.ts +72 -0
  182. package/dist/src/hooks/useSignOut.d.ts.map +1 -0
  183. package/dist/src/hooks/useSignOut.js +22 -0
  184. package/dist/src/hooks/useSignOut.js.map +1 -0
  185. package/dist/src/hooks/useSignUpWithWallet.d.ts +73 -0
  186. package/dist/src/hooks/useSignUpWithWallet.d.ts.map +1 -0
  187. package/dist/src/hooks/useSignUpWithWallet.js +11 -0
  188. package/dist/src/hooks/useSignUpWithWallet.js.map +1 -0
  189. package/dist/src/hooks/useTokensBalances.d.ts +74 -0
  190. package/dist/src/hooks/useTokensBalances.d.ts.map +1 -0
  191. package/dist/src/hooks/useTokensBalances.js +140 -0
  192. package/dist/src/hooks/useTokensBalances.js.map +1 -0
  193. package/dist/src/hooks/useUpdateMezoId.d.ts +108 -0
  194. package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -0
  195. package/dist/src/hooks/useUpdateMezoId.js +19 -0
  196. package/dist/src/hooks/useUpdateMezoId.js.map +1 -0
  197. package/dist/src/hooks/useWalletAccount.d.ts +13 -0
  198. package/dist/src/hooks/useWalletAccount.d.ts.map +1 -0
  199. package/dist/src/hooks/useWalletAccount.js +29 -0
  200. package/dist/src/hooks/useWalletAccount.js.map +1 -0
  201. package/dist/src/hooks/useWatchTransferEvents.d.ts +5 -0
  202. package/dist/src/hooks/useWatchTransferEvents.d.ts.map +1 -0
  203. package/dist/src/hooks/useWatchTransferEvents.js +63 -0
  204. package/dist/src/hooks/useWatchTransferEvents.js.map +1 -0
  205. package/dist/src/index.d.ts +7 -0
  206. package/dist/src/index.d.ts.map +1 -0
  207. package/dist/src/index.js +7 -0
  208. package/dist/src/index.js.map +1 -0
  209. package/dist/src/lib/contracts/index.d.ts +13 -0
  210. package/dist/src/lib/contracts/index.d.ts.map +1 -0
  211. package/dist/src/lib/contracts/index.js +57 -0
  212. package/dist/src/lib/contracts/index.js.map +1 -0
  213. package/dist/src/provider.d.ts +17 -0
  214. package/dist/src/provider.d.ts.map +1 -0
  215. package/dist/src/provider.js +16 -0
  216. package/dist/src/provider.js.map +1 -0
  217. package/dist/src/stores/dropdownStore.d.ts +12 -0
  218. package/dist/src/stores/dropdownStore.d.ts.map +1 -0
  219. package/dist/src/stores/dropdownStore.js +13 -0
  220. package/dist/src/stores/dropdownStore.js.map +1 -0
  221. package/dist/src/utils/address.d.ts +15 -0
  222. package/dist/src/utils/address.d.ts.map +1 -0
  223. package/dist/src/utils/address.js +37 -0
  224. package/dist/src/utils/address.js.map +1 -0
  225. package/dist/src/utils/address.test.d.ts +2 -0
  226. package/dist/src/utils/address.test.d.ts.map +1 -0
  227. package/dist/src/utils/address.test.js +40 -0
  228. package/dist/src/utils/address.test.js.map +1 -0
  229. package/dist/src/utils/cryptoAssets.d.ts +44 -0
  230. package/dist/src/utils/cryptoAssets.d.ts.map +1 -0
  231. package/dist/src/utils/cryptoAssets.js +131 -0
  232. package/dist/src/utils/cryptoAssets.js.map +1 -0
  233. package/dist/src/utils/cryptoAssets.test.d.ts +2 -0
  234. package/dist/src/utils/cryptoAssets.test.d.ts.map +1 -0
  235. package/dist/src/utils/cryptoAssets.test.js +67 -0
  236. package/dist/src/utils/cryptoAssets.test.js.map +1 -0
  237. package/dist/src/utils/currency.d.ts +14 -0
  238. package/dist/src/utils/currency.d.ts.map +1 -0
  239. package/dist/src/utils/currency.js +27 -0
  240. package/dist/src/utils/currency.js.map +1 -0
  241. package/dist/src/utils/currency.test.d.ts +2 -0
  242. package/dist/src/utils/currency.test.d.ts.map +1 -0
  243. package/dist/src/utils/currency.test.js +34 -0
  244. package/dist/src/utils/currency.test.js.map +1 -0
  245. package/dist/src/utils/numbers.d.ts +58 -0
  246. package/dist/src/utils/numbers.d.ts.map +1 -0
  247. package/dist/src/utils/numbers.js +132 -0
  248. package/dist/src/utils/numbers.js.map +1 -0
  249. package/dist/src/utils/numbers.test.d.ts +2 -0
  250. package/dist/src/utils/numbers.test.d.ts.map +1 -0
  251. package/dist/src/utils/numbers.test.js +170 -0
  252. package/dist/src/utils/numbers.test.js.map +1 -0
  253. package/dist/src/utils/siww.d.ts +4 -0
  254. package/dist/src/utils/siww.d.ts.map +1 -0
  255. package/dist/src/utils/siww.js +19 -0
  256. package/dist/src/utils/siww.js.map +1 -0
  257. package/dist/src/utils/time.d.ts +5 -0
  258. package/dist/src/utils/time.d.ts.map +1 -0
  259. package/dist/src/utils/time.js +5 -0
  260. package/dist/src/utils/time.js.map +1 -0
  261. package/dist/src/wallet/index.d.ts +2 -0
  262. package/dist/src/wallet/index.d.ts.map +1 -0
  263. package/dist/src/wallet/index.js +2 -0
  264. package/dist/src/wallet/index.js.map +1 -0
  265. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ import { StatefulPopover, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import { useConnectModal } from "@rainbow-me/rainbowkit";
3
+ import React, { useEffect, useMemo } from "react";
4
+ import { useDisconnect } from "wagmi";
5
+ import DefaultAvatar from "../../assets/DefaultAvatar";
6
+ import useWalletAccount from "../../hooks/useWalletAccount";
7
+ import ConnectedTrigger from "./ConnectedTrigger";
8
+ import Content from "./Content";
9
+ import DisconnectedTrigger from "./DisconnectedTrigger";
10
+ import { useSignInWithWallet } from "../../hooks";
11
+ import useDropdownData from "../../hooks/useDropdownData";
12
+ /**
13
+ * Passport Dropdown component that displays user's wallet and assets information.
14
+ * @param {DropdownProps} props - Component props.
15
+ * @returns {JSX.Element}
16
+ */
17
+ export function Dropdown(props) {
18
+ const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick, accountDataRefetchInterval, nativeBalanceRefetchInterval, ...restProps } = props;
19
+ const [, theme] = useStyletron();
20
+ const data = useDropdownData({
21
+ accountDataRefetchInterval,
22
+ nativeBalanceRefetchInterval,
23
+ });
24
+ const isCriticalDropdownDataLoaded = useMemo(() => Boolean(data.mezoId && data.accountAddress && data.walletAddress), [data]);
25
+ const { openConnectModal } = useConnectModal();
26
+ const { isConnected } = useWalletAccount();
27
+ const { signInWithWalletAsync, isPending } = useSignInWithWallet();
28
+ const { disconnectAsync } = useDisconnect();
29
+ useEffect(() => {
30
+ if (onSignIn)
31
+ return;
32
+ const handleSignIn = async () => {
33
+ if (!isConnected)
34
+ return;
35
+ try {
36
+ await signInWithWalletAsync();
37
+ }
38
+ catch (error) {
39
+ await disconnectAsync();
40
+ }
41
+ };
42
+ handleSignIn();
43
+ }, [disconnectAsync, isConnected, onSignIn, signInWithWalletAsync]);
44
+ if (!isConnected || !isCriticalDropdownDataLoaded) {
45
+ return (React.createElement(DisconnectedTrigger
46
+ // If connect wallet flow is not provided it fallbacks to RainbowKit's
47
+ // connect modal
48
+ , {
49
+ // If connect wallet flow is not provided it fallbacks to RainbowKit's
50
+ // connect modal
51
+ onClick: onSignIn || openConnectModal, isLoading: isPending, ...triggerProps?.signedOut }, "Sign in"));
52
+ }
53
+ return (React.createElement(StatefulPopover, { content: React.createElement(Content, { mezoId: data.mezoId, matsBalance: data.matsBalance, accountAddress: data.accountAddress, walletAddress: data.walletAddress, walletType: data.walletType, usdTotalBalance: data.usdTotalBalance, usdTroveDebt: data.usdTroveDebt, usdCollateral: data.usdCollateral, assets: data.assets, otherAssetsCount: data.otherAssetsCount, otherAssetsUsdTotal: data.otherAssetsUsdTotal, onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick }), placement: placement, animateOutTime: animateOutTime, overrides: {
54
+ ...overrides,
55
+ Body: {
56
+ ...overrides?.Body,
57
+ style: {
58
+ width: "396px",
59
+ borderRadius: theme.borders.radius500,
60
+ boxShadow: theme.lighting.shadow500,
61
+ overflow: "hidden",
62
+ ...overrides?.Body?.style,
63
+ },
64
+ },
65
+ }, ...restProps },
66
+ React.createElement(ConnectedTrigger, { avatar: React.createElement(DefaultAvatar, null), ...triggerProps?.signedIn })));
67
+ }
68
+ //# sourceMappingURL=Dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA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AK,EAAE,OAAO;oBACd,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;oBACrC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,GAAG,SAAS,EAAE,IAAI,EAAE,KAAK;iBAC1B;aACF;SACF,KACG,SAAS;QAEb,oBAAC,gBAAgB,IACf,MAAM,EAAE,oBAAC,aAAa,OAAG,KACrB,YAAY,EAAE,QAAQ,GAC1B,CACc,CACnB,CAAA;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { IconProps, ListItemProps } from "@mezo-org/mezo-clay";
2
+ import React, { FC } from "react";
3
+ type ListingItemProps = {
4
+ icon?: FC<IconProps>;
5
+ label: string;
6
+ subLabel?: string;
7
+ value: string;
8
+ subValue?: string;
9
+ overrides?: ListItemProps["overrides"];
10
+ };
11
+ export default function ListingItem(props: ListingItemProps): React.JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=ListingItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListingItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACT,aAAa,EACd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAUjC,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;CACvC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAoD1D"}
@@ -0,0 +1,34 @@
1
+ import { ListItem, ListItemLabel, mergeOverrides, } from "@mezo-org/mezo-clay";
2
+ import React from "react";
3
+ const SHARED_LABEL_OVERRIDES = {
4
+ LabelDescription: {
5
+ style: {
6
+ color: "#4B4B4B", // contentSecondary
7
+ },
8
+ },
9
+ };
10
+ export default function ListingItem(props) {
11
+ const { icon: Icon, label, subLabel = "", value, subValue = "", overrides, } = props;
12
+ return (React.createElement(ListItem, { artwork: Icon,
13
+ // eslint-disable-next-line react/no-unstable-nested-components
14
+ endEnhancer: () => (React.createElement(ListItemLabel, { description: subValue, overrides: mergeOverrides({
15
+ LabelRoot: {
16
+ style: {
17
+ textAlign: "right",
18
+ },
19
+ },
20
+ }, SHARED_LABEL_OVERRIDES) }, value)), overrides: mergeOverrides({
21
+ Root: {
22
+ style: {
23
+ backgroundColor: "transparent",
24
+ },
25
+ },
26
+ Content: {
27
+ style: {
28
+ border: 0,
29
+ },
30
+ },
31
+ }, overrides) },
32
+ React.createElement(ListItemLabel, { description: subLabel, overrides: SHARED_LABEL_OVERRIDES }, label)));
33
+ }
34
+ //# sourceMappingURL=ListingItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListingItem.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,aAAa,EACb,cAAc,GAIf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAa,MAAM,OAAO,CAAA;AAEjC,MAAM,sBAAsB,GAAoC;IAC9D,gBAAgB,EAAE;QAChB,KAAK,EAAE;YACL,KAAK,EAAE,SAAS,EAAE,mBAAmB;SACtC;KACF;CACF,CAAA;AAWD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAuB;IACzD,MAAM,EACJ,IAAI,EAAE,IAAI,EACV,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,SAAS,GACV,GAAG,KAAK,CAAA;IAET,OAAO,CACL,oBAAC,QAAQ,IACP,OAAO,EAAE,IAAI;QACb,+DAA+D;QAC/D,WAAW,EAAE,GAAG,EAAE,CAAC,CACjB,oBAAC,aAAa,IACZ,WAAW,EAAE,QAAQ,EACrB,SAAS,EAAE,cAAc,CACvB;gBACE,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,SAAS,EAAE,OAAO;qBACnB;iBACF;aACF,EACD,sBAAsB,CACvB,IAEA,KAAK,CACQ,CACjB,EACD,SAAS,EAAE,cAAc,CACvB;YACE,IAAI,EAAE;gBACJ,KAAK,EAAE;oBACL,eAAe,EAAE,aAAa;iBAC/B;aACF;YACD,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,CAAC;iBACV;aACF;SACF,EACD,SAAS,CACV;QAED,oBAAC,aAAa,IAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,IACpE,KAAK,CACQ,CACP,CACZ,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React, { ReactNode } from "react";
2
+ type NestedViewLayoutProps = {
3
+ children: ReactNode;
4
+ };
5
+ declare function NestedViewLayout(props: NestedViewLayoutProps): React.JSX.Element;
6
+ export default NestedViewLayout;
7
+ //# sourceMappingURL=NestedViewLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestedViewLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAUrD,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAmDrD;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { ArrowLeft, Block, ButtonIcon, LabelMedium, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import React, { useCallback } from "react";
3
+ import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
4
+ const getHeaderTitle = (view) => {
5
+ const titleMap = {
6
+ [DropdownView.RECEIVE]: "Receive",
7
+ };
8
+ return titleMap[view];
9
+ };
10
+ function NestedViewLayout(props) {
11
+ const { children, ...restProps } = props;
12
+ const currentView = useDropdownStore((state) => state.view);
13
+ const setView = useDropdownStore((state) => state.setView);
14
+ const isNested = useDropdownStore((state) => state.isNestedView());
15
+ const [, theme] = useStyletron();
16
+ const handleOnButtonClick = useCallback(() => {
17
+ setView(DropdownView.ROOT);
18
+ }, [setView]);
19
+ return (React.createElement(Block, { display: "flex", flexDirection: "column", minHeight: "588px", padding: theme.sizing.scale700, paddingTop: 0, ...restProps },
20
+ React.createElement(Block, { display: "flex", alignItems: "center", paddingTop: theme.sizing.scale600, paddingBottom: theme.sizing.scale600, marginBottom: theme.sizing.scale300 },
21
+ React.createElement(ButtonIcon, { onClick: handleOnButtonClick, shape: "circle", size: "small", overrides: {
22
+ BaseButton: {
23
+ style: {
24
+ background: theme.colors.backgroundPrimary,
25
+ marginRight: isNested ? theme.sizing.scale300 : undefined,
26
+ },
27
+ },
28
+ } },
29
+ React.createElement(ArrowLeft, { size: theme.sizing.scale700 })),
30
+ React.createElement(LabelMedium, null, getHeaderTitle(currentView))),
31
+ children));
32
+ }
33
+ export default NestedViewLayout;
34
+ //# sourceMappingURL=NestedViewLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NestedViewLayout.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAA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AC,QAAQ,EACd,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE;oBACT,UAAU,EAAE;wBACV,KAAK,EAAE;4BACL,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;4BAC1C,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;yBAC1D;qBACF;iBACF;gBAED,oBAAC,SAAS,IAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAI,CAC/B;YAEb,oBAAC,WAAW,QAAE,cAAc,CAAC,WAAW,CAAC,CAAe,CAClD;QAEP,QAAQ,CACH,CACT,CAAA;AACH,CAAC;AAED,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type ReceiveProps = {
3
+ address: string;
4
+ };
5
+ declare function Receive(props: ReceiveProps): React.JSX.Element;
6
+ export default Receive;
7
+ //# sourceMappingURL=Receive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Receive.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAQpD,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,qBAgGnC;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,53 @@
1
+ import { Block, Button, LabelMedium, MonoLabelXSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import React, { useCallback, useState } from "react";
3
+ import { useCopyToClipboard } from "usehooks-ts";
4
+ import { QRCodeSVG } from "qrcode.react";
5
+ import NestedViewLayout from "../NestedViewLayout";
6
+ import { getAddressExplorerUrl } from "../../../utils/address";
7
+ import { usePassportContext } from "../../../hooks/usePassportContext";
8
+ import useWalletAccount from "../../../hooks/useWalletAccount";
9
+ function Receive(props) {
10
+ const { address } = props;
11
+ const { environment } = usePassportContext();
12
+ const blockExplorerUrl = getAddressExplorerUrl(address, "mezo", environment === "testnet");
13
+ const [, theme] = useStyletron();
14
+ const [, copy] = useCopyToClipboard();
15
+ const [isCopiedMessageVisible, setIsCopiedMessageVisible] = useState(false);
16
+ const handleCopyAddress = useCallback(() => {
17
+ copy(address);
18
+ setIsCopiedMessageVisible(true);
19
+ setTimeout(() => {
20
+ setIsCopiedMessageVisible(false);
21
+ }, 2000);
22
+ }, [copy, address]);
23
+ const { networkFamily } = useWalletAccount();
24
+ return (React.createElement(NestedViewLayout, null,
25
+ React.createElement(LabelMedium, null, "Receive assets on Mezo"),
26
+ React.createElement(ParagraphSmall, { marginTop: theme.sizing.scale300, marginBottom: theme.sizing.scale600, color: theme.colors.contentTertiary }, networkFamily === "bitcoin" ? (React.createElement(React.Fragment, null, "Mezo automatically created a smart account that's fully controlled by your connected Bitcoin wallet. Use this address to receive assets on Mezo.")) : (React.createElement(React.Fragment, null, "Your connected wallet address is your Mezo address. Use this address to receive assets on Mezo."))),
27
+ React.createElement(Block, { as: QRCodeSVG, value: address, flex: 1, overrides: {
28
+ Block: {
29
+ style: {
30
+ aspectRatio: 1,
31
+ width: "fit-content",
32
+ margin: "0 auto",
33
+ },
34
+ },
35
+ } }),
36
+ React.createElement(MonoLabelXSmall, { marginTop: theme.sizing.scale800, marginBottom: theme.sizing.scale800, overrides: {
37
+ Block: {
38
+ style: {
39
+ textAlign: "center",
40
+ },
41
+ },
42
+ } }, address),
43
+ React.createElement(Button, { onClick: handleCopyAddress, overrides: {
44
+ BaseButton: {
45
+ style: {
46
+ marginBottom: theme.sizing.scale400,
47
+ },
48
+ },
49
+ } }, isCopiedMessageVisible ? "Copied!" : "Copy Mezo Address"),
50
+ React.createElement(Button, { kind: "secondary", "$as": "a", href: blockExplorerUrl, target: "_blank" }, "View Explorer")));
51
+ }
52
+ export default Receive;
53
+ //# sourceMappingURL=Receive.js.map
@@ -0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BAAgB,EAAE,MAAM,EAAC,QAAQ,oBAE/D,CACQ,CACpB,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type AccountAddressActionsProps = {
3
+ address: string;
4
+ };
5
+ export default function AccountAddressActions(props: AccountAddressActionsProps): React.JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=AccountAddressActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAddressActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAK1C,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAqBD,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAC3C,KAAK,EAAE,0BAA0B,qBA+DlC"}
@@ -0,0 +1,48 @@
1
+ import { ArrowNarrowLeft, Block, Button, Cube01, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import React, { useCallback } from "react";
3
+ import { usePassportContext } from "../../../hooks/usePassportContext";
4
+ import { getAddressExplorerUrl } from "../../../utils/address";
5
+ import useDropdownStore, { DropdownView } from "../../../stores/dropdownStore";
6
+ const buttonStartEnhancerSize = 12;
7
+ const commonButtonProps = {
8
+ kind: "secondary",
9
+ size: "xsmall",
10
+ overrides: {
11
+ BaseButton: {
12
+ style: {
13
+ flex: 1,
14
+ },
15
+ },
16
+ StartEnhancer: {
17
+ style: {
18
+ stroke: "currentColor",
19
+ },
20
+ },
21
+ },
22
+ };
23
+ export default function AccountAddressActions(props) {
24
+ const { address } = props;
25
+ const [, theme] = useStyletron();
26
+ const { environment } = usePassportContext();
27
+ const blockExplorerUrl = getAddressExplorerUrl(address, "mezo", environment === "testnet");
28
+ const setDropdownView = useDropdownStore((state) => state.setView);
29
+ const handleReceiveClick = useCallback(() => {
30
+ setDropdownView(DropdownView.RECEIVE);
31
+ }, [setDropdownView]);
32
+ return (React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: "transparent", marginBottom: theme.sizing.scale600, overrides: {
33
+ Block: {
34
+ style: {
35
+ gap: theme.sizing.scale600,
36
+ },
37
+ },
38
+ } },
39
+ React.createElement(Button, { startEnhancer: React.createElement(Cube01, { size: buttonStartEnhancerSize }), "$as": "a", href: blockExplorerUrl, target: "_blank", ...commonButtonProps }, "View Mezo Explorer"),
40
+ React.createElement(Button, { onClick: handleReceiveClick, startEnhancer: React.createElement(ArrowNarrowLeft, { size: buttonStartEnhancerSize, overrides: {
41
+ Svg: {
42
+ style: {
43
+ transform: "rotate(-45deg)",
44
+ },
45
+ },
46
+ } }), ...commonButtonProps }, "Receive")));
47
+ }
48
+ //# sourceMappingURL=AccountAddressActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAddressActions.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,EACL,MAAM,EAEN,MAAM,EACN,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAM9E,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC,MAAM,iBAAiB,GAAyB;IAC9C,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE;QACT,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;aACR;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,MAAM,EAAE,cAAc;aACvB;SACF;KACF;CACF,CAAA;AAED,MAA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;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { CryptoAssetKey } from "../../../utils/cryptoAssets";
3
+ type AccountAssetItemProps = {
4
+ type: CryptoAssetKey;
5
+ amount: string;
6
+ subLabel: string;
7
+ subValue: string;
8
+ };
9
+ export default function AccountAssetItem(props: AccountAssetItemProps): React.JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=AccountAssetItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAssetItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAssetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAkB,MAAM,6BAA6B,CAAA;AAG5E,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,cAAc,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBAcpE"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { getCryptoAsset } from "../../../utils/cryptoAssets";
3
+ import ListingItem from "../ListingItem";
4
+ export default function AccountAssetItem(props) {
5
+ const { type, amount, subLabel, subValue } = props;
6
+ const { icon: Icon, name: label } = getCryptoAsset(type);
7
+ return (React.createElement(ListingItem, { icon: Icon, label: label, subLabel: subLabel, value: amount, subValue: subValue }));
8
+ }
9
+ //# sourceMappingURL=AccountAssetItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAssetItem.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAssetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAkB,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,WAAW,MAAM,gBAAgB,CAAA;AASxC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAA4B;IACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAElD,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;IAExD,OAAO,CACL,oBAAC,WAAW,IACV,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type AccountBalanceProps = {
3
+ totalBalance: string;
4
+ totalDebt: string;
5
+ };
6
+ export default function AccountBalance(props: AccountBalanceProps): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=AccountBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAoBhE"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { useStyletron } from "@mezo-org/mezo-clay";
3
+ import ListingItem from "../ListingItem";
4
+ export default function AccountBalance(props) {
5
+ const { totalBalance, totalDebt } = props;
6
+ const [, theme] = useStyletron();
7
+ return (React.createElement(ListingItem, { label: "Total assets", value: totalBalance, subLabel: "Total liabilities", subValue: totalDebt, overrides: {
8
+ Root: {
9
+ style: {
10
+ borderBottom: `1px solid ${theme.colors.borderInverseSelected}`,
11
+ },
12
+ },
13
+ } }));
14
+ }
15
+ //# sourceMappingURL=AccountBalance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,WAAW,MAAM,gBAAgB,CAAA;AAOxC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,KAAK,CAAA;IAEzC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,WAAW,IACV,KAAK,EAAC,cAAc,EACpB,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAC,mBAAmB,EAC5B,QAAQ,EAAE,SAAS,EACnB,SAAS,EAAE;YACT,IAAI,EAAE;gBACJ,KAAK,EAAE;oBACL,YAAY,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE;iBAChE;aACF;SACF,GACD,CACH,CAAA;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type AccountOtherAssetsProps = {
3
+ assetsCount: number;
4
+ assetsUsdTotal: number;
5
+ onClick?: () => void;
6
+ };
7
+ export default function AccountOtherAssets(props: AccountOtherAssetsProps): React.JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=AccountOtherAssets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountOtherAssets.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAKtC,KAAK,uBAAuB,GAAG;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBAwDxE"}
@@ -0,0 +1,48 @@
1
+ import React, { useMemo } from "react";
2
+ import { Block, useStyletron, CoinsStacked02 } from "@mezo-org/mezo-clay";
3
+ import ListingItem from "../ListingItem";
4
+ import { formatUsd } from "../../../utils/currency";
5
+ export default function AccountOtherAssets(props) {
6
+ const { assetsCount, assetsUsdTotal, onClick } = props;
7
+ const [, theme] = useStyletron();
8
+ const label = useMemo(() => {
9
+ if (assetsCount === 0)
10
+ return "No other assets";
11
+ if (assetsCount === 1)
12
+ return "1 more asset";
13
+ return `${assetsCount} more assets`;
14
+ }, [assetsCount]);
15
+ const formattedAssetsUsdTotal = formatUsd(assetsUsdTotal);
16
+ return (React.createElement(Block, { "aria-label": label, as: "li", overrides: {
17
+ Block: {
18
+ style: {
19
+ listStyle: "none",
20
+ borderTop: `1px solid ${theme.colors.borderInverseSelected}`,
21
+ },
22
+ },
23
+ } },
24
+ React.createElement(ListingItem, { icon: CoinsStacked02, label: label, value: formattedAssetsUsdTotal, overrides: {
25
+ Root: {
26
+ props: {
27
+ $as: "button",
28
+ onClick,
29
+ },
30
+ style: {
31
+ border: 0,
32
+ padding: 0,
33
+ cursor: "pointer",
34
+ },
35
+ },
36
+ ArtworkContainer: {
37
+ style: {
38
+ stroke: theme.colors.contentPrimary,
39
+ },
40
+ },
41
+ Content: {
42
+ style: {
43
+ minHeight: theme.sizing.scale1200,
44
+ },
45
+ },
46
+ } })));
47
+ }
48
+ //# sourceMappingURL=AccountOtherAssets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountOtherAssets.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE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M,CAAC,cAAc;qBACpC;iBACF;gBACD,OAAO,EAAE;oBACP,KAAK,EAAE;wBACL,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;qBAClC;iBACF;aACF,GACD,CACI,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { DetailedCryptoAsset } from "../../../utils/cryptoAssets";
3
+ type RootProps = {
4
+ mezoId: string;
5
+ matsBalance: number;
6
+ accountAddress: string;
7
+ walletAddress: string;
8
+ walletType: "bitcoin" | "evm";
9
+ usdTotalBalance: number;
10
+ usdTroveDebt: number;
11
+ usdCollateral: number;
12
+ assets: {
13
+ btc: DetailedCryptoAsset;
14
+ musd: DetailedCryptoAsset;
15
+ };
16
+ otherAssetsCount: number;
17
+ otherAssetsUsdTotal: number;
18
+ onSignOut?: () => void;
19
+ onOtherAssetsClick?: () => void;
20
+ };
21
+ export default function Root(props: RootProps): React.JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=Root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/Root.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsB,MAAM,OAAO,CAAA;AAQ1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAKjE,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,SAAS,GAAG,KAAK,CAAA;IAC7B,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE;QACN,GAAG,EAAE,mBAAmB,CAAA;QACxB,IAAI,EAAE,mBAAmB,CAAA;KAC1B,CAAA;IACD,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;CAChC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,SAAS,qBAiH5C"}
@@ -0,0 +1,57 @@
1
+ import { Block, Button, LogOut01, useStyletron } from "@mezo-org/mezo-clay";
2
+ import React, { useCallback } from "react";
3
+ import { useDisconnect } from "wagmi";
4
+ import { useSignOut } from "../../../hooks";
5
+ import WalletAddress from "./WalletAddress";
6
+ import AccountBalance from "./AccountBalance";
7
+ import WelcomeBlock from "./WelcomeBlock";
8
+ import AccountAddressActions from "./AccountAddressActions";
9
+ import AccountAssetItem from "./AccountAssetItem";
10
+ import { formatNumberToCompactString } from "../../../utils/numbers";
11
+ import { formatUsd } from "../../../utils/currency";
12
+ import AccountOtherAssets from "./AccountOtherAssets";
13
+ export default function Root(props) {
14
+ const { mezoId, walletAddress, accountAddress, walletType, usdTotalBalance, usdTroveDebt, usdCollateral, matsBalance, assets, otherAssetsCount, otherAssetsUsdTotal, onSignOut, onOtherAssetsClick, } = props;
15
+ const [, theme] = useStyletron();
16
+ const { disconnect } = useDisconnect();
17
+ const { signOut } = useSignOut();
18
+ const handleLogOut = useCallback(() => {
19
+ if (onSignOut) {
20
+ onSignOut();
21
+ return;
22
+ }
23
+ signOut();
24
+ disconnect();
25
+ }, [signOut, disconnect, onSignOut]);
26
+ const formattedMatsBalance = formatNumberToCompactString(matsBalance, 2);
27
+ const formattedUsdTotalBalance = formatUsd(usdTotalBalance);
28
+ const formattedUsdTroveDebt = formatUsd(usdTroveDebt);
29
+ const formattedUsdCollateral = formatUsd(usdCollateral);
30
+ return (React.createElement(Block, { display: "inline-flex", flexDirection: "column", padding: theme.sizing.scale600 },
31
+ React.createElement(WelcomeBlock, { mezoId: mezoId, matsBalance: formattedMatsBalance }),
32
+ React.createElement(AccountAddressActions, { address: accountAddress }),
33
+ React.createElement(Block, { display: "flex", flexDirection: "column", backgroundColor: theme.colors.backgroundSecondary, overflow: "hidden", overrides: {
34
+ Block: { style: { borderRadius: theme.borders.radius300 } },
35
+ } },
36
+ React.createElement(WalletAddress, { address: walletAddress, type: walletType }),
37
+ React.createElement(AccountBalance, { totalBalance: formattedUsdTotalBalance, totalDebt: formattedUsdTroveDebt }),
38
+ React.createElement(AccountAssetItem, { type: "BTC", amount: assets.btc.formattedUsdBalance, subLabel: "Locked collateral", subValue: formattedUsdCollateral }),
39
+ React.createElement(AccountAssetItem, { type: "MUSD", amount: assets.musd.formattedUsdBalance, subLabel: "Borrowed", subValue: formattedUsdTroveDebt }),
40
+ React.createElement(AccountOtherAssets, { assetsCount: otherAssetsCount, assetsUsdTotal: otherAssetsUsdTotal, onClick: onOtherAssetsClick })),
41
+ React.createElement(Block, { marginTop: theme.sizing.scale700, padding: `0 ${theme.sizing.scale100}` },
42
+ React.createElement(Button, { size: "small", kind: "tertiary", startEnhancer: React.createElement(LogOut01, { color: "currentColor", size: 12 }), onClick: () => handleLogOut(), overrides: {
43
+ Root: {
44
+ style: {
45
+ ":hover": {
46
+ backgroundColor: theme.colors.backgroundSecondary,
47
+ boxShadow: "none",
48
+ },
49
+ ":active": {
50
+ backgroundColor: theme.colors.backgroundSecondary,
51
+ color: theme.colors.contentPrimary,
52
+ },
53
+ },
54
+ },
55
+ } }, "Log out"))));
56
+ }
57
+ //# sourceMappingURL=Root.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Root.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,UAAU,EA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CAAC,MAAM,CAAC,QAAQ,EAAE;YAErC,oBAAC,MAAM,IACL,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,UAAU,EACf,aAAa,EAAE,oBAAC,QAAQ,IAAC,KAAK,EAAC,cAAc,EAAC,IAAI,EAAE,EAAE,GAAI,EAC1D,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,EAAE,EAC7B,SAAS,EAAE;oBACT,IAAI,EAAE;wBACJ,KAAK,EAAE;4BACL,QAAQ,EAAE;gCACR,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;gCACjD,SAAS,EAAE,MAAM;6BAClB;4BACD,SAAS,EAAE;gCACT,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;gCACjD,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc;6BACnC;yBACF;qBACF;iBACF,cAGM,CACH,CACF,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type WalletAddressProps = {
3
+ address: string;
4
+ type: "bitcoin" | "evm";
5
+ };
6
+ export default function WalletAddress(props: WalletAddressProps): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=WalletAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WalletAddress.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/WalletAddress.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAMpD,KAAK,kBAAkB,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,GAAG,KAAK,CAAA;CACxB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA6G9D"}