Solana

Programming API reference for the Stork Solana contract.

SDK

Solana contracts can program against Stork's contract using the stork-sdk rust crate available on crates.io. This SDK provides useful methods and structs for reading from stork price feed account. For thorough documentation, please also see the docs.rs page. The Stork contract and SDK are built on top of Anchor.

Installation

After setting up your Anchor project, add the stork-sdk to your project dependencies by adding the following line to the [dependencies] section of the programs Cargo.toml :

// Cargo.toml
[dependencies]
stork-sdk = ">0.0.5"

or the following command:

cargo add stork-sdk

You can now import the stork-sdk's interfaces with:

// your_module.rs
use stork-sdk::{<...>};

Documentation

Documentation for the methods, structs, and constants provided by the stork-sdk can be found on doc.rs.

Examples

Example usage of the stork-sdk for consuming Stork prices can be found in the stork-external github repo.

Contract

Stork's contract depends on the stork-sdk crate and Anchor, and contains useful methods for writing to the Stork Config account, as well as Temporal Numeric Value Feed PDA accounts that represent Stork data feeds. The full source-code can be found in the stork-external github repo. For the official deployments, please see the Solana Contract Addresses.

Last updated