Contract a7463634674ca764401e713e4e29aef4e8521877f76ab78b1e91bea9d46ec6bb

← Back to Index 📥 Download WASM

Meta

rssdkver 20.5.0#9e2c3022b4355b224a7a814e13ba51761eeb14bb
rsver 1.77.2

Instances

  • CATKK5ZNJCKQQWTUWIUFZMY6V6MOQUGSTFSXMNQZHVJHYF7GVV36FB3Y
  • CCPXGHMVZROX7G6OIP4VBN7FJO6KJAMASNQXLISC3QI52EQVX3VKIWO6

Interface

fn resolution(env: soroban_sdk::Env) -> u32
fn price(env: soroban_sdk::Env, _asset: Asset, _timestamp: u64) -> Option
fn prices(
    env: soroban_sdk::Env,
    _asset: Asset,
    _records: u32,
) -> Option>
fn base(env: soroban_sdk::Env) -> Asset
fn decimals(env: soroban_sdk::Env) -> u32
fn assets(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn lastprice(env: soroban_sdk::Env, asset: Asset) -> Option

Initialize the contract with the admin and the oracle configurations

Arguments

  • admin - The address of the admin
  • base - The base asset
  • assets - The list of supported assets
  • asset_configs - The list of oracle configurations for each asset

Errors

  • AlreadyInitialized - The contract has already been initialized
  • InvalidAssets - The asset array is invalid
  • InvalidOracleConfig - The oracle config array is invalid
fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    base: Asset,
    assets: soroban_sdk::Vec,
    asset_configs: soroban_sdk::Vec,
    decimals: u32,
)

Fetch the confugration of an asset

fn config(env: soroban_sdk::Env, asset: Asset) -> OracleConfig

(Admin only) Block an asset

Arguments

  • asset - The asset to block

Errors

  • AssetNotFound - The asset is not found
fn block(env: soroban_sdk::Env, asset: Asset)

(Admin only) Unblock an asset

Arguments

  • asset - The asset to unblock

Errors

  • AssetNotFound - The asset is not found
fn unblock(env: soroban_sdk::Env, asset: Asset)

Imports

WebAssembly Text (WAT) ▶