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

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 (42) 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-6HRRPZPM.mjs → chunk-LPQROHSB.mjs} +2 -2
  4. package/dist/{chunk-D6IUBR7S.mjs → chunk-V3WGYFWQ.mjs} +47 -1
  5. package/dist/chunk-V3WGYFWQ.mjs.map +1 -0
  6. package/dist/components/index.d.mts +3 -3
  7. package/dist/components/index.d.ts +3 -3
  8. package/dist/components/index.mjs +1 -1
  9. package/dist/hooks/api/index.d.mts +2 -2
  10. package/dist/hooks/api/index.d.ts +2 -2
  11. package/dist/hooks/api/index.mjs +2 -2
  12. package/dist/hooks/index.d.mts +2 -2
  13. package/dist/hooks/index.d.ts +2 -2
  14. package/dist/hooks/index.js +53 -0
  15. package/dist/hooks/index.js.map +1 -1
  16. package/dist/hooks/index.mjs +3 -1
  17. package/dist/{index-BVatQlwF.d.mts → index-B-s1k4Da.d.mts} +1 -1
  18. package/dist/{index-BIgM4fy0.d.mts → index-B8DYrhSW.d.mts} +1 -1
  19. package/dist/{index-CGs_yTFg.d.ts → index-BHvCA7F9.d.ts} +2 -2
  20. package/dist/{index-M7ZB3yR5.d.mts → index-BZrddrq-.d.mts} +2 -2
  21. package/dist/{index-DamklTOJ.d.mts → index-BvLpvebq.d.mts} +2 -2
  22. package/dist/{index-CKiK4KHj.d.ts → index-Bzcc-y8m.d.ts} +1 -1
  23. package/dist/{index-BwD1ij0H.d.ts → index-Cwx2p8th.d.ts} +1 -1
  24. package/dist/{index-C2-M-aBb.d.ts → index-DCeOyAw8.d.ts} +2 -2
  25. package/dist/{index-RfA22r-Z.d.ts → index-DG_gyw1q.d.ts} +1 -1
  26. package/dist/{index-BHVMQGZj.d.mts → index-DKyt0for.d.mts} +11 -3
  27. package/dist/{index-Bb7IkjUW.d.mts → index-DbG5IjhP.d.mts} +1 -1
  28. package/dist/{index-DgAnNnit.d.ts → index-TkB89QxX.d.ts} +11 -3
  29. package/dist/index.d.mts +7 -7
  30. package/dist/index.d.ts +7 -7
  31. package/dist/index.js +45 -0
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.mjs +2 -2
  34. package/dist/types/index.d.mts +1 -1
  35. package/dist/types/index.d.ts +1 -1
  36. package/dist/{types-DQq17lf4.d.mts → types-CHkU0WHZ.d.mts} +1 -1
  37. package/dist/{types-DQq17lf4.d.ts → types-CHkU0WHZ.d.ts} +1 -1
  38. package/dist/ui/index.d.mts +3 -3
  39. package/dist/ui/index.d.ts +3 -3
  40. package/package.json +1 -1
  41. package/dist/chunk-D6IUBR7S.mjs.map +0 -1
  42. /package/dist/{chunk-6HRRPZPM.mjs.map → chunk-LPQROHSB.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { q as IconProps$1 } from '../../types-DQq17lf4.mjs';
3
+ import { r as IconProps$1 } from '../../types-CHkU0WHZ.mjs';
4
4
 
5
5
  declare function BackIcon({ color, size, className, style }: {
6
6
  color?: string;
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React, { CSSProperties } from 'react';
3
- import { q as IconProps$1 } from '../../types-DQq17lf4.js';
3
+ import { r as IconProps$1 } from '../../types-CHkU0WHZ.js';
4
4
 
5
5
  declare function BackIcon({ color, size, className, style }: {
6
6
  color?: string;
@@ -11,7 +11,7 @@ import {
11
11
  useUserInfo,
12
12
  verifyPohApi,
13
13
  wallet_exports
14
- } from "./chunk-D6IUBR7S.mjs";
14
+ } from "./chunk-V3WGYFWQ.mjs";
15
15
  import {
16
16
  __export
17
17
  } from "./chunk-J5LGTIGS.mjs";
@@ -94,4 +94,4 @@ export {
94
94
  user_exports,
95
95
  api_exports
96
96
  };
97
- //# sourceMappingURL=chunk-6HRRPZPM.mjs.map
97
+ //# sourceMappingURL=chunk-LPQROHSB.mjs.map
@@ -592,6 +592,7 @@ __export(hooks_exports, {
592
592
  useMatchChain: () => useMatchChain,
593
593
  useMatchEvents: () => useMatchEvents,
594
594
  useMatchWallet: () => useMatchWallet,
595
+ useMatchWalletRecords: () => useMatchWalletRecords,
595
596
  useModal: () => useModal,
596
597
  useReceipt: () => useReceipt,
597
598
  useToast: () => useToast,
@@ -1238,6 +1239,11 @@ function useMatchChain() {
1238
1239
  // src/hooks/useMatchWallet.tsx
1239
1240
  import { QRCode } from "react-qrcode";
1240
1241
  import { useEffect as useEffect6, useState as useState7 } from "react";
1242
+
1243
+ // example/src/config/contract.ts
1244
+ var address = "0x4143e29770fd63e24bb1f32d50bf8a590e34de4b";
1245
+
1246
+ // src/hooks/useMatchWallet.tsx
1241
1247
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1242
1248
  function useMatchWallet() {
1243
1249
  const modal = useModal();
@@ -1285,6 +1291,45 @@ function useMatchWallet() {
1285
1291
  showReceiveModal
1286
1292
  };
1287
1293
  }
1294
+ function useMatchWalletRecords({
1295
+ pageSize = 10
1296
+ }) {
1297
+ const [hasMore, setHasMore] = useState7(true);
1298
+ const [items, setItems] = useState7([]);
1299
+ const { chainId } = useMatchChain();
1300
+ const chainIdStr = chainId.toString() || "";
1301
+ const fetchMoreData = async () => {
1302
+ if (!hasMore) {
1303
+ return;
1304
+ }
1305
+ const res = await getUserWalletTransactionsApi({
1306
+ chain_id: chainIdStr,
1307
+ limit: pageSize,
1308
+ offset: items.length
1309
+ });
1310
+ if (isSuccess(res)) {
1311
+ if (res.data && res.data.transactions.length > 0) {
1312
+ setItems(items.concat(res.data.transactions));
1313
+ }
1314
+ setHasMore(res.data && res.data.transactions.length >= pageSize);
1315
+ }
1316
+ };
1317
+ const onInit = async () => {
1318
+ setItems([]);
1319
+ setHasMore(true);
1320
+ fetchMoreData();
1321
+ };
1322
+ useEffect6(() => {
1323
+ if (chainId && address) {
1324
+ onInit();
1325
+ }
1326
+ }, [chainId, address]);
1327
+ return {
1328
+ items,
1329
+ fetchMoreData,
1330
+ hasMore
1331
+ };
1332
+ }
1288
1333
 
1289
1334
  // src/hooks/useReceipt.tsx
1290
1335
  import { useState as useState8, useCallback as useCallback4, useEffect as useEffect7 } from "react";
@@ -4689,9 +4734,10 @@ export {
4689
4734
  WalletModal,
4690
4735
  components_exports,
4691
4736
  useMatchWallet,
4737
+ useMatchWalletRecords,
4692
4738
  useReceipt,
4693
4739
  hooks_exports,
4694
4740
  MatchProvider,
4695
4741
  useMatch
4696
4742
  };
4697
- //# sourceMappingURL=chunk-D6IUBR7S.mjs.map
4743
+ //# sourceMappingURL=chunk-V3WGYFWQ.mjs.map