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
23e48718
Commit
23e48718
authored
Oct 11, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pending transaction details
parent
150b44c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
39 deletions
+57
-39
transaction.ts
types/api/transaction.ts
+3
-3
TokenTransfer.tsx
ui/tx/TokenTransfer.tsx
+1
-1
TxDetails.tsx
ui/tx/TxDetails.tsx
+53
-35
No files found.
types/api/transaction.ts
View file @
23e48718
...
@@ -8,8 +8,8 @@ export interface Transaction {
...
@@ -8,8 +8,8 @@ export interface Transaction {
result
:
string
;
result
:
string
;
confirmations
:
number
;
confirmations
:
number
;
status
:
'
ok
'
|
'
error
'
|
null
;
status
:
'
ok
'
|
'
error
'
|
null
;
block
:
number
;
block
:
number
|
null
;
timestamp
:
string
;
timestamp
:
string
|
null
;
confirmation_duration
:
Array
<
number
>
;
confirmation_duration
:
Array
<
number
>
;
from
:
AddressParam
;
from
:
AddressParam
;
to
:
AddressParam
;
to
:
AddressParam
;
...
@@ -18,7 +18,7 @@ export interface Transaction {
...
@@ -18,7 +18,7 @@ export interface Transaction {
fee
:
Fee
;
fee
:
Fee
;
gas_price
:
number
;
gas_price
:
number
;
type
:
number
;
type
:
number
;
gas_used
:
string
;
gas_used
:
string
|
null
;
gas_limit
:
string
;
gas_limit
:
string
;
max_fee_per_gas
:
number
|
null
;
max_fee_per_gas
:
number
|
null
;
max_priority_fee_per_gas
:
number
|
null
;
max_priority_fee_per_gas
:
number
|
null
;
...
...
ui/tx/TokenTransfer.tsx
View file @
23e48718
...
@@ -20,7 +20,7 @@ const TokenTransfer = ({ from, to, total, exchange_rate: exchangeRate, ...token
...
@@ -20,7 +20,7 @@ const TokenTransfer = ({ from, to, total, exchange_rate: exchangeRate, ...token
<
AddressLink
fontWeight=
"500"
hash=
{
to
.
hash
}
truncation=
"constant"
/>
<
AddressLink
fontWeight=
"500"
hash=
{
to
.
hash
}
truncation=
"constant"
/>
</
Flex
>
</
Flex
>
<
Text
fontWeight=
{
500
}
as=
"span"
>
For:
{
space
}
<
Text
fontWeight=
{
500
}
as=
"span"
>
For:
{
space
}
<
CurrencyValue
value=
{
total
.
value
.
replaceAll
(
'
,
'
,
''
)
}
unit=
"ether"
exchangeRate=
{
exchangeRate
}
fontWeight=
{
600
}
/>
<
CurrencyValue
value=
{
total
.
value
}
unit=
"ether"
exchangeRate=
{
exchangeRate
}
fontWeight=
{
600
}
/>
</
Text
>
</
Text
>
<
TokenSnippet
symbol=
{
token
.
token_symbol
}
hash=
{
token
.
token_address
}
name=
"Foo"
/>
<
TokenSnippet
symbol=
{
token
.
token_symbol
}
hash=
{
token
.
token_address
}
name=
"Foo"
/>
</
Flex
>
</
Flex
>
...
...
ui/tx/TxDetails.tsx
View file @
23e48718
import
{
Grid
,
GridItem
,
Text
,
Box
,
Icon
,
Link
,
Flex
}
from
'
@chakra-ui/react
'
;
import
{
Grid
,
GridItem
,
Text
,
Box
,
Icon
,
Link
,
Flex
,
Spinner
}
from
'
@chakra-ui/react
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
{
useQuery
}
from
'
@tanstack/react-query
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
BigNumber
from
'
bignumber.js
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
...
@@ -72,6 +72,7 @@ const TxDetails = () => {
...
@@ -72,6 +72,7 @@ const TxDetails = () => {
hint=
"Unique character string (TxID) assigned to every verified transaction."
hint=
"Unique character string (TxID) assigned to every verified transaction."
flexWrap=
"nowrap"
flexWrap=
"nowrap"
>
>
{
data
.
status
===
null
&&
<
Spinner
mr=
{
2
}
size=
"sm"
flexShrink=
{
0
}
/>
}
<
Box
overflow=
"hidden"
>
<
Box
overflow=
"hidden"
>
<
HashStringShortenDynamic
hash=
{
data
.
hash
}
/>
<
HashStringShortenDynamic
hash=
{
data
.
hash
}
/>
</
Box
>
</
Box
>
...
@@ -88,12 +89,17 @@ const TxDetails = () => {
...
@@ -88,12 +89,17 @@ const TxDetails = () => {
title=
"Block"
title=
"Block"
hint=
"Block number containing the transaction."
hint=
"Block number containing the transaction."
>
>
<
Text
>
{
data
.
block
}
</
Text
>
<
Text
>
{
data
.
block
===
null
?
'
Pending
'
:
data
.
block
}
</
Text
>
{
Boolean
(
data
.
confirmations
)
&&
(
<>
<
TextSeparator
color=
"gray.500"
/>
<
TextSeparator
color=
"gray.500"
/>
<
Text
variant=
"secondary"
>
<
Text
variant=
"secondary"
>
{
data
.
confirmations
}
Block confirmations
{
data
.
confirmations
}
Block confirmations
</
Text
>
</
Text
>
</>
)
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
data
.
timestamp
&&
(
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Timestamp"
title=
"Timestamp"
hint=
"Date & time of transaction inclusion, including length of time for confirmation."
hint=
"Date & time of transaction inclusion, including length of time for confirmation."
...
@@ -104,6 +110,7 @@ const TxDetails = () => {
...
@@ -104,6 +110,7 @@ const TxDetails = () => {
<
Text
whiteSpace=
"normal"
>
{
dayjs
(
data
.
timestamp
).
format
(
'
LLLL
'
)
}
<
TextSeparator
color=
"gray.500"
/></
Text
>
<
Text
whiteSpace=
"normal"
>
{
dayjs
(
data
.
timestamp
).
format
(
'
LLLL
'
)
}
<
TextSeparator
color=
"gray.500"
/></
Text
>
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
<
Text
variant=
"secondary"
>
{
getConfirmationDuration
(
data
.
confirmation_duration
)
}
</
Text
>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
)
}
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
3
,
lg
:
8
}
}
/>
<
GridItem
colSpan=
{
{
base
:
undefined
,
lg
:
2
}
}
mt=
{
{
base
:
3
,
lg
:
8
}
}
/>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"From"
title=
"From"
...
@@ -173,10 +180,10 @@ const TxDetails = () => {
...
@@ -173,10 +180,10 @@ const TxDetails = () => {
title=
"Gas limit & usage by txn"
title=
"Gas limit & usage by txn"
hint=
"Actual gas amount used by the transaction."
hint=
"Actual gas amount used by the transaction."
>
>
<
Text
>
{
BigNumber
(
data
.
gas_used
).
toFormat
()
}
</
Text
>
<
Text
>
{
BigNumber
(
data
.
gas_used
||
0
).
toFormat
()
}
</
Text
>
<
TextSeparator
/>
<
TextSeparator
/>
<
Text
>
{
BigNumber
(
data
.
gas_limit
).
toFormat
()
}
</
Text
>
<
Text
>
{
BigNumber
(
data
.
gas_limit
).
toFormat
()
}
</
Text
>
<
Utilization
ml=
{
4
}
value=
{
BigNumber
(
data
.
gas_used
).
dividedBy
(
BigNumber
(
data
.
gas_limit
)).
toNumber
()
}
/>
<
Utilization
ml=
{
4
}
value=
{
BigNumber
(
data
.
gas_used
||
0
).
dividedBy
(
BigNumber
(
data
.
gas_limit
)).
toNumber
()
}
/>
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
(
data
.
base_fee_per_gas
||
data
.
max_fee_per_gas
||
data
.
max_priority_fee_per_gas
)
&&
(
{
(
data
.
base_fee_per_gas
||
data
.
max_fee_per_gas
||
data
.
max_priority_fee_per_gas
)
&&
(
<
DetailsInfoItem
<
DetailsInfoItem
...
@@ -236,23 +243,34 @@ const TxDetails = () => {
...
@@ -236,23 +243,34 @@ const TxDetails = () => {
title=
"Other"
title=
"Other"
hint=
"Other data related to this transaction."
hint=
"Other data related to this transaction."
>
>
{
typeof
data
.
type
===
'
number
'
&&
(
{
<
Box
>
[
typeof
data
.
type
===
'
number
'
&&
(
<
Box
key=
"type"
>
<
Text
as=
"span"
fontWeight=
"500"
>
Txn type:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Txn type:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
type
}
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
type
}
</
Text
>
{
data
.
type
===
2
&&
<
Text
fontWeight=
"400"
as=
"span"
ml=
{
1
}
variant=
"secondary"
>
(EIP-1559)
</
Text
>
}
{
data
.
type
===
2
&&
<
Text
fontWeight=
"400"
as=
"span"
ml=
{
1
}
variant=
"secondary"
>
(EIP-1559)
</
Text
>
}
<
TextSeparator
/>
</
Box
>
</
Box
>
)
}
),
<
Box
>
<
Box
key=
"nonce"
>
<
Text
as=
"span"
fontWeight=
"500"
>
Nonce:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Nonce:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
nonce
}
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
nonce
}
</
Text
>
<
TextSeparator
/>
</
Box
>,
</
Box
>
data
.
position
!==
null
&&
(
<
Box
>
<
Box
key=
"position"
>
<
Text
as=
"span"
fontWeight=
"500"
>
Position:
</
Text
>
<
Text
as=
"span"
fontWeight=
"500"
>
Position:
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
position
}
</
Text
>
<
Text
fontWeight=
"600"
as=
"span"
>
{
data
.
position
}
</
Text
>
</
Box
>
</
Box
>
),
]
.
filter
(
Boolean
)
.
map
((
item
,
index
)
=>
(
<>
{
index
!==
0
&&
<
TextSeparator
/>
}
{
item
}
</>
))
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
<
DetailsInfoItem
<
DetailsInfoItem
title=
"Raw input"
title=
"Raw input"
...
...
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