Appearance
meta_slot
Summary. Load the originating transaction's metadata object into a slot.
Signature.
c
int64_t meta_slot(uint32_t slot_no);Parameters.
| Name | Type | Description |
|---|---|---|
slot_no | uint32_t | Destination slot, or 0 to allocate a free slot. |
Return value. Returns the slot number the metadata was loaded into on success. Errors: PREREQUISITE_NOT_MET (-9) if metadata is not available in the current execution; INVALID_ARGUMENT (-7) if slot_no exceeds max_slots; NO_FREE_SLOTS (-6) if slot_no == 0 and none are free.
Common failure patterns.
- Calling it when no provisional metadata exists →
PREREQUISITE_NOT_MET. Transaction metadata only becomes available once the transaction has been applied, so this is aimed at weak (post-apply) executions; seehook_again.
Caveats / notes.
- The slotted object is the transaction's
TxMeta; drill into it withslot_subfield/slot_subarraythe same way as any other slotted object. meta_slotis available without an amendment gate in this branch.
Minimal example.
c
int64_t m = meta_slot(0); // PREREQUISITE_NOT_MET during a strong (pre-apply) executionRelated APIs. hook_again, slot_subfield, xpop_slot.