-
Notifications
You must be signed in to change notification settings - Fork 7
feat: algod_client_ffi crate #282
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
base: main
Are you sure you want to change the base?
Conversation
Still need to do some FFI From impls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new algod_client_ffi crate to enable FFI (Foreign Function Interface) compatibility for the Algorand algod client. The separation addresses an architectural limitation where feature flags prevented proper FFI integration in the existing utils package.
Key changes:
- Creates FFI-compatible wrapper models that convert between Rust native types and FFI-safe types
- Implements bidirectional conversion traits (From/TryFrom) for seamless type translation
- Establishes a complete API client interface with error handling
Reviewed Changes
Copilot reviewed 298 out of 525 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/lib.rs |
Entry point with uniffi scaffolding and module exports |
src/apis/mod.rs |
Error type definitions and API endpoint module organization |
src/apis/client.rs |
Main FFI client implementation wrapping the Rust algod client |
src/apis/*.rs (error modules) |
Individual error type conversions for each API endpoint |
src/apis/parameter_enums.rs |
FFI-compatible enum definitions for API parameters |
src/models/mod.rs |
Model module structure with custom JSON value handling |
src/models/*.rs (model files) |
FFI wrapper structs with conversion implementations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The current approach that uses a feature flag makes it impossible to actually use the FFI algod client in FFI utils because utils FFI wraps the non-FFI utils which uses the non-FFI algod. Thus we need a separate FFI crate so we can convert between the rust models and the FFI-compatible models.