@mezo-org/passport 0.4.0-dev.47 → 0.4.0-dev.49

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 (30) hide show
  1. package/dist/cjs/index.js +68 -0
  2. package/dist/cjs/index.js.map +1 -0
  3. package/dist/esm/index.js +68 -0
  4. package/dist/esm/index.js.map +1 -0
  5. package/dist/index.d.ts +31 -0
  6. package/dist/src/components/Dropdown/AccountAddress.d.ts +8 -0
  7. package/dist/src/components/Dropdown/AccountAddress.d.ts.map +1 -0
  8. package/dist/src/components/Dropdown/AccountAddress.js +66 -0
  9. package/dist/src/components/Dropdown/AccountAddress.js.map +1 -0
  10. package/dist/src/components/Dropdown/AccountAssets.d.ts +13 -0
  11. package/dist/src/components/Dropdown/AccountAssets.d.ts.map +1 -0
  12. package/dist/src/components/Dropdown/AccountAssets.js +43 -0
  13. package/dist/src/components/Dropdown/AccountAssets.js.map +1 -0
  14. package/dist/src/components/Dropdown/AccountBalance.d.ts +7 -0
  15. package/dist/src/components/Dropdown/AccountBalance.d.ts.map +1 -0
  16. package/dist/src/components/Dropdown/AccountBalance.js +16 -0
  17. package/dist/src/components/Dropdown/AccountBalance.js.map +1 -0
  18. package/dist/src/components/Dropdown/WelcomeBlock.d.ts +8 -0
  19. package/dist/src/components/Dropdown/WelcomeBlock.d.ts.map +1 -0
  20. package/dist/src/components/Dropdown/WelcomeBlock.js +43 -0
  21. package/dist/src/components/Dropdown/WelcomeBlock.js.map +1 -0
  22. package/dist/src/hooks/useAssetsUSDConversion.d.ts +8 -0
  23. package/dist/src/hooks/useAssetsUSDConversion.d.ts.map +1 -0
  24. package/dist/src/hooks/useAssetsUSDConversion.js +21 -0
  25. package/dist/src/hooks/useAssetsUSDConversion.js.map +1 -0
  26. package/dist/src/lib/contracts/troveManager.d.ts +1401 -0
  27. package/dist/src/lib/contracts/troveManager.d.ts.map +1 -0
  28. package/dist/src/lib/contracts/troveManager.js +1820 -0
  29. package/dist/src/lib/contracts/troveManager.js.map +1 -0
  30. package/package.json +19 -21
