@mezo-org/passport 0.16.0-dev.0 → 0.16.0-dev.1

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 (126) hide show
  1. package/dist/src/api/auth.d.ts +9 -0
  2. package/dist/src/api/auth.d.ts.map +1 -1
  3. package/dist/src/api/auth.js +7 -0
  4. package/dist/src/api/auth.js.map +1 -1
  5. package/dist/src/assets/EditIcon.d.ts +5 -0
  6. package/dist/src/assets/EditIcon.d.ts.map +1 -0
  7. package/dist/src/assets/EditIcon.js +10 -0
  8. package/dist/src/assets/EditIcon.js.map +1 -0
  9. package/dist/src/components/Dropdown/Content.d.ts.map +1 -1
  10. package/dist/src/components/Dropdown/Content.js +3 -1
  11. package/dist/src/components/Dropdown/Content.js.map +1 -1
  12. package/dist/src/components/Dropdown/Dropdown.js +1 -1
  13. package/dist/src/components/Dropdown/Dropdown.js.map +1 -1
  14. package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -1
  15. package/dist/src/components/Dropdown/NestedViewLayout.js +1 -0
  16. package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -1
  17. package/dist/src/components/Dropdown/Receive/Receive.js +1 -1
  18. package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -1
  19. package/dist/src/components/Dropdown/Root/AccountAddressActions.js +1 -1
  20. package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -1
  21. package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -1
  22. package/dist/src/components/Dropdown/Root/Root.js +6 -2
  23. package/dist/src/components/Dropdown/Root/Root.js.map +1 -1
  24. package/dist/src/components/Dropdown/Root/WalletAddress.js +1 -1
  25. package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -1
  26. package/dist/src/components/Dropdown/Settings/InlineEditField.d.ts +12 -0
  27. package/dist/src/components/Dropdown/Settings/InlineEditField.d.ts.map +1 -0
  28. package/dist/src/components/Dropdown/Settings/InlineEditField.js +95 -0
  29. package/dist/src/components/Dropdown/Settings/InlineEditField.js.map +1 -0
  30. package/dist/src/components/Dropdown/Settings/Settings.d.ts +4 -0
  31. package/dist/src/components/Dropdown/Settings/Settings.d.ts.map +1 -0
  32. package/dist/src/components/Dropdown/Settings/Settings.js +36 -0
  33. package/dist/src/components/Dropdown/Settings/Settings.js.map +1 -0
  34. package/dist/src/config.d.ts +3 -4
  35. package/dist/src/config.d.ts.map +1 -1
  36. package/dist/src/config.js +9 -13
  37. package/dist/src/config.js.map +1 -1
  38. package/dist/src/hooks/index.d.ts +2 -0
  39. package/dist/src/hooks/index.d.ts.map +1 -1
  40. package/dist/src/hooks/index.js +2 -0
  41. package/dist/src/hooks/index.js.map +1 -1
  42. package/dist/src/hooks/useAcceptDocuments.d.ts +18 -0
  43. package/dist/src/hooks/useAcceptDocuments.d.ts.map +1 -1
  44. package/dist/src/hooks/useAuthenticateWithWallet.js +1 -1
  45. package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -1
  46. package/dist/src/hooks/useBorrowData.js +1 -1
  47. package/dist/src/hooks/useBorrowData.js.map +1 -1
  48. package/dist/src/hooks/useCollateralPrice.js +1 -1
  49. package/dist/src/hooks/useCollateralPrice.js.map +1 -1
  50. package/dist/src/hooks/useCreateAccount.d.ts +18 -0
  51. package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
  52. package/dist/src/hooks/useCreateAccount.js +1 -1
  53. package/dist/src/hooks/useCreateAccount.js.map +1 -1
  54. package/dist/src/hooks/useLinkAccount.js +1 -1
  55. package/dist/src/hooks/useLinkAccount.js.map +1 -1
  56. package/dist/src/hooks/useTokensBalances.d.ts.map +1 -1
  57. package/dist/src/hooks/useTokensBalances.js +2 -10
  58. package/dist/src/hooks/useTokensBalances.js.map +1 -1
  59. package/dist/src/hooks/useUpdateMezoId.d.ts +18 -0
  60. package/dist/src/hooks/useUpdateMezoId.d.ts.map +1 -1
  61. package/dist/src/hooks/useUpdateUserProfile.d.ts +171 -0
  62. package/dist/src/hooks/useUpdateUserProfile.d.ts.map +1 -0
  63. package/dist/src/hooks/useUpdateUserProfile.js +19 -0
  64. package/dist/src/hooks/useUpdateUserProfile.js.map +1 -0
  65. package/dist/src/hooks/useWalletAccount.d.ts +3 -6
  66. package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
  67. package/dist/src/hooks/useWalletAccount.js +6 -4
  68. package/dist/src/hooks/useWalletAccount.js.map +1 -1
  69. package/dist/src/hooks/useWatchTransferEvents.d.ts.map +1 -1
  70. package/dist/src/hooks/useWatchTransferEvents.js +0 -1
  71. package/dist/src/hooks/useWatchTransferEvents.js.map +1 -1
  72. package/dist/src/index.d.ts +1 -1
  73. package/dist/src/index.d.ts.map +1 -1
  74. package/dist/src/index.js +1 -1
  75. package/dist/src/index.js.map +1 -1
  76. package/dist/src/lib/contracts/index.d.ts +1 -1
  77. package/dist/src/lib/contracts/index.d.ts.map +1 -1
  78. package/dist/src/lib/contracts/index.js +0 -3
  79. package/dist/src/lib/contracts/index.js.map +1 -1
  80. package/dist/src/stores/dropdownStore.d.ts +2 -1
  81. package/dist/src/stores/dropdownStore.d.ts.map +1 -1
  82. package/dist/src/stores/dropdownStore.js +1 -0
  83. package/dist/src/stores/dropdownStore.js.map +1 -1
  84. package/dist/src/utils/assets.d.ts +0 -15
  85. package/dist/src/utils/assets.d.ts.map +1 -1
  86. package/dist/src/utils/assets.js +0 -13
  87. package/dist/src/utils/assets.js.map +1 -1
  88. package/dist/src/utils/validation.d.ts +13 -0
  89. package/dist/src/utils/validation.d.ts.map +1 -0
  90. package/dist/src/utils/validation.js +34 -0
  91. package/dist/src/utils/validation.js.map +1 -0
  92. package/dist/src/utils/validation.test.d.ts +2 -0
  93. package/dist/src/utils/validation.test.d.ts.map +1 -0
  94. package/dist/src/utils/validation.test.js +63 -0
  95. package/dist/src/utils/validation.test.js.map +1 -0
  96. package/package.json +10 -8
  97. package/src/api/auth.ts +22 -0
  98. package/src/assets/EditIcon.tsx +33 -0
  99. package/src/components/Dropdown/Content.tsx +3 -0
  100. package/src/components/Dropdown/Dropdown.tsx +1 -1
  101. package/src/components/Dropdown/NestedViewLayout.tsx +1 -0
  102. package/src/components/Dropdown/Receive/Receive.tsx +1 -1
  103. package/src/components/Dropdown/Root/AccountAddressActions.tsx +1 -1
  104. package/src/components/Dropdown/Root/Root.tsx +29 -2
  105. package/src/components/Dropdown/Root/WalletAddress.tsx +1 -1
  106. package/src/components/Dropdown/Settings/InlineEditField.tsx +212 -0
  107. package/src/components/Dropdown/Settings/Settings.tsx +87 -0
  108. package/src/config.ts +16 -26
  109. package/src/hooks/index.ts +2 -0
  110. package/src/hooks/useAuthenticateWithWallet.ts +1 -1
  111. package/src/hooks/useBorrowData.ts +1 -1
  112. package/src/hooks/useCollateralPrice.ts +1 -1
  113. package/src/hooks/useCreateAccount.ts +1 -1
  114. package/src/hooks/useLinkAccount.ts +1 -1
  115. package/src/hooks/useTokensBalances.ts +1 -10
  116. package/src/hooks/useUpdateUserProfile.ts +34 -0
  117. package/src/hooks/useWalletAccount.ts +15 -10
  118. package/src/hooks/useWatchTransferEvents.ts +0 -1
  119. package/src/index.ts +0 -1
  120. package/src/lib/contracts/index.ts +0 -4
  121. package/src/stores/dropdownStore.ts +1 -0
  122. package/src/utils/assets.ts +0 -14
  123. package/src/utils/validation.test.ts +97 -0
  124. package/src/utils/validation.ts +35 -0
  125. package/dist/src/lib/contracts/artifacts/MEZO.json +0 -428
  126. package/src/lib/contracts/artifacts/MEZO.json +0 -428
