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
d1d615e6
Commit
d1d615e6
authored
Jan 17, 2024
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user ops tab in tx
parent
91b8e7bf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
2 deletions
+82
-2
resources.ts
lib/api/resources.ts
+3
-2
userOps.ts
types/api/userOps.ts
+4
-0
Transaction.tsx
ui/pages/Transaction.tsx
+2
-0
TxUserOps.tsx
ui/tx/TxUserOps.tsx
+73
-0
No files found.
lib/api/resources.ts
View file @
d1d615e6
...
...
@@ -77,7 +77,7 @@ import type {
import
type
{
TxInterpretationResponse
}
from
'
types/api/txInterpretation
'
;
import
type
{
TTxsFilters
}
from
'
types/api/txsFilters
'
;
import
type
{
TxStateChanges
}
from
'
types/api/txStateChanges
'
;
import
type
{
UserOpsResponse
,
UserOp
}
from
'
types/api/userOps
'
;
import
type
{
UserOpsResponse
,
UserOp
,
UserOpsFilters
}
from
'
types/api/userOps
'
;
import
type
{
VerifiedContractsSorting
}
from
'
types/api/verifiedContracts
'
;
import
type
{
VisualizedContract
}
from
'
types/api/visualization
'
;
import
type
{
WithdrawalsResponse
,
WithdrawalsCounters
}
from
'
types/api/withdrawals
'
;
...
...
@@ -583,7 +583,7 @@ export const RESOURCES = {
// USER OPS
user_ops
:
{
path
:
'
/api/v2/proxy/account-abstraction/operations
'
,
filterFields
:
[],
filterFields
:
[
'
transaction_hash
'
as
const
],
},
user_op
:
{
...
...
@@ -789,6 +789,7 @@ Q extends 'tokens_bridged' ? TokensBridgedFilters :
Q
extends
'
verified_contracts
'
?
VerifiedContractsFilters
:
Q
extends
'
addresses_lookup
'
?
EnsAddressLookupFilters
:
Q
extends
'
domains_lookup
'
?
EnsDomainLookupFilters
:
Q
extends
'
user_ops
'
?
UserOpsFilters
:
never
;
/* eslint-enable @typescript-eslint/indent */
...
...
types/api/userOps.ts
View file @
d1d615e6
...
...
@@ -50,3 +50,7 @@ export type UserOp = {
user_logs_start_index
:
number
;
user_logs_count
:
number
;
}
export
type
UserOpsFilters
=
{
transaction_hash
?:
string
;
}
ui/pages/Transaction.tsx
View file @
d1d615e6
...
...
@@ -22,6 +22,7 @@ import TxRawTrace from 'ui/tx/TxRawTrace';
import
TxState
from
'
ui/tx/TxState
'
;
import
TxSubHeading
from
'
ui/tx/TxSubHeading
'
;
import
TxTokenTransfer
from
'
ui/tx/TxTokenTransfer
'
;
import
TxUserOps
from
'
ui/tx/TxUserOps
'
;
const
TransactionPageContent
=
()
=>
{
const
router
=
useRouter
();
...
...
@@ -47,6 +48,7 @@ const TransactionPageContent = () => {
{
id
:
'
wrapped
'
,
title
:
'
Regular tx details
'
,
component
:
<
TxDetailsWrapped
data=
{
data
.
wrapped
}
/>
}
:
undefined
,
{
id
:
'
token_transfers
'
,
title
:
'
Token transfers
'
,
component
:
<
TxTokenTransfer
/>
},
config
.
features
.
userOps
.
isEnabled
?
{
id
:
'
user_ops
'
,
title
:
'
User operations
'
,
component
:
<
TxUserOps
/>
}
:
undefined
,
{
id
:
'
internal
'
,
title
:
'
Internal txns
'
,
component
:
<
TxInternals
/>
},
{
id
:
'
logs
'
,
title
:
'
Logs
'
,
component
:
<
TxLogs
/>
},
{
id
:
'
state
'
,
title
:
'
State
'
,
component
:
<
TxState
/>
},
...
...
ui/tx/TxUserOps.tsx
0 → 100644
View file @
d1d615e6
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
SECOND
}
from
'
lib/consts
'
;
import
{
USER_OPS_ITEM
}
from
'
stubs/userOps
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
ActionBar
from
'
ui/shared/ActionBar
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
DataListDisplay
from
'
ui/shared/DataListDisplay
'
;
import
Pagination
from
'
ui/shared/pagination/Pagination
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
TxPendingAlert
from
'
ui/tx/TxPendingAlert
'
;
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
import
useFetchTxInfo
from
'
ui/tx/useFetchTxInfo
'
;
import
UserOpsListItem
from
'
ui/userOps/UserOpsListItem
'
;
import
UserOpsTable
from
'
ui/userOps/UserOpsTable
'
;
const
TxTokenTransfer
=
()
=>
{
const
txsInfo
=
useFetchTxInfo
({
updateDelay
:
5
*
SECOND
});
const
userOpsQuery
=
useQueryWithPages
({
resourceName
:
'
user_ops
'
,
options
:
{
enabled
:
!
txsInfo
.
isPlaceholderData
&&
Boolean
(
txsInfo
.
data
?.
status
&&
txsInfo
.
data
?.
hash
),
// most often there is only one user op in one tx
placeholderData
:
generateListStub
<
'
user_ops
'
>
(
USER_OPS_ITEM
,
1
,
{
next_page_params
:
null
}),
},
filters
:
{
transaction_hash
:
txsInfo
.
data
?.
hash
},
});
if
(
!
txsInfo
.
isPending
&&
!
txsInfo
.
isPlaceholderData
&&
!
txsInfo
.
isError
&&
!
txsInfo
.
data
.
status
)
{
return
txsInfo
.
socketStatus
?
<
TxSocketAlert
status=
{
txsInfo
.
socketStatus
}
/>
:
<
TxPendingAlert
/>;
}
if
(
txsInfo
.
isError
||
userOpsQuery
.
isError
)
{
return
<
DataFetchAlert
/>;
}
const
content
=
userOpsQuery
.
data
?.
items
?
(
<>
<
Hide
below=
"lg"
ssr=
{
false
}
>
<
UserOpsTable
items=
{
userOpsQuery
.
data
?.
items
}
top=
{
userOpsQuery
.
pagination
.
isVisible
?
0
:
80
}
isLoading=
{
userOpsQuery
.
isPlaceholderData
}
/>
</
Hide
>
<
Show
below=
"lg"
ssr=
{
false
}
>
{
userOpsQuery
.
data
.
items
.
map
(((
item
,
index
)
=>
(
<
UserOpsListItem
key=
{
item
.
hash
+
(
userOpsQuery
.
isPlaceholderData
?
String
(
index
)
:
''
)
}
item=
{
item
}
isLoading=
{
userOpsQuery
.
isPlaceholderData
}
/>
)))
}
</
Show
>
</>
)
:
null
;
const
actionBar
=
userOpsQuery
.
pagination
.
isVisible
?
(
<
ActionBar
mt=
{
-
6
}
alignItems=
"center"
>
<
Pagination
ml=
"auto"
{
...
userOpsQuery
.
pagination
}
/>
</
ActionBar
>
)
:
null
;
return
(
<
DataListDisplay
isError=
{
txsInfo
.
isError
||
userOpsQuery
.
isError
}
items=
{
userOpsQuery
.
data
?.
items
}
emptyText=
"There are no user operations."
content=
{
content
}
actionBar=
{
actionBar
}
/>
);
};
export
default
TxTokenTransfer
;
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