export class Token {
  constructor(
    public readonly id: string,
    public readonly isNative: boolean,
    public readonly address: string | null,
    public readonly networkId: string,
    public readonly thumbnail: string | null,
    public readonly name: string,
    public readonly symbol: string,
    public readonly decimals: number,
    public readonly code: string,
    public readonly info: string | null,
    public readonly isActive: boolean,
    public readonly minimumSwapValue: number | null,
    public readonly mcap: number | null,
    public readonly createdAt: Date,
    public readonly updatedAt: Date,
  ) {}

  public static create(
    id: string,
    isNative: boolean,
    address: string | null,
    networkId: string,
    thumbnail: string | null,
    name: string,
    symbol: string,
    decimals: number,
    code: string,
    info: string | null,
    isActive = true,
    minimumSwapValue: number | null = null,
    mcap: number | null = null,
  ): Token {
    const now = new Date();
    return new Token(
      id,
      isNative,
      address,
      networkId,
      thumbnail,
      name,
      symbol,
      decimals,
      code,
      info,
      isActive,
      minimumSwapValue,
      mcap,
      now,
      now,
    );
  }
}
