Lore functions use participant numbers beginning at 1. Participant 1 is always the JOI using the Item action or Boop.
Lore amounts must be positive numbers and are rounded to whole Lore units.
Lore::get()
Lore::get()
Lore::get(participant)
Returns the participant’s Lore balance. It defaults to participant 1.
Lore::get(2)
The returned balance includes earlier charges, transfers, and rewards planned by the same program.
Lore::charge()
Lore::charge(amount)
Charges participant 1 and pays the Item or Boop creator. Returns the charged amount.
Lore::charge(25);
When the creator and participant 1 use the same wallet, the Lore is burned. Sugar shows an error when the available balance is too low.
Lore::transfer()
Lore::transfer(amount, targetParticipant)
Transfers Lore from participant 1 to another participant and returns the transferred amount.
Lore::transfer(10, 2);
The target must exist, cannot be participant 1, and cannot use the same wallet as participant 1. Sugar shows an error when the available balance is too low.
Lore::earn()
Lore::earn(amount)
Lore::earn(amount, participant)
Rewards participant 1 by default or the selected participant. The creation must be linked to an App verified by JOI.
Rewards respect JOI’s rolling daily earning limit. The function returns the amount actually awarded, which can be smaller than requested or 0.
let awarded = Lore::earn(20, 2);
Creators do not fund verified rewards themselves.
Approval behavior
Before applying Lore spending, paid Item changes, transformations, or Item use, JOI asks the person to confirm.
JOI groups everything that needs confirmation on one screen. Canceling sends no message and saves no variable, inventory, Item, or Lore changes.
After confirmation, JOI checks balances, ownership, and Items again. If something changed while the screen was open, the action stops and can be tried again.
Lore functions are unavailable in conditions, Embed Templates, and Automations.