@matchain/matchid-sdk-react 0.1.48-alpha.2 → 0.1.48-alpha.4

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 (44) hide show
  1. package/dist/assets/icon/index.d.mts +1 -1
  2. package/dist/assets/icon/index.d.ts +1 -1
  3. package/dist/{chunk-D6IUBR7S.mjs → chunk-546GCDLV.mjs} +47 -1
  4. package/dist/chunk-546GCDLV.mjs.map +1 -0
  5. package/dist/{chunk-6HRRPZPM.mjs → chunk-UTCHBVMG.mjs} +2 -2
  6. package/dist/components/index.d.mts +3 -3
  7. package/dist/components/index.d.ts +3 -3
  8. package/dist/components/index.js.map +1 -1
  9. package/dist/components/index.mjs +1 -1
  10. package/dist/hooks/api/index.d.mts +2 -2
  11. package/dist/hooks/api/index.d.ts +2 -2
  12. package/dist/hooks/api/index.js.map +1 -1
  13. package/dist/hooks/api/index.mjs +2 -2
  14. package/dist/hooks/index.d.mts +2 -2
  15. package/dist/hooks/index.d.ts +2 -2
  16. package/dist/hooks/index.js +53 -0
  17. package/dist/hooks/index.js.map +1 -1
  18. package/dist/hooks/index.mjs +3 -1
  19. package/dist/{index-BVatQlwF.d.mts → index-B-s1k4Da.d.mts} +1 -1
  20. package/dist/{index-BIgM4fy0.d.mts → index-B8DYrhSW.d.mts} +1 -1
  21. package/dist/{index-CGs_yTFg.d.ts → index-BHvCA7F9.d.ts} +2 -2
  22. package/dist/{index-M7ZB3yR5.d.mts → index-BZrddrq-.d.mts} +2 -2
  23. package/dist/{index-DamklTOJ.d.mts → index-BvLpvebq.d.mts} +2 -2
  24. package/dist/{index-CKiK4KHj.d.ts → index-Bzcc-y8m.d.ts} +1 -1
  25. package/dist/{index-BwD1ij0H.d.ts → index-Cwx2p8th.d.ts} +1 -1
  26. package/dist/{index-C2-M-aBb.d.ts → index-DCeOyAw8.d.ts} +2 -2
  27. package/dist/{index-RfA22r-Z.d.ts → index-DG_gyw1q.d.ts} +1 -1
  28. package/dist/{index-BHVMQGZj.d.mts → index-DKyt0for.d.mts} +11 -3
  29. package/dist/{index-Bb7IkjUW.d.mts → index-DbG5IjhP.d.mts} +1 -1
  30. package/dist/{index-DgAnNnit.d.ts → index-TkB89QxX.d.ts} +11 -3
  31. package/dist/index.d.mts +7 -7
  32. package/dist/index.d.ts +7 -7
  33. package/dist/index.js +45 -0
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +2 -2
  36. package/dist/types/index.d.mts +1 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/dist/{types-DQq17lf4.d.mts → types-CHkU0WHZ.d.mts} +1 -1
  39. package/dist/{types-DQq17lf4.d.ts → types-CHkU0WHZ.d.ts} +1 -1
  40. package/dist/ui/index.d.mts +3 -3
  41. package/dist/ui/index.d.ts +3 -3
  42. package/package.json +1 -1
  43. package/dist/chunk-D6IUBR7S.mjs.map +0 -1
  44. /package/dist/{chunk-6HRRPZPM.mjs.map → chunk-UTCHBVMG.mjs.map} +0 -0
@@ -2,11 +2,11 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-6HRRPZPM.mjs";
5
+ } from "../../chunk-UTCHBVMG.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-D6IUBR7S.mjs";
9
+ } from "../../chunk-546GCDLV.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
11
  import "../../chunk-LNSJ3ZXG.mjs";
