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
d5b0eecf
Commit
d5b0eecf
authored
Apr 14, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optional to address in tx
parent
74c86bcb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
63 deletions
+66
-63
transaction.ts
types/api/transaction.ts
+3
-10
LatestTxsItem.tsx
ui/home/LatestTxsItem.tsx
+14
-12
TxDetails.tsx
ui/tx/TxDetails.tsx
+33
-27
TxsListItem.tsx
ui/txs/TxsListItem.tsx
+13
-11
TxsTableItem.tsx
ui/txs/TxsTableItem.tsx
+3
-3
No files found.
types/api/transaction.ts
View file @
d5b0eecf
...
@@ -9,16 +9,9 @@ export type TransactionRevertReason = {
...
@@ -9,16 +9,9 @@ export type TransactionRevertReason = {
raw
:
string
;
raw
:
string
;
}
|
DecodedInput
;
}
|
DecodedInput
;
export
type
Transaction
=
(
export
type
Transaction
=
{
{
to
:
AddressParam
|
null
;
to
:
AddressParam
;
created_contract
:
AddressParam
|
null
;
created_contract
:
null
;
}
|
{
to
:
null
;
created_contract
:
AddressParam
;
}
)
&
{
hash
:
string
;
hash
:
string
;
result
:
string
;
result
:
string
;
confirmations
:
number
;
confirmations
:
number
;
...
...
ui/home/LatestTxsItem.tsx
View file @
d5b0eecf
...
@@ -97,18 +97,20 @@ const LatestTxsItem = ({ tx }: Props) => {
...
@@ -97,18 +97,20 @@ const LatestTxsItem = ({ tx }: Props) => {
mx=
{
2
}
mx=
{
2
}
color=
"gray.500"
color=
"gray.500"
/>
/>
<
Address
>
{
dataTo
&&
(
<
AddressIcon
address=
{
dataTo
}
/>
<
Address
>
<
AddressLink
<
AddressIcon
address=
{
dataTo
}
/>
type=
"address"
<
AddressLink
hash=
{
dataTo
.
hash
}
type=
"address"
alias=
{
dataTo
.
name
}
hash=
{
dataTo
.
hash
}
fontWeight=
"500"
alias=
{
dataTo
.
name
}
ml=
{
2
}
fontWeight=
"500"
truncation=
"constant"
ml=
{
2
}
fontSize=
"sm"
truncation=
"constant"
/>
fontSize=
"sm"
</
Address
>
/>
</
Address
>
)
}
</
Flex
>
</
Flex
>
<
Flex
fontSize=
"sm"
justifyContent=
"end"
flexDirection=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Flex
fontSize=
"sm"
justifyContent=
"end"
flexDirection=
{
{
base
:
'
column
'
,
lg
:
'
row
'
}
}
>
<
Box
mr=
{
{
base
:
0
,
lg
:
3
}
}
mb=
{
{
base
:
2
,
lg
:
0
}
}
>
<
Box
mr=
{
{
base
:
0
,
lg
:
3
}
}
mb=
{
{
base
:
2
,
lg
:
0
}
}
>
...
...
ui/tx/TxDetails.tsx
View file @
d5b0eecf
...
@@ -86,21 +86,21 @@ const TxDetails = () => {
...
@@ -86,21 +86,21 @@ const TxDetails = () => {
const
toAddress
=
data
.
to
?
data
.
to
:
data
.
created_contract
;
const
toAddress
=
data
.
to
?
data
.
to
:
data
.
created_contract
;
const
addressToTags
=
[
const
addressToTags
=
[
...
toAddress
.
private_tags
||
[],
...
toAddress
?
.
private_tags
||
[],
...
toAddress
.
public_tags
||
[],
...
toAddress
?
.
public_tags
||
[],
...
toAddress
.
watchlist_names
||
[],
...
toAddress
?
.
watchlist_names
||
[],
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
].
map
((
tag
)
=>
<
Tag
key=
{
tag
.
label
}
>
{
tag
.
display_name
}
</
Tag
>);
const
actionsExist
=
data
.
actions
&&
data
.
actions
.
length
>
0
;
const
actionsExist
=
data
.
actions
&&
data
.
actions
.
length
>
0
;
const
executionSuccessBadge
=
toAddress
.
is_contract
&&
data
.
result
===
'
success
'
?
(
const
executionSuccessBadge
=
toAddress
?
.
is_contract
&&
data
.
result
===
'
success
'
?
(
<
Tooltip
label=
"Contract execution completed"
>
<
Tooltip
label=
"Contract execution completed"
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
Icon
as=
{
successIcon
}
boxSize=
{
4
}
color=
{
executionSuccessIconColor
}
cursor=
"pointer"
/>
<
Icon
as=
{
successIcon
}
boxSize=
{
4
}
color=
{
executionSuccessIconColor
}
cursor=
"pointer"
/>
</
chakra
.
span
>
</
chakra
.
span
>
</
Tooltip
>
</
Tooltip
>
)
:
null
;
)
:
null
;
const
executionFailedBadge
=
toAddress
.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
?
(
const
executionFailedBadge
=
toAddress
?
.
is_contract
&&
Boolean
(
data
.
status
)
&&
data
.
result
!==
'
success
'
?
(
<
Tooltip
label=
"Error occurred during contract execution"
>
<
Tooltip
label=
"Error occurred during contract execution"
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
chakra
.
span
display=
"inline-flex"
ml=
{
2
}
mr=
{
1
}
>
<
Icon
as=
{
errorIcon
}
boxSize=
{
4
}
color=
"error"
cursor=
"pointer"
/>
<
Icon
as=
{
errorIcon
}
boxSize=
{
4
}
color=
"error"
cursor=
"pointer"
/>
...
@@ -214,29 +214,35 @@ const TxDetails = () => {
...
@@ -214,29 +214,35 @@ const TxDetails = () => {
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
flexWrap=
{
{
base
:
'
wrap
'
,
lg
:
'
nowrap
'
}
}
columnGap=
{
3
}
columnGap=
{
3
}
>
>
{
data
.
to
&&
data
.
to
.
hash
?
(
{
toAddress
?
(
<
Address
alignItems=
"center"
>
<>
<
AddressIcon
address=
{
toAddress
}
/>
{
data
.
to
&&
data
.
to
.
hash
?
(
<
AddressLink
type=
"address"
ml=
{
2
}
hash=
{
toAddress
.
hash
}
/>
<
Address
alignItems=
"center"
>
{
executionSuccessBadge
}
<
AddressIcon
address=
{
toAddress
}
/>
{
executionFailedBadge
}
<
AddressLink
type=
"address"
ml=
{
2
}
hash=
{
toAddress
.
hash
}
/>
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
{
executionSuccessBadge
}
</
Address
>
{
executionFailedBadge
}
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
</
Address
>
)
:
(
<
Flex
width=
{
{
base
:
'
100%
'
,
lg
:
'
auto
'
}
}
whiteSpace=
"pre"
alignItems=
"center"
>
<
span
>
[Contract
</
span
>
<
AddressLink
type=
"address"
hash=
{
toAddress
.
hash
}
/>
<
span
>
created]
</
span
>
{
executionSuccessBadge
}
{
executionFailedBadge
}
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
</
Flex
>
)
}
{
toAddress
.
name
&&
<
Text
>
{
toAddress
.
name
}
</
Text
>
}
{
addressToTags
.
length
>
0
&&
(
<
Flex
columnGap=
{
3
}
>
{
addressToTags
}
</
Flex
>
)
}
</>
)
:
(
)
:
(
<
Flex
width=
{
{
base
:
'
100%
'
,
lg
:
'
auto
'
}
}
whiteSpace=
"pre"
alignItems=
"center"
>
<
span
>
[ Contract creation ]
</
span
>
<
span
>
[Contract
</
span
>
<
AddressLink
type=
"address"
hash=
{
toAddress
.
hash
}
/>
<
span
>
created]
</
span
>
{
executionSuccessBadge
}
{
executionFailedBadge
}
<
CopyToClipboard
text=
{
toAddress
.
hash
}
/>
</
Flex
>
)
}
{
toAddress
.
name
&&
<
Text
>
{
toAddress
.
name
}
</
Text
>
}
{
addressToTags
.
length
>
0
&&
(
<
Flex
columnGap=
{
3
}
>
{
addressToTags
}
</
Flex
>
)
}
)
}
</
DetailsInfoItem
>
</
DetailsInfoItem
>
{
data
.
token_transfers
&&
<
TxDetailsTokenTransfers
data=
{
data
.
token_transfers
}
txHash=
{
data
.
hash
}
/>
}
{
data
.
token_transfers
&&
<
TxDetailsTokenTransfers
data=
{
data
.
token_transfers
}
txHash=
{
data
.
hash
}
/>
}
...
...
ui/txs/TxsListItem.tsx
View file @
d5b0eecf
...
@@ -112,17 +112,19 @@ const TxsListItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }:
...
@@ -112,17 +112,19 @@ const TxsListItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }:
color=
"gray.500"
color=
"gray.500"
/>
/>
)
}
)
}
<
Address
maxWidth=
{
`calc((100% - ${ currentAddress ? TAG_WIDTH + 16 : ARROW_WIDTH + 8 }px)/2)`
}
>
{
dataTo
?
(
<
AddressIcon
address=
{
dataTo
}
/>
<
Address
maxWidth=
{
`calc((100% - ${ currentAddress ? TAG_WIDTH + 16 : ARROW_WIDTH + 8 }px)/2)`
}
>
<
AddressLink
<
AddressIcon
address=
{
dataTo
}
/>
type=
"address"
<
AddressLink
hash=
{
dataTo
.
hash
}
type=
"address"
alias=
{
dataTo
.
name
}
hash=
{
dataTo
.
hash
}
fontWeight=
"500"
alias=
{
dataTo
.
name
}
ml=
{
2
}
fontWeight=
"500"
isDisabled=
{
isIn
}
ml=
{
2
}
/>
isDisabled=
{
isIn
}
</
Address
>
/>
</
Address
>
)
:
'
-
'
}
</
Flex
>
</
Flex
>
<
Box
mt=
{
2
}
>
<
Box
mt=
{
2
}
>
<
Text
as=
"span"
>
Value
{
appConfig
.
network
.
currency
.
symbol
}
</
Text
>
<
Text
as=
"span"
>
Value
{
appConfig
.
network
.
currency
.
symbol
}
</
Text
>
...
...
ui/txs/TxsTableItem.tsx
View file @
d5b0eecf
...
@@ -39,7 +39,7 @@ type Props = {
...
@@ -39,7 +39,7 @@ type Props = {
const
TxsTableItem
=
({
tx
,
showBlockInfo
,
currentAddress
,
enableTimeIncrement
}:
Props
)
=>
{
const
TxsTableItem
=
({
tx
,
showBlockInfo
,
currentAddress
,
enableTimeIncrement
}:
Props
)
=>
{
const
dataTo
=
tx
.
to
?
tx
.
to
:
tx
.
created_contract
;
const
dataTo
=
tx
.
to
?
tx
.
to
:
tx
.
created_contract
;
const
isOut
=
Boolean
(
currentAddress
&&
currentAddress
===
tx
.
from
.
hash
);
const
isOut
=
Boolean
(
currentAddress
&&
currentAddress
===
tx
.
from
.
hash
);
const
isIn
=
Boolean
(
currentAddress
&&
currentAddress
===
dataTo
.
hash
);
const
isIn
=
Boolean
(
currentAddress
&&
currentAddress
===
dataTo
?
.
hash
);
const
timeAgo
=
useTimeAgoIncrement
(
tx
.
timestamp
,
enableTimeIncrement
);
const
timeAgo
=
useTimeAgoIncrement
(
tx
.
timestamp
,
enableTimeIncrement
);
...
@@ -50,12 +50,12 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }
...
@@ -50,12 +50,12 @@ const TxsTableItem = ({ tx, showBlockInfo, currentAddress, enableTimeIncrement }
</
Address
>
</
Address
>
);
);
const
addressTo
=
(
const
addressTo
=
dataTo
?
(
<
Address
>
<
Address
>
<
AddressIcon
address=
{
dataTo
}
/>
<
AddressIcon
address=
{
dataTo
}
/>
<
AddressLink
type=
"address"
hash=
{
dataTo
.
hash
}
alias=
{
dataTo
.
name
}
fontWeight=
"500"
ml=
{
2
}
truncation=
"constant"
isDisabled=
{
isIn
}
/>
<
AddressLink
type=
"address"
hash=
{
dataTo
.
hash
}
alias=
{
dataTo
.
name
}
fontWeight=
"500"
ml=
{
2
}
truncation=
"constant"
isDisabled=
{
isIn
}
/>
</
Address
>
</
Address
>
);
)
:
'
-
'
;
return
(
return
(
<
Tr
<
Tr
...
...
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