File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 23
23
Operation
24
24
<BlockInfo
25
25
:value =" userOpData.nonce.toString()"
26
- :label =" `#${userOpData.nonce}`"
26
+ :label =" `#${formatNonce( userOpData.nonce) }`"
27
27
type =" regular"
28
28
:chain =" userOpData.chainId"
29
29
/>
@@ -272,7 +272,19 @@ function formatEntryPoint(value: Address): string {
272
272
}
273
273
274
274
function getAddressLabel(chain : Chain , address : Address ): string {
275
- return getLabelText (chain , address ) || address ;
275
+ return getLabelText (chain , address ) || formatAddress (address );
276
+ }
277
+
278
+ function formatAddress(address : Address ): string {
279
+ return address .slice (0 , 8 ) + ' …' + address .slice (- 6 );
280
+ }
281
+
282
+ function formatNonce(nonce : bigint ): string {
283
+ const nonceString = nonce .toString ();
284
+ if (nonceString .length <= 10 ) {
285
+ return nonce .toString ();
286
+ }
287
+ return ` ${nonceString .slice (0 , 5 )}…${nonceString .slice (- 5 )} ` ;
276
288
}
277
289
</script >
278
290
You can’t perform that action at this time.
0 commit comments