@@ -0,0 +1,19 @@
1
+ import { useQueryClient, useMutation, } from "@tanstack/react-query";
2
+ import { useAuthApiClient } from "./useAuthApiClient";
3
+ import { QUERY_KEYS } from "./constants";
4
+ export function useUpdateUserProfile(mutationOptions = {}) {
5
+ const queryClient = useQueryClient();
6
+ const authApiClient = useAuthApiClient();
7
+ const { onSuccess: customOnSuccess, ...restMutationOptions } = mutationOptions;
8
+ const { mutate, mutateAsync, ...rest } = useMutation({
9
+ mutationFn: (updates) => authApiClient.updateAccount(updates),
10
+ onSuccess: (data, variables, context) => {
11
+ queryClient.resetQueries({ queryKey: [QUERY_KEYS.ACCOUNT] });
12
+ if (customOnSuccess)
13
+ customOnSuccess(data, variables, context);
14
+ },
15
+ ...restMutationOptions,
16
+ });
17
+ return { updateProfile: mutate, updateProfileAsync: mutateAsync, ...rest };
18
+ }
19
+ //# sourceMappingURL=useUpdateUserProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUpdateUserProfile.js","sourceRoot":"","sources":["../../../src/hooks/useUpdateUserProfile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,GAGZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,MAAM,UAAU,oBAAoB,CAClC,kBAGI,EAAE;IAEN,MAAM,WAAW,GAAG,cAAc,EAAE,CAAA;IACpC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,mBAAmB,EAAE,GAAG,eAAe,CAAA;IAE9E,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,CAAC;QACnD,UAAU,EAAE,CAAC,OAA6B,EAAE,EAAE,CAC5C,aAAa,CAAC,aAAa,CAAC,OAAO,CAAC;QACtC,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;YACtC,WAAW,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YAE5D,IAAI,eAAe;gBAAE,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;QAChE,CAAC;QACD,GAAG,mBAAmB;KACvB,CAAC,CAAA;IAEF,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,CAAA;AAC5E,CAAC"}
@@ -1,13 +1,10 @@
1
1
  import { Address } from "viem";
