Skip to content

Migrate ServerInfo to null safety and correct numeric types #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

diegolousx
Copy link

This PR makes the following changes:
• Adds full null safety to the ServerInfo, Info, ValidatedLedger, and related models.
• Updates fields such as reserve_base_xrp, and reserve_inc_xrp from int to double to match actual API response types.

These updates make the code compatible with Dart null safety and prevent runtime type errors.

This updates the ServerInfo model and nested classes to be null-safe.
Also fixes type mismatches where the API returns floating-point numbers (e.g. reserveBaseXrp) by using double instead of int.
@mrtnetwork
Copy link
Owner

@diegolousx
Hi, thanks for the pull request.

I tested my code on Testnet, Mainnet, and Devnet using the XRPL public node endpoints (both HTTP and WSS) and didn’t have any issues fetching the service info. However, your code in this section:

final double? reserveBaseXrp;
final double? reserveIncXrp;

gives me a type error: int is not double. Could you please let me know which network and node you are using?

Also, apologies for the late response.

- Update dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants