Deletes unspent output data from the state.
The transaction hash of the outpoint
The index of the outpoint
Promise that resolves when the unspent output data is deleted
Sets the reservation status of an unspent output for a specific invitation.
The outpoints to reserve
Whether the output should be reserved
The invitation identifier to associate with the reservation
Promise that resolves when the output reservation status is set
Retrieves an invitation from the state by its identifier.
Identifier for the invitation
Promise resolving to the stored invitation data, or undefined if not found
TODO: This needs a different implementation, this function is focused on p2pkh.
Gets the last derivative index used for standard locking bytecodes. Filters by templateIdentifier and outputIdentifier, and optionally by invitationIdentifier.
The template identifier to filter by
The output identifier to filter by
OptionalinvitationIdentifier: stringOptional invitation identifier to filter by (if provided, only looks at locking bytecodes for that invitation)
Promise resolving to the last derivative index as a string, or null if none found
Retrieves script hash data from the state by its script hash.
The script hash to look up
Promise resolving to the script hash data, or undefined if not found
Retrieves a template from the state by its identifier.
Identifier for the template
Promise resolving to the template data, or undefined if not found
Retrieves unspent output data from the state.
The transaction hash of the outpoint
The index of the outpoint
Promise resolving to the unspent output data, or undefined if not found
Lists event data matching the provided query.
Query to apply ( e.g. eventType)
Promise resolving to the matching event data
Lists script hash data matching the provided query.
Query to apply (e.g. templateIdentifier, scriptHash, or invitationIdentifier)
Promise resolving to the matching script hash data
Lists all templates stored in the state.
Promise resolving to an array of all templates
Lists unspent output data matching the provided query and optional filter.
Optionalquery: UnspentOutputDataQueryQuery to apply ( e.g. templateIdentifier, reservedBy, lockingBytecode, or status)
Optionalfilter: UnspentOutputDataFilterOptional filter to apply ( e.g. reserved)
Promise resolving to the matching unspent output data
Stores an event in the state.
Identifier for the event
Type of the event
Event data
Optionaltimestamp: numberOptional timestamp
Promise that resolves when the event is stored
Stores an invitation in the state.
Identifier for the invitation
The invitation data to store
Promise that resolves when the invitation is stored
Stores script hash data in the state.
The script hash data to store
Promise that resolves when the script hash data is stored
Stores a template in the state.
The template data to store
Promise that resolves when the template is stored
Stores unspent output data in the state.
The unspent output data to store
Promise that resolves when the unspent output data is stored
Updates the status of existing unspent output data in the state.
The transaction hash of the outpoint
The index of the outpoint
The new status to set ('confirmed' or 'pending')
Promise that resolves when the status is updated
State class responsible for managing the state of the XO Engine.
Example