2
- import { Connector } from "wagmi";
3
- type UseWalletAccountReturn = {
2
+ import { UseAccountReturnType } from "wagmi";
3
+ type UseWalletAccountReturn = Omit<UseAccountReturnType, "address"> & {
4
4
  accountAddress?: Address;
5
5
  walletAddress?: string;
6
- isConnected: boolean;
7
6
  networkFamily: "bitcoin" | "evm";
8
- connector?: Connector;
9
- chainId?: number;
10
7
  };
11
- export default function useWalletAccount(): UseWalletAccountReturn;
8
+ export declare function useWalletAccount(): UseWalletAccountReturn;
12
9
  export {};
13
10
  //# sourceMappingURL=useWalletAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWalletAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWalletAccount.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AAE7C,KAAK,sBAAsB,GAAG;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,SAAS,GAAG,KAAK,CAAA;IAChC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAID,MAAM,CAAC,OAAO,UAAU,gBAAgB,IAAI,sBAAsB,CAmCjE"}
1
+ {"version":3,"file":"useWalletAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWalletAccount.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAc,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAExD,KAAK,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,SAAS,CAAC,GAAG;IACpE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,SAAS,GAAG,KAAK,CAAA;CACjC,CAAA;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,CA6CzD"}
@@ -1,9 +1,8 @@
1
1
  import { useQuery } from "@tanstack/react-query";
2
2
  import { useMemo } from "react";
3
3
  import { useAccount } from "wagmi";
4
- // TODO: Invesitgate race conditions and refactor
5
- export default function useWalletAccount() {
6
- const { address: evmAddress, connector, chainId } = useAccount();
4
+ export function useWalletAccount() {
5
+ const { address: evmAddress, connector, chainId, isConnected, ...rest } = useAccount();
7
6
  const networkFamily = useMemo(() => (connector?.type !== "orangekit" ? "evm" : "bitcoin"), [connector]);
8
7
  const { data: btcData } = useQuery({
9
8
  queryKey: [connector?.id],
@@ -16,15 +15,18 @@ export default function useWalletAccount() {
16
15
  balance,
17
16
  };
18
17
  },
18
+ enabled: networkFamily === "bitcoin" && !!connector,
19
19
  });
20
20
  const { address: btcAddress } = btcData || {};
21
21
  return {
22
22
  accountAddress: evmAddress,
23
23
  walletAddress: btcAddress ?? evmAddress,
24
- isConnected: networkFamily === "bitcoin" ? !!btcAddress : !!evmAddress,
24
+ isConnected: isConnected &&
25
+ (networkFamily === "bitcoin" ? !!btcAddress : !!evmAddress),
25
26
  networkFamily,
26
27
  connector,
27
28
  chainId,
29
+ ...rest,
28
30
  };
29
31
  }
30
32
  //# sourceMappingURL=useWalletAccount.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWalletAccount.js","sourceRoot":"","sources":["../../../src/hooks/useWalletAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAa,UAAU,EAAE,MAAM,OAAO,CAAA;AAW7C,iDAAiD;AAEjD,MAAM,CAAC,OAAO,UAAU,gBAAgB;IACt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AO,EAEL,cAAc,EAEf,MAAM,kBAAkB,CAAA;AAMzB,iBAAS,sBAAsB,CAAC,KAAK,EAAE,cAAc,QA6CpD;AAED,iBAAS,kCAAkC,SAa1C;AAED,OAAO,EAAE,sBAAsB,EAAE,kCAAkC,EAAE,CAAA"}
1
+ {"version":3,"file":"useWatchTransferEvents.d.ts","sourceRoot":"","sources":["../../../src/hooks/useWatchTransferEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,cAAc,EAEf,MAAM,kBAAkB,CAAA;AAMzB,iBAAS,sBAAsB,CAAC,KAAK,EAAE,cAAc,QA6CpD;AAED,iBAAS,kCAAkC,SAY1C;AAED,OAAO,EAAE,sBAAsB,EAAE,kCAAkC,EAAE,CAAA"}
@@ -58,7 +58,6 @@ function useWatchTransferEventsForAllTokens() {
58
58
  useWatchTransferEvents("mUSDT");
59
59
  useWatchTransferEvents("mxSolvBTC");
60
60
  useWatchTransferEvents("MUSD");
61
- useWatchTransferEvents("MEZO");
62
61
  }
63
62
  export { useWatchTransferEvents, useWatchTransferEventsForAllTokens };
64
63
  //# sourceMappingURL=useWatchTransferEvents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useWatchTransferEvents.js","sourceRoot":"","sources":["../../../src/hooks/useWatchTransferEvents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAA;AACzD,OAAO,EACL,qBAAqB,EAErB,qBAAqB,GACtB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAE/C,SAAS,sBAAsB,CAAC,KAAqB;IACnD,M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qBAAqB,EAAE,CAAA;YACvB,iBAAiB,EAAE,CAAA;QACrB,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,kCAAkC;IACzC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAChC,sBAAsB,CAAC,MAAM,CAAC,CAAA;IAC9B,sBAAsB,CAAC,OAAO,CAAC,CAAA;IAC/B,sBAAsB,CAAC,UAAU,CAAC,CAAA;IAClC,sBAAsB,CAAC,QAAQ,CAAC,CAAA;IAChC,sBAAsB,CAAC,IAAI,CAAC,CAAA;IAC5B,sBAAsB,CAAC,OAAO,CAAC,CAAA;IAC/B,sBAAsB,CAAC,OAAO,CAAC,CAAA;IAC/B,sBAAsB,CAAC,OAAO,CAAC,CAAA;IAC/B,sBAAsB,CAAC,WAAW,CAAC,CAAA;IACnC,sBAAsB,CAAC,MAAM,CAAC,CAAA;AAChC,CAAC;AAED,OAAO,EAAE,sBAAsB,EAAE,kCAAkC,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  export * from "./components";
2
- export { defaultConfig, unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
2
+ export { unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
3
3
  export * from "./constants";
4
4
  export * from "./hooks";
5
5
  export * from "./provider";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./components";
2
- export { defaultConfig, unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
2
+ export { unisatWalletMezoMainnet, unisatWalletMezoTestnet, okxWalletMezoMainnet, okxWalletMezoTestnet, xverseWalletMezoMainnet, xverseWalletMezoTestnet, getDefaultWallets, getConfig, } from "./config";
3
3
  export * from "./constants";
4
4
  export * from "./hooks";
5
5
  export * from "./provider";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,GACV,MAAM,UAAU,CAAA;AACjB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { Abi, Address } from "viem";
2
- export type MezoChainToken = "mcbBTC" | "mDAI" | "mFBTC" | "mSolvBTC" | "mswBTC" | "mT" | "mUSDC" | "mUSDe" | "mUSDT" | "mxSolvBTC" | "MUSD" | "MEZO";
2
+ export type MezoChainToken = "mcbBTC" | "mDAI" | "mFBTC" | "mSolvBTC" | "mswBTC" | "mT" | "mUSDC" | "mUSDe" | "mUSDT" | "mxSolvBTC" | "MUSD";
3
3
  export type MezoBorrowContract = "TroveManager" | "BorrowerOperations" | "PriceFeed";
4
4
  type ContractsMap<K extends string> = Record<K, {
5
5
  address: Address;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/contracts/index.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAGnC,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,IAAI,GACJ,OAAO,GACP,OAAO,GACP,OAAO,GACP,WAAW,GACX,MAAM,GACN,MAAM,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAC1B,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 @@ import troveManagerTestnet from "@mezo-org/musd-contracts/deployments/matsnet/Tr
26
26
  import borrowerOperationsTestnet from "@mezo-org/musd-contracts/deployments/matsnet/BorrowerOperations.json";
27
27
  import priceFeed from "@mezo-org/musd-contracts/deployments/mainnet/PriceFeed.json";
28
28
  import priceFeedTestnet from "@mezo-org/musd-contracts/deployments/matsnet/PriceFeed.json";
29
- import mezoArtifact from "./artifacts/MEZO.json";
30
29
  export const testnetTokenContracts = {
31
30
  mcbBTC: cbbtcTestnet,
32
31
  mDAI: daiTestnet,
@@ -39,7 +38,6 @@ export const testnetTokenContracts = {
39
38
  mUSDT: usdtTestnet,
40
39
  mxSolvBTC: xsolvbtcTestnet,
41
40
  MUSD: musdTestnet,
42
- MEZO: mezoArtifact,
43
41
  };
44
42
  export const mainnetTokenContracts = {
45
43
  mcbBTC: cbbtcMainnet,
@@ -53,7 +51,6 @@ export const mainnetTokenContracts = {
53
51
  mUSDT: usdtMainnet,
54
52
  mxSolvBTC: xsolvbtcMainnet,
55
53
  MUSD: musdMainnet,
56
- MEZO: mezoArtifact,
57
54
  };
58
55
  export const mainnetBorrowContracts = {
59
56
  TroveManager: troveManagerMainnet,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2DAA2D,CAAA;AACpF,OAAO,UAAU,MAAM,yDAAyD,CAAA;AAChF,OAAO,WAAW,MAAM,0DAA0D,CAAA;AAClF,OAAO,cAAc,MAAM,6DAA6D,CAAA;AACxF,OAAO,YAAY,MAAM,2DAA2D,CAAA;AACpF,OAAO,QAAQ,MAAM,uDAAuD,CAAA;AAC5E,OAAO,WAAW,MAAM,0DAA0D,CAAA;AAClF,OAAO,WAAW,MAAM,0DAA0D,CAAA;AAClF,OAAO,WAAW,MAAM,0DAA0D,CAAA;AAClF,OAAO,eAAe,MAAM,8DAA8D,CAAA;AAC1F,OAAO,WAAW,MAAM,wDA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;IACjC,kBAAkB,EAAE,yBAAyB;IAC7C,SAAS,EAAE,gBAAgB;CACmB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export declare enum DropdownView {
2
2
  ROOT = "ROOT",
3
- RECEIVE = "RECEIVE"
3
+ RECEIVE = "RECEIVE",
4
+ SETTINGS = "SETTINGS"
4
5
  }
5
6
  interface DropdownStore {
6
7
  view: DropdownView;
@@ -1 +1 @@
1
- {"version":3,"file":"dropdownStore.d.ts","sourceRoot":"","sources":["../../../src/stores/dropdownStore.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
+ {"version":3,"file":"dropdownStore.d.ts","sourceRoot":"","sources":["../../../src/stores/dropdownStore.ts"],"names":[],"mappings":"AAEA,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;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"}
@@ -3,6 +3,7 @@ export var DropdownView;
3
3
  (function (DropdownView) {
4
4
  DropdownView["ROOT"] = "ROOT";
5
5
  DropdownView["RECEIVE"] = "RECEIVE";
6
+ DropdownView["SETTINGS"] = "SETTINGS";
6
7
  })(DropdownView || (DropdownView = {}));
7
8
  const useDropdownStore = create((set, get) => ({
8
9
  view: DropdownView.ROOT,
@@ -1 +1 @@
1
- {"version":3,"file":"dropdownStore.js","sourceRoot":"","sources":["../../../src/stores/dropdownStore.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
+ {"version":3,"file":"dropdownStore.js","sourceRoot":"","sources":["../../../src/stores/dropdownStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEhC,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;AACvB,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB;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"}
@@ -64,11 +64,6 @@ declare const ASSETS: {
64
64
  symbol: string;
65
65
  decimals: number;
66
66
  };
67
- MEZO: {
68
- name: string;
69
- symbol: string;
70
- decimals: number;
71
- };
72
67
  };
73
68
  /**
74
69
  * Gets details of given crypto asset
@@ -127,10 +122,6 @@ export declare function getAsset(key: keyof typeof ASSETS): {
127
122
  name: string;
128
123
  symbol: string;
129
124
  decimals: number;
130
- } | {
131
- name: string;
132
- symbol: string;
133
- decimals: number;
134
125
  };
135
126
  /**
136
127
  * Checks if given crypto asset is Bitcoin-like
@@ -150,11 +141,5 @@ export declare function isUsdLikeCryptoAsset(key: string): boolean;
150
141
  * @returns True if crypto asset is T token
151
142
  */
152
143
  export declare function isTTokenCryptoAsset(key: string): boolean;
153
- /**
154
- * Checks if given crypto asset is MEZO token
155
- * @param key The key of crypto asset
156
- * @returns True if crypto asset is MEZO token
157
- */
158
- export declare function isMezoCryptoAsset(key: string): boolean;
159
144
  export {};
160
145
  //# sourceMappingURL=assets.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEX,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;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,WAE5C"}
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"}
@@ -64,11 +64,6 @@ const ASSETS = {
64
64
  symbol: "mxSolvBTC",
65
65
  decimals: 18,
66
66
  },
67
- MEZO: {
68
- name: "MEZO",
69
- symbol: "MEZO",
70
- decimals: 18,
71
- },
72
67
  };
73
68
  /**
74
69
  * Gets details of given crypto asset
@@ -102,12 +97,4 @@ export function isUsdLikeCryptoAsset(key) {
102
97
  export function isTTokenCryptoAsset(key) {
103
98
  return /^(mt|t)$/i.test(key);
104
99
  }
105
- /**
106
- * Checks if given crypto asset is MEZO token
107
- * @param key The key of crypto asset
108
- * @returns True if crypto asset is MEZO token
109
- */
110
- export function isMezoCryptoAsset(key) {
111
- return /^mezo$/i.test(key);
112
- }
113
100
  //# sourceMappingURL=assets.js.map
@@ -1 +1 @@
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,EA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value - The email address to validate
4
+ * @returns An error message if invalid, null if valid or empty
5
+ */
6
+ export declare function validateEmail(value: string): string | null;
7
+ /**
8
+ * Validates a Telegram handle.
9
+ * @param value - The Telegram handle to validate (with or without @ prefix)
10
+ * @returns An error message if invalid, null if valid or empty
11
+ */
12
+ export declare function validateTelegram(value: string): string | null;
13
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ1D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAY7D"}
@@ -0,0 +1,34 @@
1
+ const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
2
+ /**
3
+ * Validates an email address.
4
+ * @param value - The email address to validate
5
+ * @returns An error message if invalid, null if valid or empty
6
+ */
7
+ export function validateEmail(value) {
8
+ if (!value) {
9
+ return null;
10
+ }
11
+ if (!EMAIL_REGEX.test(value)) {
12
+ return "Please enter a valid email address";
13
+ }
14
+ return null;
15
+ }
16
+ /**
17
+ * Validates a Telegram handle.
18
+ * @param value - The Telegram handle to validate (with or without @ prefix)
19
+ * @returns An error message if invalid, null if valid or empty
20
+ */
21
+ export function validateTelegram(value) {
22
+ if (!value) {
23
+ return null;
24
+ }
25
+ const handle = value.startsWith("@") ? value.slice(1) : value;
26
+ if (handle.length < 5) {
27
+ return "Telegram handle must be at least 5 characters";
28
+ }
29
+ if (!/^[a-zA-Z0-9_]+$/.test(handle)) {
30
+ return "Telegram handle can only contain letters, numbers, and underscores";
31
+ }
32
+ return null;
33
+ }
34
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG,4BAA4B,CAAA;AAEhD;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,oCAAoC,CAAA;IAC7C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC7D,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,+CAA+C,CAAA;IACxD,CAAC;IACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,OAAO,oEAAoE,CAAA;IAC7E,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=validation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../../src/utils/validation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,63 @@
1
+ import { validateEmail, validateTelegram } from "./validation";
2
+ describe("validateEmail", () => {
3
+ it("returns null for empty string", () => {
4
+ expect(validateEmail("")).toBeNull();
5
+ });
6
+ it("returns null for valid email", () => {
7
+ expect(validateEmail("user@example.com")).toBeNull();
8
+ });
9
+ it("returns null for valid email with subdomain", () => {
10
+ expect(validateEmail("user@mail.example.com")).toBeNull();
11
+ });
12
+ it("returns null for valid email with plus addressing", () => {
13
+ expect(validateEmail("user+tag@example.com")).toBeNull();
14
+ });
15
+ it("returns error for email without @", () => {
16
+ expect(validateEmail("userexample.com")).toBe("Please enter a valid email address");
17
+ });
18
+ it("returns error for email without domain", () => {
19
+ expect(validateEmail("user@")).toBe("Please enter a valid email address");
20
+ });
21
+ it("returns error for email without TLD", () => {
22
+ expect(validateEmail("user@example")).toBe("Please enter a valid email address");
23
+ });
24
+ it("returns error for email with spaces", () => {
25
+ expect(validateEmail("user @example.com")).toBe("Please enter a valid email address");
26
+ });
27
+ });
28
+ describe("validateTelegram", () => {
29
+ it("returns null for empty string", () => {
30
+ expect(validateTelegram("")).toBeNull();
31
+ });
32
+ it("returns null for valid handle without @", () => {
33
+ expect(validateTelegram("username")).toBeNull();
34
+ });
35
+ it("returns null for valid handle with @", () => {
36
+ expect(validateTelegram("@username")).toBeNull();
37
+ });
38
+ it("returns null for handle with numbers", () => {
39
+ expect(validateTelegram("user123")).toBeNull();
40
+ });
41
+ it("returns null for handle with underscores", () => {
42
+ expect(validateTelegram("user_name")).toBeNull();
43
+ });
44
+ it("returns null for exactly 5 character handle", () => {
45
+ expect(validateTelegram("abcde")).toBeNull();
46
+ });
47
+ it("returns error for handle shorter than 5 characters", () => {
48
+ expect(validateTelegram("abcd")).toBe("Telegram handle must be at least 5 characters");
49
+ });
50
+ it("returns error for handle with @ that is too short", () => {
51
+ expect(validateTelegram("@abcd")).toBe("Telegram handle must be at least 5 characters");
52
+ });
53
+ it("returns error for handle with special characters", () => {
54
+ expect(validateTelegram("user-name")).toBe("Telegram handle can only contain letters, numbers, and underscores");
55
+ });
56
+ it("returns error for handle with spaces", () => {
57
+ expect(validateTelegram("user name")).toBe("Telegram handle can only contain letters, numbers, and underscores");
58
+ });
59
+ it("returns error for handle with dots", () => {
60
+ expect(validateTelegram("user.name")).toBe("Telegram handle can only contain letters, numbers, and underscores");
61
+ });
62
+ });
63
+ //# sourceMappingURL=validation.test.js.map
@@ -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,CAChD,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACpC,+CAA+C,CAChD,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CACxC,oEAAoE,CACrE,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CACxC,oEAAoE,CACrE,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC5C,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CACxC,oEAAoE,CACrE,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezo-org/passport",
3
- "version": "0.16.0-dev.0",
3
+ "version": "0.16.0-dev.1",
4
4
  "main": "dist/src/index.js",
5
5
  "license": "GPL-3.0-only",
6
6
  "scripts": {
@@ -34,25 +34,27 @@
34
34
  "prettier": "^3.2.5",
35
35
  "ts-jest": "^29.1.2",
36
36
  "ts-node": "^10.9.2",
37
- "typescript": "^5.4.3"
37
+ "typescript": "^5.8.2"
38
38
  },
39
39
  "dependencies": {
40
40
  "@mezo-org/mezo-clay": "0.1.0-dev.37",
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.19",
43
+ "@mezo-org/orangekit": "1.0.0-beta.40",
44
44
  "@mezo-org/sign-in-with-wallet": "1.0.0-beta.8",
45
+ "@rainbow-me/rainbowkit": "2.0.2",
46
+ "@tanstack/react-query": "^5.28.4",
47
+ "motion": "^12.23.6",
45
48
  "qrcode.react": "^4.2.0",
46
49
  "styletron-engine-monolithic": "^1.0.0",
47
50
  "usehooks-ts": "^3.1.1",
48
- "motion": "^12.23.6",
49
51
  "zustand": "^5.0.3"
50
52
  },
51
53
  "peerDependencies": {
52
- "@rainbow-me/rainbowkit": "2.0.2",
54
+ "@rainbow-me/rainbowkit": "^2.0.2",
53
55
  "@tanstack/react-query": "^5.28.4",
54
56
  "react": "^18.2.0",
55
- "viem": "2.22.8",
56
- "wagmi": "2.5.12"
57
+ "viem": "^2.22.8",
58
+ "wagmi": "^2.5.12"
57
59
  }
58
- }
60
+ }
package/src/api/auth.ts CHANGED
@@ -31,6 +31,8 @@ type Account = {
31
31
  hasModifiedMezoId: boolean
32
32
  linkedAccounts: LinkedAccount[]
33
33
  documents?: Record<DocumentType, UserDocumentStatus>
34
+ email?: string
35
+ telegram?: string
34
36
  }
35
37
 
36
38
  export type Session = {
@@ -94,6 +96,14 @@ export type AcceptDocumentsRequest = Partial<
94
96
  Record<DocumentType, { acceptedVersion: string }>
95
97
  >
96
98
 
99
+ export type UpdateAccountRequest = {
100
+ mezoId?: string
101
+ email?: string
102
+ telegram?: string
103
+ }
104
+
105
+ export type UpdateAccountResponse = Account
106
+
97
107
  export const AUTH_API_ENDPOINTS_BY_ENV = {
98
108
  mainnet: "https://api.mezo.org",
99
109
  testnet: "https://api.test.mezo.org",
@@ -222,4 +232,16 @@ export class AuthApiClient extends ApiClient {
222
232
 
223
233
  return data
224
234
  }
235
+
236
+ async updateAccount(updates: UpdateAccountRequest) {
237
+ const data = await this.handleRequest<UpdateAccountResponse>(
238
+ "/session/account",
239
+ {
240
+ method: "PATCH",
241
+ body: updates,
242
+ },
243
+ )
244
+
245
+ return data
246
+ }
225
247
  }
@@ -0,0 +1,33 @@
1
+ import { Icon, IconProps } from "@mezo-org/mezo-clay"
2
+ import React, { forwardRef, Ref } from "react"
3
+
4
+ function EditIcon(props: IconProps, ref: Ref<SVGSVGElement>) {
5
+ const { title, size = 16, color = "black", ...restProps } = props
6
+
7
+ return (
8
+ <Icon
9
+ ref={ref}
10
+ viewBox="0 0 24 24"
11
+ title={title ?? "Edit"}
12
+ size={size}
13
+ color={color}
14
+ role="graphics-symbol"
15
+ {...restProps}
16
+ >
17
+ <path
18
+ d="M18 10L21 7L17 3L14 6M18 10L8 20H4V16L14 6M18 10L14 6"
19
+ stroke={color}
20
+ strokeWidth="2"
21
+ strokeLinecap="round"
22
+ strokeLinejoin="round"
23
+ fill="none"
24
+ />
25
+ </Icon>
26
+ )
27
+ }
28
+
29
+ const ForwardedEditIcon: React.ForwardRefExoticComponent<
30
+ IconProps & React.RefAttributes<SVGSVGElement>
31
+ > = forwardRef<SVGSVGElement, IconProps>(EditIcon)
32
+
33
+ export default ForwardedEditIcon
@@ -3,6 +3,7 @@ import React, { useEffect } from "react"
3
3
  import useDropdownStore, { DropdownView } from "../../stores/dropdownStore"
4
4
  import Root from "./Root/Root"
5
5
  import Receive from "./Receive/Receive"
6
+ import Settings from "./Settings/Settings"
6
7
  import TestnetTopBanner from "./TestnetTopBanner"
7
8
 
8
9
  type ContentProps = {
@@ -46,6 +47,8 @@ function Content(props: ContentProps) {
46
47
  )}
47
48
 
48
49
  {currentView === DropdownView.RECEIVE && <Receive />}
50
+
51
+ {currentView === DropdownView.SETTINGS && <Settings />}
49
52
  </Block>
50
53
  )
51
54
  }
@@ -10,7 +10,7 @@ import DefaultAvatar from "../../assets/DefaultAvatar"
10
10
  import ConnectedTrigger from "./ConnectedTrigger"
11
11
  import Content from "./Content"
12
12
  import DisconnectedTrigger from "./DisconnectedTrigger"
13
- import useWalletAccount from "../../hooks/useWalletAccount"
13
+ import { useWalletAccount } from "../../hooks/useWalletAccount"
14
14
  import { useWatchTransferEventsForAllTokens } from "../../hooks/useWatchTransferEvents"
15
15
 
16
16
  export type DropdownProps = {
@@ -12,6 +12,7 @@ import useDropdownStore, { DropdownView } from "../../stores/dropdownStore"
12
12
  const getHeaderTitle = (view: DropdownView) => {
13
13
  const titleMap: Partial<Record<DropdownView, string>> = {
14
14
  [DropdownView.RECEIVE]: "Scan to receive",
15
+ [DropdownView.SETTINGS]: "Settings",
15
16
  }
16
17
  return titleMap[view]!
17
18
  }
@@ -13,7 +13,7 @@ import { QRCodeSVG } from "qrcode.react"
13
13
  import NestedViewLayout from "../NestedViewLayout"
14
14
  import { getAddressExplorerUrl } from "../../../utils/address"
15
15
  import { usePassportContext } from "../../../hooks/usePassportContext"
16
- import useWalletAccount from "../../../hooks/useWalletAccount"
16
+ import { useWalletAccount } from "../../../hooks/useWalletAccount"
17
17
 
18
18
  function Receive() {
19
19
  const { environment } = usePassportContext()
@@ -11,7 +11,7 @@ import React from "react"
11
11
  import { usePassportContext } from "../../../hooks/usePassportContext"
12
12
  import { getAddressExplorerUrl } from "../../../utils/address"
13
13
  import useDropdownStore, { DropdownView } from "../../../stores/dropdownStore"
14
- import useWalletAccount from "../../../hooks/useWalletAccount"
14
+ import { useWalletAccount } from "../../../hooks/useWalletAccount"
15
15
 
16
16
  const buttonStartEnhancerSize = 12
17
17