@mezo-org/passport 0.4.0-dev.60 → 0.4.0-dev.62

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 (34) hide show
  1. package/dist/src/config.d.ts +1 -0
  2. package/dist/src/config.d.ts.map +1 -1
  3. package/dist/src/config.js +2 -8
  4. package/dist/src/config.js.map +1 -1
  5. package/package.json +2 -2
  6. package/src/config.ts +3 -7
  7. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +0 -3
  8. package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +0 -1
  9. package/dist/src/components/Dropdown/Root/AccountBtcListing.js +0 -22
  10. package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +0 -1
  11. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +0 -3
  12. package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +0 -1
  13. package/dist/src/components/Dropdown/Root/AccountMusdListing.js +0 -22
  14. package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +0 -1
  15. package/dist/src/hooks/useAutoConnect.d.ts +0 -10
  16. package/dist/src/hooks/useAutoConnect.d.ts.map +0 -1
  17. package/dist/src/hooks/useAutoConnect.js +0 -41
  18. package/dist/src/hooks/useAutoConnect.js.map +0 -1
  19. package/dist/src/stores/connectorStore.d.ts +0 -12
  20. package/dist/src/stores/connectorStore.d.ts.map +0 -1
  21. package/dist/src/stores/connectorStore.js +0 -13
  22. package/dist/src/stores/connectorStore.js.map +0 -1
  23. package/dist/src/stores/dropdownStore copy.d.ts +0 -12
  24. package/dist/src/stores/dropdownStore copy.d.ts.map +0 -1
  25. package/dist/src/stores/dropdownStore copy.js +0 -13
  26. package/dist/src/stores/dropdownStore copy.js.map +0 -1
  27. package/dist/src/utils/assets.d.ts +0 -145
  28. package/dist/src/utils/assets.d.ts.map +0 -1
  29. package/dist/src/utils/assets.js +0 -100
  30. package/dist/src/utils/assets.js.map +0 -1
  31. package/dist/src/utils/assets.test.d.ts +0 -2
  32. package/dist/src/utils/assets.test.d.ts.map +0 -1
  33. package/dist/src/utils/assets.test.js +0 -46
  34. package/dist/src/utils/assets.test.js.map +0 -1
@@ -4,6 +4,7 @@ import { mezoMainnet, mezoTestnet } from "./constants";
4
4
  type WagmiConfigParameters = Omit<CreateConfigParameters, "client" | "connectors" | "chains" | "wallets" | "transports">;
5
5
  type GetDefaultConfigParameters = WagmiConfigParameters & {
6
6
  appName: string;
7
+ mezoNetwork?: "mainnet" | "testnet";
7
8
  appDescription?: string;
8
9
  appUrl?: string;
9
10
  appIcon?: string;
@@ -1 +1 @@
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;AACd,OAAO,EAAY,WAAW,EAAE,WAAW,EAAkB,MAAM,aAAa,CAAA;AAGhF,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,0BAA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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;AAYD,eAAO,MAAM,uBAAuB,8CAEnC,CAAA;AACD,eAAO,MAAM,oBAAoB,8CAA2C,CAAA;AAC5E,eAAO,MAAM,uBAAuB,8CAEnC,CAAA;AAED,eAAO,MAAM,uBAAuB,8CAEnC,CAAA;AACD,eAAO,MAAM,oBAAoB,8CAA2C,CAAA;AAC5E,eAAO,MAAM,uBAAuB,8CAEnC,CAAA;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,SAAS,GAAG,SAAqB,GACzC,UAAU,CAkBZ;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,0BAA0B,GAAG,MAAM,CAiBpE;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAG5B,CAAC,WAAW,CAAC,EAAE,CAAC,oCAA6C;IAC7D,CAAC,WAAW,CAAC,EAAE,CAAC,oCAA6C;EAE/D,CAAA"}
@@ -45,14 +45,8 @@ export function getDefaultWallets(network = "mainnet") {
45
45
  ];
46
46
  }
