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
a627b3dd
Commit
a627b3dd
authored
Sep 08, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gas limit and fees
parent
6e4f1fa7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
Utilization.tsx
ui/shared/Utilization.tsx
+23
-0
TxDetails.tsx
ui/tx/TxDetails.tsx
+28
-1
No files found.
ui/shared/Utilization.tsx
0 → 100644
View file @
a627b3dd
import
{
Box
,
Flex
,
Text
,
chakra
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
interface
Props
{
className
?:
string
;
value
:
number
;
}
const
WIDTH
=
50
;
const
Utilization
=
({
className
,
value
}:
Props
)
=>
{
const
valueString
=
(
value
*
100
).
toFixed
(
2
)
+
'
%
'
;
return
(
<
Flex
className=
{
className
}
alignItems=
"center"
>
<
Box
bg=
"gray.100"
w=
{
`${ WIDTH }px`
}
h=
"4px"
borderRadius=
"full"
overflow=
"hidden"
>
<
Box
bg=
"green.500"
w=
{
valueString
}
h=
"100%"
/>
</
Box
>
<
Text
color=
"green.500"
ml=
"10px"
fontWeight=
"bold"
>
{
valueString
}
</
Text
>
</
Flex
>
);
};
export
default
chakra
(
Utilization
);
ui/tx/TxDetails.tsx
View file @
a627b3dd
import
{
Grid
,
Text
,
Icon
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
Text
,
Box
,
Icon
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
{
tx
}
from
'
data/tx
'
;
...
...
@@ -9,6 +9,7 @@ import AddressIcon from 'ui/shared/AddressIcon';
import
AddressLinkWithTooltip
from
'
ui/shared/AddressLinkWithTooltip
'
;
import
CopyToClipboard
from
'
ui/shared/CopyToClipboard
'
;
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
import
Utilization
from
'
ui/shared/Utilization
'
;
import
type
{
Props
as
TxStatusProps
}
from
'
ui/tx/TxStatus
'
;
import
TxStatus
from
'
ui/tx/TxStatus
'
;
...
...
@@ -92,6 +93,32 @@ const TxDetails = () => {
<
Text
>
{
tx
.
gas_price
.
toLocaleString
(
'
en
'
,
{
minimumFractionDigits
:
18
})
}
Ether
</
Text
>
<
Text
variant=
"secondary"
ml=
{
1
}
>
(
{
(
tx
.
gas_price
*
Math
.
pow
(
10
,
18
)).
toFixed
(
0
)
}
Gwei)
</
Text
>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Gas limit & usage by txn"
hint=
"Actual gas amount used by the transaction."
>
<
Text
>
{
tx
.
gas_used
.
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Text
{
...
leftSeparatorStyles
}
>
{
tx
.
gas_limit
.
toLocaleString
(
'
en
'
)
}
</
Text
>
<
Utilization
ml=
{
4
}
value=
{
tx
.
gas_used
/
tx
.
gas_limit
}
/>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Gas fees (Gwei)"
// eslint-disable-next-line max-len
hint=
"Base Fee refers to the network Base Fee at the time of the block, while Max Fee & Max Priority Fee refer to the max amount a user is willing to pay for their tx & to give to the miner respectively."
>
<
Box
>
<
Text
as=
"span"
>
Base:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
base
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
>
Max:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
max
}
</
Text
>
</
Box
>
<
Box
{
...
leftSeparatorStyles
}
>
<
Text
as=
"span"
>
Max priority:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
tx
.
gas_fees
.
max_priority
}
</
Text
>
</
Box
>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Burnt fees"
hint=
"Amount of ETH burned for this transaction. Equals Block Base Fee per Gas * Gas Used."
...
...
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