@cfxjs/sirius-next-common 0.2.12 → 0.2.14
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-EERNUGUK.js → chunk-7TNE7P6L.js} +3 -2
- package/dist/chunk-7TNE7P6L.js.map +1 -0
- package/dist/{chunk-GKZK26DZ.js → chunk-AIBPOND2.js} +2 -2
- package/dist/chunk-AIBPOND2.js.map +1 -0
- package/dist/{chunk-4J3SQGIV.js → chunk-CPX5R5ND.js} +2 -2
- package/dist/{chunk-QMLPHJCA.js → chunk-GFY6G6I2.js} +2 -8
- package/dist/chunk-GFY6G6I2.js.map +1 -0
- package/dist/{chunk-NZY53U2H.js → chunk-H5VKAQ2A.js} +2 -2
- package/dist/{chunk-ADULNBMD.js → chunk-NA2IXF26.js} +3 -3
- package/dist/{chunk-ODJ4QBD5.js → chunk-PTIDOK4R.js} +3 -3
- package/dist/{chunk-NXCZ5PMI.js → chunk-TLAXH2HE.js} +5 -3
- package/dist/chunk-TLAXH2HE.js.map +1 -0
- package/dist/{chunk-3HO74CMH.js → chunk-UINFSWXM.js} +8 -6
- package/dist/chunk-UINFSWXM.js.map +1 -0
- package/dist/components/AddressContainer/CoreAddressContainer.js +3 -3
- package/dist/components/AddressContainer/EVMAddressContainer.js +3 -3
- package/dist/components/AddressContainer/addressSwitcher.js +2 -2
- package/dist/components/AddressContainer/addressView.js +1 -1
- package/dist/components/InputData/index.d.ts +2 -1
- package/dist/components/InputData/index.js +1 -1
- package/dist/components/OutputData/index.js +1 -1
- package/dist/components/TransactionAction/coreTransactionAction.js +3 -3
- package/dist/components/TransactionAction/evmTransactionAction.js +3 -3
- package/dist/components/TransactionTrace/TraceDetail.js +4 -4
- package/dist/components/TransactionTrace/TreeTraceTable.js +5 -5
- package/dist/components/TransactionTrace/index.js +5 -5
- package/dist/utils/hooks/useDecodeFunctionData.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3HO74CMH.js.map +0 -1
- package/dist/chunk-EERNUGUK.js.map +0 -1
- package/dist/chunk-GKZK26DZ.js.map +0 -1
- package/dist/chunk-NXCZ5PMI.js.map +0 -1
- package/dist/chunk-QMLPHJCA.js.map +0 -1
- /package/dist/{chunk-4J3SQGIV.js.map → chunk-CPX5R5ND.js.map} +0 -0
- /package/dist/{chunk-NZY53U2H.js.map → chunk-H5VKAQ2A.js.map} +0 -0
- /package/dist/{chunk-ADULNBMD.js.map → chunk-NA2IXF26.js.map} +0 -0
- /package/dist/{chunk-ODJ4QBD5.js.map → chunk-PTIDOK4R.js.map} +0 -0
|
@@ -49,13 +49,14 @@ var decodeFunctionDataByAbi = ({
|
|
|
49
49
|
abi,
|
|
50
50
|
name: decodedParams.functionName ?? methodID
|
|
51
51
|
});
|
|
52
|
+
const results = decodedResults === void 0 ? void 0 : abiItem.outputs.length === 1 ? [decodedResults] : decodedResults;
|
|
52
53
|
if (!withOutput) {
|
|
53
54
|
abiItem.outputs = [];
|
|
54
55
|
}
|
|
55
56
|
const fullName = formatABI([abiItem])[0];
|
|
56
57
|
return {
|
|
57
58
|
decodedParams,
|
|
58
|
-
decodedResults:
|
|
59
|
+
decodedResults: results,
|
|
59
60
|
abiItem,
|
|
60
61
|
fullName,
|
|
61
62
|
failed: false,
|
|
@@ -195,4 +196,4 @@ var useDecodeFunctionData = ({
|
|
|
195
196
|
export {
|
|
196
197
|
useDecodeFunctionData
|
|
197
198
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
199
|
+
//# sourceMappingURL=chunk-7TNE7P6L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/hooks/useDecodeFunctionData.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n decodeFunctionData,\n decodeFunctionResult,\n getAbiItem,\n AbiFunctionWithoutGas,\n} from 'src/utils/sdk';\nimport { useContractDetail } from './useContractDetail';\nimport { formatABI } from '..';\nimport { useMethodAbi } from './useMethodAbi';\n\nconst fields = ['abi' as const];\n\nexport type Hex = `0x${string}`;\n\nconst decodeFunctionDataByAbi = ({\n abi: _abi,\n input,\n output,\n space,\n success,\n withOutput = false,\n similarWarning,\n}: {\n input: Hex;\n output?: Hex;\n abi?: AbiFunctionWithoutGas[] | string;\n space: 'evm' | 'core';\n success?: boolean;\n withOutput?: boolean;\n similarWarning?: boolean;\n}) => {\n try {\n const abi = typeof _abi === 'string' ? JSON.parse(_abi) : _abi;\n const hasAbi = abi && abi.length > 0;\n if (!hasAbi) return null;\n const isReturnDataEmpty = !output || output === '0x';\n const methodID = input.slice(0, 10);\n const decodedParams = decodeFunctionData({\n abi: abi,\n data: input,\n space,\n });\n let decodedResults = success\n ? !isReturnDataEmpty\n ? decodeFunctionResult({\n abi: abi,\n functionName: decodedParams.functionName,\n data: output,\n space,\n })\n : undefined\n : output;\n const abiItem = getAbiItem({\n abi: abi,\n name: decodedParams.functionName ?? methodID,\n }) as AbiFunctionWithoutGas;\n // if the output has only one value, decodeFunctionResult will return the value directly, otherwise it will return an array,\n // so we need to check the length of abiItem.outputs to determine whether to wrap decodedResults in an array\n const results =\n decodedResults === undefined\n ? undefined\n : abiItem.outputs.length === 1\n ? [decodedResults]\n : (decodedResults as unknown[]);\n if (!withOutput) {\n abiItem.outputs = [];\n }\n const fullName = formatABI([abiItem])[0];\n return {\n decodedParams,\n decodedResults: results,\n abiItem,\n fullName: fullName,\n failed: false,\n similarWarning,\n };\n } catch (error) {\n console.log('decode function data and result error', error);\n return {\n failed: true,\n similarWarning,\n };\n }\n};\n\nexport interface DecodedFunctionData {\n decodedParams?: {\n args: readonly unknown[] | undefined;\n functionName: string;\n };\n decodedResults?: unknown[];\n abiItem?: AbiFunctionWithoutGas;\n fullName?: string;\n // no abi for decoded\n noAbi?: boolean;\n // decoded failed\n failed?: boolean;\n // decoded by method abi, not contract abi\n similarWarning?: boolean;\n}\n\nexport const useDecodeFunctionData = ({\n to,\n abi: outerAbi,\n implementation: _implementation,\n input,\n output,\n space,\n success,\n supportMethodAbi,\n withOutput,\n}: {\n input: Hex;\n output?: Hex;\n to?: string;\n implementation?: string;\n abi?: AbiFunctionWithoutGas[];\n space: 'evm' | 'core';\n success?: boolean;\n supportMethodAbi?: boolean;\n withOutput?: boolean;\n}): [DecodedFunctionData, boolean] => {\n const hasOuterAbi = outerAbi && outerAbi.length > 0;\n const needContractAbi = !hasOuterAbi && !!input;\n const { data: contractData, isLoading: contractLoading } = useContractDetail(\n to,\n fields,\n needContractAbi,\n );\n const implementation =\n _implementation ?? contractData?.implementation?.address;\n const { data: implementationData, isLoading: implementationLoading } =\n useContractDetail(implementation, fields, needContractAbi);\n const decodedByOuterAbi = useMemo(() => {\n return decodeFunctionDataByAbi({\n abi: outerAbi,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, outerAbi, success, space, withOutput]);\n const decodedByContractAbi = useMemo(() => {\n if (!contractData?.abi) return null;\n return decodeFunctionDataByAbi({\n abi: contractData.abi as string,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, contractData?.abi, success, space, withOutput]);\n const decodedByImplementationAbi = useMemo(() => {\n if (!implementationData?.abi) return null;\n return decodeFunctionDataByAbi({\n abi: implementationData.abi as string,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, implementationData?.abi, success, space, withOutput]);\n const needMethodAbi =\n !!supportMethodAbi &&\n needContractAbi &&\n // contract abi decoded failed\n !contractLoading &&\n (!decodedByContractAbi || decodedByContractAbi.failed) &&\n // implementation contract abi decoded failed\n !implementationLoading &&\n (!decodedByImplementationAbi || decodedByImplementationAbi.failed);\n const { data: methodAbi, isLoading: methodAbiLoading } = useMethodAbi(\n input.slice(0, 10),\n needMethodAbi,\n );\n const decodedByMethodAbi = useMemo(() => {\n // decode tx data with function abi only if there is only one function\n if (!methodAbi || methodAbi.list.length !== 1) return null;\n try {\n // e.g. transfer(address,uint256)\n const fullName = methodAbi.list[0]!.fullName;\n // e.g. function transfer(address recipient, uint256 amount) returns (bool)\n const formatWithArg = methodAbi.list[0]!.formatWithArg;\n const abi = formatABI([formatWithArg || `function ${fullName}`], {\n json: true,\n });\n return decodeFunctionDataByAbi({\n abi: abi,\n input,\n output,\n space,\n success,\n withOutput,\n similarWarning: true,\n });\n } catch (error) {\n console.log('decode function data and result error', error);\n return {\n failed: true,\n };\n }\n }, [input, output, methodAbi, success, space, withOutput]);\n\n return useMemo(() => {\n if (!input) return [{}, false];\n if (decodedByOuterAbi && !decodedByOuterAbi.failed)\n return [decodedByOuterAbi, false];\n if (decodedByImplementationAbi && !decodedByImplementationAbi.failed)\n return [decodedByImplementationAbi, implementationLoading];\n if (decodedByContractAbi && !decodedByContractAbi.failed)\n return [decodedByContractAbi, contractLoading];\n if (decodedByMethodAbi && !decodedByMethodAbi.failed)\n return [decodedByMethodAbi, methodAbiLoading];\n if (\n (decodedByOuterAbi && decodedByOuterAbi.failed) ||\n (decodedByImplementationAbi && decodedByImplementationAbi.failed) ||\n (decodedByContractAbi && decodedByContractAbi.failed) ||\n (decodedByMethodAbi && decodedByMethodAbi.failed)\n ) {\n return [\n {\n failed: true,\n },\n false,\n ];\n }\n return [\n {\n noAbi: true,\n },\n false,\n ];\n }, [\n input,\n decodedByOuterAbi,\n decodedByContractAbi,\n decodedByImplementationAbi,\n decodedByMethodAbi,\n contractLoading,\n implementationLoading,\n methodAbiLoading,\n ]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAWxB,IAAM,SAAS,CAAC,KAAc;AAI9B,IAAM,0BAA0B,CAAC;AAAA,EAC/B,KAAK;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AACF,MAQM;AACJ,MAAI;AACF,UAAM,MAAM,OAAO,SAAS,WAAW,KAAK,MAAM,IAAI,IAAI;AAC1D,UAAM,SAAS,OAAO,IAAI,SAAS;AACnC,QAAI,CAAC;AAAQ,aAAO;AACpB,UAAM,oBAAoB,CAAC,UAAU,WAAW;AA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MAAM;AAAA,MACR,CAAC;AACD,aAAO,wBAAwB;AAAA,QAC7B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,gBAAgB;AAAA,MAClB,CAAC;AAAA,IACH,SAAS,OAAP;AACA,cAAQ,IAAI,yCAAyC,KAAK;AAC1D,aAAO;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,QAAQ,WAAW,SAAS,OAAO,UAAU,CAAC;AAEzD,SAAO,QAAQ,MAAM;AACnB,QAAI,CAAC;AAAO,aAAO,CAAC,CAAC,GAAG,KAAK;AAC7B,QAAI,qBAAqB,CAAC,kBAAkB;AAC1C,aAAO,CAAC,mBAAmB,KAAK;AAClC,QAAI,8BAA8B,CAAC,2BAA2B;AAC5D,aAAO,CAAC,4BAA4B,qBAAqB;AAC3D,QAAI,wBAAwB,CAAC,qBAAqB;AAChD,aAAO,CAAC,sBAAsB,eAAe;AAC/C,QAAI,sBAAsB,CAAC,mBAAmB;AAC5C,aAAO,CAAC,oBAAoB,gBAAgB;AAC9C,QACG,qBAAqB,kBAAkB,UACvC,8BAA8B,2BAA2B,UACzD,wBAAwB,qBAAqB,UAC7C,sBAAsB,mBAAmB,QAC1C;AACA,aAAO;AAAA,QACL;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,QACA;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,MACL;AAAA,QACE,OAAO;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -72,7 +72,7 @@ var RenderAddress = ({
|
|
|
72
72
|
hideAliasPrefixInHover = false
|
|
73
73
|
}) => {
|
|
74
74
|
const translations = getTranslations();
|
|
75
|
-
const name = content || ENSLabel || nametag ||
|
|
75
|
+
const name = addressLabel || content || ENSLabel || nametag || alias;
|
|
76
76
|
const defaultStyle = {
|
|
77
77
|
maxWidth: `${name && isFullNameTag || isFull ? "auto" : (maxWidth || defaultPCMaxWidth) + "px"}`
|
|
78
78
|
};
|
|
@@ -127,4 +127,4 @@ var RenderAddress = ({
|
|
|
127
127
|
export {
|
|
128
128
|
RenderAddress
|
|
129
129
|
};
|
|
130
|
-
//# sourceMappingURL=chunk-
|
|
130
|
+
//# sourceMappingURL=chunk-AIBPOND2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/addressView.tsx"],"sourcesContent":["import { Translation } from 'react-i18next';\nimport { Text } from '../Text';\nimport { convertCheckSum } from '../../utils/address';\nimport { getTranslations } from '../../store';\nimport { TooltipContent, RenderAddressProps } from './types';\nimport { shortenAddress } from '@cfx-kit/dapp-utils/dist/address';\n\nconst defaultPCMaxWidth = 138;\n\n// common\nconst renderTooltipContent = (tooltipContent: TooltipContent) => {\n return Object.entries(tooltipContent)\n .map(([key, { label, value, hideLabel }]) => {\n if (value) {\n return (\n <div key={key}>\n {!hideLabel && (\n <span>\n <Translation>{t => t(label)}</Translation>\n </span>\n )}\n {value}\n </div>\n );\n }\n return null;\n })\n .filter(Boolean);\n};\n\n// common\nconst convertLink = ({\n link,\n type,\n hrefAddress,\n cfxAddress,\n}: RenderAddressProps) => {\n if (typeof link === 'string') {\n return link;\n }\n if (link === false) {\n return false;\n }\n\n const address = hrefAddress || cfxAddress;\n\n if (address && typeof address === 'string') {\n const pathname = window.location.pathname.toLowerCase();\n const addressLower = address.toLowerCase();\n if (pathname.includes('/address/' + addressLower)) {\n return false;\n }\n\n if (type === 'pow') {\n return `/address/${address}`;\n }\n\n if (type === 'pos') {\n return `/pos/accounts/${address}`;\n }\n }\n\n return false;\n};\n\n// common\nexport const RenderAddress = ({\n cfxAddress,\n alias,\n hoverValue,\n hrefAddress,\n content,\n link = '',\n isFull = false,\n isFullNameTag = false,\n style = {},\n maxWidth,\n prefix = null,\n suffix = null,\n type = 'pow',\n addressLabel = '',\n ENSLabel = '',\n nametag = '',\n hideAliasPrefixInHover = false,\n}: RenderAddressProps) => {\n const translations = getTranslations();\n\n // Private name tags >CNS/ENS>Official tag/name>contract tag > contract token name > contract name\n const name = addressLabel || content || ENSLabel || nametag || alias;\n\n const defaultStyle = {\n maxWidth: `${(name && isFullNameTag) || isFull ? 'auto' : (maxWidth || defaultPCMaxWidth) + 'px'}`,\n };\n\n const href = convertLink({ link, type, hrefAddress, cfxAddress });\n\n const Wrapper = href ? 'a' : 'div';\n\n const tooltipContent: TooltipContent = {\n ENSLabel: {\n label: (translations as any)?.ens?.tip,\n value: ENSLabel,\n },\n nametag: {\n label: translations?.nametag?.tip,\n value: nametag,\n },\n addressLabel: {\n label: translations?.profile.address.myNameTag,\n value: addressLabel,\n },\n alias: {\n label: translations?.profile.address.publicNameTag,\n value: alias,\n hideLabel: hideAliasPrefixInHover,\n },\n };\n\n const checksumAddress = convertCheckSum(cfxAddress);\n\n const cfxAddressLabel =\n typeof cfxAddress === 'string' && !isFull\n ? shortenAddress(checksumAddress!)\n : checksumAddress;\n\n return (\n <div className=\"inline-flex\">\n {prefix}\n <Text\n tag=\"span\"\n hoverValue={\n <>\n {renderTooltipContent(tooltipContent)}\n <div>{hoverValue || checksumAddress}</div>\n </>\n }\n >\n <Wrapper\n className=\"block relative align-bottom cursor-default truncate\"\n style={{ ...defaultStyle, ...style }}\n {...(href ? { href: String(href) } : {})}\n >\n {name || cfxAddressLabel}\n </Wrapper>\n </Text>\n {suffix}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,mBAAmB;AAK5B,SAAS,sBAAsB;AAUrB,SAoHA,UAjHM,KAHN;AARV,IAAM,oBAAoB;AAG1B,IAAM,uBAAuB,CAAC,mBAAmC;AAC/D,SAAO,OAAO,QAAQ,cAAc,EACjC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,OAAO,UAAU,C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O,YAAY,EAAE,MAAM,MAAM,aAAa,WAAW,CAAC;AAEhE,QAAM,UAAU,OAAO,MAAM;AAE7B,QAAM,iBAAiC;AAAA,IACrC,UAAU;AAAA,MACR,OAAQ,cAAsB,KAAK;AAAA,MACnC,OAAO;AAAA,IACT;AAAA,IACA,SAAS;AAAA,MACP,OAAO,cAAc,SAAS;AAAA,MAC9B,OAAO;AAAA,IACT;AAAA,IACA,cAAc;AAAA,MACZ,OAAO,cAAc,QAAQ,QAAQ;AAAA,MACrC,OAAO;AAAA,IACT;AAAA,IACA,OAAO;AAAA,MACL,OAAO,cAAc,QAAQ,QAAQ;AAAA,MACrC,OAAO;AAAA,MACP,WAAW;AAAA,IACb;AAAA,EACF;AAEA,QAAM,kBAAkB,gBAAgB,UAAU;AAElD,QAAM,kBACJ,OAAO,eAAe,YAAY,CAAC,SAC/B,eAAe,eAAgB,IAC/B;AAEN,SACE,qBAAC,SAAI,WAAU,eACZ;AAAA;AAAA,IACD;AAAA,MAAC;AAAA;AAAA,QACC,KAAI;AAAA,QACJ,YACE,iCACG;AAAA,+BAAqB,cAAc;AAAA,UACpC,oBAAC,SAAK,wBAAc,iBAAgB;AAAA,WACtC;AAAA,QAGF;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,OAAO,EAAE,GAAG,cAAc,GAAG,MAAM;AAAA,YAClC,GAAI,OAAO,EAAE,MAAM,OAAO,IAAI,EAAE,IAAI,CAAC;AAAA,YAErC,kBAAQ;AAAA;AAAA,QACX;AAAA;AAAA,IACF;AAAA,IACC;AAAA,KACH;AAEJ;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-XZ7IV2FF.js";
|
|
4
4
|
import {
|
|
5
5
|
TraceDetail
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UINFSWXM.js";
|
|
7
7
|
|
|
8
8
|
// src/components/TransactionTrace/TreeTraceTable.tsx
|
|
9
9
|
import { useMemo } from "react";
|
|
@@ -79,4 +79,4 @@ var TreeTraceTable = ({
|
|
|
79
79
|
export {
|
|
80
80
|
TreeTraceTable
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-CPX5R5ND.js.map
|
|
@@ -35,13 +35,7 @@ var OutputData = ({
|
|
|
35
35
|
if (!success)
|
|
36
36
|
return /* @__PURE__ */ jsx(Original, { data: output });
|
|
37
37
|
if (decodedData) {
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
-
GeneralDecode,
|
|
40
|
-
{
|
|
41
|
-
data: output,
|
|
42
|
-
fullName: decodedData.fullName
|
|
43
|
-
}
|
|
44
|
-
);
|
|
38
|
+
return /* @__PURE__ */ jsx(GeneralDecode, { data: output, includeMethodID: false });
|
|
45
39
|
}
|
|
46
40
|
} else if (dataType === "optimizationDecode") {
|
|
47
41
|
if (!success) {
|
|
@@ -75,4 +69,4 @@ var OutputData = ({
|
|
|
75
69
|
export {
|
|
76
70
|
OutputData
|
|
77
71
|
};
|
|
78
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-GFY6G6I2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/OutputData/index.tsx"],"sourcesContent":["import { DataType } from 'src/utils/hooks/useDecodedDataType';\nimport { DecodedFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\nimport { ErrorDecode } from './ErrorDecode';\nimport { Original } from '../InputData/Original';\nimport { UTF8 } from '../InputData/UTF8';\nimport { GeneralDecode } from '../InputData/GeneralDecode';\nimport { DecodedParameters } from '../InputData/OptimizationDecode';\n\nexport const OutputData = ({\n decodedData,\n dataType,\n output,\n to,\n space,\n success,\n proxy,\n labelClassName,\n}: {\n decodedData?: DecodedFunctionData;\n dataType: DataType;\n output?: `0x${string}`;\n space: 'evm' | 'core';\n to?: string;\n labelClassName?: string;\n success?: boolean;\n proxy?: {\n beaconAddress?: string;\n implAddress: string;\n };\n}) => {\n const isReturnDataEmpty = !output || output === '0x';\n if (isReturnDataEmpty) return null;\n if (dataType === 'utf8') {\n return <UTF8 data={output}></UTF8>;\n } else if (dataType === 'generalDecode') {\n if (!success) return <Original data={output}></Original>;\n if (decodedData) {\n return (\n <GeneralDecode data={output} includeMethodID={false}></GeneralDecode>\n );\n }\n } else if (dataType === 'optimizationDecode') {\n if (!success) {\n return (\n <ErrorDecode\n to={to}\n space={space}\n errorData={output}\n proxy={proxy}\n labelClassName={labelClassName}\n ></ErrorDecode>\n );\n }\n if (decodedData) {\n return (\n <DecodedParameters\n args={decodedData.decodedResults}\n params={decodedData.abiItem?.outputs ?? []}\n label=\"Return:\"\n labelClassName={labelClassName}\n space={space}\n />\n );\n }\n }\n return <Original data={output}></Original>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCW;AAzBJ,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAYM;AACJ,QAAM,oBAAoB,CAAC,UAAU,WAAW;AAChD,MAAI;AAAmB,WAAO;AAC9B,MAAI,aAAa,QAAQ;AACvB,WAAO,oBAAC,QAAK,MAAM,QAAQ;AAAA,EAC7B,WAAW,aAAa,iBAAiB;AACvC,QAAI,CAAC;AAAS,aAAO,oBAAC,YAAS,MAAM,QAAQ;AAC7C,QAAI,aAAa;AACf,aACE,oBAAC,iBAAc,MAAM,QAAQ,iBAAiB,OAAO;AAAA,IAEzD;AAAA,EACF,WAAW,aAAa,sBAAsB;AAC5C,QAAI,CAAC,SAAS;AACZ,aACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX;AAAA,UACA;AAAA;AAAA,MACD;AAAA,IAEL;AACA,QAAI,aAAa;AACf,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,YAAY;AAAA,UAClB,QAAQ,YAAY,SAAS,WAAW,CAAC;AAAA,UACzC,OAAM;AAAA,UACN;AAAA,UACA;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AACA,SAAO,oBAAC,YAAS,MAAM,QAAQ;AACjC;","names":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-JFFTHCNE.js";
|
|
4
4
|
import {
|
|
5
5
|
RenderAddress
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AIBPOND2.js";
|
|
7
7
|
import {
|
|
8
8
|
formatAddress,
|
|
9
9
|
isInnerContractAddress
|
|
@@ -205,4 +205,4 @@ export {
|
|
|
205
205
|
MyAddress,
|
|
206
206
|
PosAddress
|
|
207
207
|
};
|
|
208
|
-
//# sourceMappingURL=chunk-
|
|
208
|
+
//# sourceMappingURL=chunk-H5VKAQ2A.js.map
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
ContractCreatedAddress,
|
|
4
4
|
InvalidAddress,
|
|
5
5
|
MyAddress
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H5VKAQ2A.js";
|
|
7
7
|
import {
|
|
8
8
|
RenderAddress
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AIBPOND2.js";
|
|
10
10
|
import {
|
|
11
11
|
convertCheckSum,
|
|
12
12
|
formatAddress,
|
|
@@ -105,4 +105,4 @@ var EVMAddressContainer = withTranslation()(
|
|
|
105
105
|
export {
|
|
106
106
|
EVMAddressContainer
|
|
107
107
|
};
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-NA2IXF26.js.map
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
InvalidAddress,
|
|
9
9
|
MyAddress,
|
|
10
10
|
PosAddress
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-H5VKAQ2A.js";
|
|
12
12
|
import {
|
|
13
13
|
RenderAddress
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AIBPOND2.js";
|
|
15
15
|
import {
|
|
16
16
|
formatAddress,
|
|
17
17
|
isCoreAddress,
|
|
@@ -138,4 +138,4 @@ var CoreAddressContainer = withTranslation()(
|
|
|
138
138
|
export {
|
|
139
139
|
CoreAddressContainer
|
|
140
140
|
};
|
|
141
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-PTIDOK4R.js.map
|
|
@@ -21,7 +21,8 @@ var InputData = ({
|
|
|
21
21
|
dataType,
|
|
22
22
|
input,
|
|
23
23
|
space,
|
|
24
|
-
labelClassName
|
|
24
|
+
labelClassName,
|
|
25
|
+
success
|
|
25
26
|
}) => {
|
|
26
27
|
if (dataType === "utf8") {
|
|
27
28
|
return /* @__PURE__ */ jsx(UTF8, { data: input });
|
|
@@ -32,7 +33,8 @@ var InputData = ({
|
|
|
32
33
|
decodedParams: decodedData.decodedParams,
|
|
33
34
|
decodedResults: decodedData.decodedResults,
|
|
34
35
|
abiItem: decodedData.abiItem,
|
|
35
|
-
input
|
|
36
|
+
input,
|
|
37
|
+
success
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
40
|
} else if (dataType === "generalDecode") {
|
|
@@ -61,4 +63,4 @@ var InputData = ({
|
|
|
61
63
|
export {
|
|
62
64
|
InputData
|
|
63
65
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
66
|
+
//# sourceMappingURL=chunk-TLAXH2HE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/InputData/index.tsx"],"sourcesContent":["import { DataType } from 'src/utils/hooks/useDecodedDataType';\nimport { Original } from './Original';\nimport { UTF8 } from './UTF8';\nimport { JsonDecode } from './JsonDecode';\nimport { OptimizationDecode } from './OptimizationDecode';\nimport { GeneralDecode } from './GeneralDecode';\nimport { DecodedFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\n\nexport const InputData = ({\n decodedData,\n dataType,\n input,\n space,\n labelClassName,\n success,\n}: {\n decodedData: DecodedFunctionData;\n dataType: DataType;\n input: `0x${string}`;\n space: 'evm' | 'core';\n labelClassName?: string;\n success?: boolean;\n}) => {\n if (dataType === 'utf8') {\n return <UTF8 data={input}></UTF8>;\n } else if (\n dataType === 'json' &&\n decodedData.decodedParams &&\n decodedData.abiItem\n ) {\n return (\n <JsonDecode\n decodedParams={decodedData.decodedParams}\n decodedResults={decodedData.decodedResults}\n abiItem={decodedData.abiItem}\n input={input}\n success={success}\n ></JsonDecode>\n );\n } else if (dataType === 'generalDecode') {\n return (\n <GeneralDecode\n data={input}\n fullName={decodedData.fullName}\n ></GeneralDecode>\n );\n } else if (\n dataType === 'optimizationDecode' &&\n decodedData.decodedParams &&\n decodedData.abiItem\n ) {\n return (\n <OptimizationDecode\n decodedParams={decodedData.decodedParams}\n abiItem={decodedData.abiItem}\n input={input}\n labelClassName={labelClassName}\n space={space}\n ></OptimizationDecode>\n );\n }\n return <Original data={input}></Original>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBW;AAhBJ,IAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAOM;AACJ,MAAI,aAAa,QAAQ;AACvB,WAAO,oBAAC,QAAK,MAAM,OAAO;AAAA,EAC5B,WACE,aAAa,UACb,YAAY,iBACZ,YAAY,SACZ;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAe,YAAY;AAAA,QAC3B,gBAAgB,YAAY;AAAA,QAC5B,SAAS,YAAY;AAAA,QACrB;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEL,WAAW,aAAa,iBAAiB;AACvC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,YAAY;AAAA;AAAA,IACvB;AAAA,EAEL,WACE,aAAa,wBACb,YAAY,iBACZ,YAAY,SACZ;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAe,YAAY;AAAA,QAC3B,SAAS,YAAY;AAAA,QACrB;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEL;AACA,SAAO,oBAAC,YAAS,MAAM,OAAO;AAChC;","names":[]}
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
} from "./chunk-UM5J477V.js";
|
|
4
4
|
import {
|
|
5
5
|
useDecodeFunctionData
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7TNE7P6L.js";
|
|
7
7
|
import {
|
|
8
8
|
Select
|
|
9
9
|
} from "./chunk-YIZCD4WG.js";
|
|
10
10
|
import {
|
|
11
11
|
OutputData
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GFY6G6I2.js";
|
|
13
13
|
import {
|
|
14
14
|
InputData
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TLAXH2HE.js";
|
|
16
16
|
import {
|
|
17
17
|
Card
|
|
18
18
|
} from "./chunk-O6NJ56NA.js";
|
|
@@ -53,6 +53,7 @@ var CommonTraceDetail = ({
|
|
|
53
53
|
isContractCreated,
|
|
54
54
|
decodedData
|
|
55
55
|
});
|
|
56
|
+
const isReturnDataEmpty = !output || output === "0x";
|
|
56
57
|
let outputDataType = dataType;
|
|
57
58
|
if ((outputDataType === "optimizationDecode" || outputDataType === "generalDecode") && outcome === "fail") {
|
|
58
59
|
outputDataType = "utf8";
|
|
@@ -93,11 +94,12 @@ var CommonTraceDetail = ({
|
|
|
93
94
|
input,
|
|
94
95
|
decodedData,
|
|
95
96
|
space,
|
|
96
|
-
labelClassName: "text-#002257 w-150px"
|
|
97
|
+
labelClassName: "text-#002257 w-150px",
|
|
98
|
+
success
|
|
97
99
|
}
|
|
98
100
|
) })
|
|
99
101
|
] }),
|
|
100
|
-
dataType !== "json" && /* @__PURE__ */ jsxs("div", { className: "flex gap-5px mt-16px", children: [
|
|
102
|
+
dataType !== "json" && !isReturnDataEmpty && /* @__PURE__ */ jsxs("div", { className: "flex gap-5px mt-16px", children: [
|
|
101
103
|
outputDataType !== "optimizationDecode" && /* @__PURE__ */ jsx("div", { className: clsx("w-150px shrink-0", !success && "text-red"), children: outcome === "success" ? "Output Data" : outcome === "fail" ? "Failed" : "Error" }),
|
|
102
104
|
/* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(
|
|
103
105
|
OutputData,
|
|
@@ -183,4 +185,4 @@ var TraceDetail = (props) => {
|
|
|
183
185
|
export {
|
|
184
186
|
TraceDetail
|
|
185
187
|
};
|
|
186
|
-
//# sourceMappingURL=chunk-
|
|
188
|
+
//# sourceMappingURL=chunk-UINFSWXM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TransactionTrace/TraceDetail.tsx"],"sourcesContent":["import { Card } from '../Card';\nimport { Select } from '../Select';\nimport { useTranslation } from 'react-i18next';\nimport { getTranslations } from 'src/store';\nimport clsx from 'clsx';\nimport { useDecodeFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\nimport {\n DataType,\n useDecodedDataType,\n} from 'src/utils/hooks/useDecodedDataType';\nimport { InputData } from '../InputData';\nimport { OutputData } from '../OutputData';\nimport { AbiFunctionWithoutGas } from 'src/utils/sdk';\nimport { useState } from 'react';\n\ninterface Props {\n to?: string;\n isContractCreated?: boolean;\n input?: `0x${string}`;\n output?: `0x${string}`;\n abi?: AbiFunctionWithoutGas[];\n outcome?: 'success' | 'fail' | 'reverted';\n space: 'evm' | 'core';\n proxy?: {\n beaconAddress?: string;\n implAddress: string;\n };\n}\n\nconst CommonTraceDetail = ({\n to,\n input = '0x',\n output,\n outcome = 'success',\n abi,\n isContractCreated,\n space,\n proxy,\n}: Props) => {\n const success = outcome === 'success';\n const { t } = useTranslation();\n const translations = getTranslations();\n const [decodedData] = useDecodeFunctionData({\n to,\n input,\n output,\n success,\n space,\n abi,\n withOutput: true,\n });\n const { dataType, setDataType, dataTypeList } = useDecodedDataType({\n to,\n input,\n isContractCreated,\n decodedData,\n });\n const isReturnDataEmpty = !output || output === '0x';\n let outputDataType = dataType;\n // when the transaction failed, the output is the error message, use utf8 as decode type\n if (\n (outputDataType === 'optimizationDecode' ||\n outputDataType === 'generalDecode') &&\n outcome === 'fail'\n ) {\n outputDataType = 'utf8';\n }\n\n return (\n <Card className=\"!border-1 !border-#E8E9EA py-10px\">\n <div className=\"flex gap-5px\">\n <div className=\"w-150px shrink-0\"></div>\n <Select\n value={dataType}\n onChange={setDataType}\n disableMatchWidth\n size=\"medium\"\n className=\"mb-16px mt-0 bg-#fff border border-solid border-#ccc\"\n disabled={dataTypeList.length === 1}\n width={180}\n >\n {dataTypeList.map(dataTypeItem => {\n return (\n <Select.Option\n className=\"data-[highlighted]:bg-[var(--theme-color-green2)] data-[highlighted]:text-#fff\"\n key={dataTypeItem}\n value={dataTypeItem}\n >\n {t(translations.transaction.select[dataTypeItem])}\n </Select.Option>\n );\n })}\n </Select>\n </div>\n <div className=\"flex gap-5px\">\n {dataType !== 'optimizationDecode' && (\n <div className=\"w-150px shrink-0\">\n {dataType === 'json' ? 'In and Out Data' : 'Input Data'}\n </div>\n )}\n <div className=\"flex-1\">\n <InputData\n dataType={dataType}\n input={input}\n decodedData={decodedData}\n space={space}\n labelClassName=\"text-#002257 w-150px\"\n success={success}\n />\n </div>\n </div>\n {dataType !== 'json' && !isReturnDataEmpty && (\n <div className=\"flex gap-5px mt-16px\">\n {outputDataType !== 'optimizationDecode' && (\n <div className={clsx('w-150px shrink-0', !success && 'text-red')}>\n {outcome === 'success'\n ? 'Output Data'\n : outcome === 'fail'\n ? 'Failed'\n : 'Error'}\n </div>\n )}\n <div className=\"flex-1\">\n <OutputData\n dataType={outputDataType}\n output={output}\n decodedData={decodedData}\n space={space}\n proxy={proxy}\n success={success}\n to={to}\n labelClassName={clsx(\n 'w-150px',\n !success ? 'text-red' : 'text-#002257',\n )}\n />\n </div>\n </div>\n )}\n </Card>\n );\n};\n\n// create contract failed may return error data, but it's not standard, so we only show error info for it\nconst CreateContractFailedTraceDetail = ({\n to,\n output,\n space,\n proxy,\n outcome,\n}: Props) => {\n const [dataType, setDataType] = useState<DataType>('utf8');\n const { t } = useTranslation();\n const translations = getTranslations();\n const dataTypeList = ['original', 'utf8'] as DataType[];\n\n return (\n <Card className=\"!border-1 !border-#E8E9EA py-10px\">\n <div className=\"flex gap-5px\">\n <div className=\"w-150px shrink-0\"></div>\n <Select\n value={dataType}\n onChange={setDataType}\n disableMatchWidth\n size=\"medium\"\n className=\"mb-16px mt-0 bg-#fff border border-solid border-#ccc\"\n disabled={dataTypeList.length === 1}\n width={180}\n >\n {dataTypeList.map(dataTypeItem => {\n return (\n <Select.Option\n className=\"data-[highlighted]:bg-[var(--theme-color-green2)] data-[highlighted]:text-#fff\"\n key={dataTypeItem}\n value={dataTypeItem}\n >\n {t(translations.transaction.select[dataTypeItem])}\n </Select.Option>\n );\n })}\n </Select>\n </div>\n <div className=\"flex gap-5px mt-16px\">\n <div className={clsx('w-150px shrink-0 text-red')}>\n {outcome === 'fail' ? 'Failed' : 'Error'}\n </div>\n <div className=\"flex-1\">\n <OutputData\n dataType={dataType}\n output={output}\n space={space}\n proxy={proxy}\n success={false}\n to={to}\n labelClassName=\"w-150px text-red\"\n />\n </div>\n </div>\n </Card>\n );\n};\n\nexport const TraceDetail = (props: Props) => {\n const { outcome = 'success', isContractCreated } = props;\n if (isContractCreated && outcome !== 'success')\n return <CreateContractFailedTraceDetail {...props} />;\n return <CommonTraceDetail {...props} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,sBAAsB;AAE/B,OAAO,UAAU;AASjB,SAAS,gBAAgB;AAyDnB,SACE,KADF;AAzCN,IAAM,oBAAoB,CAAC;AAAA,EACzB;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAa;AACX,QAAM,UAAU,YAAY;AAC5B,QAAM,EAAE,EAAE,I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AA2B,GAC7C,sBAAY,SAAS,WAAW,SACnC;AAAA,MACA,oBAAC,SAAI,WAAU,UACb;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,gBAAe;AAAA;AAAA,MACjB,GACF;AAAA,OACF;AAAA,KACF;AAEJ;AAEO,IAAM,cAAc,CAAC,UAAiB;AAC3C,QAAM,EAAE,UAAU,WAAW,kBAAkB,IAAI;AACnD,MAAI,qBAAqB,YAAY;AACnC,WAAO,oBAAC,mCAAiC,GAAG,OAAO;AACrD,SAAO,oBAAC,qBAAmB,GAAG,OAAO;AACvC;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CoreAddressContainer
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-PTIDOK4R.js";
|
|
4
4
|
import "../../chunk-BUSBM33B.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-H5VKAQ2A.js";
|
|
6
6
|
import "../../chunk-JFFTHCNE.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-AIBPOND2.js";
|
|
8
8
|
import "../../chunk-CNF26YY7.js";
|
|
9
9
|
import "../../chunk-P4EE3QGM.js";
|
|
10
10
|
import "../../chunk-TOKKKTFG.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EVMAddressContainer
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import "../../chunk-
|
|
3
|
+
} from "../../chunk-NA2IXF26.js";
|
|
4
|
+
import "../../chunk-H5VKAQ2A.js";
|
|
5
5
|
import "../../chunk-JFFTHCNE.js";
|
|
6
|
-
import "../../chunk-
|
|
6
|
+
import "../../chunk-AIBPOND2.js";
|
|
7
7
|
import "../../chunk-CNF26YY7.js";
|
|
8
8
|
import "../../chunk-P4EE3QGM.js";
|
|
9
9
|
import "../../chunk-TOKKKTFG.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
InvalidAddress,
|
|
6
6
|
MyAddress,
|
|
7
7
|
PosAddress
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-H5VKAQ2A.js";
|
|
9
9
|
import "../../chunk-JFFTHCNE.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-AIBPOND2.js";
|
|
11
11
|
import "../../chunk-CNF26YY7.js";
|
|
12
12
|
import "../../chunk-P4EE3QGM.js";
|
|
13
13
|
import "../../chunk-TOKKKTFG.js";
|
|
@@ -4,12 +4,13 @@ import { DecodedFunctionData } from '../../utils/hooks/useDecodeFunctionData.js'
|
|
|
4
4
|
import '../../utils/sdk.js';
|
|
5
5
|
import 'viem';
|
|
6
6
|
|
|
7
|
-
declare const InputData: ({ decodedData, dataType, input, space, labelClassName, }: {
|
|
7
|
+
declare const InputData: ({ decodedData, dataType, input, space, labelClassName, success, }: {
|
|
8
8
|
decodedData: DecodedFunctionData;
|
|
9
9
|
dataType: DataType;
|
|
10
10
|
input: `0x${string}`;
|
|
11
11
|
space: 'evm' | 'core';
|
|
12
12
|
labelClassName?: string | undefined;
|
|
13
|
+
success?: boolean | undefined;
|
|
13
14
|
}) => react_jsx_runtime.JSX.Element;
|
|
14
15
|
|
|
15
16
|
export { InputData };
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
import "../../chunk-TGK5LP2H.js";
|
|
11
11
|
import {
|
|
12
12
|
CoreAddressContainer
|
|
13
|
-
} from "../../chunk-
|
|
13
|
+
} from "../../chunk-PTIDOK4R.js";
|
|
14
14
|
import "../../chunk-BUSBM33B.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-H5VKAQ2A.js";
|
|
16
16
|
import "../../chunk-JFFTHCNE.js";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-AIBPOND2.js";
|
|
18
18
|
import "../../chunk-CNF26YY7.js";
|
|
19
19
|
import "../../chunk-P4EE3QGM.js";
|
|
20
20
|
import "../../chunk-TOKKKTFG.js";
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
import "../../chunk-TGK5LP2H.js";
|
|
11
11
|
import {
|
|
12
12
|
EVMAddressContainer
|
|
13
|
-
} from "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-NA2IXF26.js";
|
|
14
|
+
import "../../chunk-H5VKAQ2A.js";
|
|
15
15
|
import "../../chunk-JFFTHCNE.js";
|
|
16
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-AIBPOND2.js";
|
|
17
17
|
import {
|
|
18
18
|
formatAddress
|
|
19
19
|
} from "../../chunk-CNF26YY7.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TraceDetail
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-UINFSWXM.js";
|
|
4
4
|
import "../../chunk-UM5J477V.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-7TNE7P6L.js";
|
|
6
6
|
import "../../chunk-E3ZD2GGG.js";
|
|
7
7
|
import "../../chunk-YIZCD4WG.js";
|
|
8
8
|
import "../../chunk-EMPFZFBS.js";
|
|
9
9
|
import "../../chunk-NWVSTRCG.js";
|
|
10
|
-
import "../../chunk-
|
|
10
|
+
import "../../chunk-GFY6G6I2.js";
|
|
11
11
|
import "../../chunk-6HJCR6PQ.js";
|
|
12
12
|
import "../../chunk-K6FHTS3F.js";
|
|
13
13
|
import "../../chunk-6SXAFSBF.js";
|
|
14
14
|
import "../../chunk-JIRLY7OG.js";
|
|
15
15
|
import "../../chunk-4B6ASBYQ.js";
|
|
16
16
|
import "../../chunk-3PXUIH3S.js";
|
|
17
|
-
import "../../chunk-
|
|
17
|
+
import "../../chunk-TLAXH2HE.js";
|
|
18
18
|
import "../../chunk-OYESIV3F.js";
|
|
19
19
|
import "../../chunk-L62OTV7F.js";
|
|
20
20
|
import "../../chunk-U6ZN2ABK.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeTraceTable
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-CPX5R5ND.js";
|
|
4
4
|
import "../../chunk-XZ7IV2FF.js";
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
import "../../chunk-UINFSWXM.js";
|
|
6
6
|
import "../../chunk-UM5J477V.js";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-7TNE7P6L.js";
|
|
8
8
|
import "../../chunk-E3ZD2GGG.js";
|
|
9
9
|
import "../../chunk-YIZCD4WG.js";
|
|
10
10
|
import "../../chunk-EMPFZFBS.js";
|
|
11
11
|
import "../../chunk-NWVSTRCG.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-GFY6G6I2.js";
|
|
13
13
|
import "../../chunk-6HJCR6PQ.js";
|
|
14
14
|
import "../../chunk-K6FHTS3F.js";
|
|
15
15
|
import "../../chunk-6SXAFSBF.js";
|
|
16
16
|
import "../../chunk-JIRLY7OG.js";
|
|
17
17
|
import "../../chunk-4B6ASBYQ.js";
|
|
18
18
|
import "../../chunk-3PXUIH3S.js";
|
|
19
|
-
import "../../chunk-
|
|
19
|
+
import "../../chunk-TLAXH2HE.js";
|
|
20
20
|
import "../../chunk-OYESIV3F.js";
|
|
21
21
|
import "../../chunk-L62OTV7F.js";
|
|
22
22
|
import "../../chunk-U6ZN2ABK.js";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TreeTraceTable
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-CPX5R5ND.js";
|
|
4
4
|
import "../../chunk-XZ7IV2FF.js";
|
|
5
5
|
import {
|
|
6
6
|
TraceDetail
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-UINFSWXM.js";
|
|
8
8
|
import "../../chunk-UM5J477V.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-7TNE7P6L.js";
|
|
10
10
|
import "../../chunk-E3ZD2GGG.js";
|
|
11
11
|
import "../../chunk-YIZCD4WG.js";
|
|
12
12
|
import "../../chunk-EMPFZFBS.js";
|
|
13
13
|
import "../../chunk-NWVSTRCG.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-GFY6G6I2.js";
|
|
15
15
|
import "../../chunk-6HJCR6PQ.js";
|
|
16
16
|
import "../../chunk-K6FHTS3F.js";
|
|
17
17
|
import "../../chunk-6SXAFSBF.js";
|
|
18
18
|
import "../../chunk-JIRLY7OG.js";
|
|
19
19
|
import "../../chunk-4B6ASBYQ.js";
|
|
20
20
|
import "../../chunk-3PXUIH3S.js";
|
|
21
|
-
import "../../chunk-
|
|
21
|
+
import "../../chunk-TLAXH2HE.js";
|
|
22
22
|
import "../../chunk-OYESIV3F.js";
|
|
23
23
|
import "../../chunk-L62OTV7F.js";
|
|
24
24
|
import "../../chunk-U6ZN2ABK.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/TransactionTrace/TraceDetail.tsx"],"sourcesContent":["import { Card } from '../Card';\nimport { Select } from '../Select';\nimport { useTranslation } from 'react-i18next';\nimport { getTranslations } from 'src/store';\nimport clsx from 'clsx';\nimport { useDecodeFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\nimport {\n DataType,\n useDecodedDataType,\n} from 'src/utils/hooks/useDecodedDataType';\nimport { InputData } from '../InputData';\nimport { OutputData } from '../OutputData';\nimport { AbiFunctionWithoutGas } from 'src/utils/sdk';\nimport { useState } from 'react';\n\ninterface Props {\n to?: string;\n isContractCreated?: boolean;\n input?: `0x${string}`;\n output?: `0x${string}`;\n abi?: AbiFunctionWithoutGas[];\n outcome?: 'success' | 'fail' | 'reverted';\n space: 'evm' | 'core';\n proxy?: {\n beaconAddress?: string;\n implAddress: string;\n };\n}\n\nconst CommonTraceDetail = ({\n to,\n input = '0x',\n output,\n outcome = 'success',\n abi,\n isContractCreated,\n space,\n proxy,\n}: Props) => {\n const success = outcome === 'success';\n const { t } = useTranslation();\n const translations = getTranslations();\n const [decodedData] = useDecodeFunctionData({\n to,\n input,\n output,\n success,\n space,\n abi,\n withOutput: true,\n });\n const { dataType, setDataType, dataTypeList } = useDecodedDataType({\n to,\n input,\n isContractCreated,\n decodedData,\n });\n let outputDataType = dataType;\n // when the transaction failed, the output is the error message, use utf8 as decode type\n if (\n (outputDataType === 'optimizationDecode' ||\n outputDataType === 'generalDecode') &&\n outcome === 'fail'\n ) {\n outputDataType = 'utf8';\n }\n\n return (\n <Card className=\"!border-1 !border-#E8E9EA py-10px\">\n <div className=\"flex gap-5px\">\n <div className=\"w-150px shrink-0\"></div>\n <Select\n value={dataType}\n onChange={setDataType}\n disableMatchWidth\n size=\"medium\"\n className=\"mb-16px mt-0 bg-#fff border border-solid border-#ccc\"\n disabled={dataTypeList.length === 1}\n width={180}\n >\n {dataTypeList.map(dataTypeItem => {\n return (\n <Select.Option\n className=\"data-[highlighted]:bg-[var(--theme-color-green2)] data-[highlighted]:text-#fff\"\n key={dataTypeItem}\n value={dataTypeItem}\n >\n {t(translations.transaction.select[dataTypeItem])}\n </Select.Option>\n );\n })}\n </Select>\n </div>\n <div className=\"flex gap-5px\">\n {dataType !== 'optimizationDecode' && (\n <div className=\"w-150px shrink-0\">\n {dataType === 'json' ? 'In and Out Data' : 'Input Data'}\n </div>\n )}\n <div className=\"flex-1\">\n <InputData\n dataType={dataType}\n input={input}\n decodedData={decodedData}\n space={space}\n labelClassName=\"text-#002257 w-150px\"\n />\n </div>\n </div>\n {dataType !== 'json' && (\n <div className=\"flex gap-5px mt-16px\">\n {outputDataType !== 'optimizationDecode' && (\n <div className={clsx('w-150px shrink-0', !success && 'text-red')}>\n {outcome === 'success'\n ? 'Output Data'\n : outcome === 'fail'\n ? 'Failed'\n : 'Error'}\n </div>\n )}\n <div className=\"flex-1\">\n <OutputData\n dataType={outputDataType}\n output={output}\n decodedData={decodedData}\n space={space}\n proxy={proxy}\n success={success}\n to={to}\n labelClassName={clsx(\n 'w-150px',\n !success ? 'text-red' : 'text-#002257',\n )}\n />\n </div>\n </div>\n )}\n </Card>\n );\n};\n\n// create contract failed may return error data, but it's not standard, so we only show error info for it\nconst CreateContractFailedTraceDetail = ({\n to,\n output,\n space,\n proxy,\n outcome,\n}: Props) => {\n const [dataType, setDataType] = useState<DataType>('utf8');\n const { t } = useTranslation();\n const translations = getTranslations();\n const dataTypeList = ['original', 'utf8'] as DataType[];\n\n return (\n <Card className=\"!border-1 !border-#E8E9EA py-10px\">\n <div className=\"flex gap-5px\">\n <div className=\"w-150px shrink-0\"></div>\n <Select\n value={dataType}\n onChange={setDataType}\n disableMatchWidth\n size=\"medium\"\n className=\"mb-16px mt-0 bg-#fff border border-solid border-#ccc\"\n disabled={dataTypeList.length === 1}\n width={180}\n >\n {dataTypeList.map(dataTypeItem => {\n return (\n <Select.Option\n className=\"data-[highlighted]:bg-[var(--theme-color-green2)] data-[highlighted]:text-#fff\"\n key={dataTypeItem}\n value={dataTypeItem}\n >\n {t(translations.transaction.select[dataTypeItem])}\n </Select.Option>\n );\n })}\n </Select>\n </div>\n <div className=\"flex gap-5px mt-16px\">\n <div className={clsx('w-150px shrink-0 text-red')}>\n {outcome === 'fail' ? 'Failed' : 'Error'}\n </div>\n <div className=\"flex-1\">\n <OutputData\n dataType={dataType}\n output={output}\n space={space}\n proxy={proxy}\n success={false}\n to={to}\n labelClassName=\"w-150px text-red\"\n />\n </div>\n </div>\n </Card>\n );\n};\n\nexport const TraceDetail = (props: Props) => {\n const { outcome = 'success', isContractCreated } = props;\n if (isContractCreated && outcome !== 'success')\n return <CreateContractFailedTraceDetail {...props} />;\n return <CommonTraceDetail {...props} />;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAS,sBAAsB;AAE/B,OAAO,UAAU;AASjB,SAAS,gBAAgB;AAwD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AAA,cAH3C;AAAA,YAIP;AAAA,UAEJ,CAAC;AAAA;AAAA,MACH;AAAA,OACF;AAAA,IACA,qBAAC,SAAI,WAAU,wBACb;AAAA,0BAAC,SAAI,WAAW,KAAK,2BAA2B,GAC7C,sBAAY,SAAS,WAAW,SACnC;AAAA,MACA,oBAAC,SAAI,WAAU,UACb;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,SAAS;AAAA,UACT;AAAA,UACA,gBAAe;AAAA;AAAA,MACjB,GACF;AAAA,OACF;AAAA,KACF;AAEJ;AAEO,IAAM,cAAc,CAAC,UAAiB;AAC3C,QAAM,EAAE,UAAU,WAAW,kBAAkB,IAAI;AACnD,MAAI,qBAAqB,YAAY;AACnC,WAAO,oBAAC,mCAAiC,GAAG,OAAO;AACrD,SAAO,oBAAC,qBAAmB,GAAG,OAAO;AACvC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/hooks/useDecodeFunctionData.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n decodeFunctionData,\n decodeFunctionResult,\n getAbiItem,\n AbiFunctionWithoutGas,\n} from 'src/utils/sdk';\nimport { useContractDetail } from './useContractDetail';\nimport { formatABI } from '..';\nimport { useMethodAbi } from './useMethodAbi';\n\nconst fields = ['abi' as const];\n\nexport type Hex = `0x${string}`;\n\nconst decodeFunctionDataByAbi = ({\n abi: _abi,\n input,\n output,\n space,\n success,\n withOutput = false,\n similarWarning,\n}: {\n input: Hex;\n output?: Hex;\n abi?: AbiFunctionWithoutGas[] | string;\n space: 'evm' | 'core';\n success?: boolean;\n withOutput?: boolean;\n similarWarning?: boolean;\n}) => {\n try {\n const abi = typeof _abi === 'string' ? JSON.parse(_abi) : _abi;\n const hasAbi = abi && abi.length > 0;\n if (!hasAbi) return null;\n const isReturnDataEmpty = !output || output === '0x';\n const methodID = input.slice(0, 10);\n const decodedParams = decodeFunctionData({\n abi: abi,\n data: input,\n space,\n });\n let decodedResults = success\n ? !isReturnDataEmpty\n ? decodeFunctionResult({\n abi: abi,\n functionName: decodedParams.functionName,\n data: output,\n space,\n })\n : undefined\n : output;\n const abiItem = getAbiItem({\n abi: abi,\n name: decodedParams.functionName ?? methodID,\n }) as AbiFunctionWithoutGas;\n if (!withOutput) {\n abiItem.outputs = [];\n }\n const fullName = formatABI([abiItem])[0];\n\n return {\n decodedParams,\n decodedResults:\n decodedResults === undefined\n ? undefined\n : Array.isArray(decodedResults)\n ? (decodedResults as unknown[])\n : [decodedResults],\n abiItem,\n fullName: fullName,\n failed: false,\n similarWarning,\n };\n } catch (error) {\n console.log('decode function data and result error', error);\n return {\n failed: true,\n similarWarning,\n };\n }\n};\n\nexport interface DecodedFunctionData {\n decodedParams?: {\n args: readonly unknown[] | undefined;\n functionName: string;\n };\n decodedResults?: unknown[];\n abiItem?: AbiFunctionWithoutGas;\n fullName?: string;\n // no abi for decoded\n noAbi?: boolean;\n // decoded failed\n failed?: boolean;\n // decoded by method abi, not contract abi\n similarWarning?: boolean;\n}\n\nexport const useDecodeFunctionData = ({\n to,\n abi: outerAbi,\n implementation: _implementation,\n input,\n output,\n space,\n success,\n supportMethodAbi,\n withOutput,\n}: {\n input: Hex;\n output?: Hex;\n to?: string;\n implementation?: string;\n abi?: AbiFunctionWithoutGas[];\n space: 'evm' | 'core';\n success?: boolean;\n supportMethodAbi?: boolean;\n withOutput?: boolean;\n}): [DecodedFunctionData, boolean] => {\n const hasOuterAbi = outerAbi && outerAbi.length > 0;\n const needContractAbi = !hasOuterAbi && !!input;\n const { data: contractData, isLoading: contractLoading } = useContractDetail(\n to,\n fields,\n needContractAbi,\n );\n const implementation =\n _implementation ?? contractData?.implementation?.address;\n const { data: implementationData, isLoading: implementationLoading } =\n useContractDetail(implementation, fields, needContractAbi);\n const decodedByOuterAbi = useMemo(() => {\n return decodeFunctionDataByAbi({\n abi: outerAbi,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, outerAbi, success, space, withOutput]);\n const decodedByContractAbi = useMemo(() => {\n if (!contractData?.abi) return null;\n return decodeFunctionDataByAbi({\n abi: contractData.abi as string,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, contractData?.abi, success, space, withOutput]);\n const decodedByImplementationAbi = useMemo(() => {\n if (!implementationData?.abi) return null;\n return decodeFunctionDataByAbi({\n abi: implementationData.abi as string,\n input,\n output,\n space,\n success,\n withOutput,\n });\n }, [input, output, implementationData?.abi, success, space, withOutput]);\n const needMethodAbi =\n !!supportMethodAbi &&\n needContractAbi &&\n // contract abi decoded failed\n !contractLoading &&\n (!decodedByContractAbi || decodedByContractAbi.failed) &&\n // implementation contract abi decoded failed\n !implementationLoading &&\n (!decodedByImplementationAbi || decodedByImplementationAbi.failed);\n const { data: methodAbi, isLoading: methodAbiLoading } = useMethodAbi(\n input.slice(0, 10),\n needMethodAbi,\n );\n const decodedByMethodAbi = useMemo(() => {\n // decode tx data with function abi only if there is only one function\n if (!methodAbi || methodAbi.list.length !== 1) return null;\n try {\n // e.g. transfer(address,uint256)\n const fullName = methodAbi.list[0]!.fullName;\n // e.g. function transfer(address recipient, uint256 amount) returns (bool)\n const formatWithArg = methodAbi.list[0]!.formatWithArg;\n const abi = formatABI([formatWithArg || `function ${fullName}`], {\n json: true,\n });\n return decodeFunctionDataByAbi({\n abi: abi,\n input,\n output,\n space,\n success,\n withOutput,\n similarWarning: true,\n });\n } catch (error) {\n console.log('decode function data and result error', error);\n return {\n failed: true,\n };\n }\n }, [input, output, methodAbi, success, space, withOutput]);\n\n return useMemo(() => {\n if (!input) return [{}, false];\n if (decodedByOuterAbi && !decodedByOuterAbi.failed)\n return [decodedByOuterAbi, false];\n if (decodedByImplementationAbi && !decodedByImplementationAbi.failed)\n return [decodedByImplementationAbi, implementationLoading];\n if (decodedByContractAbi && !decodedByContractAbi.failed)\n return [decodedByContractAbi, contractLoading];\n if (decodedByMethodAbi && !decodedByMethodAbi.failed)\n return [decodedByMethodAbi, methodAbiLoading];\n if (\n (decodedByOuterAbi && decodedByOuterAbi.failed) ||\n (decodedByImplementationAbi && decodedByImplementationAbi.failed) ||\n (decodedByContractAbi && decodedByContractAbi.failed) ||\n (decodedByMethodAbi && decodedByMethodAbi.failed)\n ) {\n return [\n {\n failed: true,\n },\n false,\n ];\n }\n return [\n {\n noAbi: true,\n },\n false,\n ];\n }, [\n input,\n decodedByOuterAbi,\n decodedByContractAbi,\n decodedByImplementationAbi,\n decodedByMethodAbi,\n contractLoading,\n implementationLoading,\n methodAbiLoading,\n ]);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAWxB,IAAM,SAAS,CAAC,KAAc;AAI9B,IAAM,0BAA0B,CAAC;AAAA,EAC/B,KAAK;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AACF,MAQM;AACJ,MAAI;AACF,UAAM,MAAM,OAAO,SAAS,WAAW,KAAK,MAAM,IAAI,IAAI;AAC1D,UAAM,SAAS,OAAO,IAAI,SAAS;AACnC,QAAI,CAAC;AAAQ,aAAO;AACpB,UAAM,oBAAoB,CAAC,UAAU,WAAW;AAChD,UAAM,WAAW,MAAM,MAAM,GAAG,EAAE;AAClC,UAAM,gBAAgB,mBAAmB;AAAA,MACvC;AAAA,MACA,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AACD,QAAI,iBAAiB,UACjB,CAAC,oBACC,qBAAqB;AAAA,MACnB;AAAA,MACA,cAAc,cAAc;AAAA,MAC5B,MAAM;AAAA,MACN;AAAA,IACF,CAAC,IACD,SACF;AACJ,UAAM,UAAU,WAAW;AAAA,MACzB;AAAA,MACA,MAAM,cAAc,gBAAgB;AAAA,IACtC,CAAC;AACD,QAAI,CAAC,YAAY;AACf,cAAQ,UAAU,CAAC;AAAA,IACrB;AACA,UAAM,WAAW,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;AAEvC,WAAO;AAAA,MACL;AAA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AAC5D,aAAO,CAAC,4BAA4B,qBAAqB;AAC3D,QAAI,wBAAwB,CAAC,qBAAqB;AAChD,aAAO,CAAC,sBAAsB,eAAe;AAC/C,QAAI,sBAAsB,CAAC,mBAAmB;AAC5C,aAAO,CAAC,oBAAoB,gBAAgB;AAC9C,QACG,qBAAqB,kBAAkB,UACvC,8BAA8B,2BAA2B,UACzD,wBAAwB,qBAAqB,UAC7C,sBAAsB,mBAAmB,QAC1C;AACA,aAAO;AAAA,QACL;AAAA,UACE,QAAQ;AAAA,QACV;AAAA,QACA;AAAA,MACF;AAAA,IACF;AACA,WAAO;AAAA,MACL;AAAA,QACE,OAAO;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AddressContainer/addressView.tsx"],"sourcesContent":["import { Translation } from 'react-i18next';\nimport { Text } from '../Text';\nimport { convertCheckSum } from '../../utils/address';\nimport { getTranslations } from '../../store';\nimport { TooltipContent, RenderAddressProps } from './types';\nimport { shortenAddress } from '@cfx-kit/dapp-utils/dist/address';\n\nconst defaultPCMaxWidth = 138;\n\n// common\nconst renderTooltipContent = (tooltipContent: TooltipContent) => {\n return Object.entries(tooltipContent)\n .map(([key, { label, value, hideLabel }]) => {\n if (value) {\n return (\n <div key={key}>\n {!hideLabel && (\n <span>\n <Translation>{t => t(label)}</Translation>\n </span>\n )}\n {value}\n </div>\n );\n }\n return null;\n })\n .filter(Boolean);\n};\n\n// common\nconst convertLink = ({\n link,\n type,\n hrefAddress,\n cfxAddress,\n}: RenderAddressProps) => {\n if (typeof link === 'string') {\n return link;\n }\n if (link === false) {\n return false;\n }\n\n const address = hrefAddress || cfxAddress;\n\n if (address && typeof address === 'string') {\n const pathname = window.location.pathname.toLowerCase();\n const addressLower = address.toLowerCase();\n if (pathname.includes('/address/' + addressLower)) {\n return false;\n }\n\n if (type === 'pow') {\n return `/address/${address}`;\n }\n\n if (type === 'pos') {\n return `/pos/accounts/${address}`;\n }\n }\n\n return false;\n};\n\n// common\nexport const RenderAddress = ({\n cfxAddress,\n alias,\n hoverValue,\n hrefAddress,\n content,\n link = '',\n isFull = false,\n isFullNameTag = false,\n style = {},\n maxWidth,\n prefix = null,\n suffix = null,\n type = 'pow',\n addressLabel = '',\n ENSLabel = '',\n nametag = '',\n hideAliasPrefixInHover = false,\n}: RenderAddressProps) => {\n const translations = getTranslations();\n\n const name = content || ENSLabel || nametag || addressLabel || alias;\n\n const defaultStyle = {\n maxWidth: `${(name && isFullNameTag) || isFull ? 'auto' : (maxWidth || defaultPCMaxWidth) + 'px'}`,\n };\n\n const href = convertLink({ link, type, hrefAddress, cfxAddress });\n\n const Wrapper = href ? 'a' : 'div';\n\n const tooltipContent: TooltipContent = {\n ENSLabel: {\n label: (translations as any)?.ens?.tip,\n value: ENSLabel,\n },\n nametag: {\n label: translations?.nametag?.tip,\n value: nametag,\n },\n addressLabel: {\n label: translations?.profile.address.myNameTag,\n value: addressLabel,\n },\n alias: {\n label: translations?.profile.address.publicNameTag,\n value: alias,\n hideLabel: hideAliasPrefixInHover,\n },\n };\n\n const checksumAddress = convertCheckSum(cfxAddress);\n\n const cfxAddressLabel =\n typeof cfxAddress === 'string' && !isFull\n ? shortenAddress(checksumAddress!)\n : checksumAddress;\n\n return (\n <div className=\"inline-flex\">\n {prefix}\n <Text\n tag=\"span\"\n hoverValue={\n <>\n {renderTooltipContent(tooltipContent)}\n <div>{hoverValue || checksumAddress}</div>\n </>\n }\n >\n <Wrapper\n className=\"block relative align-bottom cursor-default truncate\"\n style={{ ...defaultStyle, ...style }}\n {...(href ? { href: String(href) } : {})}\n >\n {name || cfxAddressLabel}\n </Wrapper>\n </Text>\n {suffix}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;AAA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{"version":3,"sources":["../src/components/InputData/index.tsx"],"sourcesContent":["import { DataType } from 'src/utils/hooks/useDecodedDataType';\nimport { Original } from './Original';\nimport { UTF8 } from './UTF8';\nimport { JsonDecode } from './JsonDecode';\nimport { OptimizationDecode } from './OptimizationDecode';\nimport { GeneralDecode } from './GeneralDecode';\nimport { DecodedFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\n\nexport const InputData = ({\n decodedData,\n dataType,\n input,\n space,\n labelClassName,\n}: {\n decodedData: DecodedFunctionData;\n dataType: DataType;\n input: `0x${string}`;\n space: 'evm' | 'core';\n labelClassName?: string;\n}) => {\n if (dataType === 'utf8') {\n return <UTF8 data={input}></UTF8>;\n } else if (\n dataType === 'json' &&\n decodedData.decodedParams &&\n decodedData.abiItem\n ) {\n return (\n <JsonDecode\n decodedParams={decodedData.decodedParams}\n decodedResults={decodedData.decodedResults}\n abiItem={decodedData.abiItem}\n input={input}\n ></JsonDecode>\n );\n } else if (dataType === 'generalDecode') {\n return (\n <GeneralDecode\n data={input}\n fullName={decodedData.fullName}\n ></GeneralDecode>\n );\n } else if (\n dataType === 'optimizationDecode' &&\n decodedData.decodedParams &&\n decodedData.abiItem\n ) {\n return (\n <OptimizationDecode\n decodedParams={decodedData.decodedParams}\n abiItem={decodedData.abiItem}\n input={input}\n labelClassName={labelClassName}\n space={space}\n ></OptimizationDecode>\n );\n }\n return <Original data={input}></Original>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBW;AAdJ,IAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAMM;AACJ,MAAI,aAAa,QAAQ;AACvB,WAAO,oBAAC,QAAK,MAAM,OAAO;AAAA,EAC5B,WACE,aAAa,UACb,YAAY,iBACZ,YAAY,SACZ;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAe,YAAY;AAAA,QAC3B,gBAAgB,YAAY;AAAA,QAC5B,SAAS,YAAY;AAAA,QACrB;AAAA;AAAA,IACD;AAAA,EAEL,WAAW,aAAa,iBAAiB;AACvC,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,YAAY;AAAA;AAAA,IACvB;AAAA,EAEL,WACE,aAAa,wBACb,YAAY,iBACZ,YAAY,SACZ;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAe,YAAY;AAAA,QAC3B,SAAS,YAAY;AAAA,QACrB;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,EAEL;AACA,SAAO,oBAAC,YAAS,MAAM,OAAO;AAChC;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/OutputData/index.tsx"],"sourcesContent":["import { DataType } from 'src/utils/hooks/useDecodedDataType';\nimport { DecodedFunctionData } from 'src/utils/hooks/useDecodeFunctionData';\nimport { ErrorDecode } from './ErrorDecode';\nimport { Original } from '../InputData/Original';\nimport { UTF8 } from '../InputData/UTF8';\nimport { GeneralDecode } from '../InputData/GeneralDecode';\nimport { DecodedParameters } from '../InputData/OptimizationDecode';\n\nexport const OutputData = ({\n decodedData,\n dataType,\n output,\n to,\n space,\n success,\n proxy,\n labelClassName,\n}: {\n decodedData?: DecodedFunctionData;\n dataType: DataType;\n output?: `0x${string}`;\n space: 'evm' | 'core';\n to?: string;\n labelClassName?: string;\n success?: boolean;\n proxy?: {\n beaconAddress?: string;\n implAddress: string;\n };\n}) => {\n const isReturnDataEmpty = !output || output === '0x';\n if (isReturnDataEmpty) return null;\n if (dataType === 'utf8') {\n return <UTF8 data={output}></UTF8>;\n } else if (dataType === 'generalDecode') {\n if (!success) return <Original data={output}></Original>;\n if (decodedData) {\n return (\n <GeneralDecode\n data={output}\n fullName={decodedData.fullName}\n ></GeneralDecode>\n );\n }\n } else if (dataType === 'optimizationDecode') {\n if (!success) {\n return (\n <ErrorDecode\n to={to}\n space={space}\n errorData={output}\n proxy={proxy}\n labelClassName={labelClassName}\n ></ErrorDecode>\n );\n }\n if (decodedData) {\n return (\n <DecodedParameters\n args={decodedData.decodedResults}\n params={decodedData.abiItem?.outputs ?? []}\n label=\"Return:\"\n labelClassName={labelClassName}\n space={space}\n />\n );\n }\n }\n return <Original data={output}></Original>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAiCW;AAzBJ,IAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAYM;AACJ,QAAM,oBAAoB,CAAC,UAAU,WAAW;AAChD,MAAI;AAAmB,WAAO;AAC9B,MAAI,aAAa,QAAQ;AACvB,WAAO,oBAAC,QAAK,MAAM,QAAQ;AAAA,EAC7B,WAAW,aAAa,iBAAiB;AACvC,QAAI,CAAC;AAAS,aAAO,oBAAC,YAAS,MAAM,QAAQ;AAC7C,QAAI,aAAa;AACf,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,UAAU,YAAY;AAAA;AAAA,MACvB;AAAA,IAEL;AAAA,EACF,WAAW,aAAa,sBAAsB;AAC5C,QAAI,CAAC,SAAS;AACZ,aACE;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,WAAW;AAAA,UACX;AAAA,UACA;AAAA;AAAA,MACD;AAAA,IAEL;AACA,QAAI,aAAa;AACf,aACE;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,YAAY;AAAA,UAClB,QAAQ,YAAY,SAAS,WAAW,CAAC;AAAA,UACzC,OAAM;AAAA,UACN;AAAA,UACA;AAAA;AAAA,MACF;AAAA,IAEJ;AAAA,EACF;AACA,SAAO,oBAAC,YAAS,MAAM,QAAQ;AACjC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|