fn base(env: soroban_sdk::Env) -> Asset
fn price(env: soroban_sdk::Env, asset: Asset, timestamp: u64) -> Option
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn prices(
env: soroban_sdk::Env,
asset: Asset,
records: u32,
) -> Option>
Adds a price feed for a token. Admin-gated. Panics if a feed for this token already exists.
fn add_feed(
env: soroban_sdk::Env,
token_address: soroban_sdk::Address,
price_feed: soroban_sdk::Address,
)
fn decimals(env: soroban_sdk::Env) -> u32
fn lastprice(env: soroban_sdk::Env, asset: Asset) -> Option
fn resolution(env: soroban_sdk::Env) -> u32
Completes the admin transfer initiated by propose_admin.
Must be called by the address that was proposed.
fn accept_admin(env: soroban_sdk::Env)
Constructs the adapter contract.
admin - contract's administrator (can add feeds and update resolution)base_asset - asset that will be the result of the base() endpoint calldecimals - number of decimals in the output priceresolution - staleness threshold in seconds; prices older than this are rejectedfeeds - token address → RedStone price feed contract address mappingfn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
base_asset: Asset,
decimals: u32,
resolution: u32,
price_staleness_check_period: u32,
feeds: soroban_sdk::Map,
)
Nominates new_admin as the next administrator. Admin-gated.
The transfer is not effective until new_admin calls accept_admin.
fn propose_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address)
Updates the staleness threshold. Admin-gated.
fn set_resolution(env: soroban_sdk::Env, resolution: u32)
fn set_price_staleness_check_period(env: soroban_sdk::Env, period: u32)