@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.
- package/dist/assets/icon/index.d.mts +1 -1
- package/dist/assets/icon/index.d.ts +1 -1
- package/dist/{chunk-6HRRPZPM.mjs → chunk-LPQROHSB.mjs} +2 -2
- package/dist/{chunk-D6IUBR7S.mjs → chunk-V3WGYFWQ.mjs} +47 -1
- package/dist/chunk-V3WGYFWQ.mjs.map +1 -0
- package/dist/components/index.d.mts +3 -3
- package/dist/components/index.d.ts +3 -3
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.d.mts +2 -2
- package/dist/hooks/api/index.d.ts +2 -2
- package/dist/hooks/api/index.mjs +2 -2
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +53 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3 -1
- package/dist/{index-BVatQlwF.d.mts → index-B-s1k4Da.d.mts} +1 -1
- package/dist/{index-BIgM4fy0.d.mts → index-B8DYrhSW.d.mts} +1 -1
- package/dist/{index-CGs_yTFg.d.ts → index-BHvCA7F9.d.ts} +2 -2
- package/dist/{index-M7ZB3yR5.d.mts → index-BZrddrq-.d.mts} +2 -2
- package/dist/{index-DamklTOJ.d.mts → index-BvLpvebq.d.mts} +2 -2
- package/dist/{index-CKiK4KHj.d.ts → index-Bzcc-y8m.d.ts} +1 -1
- package/dist/{index-BwD1ij0H.d.ts → index-Cwx2p8th.d.ts} +1 -1
- package/dist/{index-C2-M-aBb.d.ts → index-DCeOyAw8.d.ts} +2 -2
- package/dist/{index-RfA22r-Z.d.ts → index-DG_gyw1q.d.ts} +1 -1
- package/dist/{index-BHVMQGZj.d.mts → index-DKyt0for.d.mts} +11 -3
- package/dist/{index-Bb7IkjUW.d.mts → index-DbG5IjhP.d.mts} +1 -1
- package/dist/{index-DgAnNnit.d.ts → index-TkB89QxX.d.ts} +11 -3
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/{types-DQq17lf4.d.mts → types-CHkU0WHZ.d.mts} +1 -1
- package/dist/{types-DQq17lf4.d.ts → types-CHkU0WHZ.d.ts} +1 -1
- package/dist/ui/index.d.mts +3 -3
- package/dist/ui/index.d.ts +3 -3
- package/package.json +1 -1
- package/dist/chunk-D6IUBR7S.mjs.map +0 -1
- /package/dist/{chunk-6HRRPZPM.mjs.map → chunk-LPQROHSB.mjs.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BTCModal, E as EmailModal, L as LoginBox, a as LoginButton, c as LoginModal, b as LoginPanel, S as SOLModal, d as TONModal, T as TRONModal, U as UsernameModal, W as WalletModal } from '../index-
|
|
2
|
-
export { B as Button, F as Field, I as Input, M as Modal, a as ModalWithHeader, O as Overlay, P as Popover } from '../index-
|
|
1
|
+
export { B as BTCModal, E as EmailModal, L as LoginBox, a as LoginButton, c as LoginModal, b as LoginPanel, S as SOLModal, d as TONModal, T as TRONModal, U as UsernameModal, W as WalletModal } from '../index-BZrddrq-.mjs';
|
|
2
|
+
export { B as Button, F as Field, I as Input, M as Modal, a as ModalWithHeader, O as Overlay, P as Popover } from '../index-DbG5IjhP.mjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CHkU0WHZ.mjs';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { B as BTCModal, E as EmailModal, L as LoginBox, a as LoginButton, c as LoginModal, b as LoginPanel, S as SOLModal, d as TONModal, T as TRONModal, U as UsernameModal, W as WalletModal } from '../index-
|
|
2
|
-
export { B as Button, F as Field, I as Input, M as Modal, a as ModalWithHeader, O as Overlay, P as Popover } from '../index-
|
|
1
|
+
export { B as BTCModal, E as EmailModal, L as LoginBox, a as LoginButton, c as LoginModal, b as LoginPanel, S as SOLModal, d as TONModal, T as TRONModal, U as UsernameModal, W as WalletModal } from '../index-BHvCA7F9.js';
|
|
2
|
+
export { B as Button, F as Field, I as Input, M as Modal, a as ModalWithHeader, O as Overlay, P as Popover } from '../index-Bzcc-y8m.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-CHkU0WHZ.js';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { b as bind, a as isSuccess, p as poh, u as user, w as wallet } from '../../index-
|
|
1
|
+
export { b as bind, a as isSuccess, p as poh, u as user, w as wallet } from '../../index-B8DYrhSW.mjs';
|
|
2
2
|
import '@tanstack/react-query';
|
|
3
3
|
import '@tanstack/react-query/src/types';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-CHkU0WHZ.mjs';
|
|
5
5
|
import 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { b as bind, a as isSuccess, p as poh, u as user, w as wallet } from '../../index-
|
|
1
|
+
export { b as bind, a as isSuccess, p as poh, u as user, w as wallet } from '../../index-Cwx2p8th.js';
|
|
2
2
|
import '@tanstack/react-query';
|
|
3
3
|
import '@tanstack/react-query/src/types';
|
|
4
|
-
import '../../types-
|
|
4
|
+
import '../../types-CHkU0WHZ.js';
|
|
5
5
|
import 'react';
|
package/dist/hooks/api/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
bind_exports,
|
|
3
3
|
poh_exports,
|
|
4
4
|
user_exports
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-LPQROHSB.mjs";
|
|
6
6
|
import {
|
|
7
7
|
isSuccess,
|
|
8
8
|
wallet_exports
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-V3WGYFWQ.mjs";
|
|
10
10
|
import "../../chunk-UA6XHZHX.mjs";
|
|
11
11
|
import "../../chunk-LNSJ3ZXG.mjs";
|
|
12
12
|
import "../../chunk-A5D3NKTK.mjs";
|
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as useCopyClipboard,
|
|
2
|
-
import '../types-
|
|
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';
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as useCopyClipboard,
|
|
2
|
-
import '../types-
|
|
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';
|
package/dist/hooks/index.js
CHANGED
|
@@ -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.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,
|