47
47
  export function getConfig(config) {
48
- const { appName, walletConnectProjectId = defaultConfig.walletConnectProjectId, ...restParameters } = config;
49
- // Wallets don't have to be differentiated by network. Viem will choose proper
50
- // connector selectively based on the chainId, or by the chainId passed
51
- // explicitly.
52
- const wallets = config.bitcoinWallets ?? [
53
- ...getDefaultWallets("mainnet"),
54
- ...getDefaultWallets("testnet"),
55
- ];
48
+ const { appName, mezoNetwork = "mainnet", walletConnectProjectId = defaultConfig.walletConnectProjectId, ...restParameters } = config;
49
+ const wallets = config.bitcoinWallets ?? [...getDefaultWallets(mezoNetwork)];
56
50
  return getDefaultConfig({
57
51
  ...defaultConfig,
58
52
  appName,
@@ -1 +1 @@
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,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAiBzE,MAAM,UAAU,GAAG;IACjB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC;IACrD,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC;CACR,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAQtB;IACF,UAAU;IACV,sBAAsB,EAAE,EAAE;IAC1B,MAAM,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC;IAClC,8BAA8B,EAAE,IAAI;CACrC,CAAA;AAED,MAAM,0BAA0B,GAAG;IACjC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,IAAI;IACnC,OAAO,EAAE,QAAQ,CAAC,OAAO;CAC1B,CAAA;AAED,MAAM,0BAA0B,GAAG;IACjC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,IAAI;IACnC,OAAO,EAAE,QAAQ,CAAC,OAAO;CAC1B,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CACpD,0BAA0B,CAC3B,CAAA;AACD,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC,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C,OAAO,CAAC,SAAS,CAAC;QAC7D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC;KAC9D;CACF,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezo-org/passport",
3
- "version": "0.4.0-dev.60",
3
+ "version": "0.4.0-dev.62",
4
4
  "main": "dist/src/index.js",
5
5
  "license": "GPL-3.0-only",
6
6
  "scripts": {
@@ -40,7 +40,7 @@
40
40
  "@mezo-org/mezo-clay": "0.1.0-dev.27",
41
41
  "@mezo-org/mezod-contracts": "^1.0.0",
42
42
  "@mezo-org/musd-contracts": "^1.0.1",
43
- "@mezo-org/orangekit": "1.0.0-beta.40-dev.14",
43
+ "@mezo-org/orangekit": "1.0.0-beta.40-dev.15",
44
44
  "@mezo-org/sign-in-with-wallet": "1.0.0-beta.8",
45
45
  "qrcode.react": "^4.2.0",
46
46
  "styletron-engine-monolithic": "^1.0.0",
package/src/config.ts CHANGED
@@ -15,6 +15,7 @@ type WagmiConfigParameters = Omit<
15
15
  >
16
16
  type GetDefaultConfigParameters = WagmiConfigParameters & {
17
17
  appName: string
18
+ mezoNetwork?: "mainnet" | "testnet"
18
19
  appDescription?: string
19
20
  appUrl?: string
20
21
  appIcon?: string
@@ -95,17 +96,12 @@ export function getDefaultWallets(
95
96
  export function getConfig(config: GetDefaultConfigParameters): Config {
96
97
  const {
97
98
  appName,
99
+ mezoNetwork = "mainnet",
98
100
  walletConnectProjectId = defaultConfig.walletConnectProjectId,
99
101
  ...restParameters
100
102
  } = config
101
103
 
102
- // Wallets don't have to be differentiated by network. Viem will choose proper
103
- // connector selectively based on the chainId, or by the chainId passed
104
- // explicitly.
105
- const wallets = config.bitcoinWallets ?? [
106
- ...getDefaultWallets("mainnet"),
107
- ...getDefaultWallets("testnet"),
108
- ]
104
+ const wallets = config.bitcoinWallets ?? [...getDefaultWallets(mezoNetwork)]
109
105
 
110
106
  return getDefaultConfig({
111
107
  ...defaultConfig,
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- export default function AccountBTCListing(): "Error" | React.JSX.Element;
3
- //# sourceMappingURL=AccountBtcListing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountBtcListing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBtcListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,CAAC,OAAO,UAAU,iBAAiB,gCAkCxC"}
@@ -1,22 +0,0 @@
1
- import React from "react";
2
- import { BitcoinCircle } from "@mezo-org/mezo-clay";
3
- import ListingItem from "../ListingItem";
4
- import { getAsset } from "../../../utils/assets";
5
- import { useBorrowData } from "../../../hooks/useBorrowData";
6
- import { formatUsd } from "../../../utils/currency";
7
- import { useTokensBalances } from "../../../hooks/useTokensBalances";
8
- export default function AccountBTCListing() {
9
- const { data: borrowData, isError: isBorrowDataError, isPending: isBorrowDataPending, } = useBorrowData();
10
- const { data: tokensBalancesData, isError: isTokensBalancesError, isPending: isTokensBalancesPending, } = useTokensBalances();
11
- if (isTokensBalancesError || isBorrowDataError) {
12
- return "Error"; // TODO: Render alternative UI
13
- }
14
- if (isTokensBalancesPending || isBorrowDataPending) {
15
- return React.createElement(ListingItem, { isLoading: true });
16
- }
17
- const btcBalance = tokensBalancesData.BTC;
18
- const formattedBtcBalance = formatUsd(btcBalance.usd.formatted);
19
- const formattedLockedCollateral = formatUsd(borrowData.collateral.formatted);
20
- return (React.createElement(ListingItem, { icon: BitcoinCircle, label: getAsset("BTC").name, value: formattedBtcBalance, subLabel: "Locked collateral", subValue: formattedLockedCollateral }));
21
- }
22
- //# sourceMappingURL=AccountBtcListing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountBtcListing.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBtcListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAA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H,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- export default function AccountMusdListing(): "Error" | React.JSX.Element;
3
- //# sourceMappingURL=AccountMusdListing.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMusdListing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountMusdListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,CAAC,OAAO,UAAU,kBAAkB,gCAkCzC"}
@@ -1,22 +0,0 @@
1
- import React from "react";
2
- import { MUsdCircle02 } from "@mezo-org/mezo-clay";
3
- import ListingItem from "../ListingItem";
4
- import { getAsset } from "../../../utils/assets";
5
- import { useBorrowData } from "../../../hooks/useBorrowData";
6
- import { formatUsd } from "../../../utils/currency";
7
- import { useTokensBalances } from "../../../hooks/useTokensBalances";
8
- export default function AccountMusdListing() {
9
- const { data: borrowData, isError: isBorrowDataError, isPending: isBorrowDataPending, } = useBorrowData();
10
- const { data: tokensBalancesData, isError: isTokensBalancesError, isPending: isTokensBalancesPending, } = useTokensBalances();
11
- if (isBorrowDataError || isTokensBalancesError) {
12
- return "Error"; // TODO: Render alternative UI
13
- }
14
- if (isBorrowDataPending || isTokensBalancesPending) {
15
- return React.createElement(ListingItem, { isLoading: true });
16
- }
17
- const musdBalance = tokensBalancesData.MUSD;
18
- const formattedMusdBalance = formatUsd(musdBalance.usd.formatted);
19
- const formattedLockedCollateral = formatUsd(borrowData.troveDebt.formatted);
20
- return (React.createElement(ListingItem, { icon: MUsdCircle02, label: getAsset("MUSD").name, value: formattedMusdBalance, subLabel: "Borrowed", subValue: formattedLockedCollateral }));
21
- }
22
- //# sourceMappingURL=AccountMusdListing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AccountMusdListing.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountMusdListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAA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@
1
- /**
2
- * Automatically connects to the most recently used connector when the app loads.
3
- * This hook checks the storage for a recent connector ID and attempts to reconnect using that connector on mount.
4
- * It also updates the storage with the connector ID whenever a new connection is made.
5
- * @dev Wagmi does not support auto-connect out of the box. They recommend using a custom solution.
6
- * @see https://wagmi.sh/core/guides/migrate-from-v1-to-v2#updated-createconfig-parameters
7
- */
8
- declare function useAutoConnect(): void;
9
- export default useAutoConnect;
10
- //# sourceMappingURL=useAutoConnect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAutoConnect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAutoConnect.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,iBAAS,cAAc,SAyCtB;AAED,eAAe,cAAc,CAAA"}
@@ -1,41 +0,0 @@
1
- import { useEffect } from "react";
2
- import { useAccountEffect, useConfig, useReconnect, useWriteContract, } from "wagmi";
3
- /**
4
- * Automatically connects to the most recently used connector when the app loads.
5
- * This hook checks the storage for a recent connector ID and attempts to reconnect using that connector on mount.
6
- * It also updates the storage with the connector ID whenever a new connection is made.
7
- * @dev Wagmi does not support auto-connect out of the box. They recommend using a custom solution.
8
- * @see https://wagmi.sh/core/guides/migrate-from-v1-to-v2#updated-createconfig-parameters
9
- */
10
- function useAutoConnect() {
11
- const config = useConfig();
12
- const { reconnectAsync, connectors } = useReconnect({ config });
13
- useAccountEffect({
14
- onConnect: ({ connector }) => {
15
- config.storage?.setItem("recentConnectorId", connector.id);
16
- console.log("Stored: ", config.storage?.getItem("recentConnectorId"));
17
- },
18
- });
19
- useWriteContract;
20
- useEffect(() => {
21
- const handleAutoConnect = async () => {
22
- // This is a workaround for the wagmi issue with reconnecting of injected connectors
23
- localStorage.setItem("wagmi.injected.shimDisconnect", "true");
24
- const recentConnectorId = await config.storage?.getItem("recentConnectorId");
25
- const recentConnector = connectors.find((connector) => connector.id === recentConnectorId);
26
- if (!recentConnector)
27
- return;
28
- console.log("Found connector. Autoconnecting to: ", recentConnector.id);
29
- console.log(recentConnector);
30
- await reconnectAsync({
31
- connectors: [recentConnector],
32
- }, {
33
- onError: (e) => console.log("Failed to reconnect", e),
34
- onSuccess: (d) => console.log("Reconnected successfully", d),
35
- });
36
- };
37
- handleAutoConnect();
38
- }, [config, reconnectAsync, connectors]);
39
- }
40
- export default useAutoConnect;
41
- //# sourceMappingURL=useAutoConnect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAutoConnect.js","sourceRoot":"","sources":["../../../src/hooks/useAutoConnect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,gBAAgB,GACjB,MAAM,OAAO,CAAA;AAEd;;;;;;GAMG;AACH,SAAS,cAAc;IACrB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAE/D,gBAAgB,CAAC;QACf,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;YAC3B,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAA;YAE1D,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAA;QACvE,CAAC;KACF,CAAC,CAAA;IAEF,gBAAgB,CAAA;IAEhB,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,iBAAiB,GAAG,KAAK,IAAI,EAAE;YACnC,oFAAoF;YACpF,YAAY,CAAC,OAAO,CAAC,+BAA+B,EAAE,MAAM,CAAC,CAAA;YAE7D,MAAM,iBAAiB,GACrB,MAAM,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;YACpD,MAAM,eAAe,GAAG,UAAU,CAAC,IAAI,CACrC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,iBAAiB,CAClD,CAAA;YAED,IAAI,CAAC,eAAe;gBAAE,OAAM;YAE5B,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,eAAe,CAAC,EAAE,CAAC,CAAA;YACvE,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;YAC5B,MAAM,cAAc,CAClB;gBACE,UAAU,EAAE,CAAC,eAAe,CAAC;aAC9B,EACD;gBACE,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC,CAAC;gBACrD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,CAAC,CAAC;aAC7D,CACF,CAAA;QACH,CAAC,CAAA;QACD,iBAAiB,EAAE,CAAA;IACrB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC,CAAA;AAC1C,CAAC;AAED,eAAe,cAAc,CAAA"}
@@ -1,12 +0,0 @@
1
- export declare enum DropdownView {
2
- ROOT = "ROOT",
3
- RECEIVE = "RECEIVE"
4
- }
5
- interface DropdownStore {
6
- view: DropdownView;
7
- setView: (view: DropdownView) => void;
8
- isNestedView: () => boolean;
9
- }
10
- declare const useDropdownStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DropdownStore>>;
11
- export default useDropdownStore;
12
- //# sourceMappingURL=connectorStore.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connectorStore.d.ts","sourceRoot":"","sources":["../../../src/stores/connectorStore.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACrC,YAAY,EAAE,MAAM,OAAO,CAAA;CAC5B;AAED,QAAA,MAAM,gBAAgB,4EAInB,CAAA;AAEH,eAAe,gBAAgB,CAAA"}
@@ -1,13 +0,0 @@
1
- import { create } from "zustand";
2
- export var DropdownView;
3
- (function (DropdownView) {
4
- DropdownView["ROOT"] = "ROOT";
5
- DropdownView["RECEIVE"] = "RECEIVE";
6
- })(DropdownView || (DropdownView = {}));
7
- const useDropdownStore = create((set, get) => ({
8
- view: DropdownView.ROOT,
9
- setView: (view) => set({ view }),
10
- isNestedView: () => get().view !== DropdownView.ROOT,
11
- }));
12
- export default useDropdownStore;
13
- //# sourceMappingURL=connectorStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connectorStore.js","sourceRoot":"","sources":["../../../src/stores/connectorStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAQD,MAAM,gBAAgB,GAAG,MAAM,CAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5D,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9C,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI;CACrD,CAAC,CAAC,CAAA;AAEH,eAAe,gBAAgB,CAAA"}
@@ -1,12 +0,0 @@
1
- export declare enum DropdownView {
2
- ROOT = "ROOT",
3
- RECEIVE = "RECEIVE"
4
- }
5
- interface DropdownStore {
6
- view: DropdownView;
7
- setView: (view: DropdownView) => void;
8
- isNestedView: () => boolean;
9
- }
10
- declare const useDropdownStore: import("zustand").UseBoundStore<import("zustand").StoreApi<DropdownStore>>;
11
- export default useDropdownStore;
12
- //# sourceMappingURL=dropdownStore%20copy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdownStore copy.d.ts","sourceRoot":"","sources":["../../../src/stores/dropdownStore copy.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;CACpB;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAA;IACrC,YAAY,EAAE,MAAM,OAAO,CAAA;CAC5B;AAED,QAAA,MAAM,gBAAgB,4EAInB,CAAA;AAEH,eAAe,gBAAgB,CAAA"}
@@ -1,13 +0,0 @@
1
- import { create } from "zustand";
2
- export var DropdownView;
3
- (function (DropdownView) {
4
- DropdownView["ROOT"] = "ROOT";
5
- DropdownView["RECEIVE"] = "RECEIVE";
6
- })(DropdownView || (DropdownView = {}));
7
- const useDropdownStore = create((set, get) => ({
8
- view: DropdownView.ROOT,
9
- setView: (view) => set({ view }),
10
- isNestedView: () => get().view !== DropdownView.ROOT,
11
- }));
12
- export default useDropdownStore;
13
- //# sourceMappingURL=dropdownStore%20copy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdownStore copy.js","sourceRoot":"","sources":["../../../src/stores/dropdownStore copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAQD,MAAM,gBAAgB,GAAG,MAAM,CAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5D,IAAI,EAAE,YAAY,CAAC,IAAI;IACvB,OAAO,EAAE,CAAC,IAAkB,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC9C,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI;CACrD,CAAC,CAAC,CAAA;AAEH,eAAe,gBAAgB,CAAA"}
@@ -1,145 +0,0 @@
1
- declare const ASSETS: {
2
- BTC: {
3
- name: string;
4
- symbol: string;
5
- decimals: number;
6
- };
7
- ETH: {
8
- name: string;
9
- symbol: string;
10
- decimals: number;
11
- };
12
- MUSD: {
13
- name: string;
14
- symbol: string;
15
- decimals: number;
16
- };
17
- mDAI: {
18
- name: string;
19
- symbol: string;
20
- decimals: number;
21
- };
22
- mFBTC: {
23
- name: string;
24
- symbol: string;
25
- decimals: number;
26
- };
27
- mcbBTC: {
28
- name: string;
29
- symbol: string;
30
- decimals: number;
31
- };
32
- mSolvBTC: {
33
- name: string;
34
- symbol: string;
35
- decimals: number;
36
- };
37
- mswBTC: {
38
- name: string;
39
- symbol: string;
40
- decimals: number;
41
- };
42
- mT: {
43
- name: string;
44
- symbol: string;
45
- decimals: number;
46
- };
47
- mUSDC: {
48
- name: string;
49
- symbol: string;
50
- decimals: number;
51
- };
52
- mUSDe: {
53
- name: string;
54
- symbol: string;
55
- decimals: number;
56
- };
57
- mUSDT: {
58
- name: string;
59
- symbol: string;
60
- decimals: number;
61
- };
62
- mxSolvBTC: {
63
- name: string;
64
- symbol: string;
65
- decimals: number;
66
- };
67
- };
68
- /**
69
- * Gets details of given crypto asset
70
- * @param key The key of crypto asset
71
- * @returns The crypto asset details
72
- */
73
- export declare function getAsset(key: keyof typeof ASSETS): {
74
- name: string;
75
- symbol: string;
76
- decimals: number;
77
- } | {
78
- name: string;
79
- symbol: string;
80
- decimals: number;
81
- } | {
82
- name: string;
83
- symbol: string;
84
- decimals: number;
85
- } | {
86
- name: string;
87
- symbol: string;
88
- decimals: number;
89
- } | {
90
- name: string;
91
- symbol: string;
92
- decimals: number;
93
- } | {
94
- name: string;
95
- symbol: string;
96
- decimals: number;
97
- } | {
98
- name: string;
99
- symbol: string;
100
- decimals: number;
101
- } | {
102
- name: string;
103
- symbol: string;
104
- decimals: number;
105
- } | {
106
- name: string;
107
- symbol: string;
108
- decimals: number;
109
- } | {
110
- name: string;
111
- symbol: string;
112
- decimals: number;
113
- } | {
114
- name: string;
115
- symbol: string;
116
- decimals: number;
117
- } | {
118
- name: string;
119
- symbol: string;
120
- decimals: number;
121
- } | {
122
- name: string;
123
- symbol: string;
124
- decimals: number;
125
- };
126
- /**
127
- * Checks if given crypto asset is Bitcoin-like
128
- * @param key The key of crypto asset
129
- * @returns True if crypto asset is Bitcoin-like
130
- */
131
- export declare function isBitcoinLikeCryptoAsset(key: string): boolean;
132
- /**
133
- * Checks if given crypto asset is USD-like
134
- * @param key The key of crypto asset
135
- * @returns True if crypto asset is USD-like
136
- */
137
- export declare function isUsdLikeCryptoAsset(key: string): boolean;
138
- /**
139
- * Checks if given crypto asset is T token
140
- * @param key The key of crypto asset
141
- * @returns True if crypto asset is T token
142
- */
143
- export declare function isTTokenCryptoAsset(key: string): boolean;
144
- export {};
145
- //# sourceMappingURL=assets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEX,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEhD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,WAEnD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,WAE/C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,WAE9C"}
@@ -1,100 +0,0 @@
1
- const ASSETS = {
2
- BTC: {
3
- name: "Bitcoin",
4
- symbol: "BTC",
5
- decimals: 18,
6
- },
7
- ETH: {
8
- name: "Ethereum",
9
- symbol: "ETH",
10
- decimals: 18,
11
- },
12
- MUSD: {
13
- name: "MUSD",
14
- symbol: "MUSD",
15
- decimals: 18,
16
- },
17
- mDAI: {
18
- name: "Mezo Dai Stablecoin",
19
- symbol: "mDAI",
20
- decimals: 18,
21
- },
22
- mFBTC: {
23
- name: "Mezo Fire Bitcoin",
24
- symbol: "mFBTC",
25
- decimals: 8,
26
- },
27
- mcbBTC: {
28
- name: "Mezo Coinbase Wrapped BTC",
29
- symbol: "mcbBTC",
30
- decimals: 8,
31
- },
32
- mSolvBTC: {
33
- name: "Mezo SolvBTC",
34
- symbol: "mSolvBTC",
35
- decimals: 18,
36
- },
37
- mswBTC: {
38
- name: "Mezo swBTC",
39
- symbol: "mswBTC",
40
- decimals: 8,
41
- },
42
- mT: {
43
- name: "Mezo Threshold Network Token",
44
- symbol: "mT",
45
- decimals: 18,
46
- },
47
- mUSDC: {
48
- name: "Mezo Circle USDC",
49
- symbol: "mUSDC",
50
- decimals: 6,
51
- },
52
- mUSDe: {
53
- name: "Mezo Ethena USDe",
54
- symbol: "mUSDe",
55
- decimals: 18,
56
- },
57
- mUSDT: {
58
- name: "Mezo Tether USDe",
59
- symbol: "mUSDT",
60
- decimals: 6,
61
- },
62
- mxSolvBTC: {
63
- name: "Mezo xSolvBTC",
64
- symbol: "mxSolvBTC",
65
- decimals: 18,
66
- },
67
- };
68
- /**
69
- * Gets details of given crypto asset
70
- * @param key The key of crypto asset
71
- * @returns The crypto asset details
72
- */
73
- export function getAsset(key) {
74
- return ASSETS[key];
75
- }
76
- /**
77
- * Checks if given crypto asset is Bitcoin-like
78
- * @param key The key of crypto asset
79
- * @returns True if crypto asset is Bitcoin-like
80
- */
81
- export function isBitcoinLikeCryptoAsset(key) {
82
- return /(btc)/i.test(key);
83
- }
84
- /**
85
- * Checks if given crypto asset is USD-like
86
- * @param key The key of crypto asset
87
- * @returns True if crypto asset is USD-like
88
- */
89
- export function isUsdLikeCryptoAsset(key) {
90
- return /(usd|dai)/i.test(key);
91
- }
92
- /**
93
- * Checks if given crypto asset is T token
94
- * @param key The key of crypto asset
95
- * @returns True if crypto asset is T token
96
- */
97
- export function isTTokenCryptoAsset(key) {
98
- return /^(mt|t)$/i.test(key);
99
- }
100
- //# sourceMappingURL=assets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.js","sourceRoot":"","sources":["../../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,GAAG,EAAE;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb;IACD,GAAG,EAAE;QACH,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC;KACZ;IACD,MAAM,EAAE;QACN,IAAI,EAAE,2BAA2B;QACjC,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,CAAC;KACZ;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,EAAE;KACb;IACD,MAAM,EAAE;QACN,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,CAAC;KACZ;IACD,EAAE,EAAE;QACF,IAAI,EAAE,8BAA8B;QACpC,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC;KACZ;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC;KACZ;IACD,SAAS,EAAE;QACT,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,WAAW;QACnB,QAAQ,EAAE,EAAE;KACb;CACF,CAAA;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAwB;IAC/C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAW;IAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW;IAC9C,OAAO,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9B,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=assets.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.test.d.ts","sourceRoot":"","sources":["../../../src/utils/assets.test.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- import { getAsset, isBitcoinLikeCryptoAsset, isUsdLikeCryptoAsset, isTTokenCryptoAsset, } from "./assets";
2
- describe("getAsset", () => {
3
- it("should return correct asset data", () => {
4
- const asset = getAsset("BTC");
5
- expect(asset).toEqual({
6
- name: "Bitcoin",
7
- symbol: "BTC",
8
- decimals: 18,
9
- });
10
- });
11
- });
12
- describe("isBitcoinLikeCryptoAsset", () => {
13
- it('should return true for keys containing "btc"', () => {
14
- expect(isBitcoinLikeCryptoAsset("BTC")).toBe(true);
15
- expect(isBitcoinLikeCryptoAsset("mFBTC")).toBe(true);
16
- expect(isBitcoinLikeCryptoAsset("mcbBTC")).toBe(true);
17
- expect(isBitcoinLikeCryptoAsset("mxSolvBTC")).toBe(true);
18
- });
19
- it("should return false for non-Bitcoin assets", () => {
20
- expect(isBitcoinLikeCryptoAsset("ETH")).toBe(false);
21
- expect(isBitcoinLikeCryptoAsset("mUSDC")).toBe(false);
22
- });
23
- });
24
- describe("isUsdLikeCryptoAsset", () => {
25
- it('should return true for keys containing "usd" or "dai"', () => {
26
- expect(isUsdLikeCryptoAsset("mUSDC")).toBe(true);
27
- expect(isUsdLikeCryptoAsset("mUSDT")).toBe(true);
28
- expect(isUsdLikeCryptoAsset("mUSDe")).toBe(true);
29
- expect(isUsdLikeCryptoAsset("mDAI")).toBe(true);
30
- });
31
- it("should return false for other tokens", () => {
32
- expect(isUsdLikeCryptoAsset("BTC")).toBe(false);
33
- expect(isUsdLikeCryptoAsset("mT")).toBe(false);
34
- });
35
- });
36
- describe("isTTokenCryptoAsset", () => {
37
- it('should return true for keys like "mT" or "t"', () => {
38
- expect(isTTokenCryptoAsset("mT")).toBe(true);
39
- expect(isTTokenCryptoAsset("T")).toBe(true);
40
- });
41
- it("should return false for other tokens", () => {
42
- expect(isTTokenCryptoAsset("BTC")).toBe(false);
43
- expect(isTTokenCryptoAsset("mUSDT")).toBe(false);
44
- });
45
- });
46
- //# sourceMappingURL=assets.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assets.test.js","sourceRoot":"","sources":["../../../src/utils/assets.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,GACpB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