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
9068d41b
Commit
9068d41b
authored
Feb 08, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tx views
parent
e1c2c54e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
10 deletions
+29
-10
client.ts
lib/web3/client.ts
+9
-7
Transaction.tsx
ui/pages/Transaction.tsx
+6
-3
TxDetails.tsx
ui/tx/TxDetails.tsx
+5
-0
TxDetailsDegraded.tsx
ui/tx/TxDetailsDegraded.tsx
+4
-0
TxUserOps.tsx
ui/tx/TxUserOps.tsx
+5
-0
No files found.
lib/web3/client.ts
View file @
9068d41b
...
@@ -7,11 +7,13 @@ export const publicClient = (() => {
...
@@ -7,11 +7,13 @@ export const publicClient = (() => {
return
;
return
;
}
}
return
createPublicClient
({
try
{
chain
:
currentChain
,
return
createPublicClient
({
transport
:
http
(),
chain
:
currentChain
,
batch
:
{
transport
:
http
(),
multicall
:
true
,
batch
:
{
},
multicall
:
true
,
});
},
});
}
catch
(
error
)
{}
})();
})();
ui/pages/Transaction.tsx
View file @
9068d41b
...
@@ -7,6 +7,7 @@ import config from 'configs/app';
...
@@ -7,6 +7,7 @@ import config from 'configs/app';
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
import
throwOnResourceLoadError
from
'
lib/errors/throwOnResourceLoadError
'
;
import
throwOnResourceLoadError
from
'
lib/errors/throwOnResourceLoadError
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
getQueryParamString
from
'
lib/router/getQueryParamString
'
;
import
{
publicClient
}
from
'
lib/web3/client
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
TextAd
from
'
ui/shared/ad/TextAd
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
EntityTags
from
'
ui/shared/EntityTags
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
import
PageTitle
from
'
ui/shared/Page/PageTitle
'
;
...
@@ -33,7 +34,7 @@ const TransactionPageContent = () => {
...
@@ -33,7 +34,7 @@ const TransactionPageContent = () => {
const
txQuery
=
useTxQuery
();
const
txQuery
=
useTxQuery
();
const
{
data
,
isPlaceholderData
,
isError
,
error
,
errorUpdateCount
}
=
txQuery
;
const
{
data
,
isPlaceholderData
,
isError
,
error
,
errorUpdateCount
}
=
txQuery
;
const
showDegradedView
=
(
isError
||
isPlaceholderData
)
&&
errorUpdateCount
>
0
;
const
showDegradedView
=
publicClient
&&
(
isError
||
isPlaceholderData
)
&&
errorUpdateCount
>
0
;
const
tabs
:
Array
<
RoutedTab
>
=
(()
=>
{
const
tabs
:
Array
<
RoutedTab
>
=
(()
=>
{
const
detailsComponent
=
showDegradedView
?
const
detailsComponent
=
showDegradedView
?
...
@@ -97,8 +98,10 @@ const TransactionPageContent = () => {
...
@@ -97,8 +98,10 @@ const TransactionPageContent = () => {
return
<
RoutedTabs
tabs=
{
tabs
}
/>;
return
<
RoutedTabs
tabs=
{
tabs
}
/>;
})();
})();
if
(
error
?.
status
===
422
)
{
if
(
isError
&&
!
showDegradedView
)
{
throwOnResourceLoadError
({
resource
:
'
tx
'
,
error
,
isError
:
true
});
if
(
error
?.
status
===
422
||
error
?.
status
===
404
)
{
throwOnResourceLoadError
({
resource
:
'
tx
'
,
error
,
isError
:
true
});
}
}
}
return
(
return
(
...
...
ui/tx/TxDetails.tsx
View file @
9068d41b
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
TestnetWarning
from
'
ui/shared/alerts/TestnetWarning
'
;
import
TestnetWarning
from
'
ui/shared/alerts/TestnetWarning
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
TxInfo
from
'
./details/TxInfo
'
;
import
TxInfo
from
'
./details/TxInfo
'
;
import
type
{
TxQuery
}
from
'
./useTxQuery
'
;
import
type
{
TxQuery
}
from
'
./useTxQuery
'
;
...
@@ -10,6 +11,10 @@ interface Props {
...
@@ -10,6 +11,10 @@ interface Props {
}
}
const
TxDetails
=
({
txQuery
}:
Props
)
=>
{
const
TxDetails
=
({
txQuery
}:
Props
)
=>
{
if
(
txQuery
.
isError
)
{
return
<
DataFetchAlert
/>;
}
return
(
return
(
<>
<>
<
TestnetWarning
mb=
{
6
}
isLoading=
{
txQuery
.
isPlaceholderData
}
/>
<
TestnetWarning
mb=
{
6
}
isLoading=
{
txQuery
.
isPlaceholderData
}
/>
...
...
ui/tx/TxDetailsDegraded.tsx
View file @
9068d41b
...
@@ -36,6 +36,10 @@ const TxDetailsDegraded = ({ hash, txQuery }: Props) => {
...
@@ -36,6 +36,10 @@ const TxDetailsDegraded = ({ hash, txQuery }: Props) => {
const
query
=
useQuery
<
RpcResponseType
,
unknown
,
Transaction
|
null
>
({
const
query
=
useQuery
<
RpcResponseType
,
unknown
,
Transaction
|
null
>
({
queryKey
:
[
'
RPC
'
,
'
tx
'
,
{
hash
}
],
queryKey
:
[
'
RPC
'
,
'
tx
'
,
{
hash
}
],
queryFn
:
async
()
=>
{
queryFn
:
async
()
=>
{
if
(
!
publicClient
)
{
throw
new
Error
(
'
No public RPC client
'
);
}
const
tx
=
await
publicClient
.
getTransaction
({
hash
:
hash
as
`0x
${
string
}
`
});
const
tx
=
await
publicClient
.
getTransaction
({
hash
:
hash
as
`0x
${
string
}
`
});
if
(
!
tx
)
{
if
(
!
tx
)
{
...
...
ui/tx/TxUserOps.tsx
View file @
9068d41b
...
@@ -2,6 +2,7 @@ import React from 'react';
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
USER_OPS_ITEM
}
from
'
stubs/userOps
'
;
import
{
USER_OPS_ITEM
}
from
'
stubs/userOps
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
{
generateListStub
}
from
'
stubs/utils
'
;
import
DataFetchAlert
from
'
ui/shared/DataFetchAlert
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
useQueryWithPages
from
'
ui/shared/pagination/useQueryWithPages
'
;
import
TxPendingAlert
from
'
ui/tx/TxPendingAlert
'
;
import
TxPendingAlert
from
'
ui/tx/TxPendingAlert
'
;
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
import
TxSocketAlert
from
'
ui/tx/TxSocketAlert
'
;
...
@@ -28,6 +29,10 @@ const TxUserOps = ({ txQuery }: Props) => {
...
@@ -28,6 +29,10 @@ const TxUserOps = ({ txQuery }: Props) => {
return
txQuery
.
socketStatus
?
<
TxSocketAlert
status=
{
txQuery
.
socketStatus
}
/>
:
<
TxPendingAlert
/>;
return
txQuery
.
socketStatus
?
<
TxSocketAlert
status=
{
txQuery
.
socketStatus
}
/>
:
<
TxPendingAlert
/>;
}
}
if
(
txQuery
.
isError
)
{
return
<
DataFetchAlert
/>;
}
return
<
UserOpsContent
query=
{
userOpsQuery
}
showTx=
{
false
}
/>;
return
<
UserOpsContent
query=
{
userOpsQuery
}
showTx=
{
false
}
/>;
};
};
...
...
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