mirrored_repositories/espresso-cash-public/packages/solana/lib/src/rpc
import 'package:json_annotation/json_annotation.dart';
import 'package:solana/src/rpc/dto/context.dart';

part 'large_account.g.dart';

/// A large account
@JsonSerializable()
class LargeAccount {
  const LargeAccount({
    required this.address,
    required this.lamports,
  });

  factory LargeAccount.fromJson(Map<String, dynamic> json) =>
      _$LargeAccountFromJson(json);

  /// base-58 encoded address of the account
  final String address;

  /// Number of lamports in the account, as a u64
  final int lamports;

  Map<String, dynamic> toJson() => _$LargeAccountToJson(this);
}

@JsonSerializable()
class LargeAccountsResult extends ContextResult<List<LargeAccount>> {
  const LargeAccountsResult({required super.context, required super.value});

  factory LargeAccountsResult.fromJson(Map<String, dynamic> json) =>
      _$LargeAccountsResultFromJson(json);

  Map<String, dynamic> toJson() => _$LargeAccountsResultToJson(this);
}
