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
ba2a3e2e
Commit
ba2a3e2e
authored
Feb 18, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal txs for address
parent
6781c5e1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
71 deletions
+69
-71
AddressInternalTxs.tsx
ui/address/AddressInternalTxs.tsx
+10
-9
InternalTxsListItem.tsx
ui/internalTxs/InternalTxsListItem.tsx
+9
-10
InternalTxsTable.tsx
ui/internalTxs/InternalTxsTable.tsx
+15
-16
InternalTxsTableItem.tsx
ui/internalTxs/InternalTxsTableItem.tsx
+20
-22
Address.tsx
ui/pages/Address.tsx
+6
-6
InternalTxs.tsx
ui/pages/InternalTxs.tsx
+9
-8
No files found.
ui/address/AddressInternalTxs.tsx
View file @
ba2a3e2e
import
{
Show
,
Hide
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
...
...
@@ -70,19 +70,19 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
const
content
=
data
?.
items
?
(
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
<
InternalTxsList
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
</
Box
>
<
Box
hideBelow=
"lg"
>
<
InternalTxsTable
data=
{
data
.
items
}
currentAddress=
{
hash
}
isLoading=
{
isPlaceholderData
}
/>
</
Hide
>
</
Box
>
</>
)
:
null
;
const
actionBar
=
(
<
ActionBar
mt=
{
-
6
}
justifyContent=
"left"
>
<
AddressTxsFilter
defaultFilter
=
{
filterValue
}
initialValue
=
{
filterValue
}
onFilterChange=
{
handleFilterChange
}
hasActiveFilter=
{
Boolean
(
filterValue
)
}
isLoading=
{
pagination
.
isLoading
}
...
...
@@ -100,12 +100,13 @@ const AddressInternalTxs = ({ scrollRef, shouldRender = true, isQueryEnabled = t
return
(
<
DataListDisplay
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
filterProps=
{
{
emptyFilteredText
:
`Couldn${ apos }t find any transaction that matches your query.`
,
hasActiveFilters
:
Boolean
(
filterValue
)
}
}
emptyText=
"There are no internal transactions for this address."
content=
{
content
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
);
};
...
...
ui/internalTxs/InternalTxsListItem.tsx
View file @
ba2a3e2e
...
...
@@ -6,9 +6,9 @@ import type { InternalTransaction } from 'types/api/internalTransaction';
import
config
from
'
configs/app
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
ListItemMobile
from
'
ui/shared/ListItemMobile/ListItemMobile
'
;
...
...
@@ -38,7 +38,7 @@ const InternalTxsListItem = ({
return
(
<
ListItemMobile
rowGap=
{
3
}
>
<
Flex
columnGap=
{
2
}
>
{
typeTitle
&&
<
Tag
colorScheme=
"cyan"
isLoading=
{
isLoading
}
>
{
typeTitle
}
</
Tag
>
}
{
typeTitle
&&
<
Badge
colorPalette=
"cyan"
loading=
{
isLoading
}
>
{
typeTitle
}
</
Badge
>
}
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
</
Flex
>
<
Flex
justifyContent=
"space-between"
width=
"100%"
>
...
...
@@ -56,14 +56,13 @@ const InternalTxsListItem = ({
fontSize=
"sm"
/>
</
Flex
>
<
HStack
spacing
=
{
1
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Block
</
Skeleton
>
<
HStack
gap
=
{
1
}
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Block
</
Skeleton
>
<
BlockEntity
isLoading=
{
isLoading
}
number=
{
blockNumber
}
noIcon
fontSize=
"sm"
lineHeight=
{
5
}
textStyle=
"sm"
/>
</
HStack
>
<
AddressFromTo
...
...
@@ -73,9 +72,9 @@ const InternalTxsListItem = ({
isLoading=
{
isLoading
}
w=
"100%"
/>
<
HStack
spacing
=
{
3
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Value
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
isLoaded=
{
!
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
{
6
}
>
<
HStack
gap
=
{
3
}
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
fontWeight=
{
500
}
>
Value
{
currencyUnits
.
ether
}
</
Skeleton
>
<
Skeleton
loading=
{
isLoading
}
fontSize=
"sm"
color=
"text_secondary"
minW=
{
6
}
>
<
span
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
</
span
>
</
Skeleton
>
</
HStack
>
...
...
ui/internalTxs/InternalTxsTable.tsx
View file @
ba2a3e2e
import
{
Table
,
Tbody
,
Tr
,
Th
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
{
AddressHighlightProvider
}
from
'
lib/contexts/addressHighlight
'
;
import
{
currencyUnits
}
from
'
lib/units
'
;
import
{
default
as
Thead
}
from
'
ui/shared/TheadSticky
'
;
import
{
TableBody
,
TableColumnHeader
,
TableHeaderSticky
,
TableRoot
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
InternalTxsTableItem
from
'
./InternalTxsTableItem
'
;
...
...
@@ -18,19 +17,19 @@ interface Props {
const
InternalTxsTable
=
({
data
,
currentAddress
,
isLoading
}:
Props
)
=>
{
return
(
<
AddressHighlightProvider
>
<
Table
>
<
T
head
top=
{
68
}
>
<
T
r
>
<
T
h
width=
"15%"
>
Parent txn hash
</
Th
>
<
T
h
width=
"15%"
>
Type
</
Th
>
<
T
h
width=
"10%"
>
Block
</
Th
>
<
T
h
width=
"40%"
>
From/To
</
Th
>
<
T
h
width=
"20%"
isNumeric
>
<
Table
Root
>
<
T
ableHeaderSticky
top=
{
68
}
>
<
T
ableRow
>
<
T
ableColumnHeader
width=
"15%"
>
Parent txn hash
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"15%"
>
Type
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"10%"
>
Block
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"40%"
>
From/To
</
TableColumnHeader
>
<
T
ableColumnHeader
width=
"20%"
isNumeric
>
Value
{
currencyUnits
.
ether
}
</
T
h
>
</
T
r
>
</
T
head
>
<
T
b
ody
>
</
T
ableColumnHeader
>
</
T
ableRow
>
</
T
ableHeaderSticky
>
<
T
ableB
ody
>
{
data
.
map
((
item
,
index
)
=>
(
<
InternalTxsTableItem
key=
{
item
.
transaction_hash
+
'
_
'
+
index
}
...
...
@@ -39,8 +38,8 @@ const InternalTxsTable = ({ data, currentAddress, isLoading }: Props) => {
isLoading=
{
isLoading
}
/>
))
}
</
T
b
ody
>
</
Table
>
</
T
ableB
ody
>
</
Table
Root
>
</
AddressHighlightProvider
>
);
...
...
ui/internalTxs/InternalTxsTableItem.tsx
View file @
ba2a3e2e
import
{
Tr
,
Td
,
Box
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Flex
}
from
'
@chakra-ui/react
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
React
from
'
react
'
;
import
type
{
InternalTransaction
}
from
'
types/api/internalTransaction
'
;
import
config
from
'
configs/app
'
;
import
{
Badge
}
from
'
toolkit/chakra/badge
'
;
import
{
Skeleton
}
from
'
toolkit/chakra/skeleton
'
;
import
{
TableCell
,
TableRow
}
from
'
toolkit/chakra/table
'
;
import
AddressFromTo
from
'
ui/shared/address/AddressFromTo
'
;
import
Skeleton
from
'
ui/shared/chakra/Skeleton
'
;
import
Tag
from
'
ui/shared/chakra/Tag
'
;
import
BlockEntity
from
'
ui/shared/entities/block/BlockEntity
'
;
import
TxEntity
from
'
ui/shared/entities/tx/TxEntity
'
;
import
TxStatus
from
'
ui/shared/statusTag/TxStatus
'
;
...
...
@@ -34,8 +35,8 @@ const InternalTxsTableItem = ({
const
toData
=
to
?
to
:
createdContract
;
return
(
<
T
r
alignItems=
"top"
>
<
T
d
verticalAlign=
"middle"
>
<
T
ableRow
alignItems=
"top"
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Flex
rowGap=
{
3
}
flexDir=
"column"
>
<
TxEntity
hash=
{
txnHash
}
...
...
@@ -53,41 +54,38 @@ const InternalTxsTableItem = ({
fontSize=
"sm"
/>
</
Flex
>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
<
Flex
rowGap=
{
2
}
flexWrap=
"wrap
"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
Flex
rowGap=
{
3
}
flexDir=
"column
"
>
{
typeTitle
&&
(
<
Box
w=
"126px"
display=
"inline-block"
>
<
Tag
colorScheme=
"cyan"
mr=
{
5
}
isLoading=
{
isLoading
}
>
{
typeTitle
}
</
Tag
>
</
Box
>
<
Badge
colorPalette=
"cyan"
loading=
{
isLoading
}
>
{
typeTitle
}
</
Badge
>
)
}
<
TxStatus
status=
{
success
?
'
ok
'
:
'
error
'
}
errorText=
{
error
}
isLoading=
{
isLoading
}
/>
</
Flex
>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
BlockEntity
isLoading=
{
isLoading
}
number=
{
blockNumber
}
noIcon
fontSize=
"sm"
lineHeight=
{
5
}
textStyle=
"sm"
fontWeight=
{
500
}
/>
</
T
d
>
<
T
d
verticalAlign=
"middle"
>
</
T
ableCell
>
<
T
ableCell
verticalAlign=
"middle"
>
<
AddressFromTo
from=
{
from
}
to=
{
toData
}
current=
{
currentAddress
}
isLoading=
{
isLoading
}
/>
</
T
d
>
<
T
d
isNumeric
verticalAlign=
"middle"
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
minW=
{
6
}
>
</
T
ableCell
>
<
T
ableCell
isNumeric
verticalAlign=
"middle"
>
<
Skeleton
loading=
{
isLoading
}
display=
"inline-block"
minW=
{
6
}
>
{
BigNumber
(
value
).
div
(
BigNumber
(
10
**
config
.
chain
.
currency
.
decimals
)).
toFormat
()
}
</
Skeleton
>
</
T
d
>
</
T
r
>
</
T
ableCell
>
</
T
ableRow
>
);
};
...
...
ui/pages/Address.tsx
View file @
ba2a3e2e
...
...
@@ -201,12 +201,12 @@ const AddressPageContent = () => {
component: <AddressTokens shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
subTabs: TOKEN_TABS,
},
//
{
//
id: 'internal_txns',
//
title: 'Internal txns',
//
count: addressTabsCountersQuery.data?.internal_transactions_count,
//
component: <AddressInternalTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
//
},
{
id: 'internal_txns',
title: 'Internal txns',
count: addressTabsCountersQuery.data?.internal_transactions_count,
component: <AddressInternalTxs scrollRef={ tabsScrollRef } shouldRender={ !isTabsLoading } isQueryEnabled={ areQueriesEnabled }/>,
},
addressTabsCountersQuery.data?.celo_election_rewards_count ? {
id: 'epoch_rewards',
title: 'Epoch rewards',
...
...
ui/pages/InternalTxs.tsx
View file @
ba2a3e2e
import
{
Hide
,
Show
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
useIsMobile
from
'
lib/hooks/useIsMobile
'
;
...
...
@@ -42,12 +42,12 @@ const InternalTxs = () => {
const
content
=
data
?.
items
?
(
<>
<
Show
below=
"lg"
ssr=
{
false
}
>
<
Box
hideFrom=
"lg"
>
<
InternalTxsList
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Show
>
<
Hide
below=
"lg"
ssr=
{
false
}
>
</
Box
>
<
Box
hideBelow=
"lg"
>
<
InternalTxsTable
data=
{
data
.
items
}
isLoading=
{
isPlaceholderData
}
/>
</
Hide
>
</
Box
>
</>
)
:
null
;
...
...
@@ -59,11 +59,12 @@ const InternalTxs = () => {
/>
<
DataListDisplay
isError=
{
isError
}
items
=
{
data
?.
items
}
items
Num=
{
data
?.
items
.
length
}
emptyText=
"There are no internal transactions."
content=
{
content
}
actionBar=
{
actionBar
}
/>
>
{
content
}
</
DataListDisplay
>
</>
);
};
...
...
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