class StakingWalletBalance {
  final String coinUnit;
  final String availableBalance;
  final String lockedBalance;
  final String? availableBalanceUsdt;
  final String? lockedBalanceUsdt;

  const StakingWalletBalance({
    required this.coinUnit,
    required this.availableBalance,
    required this.lockedBalance,
    this.availableBalanceUsdt,
    this.lockedBalanceUsdt,
  });

  factory StakingWalletBalance.empty(String coinUnit) {
    return StakingWalletBalance(
      coinUnit: coinUnit.toUpperCase(),
      availableBalance: '0',
      lockedBalance: '0',
    );
  }

  factory StakingWalletBalance.fromJson(Map<String, dynamic> json) {
    return StakingWalletBalance(
      coinUnit: '${json['coinUnit'] ?? ''}'.toUpperCase(),
      availableBalance: '${json['availableBalance'] ?? '0'}',
      lockedBalance: '${json['lockedBalance'] ?? '0'}',
      availableBalanceUsdt: json['availableBalanceUsdt']?.toString(),
      lockedBalanceUsdt: json['lockedBalanceUsdt']?.toString(),
    );
  }
}
