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
51c2ae73
Commit
51c2ae73
authored
Dec 07, 2023
by
isstuev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tx fee can be null
parent
19ea1083
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
40 deletions
+51
-40
sortTxs.ts
lib/tx/sortTxs.ts
+2
-2
fee.ts
types/api/fee.ts
+1
-1
LatestTxsItem.tsx
ui/home/LatestTxsItem.tsx
+1
-1
LatestTxsItemMobile.tsx
ui/home/LatestTxsItemMobile.tsx
+1
-1
TxDetailsWrapped.tsx
ui/tx/TxDetailsWrapped.tsx
+12
-10
TxDetailsFeePerGas.tsx
ui/tx/details/TxDetailsFeePerGas.tsx
+2
-2
TxAdditionalInfoContent.tsx
ui/txs/TxAdditionalInfoContent.tsx
+18
-14
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+12
-8
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+2
-1
No files found.
lib/tx/sortTxs.ts
View file @
51c2ae73
...
...
@@ -10,9 +10,9 @@ const sortTxs = (sorting?: Sort) => (tx1: Transaction, tx2: Transaction) => {
case
'
val-asc
'
:
return
compareBns
(
tx2
.
value
,
tx1
.
value
);
case
'
fee-desc
'
:
return
compareBns
(
tx1
.
fee
.
value
,
tx2
.
fee
.
value
);
return
compareBns
(
tx1
.
fee
.
value
||
0
,
tx2
.
fee
.
value
||
0
);
case
'
fee-asc
'
:
return
compareBns
(
tx2
.
fee
.
value
,
tx1
.
fee
.
value
);
return
compareBns
(
tx2
.
fee
.
value
||
0
,
tx1
.
fee
.
value
||
0
);
default
:
return
0
;
}
...
...
types/api/fee.ts
View file @
51c2ae73
export
interface
Fee
{
type
:
string
;
value
:
string
;
value
:
string
|
null
;
}
ui/home/LatestTxsItem.tsx
View file @
51c2ae73
...
...
@@ -118,7 +118,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
accuracy=
{
5
}
color=
"text_secondary"
hideUsd
/>
)
:
(
<
Text
as=
"span"
variant=
"secondary"
>
{
getValueWithUnit
(
tx
.
fee
.
value
).
dp
(
5
).
toFormat
()
}
</
Text
>
<
Text
as=
"span"
variant=
"secondary"
>
{
tx
.
fee
.
value
?
getValueWithUnit
(
tx
.
fee
.
value
).
dp
(
5
).
toFormat
()
:
'
-
'
}
</
Text
>
)
}
</
Skeleton
>
)
}
...
...
ui/home/LatestTxsItemMobile.tsx
View file @
51c2ae73
...
...
@@ -104,7 +104,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
accuracy=
{
5
}
color=
"text_secondary"
hideUsd
/>
)
:
(
<
Text
as=
"span"
variant=
"secondary"
>
{
getValueWithUnit
(
tx
.
fee
.
value
).
dp
(
5
).
toFormat
()
}
</
Text
>
<
Text
as=
"span"
variant=
"secondary"
>
{
tx
.
fee
.
value
?
getValueWithUnit
(
tx
.
fee
.
value
).
dp
(
5
).
toFormat
()
:
'
-
'
}
</
Text
>
)
}
</
Skeleton
>
)
}
...
...
ui/tx/TxDetailsWrapped.tsx
View file @
51c2ae73
...
...
@@ -65,16 +65,18 @@ const TxDetailsWrapped = ({ data }: Props) => {
flexWrap=
"wrap"
/>
</
DetailsInfoItem
>
<
DetailsInfoItem
title=
"Transaction fee"
hint=
"Total transaction fee"
>
<
CurrencyValue
value=
{
data
.
fee
.
value
}
currency=
{
config
.
chain
.
currency
.
symbol
}
flexWrap=
"wrap"
/>
</
DetailsInfoItem
>
{
data
.
fee
.
value
!==
null
&&
(
<
DetailsInfoItem
title=
"Transaction fee"
hint=
"Total transaction fee"
>
<
CurrencyValue
value=
{
data
.
fee
.
value
}
currency=
{
config
.
chain
.
currency
.
symbol
}
flexWrap=
"wrap"
/>
</
DetailsInfoItem
>
)
}
<
TxDetailsGasPrice
gasPrice=
{
data
.
gas_price
}
/>
{
data
.
gas_limit
&&
(
<
DetailsInfoItem
...
...
ui/tx/details/TxDetailsFeePerGas.tsx
View file @
51c2ae73
...
...
@@ -6,13 +6,13 @@ import config from 'configs/app';
import
DetailsInfoItem
from
'
ui/shared/DetailsInfoItem
'
;
interface
Props
{
txFee
:
string
;
txFee
:
string
|
null
;
gasUsed
:
string
|
null
;
isLoading
?:
boolean
;
}
const
TxDetailsFeePerGas
=
({
txFee
,
gasUsed
,
isLoading
}:
Props
)
=>
{
if
(
!
config
.
UI
.
views
.
tx
.
additionalFields
?.
fee_per_gas
||
!
gasUsed
)
{
if
(
!
config
.
UI
.
views
.
tx
.
additionalFields
?.
fee_per_gas
||
!
gasUsed
||
txFee
===
null
)
{
return
null
;
}
...
...
ui/txs/TxAdditionalInfoContent.tsx
View file @
51c2ae73
...
...
@@ -33,20 +33,24 @@ const TxAdditionalInfoContent = ({ tx }: { tx: Transaction }) => {
<
Heading
as=
"h4"
size=
"sm"
mb=
{
6
}
>
Additional info
</
Heading
>
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
(
<
Box
{
...
sectionProps
}
mb=
{
4
}
>
<
Text
{
...
sectionTitleProps
}
>
Transaction fee
</
Text
>
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
/>
)
:
(
<
Flex
>
<
CurrencyValue
value=
{
tx
.
fee
.
value
}
currency=
{
config
.
UI
.
views
.
tx
.
hiddenFields
?.
fee_currency
?
''
:
config
.
chain
.
currency
.
symbol
}
exchangeRate=
{
tx
.
exchange_rate
}
accuracyUsd=
{
2
}
flexWrap=
"wrap"
rowGap=
{
0
}
/>
</
Flex
>
{
(
tx
.
stability_fee
!==
undefined
||
tx
.
fee
.
value
!==
null
)
&&
(
<>
<
Text
{
...
sectionTitleProps
}
>
Transaction fee
</
Text
>
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
/>
)
:
(
<
Flex
>
<
CurrencyValue
value=
{
tx
.
fee
.
value
}
currency=
{
config
.
UI
.
views
.
tx
.
hiddenFields
?.
fee_currency
?
''
:
config
.
chain
.
currency
.
symbol
}
exchangeRate=
{
tx
.
exchange_rate
}
accuracyUsd=
{
2
}
flexWrap=
"wrap"
rowGap=
{
0
}
/>
</
Flex
>
)
}
</>
)
}
</
Box
>
)
}
...
...
ui/txs/TxsListItem.tsx
View file @
51c2ae73
...
...
@@ -134,14 +134,18 @@ const TxsListItem = ({ tx, isLoading, showBlockInfo, currentAddress, enableTimeI
)
}
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
(
<
Flex
mt=
{
2
}
mb=
{
3
}
columnGap=
{
2
}
>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
whiteSpace=
"pre"
>
Fee
</
Skeleton
>
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
isLoading=
{
isLoading
}
hideUsd
/>
)
:
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
variant=
"text_secondary"
whiteSpace=
"pre"
>
{
getValueWithUnit
(
tx
.
fee
.
value
).
toFormat
()
}
{
config
.
UI
.
views
.
tx
.
hiddenFields
?.
fee_currency
?
''
:
` ${ config.chain.currency.symbol }`
}
</
Skeleton
>
{
(
tx
.
stability_fee
!==
undefined
||
tx
.
fee
.
value
!==
null
)
&&
(
<>
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
whiteSpace=
"pre"
>
Fee
</
Skeleton
>
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
isLoading=
{
isLoading
}
hideUsd
/>
)
:
(
<
Skeleton
isLoaded=
{
!
isLoading
}
display=
"inline-block"
variant=
"text_secondary"
whiteSpace=
"pre"
>
{
getValueWithUnit
(
tx
.
fee
.
value
||
0
).
toFormat
()
}
{
config
.
UI
.
views
.
tx
.
hiddenFields
?.
fee_currency
?
''
:
` ${ config.chain.currency.symbol }`
}
</
Skeleton
>
)
}
</>
)
}
</
Flex
>
)
}
...
...
ui/txs/TxsTableItem.tsx
View file @
51c2ae73
...
...
@@ -164,10 +164,11 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement,
)
}
{
!
config
.
UI
.
views
.
tx
.
hiddenFields
?.
tx_fee
&&
(
<
Td
isNumeric
>
{
/* eslint-disable-next-line no-nested-ternary */
}
{
tx
.
stability_fee
?
(
<
TxFeeStability
data=
{
tx
.
stability_fee
}
isLoading=
{
isLoading
}
accuracy=
{
8
}
justifyContent=
"end"
hideUsd
/>
)
:
(
<
CurrencyValue
value=
{
tx
.
fee
.
value
}
accuracy=
{
8
}
isLoading=
{
isLoading
}
/>
tx
.
fee
.
value
?
<
CurrencyValue
value=
{
tx
.
fee
.
value
}
accuracy=
{
8
}
isLoading=
{
isLoading
}
/>
:
'
-
'
)
}
</
Td
>
)
}
...
...
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