Get base asset
fn base(env: soroban_sdk::Env) -> Asset
Initialize the oracle contract with base configuration
Note: Assets should be registered separately using register_asset() to avoid transaction size limits
fn init(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
base_asset: Asset,
decimals: u32,
publishers: soroban_sdk::Vec,
quorum: u32,
publisher_variance: u32,
price_variance: u32,
resolution: u64,
history_limits: HistoryLimits,
) -> Config
Get price at timestamp - Type-specific
fn price(
env: soroban_sdk::Env,
asset_type: AssetType,
asset_symbol: soroban_sdk::Symbol,
timestamp: u64,
) -> Option
Get all assets (combines all types) - SEP-0040 compliance
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
Get recent prices - Type-specific Returns prices in descending order (newest first)
fn prices(
env: soroban_sdk::Env,
asset_type: AssetType,
asset_symbol: soroban_sdk::Symbol,
records: u32,
) -> soroban_sdk::Vec
Get all quotes (all asset types) - SEP-0040 compliance
fn quotes(env: soroban_sdk::Env) -> soroban_sdk::Vec
Upgrade contract to new WASM (admin only)
fn upgrade(env: soroban_sdk::Env, new_wasm_hash: soroban_sdk::BytesN<32>)
Get decimals - SEP-0040 compliance
fn decimals(env: soroban_sdk::Env) -> u32
Get current configuration
fn get_init(env: soroban_sdk::Env) -> Option
Get current admin
fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
Update admin address
fn set_admin(env: soroban_sdk::Env, new_admin: soroban_sdk::Address) -> Config
Get last price - Type-specific
fn last_price(
env: soroban_sdk::Env,
asset_type: AssetType,
asset_symbol: soroban_sdk::Symbol,
) -> Option
Get resolution - SEP-0040 compliance
fn resolution(env: soroban_sdk::Env) -> u64
Get all fiat assets
fn fiat_assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
Add publisher to whitelist
fn add_publisher(
env: soroban_sdk::Env,
publisher: soroban_sdk::Address,
) -> soroban_sdk::Vec
Get all crypto assets
fn crypto_assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
Update prices for a specific asset type
This maintains separate consensus per asset type
fn update_prices(
env: soroban_sdk::Env,
publisher: soroban_sdk::Address,
asset_type: AssetType,
prices: soroban_sdk::Map,
timestamp: u64,
) -> bool
Update quorum
fn update_quorum(env: soroban_sdk::Env, new_quorum: u32) -> ConfigUpdate
Get all publishers
fn get_publishers(env: soroban_sdk::Env) -> soroban_sdk::Vec
Get quotes for specific asset type
fn quotes_by_type(
env: soroban_sdk::Env,
asset_type: AssetType,
) -> soroban_sdk::Vec
Register a new asset (admin only)
Allows progressive asset registration to avoid init() size limits
fn register_asset(env: soroban_sdk::Env, asset: Asset)
Get all Stellar assets
fn stellar_assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
Deregister an asset (admin only)
fn deregister_asset(
env: soroban_sdk::Env,
asset_type: AssetType,
asset_symbol: soroban_sdk::Symbol,
)
Remove publisher from whitelist
fn remove_publisher(
env: soroban_sdk::Env,
publisher: soroban_sdk::Address,
) -> soroban_sdk::Vec
Update resolution
fn update_resolution(env: soroban_sdk::Env, new_resolution: u64) -> ConfigUpdate
Register multiple assets in batch
fn register_assets_batch(
env: soroban_sdk::Env,
asset_type: AssetType,
assets: soroban_sdk::Vec,
)
Update price variance
fn update_price_variance(env: soroban_sdk::Env, new_variance: u32) -> ConfigUpdate
Update publisher variance
fn update_publisher_variance(env: soroban_sdk::Env, new_variance: u32) -> ConfigUpdate