Sigil documentation
ReferenceRust referencesigil-nova

sigil-nova · economy

Source declarations, signatures and documentation for economy.

Source: sigil/node/sigil-nova/src/economy.rs. SHA-256: b840e56e48a5496f89cd2dbc7037482aeec6e7aac78f325ba6fd9194e412cb43.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

economy::AuctionId

Unique auction identifier.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct AuctionId(pub String);

Source line: 21.

economy::AuctionStatus

Current status of an auction.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AuctionStatus {
    Active,
    Ended,
    Settled,
    Cancelled,
}

Source line: 25.

economy::Bid

A single bid on an auction.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Bid {
pub bidder_did: String,
pub amount: u64,
pub bid_time: u64
}

Source line: 34.

economy::Auction

A parcel auction.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Auction {
pub id: AuctionId,
pub parcel_id: ParcelId,
pub seller_did: String,
pub min_bid: u64,
pub current_bid: Option<Bid>,
pub end_time: u64,
pub status: AuctionStatus
}

Source line: 42.

economy::AuctionResult

Result of settling an auction.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct AuctionResult {
pub auction_id: AuctionId,
pub winner_did: Option<String>,
pub final_amount: Option<u64>
}

Source line: 54.

economy::AuctionHouse

On-chain auction house.

#[derive(Debug, Clone, Default)]
pub struct AuctionHouse {

}

Source line: 62.

economy::AuctionHouse::new

Create an empty auction house.

pub fn new() -> Self;

Source line: 68.

economy::AuctionHouse::create_auction

Create a new auction for a parcel.

pub fn create_auction(
        &mut self,
        parcel_id: ParcelId,
        seller_did: &str,
        min_bid: u64,
        duration_epochs: u64,
        current_time: u64,
    ) -> Result<Auction, NovaError>;

Source line: 73.

economy::AuctionHouse::place_bid

Place a bid on an active auction.

The bid must exceed the current bid by at least 5%, or meet the minimum bid if there is no current bid.

pub fn place_bid(
        &mut self,
        auction_id: &AuctionId,
        bidder_did: &str,
        amount: u64,
        bid_time: u64,
    ) -> Result<Bid, NovaError>;

Source line: 134.

economy::AuctionHouse::settle_auction

Settle a completed auction, returning the result.

pub fn settle_auction(&mut self, auction_id: &AuctionId) -> Result<AuctionResult, NovaError>;

Source line: 195.

economy::AuctionHouse::cancel_auction

Cancel an auction. Only possible if no bids have been placed.

pub fn cancel_auction(
        &mut self,
        auction_id: &AuctionId,
        caller_did: &str,
    ) -> Result<(), NovaError>;

Source line: 217.

economy::AuctionHouse::get_auction

Get an auction by ID.

pub fn get_auction(&self, auction_id: &AuctionId) -> Option<&Auction>;

Source line: 247.

economy::AuctionHouse::auction_count

Total number of auctions.

pub fn auction_count(&self) -> usize;

Source line: 252.

economy::RentPayment

A rent payment record.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RentPayment {
pub parcel_id: ParcelId,
pub tenant_did: String,
pub amount: u64,
pub period_start: u64,
pub period_end: u64
}

Source line: 259.

economy::calculate_rent

Calculate base rent per epoch for a parcel type and region.

Base rates per type, with a distance multiplier from origin.

pub fn calculate_rent(parcel_type: &ParcelType, region: &RegionCoord) -> u64;

Source line: 270.

economy::BuildingCost

Cost breakdown for deploying a building.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct BuildingCost {
pub polycount_fee: u64,
pub compute_fee: u64,
pub storage_fee: u64
}

Source line: 287.

economy::BuildingCost::total

Total cost.

pub fn total(&self) -> u64;

Source line: 295.

economy::calculate_building_cost

Calculate the cost of deploying a building based on its manifest.

Fees are proportional to polycount and LOD levels.

pub fn calculate_building_cost(manifest: &BuildingManifest) -> BuildingCost;

Source line: 305.

On this page