Skip to content

Commit

Permalink
couple more robust places
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Nov 4, 2024
1 parent c033e3b commit ef7e993
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 35 deletions.
26 changes: 1 addition & 25 deletions types/api/address.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Transaction } from 'types/api/transaction';

import type { UserTags, AddressImplementation, AddressParam } from './addressParams';
import type { UserTags, AddressImplementation, AddressParam, AddressFilecoinParams } from './addressParams';
import type { Block, EpochRewardsType } from './block';
import type { InternalTransaction } from './internalTransaction';
import type { MudWorldSchema, MudWorldTable } from './mudWorlds';
Expand Down Expand Up @@ -270,27 +270,3 @@ export type AddressEpochRewardsItem = {
epoch_number: number;
associated_account: AddressParam;
}

export type AddressFilecoinParams = {
actor_type?: FilecoinActorType;
id?: string | null;
robust?: string | null;
}

export type FilecoinActorType =
'account' |
'cron' |
'datacap' |
'eam' |
'ethaccount' |
'evm' |
'init' |
'market' |
'miner' |
'multisig' |
'paych' |
'placeholder' |
'power' |
'reward' |
'system' |
'verifreg';
25 changes: 24 additions & 1 deletion types/api/addressParams.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { AddressFilecoinParams } from './address';
import type { AddressMetadataTagApi } from './addressMetadata';

export interface AddressImplementation {
Expand All @@ -17,6 +16,30 @@ export interface WatchlistName {
display_name: string;
}

export type AddressFilecoinParams = {
actor_type?: FilecoinActorType;
id?: string | null;
robust?: string | null;
}

export type FilecoinActorType =
'account' |
'cron' |
'datacap' |
'eam' |
'ethaccount' |
'evm' |
'init' |
'market' |
'miner' |
'multisig' |
'paych' |
'placeholder' |
'power' |
'reward' |
'system' |
'verifreg';

export interface UserTags {
private_tags: Array<AddressTag> | null;
watchlist_names: Array<WatchlistName> | null;
Expand Down
10 changes: 5 additions & 5 deletions ui/address/AddressDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import DetailsSponsoredItem from 'ui/shared/DetailsSponsoredItem';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import BlockEntity from 'ui/shared/entities/block/BlockEntity';
import TxEntity from 'ui/shared/entities/tx/TxEntity';
import HashStringShortenDynamic from 'ui/shared/HashStringShortenDynamic';

import AddressBalance from './details/AddressBalance';
import AddressImplementations from './details/AddressImplementations';
Expand Down Expand Up @@ -134,10 +133,11 @@ const AddressDetails = ({ addressQuery, scrollRef }: Props) => {
Ethereum Address
</DetailsInfoItem.Label>
<DetailsInfoItem.Value flexWrap="nowrap">
<Box overflow="hidden">
<HashStringShortenDynamic hash={ data.hash }/>
</Box>
<CopyToClipboard text={ data.hash }/>
<AddressEntity
address={{ hash: data.hash }}
noIcon
noLink
/>
</DetailsInfoItem.Value>
</>
) }
Expand Down
2 changes: 1 addition & 1 deletion ui/address/filecoin/FilecoinActorTag.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tag } from '@chakra-ui/react';
import React from 'react';

import type { FilecoinActorType } from 'types/api/address';
import type { FilecoinActorType } from 'types/api/addressParams';

const ACTOR_TYPES: Record<FilecoinActorType, string> = {
account: 'Account',
Expand Down
1 change: 0 additions & 1 deletion ui/pages/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ const AddressPageContent = () => {
address={{
...addressQuery.data,
hash: checkSummedHash,
filecoin: addressQuery.data?.filecoin,
name: '',
ens_domain_name: '',
implementations: null,
Expand Down
2 changes: 1 addition & 1 deletion ui/shared/entities/address/AddressEntity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Content = chakra((props: ContentProps) => {
const label = (
<VStack gap={ 0 } py={ 1 } color="inherit">
<Box fontWeight={ 600 } whiteSpace="pre-wrap" wordBreak="break-word">{ nameText }</Box>
<Box whiteSpace="pre-wrap" wordBreak="break-word">{ props.address.hash }</Box>
<Box whiteSpace="pre-wrap" wordBreak="break-word">{ props.address.filecoin?.robust ?? props.address.hash }</Box>
</VStack>
);

Expand Down
2 changes: 1 addition & 1 deletion ui/shared/entities/address/AddressEntityContentProxy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AddressEntityContentProxy = (props: ContentProps) => {
Proxy contract
{ props.address.name ? ` (${ props.address.name })` : '' }
</Box>
<AddressEntity address={{ hash: props.address.hash }} noLink noIcon noHighlight justifyContent="center"/>
<AddressEntity address={{ hash: props.address.hash, filecoin: props.address.filecoin }} noLink noIcon noHighlight justifyContent="center"/>
<Box fontWeight={ 600 } mt={ 2 }>
Implementation{ implementations.length > 1 ? 's' : '' }
{ implementationName ? ` (${ implementationName })` : '' }
Expand Down

0 comments on commit ef7e993

Please sign in to comment.