Contract 4f4ab9d3c1c27c277eeb4e26837cae2bc824b838d068a2a75397ded86e1424f6

← Back to Index 📥 Download WASM

Meta

rssdkver 26.1.0#175aa41306f383057a8cdfc84b68d931664fc34e
rsver 1.91.1

Instances

  • CB2XIALZ4IHL6S4BDPA5BERJ6G4ZQL52XI4VRRNOIQ6R3ZM6U6ZIBD3X

Interface

Return the latest stored price. Errors with [Error::PriceNotInitialized] if update_price has never run successfully.

fn get_price(env: soroban_sdk::Env) -> Result

Verify a signed Pyth Lazer update, check it is fresh, and store the latest price for the configured feed. Rejects the update if its feed timestamp is not strictly newer than the currently stored price.

fn update_price(
    env: soroban_sdk::Env,
    payload: soroban_sdk::Bytes,
) -> Result<(), soroban_sdk::Error>

Store the deployment-time configuration:

  • lazer: the deployed pyth-lazer-stellar verifier contract address.
  • feed_id: which Pyth Lazer price feed this contract tracks.
  • freshness_threshold_us: how far in the past a feed's update timestamp may lag the ledger time before the update is rejected (microseconds).
fn __constructor(
    env: soroban_sdk::Env,
    lazer: soroban_sdk::Address,
    feed_id: u32,
    freshness_threshold_us: u64,
)

Imports

WebAssembly Text (WAT) ▶