Buyer purchases a listed domain (ATOMIC) max_price provides slippage protection — reverts if listing price exceeds it
fn buy(
env: soroban_sdk::Env,
buyer: soroban_sdk::Address,
token_id: u32,
max_price: i128,
) -> Result<(), MarketError>
Seller lists a domain for sale. Approval is handled atomically via Stellar Router SDK on the frontend.
fn list(
env: soroban_sdk::Env,
seller: soroban_sdk::Address,
token_id: u32,
price: i128,
) -> Result<(), MarketError>
Emergency pause — blocks list, buy, update_price
fn pause(env: soroban_sdk::Env, admin: soroban_sdk::Address) -> Result<(), MarketError>
Seller removes a listing (always allowed, even when paused)
fn delist(
env: soroban_sdk::Env,
seller: soroban_sdk::Address,
token_id: u32,
) -> Result<(), MarketError>
Resume normal operations
fn unpause(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
) -> Result<(), MarketError>
Upgrade the contract WASM in-place (preserves all storage)
fn upgrade(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
new_wasm_hash: soroban_sdk::BytesN<32>,
) -> Result<(), MarketError>
Get contract config (admin tooling)
fn get_config(env: soroban_sdk::Env) -> Config
Change the commission fee rate and recipient
fn update_fee(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
fee_bps: u32,
fee_recipient: soroban_sdk::Address,
) -> Result<(), MarketError>
Get a single listing by token ID
fn get_listing(env: soroban_sdk::Env, token_id: u32) -> Option
Admin can force-delist stale listings (always allowed, even when paused)
fn force_delist(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
token_id: u32,
) -> Result<(), MarketError>
Transfer admin rights to a new address
fn update_admin(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
new_admin: soroban_sdk::Address,
) -> Result<(), MarketError>
Seller updates the price of a listing
fn update_price(
env: soroban_sdk::Env,
seller: soroban_sdk::Address,
token_id: u32,
new_price: i128,
) -> Result<(), MarketError>
Initialize the marketplace contract
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
nfd_contract: soroban_sdk::Address,
xlm_sac: soroban_sdk::Address,
fee_recipient: soroban_sdk::Address,
fee_bps: u32,
)
Get current fee config
fn get_fee_config(env: soroban_sdk::Env) -> FeeConfig
Get all active listings
fn get_all_listings(env: soroban_sdk::Env) -> soroban_sdk::Vec<(u32, Listing)>
Change the minimum listing price
fn update_min_amount(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
min_amount: i128,
) -> Result<(), MarketError>