@cfxjs/sirius-next-common 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-N5TMLKGL.js → chunk-3CHXTO52.js} +4 -4
- package/dist/chunk-3PF5QYAQ.js +2149 -0
- package/dist/chunk-3PF5QYAQ.js.map +1 -0
- package/dist/{chunk-73IFRWHE.js → chunk-52R454XN.js} +2 -2
- package/dist/{chunk-ZKNMJZ5R.js → chunk-BMO4IZHV.js} +1287 -1706
- package/dist/chunk-BMO4IZHV.js.map +1 -0
- package/dist/{chunk-4HTI24KG.js → chunk-BVED57CI.js} +2 -2
- package/dist/{chunk-RB2U3Y7F.js → chunk-CKOT4CK7.js} +2 -2
- package/dist/{chunk-NIYCXPXR.js → chunk-CY4XPEK5.js} +4 -4
- package/dist/{chunk-VUULJBTQ.js → chunk-H7V2CGOB.js} +2 -1
- package/dist/chunk-H7V2CGOB.js.map +1 -0
- package/dist/chunk-JXKHN73X.js +534 -0
- package/dist/chunk-JXKHN73X.js.map +1 -0
- package/dist/{chunk-CDYRVFSO.js → chunk-OQCPL2OI.js} +2 -12
- package/dist/chunk-OQCPL2OI.js.map +1 -0
- package/dist/{chunk-FMHO65DC.js → chunk-W7ZK4OQA.js} +3 -3
- package/dist/{chunk-RWMP7K3H.js → chunk-WML236LE.js} +4 -4
- package/dist/{chunk-AAQD5VX5.js → chunk-XZQWPTKA.js} +4 -4
- package/dist/components/AddressContainer/CoreAddressContainer.js +8 -7
- package/dist/components/AddressContainer/EVMAddressContainer.js +8 -7
- package/dist/components/AddressContainer/addressSwitcher.js +6 -5
- package/dist/components/AddressContainer/addressView.js +5 -4
- package/dist/components/AddressContainer/label.js +4 -3
- package/dist/components/Age/index.js +4 -3
- package/dist/components/Age/index.js.map +1 -1
- package/dist/components/AutoComplete/index.d.ts +16 -0
- package/dist/components/AutoComplete/index.js +83 -0
- package/dist/components/AutoComplete/index.js.map +1 -0
- package/dist/components/Button/index.js +4 -4
- package/dist/components/Charts/PreviewChartTemplate.js +5 -5
- package/dist/components/Charts/StockChartTemplate.js +2 -2
- package/dist/components/CopyButton/index.js +3 -2
- package/dist/components/CopyButton/index.js.map +1 -1
- package/dist/components/DecimalsSelect/index.d.ts +16 -0
- package/dist/components/DecimalsSelect/index.js +126 -0
- package/dist/components/DecimalsSelect/index.js.map +1 -0
- package/dist/components/DownloadCSV/index.js +4 -3
- package/dist/components/DownloadCSV/index.js.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/GasPriceDropdown/index.js +1 -1
- package/dist/components/Icons/index.d.ts +4 -0
- package/dist/components/Icons/index.js +68 -0
- package/dist/components/Icons/index.js.map +1 -0
- package/dist/components/IncreasePercent/index.js +1 -1
- package/dist/components/InfoIconWithTooltip/index.js +3 -2
- package/dist/components/InfoIconWithTooltip/index.js.map +1 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NetworkIcon/index.js +1 -1
- package/dist/components/PhishingAddressContainer/index.js +3 -2
- package/dist/components/PhishingAddressContainer/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +13 -0
- package/dist/components/Popover/index.js +15 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Price/index.js +3 -2
- package/dist/components/Price/index.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Select/select.js +2 -2
- package/dist/components/Text/index.js +4 -3
- package/dist/components/Tooltip/index.js +3 -2
- package/dist/components/TransactionAction/coreTransactionAction.js +8 -7
- package/dist/components/TransactionAction/coreTransactionAction.js.map +1 -1
- package/dist/components/TransactionAction/evmTransactionAction.js +8 -7
- package/dist/components/TransactionAction/evmTransactionAction.js.map +1 -1
- package/dist/uno.css +35 -6
- package/dist/utils/contractManagerTool.js +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-CDYRVFSO.js.map +0 -1
- package/dist/chunk-VUULJBTQ.js.map +0 -1
- package/dist/chunk-ZKNMJZ5R.js.map +0 -1
- /package/dist/{chunk-N5TMLKGL.js.map → chunk-3CHXTO52.js.map} +0 -0
- /package/dist/{chunk-73IFRWHE.js.map → chunk-52R454XN.js.map} +0 -0
- /package/dist/{chunk-4HTI24KG.js.map → chunk-BVED57CI.js.map} +0 -0
- /package/dist/{chunk-RB2U3Y7F.js.map → chunk-CKOT4CK7.js.map} +0 -0
- /package/dist/{chunk-NIYCXPXR.js.map → chunk-CY4XPEK5.js.map} +0 -0
- /package/dist/{chunk-FMHO65DC.js.map → chunk-W7ZK4OQA.js.map} +0 -0
- /package/dist/{chunk-RWMP7K3H.js.map → chunk-WML236LE.js.map} +0 -0
- /package/dist/{chunk-AAQD5VX5.js.map → chunk-XZQWPTKA.js.map} +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover
|
|
3
|
+
} from "../../chunk-3PF5QYAQ.js";
|
|
4
|
+
import "../../chunk-BMO4IZHV.js";
|
|
5
|
+
import "../../chunk-LRCAKRPK.js";
|
|
6
|
+
import "../../chunk-H7V2CGOB.js";
|
|
7
|
+
import "../../chunk-7RH7LJYB.js";
|
|
8
|
+
import "../../chunk-Z6EYKGBH.js";
|
|
9
|
+
import "../../chunk-J2I22Q2M.js";
|
|
10
|
+
import "../../chunk-YEUH2K6Z.js";
|
|
11
|
+
import "../../chunk-DQGLZCIG.js";
|
|
12
|
+
|
|
13
|
+
// src/components/DecimalsSelect/index.tsx
|
|
14
|
+
import { useState } from "react";
|
|
15
|
+
import clsx from "clsx";
|
|
16
|
+
import { Check, ChevronUp } from "lucide-react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var Value = ({ mode, value }) => {
|
|
19
|
+
if (mode === "pow")
|
|
20
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
21
|
+
"10 ",
|
|
22
|
+
/* @__PURE__ */ jsx("sup", { children: value })
|
|
23
|
+
] });
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
26
|
+
var CustomOption = ({ onChange, mode, ...props }) => {
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", { className: "w-full flex items-center gap-10px", children: [
|
|
28
|
+
mode === "pow" && "10^",
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
className: clsx("w-0 flex-1"),
|
|
33
|
+
onChange: (e) => onChange(e.target.value),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
};
|
|
39
|
+
var defaultOptions = [18, 8, 6];
|
|
40
|
+
var DecimalsSelect = ({
|
|
41
|
+
max,
|
|
42
|
+
onChange,
|
|
43
|
+
optionsClassName,
|
|
44
|
+
popoverClassName,
|
|
45
|
+
className,
|
|
46
|
+
placeholder,
|
|
47
|
+
value,
|
|
48
|
+
options = defaultOptions,
|
|
49
|
+
mode = "decimals"
|
|
50
|
+
}) => {
|
|
51
|
+
const [open, setOpen] = useState(false);
|
|
52
|
+
const [selected, setSelected] = useState(
|
|
53
|
+
() => options.find((option) => option === value)
|
|
54
|
+
);
|
|
55
|
+
const handleDecimalsChange = (value2) => {
|
|
56
|
+
if (!value2) {
|
|
57
|
+
onChange(void 0);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
let num = Number(value2);
|
|
61
|
+
if (value2.includes("-") || value2.includes(".") || isNaN(num))
|
|
62
|
+
return;
|
|
63
|
+
if (max && num > max)
|
|
64
|
+
num = max;
|
|
65
|
+
if (num < 0)
|
|
66
|
+
num = 0;
|
|
67
|
+
setSelected(void 0);
|
|
68
|
+
onChange(num);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
Popover,
|
|
72
|
+
{
|
|
73
|
+
content: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8px w-76px", children: [
|
|
74
|
+
options.map((option) => /* @__PURE__ */ jsxs(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: clsx(
|
|
78
|
+
"cursor-pointer bg-[#fff] hover:bg-[#f1f3f5] w-full flex items-center justify-between",
|
|
79
|
+
optionsClassName
|
|
80
|
+
),
|
|
81
|
+
onClick: () => {
|
|
82
|
+
setSelected(option);
|
|
83
|
+
onChange(option);
|
|
84
|
+
setOpen(false);
|
|
85
|
+
},
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ jsx(Value, { mode, value: option }),
|
|
88
|
+
option === selected && /* @__PURE__ */ jsx(Check, { className: "w-16px h-16px" })
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
option
|
|
92
|
+
)),
|
|
93
|
+
/* @__PURE__ */ jsx("div", { className: clsx("bg-[#fff] w-full", optionsClassName), children: /* @__PURE__ */ jsx(
|
|
94
|
+
CustomOption,
|
|
95
|
+
{
|
|
96
|
+
onChange: handleDecimalsChange,
|
|
97
|
+
value: selected === void 0 && value !== void 0 ? value : "",
|
|
98
|
+
mode
|
|
99
|
+
}
|
|
100
|
+
) })
|
|
101
|
+
] }),
|
|
102
|
+
containerClassName: popoverClassName,
|
|
103
|
+
onOpen: () => setOpen(true),
|
|
104
|
+
onClose: () => setOpen(false),
|
|
105
|
+
open,
|
|
106
|
+
children: /* @__PURE__ */ jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: clsx(
|
|
110
|
+
"inline-flex justify-between items-center px-8px h-24px w-100px cursor-pointer",
|
|
111
|
+
"border-1 border-solid border-#E8E9EA rounded-2px",
|
|
112
|
+
className
|
|
113
|
+
),
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ jsx("span", { children: value === void 0 ? placeholder : /* @__PURE__ */ jsx(Value, { mode, value }) }),
|
|
116
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: clsx("w-12px h-12px", !open && "rotate-180") })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
DecimalsSelect
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DecimalsSelect/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport clsx from 'clsx';\nimport { Popover } from '../Popover';\nimport { Check, ChevronUp } from 'lucide-react';\n\nconst Value: React.FC<{\n value?: number;\n mode: 'decimals' | 'pow';\n}> = ({ mode, value }) => {\n if (mode === 'pow')\n return (\n <span>\n 10 <sup>{value}</sup>\n </span>\n );\n return value;\n};\n\nconst CustomOption: React.FC<{\n onChange: (value: string) => void;\n value?: number | string;\n mode: 'decimals' | 'pow';\n}> = ({ onChange, mode, ...props }) => {\n return (\n <div className=\"w-full flex items-center gap-10px\">\n {mode === 'pow' && '10^'}\n <input\n className={clsx('w-0 flex-1')}\n onChange={e => onChange(e.target.value)}\n {...props}\n />\n </div>\n );\n};\n\nconst defaultOptions = [18, 8, 6];\n\ntype DecimalsSelectProps = {\n value?: number;\n onChange: (value?: number) => void;\n max?: number;\n placeholder?: string;\n className?: string;\n optionsClassName?: string;\n popoverClassName?: string;\n mode?: 'decimals' | 'pow';\n options?: number[];\n};\n\nexport const DecimalsSelect = ({\n max,\n onChange,\n optionsClassName,\n popoverClassName,\n className,\n placeholder,\n value,\n options = defaultOptions,\n mode = 'decimals',\n}: DecimalsSelectProps) => {\n const [open, setOpen] = useState(false);\n const [selected, setSelected] = useState(() =>\n options.find(option => option === value),\n );\n const handleDecimalsChange = (value: string) => {\n if (!value) {\n onChange(undefined);\n return;\n }\n let num = Number(value);\n if (value.includes('-') || value.includes('.') || isNaN(num)) return;\n if (max && num > max) num = max;\n if (num < 0) num = 0;\n setSelected(undefined);\n onChange(num);\n };\n return (\n <Popover\n content={\n <div className=\"flex flex-col gap-8px w-76px\">\n {options.map(option => (\n <div\n className={clsx(\n 'cursor-pointer bg-[#fff] hover:bg-[#f1f3f5] w-full flex items-center justify-between',\n optionsClassName,\n )}\n key={option}\n onClick={() => {\n setSelected(option);\n onChange(option);\n setOpen(false);\n }}\n >\n <Value mode={mode} value={option} />\n {option === selected && <Check className=\"w-16px h-16px\" />}\n </div>\n ))}\n <div className={clsx('bg-[#fff] w-full', optionsClassName)}>\n <CustomOption\n onChange={handleDecimalsChange}\n value={selected === undefined && value !== undefined ? value : ''}\n mode={mode}\n />\n </div>\n </div>\n }\n containerClassName={popoverClassName}\n onOpen={() => setOpen(true)}\n onClose={() => setOpen(false)}\n open={open}\n >\n <div\n className={clsx(\n 'inline-flex justify-between items-center px-8px h-24px w-100px cursor-pointer',\n 'border-1 border-solid border-#E8E9EA rounded-2px',\n className,\n )}\n >\n <span>\n {value === undefined ? (\n placeholder\n ) : (\n <Value mode={mode} value={value} />\n )}\n </span>\n <ChevronUp className={clsx('w-12px h-12px', !open && 'rotate-180')} />\n </div>\n </Popover>\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAgB,gBAAgB;AAChC,OAAO,UAAU;AAEjB,SAAS,OAAO,iBAAiB;AAQ3B,SACK,KADL;AANN,IAAM,QAGD,CAAC,EAAE,MAAM,MAAM,MAAM;AACxB,MAAI,SAAS;AACX,WACE,qBAAC,UAAK;AAAA;AAAA,MACD,oBAAC,SAAK,iBAAM;AAAA,OACjB;AAEJ,SAAO;AACT;AAEA,IAAM,eAID,CAAC,EAAE,UAAU,MAAM,GAAG,MAAM,MAAM;AACrC,SACE,qBAAC,SAAI,WAAU,qCACZ;AAAA,aAAS,SAAS;AAAA,IACnB;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,KAAK,YAAY;AAAA,QAC5B,UAAU,OAAK,SAAS,EAAE,OAAO,KAAK;AAAA,QACrC,GAAG;AAAA;AAAA,IACN;AAAA,KACF;AAEJ;AAEA,IAAM,iBAAiB,CAAC,IAAI,GAAG,CAAC;AAczB,IAAM,iBAAiB,CAAC;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AACT,MAA2B;AACzB,QAAM,CAAC,MAAM,OAAO,IAAI,SAAS,KAAK;AACtC,QAAM,CAAC,UAAU,WAAW,IAAI;AAAA,IAAS,MACvC,QAAQ,KAAK,YAAU,WAAW,KAAK;AAAA,EACzC;AACA,QAAM,uBAAuB,CAACA,WAAkB;AAC9C,QAAI,CAACA,QAAO;AACV,eAAS,MAAS;AAClB;AAAA,IACF;AACA,QAAI,MAAM,OAAOA,MAAK;AACtB,QAAIA,OAAM,SAAS,GAAG,KAAKA,OAAM,SAAS,GAAG,KAAK,MAAM,GAAG;AAAG;AAC9D,QAAI,OAAO,MAAM;AAAK,YAAM;AAC5B,QAAI,MAAM;AAAG,YAAM;AACnB,gBAAY,MAAS;AACrB,aAAS,GAAG;AAAA,EACd;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SACE,qBAAC,SAAI,WAAU,gCACZ;AAAA,gBAAQ,IAAI,YACX;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,cACT;AAAA,cACA;AAAA,YACF;AAAA,YAEA,SAAS,MAAM;AACb,0BAAY,MAAM;AAClB,uBAAS,MAAM;AACf,sBAAQ,KAAK;AAAA,YACf;AAAA,YAEA;AAAA,kCAAC,SAAM,MAAY,OAAO,QAAQ;AAAA,cACjC,WAAW,YAAY,oBAAC,SAAM,WAAU,iBAAgB;AAAA;AAAA;AAAA,UARpD;AAAA,QASP,CACD;AAAA,QACD,oBAAC,SAAI,WAAW,KAAK,oBAAoB,gBAAgB,GACvD;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,OAAO,aAAa,UAAa,UAAU,SAAY,QAAQ;AAAA,YAC/D;AAAA;AAAA,QACF,GACF;AAAA,SACF;AAAA,MAEF,oBAAoB;AAAA,MACpB,QAAQ,MAAM,QAAQ,IAAI;AAAA,MAC1B,SAAS,MAAM,QAAQ,KAAK;AAAA,MAC5B;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UAEA;AAAA,gCAAC,UACE,oBAAU,SACT,cAEA,oBAAC,SAAM,MAAY,OAAc,GAErC;AAAA,YACA,oBAAC,aAAU,WAAW,KAAK,iBAAiB,CAAC,QAAQ,YAAY,GAAG;AAAA;AAAA;AAAA,MACtE;AAAA;AAAA,EACF;AAEJ;","names":["value"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-OQCPL2OI.js";
|
|
4
4
|
import "../../chunk-XCKMXAL2.js";
|
|
5
5
|
import {
|
|
6
6
|
Link
|
|
@@ -8,9 +8,10 @@ import {
|
|
|
8
8
|
import "../../chunk-TGK5LP2H.js";
|
|
9
9
|
import {
|
|
10
10
|
Tooltip
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-JXKHN73X.js";
|
|
12
|
+
import "../../chunk-BMO4IZHV.js";
|
|
12
13
|
import "../../chunk-LRCAKRPK.js";
|
|
13
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-H7V2CGOB.js";
|
|
14
15
|
import "../../chunk-7RH7LJYB.js";
|
|
15
16
|
import "../../chunk-Z6EYKGBH.js";
|
|
16
17
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/DownloadCSV/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { getTranslations } from '../../store';\nimport { Link } from '../Link';\nimport { Modal } from '../Modal';\nimport ReCAPTCHA from 'react-google-recaptcha';\nimport iconInfo from '../../images/info.svg';\nimport { Tooltip } from '../Tooltip';\n\nexport const DownloadCSV = ({ url: outerUrl }: { url: string }) => {\n const { t, i18n } = useTranslation();\n const [recaptchaVisible, setRecaptchaVisible] = useState(false);\n const translations = getTranslations();\n\n const handleRecaptchaModalClose = () => setRecaptchaVisible(false);\n const onRecaptchaChange = (value: string | null) => {\n if (value) {\n // download csv file\n window.open(outerUrl);\n\n setRecaptchaVisible(false);\n }\n };\n const handleDownloadCSV = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n setRecaptchaVisible(true);\n };\n\n return (\n <div className=\"text-right mb-[-1rem]\">\n <Tooltip\n className=\"inline-block pr-[0.2857rem] w-[1.2857rem] cursor-pointer\"\n title={t(translations.general.downloadCSV.latest5000records)}\n >\n <img\n src={iconInfo}\n alt=\"warning-icon\"\n className=\"mt-[-0.2857rem]\"\n ></img>\n </Tooltip>\n <span>{t(translations.general.downloadCSV.download)} </span>\n <Link onClick={handleDownloadCSV}>\n {t(translations.general.downloadCSV.csvFile)}\n </Link>\n <Modal\n open={recaptchaVisible}\n onClose={handleRecaptchaModalClose}\n closable\n width={'26.0714rem'}\n >\n <ReCAPTCHA\n sitekey=\"6Lf4-wYrAAAAAEyOeqFdmh124oUt4PjJSEVNk3NK\"\n onChange={onRecaptchaChange}\n hl={i18n.language.indexOf('en') > -1 ? 'en' : 'zh'}\n />\n </Modal>\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/DownloadCSV/index.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { getTranslations } from '../../store';\nimport { Link } from '../Link';\nimport { Modal } from '../Modal';\nimport ReCAPTCHA from 'react-google-recaptcha';\nimport iconInfo from '../../images/info.svg';\nimport { Tooltip } from '../Tooltip';\n\nexport const DownloadCSV = ({ url: outerUrl }: { url: string }) => {\n const { t, i18n } = useTranslation();\n const [recaptchaVisible, setRecaptchaVisible] = useState(false);\n const translations = getTranslations();\n\n const handleRecaptchaModalClose = () => setRecaptchaVisible(false);\n const onRecaptchaChange = (value: string | null) => {\n if (value) {\n // download csv file\n window.open(outerUrl);\n\n setRecaptchaVisible(false);\n }\n };\n const handleDownloadCSV = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.preventDefault();\n setRecaptchaVisible(true);\n };\n\n return (\n <div className=\"text-right mb-[-1rem]\">\n <Tooltip\n className=\"inline-block pr-[0.2857rem] w-[1.2857rem] cursor-pointer\"\n title={t(translations.general.downloadCSV.latest5000records)}\n >\n <img\n src={iconInfo}\n alt=\"warning-icon\"\n className=\"mt-[-0.2857rem]\"\n ></img>\n </Tooltip>\n <span>{t(translations.general.downloadCSV.download)} </span>\n <Link onClick={handleDownloadCSV}>\n {t(translations.general.downloadCSV.csvFile)}\n </Link>\n <Modal\n open={recaptchaVisible}\n onClose={handleRecaptchaModalClose}\n closable\n width={'26.0714rem'}\n >\n <ReCAPTCHA\n sitekey=\"6Lf4-wYrAAAAAEyOeqFdmh124oUt4PjJSEVNk3NK\"\n onChange={onRecaptchaChange}\n hl={i18n.language.indexOf('en') > -1 ? 'en' : 'zh'}\n />\n </Modal>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,gBAAgB;AAChC,SAAS,sBAAsB;AAI/B,OAAO,eAAe;AACtB,OAAO,cAAc;AA4Bb,cAMF,YANE;AAzBD,IAAM,cAAc,CAAC,EAAE,KAAK,SAAS,MAAuB;AACjE,QAAM,EAAE,GAAG,KAAK,IAAI,eAAe;AACnC,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,KAAK;AAC9D,QAAM,eAAe,gBAAgB;AAErC,QAAM,4BAA4B,MAAM,oBAAoB,KAAK;AACjE,QAAM,oBAAoB,CAAC,UAAyB;AAClD,QAAI,OAAO;AAET,aAAO,KAAK,QAAQ;AAEpB,0BAAoB,KAAK;AAAA,IAC3B;AAAA,EACF;AACA,QAAM,oBAAoB,CAAC,MAA2C;AACpE,MAAE,eAAe;AACjB,wBAAoB,IAAI;AAAA,EAC1B;AAEA,SACE,qBAAC,SAAI,WAAU,yBACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO,EAAE,aAAa,QAAQ,YAAY,iBAAiB;AAAA,QAE3D;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL,KAAI;AAAA,YACJ,WAAU;AAAA;AAAA,QACX;AAAA;AAAA,IACH;AAAA,IACA,qBAAC,UAAM;AAAA,QAAE,aAAa,QAAQ,YAAY,QAAQ;AAAA,MAAE;AAAA,OAAC;AAAA,IACrD,oBAAC,QAAK,SAAS,mBACZ,YAAE,aAAa,QAAQ,YAAY,OAAO,GAC7C;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,SAAS;AAAA,QACT,UAAQ;AAAA,QACR,OAAO;AAAA,QAEP;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,UAAU;AAAA,YACV,IAAI,KAAK,SAAS,QAAQ,IAAI,IAAI,KAAK,OAAO;AAAA;AAAA,QAChD;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button_default
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-27GSITHB.js";
|
|
3
|
+
} from "../../chunk-WML236LE.js";
|
|
5
4
|
import "../../chunk-6UM5Y3SL.js";
|
|
5
|
+
import "../../chunk-27GSITHB.js";
|
|
6
6
|
import "../../chunk-3GGF3ULC.js";
|
|
7
7
|
|
|
8
8
|
// src/components/Dropdown/index.tsx
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/components/Icons/index.tsx
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
var ArrowDown = (props) => /* @__PURE__ */ jsxs(
|
|
4
|
+
"svg",
|
|
5
|
+
{
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: "16",
|
|
8
|
+
height: "16",
|
|
9
|
+
viewBox: "0 0 16 16",
|
|
10
|
+
fill: "none",
|
|
11
|
+
...props,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_7684_174)", children: [
|
|
14
|
+
/* @__PURE__ */ jsx("rect", { width: "16", height: "16", rx: "2", fill: "#7789D3", fillOpacity: "0.08" }),
|
|
15
|
+
/* @__PURE__ */ jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
d: "M4 6L8 10L12 6",
|
|
19
|
+
stroke: "#9B9EAC",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_7684_174", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var Add = (props) => /* @__PURE__ */ jsxs(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
width: "16",
|
|
34
|
+
height: "16",
|
|
35
|
+
viewBox: "0 0 16 16",
|
|
36
|
+
fill: "none",
|
|
37
|
+
...props,
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_7684_167)", children: [
|
|
40
|
+
/* @__PURE__ */ jsx("rect", { width: "16", height: "16", rx: "2", fill: "#7789D3", fillOpacity: "0.08" }),
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
"path",
|
|
43
|
+
{
|
|
44
|
+
d: "M4 8H12",
|
|
45
|
+
stroke: "#9B9EAC",
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round"
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
/* @__PURE__ */ jsx(
|
|
51
|
+
"path",
|
|
52
|
+
{
|
|
53
|
+
d: "M8 4L8 12",
|
|
54
|
+
stroke: "#9B9EAC",
|
|
55
|
+
strokeLinecap: "round",
|
|
56
|
+
strokeLinejoin: "round"
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_7684_167", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
export {
|
|
65
|
+
Add,
|
|
66
|
+
ArrowDown
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Icons/index.tsx"],"sourcesContent":["export const ArrowDown: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n {...props}\n >\n <g clipPath=\"url(#clip0_7684_174)\">\n <rect width=\"16\" height=\"16\" rx=\"2\" fill=\"#7789D3\" fillOpacity=\"0.08\" />\n <path\n d=\"M4 6L8 10L12 6\"\n stroke=\"#9B9EAC\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_7684_174\">\n <rect width=\"16\" height=\"16\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n\nexport const Add: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n {...props}\n >\n <g clipPath=\"url(#clip0_7684_167)\">\n <rect width=\"16\" height=\"16\" rx=\"2\" fill=\"#7789D3\" fillOpacity=\"0.08\" />\n <path\n d=\"M4 8H12\"\n stroke=\"#9B9EAC\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M8 4L8 12\"\n stroke=\"#9B9EAC\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </g>\n <defs>\n <clipPath id=\"clip0_7684_167\">\n <rect width=\"16\" height=\"16\" fill=\"white\" />\n </clipPath>\n </defs>\n </svg>\n);\n"],"mappings":";AASI,SACE,KADF;AATG,IAAM,YAAqD,WAChE;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAG;AAAA,IAEJ;AAAA,2BAAC,OAAE,UAAS,wBACV;AAAA,4BAAC,UAAK,OAAM,MAAK,QAAO,MAAK,IAAG,KAAI,MAAK,WAAU,aAAY,QAAO;AAAA,QACtE;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,QAAO;AAAA,YACP,eAAc;AAAA,YACd,gBAAe;AAAA;AAAA,QACjB;AAAA,SACF;AAAA,MACA,oBAAC,UACC,8BAAC,cAAS,IAAG,kBACX,8BAAC,UAAK,OAAM,MAAK,QAAO,MAAK,MAAK,SAAQ,GAC5C,GACF;AAAA;AAAA;AACF;AAGK,IAAM,MAA+C,WAC1D;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAG;AAAA,IAEJ;AAAA,2BAAC,OAAE,UAAS,wBACV;AAAA,4BAAC,UAAK,OAAM,MAAK,QAAO,MAAK,IAAG,KAAI,MAAK,WAAU,aAAY,QAAO;AAAA,QACtE;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,QAAO;AAAA,YACP,eAAc;AAAA,YACd,gBAAe;AAAA;AAAA,QACjB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,GAAE;AAAA,YACF,QAAO;AAAA,YACP,eAAc;AAAA,YACd,gBAAe;AAAA;AAAA,QACjB;AAAA,SACF;AAAA,MACA,oBAAC,UACC,8BAAC,cAAS,IAAG,kBACX,8BAAC,UAAK,OAAM,MAAK,QAAO,MAAK,MAAK,SAAQ,GAC5C,GACF;AAAA;AAAA;AACF;","names":[]}
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
} from "../../chunk-65X53DMW.js";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-JXKHN73X.js";
|
|
7
|
+
import "../../chunk-BMO4IZHV.js";
|
|
7
8
|
import "../../chunk-LRCAKRPK.js";
|
|
8
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-H7V2CGOB.js";
|
|
9
10
|
import "../../chunk-7RH7LJYB.js";
|
|
10
11
|
import "../../chunk-Z6EYKGBH.js";
|
|
11
12
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/InfoIconWithTooltip/index.tsx"],"sourcesContent":["import React from 'react';\nimport { InfoIcon } from './InfoIcon';\nimport { Tooltip } from '../Tooltip';\nimport clsx from 'clsx';\n\nexport const InfoIconWithTooltip = ({\n info,\n size = 14,\n children = null,\n}: {\n info: React.ReactNode;\n size?: number;\n children?: React.ReactNode;\n}) => {\n const title =\n typeof info === 'string'\n ? info.split('\\n').map(i => <div key={i}>{i}</div>)\n : info;\n return (\n <span className={clsx('inline-flex items-center')}>\n {children ? <span className=\"mr-0.2857rem\">{children}</span> : null}\n <Tooltip title={title}>\n <span>\n <InfoIcon size={size} />\n </span>\n </Tooltip>\n </span>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/InfoIconWithTooltip/index.tsx"],"sourcesContent":["import React from 'react';\nimport { InfoIcon } from './InfoIcon';\nimport { Tooltip } from '../Tooltip';\nimport clsx from 'clsx';\n\nexport const InfoIconWithTooltip = ({\n info,\n size = 14,\n children = null,\n}: {\n info: React.ReactNode;\n size?: number;\n children?: React.ReactNode;\n}) => {\n const title =\n typeof info === 'string'\n ? info.split('\\n').map(i => <div key={i}>{i}</div>)\n : info;\n return (\n <span className={clsx('inline-flex items-center')}>\n {children ? <span className=\"mr-0.2857rem\">{children}</span> : null}\n <Tooltip title={title}>\n <span>\n <InfoIcon size={size} />\n </span>\n </Tooltip>\n </span>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAGA,OAAO,UAAU;AAaiB,cAG9B,YAH8B;AAX3B,IAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA,OAAO;AAAA,EACP,WAAW;AACb,MAIM;AACJ,QAAM,QACJ,OAAO,SAAS,WACZ,KAAK,MAAM,IAAI,EAAE,IAAI,OAAK,oBAAC,SAAa,eAAJ,CAAM,CAAM,IAChD;AACN,SACE,qBAAC,UAAK,WAAW,KAAK,0BAA0B,GAC7C;AAAA,eAAW,oBAAC,UAAK,WAAU,gBAAgB,UAAS,IAAU;AAAA,IAC/D,oBAAC,WAAQ,OACP,8BAAC,UACC,8BAAC,YAAS,MAAY,GACxB,GACF;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Modal
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-OQCPL2OI.js";
|
|
4
4
|
import "../../chunk-XCKMXAL2.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-H7V2CGOB.js";
|
|
6
6
|
import "../../chunk-7RH7LJYB.js";
|
|
7
7
|
import "../../chunk-Z6EYKGBH.js";
|
|
8
8
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
} from "../../chunk-KKR2JERD.js";
|
|
7
7
|
import {
|
|
8
8
|
Tooltip
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-JXKHN73X.js";
|
|
10
|
+
import "../../chunk-BMO4IZHV.js";
|
|
10
11
|
import "../../chunk-LRCAKRPK.js";
|
|
11
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-H7V2CGOB.js";
|
|
12
13
|
import "../../chunk-7RH7LJYB.js";
|
|
13
14
|
import "../../chunk-Z6EYKGBH.js";
|
|
14
15
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PhishingAddressContainer/index.tsx"],"sourcesContent":["import { getTranslations } from 'src/store';\nimport { Tooltip } from '../Tooltip';\nimport { PhishingWarningIcon } from './PhishingWarningIcon';\nimport { Trans } from 'react-i18next';\nimport { useMemo } from 'react';\nimport { convertCheckSum } from 'src/utils/address';\n\nexport interface PhishingData {\n key: string;\n regex: RegExp;\n list: {\n address: string;\n list: [string, string, string];\n }[];\n}\n\nexport const formatListResponseWithPhishingInfo = <\n T extends Record<string, unknown>,\n>(\n response: T,\n) => {\n if (!response || !response.phishingInfo || !response.list) {\n return response;\n }\n const phishingInfo = response.phishingInfo as Record<string, string[]>;\n const phishingRegex = Object.keys(phishingInfo).reduce((acc, key) => {\n const value = phishingInfo[key] || [];\n if (!Array.isArray(value) || value.length <= 1) {\n return acc;\n }\n const [start = '', end = ''] = key.split('...');\n const regex = new RegExp(`^(${start})(.*)(${end})$`, 'i');\n acc.push({\n key,\n regex,\n list: value.map(item => {\n const [_, start = '', middle = '', end = ''] =\n convertCheckSum(item).match(regex) || [];\n return {\n address: item,\n list: [start, middle, end],\n };\n }),\n });\n return acc;\n }, [] as PhishingData[]);\n if (phishingRegex.length === 0) {\n return response;\n }\n return {\n ...response,\n list: (response.list as Record<string, unknown>[]).map(item => {\n const fromPhishingData = phishingRegex.find(p =>\n p.regex.test((item.from || '') as string),\n );\n const toPhishingData = phishingRegex.find(p =>\n p.regex.test((item.to || '') as string),\n );\n return {\n ...item,\n fromPhishingData,\n toPhishingData,\n };\n }),\n };\n};\n\nconst PhishingAddress: React.FC<{\n start: string;\n end: string;\n middle: string;\n}> = ({ start, end, middle }) => {\n return (\n <span>\n <span className=\"text-#FFBB37\">{start}</span>\n <span>{middle}</span>\n <span className=\"text-#FFBB37\">{end}</span>\n </span>\n );\n};\n\nconst SimilarAddresses: React.FC<{\n list: [string, string, string][];\n}> = ({ list }) => {\n return (\n <div className=\"flex flex-col\">\n {list.map(item => (\n <PhishingAddress\n key={item[1]}\n start={item[0]}\n end={item[2]}\n middle={item[1]}\n />\n ))}\n </div>\n );\n};\n\nconst PhishingTooltip: React.FC<{\n phishingData: PhishingData;\n address: string;\n}> = ({ phishingData, address }) => {\n const translations = getTranslations();\n const { list: _list, key, regex } = phishingData;\n const { start, middle, end, list } = useMemo(() => {\n const [_, start = '', middle = '', end = ''] =\n convertCheckSum(address).match(regex) || [];\n return {\n start,\n middle,\n end,\n list: _list\n .filter(item => item.address.toLowerCase() !== address.toLowerCase())\n .map(item => item.list),\n };\n }, [address, key, _list]);\n\n return (\n <Tooltip\n className=\"flex items-center\"\n containerClassName=\"[&.sirius-next-tooltip>[data-part=content]]:text-10px\"\n title={\n <Trans i18nKey={translations.toolTip.phishingWarning}>\n <PhishingAddress start={start} end={end} middle={middle} />\n <SimilarAddresses list={list} />\n </Trans>\n }\n portalled\n >\n <PhishingWarningIcon className=\"text-#FFBB37\" />\n </Tooltip>\n );\n};\n\nexport const PhishingAddressContainer: React.FC<\n React.PropsWithChildren & {\n address?: string;\n phishingData?: PhishingData;\n }\n> = ({ children, phishingData, address }) => {\n if (address && phishingData && phishingData.list.length > 0) {\n return (\n <div className=\"flex items-center\">\n <PhishingTooltip phishingData={phishingData} address={address} />\n {children}\n </div>\n );\n }\n return children;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/PhishingAddressContainer/index.tsx"],"sourcesContent":["import { getTranslations } from 'src/store';\nimport { Tooltip } from '../Tooltip';\nimport { PhishingWarningIcon } from './PhishingWarningIcon';\nimport { Trans } from 'react-i18next';\nimport { useMemo } from 'react';\nimport { convertCheckSum } from 'src/utils/address';\n\nexport interface PhishingData {\n key: string;\n regex: RegExp;\n list: {\n address: string;\n list: [string, string, string];\n }[];\n}\n\nexport const formatListResponseWithPhishingInfo = <\n T extends Record<string, unknown>,\n>(\n response: T,\n) => {\n if (!response || !response.phishingInfo || !response.list) {\n return response;\n }\n const phishingInfo = response.phishingInfo as Record<string, string[]>;\n const phishingRegex = Object.keys(phishingInfo).reduce((acc, key) => {\n const value = phishingInfo[key] || [];\n if (!Array.isArray(value) || value.length <= 1) {\n return acc;\n }\n const [start = '', end = ''] = key.split('...');\n const regex = new RegExp(`^(${start})(.*)(${end})$`, 'i');\n acc.push({\n key,\n regex,\n list: value.map(item => {\n const [_, start = '', middle = '', end = ''] =\n convertCheckSum(item).match(regex) || [];\n return {\n address: item,\n list: [start, middle, end],\n };\n }),\n });\n return acc;\n }, [] as PhishingData[]);\n if (phishingRegex.length === 0) {\n return response;\n }\n return {\n ...response,\n list: (response.list as Record<string, unknown>[]).map(item => {\n const fromPhishingData = phishingRegex.find(p =>\n p.regex.test((item.from || '') as string),\n );\n const toPhishingData = phishingRegex.find(p =>\n p.regex.test((item.to || '') as string),\n );\n return {\n ...item,\n fromPhishingData,\n toPhishingData,\n };\n }),\n };\n};\n\nconst PhishingAddress: React.FC<{\n start: string;\n end: string;\n middle: string;\n}> = ({ start, end, middle }) => {\n return (\n <span>\n <span className=\"text-#FFBB37\">{start}</span>\n <span>{middle}</span>\n <span className=\"text-#FFBB37\">{end}</span>\n </span>\n );\n};\n\nconst SimilarAddresses: React.FC<{\n list: [string, string, string][];\n}> = ({ list }) => {\n return (\n <div className=\"flex flex-col\">\n {list.map(item => (\n <PhishingAddress\n key={item[1]}\n start={item[0]}\n end={item[2]}\n middle={item[1]}\n />\n ))}\n </div>\n );\n};\n\nconst PhishingTooltip: React.FC<{\n phishingData: PhishingData;\n address: string;\n}> = ({ phishingData, address }) => {\n const translations = getTranslations();\n const { list: _list, key, regex } = phishingData;\n const { start, middle, end, list } = useMemo(() => {\n const [_, start = '', middle = '', end = ''] =\n convertCheckSum(address).match(regex) || [];\n return {\n start,\n middle,\n end,\n list: _list\n .filter(item => item.address.toLowerCase() !== address.toLowerCase())\n .map(item => item.list),\n };\n }, [address, key, _list]);\n\n return (\n <Tooltip\n className=\"flex items-center\"\n containerClassName=\"[&.sirius-next-tooltip>[data-part=content]]:text-10px\"\n title={\n <Trans i18nKey={translations.toolTip.phishingWarning}>\n <PhishingAddress start={start} end={end} middle={middle} />\n <SimilarAddresses list={list} />\n </Trans>\n }\n portalled\n >\n <PhishingWarningIcon className=\"text-#FFBB37\" />\n </Tooltip>\n );\n};\n\nexport const PhishingAddressContainer: React.FC<\n React.PropsWithChildren & {\n address?: string;\n phishingData?: PhishingData;\n }\n> = ({ children, phishingData, address }) => {\n if (address && phishingData && phishingData.list.length > 0) {\n return (\n <div className=\"flex items-center\">\n <PhishingTooltip phishingData={phishingData} address={address} />\n {children}\n </div>\n );\n }\n return children;\n};\n"],"mappings":"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","names":["start","end","middle"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React__default, { ComponentProps, HTMLAttributes } from 'react';
|
|
2
|
+
import _Popover from '@cfx-kit/ui-components/dist/Popover';
|
|
3
|
+
|
|
4
|
+
interface PopoverProps extends Omit<ComponentProps<typeof _Popover>, 'trigger'> {
|
|
5
|
+
containerClassName?: string;
|
|
6
|
+
content?: React__default.ReactNode;
|
|
7
|
+
children?: React__default.ReactNode;
|
|
8
|
+
triggerProps?: HTMLAttributes<HTMLElement>;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
declare const Popover: React__default.FC<PopoverProps>;
|
|
12
|
+
|
|
13
|
+
export { Popover, PopoverProps };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Popover
|
|
3
|
+
} from "../../chunk-3PF5QYAQ.js";
|
|
4
|
+
import "../../chunk-BMO4IZHV.js";
|
|
5
|
+
import "../../chunk-LRCAKRPK.js";
|
|
6
|
+
import "../../chunk-H7V2CGOB.js";
|
|
7
|
+
import "../../chunk-7RH7LJYB.js";
|
|
8
|
+
import "../../chunk-Z6EYKGBH.js";
|
|
9
|
+
import "../../chunk-J2I22Q2M.js";
|
|
10
|
+
import "../../chunk-YEUH2K6Z.js";
|
|
11
|
+
import "../../chunk-DQGLZCIG.js";
|
|
12
|
+
export {
|
|
13
|
+
Popover
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-JXKHN73X.js";
|
|
4
|
+
import "../../chunk-BMO4IZHV.js";
|
|
4
5
|
import "../../chunk-LRCAKRPK.js";
|
|
5
6
|
import {
|
|
6
7
|
formatPrice
|
|
7
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-H7V2CGOB.js";
|
|
8
9
|
import "../../chunk-7RH7LJYB.js";
|
|
9
10
|
import "../../chunk-Z6EYKGBH.js";
|
|
10
11
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["/**\n *\n * Footer\n *\n */\nimport React from 'react';\nimport { formatPrice } from '../../utils';\nimport { Tooltip } from '../Tooltip';\n\nexport const Price = ({\n children,\n showTooltip = true,\n}: {\n children: string | number;\n showTooltip?: boolean;\n}) => {\n if (['NaN', 'undefined', 'null'].includes(String(children))) {\n return <span>--</span>;\n }\n\n const [fPrice, fullPrice] = formatPrice(children);\n\n return fullPrice && showTooltip ? (\n <Tooltip\n title={\n <span\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n {fullPrice}\n </span>\n }\n >\n <span>{fPrice}</span>\n </Tooltip>\n ) : (\n <span>{fPrice}</span>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["/**\n *\n * Footer\n *\n */\nimport React from 'react';\nimport { formatPrice } from '../../utils';\nimport { Tooltip } from '../Tooltip';\n\nexport const Price = ({\n children,\n showTooltip = true,\n}: {\n children: string | number;\n showTooltip?: boolean;\n}) => {\n if (['NaN', 'undefined', 'null'].includes(String(children))) {\n return <span>--</span>;\n }\n\n const [fPrice, fullPrice] = formatPrice(children);\n\n return fullPrice && showTooltip ? (\n <Tooltip\n title={\n <span\n style={{\n whiteSpace: 'nowrap',\n }}\n >\n {fullPrice}\n </span>\n }\n >\n <span>{fPrice}</span>\n </Tooltip>\n ) : (\n <span>{fPrice}</span>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAiBW;AARJ,IAAM,QAAQ,CAAC;AAAA,EACpB;AAAA,EACA,cAAc;AAChB,MAGM;AACJ,MAAI,CAAC,OAAO,aAAa,MAAM,EAAE,SAAS,OAAO,QAAQ,CAAC,GAAG;AAC3D,WAAO,oBAAC,UAAK,gBAAE;AAAA,EACjB;AAEA,QAAM,CAAC,QAAQ,SAAS,IAAI,YAAY,QAAQ;AAEhD,SAAO,aAAa,cAClB;AAAA,IAAC;AAAA;AAAA,MACC,OACE;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,YAAY;AAAA,UACd;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,MAGF,8BAAC,UAAM,kBAAO;AAAA;AAAA,EAChB,IAEA,oBAAC,UAAM,kBAAO;AAElB;","names":[]}
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
SelectItem,
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-BVED57CI.js";
|
|
9
9
|
import "../../chunk-LRCAKRPK.js";
|
|
10
10
|
import {
|
|
11
11
|
cn
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-H7V2CGOB.js";
|
|
13
13
|
import "../../chunk-7RH7LJYB.js";
|
|
14
14
|
import "../../chunk-Z6EYKGBH.js";
|
|
15
15
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
SelectSeparator,
|
|
9
9
|
SelectTrigger,
|
|
10
10
|
SelectValue
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-BVED57CI.js";
|
|
12
12
|
import "../../chunk-LRCAKRPK.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-H7V2CGOB.js";
|
|
14
14
|
import "../../chunk-7RH7LJYB.js";
|
|
15
15
|
import "../../chunk-Z6EYKGBH.js";
|
|
16
16
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Text
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-W7ZK4OQA.js";
|
|
4
4
|
import "../../chunk-TOKKKTFG.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-JXKHN73X.js";
|
|
6
|
+
import "../../chunk-BMO4IZHV.js";
|
|
6
7
|
import "../../chunk-LRCAKRPK.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
+
import "../../chunk-H7V2CGOB.js";
|
|
8
9
|
import "../../chunk-7RH7LJYB.js";
|
|
9
10
|
import "../../chunk-Z6EYKGBH.js";
|
|
10
11
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tooltip
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-JXKHN73X.js";
|
|
4
|
+
import "../../chunk-BMO4IZHV.js";
|
|
4
5
|
import "../../chunk-LRCAKRPK.js";
|
|
5
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-H7V2CGOB.js";
|
|
6
7
|
import "../../chunk-7RH7LJYB.js";
|
|
7
8
|
import "../../chunk-Z6EYKGBH.js";
|
|
8
9
|
import "../../chunk-J2I22Q2M.js";
|
|
@@ -10,19 +10,20 @@ import {
|
|
|
10
10
|
import "../../chunk-TGK5LP2H.js";
|
|
11
11
|
import {
|
|
12
12
|
CoreAddressContainer
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-3CHXTO52.js";
|
|
14
14
|
import "../../chunk-EYT54RGS.js";
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-XZQWPTKA.js";
|
|
16
|
+
import "../../chunk-52R454XN.js";
|
|
17
17
|
import "../../chunk-KKR2JERD.js";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-CKOT4CK7.js";
|
|
19
|
+
import "../../chunk-W7ZK4OQA.js";
|
|
20
20
|
import "../../chunk-TOKKKTFG.js";
|
|
21
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-JXKHN73X.js";
|
|
22
|
+
import "../../chunk-BMO4IZHV.js";
|
|
22
23
|
import "../../chunk-LRCAKRPK.js";
|
|
23
24
|
import {
|
|
24
25
|
formatBalance
|
|
25
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-H7V2CGOB.js";
|
|
26
27
|
import "../../chunk-7RH7LJYB.js";
|
|
27
28
|
import {
|
|
28
29
|
reqContractAndToken,
|