export interface NativeTransferPath {
  readonly from: string;
  readonly to: string;
  readonly value: string;
}

export interface TokenTransferPath {
  readonly from: string;
  readonly to: string;
  readonly fromTokenValue: string;
  readonly toTokenValue: string;
}

export interface ContractTokenTransferPath {
  readonly to: string;
  readonly amount: string;
}

export type TransactionData = NativeTransferPath | TokenTransferPath | ContractTokenTransferPath;

export function isContractTokenTransferPath(
  path: TransactionData,
): path is ContractTokenTransferPath {
  return 'amount' in path && 'to' in path;
}

export function isTokenTransferPath(path: TransactionData): path is TokenTransferPath {
  return (
    'from' in path &&
    'to' in path &&
    ('fromTokenValue' in path || 'toTokenValue' in path)
  );
}

export function isNativeTransferPath(path: TransactionData): path is NativeTransferPath {
  return 'from' in path && 'to' in path && 'value' in path;
}
