slot_set
Behaviour
Section titled “Behaviour”- 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
- Sets the data for the specified slot.
- Returns an error code or the result of the set operation.
Definition
Section titled “Definition”int64_t slot_set ( uint32_t read_ptr, uint32_t read_len, uint32_t slot_no);function slot_set( kl: ByteArray | HexString, slotno: number ): ErrorCode | numberExample
Section titled “Example”int64_t slot_no = slot_set(keylet, 34, 0);const slot_no = slot_set(keylet, 0)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| read_ptr | uint32_t | Pointer to a buffer containing the keylet of the object to locate. This can also be a txn hash. |
| read_len | uint32_t | Length of the read buffer. Should always be 32 or 34. |
| slot_no | uint32_t | The slot number to emplace into, or 0 if you wish to pick the next available. |
| Name | Type | Description |
|---|---|---|
| kl | ByteArray | HexString | The data to set in the slot, can be an array or a string. |
| slotno | number | The slot number to set data for. |
Return Code
Section titled “Return Code”| Type | Description |
|---|---|
| int64_t | The slot number the object was inserted into |
| Type | Description |
|---|---|
| ErrorCode or number | Returns an error code or the result of the set operation. |