ava-labs / avalanche-types-rs

Avalanche primitive types in Rust (experimental)
Other
32 stars 10 forks source link

Divergence in the jsonrpc structs #33

Closed Nuttymoon closed 1 year ago

Nuttymoon commented 1 year ago

Hi,

I am trying to use avalanche_types::jsonrpc::platformvm structs to query the P-Chain API using ureq. It seems that the provided structs don't match the newest versions of the API.

E.g. ApiPrimaryValidator should match the struct of platform.getCurrentValidators response. I am seeing that:

When I look at the docs and commits of this repo, it seems that it is kind of auto-generated from the Go lib. Can we still manually contribute? If so, I might be able to update these structs, as well as add some missing ones (e.g. for the platform.getSubnets and platform.getBlockchains methods).

gyuho commented 1 year ago

Apologies for late response. Yes, some fields are missing, as I was adding them in a hurry :)

Please feel free to contribute if you would like to add more fields.

Nuttymoon commented 1 year ago

Hey @gyuho no worries. I will probably open PRs on this topic then!

gyuho commented 1 year ago

I believe this is resolved with your PR.

Please feel free to re-open.

Nuttymoon commented 1 year ago

Indeed, thanks.

I will create more precise issues if needed. I saw you already integrated some JSON RPC methods I mentioned in the latest versions!