Contract b129efd5462165a5d45e2514a96d484ca5accb50528f6c22c3e75e91fd65c3c2

← Back to Index 📥 Download WASM

Meta

cliver 26.1.0#1228cff8022b804659750b94b315932b0e0f3f6a
rssdkver 23.4.0#673d6c4f2368d282d25da29bda55c21b8be69ca6
rsver 1.95.0

Instances

  • CDIYTZ44XYR7GWVXLRXZWCMEJO5NWE6WSE2ZGSU4JPFEYJSSXJRA65KY

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,
    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)

Imports

WebAssembly Text (WAT) ▶