Skip to content

drift-labs/drift-ffi-sys

Repository files navigation

drift-ffi

Exposes C-ABI bindings for drift program.

Goals:

  1. Enable building SDKs that reuse program logic.
  2. Separate rust SDK from program/solana runtime dependencies. Allows rust SDK to freely update to latest solana-* crates with bug fixes, improvements, etc.

Developer Notes

  • this crate must be built with rust <= 1.76.0 to provide compatibility with onchain data layouts (later rust versions have breaking changes 128-bit integer C-abi compatibility)

  • for rust users this crate is intended to be linked via compiler flags (not Cargo dependency) as it compiles to a (platform dependent) dynamic lib (.so/.dylib/.dll)

  • can ignore most of the warnings for FFI safety. The main issue are types containing u128/i128s which are handled by a custom compat::u128/i128 type that forces correct alignment where required.

Releases

No releases published

Packages

No packages published

Languages