Stork
GitHubXStork
  • INTRODUCTION
    • Welcome to Stork
    • Core Concepts
    • How It Works
    • Products
  • Getting Started
    • Becoming a Publisher
    • Becoming a Subscriber
    • Putting Data On-Chain
    • Accessing Data On-Chain
  • API Reference
    • Websocket API
      • Publisher
      • Subscriber
    • REST API
    • Contract APIs
      • EVM
      • Solana / SVM
      • Sui
      • Aptos
      • CosmWasm
    • Chain Pusher Configs
      • Asset Config YAML
    • Publisher Agent Configs
      • Config JSON
      • Keys JSON
  • Resources
    • Asset ID Registry
    • Stork Pushed Assets
    • Contract Addresses
      • EVM
      • Solana / SVM
      • Sui
      • Aptos
      • CosmWasm
    • Adapters
    • Public Keys
    • FAQ
Powered by GitBook
On this page
  • SDK
  • Installation
  • Documentation
  • Examples
  • Contract
Edit on GitHub
  1. API Reference
  2. Contract APIs

Solana / SVM

Programming API reference for the Stork Solana contract.

SDK

Solana contracts can program against Stork's contract using the stork-solana-sdk rust crate available on crates.io. This SDK provides useful methods and structs for reading from stork price feed account. The Stork contract and SDK are built on top of Anchor.

Installation

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

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

or the following command:

cargo add stork-solana-sdk

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

// your_module.rs
use stork_solana_sdk::{<...>};

Documentation

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

Examples

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

Contract

Stork's contract depends on the stork-solana-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 4 months ago