@@ -0,0 +1,31 @@
1
+ import * as _mezo_org_orangekit from '@mezo-org/orangekit';
2
+ export { BitcoinWalletConnectionError, WalletNetworkDoesNotMatchProviderChainError, getOKXWallet, getUnisatWallet, getXverseWallet, isUnsupportedBitcoinAddressError, isWalletNetworkDoesNotMatchProviderChainError, mezoMatsnetTestnet, useBitcoinAccount, useSendBitcoin, useSendTransaction, useSubscribeToConnectedToUnsupportedBitcoinAddress, useSubscribeToConnectorEvent, useSubscribeToWalletNetworkDoesNotMatchProviderChain } from '@mezo-org/orangekit';
3
+ import { WalletList, Chain } from '@rainbow-me/rainbowkit';
4
+ import { CreateConfigParameters, Config } from 'wagmi';
5
+
6
+ type WagmiConfigParameters = Omit<CreateConfigParameters, "client" | "connectors" | "chains" | "wallets" | "transports">;
7
+ type GetDefaultConfigParameters = WagmiConfigParameters & {
8
+ appName: string;
9
+ appDescription?: string;
10
+ appUrl?: string;
11
+ appIcon?: string;
12
+ bitcoinWallets?: WalletList;
13
+ walletConnectProjectId?: string;
14
+ chains?: [Chain, ...Chain[]];
15
+ transports?: Pick<CreateConfigParameters, "transports">;
16
+ };
17
+ declare const defaultConfig: Required<Pick<GetDefaultConfigParameters, "transports" | "walletConnectProjectId" | "chains" | "multiInjectedProviderDiscovery">>;
18
+ declare const unisatWallet: _mezo_org_orangekit.CreateWalletFn;
19
+ declare const okxWallet: _mezo_org_orangekit.CreateWalletFn;
20
+ declare const xverseWallet: _mezo_org_orangekit.CreateWalletFn;
21
+ declare function getDefaultWallets(): WalletList;
22
+ declare function getConfig({ appName, bitcoinWallets, walletConnectProjectId, ...restParameters }: GetDefaultConfigParameters): Config;
23
+
24
+ declare const CHAIN_ID: {
25
+ testnet: 31611;
26
+ };
27
+ declare const RPC_BY_NETWORK: {
28
+ testnet: "https://rpc.test.mezo.org";
29
+ };
30
+
31
+ export { CHAIN_ID, RPC_BY_NETWORK, defaultConfig, getConfig, getDefaultWallets, okxWallet, unisatWallet, xverseWallet };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type AccountAddressProps = {
3
+ address: string;
4
+ type: "bitcoin" | "evm";
5
+ };
6
+ export default function AccountAddress(props: AccountAddressProps): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=AccountAddress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAddress.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountAddress.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAMpD,KAAK,mBAAmB,GAAG;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,SAAS,GAAG,KAAK,CAAA;CACxB,CAAA;AAID,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA6GhE"}
@@ -0,0 +1,66 @@
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
+ // TODO: Add visual feedback on copy
8
+ export default function AccountAddress(props) {
9
+ const { address, type } = props;
10
+ const { environment } = usePassportContext();
11
+ const blockExplorerUrl = getAddressExplorerUrl(address, type, environment === "testnet");
12
+ const trimmedAddress = trimAddress(address);
13
+ const { icon: accountIcon } = getCryptoAsset(type === "bitcoin" ? "btc" : "eth");
14
+ const [, theme] = useStyletron();
15
+ const [, copy] = useCopyToClipboard();
16
+ const [isCopiedMessageVisible, setIsCopiedMessageVisible] = useState(false);
17
+ const handleCopyAddress = useCallback(() => {
18
+ copy(address);
19
+ setIsCopiedMessageVisible(true);
20
+ setTimeout(() => {
21
+ setIsCopiedMessageVisible(false);
22
+ }, 2000);
23
+ }, [copy, address]);
24
+ return (React.createElement(Block, { as: "button", onClick: handleCopyAddress, display: "flex", alignItems: "center", backgroundColor: "transparent", padding: `${theme.sizing.scale600} ${theme.sizing.scale500}`, overrides: {
25
+ Block: {
26
+ style: {
27
+ borderWidth: 0,
28
+ cursor: "pointer",
29
+ ":hover": {
30
+ backgroundColor: theme.colors.backgroundTertiary,
31
+ },
32
+ },
33
+ },
34
+ } },
35
+ React.createElement(Block, { as: accountIcon, size: theme.sizing.scale600 }),
36
+ isCopiedMessageVisible ? (React.createElement(ParagraphSmall, { margin: 0, marginLeft: theme.sizing.scale300, color: theme.colors.gray800 }, "Copied address to clipboard")) : (React.createElement(Block, { as: "a", marginLeft: theme.sizing.scale300, href: blockExplorerUrl, target: "_blank", overrides: {
37
+ Block: {
38
+ style: {
39
+ color: "inherit",
40
+ textDecoration: "none",
41
+ ":hover": {
42
+ textDecoration: "underline",
43
+ },
44
+ },
45
+ },
46
+ } },
47
+ React.createElement(ParagraphSmall, { display: "flex", alignItems: "center", margin: 0, color: theme.colors.gray800 },
48
+ trimmedAddress,
49
+ React.createElement(LinkIcon, { display: "inline", size: theme.sizing.scale550, overrides: {
50
+ Svg: {
51
+ style: {
52
+ stroke: "currentColor",
53
+ marginLeft: theme.sizing.scale200,
54
+ },
55
+ },
56
+ } })))),
57
+ React.createElement(CopyIcon, { size: theme.sizing.scale550, overrides: {
58
+ Svg: {
59
+ style: {
60
+ marginLeft: "auto",
61
+ stroke: "currentColor",
62
+ },
63
+ },
64
+ } })));
65
+ }
66
+ //# sourceMappingURL=AccountAddress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAddress.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountAddress.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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cAAc;gBACf,oBAAC,QAAQ,IACP,OAAO,EAAC,QAAQ,EAChB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC3B,SAAS,EAAE;wBACT,GAAG,EAAE;4BACH,KAAK,EAAE;gCACL,MAAM,EAAE,cAAc;gCACtB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;6BAClC;yBACF;qBACF,GACD,CACa,CACX,CACT;QACD,oBAAC,QAAQ,IACP,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC3B,SAAS,EAAE;gBACT,GAAG,EAAE;oBACH,KAAK,EAAE;wBACL,UAAU,EAAE,MAAM;wBAClB,MAAM,EAAE,cAAc;qBACvB;iBACF;aACF,GACD,CACI,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { CryptoAssetKey } from "../../utils/cryptoAssets";
3
+ type AccountAssetsProps = {
4
+ label: string | React.ReactNode;
5
+ assets: {
6
+ type: CryptoAssetKey;
7
+ balance: string;
8
+ balanceInUsd: string;
9
+ }[];
10
+ };
11
+ export default function AccountAssets(props: AccountAssetsProps): React.JSX.Element | null;
12
+ export {};
13
+ //# sourceMappingURL=AccountAssets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAssets.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountAssets.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,cAAc,EAAkB,MAAM,0BAA0B,CAAA;AAEzE,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,cAAc,CAAA;QACpB,OAAO,EAAE,MAAM,CAAA;QACf,YAAY,EAAE,MAAM,CAAA;KACrB,EAAE,CAAA;CACJ,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,kBAAkB,4BAyF9D"}
@@ -0,0 +1,43 @@
1
+ import { Block, LabelSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import React, { useMemo } from "react";
3
+ import { getCryptoAsset } from "../../utils/cryptoAssets";
4
+ export default function AccountAssets(props) {
5
+ const { label, assets } = props;
6
+ const [, theme] = useStyletron();
7
+ const assetsData = useMemo(() => assets.map((token) => {
8
+ const { name, symbol, icon } = getCryptoAsset(token.type);
9
+ return {
10
+ ...token,
11
+ icon,
12
+ label: name,
13
+ symbol,
14
+ };
15
+ }), [assets]);
16
+ const labelContent = typeof label === "string" ? (React.createElement(ParagraphSmall, { margin: 0, color: theme.colors.gray800 }, label)) : (label);
17
+ if (assetsData.length === 0) {
18
+ return null;
19
+ }
20
+ return (React.createElement(Block, { padding: `0 ${theme.sizing.scale500}` },
21
+ React.createElement(Block, { margin: `${theme.sizing.scale400} 0` }, labelContent),
22
+ React.createElement(Block, { as: "ul", marginBottom: theme.sizing.scale600, padding: 0, display: "flex", flexDirection: "column", overrides: {
23
+ Block: {
24
+ style: {
25
+ gap: theme.sizing.scale100,
26
+ },
27
+ },
28
+ } }, assetsData.map((asset) => (React.createElement(Block, { as: "li", key: `${asset.type}-${asset.balance}`, display: "flex", justifyContent: "space-between", alignItems: "center", margin: `${theme.sizing.scale100} 0` },
29
+ React.createElement(asset.icon, { size: theme.sizing.scale800, overrides: {
30
+ Svg: {
31
+ style: {
32
+ marginRight: theme.sizing.scale500,
33
+ },
34
+ },
35
+ } }),
36
+ React.createElement(Block, { flex: 1 },
37
+ React.createElement(LabelSmall, { margin: 0 }, asset.label),
38
+ React.createElement(ParagraphSmall, { margin: 0, color: theme.colors.gray500 }, asset.symbol)),
39
+ React.createElement(Block, { display: "flex", alignItems: "end", flexDirection: "column" },
40
+ React.createElement(LabelSmall, { margin: 0 }, asset.balance),
41
+ React.createElement(ParagraphSmall, { margin: 0, color: theme.colors.gray500 }, asset.balanceInUsd))))))));
42
+ }
43
+ //# sourceMappingURL=AccountAssets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountAssets.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,UAAU,EACV,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAkB,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAWzE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAyB;IAC7D,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAE/B,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,UAAU,GAAG,OAAO,CACxB,GAAG,EAAE,CACH,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACnB,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAEzD,OAAO;YACL,GAAG,KAAK;YACR,IAAI;YACJ,KAAK,EAAE,IAAI;YACX,MAAM;SACP,CAAA;IACH,CAAC,CAAC,EACJ,CAAC,MAAM,CAAC,CACT,CAAA;IAED,MAAM,YAAY,GAChB,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAC1B,oBAAC,cAAc,IAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,IACnD,KAAK,CACS,CAClB,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CAAA;IAEH,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,CACL,oBAAC,KAAK,IAAC,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,CA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EAAC,aAAa,EAAC,QAAQ;gBAC3D,oBAAC,UAAU,IAAC,MAAM,EAAE,CAAC,IAAG,KAAK,CAAC,OAAO,CAAc;gBACnD,oBAAC,cAAc,IAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,IACnD,KAAK,CAAC,YAAY,CACJ,CACX,CACF,CACT,CAAC,CACI,CACF,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ type AccountBalanceProps = {
3
+ amount: string;
4
+ };
5
+ export default function AccountBalance(props: AccountBalanceProps): React.JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=AccountBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountBalance.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAsBhE"}
@@ -0,0 +1,16 @@
1
+ import { Block, HeadingSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
2
+ import React from "react";
3
+ export default function AccountBalance(props) {
4
+ const { amount } = props;
5
+ const [, theme] = useStyletron();
6
+ return (React.createElement(Block, { padding: theme.sizing.scale500, overrides: {
7
+ Block: {
8
+ style: {
9
+ borderBottom: `1px solid ${theme.colors.backgroundPrimary}`,
10
+ },
11
+ },
12
+ } },
13
+ React.createElement(ParagraphSmall, { margin: 0, color: theme.colors.gray800 }, "Available balance"),
14
+ React.createElement(HeadingSmall, { margin: 0 }, amount)));
15
+ }
16
+ //# sourceMappingURL=AccountBalance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAExB,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,EAC9B,SAAS,EAAE;YACT,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,YAAY,EAAE,aAAa,KAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE;iBAC5D;aACF;SACF;QAED,oBAAC,cAAc,IAAC,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,wBAErC;QACjB,oBAAC,YAAY,IAAC,MAAM,EAAE,CAAC,IAAG,MAAM,CAAgB,CAC1C,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type WelcomeBlockProps = {
3
+ mezoId: string;
4
+ matsBalance: string;
5
+ };
6
+ export default function WelcomeBlock(props: WelcomeBlockProps): React.JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=WelcomeBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WelcomeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/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,43 @@
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.scale300,
37
+ },
38
+ },
39
+ } },
40
+ React.createElement(Mats, { color: theme.colors.contentPrimary, size: theme.sizing.scale600 }),
41
+ matsBalance))));
42
+ }
43
+ //# sourceMappingURL=WelcomeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WelcomeBlock.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/WelcomeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,K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AAK,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,IACzC,UAAU,CACL,CACK;YAEf,oBAAC,UAAU,IACT,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,MAAM,EAAE,CAAC,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,CACD,CACP,CACF,CACT,CAAA;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { UseBaseQueryOptions } from "@tanstack/react-query";
2
+ type AssetsUsdConversion = {
3
+ btcUsd: string;
4
+ ethUsd: string;
5
+ };
6
+ export declare function useAssetsUsdConversion(useQueryOptions?: Partial<UseBaseQueryOptions<AssetsUsdConversion>>): import("@tanstack/react-query").UseQueryResult<AssetsUsdConversion, Error>;
7
+ export {};
8
+ //# sourceMappingURL=useAssetsUSDConversion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetsUSDConversion.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAssetsUSDConversion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAY,MAAM,uBAAuB,CAAA;AAKrE,KAAK,mBAAmB,GAAG;IACzB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,sBAAsB,CACpC,eAAe,GAAE,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAM,8EAmBxE"}
@@ -0,0 +1,21 @@
1
+ import { useQuery } from "@tanstack/react-query";
2
+ import { ONE_MINUTE_MS } from "../utils/time";
3
+ import { QUERY_KEYS } from "./constants";
4
+ import { usePortalApiClient } from "./usePortalApiClient";
5
+ export function useAssetsUsdConversion(useQueryOptions = {}) {
6
+ const portalApiClient = usePortalApiClient();
7
+ return useQuery({
8
+ queryKey: [QUERY_KEYS.ASSETS_USD_CONVERSION],
9
+ queryFn: async () => {
10
+ const { currentUsdPerBtc, currentUsdPerEth } = await portalApiClient.getPortalStatistics();
11
+ return {
12
+ btcUsd: currentUsdPerBtc,
13
+ ethUsd: currentUsdPerEth,
14
+ };
15
+ },
16
+ staleTime: 30 * ONE_MINUTE_MS,
17
+ retry: 1,
18
+ ...useQueryOptions,
19
+ });
20
+ }
21
+ //# sourceMappingURL=useAssetsUSDConversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAssetsUSDConversion.js","sourceRoot":"","sources":["../../../src/hooks/useAssetsUSDConversion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAOzD,MAAM,UAAU,sBAAsB,CACpC,kBAAqE,EAAE;IAEvE,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAA;IAE5C,OAAO,QAAQ,CAAC;QACd,QAAQ,EAAE,CAAC,UAAU,CAAC,qBAAqB,CAAC;QAC5C,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAC1C,MAAM,eAAe,CAAC,mBAAmB,EAAE,CAAA;YAE7C,OAAO;gBACL,MAAM,EAAE,gBAAgB;gBACxB,MAAM,EAAE,gBAAgB;aACzB,CAAA;QACH,CAAC;QACD,SAAS,EAAE,EAAE,GAAG,aAAa;QAC7B,KAAK,EAAE,CAAC;QACR,GAAG,eAAe;KACnB,CAAC,CAAA;AACJ,CAAC"}