@matchain/matchid-sdk-react 0.1.37-alpha.9 → 0.1.38
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-JULH2ML5.mjs → chunk-F5CJROWH.mjs} +40 -31
- package/dist/chunk-F5CJROWH.mjs.map +1 -0
- package/dist/{chunk-MJICYKRB.mjs → chunk-IHRQKSSO.mjs} +2 -2
- package/dist/chunk-IHRQKSSO.mjs.map +1 -0
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +16 -16
- package/dist/components/index.js.map +1 -1
- 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.js.map +1 -1
- 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.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/{index-yEwP0nd2.d.ts → index-B89X65ox.d.ts} +2 -2
- package/dist/{index-BKdqrCum.d.ts → index-BICt0DjJ.d.ts} +4 -4
- package/dist/{index-Dm5o2w2J.d.mts → index-BTTka3Uo.d.mts} +1 -1
- package/dist/{index-CV5LZa9w.d.mts → index-CAvsdgJw.d.mts} +2 -2
- package/dist/{index-DqWn6VEO.d.mts → index-CzAaZV-2.d.mts} +4 -4
- package/dist/{index-BPveUnst.d.ts → index-DUCRzr-P.d.ts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +39 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{types.d-IS3DBl3p.d.mts → types.d-Cqt8ifXa.d.mts} +1 -1
- package/dist/{types.d-IS3DBl3p.d.ts → types.d-Cqt8ifXa.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-JULH2ML5.mjs.map +0 -1
- package/dist/chunk-MJICYKRB.mjs.map +0 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
unBindWalletApi,
|
|
10
10
|
useUserInfo,
|
|
11
11
|
verifyPohApi
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F5CJROWH.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
15
|
} from "./chunk-J5LGTIGS.mjs";
|
|
@@ -90,4 +90,4 @@ export {
|
|
|
90
90
|
user_exports,
|
|
91
91
|
api_exports
|
|
92
92
|
};
|
|
93
|
-
//# sourceMappingURL=chunk-
|
|
93
|
+
//# sourceMappingURL=chunk-IHRQKSSO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/api/index.ts","../src/hooks/api/bind.ts","../src/hooks/api/poh.ts","../src/hooks/api/user.ts"],"sourcesContent":["export * as bind from \"./bind\";\nexport * as poh from \"./poh\";\nexport * as user from \"./user\";","import {useQuery} from \"@tanstack/react-query\";\nimport useUserInfo from \"../useUserInfo\";\nimport type {UseQueryOptions} from \"@tanstack/react-query/src/types\";\nimport {BindInfoType, BindItemType} from \"../../types/types\";\nimport {getBindInfoApi, getBindListApi} from \"../../api\";\n\nexport {bindCexApi, unBindApi, unBindWalletApi} from \"../../api\";\n\nexport function useBindList(options?: Partial<Omit<UseQueryOptions<BindItemType[]>, 'queryKey' | 'queryFn'>>) {\n const {isLogin} = useUserInfo()\n return useQuery<BindItemType[]>({\n queryKey: ['bindList'],\n enabled: isLogin,\n queryFn: async () => {\n let res = await getBindListApi()\n return res.data\n },\n ...options\n })\n}\n\nexport function useBindInfo(options?: Partial<Omit<UseQueryOptions<BindInfoType>, 'queryKey' | 'queryFn'>>) {\n const {isLogin} = useUserInfo()\n return useQuery<BindInfoType>({\n queryKey: ['bindInfo'],\n enabled: isLogin,\n queryFn: async () => {\n let res = await getBindInfoApi()\n return res.data\n },\n ...options\n })\n}\n","import {useQuery} from \"@tanstack/react-query\";\nimport useUserInfo from \"../useUserInfo\";\nimport type {UseQueryOptions} from \"@tanstack/react-query/src/types\";\nimport {PohItemType} from \"types/types\";\nimport {getPohListApi} from \"api\";\nexport {verifyPohApi} from \"api\";\n\nexport function usePohList(options?: Partial<Omit<UseQueryOptions<PohItemType[]>, 'queryKey' | 'queryFn'>>) {\n const {isLogin} = useUserInfo()\n return useQuery<PohItemType[]>({\n queryKey: ['pohList'],\n enabled: isLogin,\n queryFn: async () => {\n let res = await getPohListApi()\n return res.data\n },\n ...options\n })\n}","export {mintPassportNftApi,chooseIdentityApi} from \"api\""],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,gBAAe;AAQhB,SAAS,YAAY,SAAkF;AAC1G,QAAM,EAAC,QAAO,IAAI,YAAY;AAC9B,SAAO,SAAyB;AAAA,IAC5B,UAAU,CAAC,UAAU;AAAA,IACrB,SAAS;AAAA,IACT,SAAS,YAAY;AACjB,UAAI,MAAM,MAAM,eAAe;AAC/B,aAAO,IAAI;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACP,CAAC;AACL;AAEO,SAAS,YAAY,SAAgF;AACxG,QAAM,EAAC,QAAO,IAAI,YAAY;AAC9B,SAAO,SAAuB;AAAA,IAC1B,UAAU,CAAC,UAAU;AAAA,IACrB,SAAS;AAAA,IACT,SAAS,YAAY;AACjB,UAAI,MAAM,MAAM,eAAe;AAC/B,aAAO,IAAI;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACP,CAAC;AACL;;;AChCA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAQ,YAAAA,iBAAe;AAOhB,SAAS,WAAW,SAAiF;AACxG,QAAM,EAAC,QAAO,IAAI,YAAY;AAC9B,SAAOC,UAAwB;AAAA,IAC3B,UAAU,CAAC,SAAS;AAAA,IACpB,SAAS;AAAA,IACT,SAAS,YAAY;AACjB,UAAI,MAAM,MAAM,cAAc;AAC9B,aAAO,IAAI;AAAA,IACf;AAAA,IACA,GAAG;AAAA,EACP,CAAC;AACL;;;AClBA;AAAA;AAAA;AAAA;AAAA;","names":["useQuery","useQuery"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-
|
|
1
|
+
export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-CAvsdgJw.mjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
|
-
import '../types.d-
|
|
3
|
+
import '../types.d-Cqt8ifXa.mjs';
|
|
4
4
|
import 'react';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-
|
|
1
|
+
export { f as BTCModal, B as Button, E as EmailModal, F as Field, I as Input, L as LoginBox, b as LoginButton, d as LoginModal, c as LoginPanel, M as Modal, a as ModalWithHeader, e as PasswordModal, P as Popover, S as SOLModal, T as TRONModal, U as UsernameModal } from '../index-B89X65ox.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
|
-
import '../types.d-
|
|
3
|
+
import '../types.d-Cqt8ifXa.js';
|
|
4
4
|
import 'react';
|
package/dist/components/index.js
CHANGED
|
@@ -1747,14 +1747,9 @@ function PasswordModal({
|
|
|
1747
1747
|
return "";
|
|
1748
1748
|
}, [rePassword, password]);
|
|
1749
1749
|
(0, import_react6.useEffect)(() => {
|
|
1750
|
-
if (isOpen
|
|
1750
|
+
if (isOpen) {
|
|
1751
1751
|
setPassword("");
|
|
1752
1752
|
setRePassword("");
|
|
1753
|
-
const did2 = overview.did.split(":")[2];
|
|
1754
|
-
initWallet({
|
|
1755
|
-
did: did2,
|
|
1756
|
-
address: ""
|
|
1757
|
-
});
|
|
1758
1753
|
}
|
|
1759
1754
|
}, [isOpen, overview]);
|
|
1760
1755
|
const [isSubmitting, setIsSubmitting] = (0, import_react6.useState)(false);
|
|
@@ -1762,8 +1757,13 @@ function PasswordModal({
|
|
|
1762
1757
|
if (isSubmitting) return;
|
|
1763
1758
|
try {
|
|
1764
1759
|
setIsSubmitting(true);
|
|
1760
|
+
const did2 = overview ? overview.did.split(":")[2] : "";
|
|
1761
|
+
await initWallet({
|
|
1762
|
+
did: did2,
|
|
1763
|
+
address: ""
|
|
1764
|
+
});
|
|
1765
1765
|
const address = await generateWallet({
|
|
1766
|
-
did:
|
|
1766
|
+
did: did2.split(":")[2],
|
|
1767
1767
|
userPasscode: password
|
|
1768
1768
|
});
|
|
1769
1769
|
await refreshOverview();
|
|
@@ -2273,7 +2273,7 @@ function Popover({
|
|
|
2273
2273
|
gap = "20px"
|
|
2274
2274
|
}) {
|
|
2275
2275
|
const [active, setActive] = (0, import_react15.useState)(false);
|
|
2276
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2276
|
+
return children && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
2277
2277
|
"div",
|
|
2278
2278
|
{
|
|
2279
2279
|
onClick: () => {
|
|
@@ -2817,7 +2817,7 @@ function UsernameModal({
|
|
|
2817
2817
|
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "confirm" }) }),
|
|
2818
2818
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Button, { style: {
|
|
2819
2819
|
marginTop: isDownMd ? "12px" : "24px"
|
|
2820
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "
|
|
2820
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_react_intl12.FormattedMessage, { id: "cancel" }) })
|
|
2821
2821
|
] }) });
|
|
2822
2822
|
}
|
|
2823
2823
|
|
|
@@ -3373,10 +3373,10 @@ var UnisatAdapter = class {
|
|
|
3373
3373
|
window.unisat.disconnect();
|
|
3374
3374
|
await this.checkChain();
|
|
3375
3375
|
const accounts = await window.unisat.getAccounts();
|
|
3376
|
-
|
|
3376
|
+
matchlog_default.log("accounts", accounts);
|
|
3377
3377
|
if (accounts.length === 0) {
|
|
3378
3378
|
const accounts2 = await window.unisat.requestAccounts();
|
|
3379
|
-
|
|
3379
|
+
matchlog_default.log("accounts", accounts2);
|
|
3380
3380
|
if (!accounts2 || accounts2.length === 0) throw new Error("No accounts found in Unisat Wallet");
|
|
3381
3381
|
return accounts2[0];
|
|
3382
3382
|
}
|
|
@@ -3408,7 +3408,7 @@ var XverseAdapter = class {
|
|
|
3408
3408
|
try {
|
|
3409
3409
|
await (0, import_sats_connect.getCapabilities)({
|
|
3410
3410
|
onFinish: (response) => {
|
|
3411
|
-
|
|
3411
|
+
matchlog_default.log(response);
|
|
3412
3412
|
this.capabilities = new Set(response);
|
|
3413
3413
|
resolve(true);
|
|
3414
3414
|
},
|
|
@@ -3421,7 +3421,7 @@ var XverseAdapter = class {
|
|
|
3421
3421
|
}
|
|
3422
3422
|
});
|
|
3423
3423
|
} catch (err) {
|
|
3424
|
-
console.
|
|
3424
|
+
console.error(err);
|
|
3425
3425
|
resolve(false);
|
|
3426
3426
|
}
|
|
3427
3427
|
});
|
|
@@ -3432,7 +3432,7 @@ var XverseAdapter = class {
|
|
|
3432
3432
|
purposes: [import_sats_connect.AddressPurpose.Ordinals],
|
|
3433
3433
|
message: "SATS Connect Demo"
|
|
3434
3434
|
});
|
|
3435
|
-
|
|
3435
|
+
matchlog_default.log("getAccounts ~ response:", response);
|
|
3436
3436
|
if (response.status === "success") {
|
|
3437
3437
|
const ordinalsAddressItem = response.result.find(
|
|
3438
3438
|
(address) => address.purpose === import_sats_connect.AddressPurpose.Ordinals
|
|
@@ -3486,13 +3486,13 @@ var LeatherAdapter = class {
|
|
|
3486
3486
|
async connect() {
|
|
3487
3487
|
if (!await this.isInstalled()) throw new Error("Leather Wallet is not installed");
|
|
3488
3488
|
const response = await window.LeatherProvider?.request("getAddresses");
|
|
3489
|
-
|
|
3489
|
+
matchlog_default.log("Addresses:", response.result.addresses);
|
|
3490
3490
|
return response.result.addresses[0].address;
|
|
3491
3491
|
}
|
|
3492
3492
|
async signMessage(message) {
|
|
3493
3493
|
if (!await this.isInstalled()) throw new Error("Hiro Wallet is not installed");
|
|
3494
3494
|
const response = await window.LeatherProvider?.request("signMessage", { message });
|
|
3495
|
-
|
|
3495
|
+
matchlog_default.log("response", response);
|
|
3496
3496
|
return response.result.signature;
|
|
3497
3497
|
}
|
|
3498
3498
|
};
|