Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Free up a currently occupied slot
Free the specified slot, releasing any object that was slotted there
C
C
slot_no
uint32_t
The slot number
int64_t
1
or an error
If negative, an error:
DOESNT_EXIST
- the specified slot does not contain any object or it is an invalid slot
Compute the serialized size of an object in a slot
Return the number of bytes the object in the specified slot occupies when serialized
C
C
slot_no
uint32_t
The slot number
int64_t
The number of bytes the object occupies when serialized
If negative, an error:
DOESNT_EXIST
- the specified slot does not contain any object or it is an invalid slot
Count the elements of an array object in a slot
Count the elements of an array in the specified slot
Return the count
C
C
slot_no
uint32_t
The slot number
int64_t
The number of elements inside the slotted array
If negative, an error:
DOESNT_EXIST
- the specified slot does not contain any object or it is an invalid slot
NOT_AN_ARRAY
- the specified slot does not contain an array object
Serialize and output a slotted object
Serialize the object currently occupying the specified slot
Write the serialized version of the object to the output buffer
👍 Alternative useFor small objects you may avoid using a buffer. Specify
0, 0
forwrite_ptr, write_len
to attempt to return the slotted object as big endian packed data in theint64_t
return code. Up to 63 bits of data may be returned this way.
C
C
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
int64_t
The number of bytes written
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
TOO_SMALL
- output buffer was not large enough to hold the serialized object
Retrieve the field code of an object in a slot and, optionally, some other information
Index into a slotted object and assign a sub-object to another slot
Index into a slotted array and assign a sub-object to another slot
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
int64_t
If flags
is 0
then:
The sf
field code of the slotted object
If flags
is 1
then:
1
if and only if the slotted object is an STI_AMOUNT
and the type of the amount is XRP.
If negative, an error:
DOESNT_EXIST
- the specified slot_no
does not contain an object.
NOT_AN_AMOUNT
- flags
was set to 1
but the slotted object is not an STI_AMOUNT
object
parent_slot
uint32_t
Slot the parent object is in
field_id
uint32_t
The sf
code of the field you are searching for.
To compute this manually take the serialized type
and shift it into the 16 highest bits of uint32_t, then take the field
and place it in the 16 lowest bits.
For example:
sfEmitNonce
has type
5 and field
11 thus its value is 0x050BU
new_slot
uint32_t
New slot number to place the object from the selected field into. If null, choose the next available slot. May be null.
int64_t
The slot number of the newly allocated object
If negative, an error:
DOESNT_EXIST
- The searched for field isn't present in the parent slot or the parent slot is unfilled.
NO_FREE_SLOTS
- The API would require a new slot to be allocated but the Hook is already at the maximum number of slots.
INVALID_FIELD
- The specified field is not a valid sf
field.
NOT_AN_OBJECT
- The slotted object is not a valid STObject.
parent_slot
uint32_t
Slot the parent array is in
array_id
uint32_t
The sf
code of the field you are searching for.
To compute this manually take the serialized type
and shift it into the 16 highest bits of uint32_t, then take the field
and place it in the 16 lowest bits.
For example:
sfEmitNonce
has type
5 and field
11 thus its value is 0x050BU
new_slot
uint32_t
New slot number to place the object from the selected array index into. If null, choose the next available slot. May be null.
int64_t
The slot number of the newly allocated object
If negative, an error:
DOESNT_EXIST
- The specified array_id
doesn't exist in the array pointed to by parent_slot
NO_FREE_SLOTS
- The API would require a new slot to be allocated but the Hook is already at the maximum number of slots.
NOT_AN_ARRAY
- The specified parent_slot
does not contain an STArray.
int64_t
PREREQUISITE_NOT_MET
- The originating tx type was not Import
.
NO_FREE_SLOTS
- The API would require a new slot to be allocated but the Hook is already at the maximum number of slots.
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.
slot_no
uint32_t
The slot number
flags
uin32_t
For normal operation this should be 0
.
To determine whether or not an STI_AMOUNT
type contains a native (XRP) amount or a floating point (IOU) amount set to 1
.
slot_no
uint32_t
The slot number
int64_t
The XFL enclosing number
If negative, an error:
DOESNT_EXIST
- the specified slot does not contain any object or it is an invalid slot
NOT_AN_AMOUNT
- the specified slot does not contain an STI_AMOUNT
object
slot_no_tx
uint32_t
The slot number to emplace the tx blob into.
slot_no_meta
uin32_t
The slot number to emplace the meta blob into.