Skip to main content

Update Meta

Update the meta field payload stored within an Entity resource. Meta stores arbitrary JSON‑formatted metadata string, typically used for high‑level profile tags, display attributes, application‑specific configuration payload. Only the current Entity owner is permitted to execute this instruction.

open-token entity update-meta --help

Synopsis

open-token entity update-meta <Name> <Meta>

Arguments

ArgumentTypeRequiredDescription
<Name>StringYesTarget entity resource name (e.g. open://google.com, open://app.google.com). Must reference an existing non‑expired on‑chain entity account, supports multi‑level dot‑separated hierarchy. Corresponding human‑readable URI: open://google.com, open://app.google.com.
<Meta>JSON‑StringYesRaw JSON string payload. Subject to on‑chain program maximum byte‑length limit. Program saves the string as‑is; JSON schema validation is responsibility of off‑chain clients.

Behaviour

  • Transaction signer must match stored Entity owner public key; returns OwnerMismatch on authorization failure.
  • Validates target entity exists and ownership term is not expired (NameExpired).
  • Validates parent Ecosystem namespace exists on‑chain (ParentNotCreated).
  • Overwrites the on‑chain meta field with the supplied raw JSON string.
  • Does not touch owner, renter, expiry timestamps, sale‑offer, rent‑offer, body field.
  • Active usership lease (if present) remains completely unaffected; renter usership rights stay intact.
  • On‑chain program does not interpret JSON content; parsing and business logic happen on client side.
  • Logical resolution note: Even after updating entity meta, the entity cannot be resolved via open:// scheme if its parent Ecosystem is expired.

Constraints & Validation Rules

  1. OwnerMismatch: Transaction signer is not the Entity owner.
  2. NameExpired: Entity ownership registration expired; cannot update metadata.
  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. MetaTooLong: Supplied JSON string exceeds program‑defined maximum byte‑length limit.

Note: On‑chain program does not reject malformed JSON. Caller must ensure valid JSON serialization.

Usage Example

Set meta for entity open://google.com with shell‑escaped JSON string:

open-token entity update-meta open://google.com "{\"title\":\"Google Entity\",\"tags\":[\"public\",\"verified\"],\"version\":\"1.0.0\"}"