Dev:API - Assets
An asset is a user-defined data structure or NFT that is stored in a register, owned by a given profile. Assets can hold one or more pieces of data and users can define the fields (name, data, type, mutability) that data is stored in.
Supported Nouns
The following nouns are supported for this API command-set:
Noun | Description |
---|---|
any | Any asset, raw, or readonly register |
asset | An editable register with type safety |
raw | An editable register without type safety |
readonly | A non-editable register without type safety |
schema | An asset template for user-defined standards |
Example
You can include more than one noun for a command if you separate them by a comma. The following command will return all the assets of type asset, raw, and readonly that the session profile owns.
assets/list/asset,raw,readonly
Supported Verbs
The following verbs are currently supported by this command-set:
Verb | Description | Nouns |
---|---|---|
claim | Claim ownership of a register | any, asset, raw, readonly |
create | Generate a register of specified type | asset, raw, readonly, schema |
get | Get register of supported type | any, asset, raw, readonly, schema |
history | Generate the history of all last states | any, asset, raw, readonly, schema |
list | List all registers owned by active session | any, asset, raw, readonly, partial, schema |
tokenize | To represent ownership of an asset object with a token object | asset |
transactions | List all transactions that modified specified object | any, asset, raw, readonly, schema |
transfer | Transfer a specified register | any, asset, raw, readonly |
update | Update a specified object | any, asset, raw, readonly, schema |
verify | Verify if a given register has been tokenized | partial |
Example
The following will show you how to invoke a basic <verb>/<noun> URI. This will return all the assets of type any that the session profile owns.
assets/list/any
Supported Operators
The following verbs are currently supported by this command-set:
Operator | Description |
---|---|
array | Returns an array of values from the filtered data-set |
count | Returns the total number of occurrences of a value in the filtered data-set |
floor | Strips the decimal off of a value or array of values |
max | Returns the largest value in the filtered data-set |
mean | Returns the average value of the filtered data-set |
min | Returns the smallest value in the filtered data-set |
mode | Returns the most occurring value in the filtered data-set |
sum | Returns the sum of all the values in the filtered data-set |
Example
The following will show you how to invoke a basic <verb>/<noun>/<field>/<operator> URI. This will calculate the average value of the modified field for all assets owned by active session:
assets/list/any/modified/mean