slot
Behaviour
Section titled “Behaviour”- Serialize the object currently occupying the specified slot
- Write the serialized version of the object to the output buffer
- Retrieves the JSON Retrieves the data associated with the specified slot. of the specified slot.
- Returns an error code or the slot’s data.
Definition
Section titled “Definition”int64_t slot ( uint32_t write_ptr, uint32_t write_len, uint32_t slot_no);
function slot(slotno: number): ErrorCode | ByteArray
Example
Section titled “Example”uint8_t txn[512];int64_t bytes_written = slot(txn, 512, 1); // assumes a transaction is slotted into slot=1
const txn = slot(1) // assumes a transaction is slotted into slot=1
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
write_ptr | uint32_t | Pointer to a buffer of a suitable size to store the output. |
write_len | uint32_t | Length of the output buffer. |
slot_no | uint32_t | The slot number |
Name | Type | Description |
---|---|---|
slotno | number | The slot number |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The number of bytes written |
Type | Description |
---|---|
ErrorCode | ByteArray | Returns an error code or the slot’s data. |