Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
1cf6ca78
Commit
1cf6ca78
authored
Jan 22, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raw data sort
parent
336fcf55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
userOps.ts
types/api/userOps.ts
+13
-1
UserOpRaw.tsx
ui/userOp/UserOpRaw.tsx
+9
-1
No files found.
types/api/userOps.ts
View file @
1cf6ca78
...
...
@@ -49,7 +49,19 @@ export type UserOp = {
user_logs_start_index
:
number
;
user_logs_count
:
number
;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
raw
:
Record
<
string
,
any
>
;
raw
:
{
call_data
:
string
;
call_gas_limit
:
string
;
init_code
:
string
;
max_fee_per_gas
:
string
;
max_priority_fee_per_gas
:
string
;
nonce
:
string
;
paymaster_and_data
:
string
;
pre_verification_gas
:
string
;
sender
:
string
;
signature
:
string
;
verification_gas_limit
:
string
;
};
gas_price
:
string
;
gas_used
:
string
;
}
...
...
ui/userOp/UserOpRaw.tsx
View file @
1cf6ca78
import
{
Skeleton
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
UserOp
}
from
'
types/api/userOps
'
;
import
RawDataSnippet
from
'
ui/shared/RawDataSnippet
'
;
// eslint-disable-next-line max-len
const
KEYS_ORDER
:
Array
<
keyof
UserOp
[
'
raw
'
]
>
=
[
'
sender
'
,
'
nonce
'
,
'
init_code
'
,
'
call_data
'
,
'
call_gas_limit
'
,
'
verification_gas_limit
'
,
'
pre_verification_gas
'
,
'
max_fee_per_gas
'
,
'
max_priority_fee_per_gas
'
,
'
paymaster_and_data
'
,
'
signature
'
];
interface
Props
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
rawData
?:
Record
<
string
,
any
>
;
...
...
@@ -14,7 +19,10 @@ const UserOpRaw = ({ rawData, isLoading }: Props) => {
return
null
;
}
const
text
=
JSON
.
stringify
(
rawData
,
undefined
,
4
);
const
text
=
JSON
.
stringify
(
KEYS_ORDER
.
reduce
((
res
:
UserOp
[
'
raw
'
],
key
:
keyof
UserOp
[
'
raw
'
])
=>
{
res
[
key
]
=
rawData
[
key
];
return
res
;
},
{}
as
UserOp
[
'
raw
'
]),
undefined
,
4
);
return
<
Skeleton
isLoaded=
{
!
isLoading
}
><
RawDataSnippet
data=
{
text
}
/></
Skeleton
>;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment