Market pallet

This section of the wiki will list all of the extrinsics provided by the market pallet.

Extrinsic for listing a region on sale.

Arguments:

  • region_id: The region that the caller intends to list for sale.

  • timeslice_price: The price per a single timeslice.

  • sale_recipient: The `AccountId` receiving the payment from the sale. If not specified this will be the caller.

pub fn list_region(
	origin: OriginFor<T>,
	region_id: RegionId,
	timeslice_price: BalanceOf<T>,
	sale_recipient: Option<T::AccountId>,
) -> DispatchResult { }

Extrinsic for unlisting a region from sale.

Arguments:

  • region_id: The region that the caller intends to unlist from sale.

pub fn unlist_region(origin: OriginFor<T>, region_id: RegionId) -> DispatchResult { }

Extrinsic for updating the price of a region listed on sale.

Arguments:

  • region_id: The region for which we want to update the timeslice price.

  • new_timeslice_price: The new timeslice price.

pub fn update_region_price(
	origin: OriginFor<T>,
	region_id: RegionId,
	new_timeslice_price: BalanceOf<T>,
) -> DispatchResult { }

Extrinsic for purchasing a region listed on sale.

Arguments:

  • region_id: The region that is listed on sale.

  • max_price: The maximum price the buyer is willing to pay for the region. If the actual price exceeds this amount, the purchase will not be executed. The region price is linearly decreasing for currently active(i.e. usable) regions.

pub fn purchase_region(
	origin: OriginFor<T>,
	region_id: RegionId,
	max_price: BalanceOf<T>,
) -> DispatchResult { }

Last updated