12
12
  import "../../chunk-A5D3NKTK.mjs";
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, j as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, d as useModal, h as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-BHVMQGZj.mjs';
2
- import '../types-DQq17lf4.mjs';
1
+ export { c as useCopyClipboard, k as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-DKyt0for.mjs';
2
+ import '../types-CHkU0WHZ.mjs';
3
3
  import 'react';
4
4
  import 'viem';
5
5
  import '../mpc-CTbBWHld.mjs';
@@ -1,5 +1,5 @@
1
- export { c as useCopyClipboard, j as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, d as useModal, h as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-DgAnNnit.js';
2
- import '../types-DQq17lf4.js';
1
+ export { c as useCopyClipboard, k as useLayout, f as useMatchChain, a as useMatchEvents, g as useMatchWallet, h as useMatchWalletRecords, d as useModal, j as useReceipt, e as useToast, u as useUserInfo, b as useWallet } from '../index-TkB89QxX.js';
2
+ import '../types-CHkU0WHZ.js';
3
3
  import 'react';
4
4
  import 'viem';
5
5
  import '../mpc-CTbBWHld.js';
@@ -35,6 +35,7 @@ __export(hooks_exports, {
35
35
  useMatchChain: () => useMatchChain,
36
36
  useMatchEvents: () => useMatchEvents,
37
37
  useMatchWallet: () => useMatchWallet,
38
+ useMatchWalletRecords: () => useMatchWalletRecords,
38
39
  useModal: () => useModal,
39
40
  useReceipt: () => useReceipt,
40
41
  useToast: () => useToast,
@@ -255,6 +256,13 @@ var getUserChainListApi = () => {
255
256
  method: "GET"
256
257
  });
257
258
  };
259
+ var getUserWalletTransactionsApi = (data) => {
260
+ return request_default({
261
+ url: `/api/v1/user/wallet/transactions`,
262
+ method: "POST",
263
+ data
264
+ });
265
+ };
258
266
 
259
267
  // src/store/useLocalStore.ts
260
268
  var persistedState = (0, import_middleware.persist)(
@@ -1514,6 +1522,11 @@ function useMatchChain() {
1514
1522
  // src/hooks/useMatchWallet.tsx
1515
1523
  var import_react_qrcode = require("react-qrcode");
1516
1524
  var import_react33 = require("react");
1525
+
1526
+ // example/src/config/contract.ts
1527
+ var address = "0x4143e29770fd63e24bb1f32d50bf8a590e34de4b";
1528
+
1529
+ // src/hooks/useMatchWallet.tsx
1517
1530
  var import_jsx_runtime82 = require("react/jsx-runtime");
1518
1531
  function useMatchWallet() {
1519
1532
  const modal = useModal();
@@ -1561,6 +1574,45 @@ function useMatchWallet() {
1561
1574
  showReceiveModal
1562
1575
  };
1563
1576
  }
1577
+ function useMatchWalletRecords({
1578
+ pageSize = 10
1579
+ }) {
1580
+ const [hasMore, setHasMore] = (0, import_react33.useState)(true);
1581
+ const [items, setItems] = (0, import_react33.useState)([]);
1582
+ const { chainId } = useMatchChain();
1583
+ const chainIdStr = chainId ? chainId.toString() : "";
1584
+ const fetchMoreData = async () => {
1585
+ if (!hasMore) {
1586
+ return;
1587
+ }
1588
+ const res = await getUserWalletTransactionsApi({
1589
+ chain_id: chainIdStr,
1590
+ limit: pageSize,
1591
+ offset: items.length
1592
+ });
1593
+ if (isSuccess(res)) {
1594
+ if (res.data && res.data.transactions.length > 0) {
1595
+ setItems(items.concat(res.data.transactions));
1596
+ }
1597
+ setHasMore(res.data && res.data.transactions.length >= pageSize);
1598
+ }
1599
+ };
1600
+ const onInit = async () => {
1601
+ setItems([]);
1602
+ setHasMore(true);
1603
+ fetchMoreData();
1604
+ };
1605
+ (0, import_react33.useEffect)(() => {
1606
+ if (chainId && address) {
1607
+ onInit();
1608
+ }
1609
+ }, [chainId, address]);
1610
+ return {
1611
+ items,
1612
+ fetchMoreData,
1613
+ hasMore
1614
+ };
1615
+ }
1564
1616
 
1565
1617
  // src/hooks/useReceipt.tsx
1566
1618
  var import_react34 = require("react");
@@ -1713,6 +1765,7 @@ function useReceipt({
1713
1765
  useMatchChain,
1714
1766
  useMatchEvents,
1715
1767
  useMatchWallet,
1768
+ useMatchWalletRecords,
1716
1769
  useModal,
1717
1770
  useReceipt,
1718
1771
  useToast,