Skip to main content

Sale Ask

Create or modify the outright sale offer for an existing Entity resource. Enables / disables the sale listing and sets the fixed sell price. Only the Entity owner is permitted to execute this instruction.

open-token entity sale-ask --help

Synopsis

open-token entity sale-ask <Name> <Enabled> <Sell Price>

Arguments

ArgumentTypeRequiredDescription
<Name>StringYesTarget entity resource name (e.g. open://google.com, open://app.google.com). Must be an existing active on‑chain entity account, may contain dot separators for multi‑level hierarchy. Corresponding human‑readable URI: open://google.com, open://app.google.com.
<Enabled>u8YesToggle sale offer status. 0 = false(disable offer), 1 = true(enable offer). When disabled, incoming sale‑bid purchase requests will be rejected.
<Sell Price>u64YesOutright purchase price in base token units. Takes effect only when <Enabled> is set to 1. This is the total amount a buyer pays to acquire full entity ownership.

Behaviour

  • Transaction signer must match stored Entity owner public key; returns OwnerMismatch on authorization failure.
  • Validates target entity exists and is not expired (NameExpired).
  • Validates parent Ecosystem namespace exists on‑chain (ParentNotCreated).
  • Persists sale‑offer configuration on‑chain: toggle status + sell price.
  • Setting <Enabled>=0 closes the sale listing; rejects new sale‑bid. Does not abort any active rental usership lease that is currently in progress. Existing renter keeps usership until rent expiry.
  • Setting <Enabled>=1 opens the sale listing; allows external users to call sale‑bid to acquire full ownership of the entity.
  • Does not modify entity ownership, meta, body, ownership expiry or existing rent state.
  • This operation only configures the listing; it does not perform ownership transfer. Ownership transfer occurs upon successful sale‑bid.
  • After successful sale, the buyer becomes the new entity owner; any ongoing usership lease remains valid and continues running under new ownership.
  • Logical resolution note: Even if entity sale offer is active, the entity is unresolvable via open:// scheme if its parent Ecosystem has expired.

Constraints & Validation Rules

  1. OwnerMismatch: Transaction signer is not the Entity owner.
  2. NameExpired: Entity ownership registration expired; cannot configure sale offer.
  3. ParentNotCreated: Parent Ecosystem namespace does not exist on‑chain.
  4. MaxEntityLevelIsFour: Entity name hierarchy depth exceeds program‑defined maximum level.
  5. NameTooLong / NameEmpty: Invalid entity name input.
  6. Invalid <Enabled> value: any value other than 0 or 1 triggers program validation failure.
  7. Zero‑price is permitted unless treasury configuration enforces a minimum sale price.

Usage Example

Enable sale offer for entity open://google.com with sell price 30000 base token units:

open-token entity sale-ask open://google.com 1 30000

Disable sale offer for entity open://app.google.com, active rent lease remains unaffected:

open-token entity sale-ask open://app.google.com 0 30000