An Item action or Boop can read and move Lore. These related functions live in the Lore namespace, so each name begins with Lore::. When someone would spend Lore, JOI shows exactly what will happen and asks them to confirm.
Participant 1 is always the person using the creation.
Read a balance
Lore::get()
This returns participant 1’s Lore balance.
Give it a participant number to read someone else’s balance:
Lore::get(2)
If an earlier line in the same program charged or transferred Lore, Lore::get() includes that planned change.
Charge the person using the creation
Lore::charge(25);
This charges participant 1 and pays 25 Lore to the Item or Boop creator. The function returns the amount charged.
If the creator and participant 1 use the same wallet, the Lore is burned instead.
Transfer Lore to another participant
Lore::transfer(10, 2);
This sends 10 Lore from participant 1 to participant 2. The recipient cannot be participant 1 or use the same wallet.
Reward a participant
let awarded = Lore::earn(20);
Lore::earn() rewards participant 1 by default. Pass another participant number as the second argument:
let awarded = Lore::earn(20, 2);
Rewards work only when the Item or Boop is linked to an App verified by JOI. They count toward each account’s daily Lore earning limit.
The function returns the amount actually awarded. It may be smaller than the amount requested, or 0 when the daily limit has been reached.
action completeChallenge -> "Complete challenge" {
let awarded = Lore::earn(20);
text if awarded > 0 {
"@1 earned {awarded} Lore!"
} else {
"@1 completed the challenge, but reached today's Lore reward limit."
}
}
Use the returned amount in your message so the result always tells the truth.
What happens when confirmation is needed
JOI places Lore costs, paid Item changes, Item transformations, and inventory Item uses on one confirmation screen.
If the person cancels, none of those changes happen and the result is not sent. If they confirm, JOI checks the balance and Items again before applying anything.
Sandbox Mode shows the same planned changes without moving real Lore or changing real Items.