Interface
This page explains the application interface which is constituted by projection and transaction functions.
The application interface consists of two components:
Transaction functions representing the application write interface.
Projection functions representing the application read interface.
Transaction Functions
Transaction functions take arbitrary input data and output a transaction object. Besides populating the transaction object with the required , they also take care of checking the input arguments for correctness and can return error messages.
Transaction function examples are:
A
transfer
function consuming an owned resource and creating one owned by a receiver.
A
merge
function merging a list of resources into one.
A
swap
function consuming a list of resources and specifying a list of resource kinds and quantities that the caller wants to receive in return.
Projection Functions
Projection functions project data from the state (usually being fragmented into many different resources) into a format being useful to application users. As such, they take a list of resources as input and output arbitrary data.
Projection function examples are:
A
totalBalance
function returning the total quantity of resources of a specific kind being owned by an owner identity.
A
chatHistory
function returning the message texts of a message channel.
Commonly, the input resources passed to projection functions are obtained after indexing and custom-filtering, e.g., from an indexing service provider.
Last updated