@cfxjs/sirius-next-common 0.3.6 → 0.4.0
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-6KK5HI4P.js → chunk-2BLHJLZO.js} +6 -6
- package/dist/{chunk-B3JBVHRM.js → chunk-2RVLHSYV.js} +4 -4
- package/dist/{chunk-FGRQ4ZLK.js → chunk-2T3VTZXW.js} +4 -4
- package/dist/{chunk-3ICCM4IY.js → chunk-2WY3J56A.js} +2 -2
- package/dist/{chunk-6ZBEHPM3.js → chunk-2ZR25NMU.js} +2 -2
- package/dist/{chunk-PQGWNL22.js → chunk-36EB4LRH.js} +4 -4
- package/dist/{chunk-YNAGSMY4.js → chunk-3XNQKM2D.js} +2 -2
- package/dist/{chunk-VAJYEHTC.js → chunk-4MEAKY73.js} +2 -2
- package/dist/{chunk-ZNYSNETG.js → chunk-4MVQ3JTN.js} +2 -2
- package/dist/{chunk-FG544Z6M.js → chunk-6XQWKKL5.js} +8 -8
- package/dist/{chunk-TAA65LM3.js → chunk-7FIPVSHQ.js} +2 -2
- package/dist/chunk-7IYCCOGO.js +20 -0
- package/dist/chunk-7IYCCOGO.js.map +1 -0
- package/dist/{chunk-UNFMF6PD.js → chunk-B74PZXOZ.js} +7 -7
- package/dist/{chunk-ZBRC5EH7.js → chunk-CTCBKNSN.js} +3 -3
- package/dist/{chunk-RPSV2GNQ.js → chunk-D5HJCIRL.js} +2 -2
- package/dist/{chunk-72GJNVP4.js → chunk-EGXD2GDI.js} +3 -3
- package/dist/chunk-EGXD2GDI.js.map +1 -0
- package/dist/{chunk-FINM6TKG.js → chunk-EIDH56XO.js} +6 -6
- package/dist/{chunk-5DFWDFAH.js → chunk-EWGQW5BF.js} +2 -2
- package/dist/{chunk-NSSVN52T.js → chunk-GGLZLKNJ.js} +6 -6
- package/dist/{chunk-NF7GYQG6.js → chunk-GPHUCEN2.js} +2 -2
- package/dist/{chunk-YCMDHTTU.js → chunk-HHJWVVJC.js} +1 -1
- package/dist/chunk-HHJWVVJC.js.map +1 -0
- package/dist/{chunk-V3GMPX56.js → chunk-I36TYEEM.js} +2 -2
- package/dist/{chunk-DL3DLAMH.js → chunk-LMY5VYFP.js} +2 -2
- package/dist/{chunk-DADUZ3EO.js → chunk-LUHISU5F.js} +2 -2
- package/dist/{chunk-BRN6FDQC.js → chunk-LZF26HB6.js} +2 -2
- package/dist/{chunk-NUPJAGZZ.js → chunk-M7G2HHUU.js} +32 -9
- package/dist/chunk-M7G2HHUU.js.map +1 -0
- package/dist/{chunk-VFCQE5LC.js → chunk-NBMABBMG.js} +5 -5
- package/dist/{chunk-RHRATSWJ.js → chunk-OAUFBUYV.js} +5 -5
- package/dist/{chunk-5KPBXHB7.js → chunk-ODPPKXIV.js} +3 -3
- package/dist/{chunk-ZZLGINAC.js → chunk-ON5OBLMV.js} +22 -12
- package/dist/chunk-ON5OBLMV.js.map +1 -0
- package/dist/{chunk-2HMA7IBM.js → chunk-OUQEXLFQ.js} +3 -3
- package/dist/{chunk-XHSYE74K.js → chunk-OVGNIKRY.js} +3 -3
- package/dist/{chunk-SWQBFWF6.js → chunk-QCA4QRD4.js} +2 -2
- package/dist/{chunk-GI3265DN.js → chunk-QL4NKKTA.js} +2 -2
- package/dist/{chunk-EXTUS5TC.js → chunk-RK632STC.js} +5 -5
- package/dist/{chunk-Z3GOXWTO.js → chunk-RX44WEW6.js} +5 -5
- package/dist/{chunk-POB5MNTV.js → chunk-S2C6VOUJ.js} +2 -2
- package/dist/{chunk-3MT7JGRQ.js → chunk-TAEXZ5LI.js} +2 -2
- package/dist/{chunk-3TLAXDXL.js → chunk-TIWELXT7.js} +5 -5
- package/dist/{chunk-2Y57U43P.js → chunk-TPUZ46LY.js} +2 -2
- package/dist/{chunk-F773S4VE.js → chunk-TTMMIWXR.js} +3 -3
- package/dist/chunk-TTMMIWXR.js.map +1 -0
- package/dist/{chunk-JONZIRMN.js → chunk-UBHTXZWS.js} +2 -2
- package/dist/{chunk-2VQWB562.js → chunk-WYM7FWXA.js} +2 -2
- package/dist/{chunk-TGK5LP2H.js → chunk-X35GBAUQ.js} +1 -1
- package/dist/chunk-X35GBAUQ.js.map +1 -0
- package/dist/{chunk-BXD6FXE7.js → chunk-XGSBVC7P.js} +2 -2
- package/dist/{chunk-OH6PXF7K.js → chunk-XIQH26WA.js} +2 -2
- package/dist/{chunk-OBQKDJXW.js → chunk-XJPWKT2J.js} +3 -3
- package/dist/{chunk-G24GHQO6.js → chunk-YL3I4UMA.js} +5 -5
- package/dist/{chunk-Q4J2MT7G.js → chunk-YLBHOAH5.js} +3 -3
- package/dist/{chunk-7UH332LS.js → chunk-ZUO2WVSN.js} +2 -2
- package/dist/components/AAFailedReason/index.js +9 -9
- package/dist/components/AceEditor/index.js +6 -6
- package/dist/components/AddressContainer/CoreAddressContainer.js +12 -12
- package/dist/components/AddressContainer/EVMAddressContainer.js +11 -11
- package/dist/components/AddressContainer/addressSwitcher.js +9 -9
- package/dist/components/AddressContainer/addressView.js +8 -8
- package/dist/components/AddressContainer/label.js +5 -5
- package/dist/components/AddressContainer/utils.js +5 -5
- package/dist/components/Age/index.js +6 -6
- package/dist/components/AutoComplete/index.js +5 -5
- package/dist/components/Charts/BreadcrumbNav.js +3 -3
- package/dist/components/Charts/PreviewChartTemplate.js +5 -5
- package/dist/components/Charts/PreviewTitle.js +3 -3
- package/dist/components/Charts/StockChartTemplate.js +5 -5
- package/dist/components/ContractAbi/IntValueFormatter.js +7 -7
- package/dist/components/ContractAbi/ParamTitle.js +7 -7
- package/dist/components/ContractAbi/index.js +11 -11
- package/dist/components/ContractAbi/utils.js +5 -5
- package/dist/components/CookieTip/index.js +1 -1
- package/dist/components/CopyButton/index.js +5 -5
- package/dist/components/DecimalsSelect/index.js +6 -6
- package/dist/components/DownloadCSV/index.js +8 -8
- package/dist/components/GasPriceDropdown/index.js +4 -4
- package/dist/components/IncreasePercent/index.js +4 -4
- package/dist/components/InfoIconWithTooltip/index.js +6 -6
- package/dist/components/InputData/AbiWarning.js +3 -3
- package/dist/components/InputData/AddressLabel.js +10 -10
- package/dist/components/InputData/ContractDetail.js +9 -9
- package/dist/components/InputData/JsonDecode.js +7 -7
- package/dist/components/InputData/OptimizationDecode.js +16 -16
- package/dist/components/InputData/Original.js +5 -5
- package/dist/components/InputData/UTF8.js +5 -5
- package/dist/components/InputData/index.js +21 -21
- package/dist/components/Link/index.js +2 -2
- package/dist/components/Modal/index.js +5 -5
- package/dist/components/NetworkIcon/index.js +4 -4
- package/dist/components/OutputData/ErrorDecode.js +24 -24
- package/dist/components/OutputData/index.js +26 -26
- package/dist/components/PhishingAddressContainer/index.js +6 -6
- package/dist/components/Popover/index.js +5 -5
- package/dist/components/Price/index.js +5 -5
- package/dist/components/ProxyContractAddress/index.js +10 -10
- package/dist/components/Radio/index.js +4 -4
- package/dist/components/SearchInput/index.js +6 -6
- package/dist/components/Select/index.js +6 -6
- package/dist/components/Select/select.js +5 -5
- package/dist/components/SmartAccountAddress/index.js +10 -10
- package/dist/components/Text/index.js +6 -6
- package/dist/components/Tooltip/index.js +5 -5
- package/dist/components/TransactionAction/coreTransactionAction.js +14 -14
- package/dist/components/TransactionAction/evmTransactionAction.js +13 -13
- package/dist/components/TransactionTrace/TraceDetail.js +34 -34
- package/dist/components/TransactionTrace/TreeTraceTable.js +35 -35
- package/dist/components/TransactionTrace/index.js +35 -35
- package/dist/utils/address.js +4 -4
- package/dist/utils/addressLabel.d.ts +16 -0
- package/dist/utils/addressLabel.js +42 -0
- package/dist/utils/addressLabel.js.map +1 -0
- package/dist/utils/cive-plugins.js +2 -2
- package/dist/utils/constants.d.ts +5 -3
- package/dist/utils/constants.js +1 -1
- package/dist/utils/contractManagerTool.js +4 -4
- package/dist/utils/ga.js +1 -1
- package/dist/utils/hooks/useAbiItemById.js +3 -3
- package/dist/utils/hooks/useAddressLabel.js +5 -5
- package/dist/utils/hooks/useAddressNameMap.js +3 -3
- package/dist/utils/hooks/useAge.js +1 -1
- package/dist/utils/hooks/useAutoSetHolderFilterParams.js +4 -4
- package/dist/utils/hooks/useContractDetail.js +3 -3
- package/dist/utils/hooks/useContractsStatistics.js +2 -2
- package/dist/utils/hooks/useDecodeFunctionData.js +9 -9
- package/dist/utils/hooks/useDecodeFunctionError.js +9 -9
- package/dist/utils/hooks/useENS.js +5 -5
- package/dist/utils/hooks/useEnhanceDataWithNameMap.js +3 -3
- package/dist/utils/hooks/useMethodAbi.js +3 -3
- package/dist/utils/hooks/useSimulateTrace.js +8 -8
- package/dist/utils/hooks/useTableData.js +2 -2
- package/dist/utils/hooks/useTxTrace.js +6 -6
- package/dist/utils/index.d.ts +9 -18
- package/dist/utils/index.js +4 -4
- package/dist/utils/privateText.d.ts +9 -0
- package/dist/utils/privateText.js +12 -0
- package/dist/utils/privateText.js.map +1 -0
- package/dist/utils/pubsub.js +1 -1
- package/dist/utils/request.js +2 -2
- package/dist/utils/rpcRequest.js +1 -1
- package/dist/utils/sdk.js +3 -3
- package/dist/utils/txNote.d.ts +12 -0
- package/dist/utils/txNote.js +41 -0
- package/dist/utils/txNote.js.map +1 -0
- package/package.json +17 -10
- package/dist/chunk-72GJNVP4.js.map +0 -1
- package/dist/chunk-F773S4VE.js.map +0 -1
- package/dist/chunk-NUPJAGZZ.js.map +0 -1
- package/dist/chunk-TGK5LP2H.js.map +0 -1
- package/dist/chunk-YCMDHTTU.js.map +0 -1
- package/dist/chunk-ZZLGINAC.js.map +0 -1
- /package/dist/{chunk-6KK5HI4P.js.map → chunk-2BLHJLZO.js.map} +0 -0
- /package/dist/{chunk-B3JBVHRM.js.map → chunk-2RVLHSYV.js.map} +0 -0
- /package/dist/{chunk-FGRQ4ZLK.js.map → chunk-2T3VTZXW.js.map} +0 -0
- /package/dist/{chunk-3ICCM4IY.js.map → chunk-2WY3J56A.js.map} +0 -0
- /package/dist/{chunk-6ZBEHPM3.js.map → chunk-2ZR25NMU.js.map} +0 -0
- /package/dist/{chunk-PQGWNL22.js.map → chunk-36EB4LRH.js.map} +0 -0
- /package/dist/{chunk-YNAGSMY4.js.map → chunk-3XNQKM2D.js.map} +0 -0
- /package/dist/{chunk-VAJYEHTC.js.map → chunk-4MEAKY73.js.map} +0 -0
- /package/dist/{chunk-ZNYSNETG.js.map → chunk-4MVQ3JTN.js.map} +0 -0
- /package/dist/{chunk-FG544Z6M.js.map → chunk-6XQWKKL5.js.map} +0 -0
- /package/dist/{chunk-TAA65LM3.js.map → chunk-7FIPVSHQ.js.map} +0 -0
- /package/dist/{chunk-UNFMF6PD.js.map → chunk-B74PZXOZ.js.map} +0 -0
- /package/dist/{chunk-ZBRC5EH7.js.map → chunk-CTCBKNSN.js.map} +0 -0
- /package/dist/{chunk-RPSV2GNQ.js.map → chunk-D5HJCIRL.js.map} +0 -0
- /package/dist/{chunk-FINM6TKG.js.map → chunk-EIDH56XO.js.map} +0 -0
- /package/dist/{chunk-5DFWDFAH.js.map → chunk-EWGQW5BF.js.map} +0 -0
- /package/dist/{chunk-NSSVN52T.js.map → chunk-GGLZLKNJ.js.map} +0 -0
- /package/dist/{chunk-NF7GYQG6.js.map → chunk-GPHUCEN2.js.map} +0 -0
- /package/dist/{chunk-V3GMPX56.js.map → chunk-I36TYEEM.js.map} +0 -0
- /package/dist/{chunk-DL3DLAMH.js.map → chunk-LMY5VYFP.js.map} +0 -0
- /package/dist/{chunk-DADUZ3EO.js.map → chunk-LUHISU5F.js.map} +0 -0
- /package/dist/{chunk-BRN6FDQC.js.map → chunk-LZF26HB6.js.map} +0 -0
- /package/dist/{chunk-VFCQE5LC.js.map → chunk-NBMABBMG.js.map} +0 -0
- /package/dist/{chunk-RHRATSWJ.js.map → chunk-OAUFBUYV.js.map} +0 -0
- /package/dist/{chunk-5KPBXHB7.js.map → chunk-ODPPKXIV.js.map} +0 -0
- /package/dist/{chunk-2HMA7IBM.js.map → chunk-OUQEXLFQ.js.map} +0 -0
- /package/dist/{chunk-XHSYE74K.js.map → chunk-OVGNIKRY.js.map} +0 -0
- /package/dist/{chunk-SWQBFWF6.js.map → chunk-QCA4QRD4.js.map} +0 -0
- /package/dist/{chunk-GI3265DN.js.map → chunk-QL4NKKTA.js.map} +0 -0
- /package/dist/{chunk-EXTUS5TC.js.map → chunk-RK632STC.js.map} +0 -0
- /package/dist/{chunk-Z3GOXWTO.js.map → chunk-RX44WEW6.js.map} +0 -0
- /package/dist/{chunk-POB5MNTV.js.map → chunk-S2C6VOUJ.js.map} +0 -0
- /package/dist/{chunk-3MT7JGRQ.js.map → chunk-TAEXZ5LI.js.map} +0 -0
- /package/dist/{chunk-3TLAXDXL.js.map → chunk-TIWELXT7.js.map} +0 -0
- /package/dist/{chunk-2Y57U43P.js.map → chunk-TPUZ46LY.js.map} +0 -0
- /package/dist/{chunk-JONZIRMN.js.map → chunk-UBHTXZWS.js.map} +0 -0
- /package/dist/{chunk-2VQWB562.js.map → chunk-WYM7FWXA.js.map} +0 -0
- /package/dist/{chunk-BXD6FXE7.js.map → chunk-XGSBVC7P.js.map} +0 -0
- /package/dist/{chunk-OH6PXF7K.js.map → chunk-XIQH26WA.js.map} +0 -0
- /package/dist/{chunk-OBQKDJXW.js.map → chunk-XJPWKT2J.js.map} +0 -0
- /package/dist/{chunk-G24GHQO6.js.map → chunk-YL3I4UMA.js.map} +0 -0
- /package/dist/{chunk-Q4J2MT7G.js.map → chunk-YLBHOAH5.js.map} +0 -0
- /package/dist/{chunk-7UH332LS.js.map → chunk-ZUO2WVSN.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
publishRequestError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ON5OBLMV.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchWithCache
|
|
6
6
|
} from "./chunk-YEINMVAR.js";
|
|
@@ -65,21 +65,44 @@ var fetchWithAbort = (url, options = {}) => {
|
|
|
65
65
|
const showErrorMessage = options.showErrorMessage ?? true;
|
|
66
66
|
const timeout = options.timeout || TIMEOUT_TIMESTAMP;
|
|
67
67
|
let timeoutId;
|
|
68
|
+
let settled = false;
|
|
68
69
|
const promise = new Promise((resolve, reject) => {
|
|
70
|
+
const resolveRequest = (value) => {
|
|
71
|
+
if (settled) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
settled = true;
|
|
75
|
+
resolve(value);
|
|
76
|
+
};
|
|
77
|
+
const rejectRequest = (reason) => {
|
|
78
|
+
if (settled) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
settled = true;
|
|
82
|
+
reject(reason);
|
|
83
|
+
};
|
|
69
84
|
timeoutId = setTimeout(() => {
|
|
85
|
+
if (settled) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
70
88
|
controller.abort();
|
|
71
89
|
if (isHeadRequest(opts)) {
|
|
72
|
-
return
|
|
90
|
+
return resolveRequest(
|
|
91
|
+
createHeadFailureResponse(408, "Request timeout")
|
|
92
|
+
);
|
|
73
93
|
}
|
|
74
94
|
showErrorMessage && publishRequestError(
|
|
75
95
|
{ url, code: 20002, message: "Request timeout" },
|
|
76
96
|
"http"
|
|
77
97
|
);
|
|
78
|
-
|
|
98
|
+
rejectRequest(new Error("Request timeout"));
|
|
79
99
|
}, timeout);
|
|
80
|
-
window.fetch(url, opts).then(checkStatus).then(parseJSON).then((...args) => checkResponse(url, ...args, opts)).then((data) =>
|
|
100
|
+
window.fetch(url, opts).then(checkStatus).then(parseJSON).then((...args) => checkResponse(url, ...args, opts)).then((data) => resolveRequest(data)).catch((error) => {
|
|
101
|
+
if (settled) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
81
104
|
if (isHeadRequest(opts)) {
|
|
82
|
-
return
|
|
105
|
+
return resolveRequest(
|
|
83
106
|
createHeadFailureResponse(
|
|
84
107
|
599,
|
|
85
108
|
error?.message || "Request failed"
|
|
@@ -88,19 +111,19 @@ var fetchWithAbort = (url, options = {}) => {
|
|
|
88
111
|
}
|
|
89
112
|
if (error.name === "TypeError") {
|
|
90
113
|
showErrorMessage && publishRequestError({ url, code: 20004 }, "http");
|
|
91
|
-
|
|
114
|
+
rejectRequest(new Error("Network error"));
|
|
92
115
|
} else if (error.name === "AbortError") {
|
|
93
116
|
showErrorMessage && publishRequestError(
|
|
94
117
|
{ url, code: 20003, message: "Fetch aborted" },
|
|
95
118
|
"http"
|
|
96
119
|
);
|
|
97
|
-
|
|
120
|
+
rejectRequest(new Error("Fetch aborted"));
|
|
98
121
|
} else {
|
|
99
122
|
showErrorMessage && publishRequestError(
|
|
100
123
|
{ url, code: error.status, message: error.message },
|
|
101
124
|
"http"
|
|
102
125
|
);
|
|
103
|
-
|
|
126
|
+
rejectRequest(error);
|
|
104
127
|
}
|
|
105
128
|
}).finally(() => clearTimeout(timeoutId));
|
|
106
129
|
});
|
|
@@ -318,4 +341,4 @@ export {
|
|
|
318
341
|
reqContractsStatistics,
|
|
319
342
|
reqVerifiedContractsStatistics
|
|
320
343
|
};
|
|
321
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-M7G2HHUU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/request.ts"],"sourcesContent":["import qs from 'query-string';\nimport { publishRequestError } from './pubsub';\nimport {\n AbiByIdResponse,\n AddressNameMap,\n BaseContractInfo,\n ContractsStatistics,\n DetectAccountTypeResponse,\n MethodAbiItemResponse,\n} from './request.types';\nimport { getEnvConfig } from '../store';\nimport { fetchWithCache } from './cache';\ninterface FetchWithAbortType<T> {\n promise: Promise<T>;\n abort: () => void;\n}\n\ninterface FetchOptions extends RequestInit {\n timeout?: number;\n showErrorMessage?: boolean;\n}\n\nconst TIMEOUT_TIMESTAMP = 60000;\n\nconst isHeadRequest = (opts?: FetchOptions) =>\n opts?.method?.toUpperCase() === 'HEAD';\n\nconst createHeadFailureResponse = (\n status: number,\n statusText: string,\n): Response => new Response(null, { status, statusText });\n\nconst checkStatus = (response: Response) => {\n if (\n (response.status >= 200 && response.status < 300) ||\n response.status === 600\n ) {\n return response;\n } else {\n const error = new Error(response.statusText);\n error.name = 'HttpError';\n (error as any).status = response.status;\n (error as any).response = response;\n throw error;\n }\n};\n\n// 格式化 response data\nconst parseJSON = async (response: Response) => {\n const contentType = response.headers.get('content-type');\n try {\n if (contentType?.includes('application/json')) {\n return { data: await response.json(), response };\n } else if (contentType?.includes('text/html')) {\n return { data: await response.text(), response };\n } else {\n // contentType 还有其他类型,目前项目中用不到\n // 不能简单的报错,比如 image/x-icon 是 favicon 请求\n // 此处直接返回 response,由业务代码处理其他类型的数据\n return { data: response, response };\n }\n } catch (error) {\n if ((error as any).name === 'AbortError') {\n return { data: response, response };\n }\n (error as any).response = response;\n (error as any).status = 20001;\n throw error;\n }\n};\n\n// 检查返回值中是否包含错误\nconst checkResponse = function (\n url: string,\n {\n data,\n response,\n }: {\n data: any;\n response: Response;\n },\n opts: FetchOptions,\n) {\n // 兼容 data.code 和 data.data, 是关于 core space 的数据结构\n if (response.status === 200 && (data.status === '1' || data.code === 0)) {\n return data.result || data.data;\n } else if (isHeadRequest(opts)) {\n // handle of HEAD method\n return response;\n } else {\n const code = Number(data.status ?? data.code);\n const error: Partial<ErrorEvent> & {\n response?: ResponseType;\n status?: number;\n } = new Error(data.message);\n error.response = data;\n error.status = code;\n throw error;\n }\n};\n\nconst fetchWithAbort = <T>(\n url: string,\n options: FetchOptions = {},\n): FetchWithAbortType<T> => {\n const controller = new AbortController();\n const opts: FetchOptions = { ...options, signal: controller.signal };\n const showErrorMessage = options.showErrorMessage ?? true;\n const timeout = options.timeout || TIMEOUT_TIMESTAMP;\n\n let timeoutId: ReturnType<typeof setTimeout>;\n let settled = false;\n const promise: Promise<T> = new Promise((resolve, reject) => {\n const resolveRequest = (value: T) => {\n if (settled) {\n return;\n }\n settled = true;\n resolve(value);\n };\n const rejectRequest = (reason: unknown) => {\n if (settled) {\n return;\n }\n settled = true;\n reject(reason);\n };\n\n timeoutId = setTimeout(() => {\n if (settled) {\n return;\n }\n controller.abort();\n if (isHeadRequest(opts)) {\n return resolveRequest(\n createHeadFailureResponse(408, 'Request timeout') as T,\n );\n }\n showErrorMessage &&\n publishRequestError(\n { url, code: 20002, message: 'Request timeout' },\n 'http',\n );\n rejectRequest(new Error('Request timeout'));\n }, timeout);\n\n window\n .fetch(url, opts)\n .then(checkStatus)\n .then(parseJSON)\n .then((...args) => checkResponse(url, ...args, opts))\n .then(data => resolveRequest(data as T))\n .catch(error => {\n // The timeout handler settles the request before aborting the fetch,\n // so the resulting AbortError must not publish a second notification.\n if (settled) {\n return;\n }\n\n if (isHeadRequest(opts)) {\n return resolveRequest(\n createHeadFailureResponse(\n 599,\n error?.message || 'Request failed',\n ) as T,\n );\n }\n\n // A fetch() promise will reject with a TypeError when a network error is encountered or CORS is misconfigured on the server-side,\n // although this usually means permission issues or similar — a 404 does not constitute a network error, for example.\n // For detail: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n if (error.name === 'TypeError') {\n showErrorMessage && publishRequestError({ url, code: 20004 }, 'http');\n rejectRequest(new Error('Network error'));\n } else if (error.name === 'AbortError') {\n showErrorMessage &&\n publishRequestError(\n { url, code: 20003, message: 'Fetch aborted' },\n 'http',\n );\n rejectRequest(new Error('Fetch aborted'));\n } else {\n showErrorMessage &&\n publishRequestError(\n { url, code: (error as any).status, message: error.message },\n 'http',\n );\n rejectRequest(error);\n }\n })\n .finally(() => clearTimeout(timeoutId));\n });\n\n return {\n promise,\n abort: () => {\n clearTimeout(timeoutId);\n controller.abort();\n },\n };\n};\n\nexport const fetch = <T>(\n url: string,\n options: FetchOptions = {},\n): Promise<T> => {\n const { promise } = fetchWithAbort<T>(url, options);\n return promise;\n};\n\nexport const appendApiPrefix = (url: string) => {\n // for cfx top N\n if (url.startsWith('/stat/')) {\n return url;\n }\n if (url.startsWith('http')) {\n return url;\n }\n return `/v1${url.startsWith('/') ? url : '/' + url}`;\n};\n\nexport const fetchWithPrefix = <T>(url: string, opts?: FetchOptions) => {\n return fetch<T>(appendApiPrefix(url), opts);\n};\n\nexport const fetchWithOpenApi = <T>(url: string, opts?: FetchOptions) => {\n const ENV_CONFIG = getEnvConfig();\n if (!ENV_CONFIG.ENV_OPEN_API_HOST) {\n throw new Error('ENV_OPEN_API_HOST is not set');\n }\n return fetch<T>(\n `${ENV_CONFIG.ENV_OPEN_API_HOST}${url.startsWith('/') ? url : '/' + url}`,\n opts,\n );\n};\n\nexport const simpleGetFetcher = async <T>(args: any[]) => {\n const [url, query] = args;\n const requestUrl = query ? qs.stringifyUrl({ url, query }) : url;\n return await fetchWithPrefix<T>(requestUrl, {\n method: 'get',\n });\n};\n\ntype RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';\ninterface QueryParams {\n [key: string]: string | undefined;\n}\ninterface Config {\n url: string;\n query: QueryParams;\n type?: RequestMethod;\n body?: any;\n headers?: Headers;\n signal?: AbortSignal;\n}\n\nconst queryAddress = (address: string[]) => {\n return address.reduce((prev, curr, index) => {\n return !index ? `address=${curr}` : `${prev}&address=${curr}`;\n }, '');\n};\n\nexport const sendRequestChart = async (config: Config) => {\n try {\n const res: any = await fetch(\n qs.stringifyUrl({ url: config.url, query: config.query }),\n {\n method: config.type || 'GET',\n body: config.body,\n headers: config.headers,\n signal: config.signal,\n },\n );\n const data = res;\n data.list = [...(data.list || [])].reverse();\n return data;\n } catch (error) {\n console.error('Request failed', error);\n throw error;\n }\n};\n\nexport const sendRequestENSInfo = async (url?: string | null) => {\n if (!url) return {};\n try {\n const res: any = await fetch(url, {\n method: 'GET',\n });\n\n return res?.map;\n } catch (error) {\n console.error('Request failed', error);\n throw error;\n }\n};\n\nexport const sendRequestGasPrice = async () => {\n try {\n const res: any = await fetch(`/stat/gasprice/tracker`, {\n method: 'GET',\n });\n return res;\n } catch (error) {\n console.error('Request failed', error);\n throw error;\n }\n};\n\nexport const reqNametag = async (address: string[]) => {\n const query = queryAddress(address);\n\n const res: any = await fetch(`/v1/nametag?${query}`, {\n method: 'GET',\n });\n return res?.map;\n};\n\nexport const reqContractAndToken = fetchWithCache(\n async (address: string[]) => {\n const query = queryAddress(address);\n\n const res: any = await fetch(`/v1/contract-and-token?${query}`, {\n method: 'GET',\n });\n return res;\n },\n {\n key: 'contract-and-token',\n maxAge: 1000 * 60 * 60,\n },\n);\n\nexport const getContractDetail = fetchWithCache(\n <T extends string>(contractAddress?: string, fields: T[] = []) => {\n const url = qs.stringifyUrl({\n url: `/v1/contract/${contractAddress}`,\n query: { fields },\n });\n\n return fetch<BaseContractInfo & Record<T, unknown>>(url, {\n method: 'GET',\n });\n },\n {\n key: 'contract-detail',\n maxAge: 1000 * 60 * 60,\n },\n);\n\nexport const detectAccountType = fetchWithCache(\n (address: string) => {\n return fetchWithOpenApi<DetectAccountTypeResponse>(\n `/util/detectAccountType?hex=${address}`,\n {\n method: 'GET',\n },\n );\n },\n {\n key: 'detectAccountType',\n // 10 seconds\n maxAge: 1000 * 10,\n },\n);\n\nexport const reqAbiByMethodId = (methodId: string) => {\n return fetchWithPrefix<{\n list: MethodAbiItemResponse[];\n }>(\n qs.stringifyUrl({\n url: '/stat/list-abi-method',\n query: {\n id: methodId,\n },\n }),\n );\n};\n\nexport const fetchAddressNameMap = (\n addresses: string[],\n params: {\n withContractInfo?: 'true' | 'false';\n withNameTagInfo?: 'true' | 'false';\n withENSInfo?: 'true' | 'false';\n } = {},\n) => {\n const url = qs.stringifyUrl({\n url: '/account/infos',\n query: {\n accounts: addresses.join(','),\n ...params,\n },\n });\n return fetchWithOpenApi<Record<string, AddressNameMap>>(url, {\n method: 'GET',\n });\n};\n\nexport const reqAbiById = fetchWithCache(\n (params: { function?: string; error?: string; event?: string }) => {\n const url = qs.stringifyUrl({\n url: '/contract/lookupAbi',\n query: params,\n });\n return fetchWithOpenApi<AbiByIdResponse>(url, {\n method: 'GET',\n });\n },\n {\n key: 'reqAbiById',\n maxAge: 1000 * 60 * 60,\n },\n);\n\nexport const reqContractsStatistics = (params: Record<string, string> = {}) => {\n const url = qs.stringifyUrl({\n url: '/statistics/contract',\n query: params,\n });\n return fetchWithOpenApi<{\n total: number;\n list: ContractsStatistics[];\n }>(url, {\n method: 'GET',\n });\n};\n\nexport const reqVerifiedContractsStatistics = (\n params: Record<string, string> = {},\n) => {\n const url = qs.stringifyUrl({\n url: '/statistics/contract/verified',\n query: params,\n });\n return fetchWithOpenApi<{\n total: number;\n list: ContractsStatistics[];\n }>(url, {\n method: 'GET',\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,QAAQ;AAsBf,IAAM,oBAAoB;AAE1B,IAAM,gBAAgB,CAAC,SACrB,MAAM,QAAQ,YAAY,MAAM;AAElC,IAAM,4BAA4B,CAChC,QACA,eACa,IAAI,SAAS,MAAM,EAAE,QAAQ,WAAW,CAAC;AAExD,IAAM,cAAc,CAAC,aAAuB;AAC1C,MACG,SAAS,UAAU,OAAO,SAAS,SAAS,OAC7C,SAAS,WAAW,KACpB;AACA,WAAO;AAAA,EACT,OAAO;AACL,UAAM,QAAQ,IAAI,MAAM,SAAS,UAAU;AAC3C,UAAM,OAAO;AACb,IAAC,MAAc,SAAS,SAAS;AACjC,IAAC,MAAc,WAAW;AAC1B,UAAM;AAAA,EACR;AACF;AAGA,IAAM,YAAY,OAAO,aAAuB;AAC9C,QAAM,cAAc,SAAS,QAAQ,IAAI,cAAc;AACvD,MAAI;AACF,QAAI,aAAa,SAAS,kBAAkB,GAAG;AAC7C,aAAO,EAAE,MAAM,MAAM,SAAS,KAAK,GAAG,SAAS;AAAA,IACjD,WAAW,aAAa,SAAS,WAAW,GAAG;AAC7C,aAAO,EAAE,MAAM,MAAM,SAAS,KAAK,GAAG,SAAS;AAAA,IACjD,OAAO;AAIL,aAAO,EAAE,MAAM,UAAU,SAAS;AAAA,IACpC;AAAA,EACF,SAAS,OAAP;AACA,QAAK,MAAc,SAAS,cAAc;AACxC,aAAO,EAAE,MAAM,UAAU,SAAS;AAAA,IACpC;AACA,IAAC,MAAc,WAAW;AAC1B,IAAC,MAAc,S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AAAA,IACN,QAAQ;AAAA,EACV,CAAC;AACH;","names":[]}
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-PRKOG6DK.js";
|
|
4
4
|
import {
|
|
5
5
|
RenderAddress
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OUQEXLFQ.js";
|
|
7
7
|
import {
|
|
8
8
|
formatAddress,
|
|
9
9
|
isInnerContractAddress
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ODPPKXIV.js";
|
|
11
11
|
import {
|
|
12
12
|
Tooltip
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QCA4QRD4.js";
|
|
14
14
|
import {
|
|
15
15
|
coreCorrespondsToEspace,
|
|
16
16
|
getNetwork
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EGXD2GDI.js";
|
|
18
18
|
import {
|
|
19
19
|
getEnvConfig,
|
|
20
20
|
getTranslations,
|
|
@@ -209,4 +209,4 @@ export {
|
|
|
209
209
|
MyAddress,
|
|
210
210
|
PosAddress
|
|
211
211
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-NBMABBMG.js.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getAddressNameInfo
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WYM7FWXA.js";
|
|
4
4
|
import {
|
|
5
5
|
ContractAddress,
|
|
6
6
|
ContractCreatedAddress,
|
|
7
7
|
InvalidAddress,
|
|
8
8
|
MyAddress
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NBMABBMG.js";
|
|
10
10
|
import {
|
|
11
11
|
RenderAddress
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OUQEXLFQ.js";
|
|
13
13
|
import {
|
|
14
14
|
convertCheckSum,
|
|
15
15
|
formatAddress,
|
|
16
16
|
isEvmAddress,
|
|
17
17
|
isZeroAddress
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-ODPPKXIV.js";
|
|
19
19
|
import {
|
|
20
20
|
getTranslations,
|
|
21
21
|
useGlobalData
|
|
@@ -109,4 +109,4 @@ var EVMAddressContainer = withTranslation()(
|
|
|
109
109
|
export {
|
|
110
110
|
EVMAddressContainer
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-OAUFBUYV.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NETWORK_ID
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HHJWVVJC.js";
|
|
4
4
|
import {
|
|
5
5
|
detectAccountType
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-M7G2HHUU.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/address.ts
|
|
9
9
|
import SDK from "js-conflux-sdk";
|
|
@@ -283,4 +283,4 @@ export {
|
|
|
283
283
|
formatAddressHexToBase32,
|
|
284
284
|
isAddressEqual
|
|
285
285
|
};
|
|
286
|
-
//# sourceMappingURL=chunk-
|
|
286
|
+
//# sourceMappingURL=chunk-ODPPKXIV.js.map
|
|
@@ -4,25 +4,35 @@ import {
|
|
|
4
4
|
|
|
5
5
|
// src/utils/pubsub.ts
|
|
6
6
|
var pubSubLib = () => {
|
|
7
|
-
const subscribers =
|
|
7
|
+
const subscribers = /* @__PURE__ */ new Map();
|
|
8
8
|
function publish(eventName, data) {
|
|
9
|
-
const eventSubscribers = subscribers
|
|
10
|
-
if (!
|
|
9
|
+
const eventSubscribers = subscribers.get(eventName);
|
|
10
|
+
if (!eventSubscribers) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
eventSubscribers.forEach((
|
|
14
|
-
|
|
13
|
+
[...eventSubscribers].forEach((subscription) => {
|
|
14
|
+
if (subscription.active) {
|
|
15
|
+
subscription.callback(data);
|
|
16
|
+
}
|
|
15
17
|
});
|
|
16
18
|
}
|
|
17
19
|
function subscribe(eventName, callback) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
let eventSubscribers = subscribers.get(eventName);
|
|
21
|
+
if (!eventSubscribers) {
|
|
22
|
+
eventSubscribers = /* @__PURE__ */ new Set();
|
|
23
|
+
subscribers.set(eventName, eventSubscribers);
|
|
20
24
|
}
|
|
21
|
-
const
|
|
22
|
-
eventSubscribers.
|
|
23
|
-
const index = eventSubscribers.length - 1;
|
|
25
|
+
const subscription = { callback, active: true };
|
|
26
|
+
eventSubscribers.add(subscription);
|
|
24
27
|
return () => {
|
|
25
|
-
|
|
28
|
+
if (!subscription.active) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
subscription.active = false;
|
|
32
|
+
eventSubscribers.delete(subscription);
|
|
33
|
+
if (eventSubscribers.size === 0) {
|
|
34
|
+
subscribers.delete(eventName);
|
|
35
|
+
}
|
|
26
36
|
};
|
|
27
37
|
}
|
|
28
38
|
return {
|
|
@@ -79,4 +89,4 @@ export {
|
|
|
79
89
|
pubsub,
|
|
80
90
|
publishRequestError
|
|
81
91
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-ON5OBLMV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/pubsub.ts"],"sourcesContent":["import { getEnvConfig } from '../store';\n\ntype EventName = string;\ntype Callback = (data: any) => void;\n\ninterface Subscription {\n callback: Callback;\n active: boolean;\n}\n\nconst pubSubLib = () => {\n const subscribers = new Map<EventName, Set<Subscription>>();\n\n function publish(eventName: EventName, data: any): void {\n const eventSubscribers = subscribers.get(eventName);\n if (!eventSubscribers) {\n return;\n }\n\n [...eventSubscribers].forEach(subscription => {\n if (subscription.active) {\n subscription.callback(data);\n }\n });\n }\n\n function subscribe(eventName: EventName, callback: Callback): () => void {\n let eventSubscribers = subscribers.get(eventName);\n if (!eventSubscribers) {\n eventSubscribers = new Set();\n subscribers.set(eventName, eventSubscribers);\n }\n const subscription: Subscription = { callback, active: true };\n eventSubscribers.add(subscription);\n\n return () => {\n if (!subscription.active) {\n return;\n }\n subscription.active = false;\n eventSubscribers.delete(subscription);\n if (eventSubscribers.size === 0) {\n subscribers.delete(eventName);\n }\n };\n }\n\n return {\n publish,\n subscribe,\n };\n};\n\nexport const pubsub = pubSubLib();\n\ninterface ErrorInfoType {\n url?: string;\n code?: number;\n message?: string;\n data?: string;\n method?: string;\n}\n\nconst isNil = (value: any) => value === null || value === undefined;\nexport const publishRequestError = (\n e: (Error & ErrorInfoType) | ErrorInfoType,\n type: 'rpc' | 'http' | 'wallet' | 'code',\n) => {\n let detail = '';\n if (e.code && e.message) {\n if (type === 'code') {\n detail = e.message;\n } else {\n detail = `Error Code: ${e.code} \\n`;\n if (type === 'http') {\n const origin = window.location.origin;\n detail += `Rest Api Url: ${\n e.url?.includes('https://') ? e.url : origin + e.url\n } \\n`;\n }\n if (type === 'rpc') {\n const RPC_SERVER = getEnvConfig().ENV_RPC_SERVER;\n if (RPC_SERVER) {\n detail += `RPC Url: ${RPC_SERVER} \\n`;\n }\n if (!isNil(e.method)) {\n detail += `Method: ${e.method} \\n`;\n }\n if (!isNil(e.data)) {\n detail += `Data: ${e.data} \\n`;\n }\n }\n detail += `Error Message: ${e.message} \\n`;\n }\n }\n\n pubsub.publish('notify', {\n type: 'request',\n option: {\n code: type === 'rpc' ? 30001 : e.code || 20000, // code is used for title, 20000 means unknown issue\n message: e.message,\n detail: detail,\n },\n });\n};\n"],"mappings":";;;;;AAUA,IAAM,YAAY,MAAM;AACtB,QAAM,cAAc,oBAAI,IAAkC;AAE1D,WAAS,QAAQ,WAAsB,MAAiB;AACtD,UAAM,mBAAmB,YAAY,IAAI,SAAS;AAClD,QAAI,CAAC,kBAAkB;AACrB;AAAA,IACF;AAEA,KAAC,GAAG,gBAAgB,EAAE,QAAQ,kBAAgB;AAC5C,UAAI,aAAa,QA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AA;AAAA,QACvB;AAAA,MACF;AACA,gBAAU,kBAAkB,EAAE;AAAA;AAAA,IAChC;AAAA,EACF;AAEA,SAAO,QAAQ,UAAU;AAAA,IACvB,MAAM;AAAA,IACN,QAAQ;AAAA,MACN,MAAM,SAAS,QAAQ,QAAQ,EAAE,QAAQ;AAAA;AAAA,MACzC,SAAS,EAAE;AAAA,MACX;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
convertCheckSum
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ODPPKXIV.js";
|
|
4
4
|
import {
|
|
5
5
|
Text
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TTMMIWXR.js";
|
|
7
7
|
import {
|
|
8
8
|
getTranslations
|
|
9
9
|
} from "./chunk-L4AFJGXJ.js";
|
|
@@ -143,4 +143,4 @@ var RenderAddress = ({
|
|
|
143
143
|
export {
|
|
144
144
|
RenderAddress
|
|
145
145
|
};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-OUQEXLFQ.js.map
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
recoverAddress,
|
|
31
31
|
serializeErc6492Signature,
|
|
32
32
|
transactionType
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-2ZR25NMU.js";
|
|
34
34
|
import {
|
|
35
35
|
secp256k1
|
|
36
36
|
} from "./chunk-CGDNDBBP.js";
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
} from "./chunk-LBAEFEJU.js";
|
|
90
90
|
import {
|
|
91
91
|
NETWORK_ID
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-HHJWVVJC.js";
|
|
93
93
|
import {
|
|
94
94
|
getEnvConfig
|
|
95
95
|
} from "./chunk-L4AFJGXJ.js";
|
|
@@ -21487,4 +21487,4 @@ export {
|
|
|
21487
21487
|
decodeFunctionResult3 as decodeFunctionResult,
|
|
21488
21488
|
decodeErrorResult3 as decodeErrorResult
|
|
21489
21489
|
};
|
|
21490
|
-
//# sourceMappingURL=chunk-
|
|
21490
|
+
//# sourceMappingURL=chunk-OVGNIKRY.js.map
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-BMO4IZHV.js";
|
|
24
24
|
import {
|
|
25
25
|
cn
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EGXD2GDI.js";
|
|
27
27
|
|
|
28
28
|
// src/components/Tooltip/index.tsx
|
|
29
29
|
import {
|
|
@@ -535,4 +535,4 @@ var Tooltip2 = ({
|
|
|
535
535
|
export {
|
|
536
536
|
Tooltip2 as Tooltip
|
|
537
537
|
};
|
|
538
|
-
//# sourceMappingURL=chunk-
|
|
538
|
+
//# sourceMappingURL=chunk-QCA4QRD4.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchAddressNameMap
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M7G2HHUU.js";
|
|
4
4
|
|
|
5
5
|
// src/utils/hooks/useAddressNameMap.ts
|
|
6
6
|
import useSWRImmutable from "swr/immutable";
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
transformNameMapKeysToLowerCase,
|
|
27
27
|
useAddressNameMap
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-QL4NKKTA.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useAddressNameMap
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QL4NKKTA.js";
|
|
4
4
|
import {
|
|
5
5
|
Link
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TPUZ46LY.js";
|
|
7
7
|
import {
|
|
8
8
|
getAddressNameInfo
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WYM7FWXA.js";
|
|
10
10
|
import {
|
|
11
11
|
DefaultTokenIcon
|
|
12
12
|
} from "./chunk-PRKOG6DK.js";
|
|
13
13
|
import {
|
|
14
14
|
formatAddress
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ODPPKXIV.js";
|
|
16
16
|
|
|
17
17
|
// src/components/InputData/ContractDetail.tsx
|
|
18
18
|
import clsx from "clsx";
|
|
@@ -77,4 +77,4 @@ var ContractDetail = ({ address, addressType }) => {
|
|
|
77
77
|
export {
|
|
78
78
|
ContractDetail
|
|
79
79
|
};
|
|
80
|
-
//# sourceMappingURL=chunk-
|
|
80
|
+
//# sourceMappingURL=chunk-RK632STC.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ErrorDecode
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GGLZLKNJ.js";
|
|
4
4
|
import {
|
|
5
5
|
Original
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XGSBVC7P.js";
|
|
7
7
|
import {
|
|
8
8
|
UTF8
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4MVQ3JTN.js";
|
|
10
10
|
import {
|
|
11
11
|
GeneralDecode
|
|
12
12
|
} from "./chunk-JVCFVNGV.js";
|
|
13
13
|
import {
|
|
14
14
|
DecodedParameters
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B74PZXOZ.js";
|
|
16
16
|
|
|
17
17
|
// src/components/OutputData/index.tsx
|
|
18
18
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -69,4 +69,4 @@ var OutputData = ({
|
|
|
69
69
|
export {
|
|
70
70
|
OutputData
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-RX44WEW6.js.map
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "./chunk-BMO4IZHV.js";
|
|
30
30
|
import {
|
|
31
31
|
cn
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-EGXD2GDI.js";
|
|
33
33
|
|
|
34
34
|
// src/components/Popover/index.tsx
|
|
35
35
|
import { useRef } from "react";
|
|
@@ -2146,4 +2146,4 @@ focus-trap/dist/focus-trap.esm.js:
|
|
|
2146
2146
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
2147
2147
|
*)
|
|
2148
2148
|
*/
|
|
2149
|
-
//# sourceMappingURL=chunk-
|
|
2149
|
+
//# sourceMappingURL=chunk-S2C6VOUJ.js.map
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-LRCAKRPK.js";
|
|
15
15
|
import {
|
|
16
16
|
cn
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-EGXD2GDI.js";
|
|
18
18
|
|
|
19
19
|
// src/components/Select/select.tsx
|
|
20
20
|
import * as React9 from "react";
|
|
@@ -3613,4 +3613,4 @@ export {
|
|
|
3613
3613
|
SelectItem,
|
|
3614
3614
|
SelectSeparator
|
|
3615
3615
|
};
|
|
3616
|
-
//# sourceMappingURL=chunk-
|
|
3616
|
+
//# sourceMappingURL=chunk-TAEXZ5LI.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Original
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XGSBVC7P.js";
|
|
4
4
|
import {
|
|
5
5
|
UTF8
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4MVQ3JTN.js";
|
|
7
7
|
import {
|
|
8
8
|
GeneralDecode
|
|
9
9
|
} from "./chunk-JVCFVNGV.js";
|
|
10
10
|
import {
|
|
11
11
|
JsonDecode
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YLBHOAH5.js";
|
|
13
13
|
import {
|
|
14
14
|
OptimizationDecode
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-B74PZXOZ.js";
|
|
16
16
|
|
|
17
17
|
// src/components/InputData/index.tsx
|
|
18
18
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -63,4 +63,4 @@ var InputData = ({
|
|
|
63
63
|
export {
|
|
64
64
|
InputData
|
|
65
65
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-TIWELXT7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
trackEvent
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X35GBAUQ.js";
|
|
4
4
|
|
|
5
5
|
// src/components/Link/index.tsx
|
|
6
6
|
import React from "react";
|
|
@@ -58,4 +58,4 @@ var Link = React.memo(
|
|
|
58
58
|
export {
|
|
59
59
|
Link
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-TPUZ46LY.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-TOKKKTFG.js";
|
|
4
4
|
import {
|
|
5
5
|
Tooltip
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QCA4QRD4.js";
|
|
7
7
|
import {
|
|
8
8
|
selectText
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EGXD2GDI.js";
|
|
10
10
|
|
|
11
11
|
// src/components/Text/index.tsx
|
|
12
12
|
import React from "react";
|
|
@@ -102,4 +102,4 @@ var Text = React.memo(
|
|
|
102
102
|
export {
|
|
103
103
|
Text
|
|
104
104
|
};
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-TTMMIWXR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/Text/index.tsx"],"sourcesContent":["import React from 'react';\nimport clsx from 'clsx';\nimport { Tooltip } from '../Tooltip';\nimport { selectText } from '../../utils';\nimport { useBreakpoint } from '../../utils/media';\n\ntype NormalTypes =\n | 'default'\n | 'secondary'\n | 'success'\n | 'warning'\n | 'error'\n | 'primary';\n\ntype TextProps = {\n children?: React.ReactNode;\n maxWidth?: string;\n mobileMaxWidth?: string;\n maxCount?: number;\n mobileMaxCount?: number;\n hoverValue?: React.ReactNode;\n hoverValueMaxCount?: number;\n tag?: 'p' | 'span';\n type?: NormalTypes;\n hideTooltip?: boolean;\n};\ntype NativeAttrs = Omit<React.HTMLAttributes<any>, keyof TextProps>;\n\nconst getTypeColor = (type: NormalTypes) => {\n const colors: { [key in NormalTypes]: string } = {\n default: 'inherit',\n primary: '#7cd77b',\n secondary: '#666',\n success: '#7cd77b',\n warning: '#ffc438',\n error: '#e15c56',\n };\n\n return colors[type] || colors.default;\n};\n\n// Behavior contract:\n// 1. maxWidth has priority over maxCount.\n// 2. maxCount applies only to string children.\n// 3. hoverValue is preferred as Tooltip text; otherwise children are used.\n// 4. On mobile, long tooltip text is split into fixed-size segments for the current\n// address/table layouts. Changes require narrow-screen and multilingual visual checks.\nexport const Text = React.memo(\n ({\n className,\n children,\n maxWidth: _maxWidth,\n mobileMaxWidth = _maxWidth,\n maxCount: _maxCount,\n mobileMaxCount = _maxCount,\n hoverValue,\n hoverValueMaxCount: outerHoverValueMaxCount,\n tag = 'p',\n type = 'default',\n hideTooltip = false,\n ...props\n }: NativeAttrs & TextProps) => {\n const Component = tag;\n const bp = useBreakpoint();\n let child: React.ReactNode = children;\n const maxCount = bp === 's' ? mobileMaxCount : _maxCount;\n const maxWidth = bp === 's' ? mobileMaxWidth : _maxWidth;\n if (\n maxWidth === undefined &&\n maxCount &&\n typeof children === 'string' &&\n children.length > maxCount\n ) {\n child = String.prototype.substr.call(children, 0, maxCount) + '...';\n }\n\n let textContent = hoverValue || children;\n // 当前移动端 tooltip 默认按 34 个字符分段,兼容地址和表格中的长文本。\n // 分段可能落在完整单词中;改为动态宽度前,需要结合英文、中文、地址和窄屏\n // 页面完成视觉回归,不能只根据单个调用方判断。\n // @todo [待确认] 评估按实际文本宽度动态设置容器宽度的方案。\n if (bp === 's' && typeof textContent === 'string') {\n const hoverValueMaxCount = outerHoverValueMaxCount || 34; // default text count is 34\n let textContentCopy: string = textContent;\n const newTextContent: Array<React.ReactNode> = [];\n let count = 0;\n while (textContentCopy.length > hoverValueMaxCount) {\n newTextContent.push(\n <span key={count}>\n {textContentCopy.substr(0, hoverValueMaxCount)}\n </span>,\n );\n newTextContent.push(<br key={`br${count}`} />);\n textContentCopy = textContentCopy.substr(hoverValueMaxCount);\n // 防止文本过长的情况\n if (count > 3) {\n textContentCopy =\n textContentCopy.substr(0, hoverValueMaxCount - 3) + '...';\n }\n }\n newTextContent.push(<span key={++count}>{textContentCopy}</span>);\n textContent = newTextContent;\n }\n const tooltipText =\n !hideTooltip &&\n React.createElement(\n 'div',\n {\n onClick: e => {\n e.preventDefault();\n e.stopPropagation();\n selectText(e.currentTarget);\n },\n },\n textContent,\n );\n\n const p = { title: tooltipText };\n return React.createElement(Tooltip, p, [\n <span key=\"text\">\n <Component\n className={clsx(\n 'sirius-text truncate vertical-bottom',\n 'all-[a]:truncate all-[a]:vertical-bottom all-[a]:cursor-pointer all-[a:hover]:text-#0626ae',\n className,\n )}\n style={{\n maxWidth,\n display: maxWidth === undefined ? 'inherit' : 'inline-block',\n color: getTypeColor(type),\n }}\n {...props}\n >\n {child}\n </Component>\n </span>,\n ]);\n },\n);\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,WAAW;AAClB,OAAO,UAAU;AAuFP;AA5DV,IAAM,eAAe,CAAC,SAAsB;AAC1C,QAAM,SAA2C;AAAA,IAC/C,SAAS;AAAA,IACT,SAAS;AAAA,IACT,WAAW;AAAA,IACX,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,EACT;AAEA,SAAO,OAAO,IAAI,KAAK,OAAO;AAChC;AAQO,IAAM,OAAO,MAAM;AAAA,EACxB,CAAC;AAAA,IACC;AAAA,IACA;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M,IAAI,EAAE,OAAO,YAAY;AAC/B,WAAO,MAAM,cAAc,SAAS,GAAG;AAAA,MACrC,oBAAC,UACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAW;AAAA,YACT;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,UACA,OAAO;AAAA,YACL;AAAA,YACA,SAAS,aAAa,SAAY,YAAY;AAAA,YAC9C,OAAO,aAAa,IAAI;AAAA,UAC1B;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,MACH,KAfQ,MAgBV;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
convertCheckSum
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ODPPKXIV.js";
|
|
4
4
|
import {
|
|
5
5
|
useGlobalData
|
|
6
6
|
} from "./chunk-L4AFJGXJ.js";
|
|
@@ -20,4 +20,4 @@ var useAddressLabel = (address, showAddressLabel = true) => {
|
|
|
20
20
|
export {
|
|
21
21
|
useAddressLabel
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-UBHTXZWS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isZeroAddress
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ODPPKXIV.js";
|
|
4
4
|
|
|
5
5
|
// src/components/AddressContainer/utils.ts
|
|
6
6
|
var getPocketAlias = ({
|
|
@@ -48,4 +48,4 @@ export {
|
|
|
48
48
|
getPocketAlias,
|
|
49
49
|
getAddressNameInfo
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-WYM7FWXA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/ga.ts"],"sourcesContent":["// Google Analytics gtag version API\n// https://developers.google.com/analytics/devguides/collection/gtagjs\n\ndeclare global {\n interface Window {\n gtag: any;\n }\n}\n\nexport const prodTargetId = 'G-BWQ72S5QE8';\nexport const testTargetId = 'G-17W5VXCYSL';\nexport const devTargetId = 'G-VCXQ7FY6EV';\n\n// TODO [待确认] 是否将 Portal 地址绑定为 GA userId。实现前必须确认产品目的、\n// 用户同意与隐私要求,并定义地址切换、断开连接和跨网络场景的行为。\n\nexport const getTrackId = () => {\n return window.location.hostname.includes('confluxscan.org')\n ? prodTargetId\n : window.location.hostname.includes('confluxnetwork.org')\n ? testTargetId\n : devTargetId;\n};\n\n// add additional configuration information to targets\nexport const trackConfig = (configInfo = {}) => {\n window.gtag && window.gtag('config', getTrackId(), configInfo);\n};\n\nexport interface TrackEventParams {\n action: string;\n category: string;\n label?: string;\n value?: number;\n}\n// track event data\nexport const trackEvent = (eventInfo: TrackEventParams) => {\n try {\n const eventObject: any = {\n event_category: eventInfo.category,\n };\n if (typeof eventInfo.label !== 'undefined') {\n eventObject.event_label = eventInfo.label;\n }\n if (typeof eventInfo.value !== 'undefined') {\n eventObject.value = eventInfo.value;\n }\n // if (\n // window.location.hostname.includes('127.0.0.1') ||\n // window.location.hostname.includes('localhost')\n // ) {\n // console.info(`trackEvent`, eventInfo);\n // }\n window.gtag &&\n window.gtag(\n 'event',\n `${eventInfo.category}_${eventInfo.action}`,\n eventObject,\n );\n } catch (e) {\n console.error(e);\n }\n};\n\ninterface TrackScreenViewParams {\n appName: string;\n screenName: string;\n appId?: string;\n appVersion?: string;\n appInstallerId?: string;\n}\n// track screen view\nexport const trackScreenView = (screenViewInfo: TrackScreenViewParams) => {\n try {\n window.gtag &&\n window.gtag('event', 'screen_view', {\n screen_name: screenViewInfo.screenName,\n app_name: screenViewInfo.appName,\n app_id: screenViewInfo.appId || '',\n app_version: screenViewInfo.appVersion || '',\n app_installer_id: screenViewInfo.appInstallerId || '',\n });\n } catch (e) {\n console.error(e);\n }\n};\n\ninterface TrackTimingParams {\n name: string;\n value: number; // milliseconds\n category: string;\n label?: string;\n}\n// track timing\nexport const trackTiming = (timingInfo: TrackTimingParams) => {\n try {\n window.gtag &&\n window.gtag('event', 'timing_complete', {\n name: timingInfo.name,\n event_category: timingInfo.category,\n event_label: timingInfo.label || '',\n value: timingInfo.value || 0,\n });\n } catch (e) {\n console.error(e);\n }\n};\n\n// track error\n// set fatal to true if the error is fatal\nexport const trackError = (description: string, fatal = false) => {\n try {\n window.gtag &&\n window.gtag('event', 'exception', {\n description,\n fatal,\n });\n } catch (e) {\n console.error(e);\n }\n};\n"],"mappings":";AASO,IAAM,eAAe;AACrB,IAAM,eAAe;AACrB,IAAM,cAAc;AAKpB,IAAM,aAAa,MAAM;AAC9B,SAAO,OAAO,SAAS,SAAS,SAAS,iBAAiB,IACtD,eACA,OAAO,SAAS,SAAS,SAAS,oBAAoB,IACpD,eACA;AACR;AAGO,IAAM,cAAc,CAAC,aAAa,CAAC,MAAM;AAC9C,SAAO,QAAQ,OAAO,KAAK,UAAU,WAAW,GAAG,UAAU;AAC/D;AASO,IAAM,aAAa,CAAC,cAAgC;AACzD,MAAI;AACF,UAAM,cAAmB;AAAA,MACvB,gBAAgB,UAAU;AAAA,IAC5B;AACA,QAAI,OAAO,UAAU,UAAU,aAAa;AAC1C,kBAAY,cAAc,UAAU;AAAA,IACtC;AACA,QAAI,OAAO,UAAU,UAAU,aAAa;AAC1C,kBAAY,QAAQ,UAAU;AAAA,IAChC;AAOA,WAAO,QACL,OAAO;AAAA,MACL;AAAA,MACA,GAAG,UAAU,YAAY,UAAU;AAAA,MACnC;AAAA,IACF;AAAA,EACJ,SAAS,GAAP;AACA,YAAQ,MAAM,CAAC;AAAA,EACjB;AACF;AAUO,IAAM,kBAAkB,CAAC,mBAA0C;AACxE,MAAI;AACF,WAAO,QACL,OAAO,KAAK,SAAS,eAAe;AAAA,MAClC,aAAa,eAAe;AAAA,MAC5B,UAAU,eAAe;AAAA,MACzB,QAAQ,eAAe,SAAS;AAAA,MAChC,aAAa,eAAe,cAAc;AAAA,MAC1C,kBAAkB,eAAe,kBAAkB;AAAA,IACrD,CAAC;AAAA,EACL,SAAS,GAAP;AACA,YAAQ,MAAM,CAAC;AAAA,EACjB;AACF;AASO,IAAM,cAAc,CAAC,eAAkC;AAC5D,MAAI;AACF,WAAO,QACL,OAAO,KAAK,SAAS,mBAAmB;AAAA,MACtC,MAAM,WAAW;AAAA,MACjB,gBAAgB,WAAW;AAAA,MAC3B,aAAa,WAAW,SAAS;AAAA,MACjC,OAAO,WAAW,SAAS;AAAA,IAC7B,CAAC;AAAA,EACL,SAAS,GAAP;AACA,YAAQ,MAAM,CAAC;AAAA,EACjB;AACF;AAIO,IAAM,aAAa,CAAC,aAAqB,QAAQ,UAAU;AAChE,MAAI;AACF,WAAO,QACL,OAAO,KAAK,SAAS,aAAa;AAAA,MAChC;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACL,SAAS,GAAP;AACA,YAAQ,MAAM,CAAC;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EGXD2GDI.js";
|
|
4
4
|
|
|
5
5
|
// src/components/InputData/Original.tsx
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -20,4 +20,4 @@ var Original = ({ data, className }) => {
|
|
|
20
20
|
export {
|
|
21
21
|
Original
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-XGSBVC7P.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
reqAbiById
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-M7G2HHUU.js";
|
|
4
4
|
|
|
5
5
|
// src/utils/hooks/useAbiItemById.ts
|
|
6
6
|
import useSWRImmutable from "swr/immutable";
|
|
@@ -16,4 +16,4 @@ var useAbiItemById = (id, type = "function", shouldFetch = true) => {
|
|
|
16
16
|
export {
|
|
17
17
|
useAbiItemById
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=chunk-
|
|
19
|
+
//# sourceMappingURL=chunk-XIQH26WA.js.map
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
SelectItem,
|
|
6
6
|
SelectTrigger,
|
|
7
7
|
SelectValue
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TAEXZ5LI.js";
|
|
9
9
|
import {
|
|
10
10
|
cn
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EGXD2GDI.js";
|
|
12
12
|
|
|
13
13
|
// src/components/Select/index.tsx
|
|
14
14
|
import React, { useMemo, useState, useEffect } from "react";
|
|
@@ -104,4 +104,4 @@ Select2.Option = Option;
|
|
|
104
104
|
export {
|
|
105
105
|
Select2 as Select
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-XJPWKT2J.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMethodAbi
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7FIPVSHQ.js";
|
|
4
4
|
import {
|
|
5
5
|
decodeFunctionData,
|
|
6
6
|
decodeFunctionResult
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OVGNIKRY.js";
|
|
8
8
|
import {
|
|
9
9
|
useContractDetail
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2WY3J56A.js";
|
|
11
11
|
import {
|
|
12
12
|
getAbiItem
|
|
13
13
|
} from "./chunk-S6O6Q2GQ.js";
|
|
14
14
|
import {
|
|
15
15
|
formatABI
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EGXD2GDI.js";
|
|
17
17
|
|
|
18
18
|
// src/utils/hooks/useDecodeFunctionData.ts
|
|
19
19
|
import { useMemo } from "react";
|
|
@@ -203,4 +203,4 @@ var useDecodeFunctionData = ({
|
|
|
203
203
|
export {
|
|
204
204
|
useDecodeFunctionData
|
|
205
205
|
};
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-YL3I4UMA.js.map
|