/** 信用盘玩家（代理授信）；与主站钱包资金盘区分。 */
export function isCreditFundingPlayer(
  source?: {
    funding_mode?: string | null;
    credit_line_mode?: boolean | null;
    uses_credit?: boolean | null;
  } | null,
): boolean {
  if (!source) {
    return false;
  }

  if (source.uses_credit === true) {
    return true;
  }

  if (source.funding_mode === "credit") {
    return true;
  }

  if (source.funding_mode === "wallet") {
    return false;
  }

  return source.credit_line_mode === true;
}
