export function shouldConfirmAccountHandoff(sessionAccountId, selectedAccountId) {
  return Boolean(sessionAccountId && selectedAccountId && sessionAccountId !== selectedAccountId);
}

export function accountHandoffRequestIsCurrent(request, sessionId, sessionAccountId, selectedAccountId) {
  return Boolean(request
    && request.sessionId === sessionId
    && request.fromAccountId === sessionAccountId
    && request.toAccountId === selectedAccountId
    && shouldConfirmAccountHandoff(sessionAccountId, selectedAccountId));
}
