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
bbc37ef1
Unverified
Commit
bbc37ef1
authored
Sep 13, 2024
by
tom goriunov
Committed by
GitHub
Sep 13, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display checksum-ed addresses (#2240)
Fixes #2222
parent
67703471
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
getCheckedSummedAddress.ts
lib/address/getCheckedSummedAddress.ts
+9
-0
Address.tsx
ui/pages/Address.tsx
+4
-2
No files found.
lib/address/getCheckedSummedAddress.ts
0 → 100644
View file @
bbc37ef1
import
{
getAddress
}
from
'
viem
'
;
export
default
function
getCheckedSummedAddress
(
address
:
string
):
string
{
try
{
return
getAddress
(
address
);
}
catch
(
error
)
{
return
address
;
}
}
ui/pages/Address.tsx
View file @
bbc37ef1
...
...
@@ -6,6 +6,7 @@ import type { EntityTag } from 'ui/shared/EntityTags/types';
import
type
{
RoutedTab
}
from
'
ui/shared/Tabs/types
'
;
import
config
from
'
configs/app
'
;
import
getCheckedSummedAddress
from
'
lib/address/getCheckedSummedAddress
'
;
import
useAddressMetadataInfoQuery
from
'
lib/address/useAddressMetadataInfoQuery
'
;
import
useApiQuery
from
'
lib/api/useApiQuery
'
;
import
{
useAppContext
}
from
'
lib/contexts/app
'
;
...
...
@@ -60,6 +61,7 @@ const AddressPageContent = () => {
const
tabsScrollRef
=
React
.
useRef
<
HTMLDivElement
>
(
null
);
const
hash
=
getQueryParamString
(
router
.
query
.
hash
);
const
checkSummedHash
=
React
.
useMemo
(()
=>
getCheckedSummedAddress
(
hash
),
[
hash
]);
const
areQueriesEnabled
=
!
useCheckDomainNameParam
(
hash
);
const
addressQuery
=
useAddressQuery
({
hash
,
isEnabled
:
areQueriesEnabled
});
...
...
@@ -310,7 +312,7 @@ const AddressPageContent = () => {
/>
) }
<AddressEntity
address={{ ...addressQuery.data, hash, name: '', ens_domain_name: '', implementations: null }}
address={{ ...addressQuery.data, hash
: checkSummedHash
, name: '', ens_domain_name: '', implementations: null }}
isLoading={ isLoading }
fontFamily="heading"
fontSize="lg"
...
...
@@ -325,7 +327,7 @@ const AddressPageContent = () => {
{ !isLoading && !addressQuery.data?.is_contract && config.features.account.isEnabled && (
<AddressFavoriteButton hash={ hash } watchListId={ addressQuery.data?.watchlist_address_id }/>
) }
<AddressQrCode address={{ hash }} isLoading={ isLoading }/>
<AddressQrCode address={{ hash
: checkSummedHash
}} isLoading={ isLoading }/>
<AccountActionsMenu isLoading={ isLoading }/>
<HStack ml="auto" gap={ 2 }/>
{ !isLoading && addressQuery.data?.is_contract && addressQuery.data?.is_verified && config.UI.views.address.solidityscanEnabled &&
...
...
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