Files
explore/ui/shared/address/utils.ts
T
tom goriunovandGitHub 23bb231351 Add support for Diamond proxy standard (#1963)
* add support for array of implementations

* refactor ContainerWithScrollY component

* contract source code: allow to choose between all implementations

* fix layout of AddressNetWorth component

* add scroll container to implementation address on write/read proxy contract tab

* update screenshots
2024-05-29 14:09:55 +02:00

35 lines
725 B
TypeScript

import type { AddressParam } from 'types/api/addressParams';
export type TxCourseType = 'in' | 'out' | 'self' | 'unspecified';
export function getTxCourseType(from: string, to: string | undefined, current?: string): TxCourseType {
if (current === undefined) {
return 'unspecified';
}
if (to && from === to && from === current) {
return 'self';
}
if (from === current) {
return 'out';
}
if (to && to === current) {
return 'in';
}
return 'unspecified';
}
export const unknownAddress: Omit<AddressParam, 'hash'> = {
is_contract: false,
is_verified: false,
implementations: null,
name: '',
private_tags: [],
public_tags: [],
watchlist_names: [],
ens_domain_name: null,
};