In OmniLite all NFTs belong to a Collection. Single NFT also belong to a collection. Each NFT is issued into a Collection, therefore you must first create a collection, then issue the NFT.
Each NFT has 3 data fields, as described below:
Data Type | Length | Mutability | Description | Reccomended Uses |
---|---|---|---|---|
Grant | 255 chars | immutable | Data assigned during issuance | ipfs link! unique attributes |
Issuer | 255 chars | non-immutable | Data assigned by NFT creator/issuer | royalty address/percentage. any unique attributes |
Holder | 255 chars | non-immutable | Data assigned by NFT owner | ? |
The Issuer and Holder data fields can be modified at any time using omni_setnonfungibledata
. More details.
To create a NFT collection use omni_sendissuancemanaged
with type 5
denoting NFT.
omnilite-cli omni_sendissuancemanaged "NFT_FROM_ADDRESS" 1 5 0 "CATEGORY" "SUBCATEGORY" "NFT_COLLECTION_NAME" "URL_FOR_NFT_PROJECT" "DATA"
Recommended "CATEGORY"
: "NFT"
Recommended "SUBCATEGORY"
: "collection"
or "unique"
Recommended "URL_FOR_NFT_PROJECT"
: this is not the ipfs link. Link to project website.
Recommended "DATA"
: this is not the ipfs link. use for collection description.
To issue a NFT in a collection use omni_sendgrant
.
Issue or grant new units of managed tokens.
Arguments:
Name | Type | Presence | Description |
---|---|---|---|
fromaddress |
string | required | the address to send from |
toaddress |
string | required | the receiver of the tokens (sender by default, can be "" ) |
propertyid |
number | required | the identifier of the tokens to grant |
amount |
string | required | the amount of tokens to create |
grantdata |
string | optional | NFT only: data set in all NFTs created in this grant (default: empty) |
Result:
"hash" // (string) the hex-encoded transaction hash
Example:
$ omnicore-cli "omni_sendgrant" "3HsJvhr9qzgRe3ss97b1QHs38rmaLExLcH" "" 51 "7000"
Returns owner and all data set in a non-fungible token. If looking up a single token on tokenidstart can be specified only.
Arguments:
Name | Type | Presence | Description |
---|---|---|---|
propertyid |
number | required | the property identifier |
tokenidstart |
number | required | the first non-fungible token in range |
tokenidend |
number | required | the last non-fungible token in range |
Result:
{
"index" : n, // (number) the unique index of the token
"owner" : "owner", // (string) the Bitcoin address of the owner
"grantdata" : "grantdata", // (string) contents of the grant data field
"issuerdata" : "issuerdata", // (string) contents of the issuer data field
"holderdata" : "holderdata", // (string) contents of the holder data field
}
Example:
$ omnicore-cli "omni_getnonfungibletokendata 1 10 20"
Sets either the issuer or holder data field in a non-fungible token. Holder data can only be updated by the token owner and issuer data can only be updated by address that created the tokens.
Arguments:
Name | Type | Presence | Description |
---|---|---|---|
propertyid |
number | required | the property identifier |
tokenstart |
number | required | the first token in the range to set data on |
tokenend |
number | required | the last token in the range to set data on |
issuer |
boolean | required | if true issuer data set, otherwise holder data set |
data |
string | required | data set as in either issuer or holder fields |
Result:
"hash" // (string) the hex-encoded transaction hash
Example:
$ omnicore-cli "omni_setnonfungibledata" 70 50 60 true "string data"
Create and broadcast a non-fungible send transaction.
Arguments:
Name | Type | Presence | Description |
---|---|---|---|
address |
string | required | the address to send from |
toaddress |
string | required | the address of the receiver |
propertyid |
number | required | the identifier of the tokens to send |
tokenstart |
number | required | the first token in the range to send |
tokenend |
number | required | the last token in the range to send |
redeemaddress |
string | optional | an address that can spend the transaction dust (sender by default) |
referenceamount |
string | optional | a feathercoin amount that is sent to the receiver (minimal by default) |
Result:
"hash" // (string) the hex-encoded transaction hash
Example:
$ omnicore-cli "omni_sendnonfungible" "3M9qvHKtgARhqcMtM5cRT9VaiDJ5PSfQGY" "37FaKponF7zqoMLUjEiko25pDiuVH5YLEa" 70 1 1000
existing modified rpcs:
omni_getproperty
: includes additional fieldnon-fungibletoken
(bool) - whether the property contains non-fungible tokensomni_sendissuancemanaged
: new propertytype
5
denoting non-fungibleomni_sendgrant
: additional argumentgrantdata
, data set in all NFTs created in the grant
new rpcs:
omni_getnonfungibletokens
omni_getnonfungibletokendata
omni_getnonfungibletokenranges
omni_createpayload_sendnonfungible
omni_createpayload_setnonfungibledata