@matchain/matchid-sdk-react 0.1.56-alpha.16 → 0.1.56-alpha.17
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/api.d.mts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +152 -87
- package/dist/api.js.map +1 -1
- package/dist/api.mjs +4 -3
- package/dist/chains.mjs +2 -1
- package/dist/chunk-3CR66BEX.mjs +19 -0
- package/dist/chunk-3CR66BEX.mjs.map +1 -0
- package/dist/{chunk-FQ6PYZPD.mjs → chunk-7SUDHG7S.mjs} +1 -1
- package/dist/chunk-7SUDHG7S.mjs.map +1 -0
- package/dist/{chunk-HYQ3T6WW.mjs → chunk-JX73EY6V.mjs} +2 -14
- package/dist/chunk-JX73EY6V.mjs.map +1 -0
- package/dist/{chunk-LADAY3IL.mjs → chunk-ZLTIMO57.mjs} +374 -352
- package/dist/chunk-ZLTIMO57.mjs.map +1 -0
- package/dist/{chunk-O2D3TKRD.mjs → chunk-ZY7EVYXA.mjs} +2 -2
- package/dist/components.d.mts +3 -3
- package/dist/components.d.ts +3 -3
- package/dist/components.js +473 -401
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +3 -2
- package/dist/hooks.d.mts +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +172 -109
- package/dist/hooks.js.map +1 -1
- package/dist/hooks.mjs +3 -2
- package/dist/icon.d.mts +2 -2
- package/dist/icon.d.ts +2 -2
- package/dist/icon.js.map +1 -1
- package/dist/icon.mjs +1 -1
- package/dist/{index-DCyE39bg.d.mts → index-84CqVi2I.d.mts} +1 -1
- package/dist/{index-BINNnZNA.d.ts → index-B70k4Jpk.d.ts} +1 -2
- package/dist/{index-BIVGhRja.d.mts → index-BJJ0Gb6v.d.mts} +1 -2
- package/dist/{index-BXhXRggh.d.ts → index-BNqdFiOo.d.ts} +1 -1
- package/dist/{index-DGsB7f2H.d.ts → index-BctnHnJp.d.ts} +1 -1
- package/dist/{index-DuCefmJ0.d.mts → index-BqI0PEIi.d.mts} +1 -1
- package/dist/{index-DZpXCByF.d.ts → index-C2hr7zlN.d.ts} +5 -3
- package/dist/{index-CqHlL6ue.d.mts → index-CTHpnEoB.d.mts} +5 -3
- package/dist/{index-De8efmdb.d.mts → index-Car1jFyN.d.mts} +1 -1
- package/dist/{index-CpJtux-G.d.ts → index-CcVHENNv.d.ts} +1 -1
- package/dist/{index-DQYg6bEA.d.ts → index-Cqdz_5bE.d.ts} +2 -2
- package/dist/{index-m2bn_W3Y.d.ts → index-CvzpMw3N.d.ts} +1 -1
- package/dist/{index-CzCkxwOm.d.mts → index-DkijpM5Q.d.mts} +1 -1
- package/dist/{index-BLjGmf9p.d.mts → index-DxHhOW24.d.mts} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.mts +42 -38
- package/dist/index.d.ts +42 -38
- package/dist/index.js +255 -235
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/{types-C8FLH1yn.d.mts → types-BrVeC0c8.d.mts} +0 -1
- package/dist/{types-C8FLH1yn.d.ts → types-BrVeC0c8.d.ts} +0 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/ui.d.mts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +144 -75
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +3 -2
- package/example/package-lock.json +2965 -0
- package/example/package.json +2 -1
- package/example/src/App.tsx +2 -2
- package/example/src/config/index.ts +2 -2
- package/example/src/pages/Home.tsx +15 -15
- package/example/src/pages/Wallet/index.tsx +2 -4
- package/example/src/store/useLocalStore.ts +19 -19
- package/example/yarn.lock +559 -548
- package/package.json +4 -9
- package/dist/chunk-FQ6PYZPD.mjs.map +0 -1
- package/dist/chunk-HYQ3T6WW.mjs.map +0 -1
- package/dist/chunk-LADAY3IL.mjs.map +0 -1
- /package/dist/{chunk-O2D3TKRD.mjs.map → chunk-ZY7EVYXA.mjs.map} +0 -0
package/dist/components.js
CHANGED
|
@@ -3286,7 +3286,7 @@ var useWalletModalStore = (0, import_zustand5.create)((set) => ({
|
|
|
3286
3286
|
}));
|
|
3287
3287
|
var useEmailModalStore = (0, import_zustand5.create)((set) => ({
|
|
3288
3288
|
isOpen: false,
|
|
3289
|
-
type: "
|
|
3289
|
+
type: "",
|
|
3290
3290
|
open: (type) => set({ isOpen: true, type }),
|
|
3291
3291
|
close: () => set({ isOpen: false })
|
|
3292
3292
|
}));
|
|
@@ -3298,11 +3298,16 @@ var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
|
3298
3298
|
|
|
3299
3299
|
// src/context/BusinessProvider.tsx
|
|
3300
3300
|
var import_react_query8 = require("@tanstack/react-query");
|
|
3301
|
+
|
|
3302
|
+
// src/components/BindEmailModal/index.tsx
|
|
3301
3303
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3302
3304
|
|
|
3303
|
-
// src/context/
|
|
3305
|
+
// src/context/BusinessProvider.tsx
|
|
3304
3306
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3305
3307
|
|
|
3308
|
+
// src/context/index.tsx
|
|
3309
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
3310
|
+
|
|
3306
3311
|
// src/hooks/useWalletInit.ts
|
|
3307
3312
|
var import_react20 = require("react");
|
|
3308
3313
|
var AppClientId2 = getAppClientId();
|
|
@@ -3316,8 +3321,72 @@ var import_react_intl7 = require("react-intl");
|
|
|
3316
3321
|
var import_rainbowkit = require("@rainbow-me/rainbowkit");
|
|
3317
3322
|
var import_wallets = require("@rainbow-me/rainbowkit/wallets");
|
|
3318
3323
|
var import_chains = require("wagmi/chains");
|
|
3324
|
+
|
|
3325
|
+
// src/config/chains/MatchMain.ts
|
|
3326
|
+
var import_viem11 = require("viem");
|
|
3327
|
+
var matchMain = /* @__PURE__ */ (0, import_viem11.defineChain)({
|
|
3328
|
+
//定义match链
|
|
3329
|
+
id: 698,
|
|
3330
|
+
name: "Matchain",
|
|
3331
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
3332
|
+
rpcUrls: {
|
|
3333
|
+
default: {
|
|
3334
|
+
http: ["https://rpc.matchain.io"]
|
|
3335
|
+
}
|
|
3336
|
+
},
|
|
3337
|
+
blockExplorers: {
|
|
3338
|
+
default: {
|
|
3339
|
+
name: "Matchscan",
|
|
3340
|
+
url: "https://matchscan.io/",
|
|
3341
|
+
apiUrl: "https://matchscan.io/api"
|
|
3342
|
+
}
|
|
3343
|
+
},
|
|
3344
|
+
iconUrl: "https://matchscan.io/static/identicon_logos/blockies.png",
|
|
3345
|
+
contracts: {
|
|
3346
|
+
multicall3: {
|
|
3347
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11"
|
|
3348
|
+
}
|
|
3349
|
+
}
|
|
3350
|
+
// testnet: true,
|
|
3351
|
+
});
|
|
3352
|
+
|
|
3353
|
+
// src/config/chains/MatchTest.ts
|
|
3354
|
+
var import_viem12 = require("viem");
|
|
3355
|
+
var matchTest = /* @__PURE__ */ (0, import_viem12.defineChain)({
|
|
3356
|
+
//定义matchTest链
|
|
3357
|
+
id: 699,
|
|
3358
|
+
name: "MatchTest",
|
|
3359
|
+
nativeCurrency: { name: "Match Coin", symbol: "BNB", decimals: 18 },
|
|
3360
|
+
rpcUrls: {
|
|
3361
|
+
default: {
|
|
3362
|
+
http: ["https://testnet-rpc.matchain.io"]
|
|
3363
|
+
}
|
|
3364
|
+
},
|
|
3365
|
+
blockExplorers: {
|
|
3366
|
+
default: {
|
|
3367
|
+
name: "Matchscan",
|
|
3368
|
+
url: "https://testnet.matchscan.io/",
|
|
3369
|
+
apiUrl: "https://testnet.matchscan.io/api"
|
|
3370
|
+
}
|
|
3371
|
+
},
|
|
3372
|
+
iconUrl: "https://testnet.matchscan.io/static/identicon_logos/blockies.png",
|
|
3373
|
+
contracts: {
|
|
3374
|
+
multicall3: {
|
|
3375
|
+
address: "0xca11bde05977b3631167028862be2a173976ca11",
|
|
3376
|
+
blockCreated: 751532
|
|
3377
|
+
},
|
|
3378
|
+
ensRegistry: { address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e" },
|
|
3379
|
+
ensUniversalResolver: {
|
|
3380
|
+
address: "0xc8Af999e38273D658BE1b921b88A9Ddf005769cC",
|
|
3381
|
+
blockCreated: 5317080
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
// testnet: true,
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3387
|
+
// src/MatchContext.tsx
|
|
3319
3388
|
var import_wagmi = require("wagmi");
|
|
3320
|
-
var
|
|
3389
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
3321
3390
|
var queryClient = new import_react_query9.QueryClient();
|
|
3322
3391
|
var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
3323
3392
|
appName: "MatchID",
|
|
@@ -3334,7 +3403,7 @@ var wagmiConfig = (0, import_rainbowkit.getDefaultConfig)({
|
|
|
3334
3403
|
]
|
|
3335
3404
|
}
|
|
3336
3405
|
],
|
|
3337
|
-
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base,
|
|
3406
|
+
chains: [import_chains.mainnet, import_chains.polygon, import_chains.optimism, import_chains.arbitrum, import_chains.base, matchMain, matchTest, import_chains.bsc]
|
|
3338
3407
|
});
|
|
3339
3408
|
var MatchContext = (0, import_react22.createContext)(void 0);
|
|
3340
3409
|
var useMatch = () => {
|
|
@@ -3368,8 +3437,8 @@ function useUserInfo() {
|
|
|
3368
3437
|
const { open: TONOpen } = useTONModalStore();
|
|
3369
3438
|
const { open: BTCOpen } = useBTCModalStore();
|
|
3370
3439
|
const { open: CEXBindOpen } = useCEXBindModalStore();
|
|
3371
|
-
const { open: EmailOpen } = useEmailModalStore();
|
|
3372
3440
|
const walletModalStore = useWalletModalStore();
|
|
3441
|
+
const emailModalStore = useEmailModalStore();
|
|
3373
3442
|
const getRedirectUri = () => {
|
|
3374
3443
|
return encodeURIComponent(window.location.href);
|
|
3375
3444
|
};
|
|
@@ -3462,8 +3531,8 @@ function useUserInfo() {
|
|
|
3462
3531
|
case "discord":
|
|
3463
3532
|
case "github":
|
|
3464
3533
|
case "linkedin":
|
|
3465
|
-
case "kakao":
|
|
3466
3534
|
case "facebook":
|
|
3535
|
+
case "kakao":
|
|
3467
3536
|
return await loginByMethod(method);
|
|
3468
3537
|
default:
|
|
3469
3538
|
throw new Error("unsupported method");
|
|
@@ -3503,34 +3572,6 @@ function useUserInfo() {
|
|
|
3503
3572
|
}
|
|
3504
3573
|
return false;
|
|
3505
3574
|
};
|
|
3506
|
-
const bindByEmail = async ({
|
|
3507
|
-
email,
|
|
3508
|
-
code
|
|
3509
|
-
}) => {
|
|
3510
|
-
try {
|
|
3511
|
-
const obj = {
|
|
3512
|
-
email,
|
|
3513
|
-
verification_key: emailLoginKey,
|
|
3514
|
-
verification_code: code
|
|
3515
|
-
};
|
|
3516
|
-
const res = await verifyEmailCodeApi(obj);
|
|
3517
|
-
if (res && res.data && isSuccess(res)) {
|
|
3518
|
-
events.onBind && events.onBind({
|
|
3519
|
-
type: "email"
|
|
3520
|
-
});
|
|
3521
|
-
eventManager_default.emit("onBind", {
|
|
3522
|
-
type: "email"
|
|
3523
|
-
});
|
|
3524
|
-
return true;
|
|
3525
|
-
} else {
|
|
3526
|
-
throw new Error(res.message);
|
|
3527
|
-
}
|
|
3528
|
-
} catch (error) {
|
|
3529
|
-
console.error("bindByEmail", error);
|
|
3530
|
-
throw error;
|
|
3531
|
-
}
|
|
3532
|
-
return false;
|
|
3533
|
-
};
|
|
3534
3575
|
const bindWallet = async () => {
|
|
3535
3576
|
if (!token) {
|
|
3536
3577
|
throw new Error("You must login first");
|
|
@@ -3576,18 +3617,18 @@ function useUserInfo() {
|
|
|
3576
3617
|
return TONOpen("bind");
|
|
3577
3618
|
case "btc":
|
|
3578
3619
|
return BTCOpen("bind");
|
|
3620
|
+
case "email":
|
|
3621
|
+
return emailModalStore.open("bind");
|
|
3579
3622
|
case "telegram":
|
|
3580
3623
|
return await bindTelegram();
|
|
3581
|
-
case "email":
|
|
3582
|
-
return EmailOpen("bind");
|
|
3583
3624
|
case "twitter":
|
|
3584
3625
|
case "google":
|
|
3585
3626
|
case "discord":
|
|
3586
3627
|
case "github":
|
|
3587
3628
|
case "linkedin":
|
|
3588
3629
|
case "facebook":
|
|
3589
|
-
case "kakao":
|
|
3590
3630
|
case "youtube":
|
|
3631
|
+
case "kakao":
|
|
3591
3632
|
const link = `${endpoints.back}api/v1/auth/${method == "youtube" ? "google" : method}?appid=${appid}&provider=${method == "youtube" ? "google" : method}&redirect=${encodeURIComponent(endpoints.auth + "bind/" + method)}&authorization=${token.includes("Bearer ") ? token.split(" ")[1] : token}${method == "youtube" ? "&auth_type=youtube" : ""}`;
|
|
3592
3633
|
matchlog_default.log("link", link);
|
|
3593
3634
|
return window.open(
|
|
@@ -3602,6 +3643,31 @@ function useUserInfo() {
|
|
|
3602
3643
|
const bindCex = (type) => {
|
|
3603
3644
|
return CEXBindOpen(type);
|
|
3604
3645
|
};
|
|
3646
|
+
const bindByEmail = async ({ email, code }) => {
|
|
3647
|
+
try {
|
|
3648
|
+
const obj = {
|
|
3649
|
+
email,
|
|
3650
|
+
verification_key: emailLoginKey,
|
|
3651
|
+
verification_code: code
|
|
3652
|
+
};
|
|
3653
|
+
const res = await verifyEmailCodeApi(obj);
|
|
3654
|
+
if (res && res.data && isSuccess(res)) {
|
|
3655
|
+
events.onBind && events.onBind({
|
|
3656
|
+
type: "email"
|
|
3657
|
+
});
|
|
3658
|
+
eventManager_default.emit("onBind", {
|
|
3659
|
+
type: "email"
|
|
3660
|
+
});
|
|
3661
|
+
return true;
|
|
3662
|
+
} else {
|
|
3663
|
+
throw new Error(res.message);
|
|
3664
|
+
}
|
|
3665
|
+
} catch (error) {
|
|
3666
|
+
console.error("bindByEmail", error);
|
|
3667
|
+
throw error;
|
|
3668
|
+
}
|
|
3669
|
+
return false;
|
|
3670
|
+
};
|
|
3605
3671
|
const getAuthInfo = async (method) => {
|
|
3606
3672
|
const element_id = "auth_iframe";
|
|
3607
3673
|
if (document.getElementById(element_id)) {
|
|
@@ -3670,7 +3736,6 @@ function useUserInfo() {
|
|
|
3670
3736
|
auth,
|
|
3671
3737
|
login: loginMethod,
|
|
3672
3738
|
bind,
|
|
3673
|
-
getBindEmailCode: getLoginEmailCode,
|
|
3674
3739
|
bindByEmail,
|
|
3675
3740
|
getAuthInfo,
|
|
3676
3741
|
invite
|
|
@@ -3680,10 +3745,10 @@ function useUserInfo() {
|
|
|
3680
3745
|
// src/components/EmailModal/StepVerify.tsx
|
|
3681
3746
|
var import_react24 = require("react");
|
|
3682
3747
|
var import_react_intl8 = require("react-intl");
|
|
3683
|
-
var
|
|
3748
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3684
3749
|
function StepVerify(props) {
|
|
3685
3750
|
const intl = (0, import_react_intl8.useIntl)();
|
|
3686
|
-
const { getLoginEmailCode,
|
|
3751
|
+
const { getLoginEmailCode, loginByEmail, bindByEmail } = useUserInfo();
|
|
3687
3752
|
const [error, setError] = (0, import_react24.useState)("");
|
|
3688
3753
|
const [code, setCode] = (0, import_react24.useState)("");
|
|
3689
3754
|
const [sending, setSending] = (0, import_react24.useState)(false);
|
|
@@ -3760,17 +3825,17 @@ function StepVerify(props) {
|
|
|
3760
3825
|
setSubmitting(false);
|
|
3761
3826
|
}
|
|
3762
3827
|
};
|
|
3763
|
-
return /* @__PURE__ */ (0,
|
|
3764
|
-
/* @__PURE__ */ (0,
|
|
3765
|
-
/* @__PURE__ */ (0,
|
|
3766
|
-
/* @__PURE__ */ (0,
|
|
3767
|
-
/* @__PURE__ */ (0,
|
|
3768
|
-
/* @__PURE__ */ (0,
|
|
3828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-email-verify-box", children: [
|
|
3829
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-email-verify-header", children: [
|
|
3830
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-email-verify-header-icon", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(EmailLineIcon, { size: isDownMd ? 19 : 24 }) }),
|
|
3831
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "matchid-email-verify-header-content", children: [
|
|
3832
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-email-verify-header-value", children: props.email }),
|
|
3833
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "matchid-email-verify-header-tips", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl8.FormattedMessage, { id: "sendEmailTips" }) })
|
|
3769
3834
|
] })
|
|
3770
3835
|
] }),
|
|
3771
|
-
/* @__PURE__ */ (0,
|
|
3836
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Field, { label: intl.formatMessage({
|
|
3772
3837
|
id: "verificationCode"
|
|
3773
|
-
}), error, children: /* @__PURE__ */ (0,
|
|
3838
|
+
}), error, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3774
3839
|
Input,
|
|
3775
3840
|
{
|
|
3776
3841
|
placeholder: intl.formatMessage({
|
|
@@ -3780,7 +3845,7 @@ function StepVerify(props) {
|
|
|
3780
3845
|
maxLength: codeLength,
|
|
3781
3846
|
onChange: (e) => setCode(e.target.value),
|
|
3782
3847
|
value: code,
|
|
3783
|
-
after: /* @__PURE__ */ (0,
|
|
3848
|
+
after: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3784
3849
|
Button,
|
|
3785
3850
|
{
|
|
3786
3851
|
highlight: true,
|
|
@@ -3799,20 +3864,20 @@ function StepVerify(props) {
|
|
|
3799
3864
|
)
|
|
3800
3865
|
}
|
|
3801
3866
|
) }),
|
|
3802
|
-
/* @__PURE__ */ (0,
|
|
3867
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Button, { disabled: !canContinue, loading: submitting, highlight: true, block: true, size: "lg", onClick: onContinue, children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react_intl8.FormattedMessage, { id: "continue" }) })
|
|
3803
3868
|
] });
|
|
3804
3869
|
}
|
|
3805
3870
|
|
|
3806
3871
|
// src/components/EmailModal/index.tsx
|
|
3807
3872
|
var import_react_intl9 = require("react-intl");
|
|
3808
|
-
var
|
|
3873
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
3809
3874
|
function EmailModal({
|
|
3810
3875
|
isOpen = false,
|
|
3811
|
-
type = "login",
|
|
3812
3876
|
width = 480,
|
|
3813
3877
|
onClose,
|
|
3814
3878
|
onBack,
|
|
3815
|
-
onLogin
|
|
3879
|
+
onLogin,
|
|
3880
|
+
type = "login"
|
|
3816
3881
|
}) {
|
|
3817
3882
|
const [step, setStep] = (0, import_react25.useState)("input");
|
|
3818
3883
|
const [emailVal, setEmailVal] = (0, import_react25.useState)("");
|
|
@@ -3823,14 +3888,7 @@ function EmailModal({
|
|
|
3823
3888
|
setEmailVal("");
|
|
3824
3889
|
}
|
|
3825
3890
|
}, [isOpen]);
|
|
3826
|
-
|
|
3827
|
-
if (onLogin) {
|
|
3828
|
-
onLogin();
|
|
3829
|
-
} else {
|
|
3830
|
-
onClose && onClose();
|
|
3831
|
-
}
|
|
3832
|
-
};
|
|
3833
|
-
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
3891
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
3834
3892
|
ModalWithHeader,
|
|
3835
3893
|
{
|
|
3836
3894
|
isOpen,
|
|
@@ -3840,10 +3898,10 @@ function EmailModal({
|
|
|
3840
3898
|
id: "email"
|
|
3841
3899
|
}),
|
|
3842
3900
|
onBack: step == "verify" ? () => setStep("input") : onBack,
|
|
3843
|
-
children: step === "input" ? /* @__PURE__ */ (0,
|
|
3901
|
+
children: step === "input" ? /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StepEmail, { email: emailVal, onContinue: (email) => {
|
|
3844
3902
|
setEmailVal(email);
|
|
3845
3903
|
setStep("verify");
|
|
3846
|
-
} }) : /* @__PURE__ */ (0,
|
|
3904
|
+
} }) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(StepVerify, { type, email: emailVal, onSuccess: onLogin })
|
|
3847
3905
|
}
|
|
3848
3906
|
);
|
|
3849
3907
|
}
|
|
@@ -3873,7 +3931,7 @@ function useAppConfig() {
|
|
|
3873
3931
|
}
|
|
3874
3932
|
|
|
3875
3933
|
// src/components/LoginBox/index.tsx
|
|
3876
|
-
var
|
|
3934
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
3877
3935
|
var RecommendItem = ({
|
|
3878
3936
|
icon,
|
|
3879
3937
|
name,
|
|
@@ -3882,20 +3940,20 @@ var RecommendItem = ({
|
|
|
3882
3940
|
children,
|
|
3883
3941
|
footer
|
|
3884
3942
|
}) => {
|
|
3885
|
-
return /* @__PURE__ */ (0,
|
|
3886
|
-
/* @__PURE__ */ (0,
|
|
3887
|
-
/* @__PURE__ */ (0,
|
|
3888
|
-
/* @__PURE__ */ (0,
|
|
3889
|
-
/* @__PURE__ */ (0,
|
|
3943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-recommend-method", children: [
|
|
3944
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-recommend-method-item", onClick, children: [
|
|
3945
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-recommend-method-content", children: [
|
|
3946
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-recommend-method-icon", children: icon }),
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { className: "matchid-login-recommend-method-name", children: name })
|
|
3890
3948
|
] }),
|
|
3891
|
-
footer ? footer : children ? /* @__PURE__ */ (0,
|
|
3949
|
+
footer ? footer : children ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
3892
3950
|
ArrowDownIcon,
|
|
3893
3951
|
{
|
|
3894
3952
|
className: `matchid-login-recommend-method-arrow ${showChildren ? "matchid-login-recommend-method-arrow-active" : ""}`,
|
|
3895
3953
|
size: 20,
|
|
3896
3954
|
color: "var(--matchid-arrow-color)"
|
|
3897
3955
|
}
|
|
3898
|
-
) : /* @__PURE__ */ (0,
|
|
3956
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
3899
3957
|
ArrowRightIcon,
|
|
3900
3958
|
{
|
|
3901
3959
|
className: "matchid-login-recommend-method-arrow",
|
|
@@ -3904,7 +3962,7 @@ var RecommendItem = ({
|
|
|
3904
3962
|
}
|
|
3905
3963
|
)
|
|
3906
3964
|
] }),
|
|
3907
|
-
children && /* @__PURE__ */ (0,
|
|
3965
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
3908
3966
|
"div",
|
|
3909
3967
|
{
|
|
3910
3968
|
className: `matchid-login-recommend-method-popover ${showChildren ? "matchid-login-recommend-method-popover-active" : ""}`,
|
|
@@ -3941,7 +3999,7 @@ function LoginBox({
|
|
|
3941
3999
|
}
|
|
3942
4000
|
return p.toLowerCase();
|
|
3943
4001
|
});
|
|
3944
|
-
console.log("
|
|
4002
|
+
console.log("platform", platform);
|
|
3945
4003
|
const walletMethodList = WALLET_METHODS.filter((m) => platform.includes(m));
|
|
3946
4004
|
let recommendMethodList = walletMethodList.length > 0 ? ["wallet"] : [];
|
|
3947
4005
|
let methodList = [];
|
|
@@ -3962,182 +4020,196 @@ function LoginBox({
|
|
|
3962
4020
|
walletMethods: walletMethodList
|
|
3963
4021
|
};
|
|
3964
4022
|
}, [config.platform, recommendMethods, methods, walletMethods]);
|
|
3965
|
-
const
|
|
4023
|
+
const [emailOpen, setEmailOpen] = (0, import_react26.useState)(false);
|
|
3966
4024
|
const { login } = useUserInfo();
|
|
3967
4025
|
const [showWallet, setShowWallet] = (0, import_react26.useState)(false);
|
|
3968
4026
|
const intl = (0, import_react_intl10.useIntl)();
|
|
3969
4027
|
const isDownMd = useDownMd();
|
|
3970
4028
|
const methodMap = {
|
|
3971
4029
|
wallet: {
|
|
3972
|
-
icon: /* @__PURE__ */ (0,
|
|
4030
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(WalletIcon, { size: isDownMd ? 36 : 40 }),
|
|
3973
4031
|
name: intl.formatMessage({ id: "wallet" }),
|
|
3974
4032
|
onClick: () => setShowWallet(!showWallet),
|
|
3975
4033
|
type: "wallet"
|
|
3976
4034
|
},
|
|
3977
4035
|
email: {
|
|
3978
|
-
icon: /* @__PURE__ */ (0,
|
|
4036
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(EmailIcon, { size: isDownMd ? 36 : 40 }),
|
|
3979
4037
|
name: intl.formatMessage({ id: "email" }),
|
|
3980
4038
|
onClick: () => {
|
|
3981
|
-
|
|
4039
|
+
setEmailOpen(true);
|
|
3982
4040
|
}
|
|
3983
4041
|
},
|
|
3984
4042
|
google: {
|
|
3985
|
-
icon: /* @__PURE__ */ (0,
|
|
4043
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(GoogleIcon, { size: isDownMd ? 36 : 40 }),
|
|
3986
4044
|
name: "Google",
|
|
3987
4045
|
onClick: () => login("google")
|
|
3988
4046
|
},
|
|
3989
4047
|
twitter: {
|
|
3990
|
-
icon: /* @__PURE__ */ (0,
|
|
4048
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(XIcon, { size: isDownMd ? 36 : 40 }),
|
|
3991
4049
|
name: "X",
|
|
3992
4050
|
onClick: () => login("twitter")
|
|
3993
4051
|
},
|
|
3994
4052
|
telegram: {
|
|
3995
|
-
icon: /* @__PURE__ */ (0,
|
|
4053
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(TelegramIcon, { size: isDownMd ? 36 : 40 }),
|
|
3996
4054
|
name: "Telegram",
|
|
3997
4055
|
onClick: () => login("telegram")
|
|
3998
4056
|
},
|
|
3999
4057
|
github: {
|
|
4000
|
-
icon: /* @__PURE__ */ (0,
|
|
4058
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(GithubIcon, { size: isDownMd ? 36 : 40 }),
|
|
4001
4059
|
name: "Github",
|
|
4002
4060
|
onClick: () => login("github")
|
|
4003
4061
|
},
|
|
4004
4062
|
discord: {
|
|
4005
|
-
icon: /* @__PURE__ */ (0,
|
|
4063
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(DiscordIcon, { size: isDownMd ? 36 : 40 }),
|
|
4006
4064
|
name: "Discord",
|
|
4007
4065
|
onClick: () => login("discord")
|
|
4008
4066
|
},
|
|
4009
4067
|
linkedin: {
|
|
4010
|
-
icon: /* @__PURE__ */ (0,
|
|
4068
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(LinkedinIcon, { size: isDownMd ? 36 : 40 }),
|
|
4011
4069
|
name: "LinkedIn",
|
|
4012
4070
|
onClick: () => login("linkedin")
|
|
4013
4071
|
},
|
|
4014
4072
|
facebook: {
|
|
4015
|
-
icon: /* @__PURE__ */ (0,
|
|
4073
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(FacebookIcon, { size: isDownMd ? 36 : 40 }),
|
|
4016
4074
|
name: "Facebook",
|
|
4017
4075
|
onClick: () => login("facebook")
|
|
4018
4076
|
},
|
|
4019
4077
|
youtube: {
|
|
4020
|
-
icon: /* @__PURE__ */ (0,
|
|
4078
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(YoutubeIcon, { size: isDownMd ? 36 : 40 }),
|
|
4021
4079
|
name: "Youtube",
|
|
4022
4080
|
onClick: () => login("youtube")
|
|
4023
4081
|
},
|
|
4024
4082
|
kakao: {
|
|
4025
|
-
icon: /* @__PURE__ */ (0,
|
|
4083
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(KakaoIcon, { size: isDownMd ? 36 : 40 }),
|
|
4026
4084
|
name: "Kakao",
|
|
4027
4085
|
onClick: () => login("kakao")
|
|
4028
4086
|
}
|
|
4029
4087
|
};
|
|
4030
4088
|
const { walletMap } = useWalletConfig();
|
|
4031
|
-
return /* @__PURE__ */ (0,
|
|
4032
|
-
/* @__PURE__ */ (0,
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
/* @__PURE__ */ (0,
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
4090
|
+
(!inModal || !emailOpen) && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-box", children: [
|
|
4091
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-recommend-list", children: methodConfig.recommendMethods.map((m) => {
|
|
4092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4093
|
+
RecommendItem,
|
|
4094
|
+
{
|
|
4095
|
+
icon: methodMap[m]?.icon,
|
|
4096
|
+
name: methodMap[m]?.name,
|
|
4097
|
+
onClick: methodMap[m]?.onClick,
|
|
4098
|
+
showChildren: m == "wallet" && showWallet,
|
|
4099
|
+
children: m == "wallet" && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
|
|
4100
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-recommend-wallet-divider" }),
|
|
4101
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-recommend-wallet-list", children: methodConfig.walletMethods.map((n) => {
|
|
4102
|
+
const m2 = walletMap[n];
|
|
4103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
4104
|
+
"div",
|
|
4105
|
+
{
|
|
4106
|
+
className: "matchid-login-recommend-wallet-item",
|
|
4107
|
+
onClick: () => {
|
|
4108
|
+
login(m2.method);
|
|
4109
|
+
},
|
|
4110
|
+
children: [
|
|
4111
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-recommend-wallet-item-content", children: [
|
|
4112
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-recommend-wallet-item-icon", children: m2.icon }),
|
|
4113
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4114
|
+
"div",
|
|
4115
|
+
{
|
|
4116
|
+
className: "matchid-login-recommend-wallet-item-hover-icon",
|
|
4117
|
+
children: m2.activeIcon
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4121
|
+
"span",
|
|
4122
|
+
{
|
|
4123
|
+
className: "matchid-login-recommend-wallet-item-name",
|
|
4124
|
+
children: m2.name
|
|
4125
|
+
}
|
|
4126
|
+
)
|
|
4127
|
+
] }),
|
|
4128
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4129
|
+
ArrowRightIcon,
|
|
4063
4130
|
{
|
|
4064
|
-
className: "matchid-login-recommend-wallet-item-
|
|
4065
|
-
|
|
4131
|
+
className: "matchid-login-recommend-wallet-item-arrow",
|
|
4132
|
+
size: 20,
|
|
4133
|
+
color: "var(--matchid-arrow-color)"
|
|
4066
4134
|
}
|
|
4067
4135
|
)
|
|
4068
|
-
]
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
color: "var(--matchid-arrow-color)"
|
|
4075
|
-
}
|
|
4076
|
-
)
|
|
4077
|
-
]
|
|
4078
|
-
},
|
|
4079
|
-
m2.name
|
|
4080
|
-
);
|
|
4081
|
-
}) })
|
|
4082
|
-
] })
|
|
4083
|
-
},
|
|
4084
|
-
m
|
|
4085
|
-
);
|
|
4086
|
-
}) }),
|
|
4087
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-privacy-policy", children: [
|
|
4088
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4089
|
-
import_react_intl10.FormattedMessage,
|
|
4090
|
-
{
|
|
4091
|
-
id: "loginAgreement",
|
|
4092
|
-
values: {
|
|
4093
|
-
termsLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4094
|
-
"a",
|
|
4095
|
-
{
|
|
4096
|
-
href: TERMS_OF_SERVICE_URL,
|
|
4097
|
-
target: "_blank",
|
|
4098
|
-
rel: "noopener noreferrer",
|
|
4099
|
-
className: "matchid-privacy-policy-content-link",
|
|
4100
|
-
children: chunks
|
|
4101
|
-
}
|
|
4102
|
-
),
|
|
4103
|
-
privacyLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4104
|
-
"a",
|
|
4105
|
-
{
|
|
4106
|
-
href: PRIVACY_POLICY_URL,
|
|
4107
|
-
target: "_blank",
|
|
4108
|
-
rel: "noopener noreferrer",
|
|
4109
|
-
className: "matchid-privacy-policy-content-link",
|
|
4110
|
-
children: chunks
|
|
4111
|
-
}
|
|
4112
|
-
)
|
|
4113
|
-
}
|
|
4114
|
-
}
|
|
4115
|
-
) }),
|
|
4116
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-privacy-policy-powered-by", children: [
|
|
4117
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react_intl10.FormattedMessage, { id: "poweredBy" }),
|
|
4118
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MatchIdIcon_default, {})
|
|
4119
|
-
] })
|
|
4120
|
-
] }),
|
|
4121
|
-
methodConfig.methods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-login-other", children: [
|
|
4122
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: "matchid-login-other-line-box", children: [
|
|
4123
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "matchid-login-other-line" }),
|
|
4124
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react_intl10.FormattedMessage, { id: "otherLoginMethods" }) }),
|
|
4125
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "matchid-login-other-line" })
|
|
4126
|
-
] }),
|
|
4127
|
-
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
4128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
4129
|
-
"div",
|
|
4130
|
-
{
|
|
4131
|
-
className: "matchid-login-method-item",
|
|
4132
|
-
onClick: methodMap[m]?.onClick,
|
|
4133
|
-
title: methodMap[m]?.name,
|
|
4134
|
-
children: methodMap[m]?.icon
|
|
4136
|
+
]
|
|
4137
|
+
},
|
|
4138
|
+
m2.name
|
|
4139
|
+
);
|
|
4140
|
+
}) })
|
|
4141
|
+
] })
|
|
4135
4142
|
},
|
|
4136
4143
|
m
|
|
4137
4144
|
);
|
|
4138
|
-
}) })
|
|
4139
|
-
|
|
4140
|
-
|
|
4145
|
+
}) }),
|
|
4146
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-privacy-policy", children: [
|
|
4147
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-privacy-policy-content", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4148
|
+
import_react_intl10.FormattedMessage,
|
|
4149
|
+
{
|
|
4150
|
+
id: "loginAgreement",
|
|
4151
|
+
values: {
|
|
4152
|
+
termsLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4153
|
+
"a",
|
|
4154
|
+
{
|
|
4155
|
+
href: TERMS_OF_SERVICE_URL,
|
|
4156
|
+
target: "_blank",
|
|
4157
|
+
rel: "noopener noreferrer",
|
|
4158
|
+
className: "matchid-privacy-policy-content-link",
|
|
4159
|
+
children: chunks
|
|
4160
|
+
}
|
|
4161
|
+
),
|
|
4162
|
+
privacyLink: (chunks) => /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4163
|
+
"a",
|
|
4164
|
+
{
|
|
4165
|
+
href: PRIVACY_POLICY_URL,
|
|
4166
|
+
target: "_blank",
|
|
4167
|
+
rel: "noopener noreferrer",
|
|
4168
|
+
className: "matchid-privacy-policy-content-link",
|
|
4169
|
+
children: chunks
|
|
4170
|
+
}
|
|
4171
|
+
)
|
|
4172
|
+
}
|
|
4173
|
+
}
|
|
4174
|
+
) }),
|
|
4175
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-privacy-policy-powered-by", children: [
|
|
4176
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_intl10.FormattedMessage, { id: "poweredBy" }),
|
|
4177
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MatchIdIcon_default, {})
|
|
4178
|
+
] })
|
|
4179
|
+
] }),
|
|
4180
|
+
methodConfig.methods.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-other", children: [
|
|
4181
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "matchid-login-other-line-box", children: [
|
|
4182
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-other-line" }),
|
|
4183
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-other-text", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_react_intl10.FormattedMessage, { id: "otherLoginMethods" }) }),
|
|
4184
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-other-line" })
|
|
4185
|
+
] }),
|
|
4186
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "matchid-login-method-box", children: methodConfig.methods.map((m) => {
|
|
4187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4188
|
+
"div",
|
|
4189
|
+
{
|
|
4190
|
+
className: "matchid-login-method-item",
|
|
4191
|
+
onClick: methodMap[m]?.onClick,
|
|
4192
|
+
title: methodMap[m]?.name,
|
|
4193
|
+
children: methodMap[m]?.icon
|
|
4194
|
+
},
|
|
4195
|
+
m
|
|
4196
|
+
);
|
|
4197
|
+
}) })
|
|
4198
|
+
] })
|
|
4199
|
+
] }),
|
|
4200
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
4201
|
+
EmailModal,
|
|
4202
|
+
{
|
|
4203
|
+
isOpen: emailOpen,
|
|
4204
|
+
onClose: () => {
|
|
4205
|
+
setEmailOpen(false);
|
|
4206
|
+
},
|
|
4207
|
+
onBack: inModal ? () => {
|
|
4208
|
+
setEmailOpen(false);
|
|
4209
|
+
} : void 0
|
|
4210
|
+
}
|
|
4211
|
+
)
|
|
4212
|
+
] });
|
|
4141
4213
|
}
|
|
4142
4214
|
|
|
4143
4215
|
// src/components/LoginButton/index.tsx
|
|
@@ -4145,40 +4217,40 @@ var import_react28 = require("react");
|
|
|
4145
4217
|
|
|
4146
4218
|
// src/components/LoginPanel/index.tsx
|
|
4147
4219
|
var import_react_intl11 = require("react-intl");
|
|
4148
|
-
var
|
|
4220
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
4149
4221
|
function LoginPanel({
|
|
4150
4222
|
header,
|
|
4151
4223
|
onClose,
|
|
4152
4224
|
...props
|
|
4153
4225
|
}) {
|
|
4154
4226
|
const isDownMd = useDownMd();
|
|
4155
|
-
return /* @__PURE__ */ (0,
|
|
4156
|
-
header ? header : /* @__PURE__ */ (0,
|
|
4157
|
-
/* @__PURE__ */ (0,
|
|
4158
|
-
/* @__PURE__ */ (0,
|
|
4159
|
-
/* @__PURE__ */ (0,
|
|
4227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "matchid-login-panel", children: [
|
|
4228
|
+
header ? header : /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "matchid-login-panel-header", children: [
|
|
4229
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: "matchid-login-panel-header-content", children: [
|
|
4230
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "matchid-login-panel-header-title", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_intl11.FormattedMessage, { id: "loginTitle" }) }),
|
|
4231
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "matchid-login-panel-header-subtilte", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_react_intl11.FormattedMessage, { id: "loginTips" }) })
|
|
4160
4232
|
] }),
|
|
4161
|
-
onClose && /* @__PURE__ */ (0,
|
|
4233
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "matchid-login-panel-header-close", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(CloseRoundIcon, { size: isDownMd ? 24 : 30 }) })
|
|
4162
4234
|
] }),
|
|
4163
|
-
/* @__PURE__ */ (0,
|
|
4164
|
-
/* @__PURE__ */ (0,
|
|
4235
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "matchid-login-panel-divide" }),
|
|
4236
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "matchid-login-panel-box", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(LoginBox, { ...props }) })
|
|
4165
4237
|
] });
|
|
4166
4238
|
}
|
|
4167
4239
|
|
|
4168
4240
|
// src/components/LoginModal/index.tsx
|
|
4169
|
-
var
|
|
4241
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
4170
4242
|
function LoginModal({
|
|
4171
4243
|
isOpen = false,
|
|
4172
4244
|
width = 480,
|
|
4173
4245
|
...props
|
|
4174
4246
|
}) {
|
|
4175
4247
|
const { isLogin } = useUserInfo();
|
|
4176
|
-
return /* @__PURE__ */ (0,
|
|
4248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
4177
4249
|
Modal,
|
|
4178
4250
|
{
|
|
4179
4251
|
isOpen: isOpen && !isLogin,
|
|
4180
4252
|
width,
|
|
4181
|
-
children: /* @__PURE__ */ (0,
|
|
4253
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(LoginPanel, { ...props, inModal: true })
|
|
4182
4254
|
}
|
|
4183
4255
|
);
|
|
4184
4256
|
}
|
|
@@ -4187,10 +4259,10 @@ function LoginModal({
|
|
|
4187
4259
|
var import_react27 = require("react");
|
|
4188
4260
|
|
|
4189
4261
|
// src/assets/icon/ProfileIcon.tsx
|
|
4190
|
-
var
|
|
4262
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
4191
4263
|
function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
4192
|
-
return /* @__PURE__ */ (0,
|
|
4193
|
-
/* @__PURE__ */ (0,
|
|
4264
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4194
4266
|
"path",
|
|
4195
4267
|
{
|
|
4196
4268
|
fillRule: "evenodd",
|
|
@@ -4199,7 +4271,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
4199
4271
|
fill: color
|
|
4200
4272
|
}
|
|
4201
4273
|
),
|
|
4202
|
-
/* @__PURE__ */ (0,
|
|
4274
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
4203
4275
|
"path",
|
|
4204
4276
|
{
|
|
4205
4277
|
fillRule: "evenodd",
|
|
@@ -4213,7 +4285,7 @@ function ProfileIcon({ size = 24, color = "black", ...props }) {
|
|
|
4213
4285
|
|
|
4214
4286
|
// src/components/UserPopover/index.tsx
|
|
4215
4287
|
var import_react_intl12 = require("react-intl");
|
|
4216
|
-
var
|
|
4288
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
4217
4289
|
function UserContent() {
|
|
4218
4290
|
const { logout, address, username } = useUserInfo();
|
|
4219
4291
|
const [logouting, setLogouting] = (0, import_react27.useState)(false);
|
|
@@ -4234,34 +4306,34 @@ function UserContent() {
|
|
|
4234
4306
|
rightIcon,
|
|
4235
4307
|
onClick
|
|
4236
4308
|
}) => {
|
|
4237
|
-
return /* @__PURE__ */ (0,
|
|
4238
|
-
/* @__PURE__ */ (0,
|
|
4309
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "matchid-user-popover-item", onClick, children: [
|
|
4310
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: `matchid-user-popover-item-content`, children: [
|
|
4239
4311
|
icon,
|
|
4240
|
-
/* @__PURE__ */ (0,
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "matchid-user-popover-item-text", children })
|
|
4241
4313
|
] }),
|
|
4242
4314
|
rightIcon
|
|
4243
4315
|
] });
|
|
4244
4316
|
};
|
|
4245
4317
|
const UserDivider = () => {
|
|
4246
|
-
return /* @__PURE__ */ (0,
|
|
4318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: `matchid-user-popover-divider` });
|
|
4247
4319
|
};
|
|
4248
4320
|
const [usernameOpen, setUsernameOpen] = (0, import_react27.useState)(false);
|
|
4249
4321
|
const [copied, setCopied] = useCopyClipboard();
|
|
4250
4322
|
const intl = (0, import_react_intl12.useIntl)();
|
|
4251
|
-
return /* @__PURE__ */ (0,
|
|
4252
|
-
/* @__PURE__ */ (0,
|
|
4253
|
-
/* @__PURE__ */ (0,
|
|
4323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "matchid-user-popover-content", children: [
|
|
4324
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "matchid-user-popover-list", children: [
|
|
4325
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UserItem, { onClick: () => {
|
|
4254
4326
|
setCopied(address);
|
|
4255
|
-
}, icon: copied ? /* @__PURE__ */ (0,
|
|
4256
|
-
/* @__PURE__ */ (0,
|
|
4257
|
-
/* @__PURE__ */ (0,
|
|
4327
|
+
}, icon: copied ? /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CheckIcon, { size: 20, color: "#0ecb81" }) : /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CopyIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(CheckIcon, { size: 20, color: "var(--icon-color)" }), children: truncateAddress(address) }),
|
|
4328
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UserDivider, {}),
|
|
4329
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UserItem, { onClick: () => {
|
|
4258
4330
|
setUsernameOpen(true);
|
|
4259
|
-
}, icon: /* @__PURE__ */ (0,
|
|
4331
|
+
}, icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ProfileIcon, { size: 20, color: "var(--icon-color)" }), rightIcon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(ArrowRightIcon, { size: 20, color: "var(--icon-color)" }), children: username || intl.formatMessage({
|
|
4260
4332
|
id: "setUsername"
|
|
4261
4333
|
}) })
|
|
4262
4334
|
] }),
|
|
4263
|
-
/* @__PURE__ */ (0,
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Button, { onClick: onLogout, loading: logouting, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_react_intl12.FormattedMessage, { id: "disconnect" }) }),
|
|
4336
|
+
/* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UsernameModal, { isOpen: usernameOpen, onClose: () => {
|
|
4265
4337
|
setUsernameOpen(false);
|
|
4266
4338
|
}, onSuccess: () => {
|
|
4267
4339
|
setUsernameOpen(false);
|
|
@@ -4272,12 +4344,12 @@ function UserPopover({
|
|
|
4272
4344
|
children,
|
|
4273
4345
|
...props
|
|
4274
4346
|
}) {
|
|
4275
|
-
return /* @__PURE__ */ (0,
|
|
4347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Popover, { ...props, content: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UserContent, {}), children });
|
|
4276
4348
|
}
|
|
4277
4349
|
|
|
4278
4350
|
// src/components/LoginButton/index.tsx
|
|
4279
4351
|
var import_react_intl13 = require("react-intl");
|
|
4280
|
-
var
|
|
4352
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
4281
4353
|
function LoginButton({
|
|
4282
4354
|
loginRender,
|
|
4283
4355
|
methods,
|
|
@@ -4293,8 +4365,8 @@ function LoginButton({
|
|
|
4293
4365
|
const { isLogin, username } = useUserInfo();
|
|
4294
4366
|
const [loginOpen, setLoginOpen] = (0, import_react28.useState)(false);
|
|
4295
4367
|
if (!isLogin) {
|
|
4296
|
-
return /* @__PURE__ */ (0,
|
|
4297
|
-
/* @__PURE__ */ (0,
|
|
4368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
|
|
4369
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
4298
4370
|
LoginModal,
|
|
4299
4371
|
{
|
|
4300
4372
|
methods,
|
|
@@ -4304,15 +4376,15 @@ function LoginButton({
|
|
|
4304
4376
|
onClose: () => setLoginOpen(false)
|
|
4305
4377
|
}
|
|
4306
4378
|
),
|
|
4307
|
-
/* @__PURE__ */ (0,
|
|
4308
|
-
/* @__PURE__ */ (0,
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4379
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Button, { className: "matchid-unlogin-btn", ...props, highlight: true, onClick: () => setLoginOpen(true), children: [
|
|
4380
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(UnLoginIcon_default, {}),
|
|
4381
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_react_intl13.FormattedMessage, { id: "login" }) })
|
|
4310
4382
|
] })
|
|
4311
4383
|
] });
|
|
4312
4384
|
}
|
|
4313
|
-
return loginRender ? /* @__PURE__ */ (0,
|
|
4314
|
-
/* @__PURE__ */ (0,
|
|
4315
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
return loginRender ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_jsx_runtime92.Fragment, { children: loginRender }) : /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(UserPopover, { position: popoverPosition, type: popoverType, gap: popoverGap, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Button, { onClick: onLoginClick, className: "matchid-login-btn", ...props, children: [
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(LoginIcon_default, {}),
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { children: username ? truncateAddress(username) : "MatchID " + intl.formatMessage({
|
|
4316
4388
|
id: "user"
|
|
4317
4389
|
}) })
|
|
4318
4390
|
] }) });
|
|
@@ -4321,15 +4393,15 @@ function LoginButton({
|
|
|
4321
4393
|
// src/components/UsernameModal/index.tsx
|
|
4322
4394
|
var import_react29 = require("react");
|
|
4323
4395
|
var import_react_intl14 = require("react-intl");
|
|
4324
|
-
var
|
|
4396
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
4325
4397
|
var ValidItem = ({
|
|
4326
4398
|
success = false,
|
|
4327
4399
|
text
|
|
4328
4400
|
}) => {
|
|
4329
4401
|
const isDownMd = useDownMd();
|
|
4330
|
-
return /* @__PURE__ */ (0,
|
|
4331
|
-
success ? /* @__PURE__ */ (0,
|
|
4332
|
-
/* @__PURE__ */ (0,
|
|
4402
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: `matchid-valid-status-item matchid-valid-status-${success ? "success" : "error"}`, children: [
|
|
4403
|
+
success ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CheckRoundIcon, { size: isDownMd ? 12 : 16 }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(InfoLineIcon, { size: isDownMd ? 12 : 16 }),
|
|
4404
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { children: text })
|
|
4333
4405
|
] });
|
|
4334
4406
|
};
|
|
4335
4407
|
function UsernameModal({
|
|
@@ -4377,12 +4449,12 @@ function UsernameModal({
|
|
|
4377
4449
|
}
|
|
4378
4450
|
};
|
|
4379
4451
|
const intl = (0, import_react_intl14.useIntl)();
|
|
4380
|
-
return /* @__PURE__ */ (0,
|
|
4452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ModalWithHeader, { isOpen: isOpen && isLogin, ...props, title: title || intl.formatMessage({
|
|
4381
4453
|
id: username ? "editUsernameTitle" : "setUsernameTitle"
|
|
4382
|
-
}), children: /* @__PURE__ */ (0,
|
|
4383
|
-
/* @__PURE__ */ (0,
|
|
4454
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-username-box", children: [
|
|
4455
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Field, { label: intl.formatMessage({
|
|
4384
4456
|
id: "username"
|
|
4385
|
-
}), error, children: /* @__PURE__ */ (0,
|
|
4457
|
+
}), error, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
4386
4458
|
Input,
|
|
4387
4459
|
{
|
|
4388
4460
|
placeholder: intl.formatMessage({
|
|
@@ -4395,8 +4467,8 @@ function UsernameModal({
|
|
|
4395
4467
|
value: val
|
|
4396
4468
|
}
|
|
4397
4469
|
) }),
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
4399
|
-
/* @__PURE__ */ (0,
|
|
4470
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "matchid-valid", children: [
|
|
4471
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
4400
4472
|
ValidItem,
|
|
4401
4473
|
{
|
|
4402
4474
|
success: isValid,
|
|
@@ -4405,16 +4477,16 @@ function UsernameModal({
|
|
|
4405
4477
|
})
|
|
4406
4478
|
}
|
|
4407
4479
|
),
|
|
4408
|
-
/* @__PURE__ */ (0,
|
|
4480
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ValidItem, { success: isLength, text: intl.formatMessage({
|
|
4409
4481
|
id: "usernameLengthError"
|
|
4410
4482
|
}) })
|
|
4411
4483
|
] }),
|
|
4412
|
-
/* @__PURE__ */ (0,
|
|
4484
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { disabled: !isSafe, loading: isSubmitting, style: {
|
|
4413
4485
|
marginTop: isDownMd ? "36px" : "64px"
|
|
4414
|
-
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0,
|
|
4415
|
-
/* @__PURE__ */ (0,
|
|
4486
|
+
}, onClick: onSubmit, size: "lg", block: true, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl14.FormattedMessage, { id: "confirm" }) }),
|
|
4487
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Button, { style: {
|
|
4416
4488
|
marginTop: isDownMd ? "12px" : "24px"
|
|
4417
|
-
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0,
|
|
4489
|
+
}, onClick: props.onClose, size: "lg", block: true, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react_intl14.FormattedMessage, { id: "cancel" }) })
|
|
4418
4490
|
] }) });
|
|
4419
4491
|
}
|
|
4420
4492
|
|
|
@@ -4433,7 +4505,7 @@ var walletConnectImage = wallet_default;
|
|
|
4433
4505
|
var walletSigningImage = signing_default;
|
|
4434
4506
|
|
|
4435
4507
|
// src/components/WalletModalContent/index.tsx
|
|
4436
|
-
var
|
|
4508
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
4437
4509
|
function WalletModalContent({
|
|
4438
4510
|
status,
|
|
4439
4511
|
error,
|
|
@@ -4503,15 +4575,15 @@ function WalletModalContent({
|
|
|
4503
4575
|
statusImage: walletConnectImage
|
|
4504
4576
|
};
|
|
4505
4577
|
}, [visible, connected, status, error, address]);
|
|
4506
|
-
return /* @__PURE__ */ (0,
|
|
4507
|
-
/* @__PURE__ */ (0,
|
|
4508
|
-
/* @__PURE__ */ (0,
|
|
4578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-box`, children: [
|
|
4579
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-content`, children: [
|
|
4580
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
4509
4581
|
width: 128,
|
|
4510
4582
|
height: 128
|
|
4511
4583
|
} }),
|
|
4512
|
-
/* @__PURE__ */ (0,
|
|
4584
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: pageData.isError ? "matchid-error" : "", children: pageData.text })
|
|
4513
4585
|
] }),
|
|
4514
|
-
/* @__PURE__ */ (0,
|
|
4586
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
4515
4587
|
Button,
|
|
4516
4588
|
{
|
|
4517
4589
|
block: true,
|
|
@@ -4587,15 +4659,15 @@ function WalletModalContentV2(props) {
|
|
|
4587
4659
|
statusImage: walletConnectImage
|
|
4588
4660
|
};
|
|
4589
4661
|
}, [props, submitting]);
|
|
4590
|
-
return /* @__PURE__ */ (0,
|
|
4591
|
-
/* @__PURE__ */ (0,
|
|
4592
|
-
/* @__PURE__ */ (0,
|
|
4662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: "matchid-wallet-container", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-box`, children: [
|
|
4663
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: `matchid-wallet-content`, children: [
|
|
4664
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Lottie_default, { animationData: pageData.statusImage, style: {
|
|
4593
4665
|
width: 128,
|
|
4594
4666
|
height: 128
|
|
4595
4667
|
} }),
|
|
4596
|
-
/* @__PURE__ */ (0,
|
|
4668
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { className: props.status == "error" ? "matchid-error" : "", children: pageData.text })
|
|
4597
4669
|
] }),
|
|
4598
|
-
/* @__PURE__ */ (0,
|
|
4670
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
4599
4671
|
Button,
|
|
4600
4672
|
{
|
|
4601
4673
|
block: true,
|
|
@@ -4801,7 +4873,7 @@ var ConnectorUnavailableReconnectingError = class extends BaseError {
|
|
|
4801
4873
|
};
|
|
4802
4874
|
|
|
4803
4875
|
// node_modules/@wagmi/core/dist/esm/actions/getConnectorClient.js
|
|
4804
|
-
var
|
|
4876
|
+
var import_viem13 = require("viem");
|
|
4805
4877
|
var import_utils9 = require("viem/utils");
|
|
4806
4878
|
async function getConnectorClient(config, parameters = {}) {
|
|
4807
4879
|
let connection;
|
|
@@ -4846,16 +4918,16 @@ async function getConnectorClient(config, parameters = {}) {
|
|
|
4846
4918
|
});
|
|
4847
4919
|
const chain = config.chains.find((chain2) => chain2.id === chainId);
|
|
4848
4920
|
const provider = await connection.connector.getProvider({ chainId });
|
|
4849
|
-
return (0,
|
|
4921
|
+
return (0, import_viem13.createClient)({
|
|
4850
4922
|
account,
|
|
4851
4923
|
chain,
|
|
4852
4924
|
name: "Connector Client",
|
|
4853
|
-
transport: (opts) => (0,
|
|
4925
|
+
transport: (opts) => (0, import_viem13.custom)(provider)({ ...opts, retryCount: 0 })
|
|
4854
4926
|
});
|
|
4855
4927
|
}
|
|
4856
4928
|
|
|
4857
4929
|
// node_modules/@wagmi/core/dist/esm/exports/index.js
|
|
4858
|
-
var
|
|
4930
|
+
var import_viem14 = require("viem");
|
|
4859
4931
|
|
|
4860
4932
|
// src/hooks/useEthersSigner.ts
|
|
4861
4933
|
function clientToSigner(client) {
|
|
@@ -4877,7 +4949,7 @@ async function getEthersSigner(config, { chainId } = {}) {
|
|
|
4877
4949
|
// src/components/EVMModal/index.tsx
|
|
4878
4950
|
var import_siwe = require("siwe");
|
|
4879
4951
|
var import_styles = require("@rainbow-me/rainbowkit/styles.css");
|
|
4880
|
-
var
|
|
4952
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
4881
4953
|
function WalletContent({
|
|
4882
4954
|
onSuccess,
|
|
4883
4955
|
type
|
|
@@ -5035,7 +5107,7 @@ function WalletContent({
|
|
|
5035
5107
|
setNonce(void 0);
|
|
5036
5108
|
setStatus("start");
|
|
5037
5109
|
};
|
|
5038
|
-
return /* @__PURE__ */ (0,
|
|
5110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
|
|
5039
5111
|
WalletModalContentV2,
|
|
5040
5112
|
{
|
|
5041
5113
|
status,
|
|
@@ -5053,14 +5125,14 @@ function EVMConnectModal({
|
|
|
5053
5125
|
...props
|
|
5054
5126
|
}) {
|
|
5055
5127
|
const intl = (0, import_react_intl15.useIntl)();
|
|
5056
|
-
return /* @__PURE__ */ (0,
|
|
5128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
5057
5129
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5058
5130
|
}, {
|
|
5059
5131
|
name: "EVM"
|
|
5060
|
-
}), children: /* @__PURE__ */ (0,
|
|
5132
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(WalletContent, { onSuccess, type }) });
|
|
5061
5133
|
}
|
|
5062
5134
|
function EVMModal(props) {
|
|
5063
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
5135
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_rainbowkit2.RainbowKitProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(EVMConnectModal, { ...props }) });
|
|
5064
5136
|
}
|
|
5065
5137
|
|
|
5066
5138
|
// src/components/TRONModal/index.tsx
|
|
@@ -5175,7 +5247,7 @@ var useTRONWallet = () => {
|
|
|
5175
5247
|
};
|
|
5176
5248
|
|
|
5177
5249
|
// src/components/TRONModal/index.tsx
|
|
5178
|
-
var
|
|
5250
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
5179
5251
|
function TRONConnectModal({
|
|
5180
5252
|
type = "login",
|
|
5181
5253
|
onSuccess,
|
|
@@ -5185,9 +5257,9 @@ function TRONConnectModal({
|
|
|
5185
5257
|
const intl = (0, import_react_intl16.useIntl)();
|
|
5186
5258
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useTRONWallet();
|
|
5187
5259
|
const iconMaps = {
|
|
5188
|
-
tronlink: /* @__PURE__ */ (0,
|
|
5189
|
-
bitget: /* @__PURE__ */ (0,
|
|
5190
|
-
okx: /* @__PURE__ */ (0,
|
|
5260
|
+
tronlink: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TronLinkIcon, { size: isDownMd ? 36 : 40 }),
|
|
5261
|
+
bitget: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(BitgetIcon, { size: isDownMd ? 36 : 40 }),
|
|
5262
|
+
okx: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(OKXIcon, { size: isDownMd ? 36 : 40 })
|
|
5191
5263
|
};
|
|
5192
5264
|
const { events, login } = useMatch();
|
|
5193
5265
|
const [status, setStatus] = (0, import_react34.useState)("");
|
|
@@ -5279,11 +5351,11 @@ function TRONConnectModal({
|
|
|
5279
5351
|
disconnect();
|
|
5280
5352
|
}
|
|
5281
5353
|
}, [props.isOpen]);
|
|
5282
|
-
return /* @__PURE__ */ (0,
|
|
5354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
5283
5355
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5284
5356
|
}, {
|
|
5285
5357
|
name: "TRON"
|
|
5286
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0,
|
|
5358
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5287
5359
|
WalletModalContent,
|
|
5288
5360
|
{
|
|
5289
5361
|
error,
|
|
@@ -5296,9 +5368,9 @@ function TRONConnectModal({
|
|
|
5296
5368
|
setVisible: () => {
|
|
5297
5369
|
}
|
|
5298
5370
|
}
|
|
5299
|
-
) : /* @__PURE__ */ (0,
|
|
5371
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "matchid-login-recommend-list", children: [
|
|
5300
5372
|
installedWallets.map((wallet2) => {
|
|
5301
|
-
return /* @__PURE__ */ (0,
|
|
5373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5302
5374
|
RecommendItem,
|
|
5303
5375
|
{
|
|
5304
5376
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -5311,14 +5383,14 @@ function TRONConnectModal({
|
|
|
5311
5383
|
);
|
|
5312
5384
|
}),
|
|
5313
5385
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
5314
|
-
return /* @__PURE__ */ (0,
|
|
5386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
5315
5387
|
RecommendItem,
|
|
5316
5388
|
{
|
|
5317
5389
|
icon: iconMaps[wallet2.walletKey],
|
|
5318
5390
|
name: wallet2.name,
|
|
5319
5391
|
onClick: () => {
|
|
5320
5392
|
},
|
|
5321
|
-
footer: /* @__PURE__ */ (0,
|
|
5393
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Button, { size: "sm", onClick: () => {
|
|
5322
5394
|
window.open(wallet2.website);
|
|
5323
5395
|
}, children: "Install" })
|
|
5324
5396
|
},
|
|
@@ -5328,14 +5400,14 @@ function TRONConnectModal({
|
|
|
5328
5400
|
] }) }) });
|
|
5329
5401
|
}
|
|
5330
5402
|
function TRONModal(props) {
|
|
5331
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
5403
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(TRONConnectModal, { ...props, type: props.type });
|
|
5332
5404
|
}
|
|
5333
5405
|
|
|
5334
5406
|
// src/components/TONModal/index.tsx
|
|
5335
5407
|
var import_react35 = __toESM(require("react"));
|
|
5336
5408
|
var import_react_intl17 = require("react-intl");
|
|
5337
5409
|
var import_ui_react = require("@tonconnect/ui-react");
|
|
5338
|
-
var
|
|
5410
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
5339
5411
|
function WalletContent2({
|
|
5340
5412
|
onSuccess,
|
|
5341
5413
|
type
|
|
@@ -5462,7 +5534,7 @@ function WalletContent2({
|
|
|
5462
5534
|
}
|
|
5463
5535
|
}
|
|
5464
5536
|
}, [state]);
|
|
5465
|
-
return /* @__PURE__ */ (0,
|
|
5537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5466
5538
|
WalletModalContent,
|
|
5467
5539
|
{
|
|
5468
5540
|
connected,
|
|
@@ -5496,20 +5568,20 @@ function TONConnectModal({
|
|
|
5496
5568
|
const intl = (0, import_react_intl17.useIntl)();
|
|
5497
5569
|
const { endpoints, appid } = useLocalStore_default();
|
|
5498
5570
|
const manifestUrl = `${endpoints.back}api/v1/wallet/ton?appid=${appid}&url=` + encodeURIComponent(window.location.origin);
|
|
5499
|
-
return /* @__PURE__ */ (0,
|
|
5571
|
+
return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
5500
5572
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5501
5573
|
}, {
|
|
5502
5574
|
name: "TON"
|
|
5503
|
-
}), children: /* @__PURE__ */ (0,
|
|
5575
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
|
|
5504
5576
|
import_ui_react.TonConnectUIProvider,
|
|
5505
5577
|
{
|
|
5506
5578
|
manifestUrl,
|
|
5507
|
-
children: /* @__PURE__ */ (0,
|
|
5579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(WalletContent2, { onSuccess, type })
|
|
5508
5580
|
}
|
|
5509
5581
|
) });
|
|
5510
5582
|
}
|
|
5511
5583
|
function TONModal(props) {
|
|
5512
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
5584
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(TONConnectModal, { ...props });
|
|
5513
5585
|
}
|
|
5514
5586
|
|
|
5515
5587
|
// src/components/BTCModal/index.tsx
|
|
@@ -5732,7 +5804,7 @@ var useBTCWallet = () => {
|
|
|
5732
5804
|
};
|
|
5733
5805
|
|
|
5734
5806
|
// src/components/BTCModal/index.tsx
|
|
5735
|
-
var
|
|
5807
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5736
5808
|
function BTCConnectModal({
|
|
5737
5809
|
type = "login",
|
|
5738
5810
|
onSuccess,
|
|
@@ -5742,10 +5814,10 @@ function BTCConnectModal({
|
|
|
5742
5814
|
const intl = (0, import_react_intl18.useIntl)();
|
|
5743
5815
|
const { wallets, installedWallets, chooseWallet, wallet, address, onConnect } = useBTCWallet();
|
|
5744
5816
|
const iconMaps = {
|
|
5745
|
-
leather: /* @__PURE__ */ (0,
|
|
5746
|
-
unisat: /* @__PURE__ */ (0,
|
|
5747
|
-
xverse: /* @__PURE__ */ (0,
|
|
5748
|
-
phantom: /* @__PURE__ */ (0,
|
|
5817
|
+
leather: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(LeatherIcon, { size: isDownMd ? 36 : 40 }),
|
|
5818
|
+
unisat: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(UnisatIcon, { size: isDownMd ? 36 : 40 }),
|
|
5819
|
+
xverse: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(XverseIcon, { size: isDownMd ? 36 : 40 }),
|
|
5820
|
+
phantom: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(PhantomIcon, { size: isDownMd ? 36 : 40 })
|
|
5749
5821
|
};
|
|
5750
5822
|
const { events, login } = useMatch();
|
|
5751
5823
|
const [status, setStatus] = (0, import_react37.useState)("");
|
|
@@ -5845,11 +5917,11 @@ function BTCConnectModal({
|
|
|
5845
5917
|
statusRef.current = "";
|
|
5846
5918
|
setError("");
|
|
5847
5919
|
};
|
|
5848
|
-
return /* @__PURE__ */ (0,
|
|
5920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
5849
5921
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5850
5922
|
}, {
|
|
5851
5923
|
name: "BTC"
|
|
5852
|
-
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0,
|
|
5924
|
+
}), onBack: wallet ? onBack : void 0, children: wallet ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5853
5925
|
WalletModalContent,
|
|
5854
5926
|
{
|
|
5855
5927
|
error,
|
|
@@ -5862,9 +5934,9 @@ function BTCConnectModal({
|
|
|
5862
5934
|
setVisible: () => {
|
|
5863
5935
|
}
|
|
5864
5936
|
}
|
|
5865
|
-
) : /* @__PURE__ */ (0,
|
|
5937
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: "matchid-login-recommend-list", children: [
|
|
5866
5938
|
installedWallets.map((wallet2) => {
|
|
5867
|
-
return /* @__PURE__ */ (0,
|
|
5939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5868
5940
|
RecommendItem,
|
|
5869
5941
|
{
|
|
5870
5942
|
icon: iconMaps[wallet2.walletKey],
|
|
@@ -5877,14 +5949,14 @@ function BTCConnectModal({
|
|
|
5877
5949
|
);
|
|
5878
5950
|
}),
|
|
5879
5951
|
wallets.filter((wallet2) => !installedWallets.find((installedWallet) => installedWallet.walletKey == wallet2.walletKey)).map((wallet2) => {
|
|
5880
|
-
return /* @__PURE__ */ (0,
|
|
5952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
5881
5953
|
RecommendItem,
|
|
5882
5954
|
{
|
|
5883
5955
|
icon: iconMaps[wallet2.walletKey],
|
|
5884
5956
|
name: wallet2.name,
|
|
5885
5957
|
onClick: () => {
|
|
5886
5958
|
},
|
|
5887
|
-
footer: /* @__PURE__ */ (0,
|
|
5959
|
+
footer: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Button, { size: "sm", onClick: () => {
|
|
5888
5960
|
window.open(wallet2.website);
|
|
5889
5961
|
}, children: "Install" })
|
|
5890
5962
|
},
|
|
@@ -5894,13 +5966,13 @@ function BTCConnectModal({
|
|
|
5894
5966
|
] }) }) });
|
|
5895
5967
|
}
|
|
5896
5968
|
function BTCModal(props) {
|
|
5897
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
5969
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(BTCConnectModal, { ...props });
|
|
5898
5970
|
}
|
|
5899
5971
|
|
|
5900
5972
|
// src/components/WalletModal/index.tsx
|
|
5901
5973
|
var import_react38 = require("react");
|
|
5902
5974
|
var import_react_intl19 = require("react-intl");
|
|
5903
|
-
var
|
|
5975
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5904
5976
|
function WalletConnectModal({
|
|
5905
5977
|
type,
|
|
5906
5978
|
methods: _methods,
|
|
@@ -5918,13 +5990,13 @@ function WalletConnectModal({
|
|
|
5918
5990
|
const platform = config.platform.map((p) => p.toLowerCase());
|
|
5919
5991
|
return WALLET_METHODS.filter((m) => platform.includes(m));
|
|
5920
5992
|
}, [config.platform, _methods]);
|
|
5921
|
-
return /* @__PURE__ */ (0,
|
|
5993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ModalWithHeader, { ...props, title: props.title || intl.formatMessage({
|
|
5922
5994
|
id: type == "bind" ? "bindWith" : "loginWith"
|
|
5923
5995
|
}, {
|
|
5924
5996
|
name: ""
|
|
5925
|
-
}), children: /* @__PURE__ */ (0,
|
|
5997
|
+
}), children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "matchid-login-box", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { className: "matchid-login-recommend-list", children: methods.map((method, index) => {
|
|
5926
5998
|
const m = walletMap[method];
|
|
5927
|
-
return /* @__PURE__ */ (0,
|
|
5999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
5928
6000
|
RecommendItem,
|
|
5929
6001
|
{
|
|
5930
6002
|
icon: m?.icon,
|
|
@@ -5938,12 +6010,12 @@ function WalletConnectModal({
|
|
|
5938
6010
|
}) }) }) });
|
|
5939
6011
|
}
|
|
5940
6012
|
function WalletModal(props) {
|
|
5941
|
-
return props.isOpen && /* @__PURE__ */ (0,
|
|
6013
|
+
return props.isOpen && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(WalletConnectModal, { ...props });
|
|
5942
6014
|
}
|
|
5943
6015
|
|
|
5944
6016
|
// src/components/AlphaAvatar/index.tsx
|
|
5945
6017
|
var import_react39 = require("react");
|
|
5946
|
-
var
|
|
6018
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5947
6019
|
function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
5948
6020
|
const [avatar, setAvatar] = (0, import_react39.useState)(void 0);
|
|
5949
6021
|
(0, import_react39.useEffect)(() => {
|
|
@@ -5952,7 +6024,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
5952
6024
|
setAvatar(char);
|
|
5953
6025
|
}
|
|
5954
6026
|
}, [name]);
|
|
5955
|
-
return /* @__PURE__ */ (0,
|
|
6027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `matchid-alpha-avatar ${className}`, style: {
|
|
5956
6028
|
width: size,
|
|
5957
6029
|
height: size,
|
|
5958
6030
|
fontSize: Math.ceil(size / 2)
|
|
@@ -5960,7 +6032,7 @@ function AlphaAvatar2({ name, size = 40, className = "" }) {
|
|
|
5960
6032
|
}
|
|
5961
6033
|
|
|
5962
6034
|
// src/components/WalletAsset/index.tsx
|
|
5963
|
-
var
|
|
6035
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5964
6036
|
function WalletAsset({
|
|
5965
6037
|
onAssetClick,
|
|
5966
6038
|
matchWalletAssetsOptions
|
|
@@ -5970,7 +6042,7 @@ function WalletAsset({
|
|
|
5970
6042
|
list: walletAssets.mergedAssets
|
|
5971
6043
|
});
|
|
5972
6044
|
const { list } = useMatchChain();
|
|
5973
|
-
return /* @__PURE__ */ (0,
|
|
6045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "matchid-wallet-asset-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
5974
6046
|
const clickFunc = onAssetClick && onAssetClick(n);
|
|
5975
6047
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
5976
6048
|
const getFooterColor = () => {
|
|
@@ -5985,11 +6057,11 @@ function WalletAsset({
|
|
|
5985
6057
|
}
|
|
5986
6058
|
return "";
|
|
5987
6059
|
};
|
|
5988
|
-
return /* @__PURE__ */ (0,
|
|
6060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: `matchid-wallet-asset-item`, onClick: clickFunc, style: {
|
|
5989
6061
|
cursor: clickFunc ? "pointer" : "default"
|
|
5990
6062
|
}, children: [
|
|
5991
|
-
/* @__PURE__ */ (0,
|
|
5992
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
6063
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "matchid-wallet-asset-logo", title: n.symbol || n.name || "", children: [
|
|
6064
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-wallet-asset-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
5993
6065
|
AlphaAvatar2,
|
|
5994
6066
|
{
|
|
5995
6067
|
className: `matchid-wallet-asset-icon`,
|
|
@@ -5997,12 +6069,12 @@ function WalletAsset({
|
|
|
5997
6069
|
name: n.symbol || n.name || ""
|
|
5998
6070
|
}
|
|
5999
6071
|
),
|
|
6000
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
6072
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-wallet-asset-chain` })
|
|
6001
6073
|
] }),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6003
|
-
/* @__PURE__ */ (0,
|
|
6004
|
-
"price" in n && /* @__PURE__ */ (0,
|
|
6005
|
-
/* @__PURE__ */ (0,
|
|
6074
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: `matchid-wallet-asset-info`, children: [
|
|
6075
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: `matchid-wallet-asset-name`, children: n.symbol }),
|
|
6076
|
+
"price" in n && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: `matchid-wallet-asset-content`, children: [
|
|
6077
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "matchid-wallet-asset-price", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6006
6078
|
NumberFormatter,
|
|
6007
6079
|
{
|
|
6008
6080
|
value: n.price,
|
|
@@ -6010,7 +6082,7 @@ function WalletAsset({
|
|
|
6010
6082
|
tFixNum: 2
|
|
6011
6083
|
}
|
|
6012
6084
|
) }),
|
|
6013
|
-
/* @__PURE__ */ (0,
|
|
6085
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "matchid-wallet-asset-value", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6014
6086
|
NumberFormatter,
|
|
6015
6087
|
{
|
|
6016
6088
|
value: n.value,
|
|
@@ -6019,15 +6091,15 @@ function WalletAsset({
|
|
|
6019
6091
|
}
|
|
6020
6092
|
) })
|
|
6021
6093
|
] }),
|
|
6022
|
-
/* @__PURE__ */ (0,
|
|
6023
|
-
/* @__PURE__ */ (0,
|
|
6094
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: `matchid-wallet-asset-footer`, children: [
|
|
6095
|
+
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: `matchid-wallet-asset-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6024
6096
|
NumberFormatter,
|
|
6025
6097
|
{
|
|
6026
6098
|
value: n.balance,
|
|
6027
6099
|
tFixNum: 3
|
|
6028
6100
|
}
|
|
6029
6101
|
) }),
|
|
6030
|
-
"price_change_24h" in n && /* @__PURE__ */ (0,
|
|
6102
|
+
"price_change_24h" in n && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: `matchid-wallet-asset-change ${getFooterColor()}`, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
6031
6103
|
NumberFormatter,
|
|
6032
6104
|
{
|
|
6033
6105
|
prefix: `${(n?.price_change_24h || 0) < 0 ? "-" : "+"} `,
|
|
@@ -6044,9 +6116,9 @@ function WalletAsset({
|
|
|
6044
6116
|
|
|
6045
6117
|
// src/components/TokenSend/index.tsx
|
|
6046
6118
|
var import_react40 = require("react");
|
|
6047
|
-
var
|
|
6119
|
+
var import_viem15 = require("viem");
|
|
6048
6120
|
var import_react_intl20 = require("react-intl");
|
|
6049
|
-
var
|
|
6121
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
6050
6122
|
function Input2({
|
|
6051
6123
|
onChange,
|
|
6052
6124
|
placeholder,
|
|
@@ -6056,8 +6128,8 @@ function Input2({
|
|
|
6056
6128
|
error,
|
|
6057
6129
|
size = "df"
|
|
6058
6130
|
}) {
|
|
6059
|
-
return /* @__PURE__ */ (0,
|
|
6060
|
-
/* @__PURE__ */ (0,
|
|
6131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-input-box ${"matchid-token-input-" + size}`, children: [
|
|
6132
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6061
6133
|
"input",
|
|
6062
6134
|
{
|
|
6063
6135
|
placeholder,
|
|
@@ -6068,7 +6140,7 @@ function Input2({
|
|
|
6068
6140
|
className: `matchid-token-input ${error ? "matchid-token-input-error" : ""}`
|
|
6069
6141
|
}
|
|
6070
6142
|
),
|
|
6071
|
-
error && /* @__PURE__ */ (0,
|
|
6143
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: "matchid-token-input-error-text", children: error })
|
|
6072
6144
|
] });
|
|
6073
6145
|
}
|
|
6074
6146
|
function TokenSend({
|
|
@@ -6087,8 +6159,8 @@ function TokenSend({
|
|
|
6087
6159
|
const walletClient = (0, import_react40.useMemo)(() => {
|
|
6088
6160
|
return createWalletClient2({
|
|
6089
6161
|
// @ts-ignore
|
|
6090
|
-
chain: (0,
|
|
6091
|
-
transport: (0,
|
|
6162
|
+
chain: (0, import_viem15.defineChain)(chain),
|
|
6163
|
+
transport: (0, import_viem15.http)()
|
|
6092
6164
|
});
|
|
6093
6165
|
}, [chain]);
|
|
6094
6166
|
const [amount, setAmount] = (0, import_react40.useState)("");
|
|
@@ -6101,13 +6173,13 @@ function TokenSend({
|
|
|
6101
6173
|
if (!amount || !address || !reg.test(address)) {
|
|
6102
6174
|
return;
|
|
6103
6175
|
}
|
|
6104
|
-
const viemChain = (0,
|
|
6176
|
+
const viemChain = (0, import_viem15.defineChain)(chain);
|
|
6105
6177
|
const to = isNative ? address : token.address;
|
|
6106
|
-
const value = isNative ? (0,
|
|
6107
|
-
const data = isNative ? "0x" : (0,
|
|
6108
|
-
abi:
|
|
6178
|
+
const value = isNative ? (0, import_viem15.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
|
|
6179
|
+
const data = isNative ? "0x" : (0, import_viem15.encodeFunctionData)({
|
|
6180
|
+
abi: import_viem15.erc20Abi,
|
|
6109
6181
|
functionName: "transfer",
|
|
6110
|
-
args: [address, (0,
|
|
6182
|
+
args: [address, (0, import_viem15.parseUnits)(amount, parseInt(token?.decimals || "18"))]
|
|
6111
6183
|
});
|
|
6112
6184
|
return {
|
|
6113
6185
|
to,
|
|
@@ -6196,24 +6268,24 @@ function TokenSend({
|
|
|
6196
6268
|
window.removeEventListener("message", receiveMessage);
|
|
6197
6269
|
};
|
|
6198
6270
|
}, []);
|
|
6199
|
-
return /* @__PURE__ */ (0,
|
|
6200
|
-
/* @__PURE__ */ (0,
|
|
6201
|
-
/* @__PURE__ */ (0,
|
|
6202
|
-
/* @__PURE__ */ (0,
|
|
6203
|
-
/* @__PURE__ */ (0,
|
|
6204
|
-
/* @__PURE__ */ (0,
|
|
6205
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
6271
|
+
return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ModalDrawer, { isOpen: true, onClose, zIndex, title: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_intl20.FormattedMessage, { id: "send" }), onBack, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-send-box`, children: [
|
|
6272
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
6273
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-amount-content`, children: [
|
|
6274
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-amount-header`, children: [
|
|
6275
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `matchid-token-amount-title`, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_intl20.FormattedMessage, { id: "amount" }) }),
|
|
6276
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-amount-chain`, children: [
|
|
6277
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6206
6278
|
"img",
|
|
6207
6279
|
{
|
|
6208
6280
|
src: token?.icon,
|
|
6209
6281
|
alt: token?.symbol,
|
|
6210
6282
|
className: `matchid-token-amount-chain-icon`
|
|
6211
6283
|
}
|
|
6212
|
-
) : /* @__PURE__ */ (0,
|
|
6213
|
-
/* @__PURE__ */ (0,
|
|
6284
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(AlphaAvatar, { name: token.symbol || token.name || "", size: 16 }),
|
|
6285
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("span", { children: token?.symbol })
|
|
6214
6286
|
] })
|
|
6215
6287
|
] }),
|
|
6216
|
-
/* @__PURE__ */ (0,
|
|
6288
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6217
6289
|
Input2,
|
|
6218
6290
|
{
|
|
6219
6291
|
type: "text",
|
|
@@ -6226,18 +6298,18 @@ function TokenSend({
|
|
|
6226
6298
|
error: error.amount || txError
|
|
6227
6299
|
}
|
|
6228
6300
|
),
|
|
6229
|
-
/* @__PURE__ */ (0,
|
|
6230
|
-
/* @__PURE__ */ (0,
|
|
6231
|
-
/* @__PURE__ */ (0,
|
|
6301
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-amount-footer`, children: [
|
|
6302
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-amount-title`, children: [
|
|
6303
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_intl20.FormattedMessage, { id: "balance" }),
|
|
6232
6304
|
":"
|
|
6233
6305
|
] }),
|
|
6234
|
-
/* @__PURE__ */ (0,
|
|
6306
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `matchid-token-amount-value`, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10, suffix: " " + token.symbol }) })
|
|
6235
6307
|
] }),
|
|
6236
|
-
/* @__PURE__ */ (0,
|
|
6308
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(TransferIcon, { className: "matchid-token-amount-transfer" })
|
|
6237
6309
|
] }),
|
|
6238
|
-
/* @__PURE__ */ (0,
|
|
6239
|
-
/* @__PURE__ */ (0,
|
|
6240
|
-
/* @__PURE__ */ (0,
|
|
6310
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsxs)("div", { className: `matchid-token-address-content`, children: [
|
|
6311
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `matchid-token-address-header`, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("div", { className: `matchid-token-address-title`, children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_intl20.FormattedMessage, { id: "receiveTitle" }) }) }),
|
|
6312
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6241
6313
|
Input2,
|
|
6242
6314
|
{
|
|
6243
6315
|
type: "text",
|
|
@@ -6253,7 +6325,7 @@ function TokenSend({
|
|
|
6253
6325
|
)
|
|
6254
6326
|
] })
|
|
6255
6327
|
] }),
|
|
6256
|
-
/* @__PURE__ */ (0,
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime102.jsx)(
|
|
6257
6329
|
Button,
|
|
6258
6330
|
{
|
|
6259
6331
|
size: "lg",
|
|
@@ -6262,7 +6334,7 @@ function TokenSend({
|
|
|
6262
6334
|
disabled: !canSend || !!txError,
|
|
6263
6335
|
onClick: onNext,
|
|
6264
6336
|
loading: loading || sending,
|
|
6265
|
-
children: /* @__PURE__ */ (0,
|
|
6337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_react_intl20.FormattedMessage, { id: "next" })
|
|
6266
6338
|
}
|
|
6267
6339
|
)
|
|
6268
6340
|
] }) });
|
|
@@ -6270,7 +6342,7 @@ function TokenSend({
|
|
|
6270
6342
|
|
|
6271
6343
|
// src/components/TokenDetail/index.tsx
|
|
6272
6344
|
var import_react_intl21 = require("react-intl");
|
|
6273
|
-
var
|
|
6345
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
6274
6346
|
function TokenDetail({
|
|
6275
6347
|
onClose,
|
|
6276
6348
|
token
|
|
@@ -6280,41 +6352,41 @@ function TokenDetail({
|
|
|
6280
6352
|
const chain = chainList?.find((m) => m.id.toString() === token.chain_id);
|
|
6281
6353
|
const onSend = () => {
|
|
6282
6354
|
modal.show((props) => {
|
|
6283
|
-
return /* @__PURE__ */ (0,
|
|
6355
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(TokenSend, { onClose: () => {
|
|
6284
6356
|
props.close();
|
|
6285
6357
|
onClose();
|
|
6286
6358
|
}, onBack: props.close, zIndex: props.zIndex, token });
|
|
6287
6359
|
});
|
|
6288
6360
|
};
|
|
6289
6361
|
const intl = (0, import_react_intl21.useIntl)();
|
|
6290
|
-
return /* @__PURE__ */ (0,
|
|
6362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ModalDrawer, { isOpen: true, title: intl.formatMessage({
|
|
6291
6363
|
id: "tokenDetails"
|
|
6292
|
-
}), onClose, children: /* @__PURE__ */ (0,
|
|
6293
|
-
/* @__PURE__ */ (0,
|
|
6294
|
-
/* @__PURE__ */ (0,
|
|
6295
|
-
/* @__PURE__ */ (0,
|
|
6296
|
-
token.icon ? /* @__PURE__ */ (0,
|
|
6297
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
6364
|
+
}), onClose, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-detail`, children: [
|
|
6365
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-main`, children: [
|
|
6366
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-info`, children: [
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-logo`, children: [
|
|
6368
|
+
token.icon ? /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("img", { src: token.icon, alt: token.symbol, className: `matchid-token-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(AlphaAvatar, { className: `matchid-token-icon`, size: 48, name: token.symbol || token.name || "" }),
|
|
6369
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime103.jsx)("img", { src: chain.iconUrl, alt: chain.name, className: `matchid-token-chain` })
|
|
6298
6370
|
] }),
|
|
6299
|
-
/* @__PURE__ */ (0,
|
|
6300
|
-
/* @__PURE__ */ (0,
|
|
6371
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-name`, children: [
|
|
6372
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(NumberFormatter, { value: token.balance, tFixNum: 10 }),
|
|
6301
6373
|
" ",
|
|
6302
6374
|
token.symbol
|
|
6303
6375
|
] })
|
|
6304
6376
|
] }),
|
|
6305
|
-
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ (0,
|
|
6306
|
-
/* @__PURE__ */ (0,
|
|
6307
|
-
/* @__PURE__ */ (0,
|
|
6377
|
+
token.address.toLowerCase() != NATIVE_TOKEN_ADDRESS && /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)("div", { className: `matchid-token-contract`, children: [
|
|
6378
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "matchid-token-contract-title", children: "Contract address" }),
|
|
6379
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)("div", { className: "matchid-token-contract-address", children: token.address })
|
|
6308
6380
|
] })
|
|
6309
6381
|
] }),
|
|
6310
|
-
/* @__PURE__ */ (0,
|
|
6382
|
+
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(Button, { size: "lg", block: true, highlight: true, onClick: onSend, children: /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_react_intl21.FormattedMessage, { id: "send" }) })
|
|
6311
6383
|
] }) });
|
|
6312
6384
|
}
|
|
6313
6385
|
|
|
6314
6386
|
// src/components/TokenSendList/index.tsx
|
|
6315
6387
|
var import_react41 = require("react");
|
|
6316
6388
|
var import_react_intl22 = require("react-intl");
|
|
6317
|
-
var
|
|
6389
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
6318
6390
|
function TokenSendList({ close }) {
|
|
6319
6391
|
const isDownMd = useDownMd();
|
|
6320
6392
|
const walletAssets = useMatchWalletAssets();
|
|
@@ -6326,16 +6398,16 @@ function TokenSendList({ close }) {
|
|
|
6326
6398
|
const modal = useModal();
|
|
6327
6399
|
const onNext = () => {
|
|
6328
6400
|
checked && modal.show((props) => {
|
|
6329
|
-
return /* @__PURE__ */ (0,
|
|
6401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(TokenSend, { onClose: () => {
|
|
6330
6402
|
props.close();
|
|
6331
6403
|
close();
|
|
6332
6404
|
}, onBack: props.close, zIndex: props.zIndex, token: checked });
|
|
6333
6405
|
});
|
|
6334
6406
|
};
|
|
6335
|
-
return /* @__PURE__ */ (0,
|
|
6336
|
-
/* @__PURE__ */ (0,
|
|
6407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "matchid-token-send-list-box", children: [
|
|
6408
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: "matchid-token-send-list", children: matchWalletAssetList.list.map((n, index) => {
|
|
6337
6409
|
const chain = list?.find((m) => m.id.toString() === n.chain_id);
|
|
6338
|
-
return /* @__PURE__ */ (0,
|
|
6410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(
|
|
6339
6411
|
"div",
|
|
6340
6412
|
{
|
|
6341
6413
|
className: `matchid-token-send-item ${checked?.address == n.address ? "matchid-token-send-chekced" : ""}`,
|
|
@@ -6343,10 +6415,10 @@ function TokenSendList({ close }) {
|
|
|
6343
6415
|
setChecked(n);
|
|
6344
6416
|
},
|
|
6345
6417
|
children: [
|
|
6346
|
-
/* @__PURE__ */ (0,
|
|
6347
|
-
/* @__PURE__ */ (0,
|
|
6348
|
-
/* @__PURE__ */ (0,
|
|
6349
|
-
n.icon ? /* @__PURE__ */ (0,
|
|
6418
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Radio, { checked: checked?.address == n.address, size: isDownMd ? 18 : 24 }),
|
|
6419
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "matchid-token-send-content", children: [
|
|
6420
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: "matchid-token-send-logo", children: [
|
|
6421
|
+
n.icon ? /* @__PURE__ */ (0, import_jsx_runtime104.jsx)("img", { src: n.icon, alt: n.symbol, className: `matchid-token-send-icon` }) : /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
6350
6422
|
AlphaAvatar2,
|
|
6351
6423
|
{
|
|
6352
6424
|
className: `matchid-token-send-icon`,
|
|
@@ -6354,7 +6426,7 @@ function TokenSendList({ close }) {
|
|
|
6354
6426
|
name: n.symbol || n.name || ""
|
|
6355
6427
|
}
|
|
6356
6428
|
),
|
|
6357
|
-
chain?.iconUrl && /* @__PURE__ */ (0,
|
|
6429
|
+
chain?.iconUrl && /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
|
|
6358
6430
|
"img",
|
|
6359
6431
|
{
|
|
6360
6432
|
src: chain.iconUrl,
|
|
@@ -6363,9 +6435,9 @@ function TokenSendList({ close }) {
|
|
|
6363
6435
|
}
|
|
6364
6436
|
)
|
|
6365
6437
|
] }),
|
|
6366
|
-
/* @__PURE__ */ (0,
|
|
6367
|
-
/* @__PURE__ */ (0,
|
|
6368
|
-
/* @__PURE__ */ (0,
|
|
6438
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsxs)("div", { className: `matchid-token-send-info`, children: [
|
|
6439
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: `matchid-token-send-name`, children: n.symbol }),
|
|
6440
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)("div", { className: `matchid-token-send-balance`, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(NumberFormatter, { value: n.balance, tFixNum: 3 }) })
|
|
6369
6441
|
] })
|
|
6370
6442
|
] })
|
|
6371
6443
|
]
|
|
@@ -6373,17 +6445,17 @@ function TokenSendList({ close }) {
|
|
|
6373
6445
|
index
|
|
6374
6446
|
);
|
|
6375
6447
|
}) }),
|
|
6376
|
-
/* @__PURE__ */ (0,
|
|
6448
|
+
/* @__PURE__ */ (0, import_jsx_runtime104.jsx)(Button, { size: "lg", highlight: true, block: true, disabled: !checked, onClick: onNext, children: /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_react_intl22.FormattedMessage, { id: "next" }) })
|
|
6377
6449
|
] });
|
|
6378
6450
|
}
|
|
6379
6451
|
|
|
6380
6452
|
// src/components/TransactionList/index.tsx
|
|
6381
6453
|
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
|
|
6382
6454
|
var import_react42 = require("react");
|
|
6383
|
-
var
|
|
6384
|
-
var
|
|
6455
|
+
var import_viem16 = require("viem");
|
|
6456
|
+
var import_viem17 = require("viem");
|
|
6385
6457
|
var import_react_intl23 = require("react-intl");
|
|
6386
|
-
var
|
|
6458
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
6387
6459
|
var Item = ({ data }) => {
|
|
6388
6460
|
const { address } = useWallet();
|
|
6389
6461
|
const isOut = data.from.toLowerCase() == address.toLowerCase();
|
|
@@ -6405,8 +6477,8 @@ var Item = ({ data }) => {
|
|
|
6405
6477
|
return data.from;
|
|
6406
6478
|
}
|
|
6407
6479
|
if (transferType == "erc20_transfer") {
|
|
6408
|
-
const decodeData = (0,
|
|
6409
|
-
abi:
|
|
6480
|
+
const decodeData = (0, import_viem16.decodeFunctionData)({
|
|
6481
|
+
abi: import_viem17.erc20Abi,
|
|
6410
6482
|
data: data.input
|
|
6411
6483
|
});
|
|
6412
6484
|
return decodeData.args[0];
|
|
@@ -6415,19 +6487,19 @@ var Item = ({ data }) => {
|
|
|
6415
6487
|
}, [data.input, transferType, data.to, isOut]);
|
|
6416
6488
|
const amount = (0, import_react42.useMemo)(() => {
|
|
6417
6489
|
if (transferType == "erc20_transfer") {
|
|
6418
|
-
const decodeData = (0,
|
|
6419
|
-
abi:
|
|
6490
|
+
const decodeData = (0, import_viem16.decodeFunctionData)({
|
|
6491
|
+
abi: import_viem17.erc20Abi,
|
|
6420
6492
|
data: data.input
|
|
6421
6493
|
});
|
|
6422
6494
|
const value = decodeData.args[1];
|
|
6423
|
-
return (0,
|
|
6495
|
+
return (0, import_viem16.formatUnits)(value, contracts[`${chainId}-${data.to.toLowerCase()}`]?.decimals || 18);
|
|
6424
6496
|
}
|
|
6425
6497
|
return chainFormatUnits(BigInt(data.value));
|
|
6426
6498
|
}, [data.input, transferType, data.value, contracts, chainId, data.to]);
|
|
6427
6499
|
const hashQuery = useHash({
|
|
6428
6500
|
hash: data.hash,
|
|
6429
6501
|
//@ts-ignore
|
|
6430
|
-
chain: (0,
|
|
6502
|
+
chain: (0, import_viem16.defineChain)(chain),
|
|
6431
6503
|
refetchInterval: shouldRefetch ? 3e3 : false,
|
|
6432
6504
|
enabled: shouldRefetch && data.source == "local"
|
|
6433
6505
|
});
|
|
@@ -6470,18 +6542,18 @@ var Item = ({ data }) => {
|
|
|
6470
6542
|
}
|
|
6471
6543
|
return chain?.nativeCurrency.symbol || chain?.nativeCurrency.name;
|
|
6472
6544
|
}, [transferType, chain, contracts, chainId, data.to]);
|
|
6473
|
-
return /* @__PURE__ */ (0,
|
|
6545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
|
|
6474
6546
|
"a",
|
|
6475
6547
|
{
|
|
6476
6548
|
href: explorerLink(`tx/${data.hash}`),
|
|
6477
6549
|
target: "_blank",
|
|
6478
6550
|
className: `matchid-transaction-item`,
|
|
6479
6551
|
children: [
|
|
6480
|
-
/* @__PURE__ */ (0,
|
|
6481
|
-
/* @__PURE__ */ (0,
|
|
6482
|
-
/* @__PURE__ */ (0,
|
|
6483
|
-
/* @__PURE__ */ (0,
|
|
6484
|
-
/* @__PURE__ */ (0,
|
|
6552
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: `matchid-transacton-item-container`, children: [
|
|
6553
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "matchid-transaction-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(ArrowSendIcon, { className: !isOut ? "rotate-180" : "" }) }),
|
|
6554
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: `matchid-transaction-item-details`, children: [
|
|
6555
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `matchid-transaction-item-address`, children: formatAddress(to, 6, 4) }),
|
|
6556
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6485
6557
|
"div",
|
|
6486
6558
|
{
|
|
6487
6559
|
className: `matchid-transaction-item-timestamp`,
|
|
@@ -6490,11 +6562,11 @@ var Item = ({ data }) => {
|
|
|
6490
6562
|
)
|
|
6491
6563
|
] })
|
|
6492
6564
|
] }),
|
|
6493
|
-
/* @__PURE__ */ (0,
|
|
6494
|
-
/* @__PURE__ */ (0,
|
|
6495
|
-
status == "loading" && /* @__PURE__ */ (0,
|
|
6496
|
-
status == "success" && /* @__PURE__ */ (0,
|
|
6497
|
-
status == "error" && /* @__PURE__ */ (0,
|
|
6565
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: `matchid-transaction-item-amount ${"matchid-transaction-item-" + status}`, children: [
|
|
6566
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(NumberFormatter, { value: amount, tFixNum: 6, prefix: isOut ? "-" : "+", suffix: " " + symbol }),
|
|
6567
|
+
status == "loading" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(LoadingIcon_default, { color: "#000000", size: 16, rotate: true }),
|
|
6568
|
+
status == "success" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(CheckRoundIcon, { size: 16 }),
|
|
6569
|
+
status == "error" && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(InfoRoundIcon, { size: 16 })
|
|
6498
6570
|
] })
|
|
6499
6571
|
]
|
|
6500
6572
|
}
|
|
@@ -6504,19 +6576,19 @@ function TransactionList({
|
|
|
6504
6576
|
scrollableTarget
|
|
6505
6577
|
}) {
|
|
6506
6578
|
const { fetchMoreData, hasMore, items } = useMatchWalletRecords();
|
|
6507
|
-
return /* @__PURE__ */ (0,
|
|
6579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
|
|
6508
6580
|
import_react_infinite_scroll_component.default,
|
|
6509
6581
|
{
|
|
6510
6582
|
scrollableTarget,
|
|
6511
6583
|
dataLength: items.length,
|
|
6512
6584
|
next: fetchMoreData,
|
|
6513
6585
|
hasMore,
|
|
6514
|
-
loader: /* @__PURE__ */ (0,
|
|
6515
|
-
/* @__PURE__ */ (0,
|
|
6586
|
+
loader: /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)("div", { className: "matchid-list-nomore", children: [
|
|
6587
|
+
/* @__PURE__ */ (0, import_jsx_runtime105.jsx)(LoadingIcon_default, { rotate: true, size: 16, color: "black" }),
|
|
6516
6588
|
"Loading..."
|
|
6517
6589
|
] }),
|
|
6518
|
-
endMessage: items.length > 0 ? /* @__PURE__ */ (0,
|
|
6519
|
-
children: items.length == 0 && !hasMore ? /* @__PURE__ */ (0,
|
|
6590
|
+
endMessage: items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_react_intl23.FormattedMessage, { id: "noMoreRecords" }) }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `matchid-list-nomore`, children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_react_intl23.FormattedMessage, { id: "noRecords" }) }),
|
|
6591
|
+
children: items.length == 0 && !hasMore ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: "mt-[150px]" }) : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("div", { className: `matchid-transaction-list`, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Item, { data: item }, index)) })
|
|
6520
6592
|
}
|
|
6521
6593
|
);
|
|
6522
6594
|
}
|