Contract cfbbda6395ebc147a90306c0492d5924a65e4ff683412d30e300b0bdf4f0aae0

← Back to Index 📥 Download WASM

Meta

cliver 26.0.0#60f7458e7ecffddf2f2d91dc6d0d2db4fab03ecc
rssdkver 23.4.0#673d6c4f2368d282d25da29bda55c21b8be69ca6
rsver 1.95.0

Instances

  • CCPFPY3DWJQDE3G7ZKYTZ3GNSSOJJX6JYMNT6V3FIR2KQQA3PP3GA3IV

Interface

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.

Arguments

  • admin - contract's administrator (can add feeds and update resolution)
  • base_asset - asset that will be the result of the base() endpoint call
  • decimals - number of decimals in the output price
  • resolution - staleness threshold in seconds; prices older than this are rejected
  • feeds - token address → RedStone price feed contract address mapping
fn __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)

Imports

WebAssembly Text (WAT) ▶