Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Load the originating transaction into a slot
Emplace the originating transaction into the slot specified or into a new slot if no slot is specified
C
C
slot_no
uint32_t
The slot number to emplace into, or 0 if you wish to pick the next available.
int64_t
The slot the otxn was placed in
INVALID_ARGUMENT
- specified slot number exceeds the largest possible slot number
NO_FREE_SLOTS
- the request could not granted because no free slot was avaialble to place the originating transaction into.
Retrieve the parameter value for a named Invoke transaction parameter
Look up the value for a named parameter specified in read_ptr
on the originating transaction (ttINVOKE only).
Write the parameter's value to write_ptr
C
C
write_ptr
uint32_t
Pointer to a buffer of a suitable size to store the output. Should be at least 32 bytes.
write_len
uint32_t
Length of the output buffer.
read_ptr
uint32_t
Pointer to a buffer containing the parameter's name
read_len
uint32_t
Length of the parameter's name
int64_t
The number of bytes written
If negative, an error:
OUT_OF_BOUNDS
- pointers/lengths specified outside of hook memory.
DOESNT_EXIST
- The specified paramater doesn't exist or is null
TOO_SMALL
- The parameter name can't be null
TOO_BIG
- The parameter name is greater than 32 bytes
Get the Transaction Type of the originating transaction
Return the Transaction Type of the originating transaction
C
C
None
int64_t
The Transaction Type of the originating transaction. Check the table below for a list of known Transaction Types at time of writing
ttPAYMENT
0
ttESCROW_CREATE
1
ttESCROW_FINISH
2
ttACCOUNT_SET
3
ttESCROW_CANCEL
4
ttREGULAR_KEY_SET
5
ttOFFER_CREATE
7
ttOFFER_CANCEL
8
ttTICKET_CREATE
10
ttTICKET_CANCEL
11
ttSIGNER_LIST_SET
12
ttPAYCHAN_CREATE
13
ttPAYCHAN_FUND
14
ttPAYCHAN_CLAIM
15
ttCHECK_CREATE
16
ttCHECK_CASH
17
ttCHECK_CANCEL
18
ttDEPOSIT_PREAUTH
19
ttTRUST_SET
20
ttACCOUNT_DELETE
21
ttHOOK_SET
22
ttURITOKEN_MINT
45
ttURITOKEN_BURN
46
ttURITOKEN_BUY
47
ttURITOKEN_CREATE_SELL_OFFER
48
ttURITOKEN_CANCEL_SELL_OFFER
49
ttGENESIS_MINT
96
ttIMPORT
97
ttCLAIM_REWARD
98
ttINVOKE
99
ttAMENDMENT
100
ttFEE
101
ttUNL_MODIFY
102
ttEMIT_FAILURE
103
ttUNL_REPORT
104
Serialize and output a field from the originating transaction
Find the specified sf
field in the originating transaction
Write the serialized version of the field to the output buffer
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.
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
❗️ImportantThe field code is not written to the output buffer, only the payload of the field is.
At time of writing for Hooks Public Testnet,
STI_ACCOUNT
fields likesfAccount
are returned without the leading variable length byte.
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 field
INVALID_FIELD
- the sf
field_id was invalid
DOESNT_EXIST
- the field was not found in the originating transaction
Output the canonical hash of the originating transaction
Write the canonical hash of the originating transaction to the output buffer.
If flags = 1 and the transaction is an EMIT_FAILURE transaction then write the canonical hash of the originating transaction that caused the emission.
C
C
write_ptr
uint32_t
Pointer to a buffer of to store the hash.
write_len
uint32_t
Length of the output buffer. Should be at least 32 bytes.
flags
uint32_t
If 0
:
Write the canonical hash of the originating transaction.
If 1
AND the originating transaction is an EMIT_FAILURE:
Write the canonical hash of the emitting transaction.
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
Get the generation of the originating transaction
Get the burden of the originating transaction
Load the metadata of the originating transaction into a slot
If the Hook is being Weakly Executed then emplace the metadata of the originating transaction into the slot specified or into a new slot if no slot is specified
C
C
slot_no
uint32_t
The slot number to emplace into, or 0 if you wish to pick the next available.
int64_t
The slot the otxn was placed in
INVALID_ARGUMENT
- specified slot number exceeds the largest possible slot number
NO_FREE_SLOTS
- the request could not granted because no free slot was avaialble to place the originating transaction into.
PREREQUISITE_NOT_MET
- The hook is being and therefore no transactional metadata is available.