@mezo-org/passport 0.4.0-dev.4 → 0.4.0-dev.42
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.
- package/README.md +18 -22
- package/dist/src/api/auth.d.ts +36 -59
- package/dist/src/api/auth.d.ts.map +1 -1
- package/dist/src/api/auth.js +21 -49
- package/dist/src/api/auth.js.map +1 -1
- package/dist/src/api/client.d.ts +24 -0
- package/dist/src/api/client.d.ts.map +1 -0
- package/dist/src/api/client.js +54 -0
- package/dist/src/api/client.js.map +1 -0
- package/dist/src/api/fetch-error.d.ts +5 -0
- package/dist/src/api/fetch-error.d.ts.map +1 -0
- package/dist/src/api/fetch-error.js +8 -0
- package/dist/src/api/fetch-error.js.map +1 -0
- package/dist/src/api/index.d.ts +3 -0
- package/dist/src/api/index.d.ts.map +1 -0
- package/dist/src/api/index.js +3 -0
- package/dist/src/api/index.js.map +1 -0
- package/dist/src/api/portal.d.ts +33 -0
- package/dist/src/api/portal.d.ts.map +1 -0
- package/dist/src/api/portal.js +23 -0
- package/dist/src/api/portal.js.map +1 -0
- package/dist/src/assets/DefaultAvatar.d.ts +5 -0
- package/dist/src/assets/DefaultAvatar.d.ts.map +1 -0
- package/dist/src/assets/DefaultAvatar.js +21 -0
- package/dist/src/assets/DefaultAvatar.js.map +1 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +8 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +1 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.js +39 -0
- package/dist/src/components/Dropdown/ConnectedTrigger.js.map +1 -0
- package/dist/src/components/Dropdown/Content.d.ts +23 -0
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Content.js +27 -0
- package/dist/src/components/Dropdown/Content.js.map +1 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +7 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +1 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.js +13 -0
- package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +1 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts +27 -0
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Dropdown.js +68 -0
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -0
- package/dist/src/components/Dropdown/ListingItem.d.ts +13 -0
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -0
- package/dist/src/components/Dropdown/ListingItem.js +34 -0
- package/dist/src/components/Dropdown/ListingItem.js.map +1 -0
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts +7 -0
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -0
- package/dist/src/components/Dropdown/NestedViewLayout.js +34 -0
- package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -0
- package/dist/src/components/Dropdown/Receive/Receive.d.ts +7 -0
- package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Receive/Receive.js +53 -0
- package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +7 -0
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js +48 -0
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts +11 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js +9 -0
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +8 -0
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountBalance.js +15 -0
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +9 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +48 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -0
- package/dist/src/components/Dropdown/Root/Root.d.ts +23 -0
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/Root.js +57 -0
- package/dist/src/components/Dropdown/Root/Root.js.map +1 -0
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +8 -0
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/WalletAddress.js +64 -0
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -0
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +8 -0
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +44 -0
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +3 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +1 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.js +14 -0
- package/dist/src/components/Dropdown/TestnetTopBanner.js.map +1 -0
- package/dist/src/components/Dropdown/index.d.ts +3 -0
- package/dist/src/components/Dropdown/index.d.ts.map +1 -0
- package/dist/src/components/Dropdown/index.js +2 -0
- package/dist/src/components/Dropdown/index.js.map +1 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +2 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/config.d.ts +41 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +17 -5
- package/dist/src/config.js.map +1 -1
- package/dist/src/constants.d.ts +6 -2
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +8 -4
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/constants.d.ts +1 -0
- package/dist/src/hooks/constants.d.ts.map +1 -1
- package/dist/src/hooks/constants.js +1 -0
- package/dist/src/hooks/constants.js.map +1 -1
- package/dist/src/hooks/index.d.ts +4 -1
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +4 -1
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.d.ts +7 -0
- package/dist/src/hooks/useAssetsConversionRates.d.ts.map +1 -0
- package/dist/src/hooks/useAssetsConversionRates.js +24 -0
- package/dist/src/hooks/useAssetsConversionRates.js.map +1 -0
- package/dist/src/hooks/useAuthApiClient.d.ts +1 -1
- package/dist/src/hooks/useAuthApiClient.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts +73 -0
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -0
- package/dist/src/hooks/useAuthenticateWithWallet.js +69 -0
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -0
- package/dist/src/hooks/useBorrowData.d.ts +60 -0
- package/dist/src/hooks/useBorrowData.d.ts.map +1 -0
- package/dist/src/hooks/useBorrowData.js +122 -0
- package/dist/src/hooks/useBorrowData.js.map +1 -0
- package/dist/src/hooks/useCreateAccount.d.ts +23 -173
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +7 -4
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useCreateSession.d.ts +12 -101
- package/dist/src/hooks/useCreateSession.d.ts.map +1 -1
- package/dist/src/hooks/useCreateSession.js +10 -8
- package/dist/src/hooks/useCreateSession.js.map +1 -1
- package/dist/src/hooks/useDropdownData.d.ts +47 -0
- package/dist/src/hooks/useDropdownData.d.ts.map +1 -0
- package/dist/src/hooks/useDropdownData.js +95 -0
- package/dist/src/hooks/useDropdownData.js.map +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.d.ts.map +1 -1
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js +1 -0
- package/dist/src/hooks/useEnsureNoSessionAndFetchNonce.js.map +1 -1
- package/dist/src/hooks/useGetAccountByAddress.d.ts +2 -2
- package/dist/src/hooks/useGetAccountByAddress.d.ts.map +1 -1
- package/dist/src/hooks/useGetAccountByMezoId.d.ts +2 -2
- package/dist/src/hooks/useGetAccountByMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.d.ts +16 -2
- package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.js +25 -3
- package/dist/src/hooks/useGetCurrentAccount.js.map +1 -1
- package/dist/src/hooks/useGetSession.d.ts +1 -1
- package/dist/src/hooks/useGetSession.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.d.ts +15 -175
- package/dist/src/hooks/useLinkAccount.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +7 -4
- package/dist/src/hooks/useLinkAccount.js.map +1 -1
- package/dist/src/hooks/usePortalApiClient.d.ts +2 -0
- package/dist/src/hooks/usePortalApiClient.d.ts.map +1 -0
- package/dist/src/hooks/usePortalApiClient.js +6 -0
- package/dist/src/hooks/usePortalApiClient.js.map +1 -0
- package/dist/src/hooks/useRefreshPassport.d.ts +19 -0
- package/dist/src/hooks/useRefreshPassport.d.ts.map +1 -0
- package/dist/src/hooks/useRefreshPassport.js +44 -0
- package/dist/src/hooks/useRefreshPassport.js.map +1 -0
- package/dist/src/hooks/useSignInWithDiscord.d.ts +12 -100
- package/dist/src/hooks/useSignInWithDiscord.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithDiscord.js +6 -3
- package/dist/src/hooks/useSignInWithDiscord.js.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.d.ts +12 -100
- package/dist/src/hooks/useSignInWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useSignInWithWallet.js +6 -34
- package/dist/src/hooks/useSignInWithWallet.js.map +1 -1
- package/dist/src/hooks/useSignOut.d.ts +12 -28
- package/dist/src/hooks/useSignOut.d.ts.map +1 -1
- package/dist/src/hooks/useSignOut.js +7 -4
- package/dist/src/hooks/useSignOut.js.map +1 -1
- package/dist/src/hooks/useSignUpWithWallet.d.ts +73 -0
- package/dist/src/hooks/useSignUpWithWallet.d.ts.map +1 -0
- package/dist/src/hooks/useSignUpWithWallet.js +11 -0
- package/dist/src/hooks/useSignUpWithWallet.js.map +1 -0
- package/dist/src/hooks/useTokensBalances.d.ts +74 -0
- package/dist/src/hooks/useTokensBalances.d.ts.map +1 -0
- package/dist/src/hooks/useTokensBalances.js +140 -0
- package/dist/src/hooks/useTokensBalances.js.map +1 -0
- package/dist/src/hooks/useUpdateMezoId.d.ts +30 -136
- package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -1
- package/dist/src/hooks/useUpdateMezoId.js +7 -4
- package/dist/src/hooks/useUpdateMezoId.js.map +1 -1
- package/dist/src/hooks/useWalletAccount.d.ts +13 -0
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -0
- package/dist/src/hooks/useWalletAccount.js +29 -0
- package/dist/src/hooks/useWalletAccount.js.map +1 -0
- package/dist/src/hooks/useWatchTransferEvents.d.ts +5 -0
- package/dist/src/hooks/useWatchTransferEvents.d.ts.map +1 -0
- package/dist/src/hooks/useWatchTransferEvents.js +63 -0
- package/dist/src/hooks/useWatchTransferEvents.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib/contracts/index.d.ts +13 -0
- package/dist/src/lib/contracts/index.d.ts.map +1 -0
- package/dist/src/lib/contracts/index.js +57 -0
- package/dist/src/lib/contracts/index.js.map +1 -0
- package/dist/src/provider.d.ts +10 -13
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +11 -20
- package/dist/src/provider.js.map +1 -1
- package/dist/src/stores/dropdownStore.d.ts +12 -0
- package/dist/src/stores/dropdownStore.d.ts.map +1 -0
- package/dist/src/stores/dropdownStore.js +13 -0
- package/dist/src/stores/dropdownStore.js.map +1 -0
- package/dist/src/utils/address.d.ts +15 -0
- package/dist/src/utils/address.d.ts.map +1 -0
- package/dist/src/utils/address.js +37 -0
- package/dist/src/utils/address.js.map +1 -0
- package/dist/src/utils/address.test.d.ts +2 -0
- package/dist/src/utils/address.test.d.ts.map +1 -0
- package/dist/src/utils/address.test.js +40 -0
- package/dist/src/utils/address.test.js.map +1 -0
- package/dist/src/utils/cryptoAssets.d.ts +44 -0
- package/dist/src/utils/cryptoAssets.d.ts.map +1 -0
- package/dist/src/utils/cryptoAssets.js +131 -0
- package/dist/src/utils/cryptoAssets.js.map +1 -0
- package/dist/src/utils/cryptoAssets.test.d.ts +2 -0
- package/dist/src/utils/cryptoAssets.test.d.ts.map +1 -0
- package/dist/src/utils/cryptoAssets.test.js +67 -0
- package/dist/src/utils/cryptoAssets.test.js.map +1 -0
- package/dist/src/utils/currency.d.ts +14 -0
- package/dist/src/utils/currency.d.ts.map +1 -0
- package/dist/src/utils/currency.js +27 -0
- package/dist/src/utils/currency.js.map +1 -0
- package/dist/src/utils/currency.test.d.ts +2 -0
- package/dist/src/utils/currency.test.d.ts.map +1 -0
- package/dist/src/utils/currency.test.js +34 -0
- package/dist/src/utils/currency.test.js.map +1 -0
- package/dist/src/utils/numbers.d.ts +58 -0
- package/dist/src/utils/numbers.d.ts.map +1 -0
- package/dist/src/utils/numbers.js +132 -0
- package/dist/src/utils/numbers.js.map +1 -0
- package/dist/src/utils/numbers.test.d.ts +2 -0
- package/dist/src/utils/numbers.test.d.ts.map +1 -0
- package/dist/src/utils/numbers.test.js +170 -0
- package/dist/src/utils/numbers.test.js.map +1 -0
- package/package.json +13 -5
- package/src/api/auth.ts +72 -129
- package/src/api/client.ts +78 -0
- package/src/api/fetch-error.ts +8 -0
- package/src/api/index.ts +2 -0
- package/src/api/portal.ts +57 -0
- package/src/assets/DefaultAvatar.tsx +74 -0
- package/src/components/Dropdown/ConnectedTrigger.tsx +76 -0
- package/src/components/Dropdown/Content.tsx +98 -0
- package/src/components/Dropdown/DisconnectedTrigger.tsx +36 -0
- package/src/components/Dropdown/Dropdown.tsx +148 -0
- package/src/components/Dropdown/ListingItem.tsx +80 -0
- package/src/components/Dropdown/NestedViewLayout.tsx +75 -0
- package/src/components/Dropdown/README.md +41 -0
- package/src/components/Dropdown/Receive/Receive.tsx +119 -0
- package/src/components/Dropdown/Root/AccountAddressActions.tsx +101 -0
- package/src/components/Dropdown/Root/AccountAssetItem.tsx +26 -0
- package/src/components/Dropdown/Root/AccountBalance.tsx +30 -0
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +68 -0
- package/src/components/Dropdown/Root/Root.tsx +147 -0
- package/src/components/Dropdown/Root/WalletAddress.tsx +128 -0
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +91 -0
- package/src/components/Dropdown/TestnetTopBanner.tsx +32 -0
- package/src/components/Dropdown/index.ts +2 -0
- package/src/components/index.ts +1 -0
- package/src/config.ts +24 -6
- package/src/constants.ts +8 -4
- package/src/hooks/constants.ts +1 -0
- package/src/hooks/index.ts +7 -1
- package/src/hooks/useAssetsConversionRates.ts +32 -0
- package/src/hooks/useAuthenticateWithWallet.ts +102 -0
- package/src/hooks/useBorrowData.ts +143 -0
- package/src/hooks/useCreateAccount.ts +19 -5
- package/src/hooks/useCreateSession.ts +22 -9
- package/src/hooks/useDropdownData.ts +139 -0
- package/src/hooks/useEnsureNoSessionAndFetchNonce.ts +1 -0
- package/src/hooks/useGetAccountByAddress.ts +2 -2
- package/src/hooks/useGetAccountByMezoId.ts +2 -2
- package/src/hooks/useGetCurrentAccount.ts +46 -6
- package/src/hooks/useGetSession.ts +1 -1
- package/src/hooks/useLinkAccount.ts +18 -5
- package/src/hooks/usePortalApiClient.ts +6 -0
- package/src/hooks/useRefreshPassport.ts +56 -0
- package/src/hooks/useSignInWithDiscord.ts +14 -5
- package/src/hooks/useSignInWithWallet.ts +14 -42
- package/src/hooks/useSignOut.ts +18 -4
- package/src/hooks/useSignUpWithWallet.ts +21 -0
- package/src/hooks/useTokensBalances.ts +187 -0
- package/src/hooks/useUpdateMezoId.ts +19 -4
- package/src/hooks/useWalletAccount.ts +55 -0
- package/src/hooks/useWatchTransferEvents.ts +74 -0
- package/src/index.ts +9 -1
- package/src/lib/contracts/index.ts +88 -0
- package/src/provider.ts +30 -37
- package/src/stores/dropdownStore.ts +20 -0
- package/src/utils/address.test.ts +48 -0
- package/src/utils/address.ts +45 -0
- package/src/utils/cryptoAssets.test.ts +79 -0
- package/src/utils/cryptoAssets.ts +173 -0
- package/src/utils/currency.test.ts +38 -0
- package/src/utils/currency.ts +32 -0
- package/src/utils/numbers.test.ts +220 -0
- package/src/utils/numbers.ts +188 -0
|
@@ -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,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAQnD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAA8B;IACvE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,KAAK,CAAA;IAEtD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO,iBAAiB,CAAA;QAC/C,IAAI,WAAW,KAAK,CAAC;YAAE,OAAO,cAAc,CAAA;QAC5C,OAAO,GAAG,WAAW,cAAc,CAAA;IACrC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;IAEjB,MAAM,uBAAuB,GAAG,SAAS,CAAC,cAAc,CAAC,CAAA;IAEzD,OAAO,CACL,oBAAC,KAAK,kBACQ,KAAK,EACjB,EAAE,EAAC,IAAI,EACP,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,SAAS,EAAE,MAAM;oBACjB,SAAS,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,qBAAqB,EAAE;iBAC7D;aACF;SACF;QAED,oBAAC,WAAW,IACV,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,uBAAuB,EAC9B,SAAS,EAAE;gBACT,IAAI,EAAE;oBACJ,KAAK,EAAE;wBACL,GAAG,EAAE,QAAQ;wBACb,OAAO;qBACR;oBACD,KAAK,EAAE;wBACL,MAAM,EAAE,CAAC;wBACT,OAAO,EAAE,CAAC;wBACV,MAAM,EAAE,SAAS;qBAClB;iBACF;gBACD,gBAAgB,EAAE;oBAChB,KAAK,EAAE;wBACL,MAAM,EAAE,KAAK,CAAC,MAAM,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,M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kB,IACjB,WAAW,EAAE,gBAAgB,EAC7B,cAAc,EAAE,mBAAmB,EACnC,OAAO,EAAE,kBAAkB,GAC3B,CACI;QAER,oBAAC,KAAK,IACJ,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAChC,OAAO,EAAE,KAAK,KAAK,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 @@
|
|
|
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"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Block, Copy03 as CopyIcon, LinkExternal02 as LinkIcon, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React, { useCallback, useState } from "react";
|
|
3
|
+
import { useCopyToClipboard } from "usehooks-ts";
|
|
4
|
+
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
5
|
+
import { getAddressExplorerUrl, trimAddress } from "../../../utils/address";
|
|
6
|
+
import { getCryptoAsset } from "../../../utils/cryptoAssets";
|
|
7
|
+
export default function WalletAddress(props) {
|
|
8
|
+
const { address, type } = props;
|
|
9
|
+
const { environment } = usePassportContext();
|
|
10
|
+
const blockExplorerUrl = getAddressExplorerUrl(address, type, environment === "testnet");
|
|
11
|
+
const trimmedAddress = trimAddress(address);
|
|
12
|
+
const { icon: accountIcon } = getCryptoAsset(type === "bitcoin" ? "BTC" : "ETH");
|
|
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
|
+
return (React.createElement(Block, { as: "button", onClick: handleCopyAddress, display: "flex", alignItems: "center", backgroundColor: "transparent", padding: `${theme.sizing.scale600} ${theme.sizing.scale500}`, overrides: {
|
|
24
|
+
Block: {
|
|
25
|
+
style: {
|
|
26
|
+
borderWidth: 0,
|
|
27
|
+
cursor: "pointer",
|
|
28
|
+
":hover": {
|
|
29
|
+
backgroundColor: theme.colors.backgroundTertiary,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
} },
|
|
34
|
+
React.createElement(Block, { as: accountIcon, size: theme.sizing.scale600 }),
|
|
35
|
+
isCopiedMessageVisible ? (React.createElement(ParagraphSmall, { margin: 0, marginLeft: theme.sizing.scale500, color: theme.colors.contentPrimary }, "Copied address to clipboard")) : (React.createElement(Block, { as: "a", marginLeft: theme.sizing.scale500, href: blockExplorerUrl, target: "_blank", overrides: {
|
|
36
|
+
Block: {
|
|
37
|
+
style: {
|
|
38
|
+
color: "inherit",
|
|
39
|
+
textDecoration: "none",
|
|
40
|
+
":hover": {
|
|
41
|
+
textDecoration: "underline",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
} },
|
|
46
|
+
React.createElement(ParagraphSmall, { display: "flex", alignItems: "center", margin: 0, color: theme.colors.contentPrimary },
|
|
47
|
+
trimmedAddress,
|
|
48
|
+
React.createElement(LinkIcon, { display: "inline", size: theme.sizing.scale550, overrides: {
|
|
49
|
+
Svg: {
|
|
50
|
+
style: {
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
marginLeft: theme.sizing.scale300,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
} })))),
|
|
56
|
+
React.createElement(CopyIcon, { size: theme.sizing.scale550, color: theme.colors.contentPrimary, overrides: {
|
|
57
|
+
Svg: {
|
|
58
|
+
style: {
|
|
59
|
+
marginLeft: "auto",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
} })));
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=WalletAddress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletAddress.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/WalletAddress.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,IAAI,QAAQ,EAClB,cAAc,IAAI,QAAQ,EAC1B,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAA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E,KAAK,CAAC,MAAM,CAAC,QAAQ;6BAClC;yBACF;qBACF,GACD,CACa,CACX,CACT;QACD,oBAAC,QAAQ,IACP,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC3B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,EAClC,SAAS,EAAE;gBACT,GAAG,EAAE;oBACH,KAAK,EAAE;wBACL,UAAU,EAAE,MAAM;qBACnB;iBACF;aACF,GACD,CACI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeBlock.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/WelcomeBlock.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAyE5D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Block, HeadingSmall, LabelSmall, Mats, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import DefaultAvatar from "../../../assets/DefaultAvatar";
|
|
4
|
+
const DOT_DELIMITER_REGEX = /(?=\.)/;
|
|
5
|
+
export default function WelcomeBlock(props) {
|
|
6
|
+
const { mezoId, matsBalance } = props;
|
|
7
|
+
const [name, nameSuffix] = mezoId.split(DOT_DELIMITER_REGEX);
|
|
8
|
+
const [, theme] = useStyletron();
|
|
9
|
+
return (React.createElement(Block, { display: "flex", alignItems: "center", padding: `${theme.sizing.scale600} 0`, marginBottom: theme.sizing.scale300, overrides: {
|
|
10
|
+
Block: {
|
|
11
|
+
style: {
|
|
12
|
+
gap: theme.sizing.scale600,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
} },
|
|
16
|
+
React.createElement(Block, { as: DefaultAvatar, width: theme.sizing.scale1200, height: theme.sizing.scale1200, overrides: {
|
|
17
|
+
Block: {
|
|
18
|
+
style: {
|
|
19
|
+
borderRadius: "100%",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} }),
|
|
23
|
+
React.createElement(Block, { display: "flex", flexDirection: "column", overrides: {
|
|
24
|
+
Block: {
|
|
25
|
+
style: {
|
|
26
|
+
gap: theme.sizing.scale100,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
} },
|
|
30
|
+
React.createElement(HeadingSmall, { as: "span" },
|
|
31
|
+
React.createElement(Block, { as: "span" }, name),
|
|
32
|
+
React.createElement(Block, { as: "span", color: theme.colors.gray500 }, nameSuffix)),
|
|
33
|
+
React.createElement(LabelSmall, { display: "flex", alignItems: "center", margin: 0, color: theme.colors.contentTertiary, overrides: {
|
|
34
|
+
Block: {
|
|
35
|
+
style: {
|
|
36
|
+
gap: theme.sizing.scale400,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
} },
|
|
40
|
+
React.createElement(Mats, { color: theme.colors.contentPrimary, size: theme.sizing.scale500 }),
|
|
41
|
+
matsBalance,
|
|
42
|
+
" mats"))));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=WelcomeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WelcomeBlock.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/WelcomeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,+BAA+B,CAAA;AAEzD,MAAM,mBAAmB,GAAG,QAAQ,CAAA;AAOpC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAwB;IAC3D,MAAM,EAAE,MAAM,EAAE,WAA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,EACT,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EACnC,SAAS,EAAE;oBACT,KAAK,EAAE;wBACL,KAAK,EAAE;4BACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;yBAC3B;qBACF;iBACF;gBAED,oBAAC,IAAI,IACH,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,EAClC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAC3B;gBACD,WAAW;wBACD,CACP,CACF,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestnetTopBanner.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/TestnetTopBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,MAAM,CAAC,OAAO,UAAU,gBAAgB,6BAsBvC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Block, InfoCircle, LabelSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
3
|
+
import { usePassportContext } from "../../hooks/usePassportContext";
|
|
4
|
+
export default function TestnetTopBanner() {
|
|
5
|
+
const [, theme] = useStyletron();
|
|
6
|
+
const { environment } = usePassportContext();
|
|
7
|
+
if (environment !== "testnet") {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return (React.createElement(Block, { display: "flex", alignItems: "center", padding: `${theme.sizing.scale700} ${theme.sizing.scale600}`, backgroundColor: theme.colors.warning },
|
|
11
|
+
React.createElement(InfoCircle, { size: theme.sizing.scale550 }),
|
|
12
|
+
React.createElement(LabelSmall, { marginLeft: theme.sizing.scale500 }, "You are using testnet funds.")));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=TestnetTopBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TestnetTopBanner.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/TestnetTopBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,KAAK,EACL,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAEnE,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACtC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE5C,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAC5D,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;QAErC,oBAAC,UAAU,IAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAAI;QAC3C,oBAAC,UAAU,IAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,mCAEhC,CACP,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA"}
|
package/dist/src/config.d.ts
CHANGED
|
@@ -17,5 +17,46 @@ export declare const okxWallet: import("@mezo-org/orangekit").CreateWalletFn;
|
|
|
17
17
|
export declare const xverseWallet: import("@mezo-org/orangekit").CreateWalletFn;
|
|
18
18
|
export declare function getDefaultWallets(): WalletList;
|
|
19
19
|
export declare function getConfig({ appName, bitcoinWallets, walletConnectProjectId, ...restParameters }: GetDefaultConfigParameters): Config;
|
|
20
|
+
/**
|
|
21
|
+
* This config is only used to listen for Transfer events on mezo chain.
|
|
22
|
+
* Should not be exported in index for public use.
|
|
23
|
+
*/
|
|
24
|
+
export declare const simpleWssMezoConfig: Config<readonly [{
|
|
25
|
+
blockExplorers: {
|
|
26
|
+
readonly default: {
|
|
27
|
+
readonly name: "Matsnet Testnet Explorer";
|
|
28
|
+
readonly url: "https://explorer.test.mezo.org";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
contracts: {
|
|
32
|
+
readonly multicall3: {
|
|
33
|
+
readonly address: "0xcA11bde05977b3631167028862bE2a173976CA11";
|
|
34
|
+
readonly blockCreated: 3669328;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
id: 31611;
|
|
38
|
+
name: "Mezo Matsnet Testnet";
|
|
39
|
+
nativeCurrency: {
|
|
40
|
+
readonly decimals: 18;
|
|
41
|
+
readonly name: "Bitcoin";
|
|
42
|
+
readonly symbol: "BTC";
|
|
43
|
+
};
|
|
44
|
+
rpcUrls: {
|
|
45
|
+
readonly default: {
|
|
46
|
+
readonly http: readonly ["https://rpc.test.mezo.org"];
|
|
47
|
+
readonly wss: readonly ["wss://rpc-ws.test.mezo.org"];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
sourceId?: number | undefined | undefined;
|
|
51
|
+
testnet: true;
|
|
52
|
+
custom?: Record<string, unknown> | undefined;
|
|
53
|
+
fees?: import("viem").ChainFees<undefined> | undefined;
|
|
54
|
+
formatters?: undefined;
|
|
55
|
+
serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
|
|
56
|
+
readonly iconUrl: "https://explorer.test.mezo.org/assets/configs/network_icon.svg";
|
|
57
|
+
readonly iconBackground: "#fff";
|
|
58
|
+
}], {
|
|
59
|
+
31611: import("viem").WebSocketTransport;
|
|
60
|
+
}>;
|
|
20
61
|
export {};
|
|
21
62
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/src/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAoB,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC5E,OAAO,EACL,MAAM,EAEN,sBAAsB,EAGvB,MAAM,OAAO,CAAA;AAId,KAAK,qBAAqB,GAAG,IAAI,CAC/B,sBAAsB,EACtB,QAAQ,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAC9D,CAAA;AACD,KAAK,0BAA0B,GAAG,qBAAqB,GAAG;IACxD,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,cAAc,CAAC,EAAE,UAAU,CAAA;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;IAC5B,UAAU,CAAC,EAAE,IAAI,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAA;CACxD,CAAA;AAOD,eAAO,MAAM,aAAa,EAAE,QAAQ,CAClC,IAAI,CACF,0BAA0B,EACxB,YAAY,GACZ,wBAAwB,GACxB,QAAQ,GACR,gCAAgC,CACnC,CAMF,CAAA;AAQD,eAAO,MAAM,YAAY,8CAAuC,CAAA;AAChE,eAAO,MAAM,SAAS,8CAAoC,CAAA;AAC1D,eAAO,MAAM,YAAY,8CAAuC,CAAA;AAEhE,wBAAgB,iBAAiB,IAAI,UAAU,CAO9C;AAED,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,cAAc,EACd,sBAAsB,EACtB,GAAG,cAAc,EAClB,EAAE,0BAA0B,GAAG,MAAM,CAQrC;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK9B,CAAA"}
|
package/dist/src/config.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { http } from "viem";
|
|
2
1
|
import { getDefaultConfig } from "@rainbow-me/rainbowkit";
|
|
3
|
-
import {
|
|
2
|
+
import { createConfig, http, webSocket, } from "wagmi";
|
|
3
|
+
import { CHAIN_ID, mezoTestnet, RPC_BY_NETWORK } from "./constants";
|
|
4
4
|
import { getOKXWallet, getUnisatWallet, getXverseWallet } from "./wallet";
|
|
5
5
|
const transports = {
|
|
6
|
-
|
|
6
|
+
// TODO: Add chain for mezo mainnet
|
|
7
|
+
[CHAIN_ID.testnet]: http(RPC_BY_NETWORK.testnet.http),
|
|
7
8
|
};
|
|
8
9
|
export const defaultConfig = {
|
|
9
10
|
transports,
|
|
10
11
|
walletConnectProjectId: "",
|
|
11
|
-
chains: [
|
|
12
|
+
chains: [mezoTestnet],
|
|
12
13
|
multiInjectedProviderDiscovery: true,
|
|
13
14
|
};
|
|
14
15
|
const bitcoinWalletConfig = {
|
|
15
|
-
|
|
16
|
+
// TODO: Add config for mezo mainnet
|
|
17
|
+
rpcUrl: RPC_BY_NETWORK.testnet.http,
|
|
16
18
|
chainId: CHAIN_ID.testnet,
|
|
17
19
|
};
|
|
18
20
|
export const unisatWallet = getUnisatWallet(bitcoinWalletConfig);
|
|
@@ -35,4 +37,14 @@ export function getConfig({ appName, bitcoinWallets, walletConnectProjectId, ...
|
|
|
35
37
|
...restParameters,
|
|
36
38
|
});
|
|
37
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* This config is only used to listen for Transfer events on mezo chain.
|
|
42
|
+
* Should not be exported in index for public use.
|
|
43
|
+
*/
|
|
44
|
+
export const simpleWssMezoConfig = createConfig({
|
|
45
|
+
chains: [mezoTestnet],
|
|
46
|
+
transports: {
|
|
47
|
+
[mezoTestnet.id]: webSocket(RPC_BY_NETWORK.testnet.wss),
|
|
48
|
+
},
|
|
49
|
+
});
|
|
38
50
|
//# sourceMappingURL=config.js.map
|
package/dist/src/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,gBAAgB,EAAc,MAAM,wBAAwB,CAAA;AAC5E,OAAO,EAEL,YAAY,EAEZ,IAAI,EACJ,SAAS,GACV,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAiBzE,MAAM,UAAU,GAAG;IACjB,mCAAmC;IACnC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,C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|
package/dist/src/constants.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { mezoTestnet } from "@mezo-org/orangekit";
|
|
2
2
|
export declare const CHAIN_ID: {
|
|
3
3
|
testnet: 31611;
|
|
4
|
+
mainnet: undefined;
|
|
4
5
|
};
|
|
5
6
|
export declare const RPC_BY_NETWORK: {
|
|
6
|
-
testnet:
|
|
7
|
+
testnet: {
|
|
8
|
+
http: "https://rpc.test.mezo.org";
|
|
9
|
+
wss: "wss://rpc-ws.test.mezo.org";
|
|
10
|
+
};
|
|
7
11
|
};
|
|
8
12
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;CAK1B,CAAA"}
|
package/dist/src/constants.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { mezoTestnet } from "@mezo-org/orangekit";
|
|
2
|
+
export { mezoTestnet } from "@mezo-org/orangekit";
|
|
3
3
|
export const CHAIN_ID = {
|
|
4
|
-
testnet:
|
|
4
|
+
testnet: mezoTestnet.id,
|
|
5
|
+
mainnet: undefined,
|
|
5
6
|
};
|
|
6
7
|
export const RPC_BY_NETWORK = {
|
|
7
|
-
testnet:
|
|
8
|
+
testnet: {
|
|
9
|
+
http: mezoTestnet.rpcUrls.default.http[0],
|
|
10
|
+
wss: mezoTestnet.rpcUrls.default.wss[0],
|
|
11
|
+
},
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,WAAW,CAAC,EAAE;IACvB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE;QACP,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;KACxC;CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;CAKtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,qBAAqB,EAAE,qBAAqB;CAC7C,CAAA"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
export { useBitcoinAccount, useSendBitcoin, useSendTransaction, useSubscribeToConnectedToUnsupportedBitcoinAddress, useSubscribeToConnectorEvent, useSubscribeToWalletNetworkDoesNotMatchProviderChain, } from "@mezo-org/orangekit";
|
|
2
|
-
export
|
|
2
|
+
export { useInvalidateBorrowData, useResetBorrowData } from "./useBorrowData";
|
|
3
3
|
export * from "./useGetAccountByAddress";
|
|
4
4
|
export * from "./useGetAccountByMezoId";
|
|
5
5
|
export * from "./useGetCurrentAccount";
|
|
6
6
|
export * from "./useGetSession";
|
|
7
7
|
export * from "./useLinkAccount";
|
|
8
|
+
export * from "./useRefreshPassport";
|
|
8
9
|
export * from "./useSignInWithDiscord";
|
|
9
10
|
export * from "./useSignInWithWallet";
|
|
10
11
|
export * from "./useSignOut";
|
|
12
|
+
export * from "./useSignUpWithWallet";
|
|
13
|
+
export { useInvalidateTokensBalances, useResetTokensBalances, } from "./useTokensBalances";
|
|
11
14
|
export * from "./useUpdateMezoId";
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kDAAkD,EAClD,4BAA4B,EAC5B,oDAAoD,GACrD,MAAM,qBAAqB,CAAA;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kDAAkD,EAClD,4BAA4B,EAC5B,oDAAoD,GACrD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,cAAc,mBAAmB,CAAA"}
|
package/dist/src/hooks/index.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
export { useBitcoinAccount, useSendBitcoin, useSendTransaction, useSubscribeToConnectedToUnsupportedBitcoinAddress, useSubscribeToConnectorEvent, useSubscribeToWalletNetworkDoesNotMatchProviderChain, } from "@mezo-org/orangekit";
|
|
2
|
-
export
|
|
2
|
+
export { useInvalidateBorrowData, useResetBorrowData } from "./useBorrowData";
|
|
3
3
|
export * from "./useGetAccountByAddress";
|
|
4
4
|
export * from "./useGetAccountByMezoId";
|
|
5
5
|
export * from "./useGetCurrentAccount";
|
|
6
6
|
export * from "./useGetSession";
|
|
7
7
|
export * from "./useLinkAccount";
|
|
8
|
+
export * from "./useRefreshPassport";
|
|
8
9
|
export * from "./useSignInWithDiscord";
|
|
9
10
|
export * from "./useSignInWithWallet";
|
|
10
11
|
export * from "./useSignOut";
|
|
12
|
+
export * from "./useSignUpWithWallet";
|
|
13
|
+
export { useInvalidateTokensBalances, useResetTokensBalances, } from "./useTokensBalances";
|
|
11
14
|
export * from "./useUpdateMezoId";
|
|
12
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kDAAkD,EAClD,4BAA4B,EAC5B,oDAAoD,GACrD,MAAM,qBAAqB,CAAA;AAC5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,EAClB,kDAAkD,EAClD,4BAA4B,EAC5B,oDAAoD,GACrD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAC7E,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseBaseQueryOptions } from "@tanstack/react-query";
|
|
2
|
+
type AssetsUsdConversion = {
|
|
3
|
+
usd: Record<"btc" | "eth" | "t", number>;
|
|
4
|
+
};
|
|
5
|
+
export default function useAssetsConversionRates(useQueryOptions?: Partial<UseBaseQueryOptions<AssetsUsdConversion>>): import("@tanstack/react-query").UseQueryResult<AssetsUsdConversion, Error>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=useAssetsConversionRates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAssetsConversionRates.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAssetsConversionRates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,uBAAuB,CAAA;AAKrE,KAAK,mBAAmB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC,KAAK,GAAG,KAAK,GAAG,GAAG,EAAE,MAAM,CAAC,CAAA;CACzC,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,eAAe,GAAE,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAM,8EAqBxE"}
|