Replaces the contract Wasm with the code at new_wasm_hash, keeping
the contract address and all storage intact.
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
fn get_owner(env: soroban_sdk::Env) -> Option
Registers admin as the OZ Ownable owner, the initial signers
set, the N-of-M threshold, and the SEP-40 resolution. Staleness
windows start at their defaults; tune them via the owner setters.
InvalidThreshold - threshold == 0, threshold > signers.len(),
or signers contains a duplicate address.fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
signers: soroban_sdk::Vec,
threshold: u32,
resolution: u32,
) -> Result<(), soroban_sdk::Error>
fn accept_ownership(env: soroban_sdk::Env)
fn renounce_ownership(env: soroban_sdk::Env)
fn transfer_ownership(
env: soroban_sdk::Env,
new_owner: soroban_sdk::Address,
live_until_ledger: u32,
)
FeedAlreadyMappedfn add_feed(
env: soroban_sdk::Env,
feed_id: soroban_sdk::String,
asset: ReflectorAsset,
) -> Result<(), soroban_sdk::Error>
SignerAlreadyRegisteredfn add_signer(
env: soroban_sdk::Env,
signer: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Clears aggregate, history, per-signer submissions, known-feed index.
Does not touch FeedMapping/asset index (remove_feed).
FeedNotKnownfn purge_feed(
env: soroban_sdk::Env,
feed_id: soroban_sdk::String,
) -> Result<(), soroban_sdk::Error>
Drops mapping + asset index only; submissions need purge_feed.
FeedNotMappedfn remove_feed(
env: soroban_sdk::Env,
asset: ReflectorAsset,
) -> Result<(), soroban_sdk::Error>
Side effects: drops signer's submissions; recomputes each touched feed.
SignerNotRegisteredCannotRemoveBelowThresholdfn remove_signer(
env: soroban_sdk::Env,
signer: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Side effects: recomputes every known feed under the new threshold.
InvalidThreshold - zero or above signer countfn set_threshold(
env: soroban_sdk::Env,
threshold: u32,
) -> Result<(), soroban_sdk::Error>
fn set_resolution(
env: soroban_sdk::Env,
resolution: u32,
) -> Result<(), soroban_sdk::Error>
Cache-TTL ceiling; must stay >= MaxSubmissionAgeSeconds. No recompute.
InvalidSubmissionAgefn set_max_stale_seconds(
env: soroban_sdk::Env,
seconds: u64,
) -> Result<(), soroban_sdk::Error>
Inclusion window for median + observation time. Keep <= consumer max_stale.
Side effects: recomputes all feeds.
InvalidSubmissionAge - below floor or above MaxStaleSecondsfn set_max_submission_age_seconds(
env: soroban_sdk::Env,
seconds: u64,
) -> Result<(), soroban_sdk::Error>
fn base(env: soroban_sdk::Env) -> ReflectorAsset
Closest observation at or before timestamp (package time, not write time).
fn price(
env: soroban_sdk::Env,
asset: ReflectorAsset,
timestamp: u64,
) -> Option
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn prices(
env: soroban_sdk::Env,
asset: ReflectorAsset,
records: u32,
) -> Option>
fn decimals(env: soroban_sdk::Env) -> u32
None when unmapped/missing/stale (SEP-40 soft-fail).
fn lastprice(
env: soroban_sdk::Env,
asset: ReflectorAsset,
) -> Option
fn resolution(env: soroban_sdk::Env) -> u32
All-or-nothing bulk; first missing/stale fails the whole call.
fn read_price_data(
env: soroban_sdk::Env,
feed_ids: soroban_sdk::Vec,
) -> Result, soroban_sdk::Error>
Newest-first history cap for SEP-40 price/prices.
NoDataForFeedfn read_price_history(
env: soroban_sdk::Env,
feed_id: soroban_sdk::String,
limit: u32,
) -> Result, soroban_sdk::Error>
NoDataForFeedStaleData - exceeds MaxStaleSecondsfn read_price_data_for_feed(
env: soroban_sdk::Env,
feed_id: soroban_sdk::String,
) -> Result
Records signer's latest observation for feed_id and recomputes
the cached aggregate for that feed.
NotAuthorizedSigner - signer is not a registered signer.InvalidPrice - price <= 0.PriceOutOfRange - price > MAX_SUBMITTED_PRICE.FutureTimestamp - package_timestamp is more than
MAX_FUTURE_SKEW_SECONDS ahead of the ledger clock.StaleSubmission - package_timestamp is already older than the
MaxSubmissionAgeSeconds inclusion window.fn submit_price(
env: soroban_sdk::Env,
signer: soroban_sdk::Address,
feed_id: soroban_sdk::String,
price: i128,
package_timestamp: u64,
) -> Result<(), soroban_sdk::Error>
Records signer's latest observations for multiple feeds in one
call, sharing a single package_timestamp and one auth check. All
inputs are validated upfront; no partial application on failure.
NotAuthorizedSigner - signer is not a registered signer.LengthMismatch - feed_ids.len() != prices.len().InvalidPrice - any prices[i] <= 0.PriceOutOfRange - any prices[i] > MAX_SUBMITTED_PRICE.FutureTimestamp - the shared package_timestamp is more than
MAX_FUTURE_SKEW_SECONDS ahead of the ledger clock.StaleSubmission - the shared package_timestamp is already older
than the MaxSubmissionAgeSeconds inclusion window.fn submit_prices(
env: soroban_sdk::Env,
signer: soroban_sdk::Address,
feed_ids: soroban_sdk::Vec,
prices: soroban_sdk::Vec,
package_timestamp: u64,
) -> Result<(), soroban_sdk::Error>