mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* display main data * display rest of tx fields * placeholder data * always show tabs * manage error and retries on details tab * don't retry if degraded view is active * fix tests * fix tx receipt * change styles and wording for warning * tweaks * gray alert style change and update screenshots * display main block info from RPC * refetch API query * txs tab * display empty address for contract creation tx * withdrawals tab * remove type coercions * lazy rendered lists * fix RPC query refetch * fixes * comment about block type * fix tests * update screenshots * [skip ci] better variable name
35 lines
727 B
TypeScript
35 lines
727 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,
|
|
implementation_name: '',
|
|
name: '',
|
|
private_tags: [],
|
|
public_tags: [],
|
|
watchlist_names: [],
|
|
ens_domain_name: null,
|
|
};
|