ledger_keylet
Behaviour
Section titled “Behaviour”- Read a 34 byte Keylet from the
lread_ptr
- Read a 32 byte Keylet from the
hread_ptr
- Search the ledger for the first (lowest) Keylet of this type in this range.
- If any matching Keylet is found, write it to
write_ptr
.
- This function searches the ledger for the first (
lowest
) Keylet of this type in the given range. - Returns the number of bytes written (34 bytes) on success, or an error code if an error occurs.
Definition
Section titled “Definition”C
int64_t ledger_keylet ( uint32_t write_ptr, uint32_t write_len, uint32_t lread_ptr, uint32_t lread_len, uint32_t hread_ptr, uint32_t hread_len);
function ledger_keylet( low: ByteArray | HexString, high: ByteArray | HexString ): ErrorCode | ByteArray
Example
Section titled “Example”C
//TODO
ledger_keylet(low, high)
Parameters
Section titled “Parameters”Name | Type | Description |
---|---|---|
write_ptr | uint32_t | Pointer to a buffer to store the output serialised Keylet. . |
write_len | uint32_t | Length of the output buffer. Must be 34 bytes |
lread_ptr | uint32_t | Pointer to the 34 byte serialised Keylet that represents the lower boundary of the Keylet range to search. |
lread_len | uint32_t | Always 34 bytes |
hread_ptr | uint32_t | Pointer to the 34 byte serialised Keylet that represents the upper boundary of the Keylet range to search. |
hread_len | uint32_t | Always 34 bytes |
Name | Type | Description |
---|---|---|
low | ByteArray | HexString | Pointer to the 34-byte serialized Keylet that represents the lower boundary of the Keylet range to search. |
high | ByteArray | HexString | Pointer to the 34-byte serialized Keylet that represents the upper boundary of the Keylet range to search. |
Return Code
Section titled “Return Code”Type | Description |
---|---|
int64_t | The number of bytes written (34 bytes) on success. |
Type | Description |
---|---|
ErrorCode | ByteArray | Returns the number of bytes written (34 bytes) on success, or an error code if an error occurs. |