Skip to content

slot_set

  • Locate an object given the Keylet provided in read_ptr
  • Emplace the located object into the slot specified or into a new slot if no slot (zero) is specified
int64_t slot_set (
uint32_t read_ptr,
uint32_t read_len,
uint32_t slot_no
);
int64_t slot_no =
slot_set(keylet, 34, 0);
NameTypeDescription
read_ptruint32_tPointer to a buffer containing the keylet of the object to locate. This can also be a txn hash.
read_lenuint32_tLength of the read buffer. Should always be 32 or 34.
slot_nouint32_tThe slot number to emplace into, or 0 if you wish to pick the next available.
TypeDescription
int64_t

The slot number the object was inserted into

If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.

INVALID_ARGUMENT
- read_len must be either 32 or 34 bytes depending on whether a txn hash or a keylet is being used in read_ptr
- the hash or keylet was invalid

DOESNT_EXIST
- the requested object was not found