Contract 2ae5857b21db00e06cf512b9f4ba8324478ea8fd3d24cb5cc40278d39b9e83ed

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 22.0.11#34f7f53ae31e0fd02aab436a9872e79fa671ca02
rsver 1.92.0

Instances

  • CCVYXZCTX565MH34LJJRKZTPBQSR7UZ7L32EKT3YARUQZPUP45CK22N7

Interface

Update the fee in basis points (admin only). Max 10 000 (= 100%).

fn set_fee(env: soroban_sdk::Env, fee_bps: u32) -> Result<(), RampitError>

Return the admin address.

fn get_admin(env: soroban_sdk::Env) -> Result

Return the full Order struct for the given id (or error).

TTL note: Read-only queries intentionally do not bump the persistent entry's TTL. If the order is near expiry in ledger storage, a write operation (release / refund / cancel) will bump it. Frontends that need guaranteed availability should call a write path or use extend_ttl via a separate admin utility.

fn get_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::Bytes,
) -> Result

Transfer admin role to a new address. Only the current admin can call this. Critical for key rotation if the admin key is compromised.

fn set_admin(
    env: soroban_sdk::Env,
    new_admin: soroban_sdk::Address,
) -> Result<(), RampitError>

One-time setup. Sets admin, relayer and fee (in basis points). Must be called before any other function.

fn initialize(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    relayer: soroban_sdk::Address,
    fee_bps: u32,
) -> Result<(), RampitError>

Return the current fee in basis points.

fn get_fee_bps(env: soroban_sdk::Env) -> Result

Return the current relayer address.

fn get_relayer(env: soroban_sdk::Env) -> Result

Replace the relayer address (admin only).

fn set_relayer(
    env: soroban_sdk::Env,
    new_relayer: soroban_sdk::Address,
) -> Result<(), RampitError>

Cancel a pending order before expiry. Relayer only; funds return to funder.

fn cancel_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::Bytes,
) -> Result<(), RampitError>

Withdraw accumulated platform fees for a given token to the admin address.

fn collect_fees(
    env: soroban_sdk::Env,
    token: soroban_sdk::Address,
) -> Result<(), RampitError>

Lock tokens from the relayer into escrow and create a pending order. order_id must be unique; use it as the off-chain Rampit order key. recipient receives crypto on release_order (no recipient signature).

fn create_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::Bytes,
    recipient: soroban_sdk::Address,
    token: soroban_sdk::Address,
    amount: i128,
    rate: i128,
    expiry: u64,
    direction: Direction,
) -> Result<(), RampitError>

Whether an order id is already registered on-chain.

fn order_exists(env: soroban_sdk::Env, order_id: soroban_sdk::Bytes) -> bool

Return the full escrowed amount to the funder (relayer). Relayer only.

fn refund_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::Bytes,
) -> Result<(), RampitError>

Called by the relayer once fiat payment is confirmed. Deducts the platform fee, sends the net amount to recipient, and marks the order Released.

fn release_order(
    env: soroban_sdk::Env,
    order_id: soroban_sdk::Bytes,
) -> Result<(), RampitError>

Return the accumulated (uncollected) fee balance for a token.

fn get_accumulated_fees(env: soroban_sdk::Env, token: soroban_sdk::Address) -> i128

Imports

WebAssembly Text (WAT) ▶