@cfxjs/sirius-next-common 0.1.33 → 0.1.34
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-27U3ZES6.js +212 -0
- package/dist/chunk-27U3ZES6.js.map +1 -0
- package/dist/chunk-2BYZ7YCR.js +63 -0
- package/dist/chunk-2BYZ7YCR.js.map +1 -0
- package/dist/chunk-2DTZKTKF.js +63 -0
- package/dist/chunk-2DTZKTKF.js.map +1 -0
- package/dist/chunk-2E3YJCV3.js +127 -0
- package/dist/chunk-2E3YJCV3.js.map +1 -0
- package/dist/chunk-2ICNULC2.js +254 -0
- package/dist/chunk-2ICNULC2.js.map +1 -0
- package/dist/chunk-2LPOU4PC.js +141 -0
- package/dist/chunk-2LPOU4PC.js.map +1 -0
- package/dist/chunk-2MSHBEWL.js +268 -0
- package/dist/chunk-2MSHBEWL.js.map +1 -0
- package/dist/chunk-2SCHWFIY.js +105 -0
- package/dist/chunk-2SCHWFIY.js.map +1 -0
- package/dist/chunk-3BYHQHWI.js +212 -0
- package/dist/chunk-3BYHQHWI.js.map +1 -0
- package/dist/chunk-3DTLHHIA.js +796 -0
- package/dist/chunk-3DTLHHIA.js.map +1 -0
- package/dist/chunk-3GT2MSFN.js +105 -0
- package/dist/chunk-3GT2MSFN.js.map +1 -0
- package/dist/chunk-3TE65Q5Q.js +105 -0
- package/dist/chunk-3TE65Q5Q.js.map +1 -0
- package/dist/chunk-3UE7QPSR.js +141 -0
- package/dist/chunk-3UE7QPSR.js.map +1 -0
- package/dist/chunk-4LTDTOPU.js +49 -0
- package/dist/chunk-4LTDTOPU.js.map +1 -0
- package/dist/chunk-4OVKJTEK.js +254 -0
- package/dist/chunk-4OVKJTEK.js.map +1 -0
- package/dist/chunk-54S3AFTR.js +141 -0
- package/dist/chunk-54S3AFTR.js.map +1 -0
- package/dist/chunk-5G3TPHDI.js +49 -0
- package/dist/chunk-5G3TPHDI.js.map +1 -0
- package/dist/chunk-5HPBFAVS.js +108 -0
- package/dist/chunk-5HPBFAVS.js.map +1 -0
- package/dist/chunk-5MMGA5S5.js +108 -0
- package/dist/chunk-5MMGA5S5.js.map +1 -0
- package/dist/chunk-5O5QALCR.js +49 -0
- package/dist/chunk-5O5QALCR.js.map +1 -0
- package/dist/chunk-5PHY7B5Q.js +127 -0
- package/dist/chunk-5PHY7B5Q.js.map +1 -0
- package/dist/chunk-5QV6FSW5.js +108 -0
- package/dist/chunk-5QV6FSW5.js.map +1 -0
- package/dist/chunk-5TCARLKL.js +268 -0
- package/dist/chunk-5TCARLKL.js.map +1 -0
- package/dist/chunk-5VLX5LYF.js +796 -0
- package/dist/chunk-5VLX5LYF.js.map +1 -0
- package/dist/chunk-663WU3VG.js +127 -0
- package/dist/chunk-663WU3VG.js.map +1 -0
- package/dist/chunk-6A5P5KI3.js +141 -0
- package/dist/chunk-6A5P5KI3.js.map +1 -0
- package/dist/chunk-6ECE7EAG.js +63 -0
- package/dist/chunk-6ECE7EAG.js.map +1 -0
- package/dist/chunk-6JGJBJQ5.js +268 -0
- package/dist/chunk-6JGJBJQ5.js.map +1 -0
- package/dist/chunk-6LDWVWGX.js +3629 -0
- package/dist/chunk-6LDWVWGX.js.map +1 -0
- package/dist/chunk-6LZKERHY.js +273 -0
- package/dist/chunk-6LZKERHY.js.map +1 -0
- package/dist/chunk-6RTSZQPF.js +150 -0
- package/dist/chunk-6RTSZQPF.js.map +1 -0
- package/dist/chunk-6T7MFHX3.js +2324 -0
- package/dist/chunk-6T7MFHX3.js.map +1 -0
- package/dist/chunk-6ZC5J3YR.js +212 -0
- package/dist/chunk-6ZC5J3YR.js.map +1 -0
- package/dist/chunk-7355VRDR.js +108 -0
- package/dist/chunk-7355VRDR.js.map +1 -0
- package/dist/chunk-73ACKXGM.js +254 -0
- package/dist/chunk-73ACKXGM.js.map +1 -0
- package/dist/chunk-7FHJMA3Z.js +212 -0
- package/dist/chunk-7FHJMA3Z.js.map +1 -0
- package/dist/chunk-7NSYEE6O.js +127 -0
- package/dist/chunk-7NSYEE6O.js.map +1 -0
- package/dist/chunk-7PGOPD6T.js +63 -0
- package/dist/chunk-7PGOPD6T.js.map +1 -0
- package/dist/chunk-A25FZPUD.js +268 -0
- package/dist/chunk-A25FZPUD.js.map +1 -0
- package/dist/chunk-A4KAYCOA.js +63 -0
- package/dist/chunk-A4KAYCOA.js.map +1 -0
- package/dist/chunk-AC3QYTOI.js +141 -0
- package/dist/chunk-AC3QYTOI.js.map +1 -0
- package/dist/chunk-APYD7IKG.js +49 -0
- package/dist/chunk-APYD7IKG.js.map +1 -0
- package/dist/chunk-AVY3BJ2X.js +127 -0
- package/dist/chunk-AVY3BJ2X.js.map +1 -0
- package/dist/chunk-AZ6RP3ME.js +278 -0
- package/dist/chunk-AZ6RP3ME.js.map +1 -0
- package/dist/chunk-B24CPBDV.js +150 -0
- package/dist/chunk-B24CPBDV.js.map +1 -0
- package/dist/chunk-BC6MQSTI.js +108 -0
- package/dist/chunk-BC6MQSTI.js.map +1 -0
- package/dist/chunk-BETECLYX.js +2324 -0
- package/dist/chunk-BETECLYX.js.map +1 -0
- package/dist/chunk-BGRIHUGF.js +127 -0
- package/dist/chunk-BGRIHUGF.js.map +1 -0
- package/dist/chunk-BGSOKXPS.js +3629 -0
- package/dist/chunk-BGSOKXPS.js.map +1 -0
- package/dist/chunk-BQU5GLOL.js +273 -0
- package/dist/chunk-BQU5GLOL.js.map +1 -0
- package/dist/chunk-BY6TBBZC.js +63 -0
- package/dist/chunk-BY6TBBZC.js.map +1 -0
- package/dist/chunk-CGNWZ4SF.js +108 -0
- package/dist/chunk-CGNWZ4SF.js.map +1 -0
- package/dist/chunk-CWPEXIAP.js +212 -0
- package/dist/chunk-CWPEXIAP.js.map +1 -0
- package/dist/chunk-CX3RKYHL.js +141 -0
- package/dist/chunk-CX3RKYHL.js.map +1 -0
- package/dist/chunk-DDQPPG36.js +63 -0
- package/dist/chunk-DDQPPG36.js.map +1 -0
- package/dist/chunk-DFGPW4FH.js +141 -0
- package/dist/chunk-DFGPW4FH.js.map +1 -0
- package/dist/chunk-DGMKQGSS.js +255 -0
- package/dist/chunk-DGMKQGSS.js.map +1 -0
- package/dist/chunk-DH7E2QJY.js +63 -0
- package/dist/chunk-DH7E2QJY.js.map +1 -0
- package/dist/chunk-DJMQJGDU.js +127 -0
- package/dist/chunk-DJMQJGDU.js.map +1 -0
- package/dist/chunk-DNAOZ3CB.js +127 -0
- package/dist/chunk-DNAOZ3CB.js.map +1 -0
- package/dist/chunk-DRMEOOSC.js +268 -0
- package/dist/chunk-DRMEOOSC.js.map +1 -0
- package/dist/chunk-DSBTIIE2.js +63 -0
- package/dist/chunk-DSBTIIE2.js.map +1 -0
- package/dist/chunk-DX5EXIMK.js +2324 -0
- package/dist/chunk-DX5EXIMK.js.map +1 -0
- package/dist/chunk-DYGOHLN4.js +108 -0
- package/dist/chunk-DYGOHLN4.js.map +1 -0
- package/dist/chunk-DYTSBPL6.js +108 -0
- package/dist/chunk-DYTSBPL6.js.map +1 -0
- package/dist/chunk-ENJ2UI5Q.js +127 -0
- package/dist/chunk-ENJ2UI5Q.js.map +1 -0
- package/dist/chunk-EOYF4Z6B.js +212 -0
- package/dist/chunk-EOYF4Z6B.js.map +1 -0
- package/dist/chunk-EVMADMHS.js +108 -0
- package/dist/chunk-EVMADMHS.js.map +1 -0
- package/dist/chunk-F25QUZ3T.js +127 -0
- package/dist/chunk-F25QUZ3T.js.map +1 -0
- package/dist/chunk-F6PRHM5V.js +2324 -0
- package/dist/chunk-F6PRHM5V.js.map +1 -0
- package/dist/chunk-FAUXJQMT.js +141 -0
- package/dist/chunk-FAUXJQMT.js.map +1 -0
- package/dist/chunk-FWKC2BLZ.js +212 -0
- package/dist/chunk-FWKC2BLZ.js.map +1 -0
- package/dist/chunk-G2H5OP2H.js +49 -0
- package/dist/chunk-G2H5OP2H.js.map +1 -0
- package/dist/chunk-G4J7I73Y.js +37 -0
- package/dist/chunk-G4J7I73Y.js.map +1 -0
- package/dist/chunk-GQC5LNVW.js +63 -0
- package/dist/chunk-GQC5LNVW.js.map +1 -0
- package/dist/chunk-GYYQP4DT.js +127 -0
- package/dist/chunk-GYYQP4DT.js.map +1 -0
- package/dist/chunk-GZBFBCQI.js +63 -0
- package/dist/chunk-GZBFBCQI.js.map +1 -0
- package/dist/chunk-HGLER5MY.js +796 -0
- package/dist/chunk-HGLER5MY.js.map +1 -0
- package/dist/chunk-HQ6KWJFH.js +49 -0
- package/dist/chunk-HQ6KWJFH.js.map +1 -0
- package/dist/chunk-HQQ5ZL6Q.js +49 -0
- package/dist/chunk-HQQ5ZL6Q.js.map +1 -0
- package/dist/chunk-HRAKHATH.js +150 -0
- package/dist/chunk-HRAKHATH.js.map +1 -0
- package/dist/chunk-ILSVC4UY.js +3629 -0
- package/dist/chunk-ILSVC4UY.js.map +1 -0
- package/dist/chunk-IQIVBN66.js +273 -0
- package/dist/chunk-IQIVBN66.js.map +1 -0
- package/dist/chunk-IUQBQLM6.js +19 -0
- package/dist/chunk-IUQBQLM6.js.map +1 -0
- package/dist/chunk-IVS3J33K.js +212 -0
- package/dist/chunk-IVS3J33K.js.map +1 -0
- package/dist/chunk-J6D3CAR7.js +127 -0
- package/dist/chunk-J6D3CAR7.js.map +1 -0
- package/dist/chunk-JCKMXITS.js +212 -0
- package/dist/chunk-JCKMXITS.js.map +1 -0
- package/dist/chunk-JCT3BKSW.js +3629 -0
- package/dist/chunk-JCT3BKSW.js.map +1 -0
- package/dist/chunk-JDLXU3ZF.js +108 -0
- package/dist/chunk-JDLXU3ZF.js.map +1 -0
- package/dist/chunk-JL6ZIJUH.js +2324 -0
- package/dist/chunk-JL6ZIJUH.js.map +1 -0
- package/dist/chunk-K4SYGDQ7.js +63 -0
- package/dist/chunk-K4SYGDQ7.js.map +1 -0
- package/dist/chunk-K5Z6QUIM.js +141 -0
- package/dist/chunk-K5Z6QUIM.js.map +1 -0
- package/dist/chunk-KD6CGNYU.js +254 -0
- package/dist/chunk-KD6CGNYU.js.map +1 -0
- package/dist/chunk-L65LHFIO.js +141 -0
- package/dist/chunk-L65LHFIO.js.map +1 -0
- package/dist/chunk-LBVZAZ6U.js +63 -0
- package/dist/chunk-LBVZAZ6U.js.map +1 -0
- package/dist/chunk-LHMHEG43.js +796 -0
- package/dist/chunk-LHMHEG43.js.map +1 -0
- package/dist/chunk-LJW6ZBRN.js +273 -0
- package/dist/chunk-LJW6ZBRN.js.map +1 -0
- package/dist/chunk-LYXB4GLH.js +108 -0
- package/dist/chunk-LYXB4GLH.js.map +1 -0
- package/dist/chunk-M2B6MZSF.js +796 -0
- package/dist/chunk-M2B6MZSF.js.map +1 -0
- package/dist/chunk-M6WAUVRX.js +212 -0
- package/dist/chunk-M6WAUVRX.js.map +1 -0
- package/dist/chunk-M7ID5HPC.js +150 -0
- package/dist/chunk-M7ID5HPC.js.map +1 -0
- package/dist/chunk-MIVIXDFN.js +63 -0
- package/dist/chunk-MIVIXDFN.js.map +1 -0
- package/dist/chunk-MZAIX5H4.js +254 -0
- package/dist/chunk-MZAIX5H4.js.map +1 -0
- package/dist/chunk-N56EOFH7.js +212 -0
- package/dist/chunk-N56EOFH7.js.map +1 -0
- package/dist/chunk-NCDYCEFI.js +141 -0
- package/dist/chunk-NCDYCEFI.js.map +1 -0
- package/dist/chunk-NOLINMVX.js +63 -0
- package/dist/chunk-NOLINMVX.js.map +1 -0
- package/dist/chunk-NR7VYRLX.js +212 -0
- package/dist/chunk-NR7VYRLX.js.map +1 -0
- package/dist/chunk-NSIDPAOP.js +212 -0
- package/dist/chunk-NSIDPAOP.js.map +1 -0
- package/dist/chunk-NSXFJV7H.js +255 -0
- package/dist/chunk-NSXFJV7H.js.map +1 -0
- package/dist/chunk-NV7LKWOG.js +141 -0
- package/dist/chunk-NV7LKWOG.js.map +1 -0
- package/dist/chunk-NWY2GONC.js +268 -0
- package/dist/chunk-NWY2GONC.js.map +1 -0
- package/dist/chunk-O5TVIMND.js +127 -0
- package/dist/chunk-O5TVIMND.js.map +1 -0
- package/dist/chunk-OG2QBBAF.js +49 -0
- package/dist/chunk-OG2QBBAF.js.map +1 -0
- package/dist/chunk-OK3EPS2C.js +2324 -0
- package/dist/chunk-OK3EPS2C.js.map +1 -0
- package/dist/chunk-OLWGRNA6.js +254 -0
- package/dist/chunk-OLWGRNA6.js.map +1 -0
- package/dist/chunk-OQI2W7LB.js +108 -0
- package/dist/chunk-OQI2W7LB.js.map +1 -0
- package/dist/chunk-OS4E6J4B.js +268 -0
- package/dist/chunk-OS4E6J4B.js.map +1 -0
- package/dist/chunk-P2NXBCRI.js +108 -0
- package/dist/chunk-P2NXBCRI.js.map +1 -0
- package/dist/chunk-PLDMHO2P.js +284 -0
- package/dist/chunk-PLDMHO2P.js.map +1 -0
- package/dist/chunk-PQ5G5Y3F.js +269 -0
- package/dist/chunk-PQ5G5Y3F.js.map +1 -0
- package/dist/chunk-PRFI5PWG.js +3629 -0
- package/dist/chunk-PRFI5PWG.js.map +1 -0
- package/dist/chunk-PYYIF6GR.js +108 -0
- package/dist/chunk-PYYIF6GR.js.map +1 -0
- package/dist/chunk-Q35VQXCA.js +288 -0
- package/dist/chunk-Q35VQXCA.js.map +1 -0
- package/dist/chunk-QBGHXA67.js +141 -0
- package/dist/chunk-QBGHXA67.js.map +1 -0
- package/dist/chunk-QBMZ6QXX.js +212 -0
- package/dist/chunk-QBMZ6QXX.js.map +1 -0
- package/dist/chunk-QFBKNCBJ.js +141 -0
- package/dist/chunk-QFBKNCBJ.js.map +1 -0
- package/dist/chunk-QJIALKBF.js +141 -0
- package/dist/chunk-QJIALKBF.js.map +1 -0
- package/dist/chunk-R2PTF2HJ.js +2324 -0
- package/dist/chunk-R2PTF2HJ.js.map +1 -0
- package/dist/chunk-R2UDBW7V.js +141 -0
- package/dist/chunk-R2UDBW7V.js.map +1 -0
- package/dist/chunk-RBFAHNA3.js +127 -0
- package/dist/chunk-RBFAHNA3.js.map +1 -0
- package/dist/chunk-RBTYJWYS.js +141 -0
- package/dist/chunk-RBTYJWYS.js.map +1 -0
- package/dist/chunk-REVPMYRN.js +127 -0
- package/dist/chunk-REVPMYRN.js.map +1 -0
- package/dist/chunk-RJYSPPZR.js +105 -0
- package/dist/chunk-RJYSPPZR.js.map +1 -0
- package/dist/chunk-RK473OTT.js +141 -0
- package/dist/chunk-RK473OTT.js.map +1 -0
- package/dist/chunk-RU2M3L6Z.js +212 -0
- package/dist/chunk-RU2M3L6Z.js.map +1 -0
- package/dist/chunk-S6MO4YII.js +796 -0
- package/dist/chunk-S6MO4YII.js.map +1 -0
- package/dist/chunk-SGKB56KP.js +150 -0
- package/dist/chunk-SGKB56KP.js.map +1 -0
- package/dist/chunk-SOWNENZM.js +108 -0
- package/dist/chunk-SOWNENZM.js.map +1 -0
- package/dist/chunk-SPQO2KWH.js +796 -0
- package/dist/chunk-SPQO2KWH.js.map +1 -0
- package/dist/chunk-SSKS77V7.js +108 -0
- package/dist/chunk-SSKS77V7.js.map +1 -0
- package/dist/chunk-T7KFCASW.js +63 -0
- package/dist/chunk-T7KFCASW.js.map +1 -0
- package/dist/chunk-THG4N3FI.js +63 -0
- package/dist/chunk-THG4N3FI.js.map +1 -0
- package/dist/chunk-TUK6AZZO.js +150 -0
- package/dist/chunk-TUK6AZZO.js.map +1 -0
- package/dist/chunk-UAUID5ML.js +273 -0
- package/dist/chunk-UAUID5ML.js.map +1 -0
- package/dist/chunk-UCLF63CE.js +212 -0
- package/dist/chunk-UCLF63CE.js.map +1 -0
- package/dist/chunk-UMNQJFSG.js +3629 -0
- package/dist/chunk-UMNQJFSG.js.map +1 -0
- package/dist/chunk-UNMUTILO.js +105 -0
- package/dist/chunk-UNMUTILO.js.map +1 -0
- package/dist/chunk-UP54IQOK.js +105 -0
- package/dist/chunk-UP54IQOK.js.map +1 -0
- package/dist/chunk-UUJ5KHJI.js +105 -0
- package/dist/chunk-UUJ5KHJI.js.map +1 -0
- package/dist/chunk-VICWI4OU.js +108 -0
- package/dist/chunk-VICWI4OU.js.map +1 -0
- package/dist/chunk-VRKWQVK3.js +2324 -0
- package/dist/chunk-VRKWQVK3.js.map +1 -0
- package/dist/chunk-VSLAOZQD.js +212 -0
- package/dist/chunk-VSLAOZQD.js.map +1 -0
- package/dist/chunk-VSYBVVQG.js +108 -0
- package/dist/chunk-VSYBVVQG.js.map +1 -0
- package/dist/chunk-VWQKIEMF.js +273 -0
- package/dist/chunk-VWQKIEMF.js.map +1 -0
- package/dist/chunk-VY2GZXYM.js +141 -0
- package/dist/chunk-VY2GZXYM.js.map +1 -0
- package/dist/chunk-VZ56KTEJ.js +127 -0
- package/dist/chunk-VZ56KTEJ.js.map +1 -0
- package/dist/chunk-W3L4ZQJJ.js +212 -0
- package/dist/chunk-W3L4ZQJJ.js.map +1 -0
- package/dist/chunk-WAO36MW5.js +63 -0
- package/dist/chunk-WAO36MW5.js.map +1 -0
- package/dist/chunk-WIFDOPMN.js +127 -0
- package/dist/chunk-WIFDOPMN.js.map +1 -0
- package/dist/chunk-WNRV6HEX.js +127 -0
- package/dist/chunk-WNRV6HEX.js.map +1 -0
- package/dist/chunk-WVIQHL36.js +288 -0
- package/dist/chunk-WVIQHL36.js.map +1 -0
- package/dist/chunk-WX6ECDMM.js +108 -0
- package/dist/chunk-WX6ECDMM.js.map +1 -0
- package/dist/chunk-XDRQWJU4.js +127 -0
- package/dist/chunk-XDRQWJU4.js.map +1 -0
- package/dist/chunk-XJYGT7M7.js +141 -0
- package/dist/chunk-XJYGT7M7.js.map +1 -0
- package/dist/chunk-XOZOZ2EK.js +3629 -0
- package/dist/chunk-XOZOZ2EK.js.map +1 -0
- package/dist/chunk-XSOHRWJR.js +19 -0
- package/dist/chunk-XSOHRWJR.js.map +1 -0
- package/dist/chunk-YH2WPBJA.js +150 -0
- package/dist/chunk-YH2WPBJA.js.map +1 -0
- package/dist/chunk-YHNYCAVM.js +212 -0
- package/dist/chunk-YHNYCAVM.js.map +1 -0
- package/dist/chunk-YRKENLA3.js +796 -0
- package/dist/chunk-YRKENLA3.js.map +1 -0
- package/dist/chunk-YUXO7TSK.js +272 -0
- package/dist/chunk-YUXO7TSK.js.map +1 -0
- package/dist/chunk-YVM525DY.js +105 -0
- package/dist/chunk-YVM525DY.js.map +1 -0
- package/dist/chunk-Z5U5Q34M.js +150 -0
- package/dist/chunk-Z5U5Q34M.js.map +1 -0
- package/dist/chunk-ZCBBFBGM.js +212 -0
- package/dist/chunk-ZCBBFBGM.js.map +1 -0
- package/dist/chunk-ZGP7RCSE.js +63 -0
- package/dist/chunk-ZGP7RCSE.js.map +1 -0
- package/dist/chunk-ZH2NXJHL.js +3629 -0
- package/dist/chunk-ZH2NXJHL.js.map +1 -0
- package/dist/chunk-ZHGPXPGH.js +278 -0
- package/dist/chunk-ZHGPXPGH.js.map +1 -0
- package/dist/chunk-ZLZWFEEQ.js +37 -0
- package/dist/chunk-ZLZWFEEQ.js.map +1 -0
- package/dist/chunk-ZNCI5EUG.js +108 -0
- package/dist/chunk-ZNCI5EUG.js.map +1 -0
- package/dist/chunk-ZYUWIV3D.js +63 -0
- package/dist/chunk-ZYUWIV3D.js.map +1 -0
- package/dist/chunk-ZZI5775T.js +127 -0
- package/dist/chunk-ZZI5775T.js.map +1 -0
- package/dist/components/AddressContainer/CoreAddressContainer.js +10 -11
- package/dist/components/AddressContainer/EVMAddressContainer.js +9 -10
- package/dist/components/AddressContainer/addressSwitcher.js +7 -8
- package/dist/components/AddressContainer/addressView.js +6 -7
- package/dist/components/AddressContainer/label.js +4 -4
- package/dist/components/Age/index.js +4 -4
- package/dist/components/Charts/PreviewChartTemplate.js +1 -1
- package/dist/components/Charts/StockChartTemplate.js +1 -1
- package/dist/components/CopyButton/index.js +3 -3
- package/dist/components/DownloadCSV/index.js +4 -4
- package/dist/components/GasPriceDropdown/index.js +2 -2
- package/dist/components/IncreasePercent/index.js +2 -2
- package/dist/components/InfoIconWithTooltip/index.js +3 -3
- package/dist/components/Modal/index.js +3 -3
- package/dist/components/NetworkIcon/index.js +2 -2
- package/dist/components/PhishingAddressContainer/index.js +4 -5
- package/dist/components/PhishingAddressContainer/index.js.map +1 -1
- package/dist/components/Price/index.js +3 -3
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Select/select.js +3 -3
- package/dist/components/Text/index.js +4 -4
- package/dist/components/Tooltip/index.js +3 -3
- package/dist/components/TransactionAction/coreTransactionAction.js +10 -11
- package/dist/components/TransactionAction/coreTransactionAction.js.map +1 -1
- package/dist/components/TransactionAction/evmTransactionAction.js +9 -10
- package/dist/components/TransactionAction/evmTransactionAction.js.map +1 -1
- package/dist/utils/address.d.ts +1 -2
- package/dist/utils/address.js +2 -4
- package/dist/utils/contractManagerTool.js +2 -2
- package/dist/utils/hooks/useENS.js +3 -4
- package/dist/utils/index.js +2 -2
- package/dist/utils/request.d.ts +4 -1
- package/dist/utils/request.js +3 -1
- package/dist/utils/request.types.d.ts +50 -0
- package/dist/utils/request.types.js +1 -0
- package/dist/utils/request.types.js.map +1 -0
- package/dist/utils/rpcRequest.js +31 -3
- package/dist/utils/rpcRequest.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import {
|
|
2
|
+
publishRequestError
|
|
3
|
+
} from "./chunk-J2I22Q2M.js";
|
|
4
|
+
|
|
5
|
+
// src/utils/request.ts
|
|
6
|
+
import qs from "query-string";
|
|
7
|
+
import useSWR from "swr";
|
|
8
|
+
var TIMEOUT_TIMESTAMP = 6e4;
|
|
9
|
+
var checkStatus = (response) => {
|
|
10
|
+
if (response.status >= 200 && response.status < 300 || response.status === 600) {
|
|
11
|
+
return response;
|
|
12
|
+
} else {
|
|
13
|
+
const error = new Error(response.statusText);
|
|
14
|
+
error.name = "HttpError";
|
|
15
|
+
error.status = response.status;
|
|
16
|
+
error.response = response;
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var parseJSON = async (response) => {
|
|
21
|
+
const contentType = response.headers.get("content-type");
|
|
22
|
+
try {
|
|
23
|
+
if (contentType?.includes("application/json")) {
|
|
24
|
+
return { data: await response.json(), response };
|
|
25
|
+
} else if (contentType?.includes("text/html")) {
|
|
26
|
+
return { data: await response.text(), response };
|
|
27
|
+
} else {
|
|
28
|
+
return { data: response, response };
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (error.name === "AbortError") {
|
|
32
|
+
return { data: response, response };
|
|
33
|
+
}
|
|
34
|
+
publishRequestError({ url: response.url, code: 20001 }, "http");
|
|
35
|
+
error.response = response;
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
var checkResponse = function(url, {
|
|
40
|
+
data,
|
|
41
|
+
response
|
|
42
|
+
}, opts) {
|
|
43
|
+
if (response.status === 200 && (data.status === "1" || data.code === 0)) {
|
|
44
|
+
return data.result || data.data;
|
|
45
|
+
} else if (/HEAD/i.test(opts?.method || "")) {
|
|
46
|
+
return response;
|
|
47
|
+
} else {
|
|
48
|
+
const code = Number(data.status ?? data.code);
|
|
49
|
+
publishRequestError({ url, code, message: data.message }, "http");
|
|
50
|
+
const error = new Error(data.message);
|
|
51
|
+
error.response = data;
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var fetchWithAbort = (url, options = {}) => {
|
|
56
|
+
const controller = new AbortController();
|
|
57
|
+
const opts = { ...options, signal: controller.signal };
|
|
58
|
+
const timeout = options.timeout || TIMEOUT_TIMESTAMP;
|
|
59
|
+
let timeoutId;
|
|
60
|
+
const promise = new Promise((resolve, reject) => {
|
|
61
|
+
timeoutId = setTimeout(() => {
|
|
62
|
+
controller.abort();
|
|
63
|
+
publishRequestError(
|
|
64
|
+
{ url, code: 20002, message: "Request timeout" },
|
|
65
|
+
"http"
|
|
66
|
+
);
|
|
67
|
+
reject(new Error("Request timeout"));
|
|
68
|
+
}, timeout);
|
|
69
|
+
window.fetch(url, opts).then(checkStatus).then(parseJSON).then((...args) => checkResponse(url, ...args, opts)).then((data) => resolve(data)).catch((error) => {
|
|
70
|
+
if (/HEAD/i.test(opts?.method || "")) {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
if (error.name === "TypeError") {
|
|
74
|
+
publishRequestError({ url, code: 20004 }, "http");
|
|
75
|
+
reject(new Error("Network error"));
|
|
76
|
+
} else if (error.name === "AbortError") {
|
|
77
|
+
publishRequestError(
|
|
78
|
+
{ url, code: 20003, message: "Fetch aborted" },
|
|
79
|
+
"http"
|
|
80
|
+
);
|
|
81
|
+
reject(new Error("Fetch aborted"));
|
|
82
|
+
} else {
|
|
83
|
+
publishRequestError(
|
|
84
|
+
{ url, code: error.status, message: error.message },
|
|
85
|
+
"http"
|
|
86
|
+
);
|
|
87
|
+
reject(error);
|
|
88
|
+
}
|
|
89
|
+
}).finally(() => clearTimeout(timeoutId));
|
|
90
|
+
});
|
|
91
|
+
return {
|
|
92
|
+
promise,
|
|
93
|
+
abort: () => {
|
|
94
|
+
clearTimeout(timeoutId);
|
|
95
|
+
controller.abort();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
var fetch = (url, options = {}) => {
|
|
100
|
+
const { promise } = fetchWithAbort(url, options);
|
|
101
|
+
return promise;
|
|
102
|
+
};
|
|
103
|
+
var appendApiPrefix = (url) => {
|
|
104
|
+
if (url.startsWith("/stat/")) {
|
|
105
|
+
return url;
|
|
106
|
+
}
|
|
107
|
+
if (url.startsWith("http")) {
|
|
108
|
+
return url;
|
|
109
|
+
}
|
|
110
|
+
return `/v1${url.startsWith("/") ? url : "/" + url}`;
|
|
111
|
+
};
|
|
112
|
+
var fetchWithPrefix = (url, opts) => {
|
|
113
|
+
return fetch(appendApiPrefix(url), opts);
|
|
114
|
+
};
|
|
115
|
+
var simpleGetFetcher = async (...args) => {
|
|
116
|
+
let [url, query] = args;
|
|
117
|
+
if (query) {
|
|
118
|
+
url = qs.stringifyUrl({ url, query });
|
|
119
|
+
}
|
|
120
|
+
return await fetchWithPrefix(url, {
|
|
121
|
+
method: "get"
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
var useSWRWithGetFetcher = (key, swrOpts = {}) => {
|
|
125
|
+
const isTransferReq = typeof key === "string" && key.startsWith("/transfer") || Array.isArray(key) && typeof key[0] === "string" && key[0].startsWith("/transfer");
|
|
126
|
+
const { data, error, mutate } = useSWR(key, simpleGetFetcher, {
|
|
127
|
+
...swrOpts
|
|
128
|
+
});
|
|
129
|
+
let tokenAddress = "";
|
|
130
|
+
if (isTransferReq && data && data.list) {
|
|
131
|
+
tokenAddress = data.list.reduce(
|
|
132
|
+
(acc, trans) => {
|
|
133
|
+
if (trans.address && !acc.includes(trans.address))
|
|
134
|
+
acc.push(trans.address);
|
|
135
|
+
return acc;
|
|
136
|
+
},
|
|
137
|
+
[]
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
const { data: tokenData } = useSWR(
|
|
141
|
+
tokenAddress ? qs.stringifyUrl({
|
|
142
|
+
url: "/token",
|
|
143
|
+
query: { addressArray: tokenAddress, fields: "iconUrl" }
|
|
144
|
+
}) : null,
|
|
145
|
+
simpleGetFetcher
|
|
146
|
+
);
|
|
147
|
+
if (tokenData && tokenData.list) {
|
|
148
|
+
const newTransferList = data.list.map((trans) => {
|
|
149
|
+
if (tokenAddress.includes(trans.address)) {
|
|
150
|
+
const tokenInfo = tokenData.list.find(
|
|
151
|
+
(t) => t.address === trans.address
|
|
152
|
+
);
|
|
153
|
+
if (tokenInfo)
|
|
154
|
+
return { ...trans, token: { ...tokenInfo } };
|
|
155
|
+
}
|
|
156
|
+
return trans;
|
|
157
|
+
});
|
|
158
|
+
return {
|
|
159
|
+
data: {
|
|
160
|
+
...data,
|
|
161
|
+
list: newTransferList
|
|
162
|
+
},
|
|
163
|
+
error,
|
|
164
|
+
mutate
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
return { data, error, mutate };
|
|
168
|
+
};
|
|
169
|
+
var queryAddress = (address) => {
|
|
170
|
+
return address.reduce((prev, curr, index) => {
|
|
171
|
+
return !index ? `address=${curr}` : `${prev}&address=${curr}`;
|
|
172
|
+
}, "");
|
|
173
|
+
};
|
|
174
|
+
var sendRequestChart = async (config) => {
|
|
175
|
+
try {
|
|
176
|
+
const res = await fetch(
|
|
177
|
+
qs.stringifyUrl({ url: config.url, query: config.query }),
|
|
178
|
+
{
|
|
179
|
+
method: config.type || "GET",
|
|
180
|
+
body: config.body,
|
|
181
|
+
headers: config.headers,
|
|
182
|
+
signal: config.signal
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
const data = res;
|
|
186
|
+
data.list = [...data.list || []].reverse();
|
|
187
|
+
return data;
|
|
188
|
+
} catch (error) {
|
|
189
|
+
console.error("Request failed", error);
|
|
190
|
+
throw error;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var sendRequestENSInfo = async (url) => {
|
|
194
|
+
if (!url)
|
|
195
|
+
return {};
|
|
196
|
+
try {
|
|
197
|
+
const res = await fetch(url, {
|
|
198
|
+
method: "GET"
|
|
199
|
+
});
|
|
200
|
+
return res?.map;
|
|
201
|
+
} catch (error) {
|
|
202
|
+
console.error("Request failed", error);
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
var sendRequestGasPrice = async () => {
|
|
207
|
+
try {
|
|
208
|
+
const res = await fetch(`/stat/gasprice/tracker`, {
|
|
209
|
+
method: "GET"
|
|
210
|
+
});
|
|
211
|
+
return res;
|
|
212
|
+
} catch (error) {
|
|
213
|
+
console.error("Request failed", error);
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
var reqNametag = async (address) => {
|
|
218
|
+
const query = queryAddress(address);
|
|
219
|
+
const res = await fetch(`/v1/nametag?${query}`, {
|
|
220
|
+
method: "GET"
|
|
221
|
+
});
|
|
222
|
+
return res?.map;
|
|
223
|
+
};
|
|
224
|
+
var reqContractAndToken = async (address) => {
|
|
225
|
+
const query = queryAddress(address);
|
|
226
|
+
const res = await fetch(`/v1/contract-and-token?${query}`, {
|
|
227
|
+
method: "GET"
|
|
228
|
+
});
|
|
229
|
+
return res?.map;
|
|
230
|
+
};
|
|
231
|
+
var reqContractInfo = (contractAddress, fields = []) => {
|
|
232
|
+
const url = qs.stringifyUrl({
|
|
233
|
+
url: `/v1/contract/${contractAddress}`,
|
|
234
|
+
query: { fields }
|
|
235
|
+
});
|
|
236
|
+
return fetch(url, {
|
|
237
|
+
method: "GET"
|
|
238
|
+
});
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export {
|
|
242
|
+
fetch,
|
|
243
|
+
appendApiPrefix,
|
|
244
|
+
fetchWithPrefix,
|
|
245
|
+
simpleGetFetcher,
|
|
246
|
+
useSWRWithGetFetcher,
|
|
247
|
+
sendRequestChart,
|
|
248
|
+
sendRequestENSInfo,
|
|
249
|
+
sendRequestGasPrice,
|
|
250
|
+
reqNametag,
|
|
251
|
+
reqContractAndToken,
|
|
252
|
+
reqContractInfo
|
|
253
|
+
};
|
|
254
|
+
//# sourceMappingURL=chunk-4OVKJTEK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/request.ts"],"sourcesContent":["import qs from 'query-string';\nimport { publishRequestError } from './pubsub';\nimport useSWR from 'swr';\nimport { BaseContractInfo } from './request.types';\ninterface FetchWithAbortType<T> {\n promise: Promise<T>;\n abort: () => void;\n}\n\ninterface FetchOptions extends RequestInit {\n timeout?: number;\n}\n\nconst TIMEOUT_TIMESTAMP = 60000;\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 publishRequestError({ url: response.url, code: 20001 }, 'http');\n (error as any).response = response;\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: any,\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 (/HEAD/i.test(opts?.method || '')) {\n // handle of HEAD method\n return response;\n } else {\n const code = Number(data.status ?? data.code);\n publishRequestError({ url, code, message: data.message }, 'http');\n const error: Partial<ErrorEvent> & {\n response?: ResponseType;\n } = new Error(data.message);\n error.response = data;\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 timeout = options.timeout || TIMEOUT_TIMESTAMP;\n\n let timeoutId: ReturnType<typeof setTimeout>;\n const promise: Promise<T> = new Promise((resolve, reject) => {\n timeoutId = setTimeout(() => {\n controller.abort();\n publishRequestError(\n { url, code: 20002, message: 'Request timeout' },\n 'http',\n );\n reject(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 => resolve(data as T))\n .catch(error => {\n if (/HEAD/i.test(opts?.method || '')) {\n return {};\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 publishRequestError({ url, code: 20004 }, 'http');\n reject(new Error('Network error'));\n } else if (error.name === 'AbortError') {\n publishRequestError(\n { url, code: 20003, message: 'Fetch aborted' },\n 'http',\n );\n reject(new Error('Fetch aborted'));\n } else {\n publishRequestError(\n { url, code: (error as any).status, message: error.message },\n 'http',\n );\n reject(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 simpleGetFetcher = async <T>(...args: any[]) => {\n let [url, query] = args;\n if (query) {\n url = qs.stringifyUrl({ url, query });\n }\n return await fetchWithPrefix<T>(url, {\n method: 'get',\n });\n};\n\nexport const useSWRWithGetFetcher = (\n key: string | string[] | null,\n swrOpts = {},\n) => {\n const isTransferReq =\n (typeof key === 'string' && key.startsWith('/transfer')) ||\n (Array.isArray(key) &&\n typeof key[0] === 'string' &&\n key[0].startsWith('/transfer'));\n\n const { data, error, mutate }: any = useSWR(key, simpleGetFetcher, {\n ...swrOpts,\n });\n\n let tokenAddress: string | string[] = '';\n\n // deal with token info\n if (isTransferReq && data && data.list) {\n tokenAddress = data.list.reduce(\n (acc: string[], trans: { address: string }) => {\n if (trans.address && !acc.includes(trans.address))\n acc.push(trans.address);\n return acc;\n },\n [],\n );\n }\n\n const { data: tokenData }: any = useSWR(\n tokenAddress\n ? qs.stringifyUrl({\n url: '/token',\n query: { addressArray: tokenAddress, fields: 'iconUrl' },\n })\n : null,\n simpleGetFetcher,\n );\n\n if (tokenData && tokenData.list) {\n const newTransferList = data.list.map((trans: { address: string }) => {\n if (tokenAddress.includes(trans.address)) {\n const tokenInfo = tokenData.list.find(\n (t: { address: string }) => t.address === trans.address,\n );\n if (tokenInfo) return { ...trans, token: { ...tokenInfo } };\n }\n\n return trans;\n });\n\n return {\n data: {\n ...data,\n list: newTransferList,\n },\n error,\n mutate,\n };\n }\n\n return { data, error, mutate };\n};\n\ntype RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';\ninterface QueryParams {\n [key: string]: string;\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 = 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?.map;\n};\n\nexport const reqContractInfo = <T extends string>(\n contractAddress?: string,\n fields: T[] = [],\n) => {\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"],"mappings":";;;;;AAAA,OAAO,QAAQ;AAEf,OAAO,YAAY;AAWnB,IAAM,oBAAoB;AAE1B,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,wBAAoB,EAAE,KAAK,SAAS,KAAK,MAAM,MAAM,GAAG,MAAM;AAC9D,IAAC,MAAc,WAAW;AAC1B,UAAM;AAAA,EACR;AACF;AAGA,IAAM,gBAAgB,SACpB,KACA;AAAA,EACE;AAAA,EACA;AACF,GAIA,MACA;AAEA,MAAI,SAAS,WAAW,QAAQ,KAAK,WAAW,OAAO,KAAK,SAAS,IA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M,GAAG,aAAa;AAAA,IAC1B,KAAK,gBAAgB;AAAA,IACrB,OAAO,EAAE,OAAO;AAAA,EAClB,CAAC;AAED,SAAO,MAA6C,KAAK;AAAA,IACvD,QAAQ;AAAA,EACV,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useENS
|
|
3
|
+
} from "./chunk-ZGP7RCSE.js";
|
|
4
|
+
import {
|
|
5
|
+
ContractAddress,
|
|
6
|
+
ContractCreatedAddress,
|
|
7
|
+
CoreHexAddress,
|
|
8
|
+
InvalidAddress,
|
|
9
|
+
MyAddress,
|
|
10
|
+
PosAddress
|
|
11
|
+
} from "./chunk-NR7VYRLX.js";
|
|
12
|
+
import {
|
|
13
|
+
RenderAddress
|
|
14
|
+
} from "./chunk-2E3YJCV3.js";
|
|
15
|
+
import {
|
|
16
|
+
formatAddress,
|
|
17
|
+
isCoreAddress,
|
|
18
|
+
isCoreContractAddress,
|
|
19
|
+
isZeroAddress
|
|
20
|
+
} from "./chunk-6LZKERHY.js";
|
|
21
|
+
import {
|
|
22
|
+
getLabelInfo
|
|
23
|
+
} from "./chunk-4LTDTOPU.js";
|
|
24
|
+
import {
|
|
25
|
+
getTranslations,
|
|
26
|
+
useGlobalData
|
|
27
|
+
} from "./chunk-DQGLZCIG.js";
|
|
28
|
+
|
|
29
|
+
// src/components/AddressContainer/CoreAddressContainer.tsx
|
|
30
|
+
import { memo } from "react";
|
|
31
|
+
import { withTranslation } from "react-i18next";
|
|
32
|
+
import _ from "lodash";
|
|
33
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
34
|
+
var parseProps = (props, globalData) => {
|
|
35
|
+
const {
|
|
36
|
+
alias,
|
|
37
|
+
ensInfo,
|
|
38
|
+
t,
|
|
39
|
+
showAddressLabel,
|
|
40
|
+
showNametag,
|
|
41
|
+
nametagInfo,
|
|
42
|
+
showENSLabel
|
|
43
|
+
} = props;
|
|
44
|
+
const value = props.value || "";
|
|
45
|
+
const cfxAddress = formatAddress(value, "base32");
|
|
46
|
+
let ENSMap = ensInfo || {};
|
|
47
|
+
const translations = getTranslations();
|
|
48
|
+
let aliasLabel = alias;
|
|
49
|
+
if (!alias && isZeroAddress(cfxAddress)) {
|
|
50
|
+
aliasLabel = t(translations.general.zeroAddress);
|
|
51
|
+
}
|
|
52
|
+
let prefixIcon = null;
|
|
53
|
+
let officalNametag = null;
|
|
54
|
+
let addressLabel = null;
|
|
55
|
+
let ENSLabel = null;
|
|
56
|
+
const gENSLabel = cfxAddress && ENSMap[cfxAddress]?.name;
|
|
57
|
+
if (cfxAddress && showAddressLabel) {
|
|
58
|
+
const addressLabels = globalData?.["CONFLUX_SCAN_ADDRESS_LABELS" /* addressLabel */];
|
|
59
|
+
const gAddressLabel = addressLabels?.[cfxAddress];
|
|
60
|
+
if (gAddressLabel) {
|
|
61
|
+
const { label } = getLabelInfo(gAddressLabel, "tag");
|
|
62
|
+
addressLabel = label;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (cfxAddress && showNametag) {
|
|
66
|
+
const nametags = nametagInfo?.[cfxAddress];
|
|
67
|
+
if (nametags) {
|
|
68
|
+
const nametag = nametags?.nametag ?? "";
|
|
69
|
+
const { label } = getLabelInfo(nametag, "nametag");
|
|
70
|
+
officalNametag = label;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (showENSLabel && gENSLabel) {
|
|
74
|
+
const { label, icon } = getLabelInfo(gENSLabel, "ens");
|
|
75
|
+
ENSLabel = label;
|
|
76
|
+
prefixIcon = icon;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
alias: aliasLabel,
|
|
80
|
+
prefix: prefixIcon,
|
|
81
|
+
nametag: officalNametag,
|
|
82
|
+
addressLabel,
|
|
83
|
+
ENSLabel,
|
|
84
|
+
cfxAddress
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
var CoreAddressContainer = withTranslation()(
|
|
88
|
+
memo((props) => {
|
|
89
|
+
const { globalData } = useGlobalData();
|
|
90
|
+
const unnecessaryEns = props.ensInfo || props.showENSLabel === false;
|
|
91
|
+
const { ens } = useENS(unnecessaryEns ? null : props.value);
|
|
92
|
+
if (!props.value && !props.contractCreated) {
|
|
93
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "--" });
|
|
94
|
+
}
|
|
95
|
+
const defaultProps = {
|
|
96
|
+
isFull: false,
|
|
97
|
+
isFullNameTag: false,
|
|
98
|
+
link: true,
|
|
99
|
+
isMe: false,
|
|
100
|
+
showIcon: true,
|
|
101
|
+
verify: false,
|
|
102
|
+
showAddressLabel: true,
|
|
103
|
+
showENSLabel: true,
|
|
104
|
+
showNametag: true,
|
|
105
|
+
ensInfo: ens
|
|
106
|
+
};
|
|
107
|
+
const mergeDefaultProps = _.assign({}, defaultProps, props);
|
|
108
|
+
const mergeParseProps = _.merge(
|
|
109
|
+
{},
|
|
110
|
+
mergeDefaultProps,
|
|
111
|
+
parseProps(mergeDefaultProps, globalData)
|
|
112
|
+
);
|
|
113
|
+
if (mergeParseProps.isPosAddress) {
|
|
114
|
+
return PosAddress(mergeParseProps);
|
|
115
|
+
}
|
|
116
|
+
if (!mergeParseProps.value && mergeParseProps.contractCreated) {
|
|
117
|
+
return ContractCreatedAddress({
|
|
118
|
+
...mergeParseProps,
|
|
119
|
+
outputType: "base32"
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (mergeParseProps.isEspaceAddress) {
|
|
123
|
+
return CoreHexAddress(mergeParseProps);
|
|
124
|
+
}
|
|
125
|
+
if (!isCoreAddress(mergeParseProps.value)) {
|
|
126
|
+
return InvalidAddress(mergeParseProps);
|
|
127
|
+
}
|
|
128
|
+
if (isCoreContractAddress(mergeParseProps.cfxAddress)) {
|
|
129
|
+
return ContractAddress(mergeParseProps);
|
|
130
|
+
}
|
|
131
|
+
if (mergeParseProps.isMe) {
|
|
132
|
+
return MyAddress(mergeParseProps);
|
|
133
|
+
}
|
|
134
|
+
return RenderAddress(mergeParseProps);
|
|
135
|
+
})
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
export {
|
|
139
|
+
CoreAddressContainer
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=chunk-54S3AFTR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/CoreAddressContainer.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { WithTranslation, withTranslation } from 'react-i18next';\nimport _ from 'lodash';\nimport {\n formatAddress,\n isCoreAddress,\n isCoreContractAddress,\n isZeroAddress,\n convertCheckSum,\n} from '../../utils/address';\nimport { useGlobalData, getTranslations } from '../../store';\nimport { LOCALSTORAGE_KEYS_MAP } from '../../utils/constants';\nimport { getLabelInfo } from './label';\nimport { useENS } from '../../utils/hooks/useENS';\n\nimport { RenderAddress } from './addressView';\nimport {\n ContractCreatedAddress,\n CoreHexAddress,\n InvalidAddress,\n ContractAddress,\n MyAddress,\n PosAddress,\n} from './addressSwitcher';\nimport { GlobalDataType } from 'src/store/types';\nimport { CoreAddressContainerProps } from './types';\n\nconst parseProps = (\n props: CoreAddressContainerProps & WithTranslation,\n globalData: GlobalDataType,\n) => {\n const {\n alias,\n ensInfo,\n t,\n showAddressLabel,\n showNametag,\n nametagInfo,\n showENSLabel,\n } = props;\n const value: string = props.value || '';\n const cfxAddress = formatAddress(value, 'base32');\n\n let ENSMap = ensInfo || {};\n\n const translations = getTranslations();\n\n let aliasLabel = alias;\n if (!alias && isZeroAddress(cfxAddress)) {\n aliasLabel = t(translations.general.zeroAddress);\n }\n\n let prefixIcon: React.ReactNode = null;\n // official name tag\n let officalNametag: React.ReactNode = null;\n // private name tag\n let addressLabel: React.ReactNode = null;\n // ens name tag\n let ENSLabel: React.ReactNode = null;\n // global ens name tag\n const gENSLabel = cfxAddress && ENSMap[cfxAddress]?.name;\n\n if (cfxAddress && showAddressLabel) {\n // global private name tag\n const addressLabels = globalData?.[LOCALSTORAGE_KEYS_MAP.addressLabel];\n const gAddressLabel = addressLabels?.[cfxAddress];\n\n if (gAddressLabel) {\n const { label } = getLabelInfo(gAddressLabel, 'tag');\n addressLabel = label;\n }\n }\n\n if (cfxAddress && showNametag) {\n const nametags = nametagInfo?.[cfxAddress];\n\n if (nametags) {\n const nametag = nametags?.nametag ?? '';\n const { label } = getLabelInfo(nametag, 'nametag');\n officalNametag = label;\n }\n }\n\n if (showENSLabel && gENSLabel) {\n const { label, icon } = getLabelInfo(gENSLabel, 'ens');\n ENSLabel = label;\n prefixIcon = icon;\n }\n\n return {\n alias: aliasLabel,\n prefix: prefixIcon,\n nametag: officalNametag,\n addressLabel,\n ENSLabel,\n cfxAddress,\n };\n};\n\nexport const CoreAddressContainer = withTranslation()(\n memo((props: CoreAddressContainerProps & WithTranslation) => {\n const { globalData } = useGlobalData();\n\n // If the interface returns Ens content, there is no need to obtain it separately, or disable the display of Ens content (in most cases on the list page).\n const unnecessaryEns = props.ensInfo || props.showENSLabel === false;\n const { ens } = useENS(unnecessaryEns ? null : props.value);\n\n // If a txn receipt has no 'to' address or 'contractCreated', show -- for temp\n if (!props.value && !props.contractCreated) {\n return <>--</>;\n }\n\n const defaultProps = {\n isFull: false,\n isFullNameTag: false,\n link: true,\n isMe: false,\n showIcon: true,\n verify: false,\n showAddressLabel: true,\n showENSLabel: true,\n showNametag: true,\n ensInfo: ens,\n };\n\n const mergeDefaultProps = _.assign({}, defaultProps, props);\n\n const mergeParseProps = _.merge(\n {},\n mergeDefaultProps,\n parseProps(mergeDefaultProps, globalData),\n );\n\n if (mergeParseProps.isPosAddress) {\n return PosAddress(mergeParseProps);\n }\n\n if (!mergeParseProps.value && mergeParseProps.contractCreated) {\n return ContractCreatedAddress({\n ...mergeParseProps,\n outputType: 'base32',\n });\n }\n\n if (mergeParseProps.isEspaceAddress) {\n return CoreHexAddress(mergeParseProps);\n }\n\n if (!isCoreAddress(mergeParseProps.value)) {\n return InvalidAddress(mergeParseProps);\n }\n\n if (isCoreContractAddress(mergeParseProps.cfxAddress)) {\n return ContractAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isMe) {\n return MyAddress(mergeParseProps);\n }\n\n return RenderAddress(mergeParseProps);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAA0B,uBAAuB;AACjD,OAAO,OAAO;AA2GD;AAlFb,IAAM,aAAa,CACjB,OACA,eACG;AACH,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,QAAgB,MAAM,SAAS;AACrC,QAAM,aAAa,cAAc,OAAO,QAAQ;AAEhD,MAAI,SAAS,WAAW,CAAC;AAEzB,QAAM,eAAe,gBAAgB;AAErC,MAAI,aAAa;AACjB,MAAI,CAAC,SAAS,cAAc,UAAU,GAAG;AACvC,iBAAa,EAAE,aAAa,QAAQ,WAAW;AAAA,EACjD;AAEA,MAAI,aAA8B;AAElC,MAAI,iBAAkC;AAEtC,MAAI,eAAgC;AAEpC,MAAI,WAA4B;AAEhC,QAAM,YAAY,cAAc,OAAO,UAAU,GAAG;AAEpD,MAAI,cAAc,kBAAkB;AAElC,UAAM,gBAAgB,6DAA+C;AACrE,UAAM,gBAAgB,gBAAgB,UAAU;AAEhD,QAAI,eAAe;AACjB,YAAM,EAAE,MAAM,IAAI,aAAa,eAAe,KAAK;AACnD,qBAAe;AAAA,IACjB;AAAA,EACF;AAEA,MAAI,cAAc,aAAa;AAC7B,UAAM,WAAW,cAAc,UAAU;AAEzC,QAAI,UAAU;AACZ,YAAM,UAAU,UAAU,WAAW;AACrC,YAAM,EAAE,MAAM,IAAI,aAAa,SAAS,SAAS;AACjD,uBAAiB;AAAA,IACnB;AAAA,EACF;AAEA,MAAI,gBAAgB,WAAW;AAC7B,UAAM,EAAE,OAAO,KAAK,IAAI,aAAa,WAAW,KAAK;AACrD,eAAW;AACX,iBAAa;AAAA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B,aAAO,UAAU,eAAe;AAAA,IAClC;AAEA,WAAO,cAAc,eAAe;AAAA,EACtC,CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tooltip
|
|
3
|
+
} from "./chunk-JL6ZIJUH.js";
|
|
4
|
+
import {
|
|
5
|
+
getTranslations
|
|
6
|
+
} from "./chunk-DQGLZCIG.js";
|
|
7
|
+
|
|
8
|
+
// src/components/AddressContainer/label.tsx
|
|
9
|
+
import { Translation } from "react-i18next";
|
|
10
|
+
import { Bookmark, Hash } from "@zeit-ui/react-icons";
|
|
11
|
+
import ICON_ENS from "./logo-cns-7CXISC6I.svg";
|
|
12
|
+
import { jsx } from "react/jsx-runtime";
|
|
13
|
+
var getLabelInfo = (label, type) => {
|
|
14
|
+
const translations = getTranslations();
|
|
15
|
+
if (label) {
|
|
16
|
+
let trans = "";
|
|
17
|
+
let icon = null;
|
|
18
|
+
if (type === "tag") {
|
|
19
|
+
trans = translations.profile.tip.label;
|
|
20
|
+
icon = /* @__PURE__ */ jsx(Bookmark, { color: "var(--theme-color-gray2)", size: 16 });
|
|
21
|
+
} else if (type === "ens") {
|
|
22
|
+
trans = translations.ens.label;
|
|
23
|
+
icon = /* @__PURE__ */ jsx(
|
|
24
|
+
"img",
|
|
25
|
+
{
|
|
26
|
+
src: ICON_ENS,
|
|
27
|
+
className: "w-[16px] h-[16px] mb-[3px] mr-[2px]",
|
|
28
|
+
alt: ""
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
} else if (type === "nametag") {
|
|
32
|
+
trans = translations.nametag.label;
|
|
33
|
+
icon = /* @__PURE__ */ jsx(Hash, { color: "var(--theme-color-gray2)", size: 16 });
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
label,
|
|
37
|
+
icon: /* @__PURE__ */ jsx("span", { className: "mr-[2px]", children: /* @__PURE__ */ jsx(Tooltip, { title: /* @__PURE__ */ jsx(Translation, { children: (t) => t(trans) }), children: icon }) })
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
label: "",
|
|
42
|
+
icon: null
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export {
|
|
47
|
+
getLabelInfo
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=chunk-5G3TPHDI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/label.tsx"],"sourcesContent":["import { Translation } from 'react-i18next';\nimport { Bookmark, Hash } from '@zeit-ui/react-icons';\nimport { Tooltip } from '../Tooltip';\nimport { getTranslations } from '../../store';\nimport ICON_ENS from '../../images/logo-cns.svg';\n\nexport const getLabelInfo = (label: string, type: string) => {\n const translations = getTranslations();\n if (label) {\n let trans: string = '';\n let icon: React.ReactNode = null;\n\n if (type === 'tag') {\n trans = translations.profile.tip.label;\n icon = <Bookmark color=\"var(--theme-color-gray2)\" size={16} />;\n } else if (type === 'ens') {\n trans = (translations as any).ens.label;\n icon = (\n <img\n src={ICON_ENS}\n className=\"w-[16px] h-[16px] mb-[3px] mr-[2px]\"\n alt=\"\"\n />\n );\n // nametag from official operational staff\n } else if (type === 'nametag') {\n trans = translations.nametag.label;\n icon = <Hash color=\"var(--theme-color-gray2)\" size={16} />;\n }\n\n return {\n label,\n icon: (\n <span className=\"mr-[2px]\">\n <Tooltip title={<Translation>{t => t(trans)}</Translation>}>\n {icon}\n </Tooltip>\n </span>\n ),\n };\n }\n\n return {\n label: '',\n icon: null,\n };\n};\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmB;AAC5B,SAAS,UAAU,YAAY;AAG/B,OAAO,cAAc;AAUR;AARN,IAAM,eAAe,CAAC,OAAe,SAAiB;AAC3D,QAAM,eAAe,gBAAgB;AACrC,MAAI,OAAO;AACT,QAAI,QAAgB;AACpB,QAAI,OAAwB;AAE5B,QAAI,SAAS,OAAO;AAClB,cAAQ,aAAa,QAAQ,IAAI;AACjC,aAAO,oBAAC,YAAS,OAAM,4BAA2B,MAAM,IAAI;AAAA,IAC9D,WAAW,SAAS,OAAO;AACzB,cAAS,aAAqB,IAAI;AAClC,aACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,WAAU;AAAA,UACV,KAAI;AAAA;AAAA,MACN;AAAA,IAGJ,WAAW,SAAS,WAAW;AAC7B,cAAQ,aAAa,QAAQ;AAC7B,aAAO,oBAAC,QAAK,OAAM,4BAA2B,MAAM,IAAI;AAAA,IAC1D;AAEA,WAAO;AAAA,MACL;AAAA,MACA,MACE,oBAAC,UAAK,WAAU,YACd,8BAAC,WAAQ,OAAO,oBAAC,eAAa,iBAAK,EAAE,KAAK,GAAE,GACzC,gBACH,GACF;AAAA,IAEJ;AAAA,EACF;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ContractAddress,
|
|
3
|
+
ContractCreatedAddress,
|
|
4
|
+
InvalidAddress,
|
|
5
|
+
MyAddress
|
|
6
|
+
} from "./chunk-3BYHQHWI.js";
|
|
7
|
+
import {
|
|
8
|
+
RenderAddress
|
|
9
|
+
} from "./chunk-DJMQJGDU.js";
|
|
10
|
+
import {
|
|
11
|
+
convertCheckSum,
|
|
12
|
+
formatAddress,
|
|
13
|
+
isEvmAddress,
|
|
14
|
+
isZeroAddress
|
|
15
|
+
} from "./chunk-YUXO7TSK.js";
|
|
16
|
+
import {
|
|
17
|
+
getLabelInfo
|
|
18
|
+
} from "./chunk-HQQ5ZL6Q.js";
|
|
19
|
+
import {
|
|
20
|
+
getTranslations,
|
|
21
|
+
useGlobalData
|
|
22
|
+
} from "./chunk-DQGLZCIG.js";
|
|
23
|
+
|
|
24
|
+
// src/components/AddressContainer/EVMAddressContainer.tsx
|
|
25
|
+
import { memo } from "react";
|
|
26
|
+
import { withTranslation } from "react-i18next";
|
|
27
|
+
import _ from "lodash";
|
|
28
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
29
|
+
var parseProps = (props, globalData) => {
|
|
30
|
+
const { alias, t, showAddressLabel, showNametag, nametagInfo } = props;
|
|
31
|
+
const value = props.value || "";
|
|
32
|
+
const cfxAddress = formatAddress(value, "hex");
|
|
33
|
+
const translations = getTranslations();
|
|
34
|
+
let aliasLabel = alias;
|
|
35
|
+
if (!alias && isZeroAddress(cfxAddress)) {
|
|
36
|
+
aliasLabel = t(translations.general.zeroAddress);
|
|
37
|
+
}
|
|
38
|
+
let officalNametag = null;
|
|
39
|
+
let addressLabel = null;
|
|
40
|
+
if (cfxAddress && showAddressLabel) {
|
|
41
|
+
const addressLabels = globalData?.["CONFLUX_SCAN_ADDRESS_LABELS" /* addressLabel */];
|
|
42
|
+
const gAddressLabel = addressLabels?.[convertCheckSum(cfxAddress)] || addressLabels?.[cfxAddress.toLowerCase()];
|
|
43
|
+
if (gAddressLabel) {
|
|
44
|
+
const { label } = getLabelInfo(gAddressLabel, "tag");
|
|
45
|
+
addressLabel = label;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (cfxAddress && showNametag) {
|
|
49
|
+
const nametags = nametagInfo?.[convertCheckSum(cfxAddress)] || nametagInfo?.[cfxAddress.toLowerCase()];
|
|
50
|
+
if (nametags) {
|
|
51
|
+
const nametag = nametags?.nametag ?? "";
|
|
52
|
+
const { label } = getLabelInfo(nametag, "nametag");
|
|
53
|
+
officalNametag = label;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
alias: aliasLabel,
|
|
58
|
+
nametag: officalNametag,
|
|
59
|
+
addressLabel,
|
|
60
|
+
cfxAddress
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
var EVMAddressContainer = withTranslation()(
|
|
64
|
+
memo((props) => {
|
|
65
|
+
const { globalData } = useGlobalData();
|
|
66
|
+
if (!props.value && !props.contractCreated) {
|
|
67
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "--" });
|
|
68
|
+
}
|
|
69
|
+
const defaultProps = {
|
|
70
|
+
isFull: false,
|
|
71
|
+
isFullNameTag: false,
|
|
72
|
+
link: true,
|
|
73
|
+
isMe: false,
|
|
74
|
+
showIcon: true,
|
|
75
|
+
verify: false,
|
|
76
|
+
showAddressLabel: true,
|
|
77
|
+
showENSLabel: true,
|
|
78
|
+
showNametag: true
|
|
79
|
+
};
|
|
80
|
+
const mergeDefaultProps = _.assign({}, defaultProps, props);
|
|
81
|
+
const mergeParseProps = _.merge(
|
|
82
|
+
{},
|
|
83
|
+
mergeDefaultProps,
|
|
84
|
+
parseProps(mergeDefaultProps, globalData)
|
|
85
|
+
);
|
|
86
|
+
if (!mergeParseProps.value && mergeParseProps.contractCreated) {
|
|
87
|
+
return ContractCreatedAddress({
|
|
88
|
+
...mergeParseProps,
|
|
89
|
+
outputType: "hex"
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
if (!isEvmAddress(mergeParseProps.value)) {
|
|
93
|
+
return InvalidAddress(mergeParseProps);
|
|
94
|
+
}
|
|
95
|
+
if (mergeParseProps.isContract) {
|
|
96
|
+
return ContractAddress(mergeParseProps);
|
|
97
|
+
}
|
|
98
|
+
if (mergeParseProps.isMe) {
|
|
99
|
+
return MyAddress(mergeParseProps);
|
|
100
|
+
}
|
|
101
|
+
return RenderAddress(mergeParseProps);
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
EVMAddressContainer
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=chunk-5HPBFAVS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AddressContainer/EVMAddressContainer.tsx"],"sourcesContent":["import { memo } from 'react';\nimport { WithTranslation, withTranslation } from 'react-i18next';\nimport _ from 'lodash';\nimport {\n formatAddress,\n isEvmAddress,\n isZeroAddress,\n convertCheckSum,\n} from '../../utils/address';\nimport { useGlobalData, getTranslations } from '../../store';\nimport { LOCALSTORAGE_KEYS_MAP } from '../../utils/constants';\nimport { getLabelInfo } from './label';\n\nimport { RenderAddress } from './addressView';\nimport {\n ContractCreatedAddress,\n InvalidAddress,\n ContractAddress,\n MyAddress,\n} from './addressSwitcher';\nimport { GlobalDataType } from 'src/store/types';\nimport { EVMAddressContainerProps } from './types';\n\nconst parseProps = (\n props: EVMAddressContainerProps & WithTranslation,\n globalData: GlobalDataType,\n) => {\n const { alias, t, showAddressLabel, showNametag, nametagInfo } = props;\n const value: string = props.value || '';\n const cfxAddress = formatAddress(value, 'hex');\n\n const translations = getTranslations();\n\n let aliasLabel = alias;\n if (!alias && isZeroAddress(cfxAddress)) {\n aliasLabel = t(translations.general.zeroAddress);\n }\n\n // official name tag\n let officalNametag: React.ReactNode = null;\n // private name tag\n let addressLabel: React.ReactNode = null;\n\n if (cfxAddress && showAddressLabel) {\n // global private name tag\n const addressLabels = globalData?.[LOCALSTORAGE_KEYS_MAP.addressLabel];\n const gAddressLabel =\n addressLabels?.[convertCheckSum(cfxAddress)] ||\n addressLabels?.[cfxAddress.toLowerCase()];\n\n if (gAddressLabel) {\n const { label } = getLabelInfo(gAddressLabel, 'tag');\n addressLabel = label;\n }\n }\n\n if (cfxAddress && showNametag) {\n const nametags =\n nametagInfo?.[convertCheckSum(cfxAddress)] ||\n nametagInfo?.[cfxAddress.toLowerCase()];\n\n if (nametags) {\n const nametag = nametags?.nametag ?? '';\n const { label } = getLabelInfo(nametag, 'nametag');\n officalNametag = label;\n }\n }\n\n return {\n alias: aliasLabel,\n nametag: officalNametag,\n addressLabel,\n cfxAddress,\n };\n};\n\nexport const EVMAddressContainer = withTranslation()(\n memo((props: EVMAddressContainerProps & WithTranslation) => {\n const { globalData } = useGlobalData();\n\n // If a txn receipt has no 'to' address or 'contractCreated', show -- for temp\n if (!props.value && !props.contractCreated) {\n return <>--</>;\n }\n\n const defaultProps = {\n isFull: false,\n isFullNameTag: false,\n link: true,\n isMe: false,\n showIcon: true,\n verify: false,\n showAddressLabel: true,\n showENSLabel: true,\n showNametag: true,\n };\n\n const mergeDefaultProps = _.assign({}, defaultProps, props);\n\n const mergeParseProps = _.merge(\n {},\n mergeDefaultProps,\n parseProps(mergeDefaultProps, globalData),\n );\n\n if (!mergeParseProps.value && mergeParseProps.contractCreated) {\n return ContractCreatedAddress({\n ...mergeParseProps,\n outputType: 'hex',\n });\n }\n\n if (!isEvmAddress(mergeParseProps.value)) {\n return InvalidAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isContract) {\n return ContractAddress(mergeParseProps);\n }\n\n if (mergeParseProps.isMe) {\n return MyAddress(mergeParseProps);\n }\n\n return RenderAddress(mergeParseProps);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAAY;AACrB,SAA0B,uBAAuB;AACjD,OAAO,OAAO;AAgFD;AA3Db,IAAM,aAAa,CACjB,OACA,eACG;AACH,QAAM,EAAE,OAAO,GAAG,kBAAkB,aAAa,YAAY,IAAI;AACjE,QAAM,QAAgB,MAAM,SAAS;AACrC,QAAM,aAAa,cAAc,OAAO,KAAK;AAE7C,QAAM,eAAe,gBAAgB;AAErC,MAAI,aAAa;AACjB,MAAI,CAAC,SAAS,cAAc,UAAU,GAAG;AACvC,iBAAa,EAAE,aAAa,QAAQ,WAAW;AAAA,EACjD;AAGA,MAAI,iBAAkC;AAEtC,MAAI,eAAgC;AAEpC,MAAI,cAAc,kBAAkB;AAElC,UAAM,gBAAgB,6DAA+C;AACrE,UAAM,gBACJ,gBAAgB,gBAAgB,UAAU,CAAC,KAC3C,gBAAgB,WAAW,YAAY,CAAC;AAE1C,QAAI,eAAe;AACjB,YAAM,EAAE,MAAM,IAAI,aAAa,eAAe,KAAK;AACnD,qBAAe;AAAA,IACjB;AAAA,EACF;AAEA,MAAI,cAAc,aAAa;AAC7B,UAAM,WACJ,cAAc,gBAAgB,UAAU,CAAC,KACzC,cAAc,WAAW,YAAY,CAA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