Market
See definitions:
Actions:
Action: createSSCCreate SSC
JSON Example
Also see: createSSC
Action: cancel
cancel
JSON Example
{
"contractName": "market",
"contractAction": "cancel",
"contractPayload": {
"type": "buy",
"id": "a47906faa9071cf524e0bc8909b0d6f81f4fd48f"
}
}
Also see: cancel
Action: buy
buy
JSON Example
{
"contractName": "market",
"contractAction": "buy",
"contractPayload": {
"symbol": "BEE",
"quantity": "1",
"price": "0.00000001"
}
}
Also see: buy
Action: sell
sell
JSON Example
{
"contractName": "market",
"contractAction": "sell",
"contractPayload": {
"symbol": "BEE",
"quantity": "100000",
"price": "1"
}
}
Also see: sell
Action: marketBuy
market buy
JSON Example
Also see: marketBuy
Action: marketSell
market sell
JSON Example
Also see: marketSell
Nft
Token issuance
Once an NFT has been created, its data properties defined, and editing permissions set, it’s time to issue some tokens!
fees
There is a fee per each token issued, which the issuing account or smart contract must pay. The issuer can choose to pay the fee in one of several different regular Hive Engine token types. Initially, such fees will be payable in BEE. The issuance fee is calculated as follows:
fee = base fee + ((base fee) x (number of data properties))
The base fee when paying with BEE is 0.001. The fee reflects the fact that on-chain storage has a cost, so the more data properties an NFT has, the higher the issuance fee will be per token.
Example: you want to issue 3 tokens and pay the fees in BEE. Your NFT has 4 data properties. You will pay 0.005 BEE per token issued (the base fee of 0.001, plus an additional 0.001 for each data property). The total cost to issue 3 tokens will be 0.015 BEE.
locked tokens
When a token is issued, the issuer can optionally choose to lock up a basket of other tokens within the issued NFT token (or NFT instance, as we sometimes refer to them). These locked tokens will be transferred from the issuing account or smart contract, and considered “owned” by the newly issued token itself. The locked tokens will stay attached to the issued NFT instance for the duration of its lifetime. Locked tokens cannot be spent or interacted with in any way, they are effectively out of circulation.
The only way to retrieve locked tokens is by burning the NFT instance that contains them. When an NFT token is burned, any locked tokens are released & transferred back to the account or smart contract that held the burned token (they are NOT sent back to the issuing account!).
Thus locked tokens are a way to give intrinsic value to an NFT, above & beyond what the NFT is worth in its own right. Token holders are incentivized to burn their NFTs in order to get back the value of the tokens locked within.
Note that both regular Hive Engine tokens and other NFT instances can be locked within tokens in this manner. You can even have a mix of different token types.
locked token restrictions
For performance reasons, the following rules apply when dealing with locked tokens. For the purposes of these rules, we use the term container token to refer to an NFT instance that contains other NFT instances locked within it (an NFT instance that only contains regular Hive Engine tokens is NOT considered to be a container token).
- A maximum of 10 different types of regular tokens can be locked up in a single NFT token (though the quantity of each has no limit).
- A maximum of 50 NFT instances can be locked up in a single NFT token. A mix of different symbols is permitted without restriction.
- Container tokens must be issued individually, you may not issue more than one of them at once using the issueMultiple action.
- Container tokens must be burned individually, you may not burn more than one at a time using the burn action.
- In the issueMultiple and burn actions, container tokens and non-container tokens cannot be mixed. You can burn up to EITHER 50 non-container tokens OR 1 container token at a time. token IDs
- Each issued NFT token has its own unique ID number. This ID starts at 1 for each token symbol, and increments by 1 every time a new token is issued. Thus if you issue a new instance of a MYNFT, and the ID of that newly issued token is 501, you know it is the 501st MYNFT to be issued. Token ID numbers can be used to look up data properties through RPC queries, or to identify tokens to be the subject of transfer, burn, delegate, etc actions.
Token IDs are always represented as strings when used in arguments to contract actions. Note that ID numbers are not globally unique; they will only be unique for a given symbol (i.e. MYNFT can have a token with id 5, and OTHERNFT can also have a token with id 5). The combination of symbol and ID number uniquely identifies a token (or NFT instance, as we sometimes refer to them).
See definitions:
Actions:
- createSSC
- create
- updateUrl
- updateMetadata
- updateName
- updateOrgName
- updateProductName
- addAuthorizedIssuingAccounts
- addAuthorizedIssuingContracts
- removeAuthorizedIssuingAccounts
- removeAuthorizedIssuingContracts
- transferOwnership
- addProperty
- setPropertyPermissions
- setProperties
- setGroupBy
- updatePropertyDefinition
- issueMultiple
- enableDelegation
- delegate
- undelegate
- transfer
- burn
Create SSC
JSON Example
Also see: createSSC
Action: create
Creates a new NFT. A creation fee of 100 BEE is required.
- requires active key: yes
- can be called by: blockchain account
- parameters:
name
(string): name of the token (letters, numbers, whitespace only, max length of 50)symbol
(string): symbol of the token (uppercase letters only, max length of 10)- (optional)
orgName
(string): name of the company/organization that created this NFT (letters, numbers, whitespace only, max length of 50) - (optional)
productName
(string): product/brand that this NFT is associated with (letters, numbers, whitespace only, max length of 50) - (optional)
url
(string): url of the project (max length of 255) - (optional)
maxSupply
(string): maximum supply for the token (between 1 and 9,007,199,254,740,991). If maxSupply is not specified, then the supply will be unlimited. - (optional)
authorizedIssuingAccounts
(array of string): a list of blockchain accounts which are authorized to issue new tokens on behalf of the NFT owner. If no list is provided, then the NFT owner (the account that calls create) will be the only such authorized account by default. - (optional)
authorizedIssuingContracts
(array of string): a list of smart contracts which are authorized to issue new tokens on behalf of the NFT owner. If no list is provided, then no smart contracts will be authorized as such.
JSON Example
{
"contractName":"nft",
"contractAction":"create",
"contractPayload":{
"symbol":"TESTNFT",
"name":"My Test NFT"
}
}
{
"contractName":"nft",
"contractAction":"create",
"contractPayload":{
"symbol":"TESTNFT",
"name":"My Test NFT",
"url":"https://mynft.com",
"maxSupply":"1000"
}
}
{
"contractName":"nft",
"contractAction":"create",
"contractPayload":{
"symbol":"TESTNFT",
"name":"My Test NFT",
"orgName":"My Company Inc",
"productName":"Uber Cool Product",
"url":"https://mynft.com",
"maxSupply":"1000",
"authorizedIssuingAccounts":[
"cryptomancer",
"aggroed",
"harpagon"
],
"authorizedIssuingContracts":[
"mycontract",
"myothercontract"
]
}
}
Also see: create
Action: updateUrl
Updates the url of the token’s project web site.
- requires active key: no
- can be called by: blockchain account that owns the NFT
- parameters:
url
(string): new url for the token (0 <= length <= 255)symbol
(string): symbol of the token (uppercase letters only, max length of 10)
JSON Example
{
"contractName": "nft",
"contractAction": "updateUrl",
"contractPayload": {
"symbol": "TESTNFT",
"url": "https://mynewurl.com"
}
}
Also see: updateUrl
Action: updateMetadata
update metadata
JSON Example
{
"contractName": "nft",
"contractAction": "updateMetadata",
"contractPayload": {
"symbol": "TESTNFT",
"metadata": {
"url": "https://mycoolnft.com",
"icon": "https://mycoolnft.com/token.jpg",
"desc": "This NFT will rock your world! It has features x, y, and z. So cool!"
}
}
}
Also see: updateMetadata
Action: updateName
Updates the user friendly name of an NFT.
- requires active key: no
- can be called by: blockchain account that owns the NFT
- parameters:
name
(string): new name of the token (letters, numbers, whitespace only, max length of 50)symbol
(string): symbol of the token (uppercase letters only, max length of 10)
JSON Example
{
"contractName":"nft",
"contractAction":"updateName",
"contractPayload":{
"symbol":"TESTNFT",
"name":"My Awesome NFT"
}
}
Also see: updateName
Action: updateOrgName
Updates the name of the company/organization that manages an NFT.
- requires active key: no
- can be called by: blockchain account that owns the NFT
- parameters:
orgName
(string): new name of the company/organization (letters, numbers, whitespace only, max length of 50)symbol
(string): symbol of the token (uppercase letters only, max length of 10)
JSON Example
{
"contractName":"nft",
"contractAction":"updateOrgName",
"contractPayload":{
"symbol":"TESTNFT",
"orgName":"Nifty Company Inc"
}
}
Also see: updateOrgName
Action: updateProductName
Updates the name of the product/brand that an NFT is associated with.
- requires active key: no
- can be called by: blockchain account that owns the NFT
- parameters:
productName
(string): new name of the product/brand (letters, numbers, whitespace only, max length of 50)symbol
(string): symbol of the token (uppercase letters only, max length of 10)
JSON Example
{
"contractName":"nft",
"contractAction":"updateProductName",
"contractPayload":{
"symbol":"TESTNFT",
"productName":"Acme Exploding NFTs"
}
}
Also see: updateProductName
Action: addAuthorizedIssuingAccounts
Adds blockchain accounts to the list of accounts that are authorized to issue new tokens on behalf of the NFT owner. This will NOT replace the existing list; it only adds to it. There is a maximum limit of 10 accounts that can be on this list.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)accounts
(array of string): a list of blockchain accounts to add to the authorized list
JSON Example
{
"contractName":"nft",
"contractAction":"addAuthorizedIssuingAccounts",
"contractPayload":{
"symbol":"TESTNFT",
"accounts":[
"satoshi",
"aggroed",
"cryptomancer"
]
}
}
Also see: addAuthorizedIssuingAccounts
Action: addAuthorizedIssuingContracts
Adds smart contracts to the list of contracts that are authorized to issue new tokens on behalf of the NFT owner. This will NOT replace the existing list; it only adds to it. There is a maximum limit of 10 smart contracts that can be on this list.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)contracts
(array of string): a list of smart contracts to add to the authorized list
JSON Example
{
"contractName": "nft",
"contractAction": "addAuthorizedIssuingContracts",
"contractPayload": {
"symbol": "TESTNFT",
"contracts": [ "mycontract","anothercontract","mygamecontract" ]
}
}
Also see: addAuthorizedIssuingContracts
Action: removeAuthorizedIssuingAccounts
Removes blockchain accounts from the list of accounts that are authorized to issue new tokens on behalf of the NFT owner. This will NOT replace the existing list; it only removes from it.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)accounts
(array of string): a list of blockchain accounts to remove from the authorized list
JSON Example
{
"contractName":"nft",
"contractAction":"removeAuthorizedIssuingAccounts",
"contractPayload":{
"symbol":"TESTNFT",
"accounts":[
"satoshi",
"aggroed"
]
}
}
Also see: removeAuthorizedIssuingAccounts
Action: removeAuthorizedIssuingContracts
Removes smart contracts from the list of contracts that are authorized to issue new tokens on behalf of the NFT owner. This will NOT replace the existing list; it only removes from it.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)contracts
(array of string): a list of smart contracts to remove from the authorized list
JSON Example
{
"contractName":"nft",
"contractAction":"removeAuthorizedIssuingContracts",
"contractPayload":{
"symbol":"TESTNFT",
"contracts":[
"mycontract",
"mygamecontract"
]
}
}
Also see: removeAuthorizedIssuingContracts
Action: transferOwnership
Transfers ownership of an NFT from the current owner to another blockchain account.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)to
(string): blockchain account to become the new owner (3 <= length <= 16)
JSON Example
{
"contractName":"nft",
"contractAction":"transferOwnership",
"contractPayload":{
"symbol":"TESTNFT",
"to":"aggroed"
}
}
Also see: transferOwnership
Action: addProperty
Adds a new data property schema to an existing NFT definition. For every data property added beyond the third, a 100 BEE fee is required.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)name
(string): name of the new data property (letters & numbers only, max length of 25)type
(string): must be number, string, or boolean as explained above- (optional)
isReadOnly
(boolean): if true, then this data property can be set exactly one time and never changed again. The default value is false if this parameter is not specified. - (optional)
authorizedEditingAccounts
(array of string): a list of blockchain accounts which are authorized to edit this data property on behalf of the NFT owner. If no list is provided, then the NFT owner (the account that calls create) will be the only such authorized account by default. - (optional)
authorizedEditingContracts
(array of string): a list of smart contracts which are authorized to edit this data property on behalf of the NFT owner. If no list is provided, then no smart contracts will be authorized as such.
Note that once a data property name and type are set, they normally CANNOT be changed (however under some limited circumstances this is possible; see updatePropertyDefinition). Also, data property schemas cannot be deleted once added.
JSON Example
{
"contractName":"nft",
"contractAction":"addProperty",
"contractPayload":{
"symbol":"TESTNFT",
"name":"color",
"type":"string"
}
}
{
"contractName":"nft",
"contractAction":"addProperty",
"contractPayload":{
"symbol":"TESTNFT",
"name":"edition",
"type":"number",
"isReadOnly":true
}
}
{
"contractName":"nft",
"contractAction":"addProperty",
"contractPayload":{
"symbol":"TESTNFT",
"name":"isPremium",
"type":"boolean",
"authorizedEditingAccounts":[
"cryptomancer"
],
"authorizedEditingContracts":[
"mycontract",
"myothercontract"
]
}
}
Also see: addProperty
Action: setPropertyPermissions
Can be used after calling the addProperty action to change the lists of authorized editing accounts & contracts for a given data property. There is a maximum limit of 10 accounts/contracts that can be on each list.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)name
(string): name of the data property (letters & numbers only, max length of 25)- (optional)
accounts
(array of string): a list of blockchain accounts which are authorized to edit this data property on behalf of the NFT owner. This list will completely replace the current one (not add to it). - (optional)
contracts
(array of string): a list of smart contracts which are authorized to edit this data property on behalf of the NFT owner. This list will completely replace the current one (not add to it).
JSON Example
{
"contractName":"nft",
"contractAction":"setPropertyPermissions",
"contractPayload":{
"symbol":"TESTNFT",
"name":"color",
"accounts":[
"cryptomancer",
"marc"
],
"contracts":[
]
}
}
Also see: setPropertyPermissions
Action: setProperties
Edits one or more data properties on one or more instances of an NFT.
- requires active key: no
- can be called by: blockchain account or smart contract on the authorized list of editing accounts/contracts for the data properties in question
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)- (optional)
fromType
(string): indicates whether this action is being called by a blockchain account or a smart contract. Can be set to user or contract. If not specified, defaults to user. Note that a smart contract can still set this to user in order to execute the action on behalf of a blockchain account rather than the calling contract itself. nfts
(array of object): the data properties to set and their corresponding NFT instance ID. Should be formatted as follows:[ {"id":"1", "properties": {"name1":"value1","name2":"value2",...}}, {"id":"2", "properties": {"name1":"value1","name2":"value2",...}, ...} ]
JSON Example
{
"contractName":"nft",
"contractAction":"setProperties",
"contractPayload":{
"symbol":"TESTNFT",
"nfts":[
{
"id":"573",
"properties":{
"color":"red",
"level":"2"
}
},
{
"id":"301",
"properties":{
"level":3
}
}
]
}
}
{
"contractName":"nft",
"contractAction":"setProperties",
"contractPayload":{
"symbol":"TESTNFT",
"fromType":"contract",
"nfts":[
{
"id":"1284",
"properties":{
"isFrozen":true
}
}
]
}
}
Also see: setProperties
Action: setGroupBy
After you have created some data properties via the addProperty action, you can call setGroupBy in order to define a list of data properties by which market orders for NFT instances should be grouped by. You can think of this grouping as an index used to organize orders on the market, similar to how PeakMonsters groups Splinterlands cards according to type & gold foil status. NFT instances which have the same values for the designated data properties are considered equivalent as far as the market is concerned.
Consider the following points carefully before calling this action:
- Data properties which never change once set (i.e. read-only properties) are the best ones to use for this grouping.
- Long text strings do not make ideal properties to group by. Integers and boolean types make the best grouping.
- Numbers with fractional parts (for example 3.1415926) should be avoided due to possible rounding issues. Integers without fractional parts are ideal for grouping.
- This grouping can only be set once! You can’t change it later on, so don’t call this action until you are completely ready to do so.
- Token holders will not be able to place market orders until you have defined a valid grouping via this action.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)properties
(array of string): list of data property names to set as the grouping. The schema for each property must have been previously created via the addProperty action.
JSON Example
{
"contractName":"nft",
"contractAction":"setGroupBy",
"contractPayload":{
"symbol":"TESTNFT",
"properties":[
"level",
"isFood"
]
}
}
Also see: setGroupBy
Action: updatePropertyDefinition
Updates the schema of a data property. This action can be used to change a data property’s name, type, or read only attribute, with a couple caveats.
This action can only be called if no tokens for this NFT have been issued yet. Once tokens have been issued, data property schema definitions cannot be changed, and any attempt to use this action will fail. This action is primarily intended as a safeguard to protect against mistakes during NFT creation time, not for changing token characteristics later on.
- There are further restrictions on data property name changes (see newName parameter below).
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
- symbol (string): symbol of the token (uppercase letters only, max length of 10)
- name (string): name of the data property to change (letters & numbers only, max length of 25)
- (optional) newName (string): new name of the data property (letters & numbers only, max length of 25). There must not be an existing data property with this new name, and the data property being changed must not be part of a grouping previously created by setGroupBy.
- (optional) type (string): new type of the data property. Must be number, string, or boolean.
- (optional) isReadOnly (boolean): new read only attribute of the data property. If true, then this data property can be set exactly one time and never changed again.
JSON Example
{
"contractName":"nft",
"contractAction":"updatePropertyDefinition",
"contractPayload":{
"symbol":"TESTNFT",
"name":"color",
"newName":"Color"
}
}
{
"contractName":"nft",
"contractAction":"updatePropertyDefinition",
"contractPayload":{
"symbol":"TESTNFT",
"name":"edition",
"type":"string"
}
}
{
"contractName":"nft",
"contractAction":"updatePropertyDefinition",
"contractPayload":{
"symbol":"TESTNFT",
"name":"frozen",
"newName":"age",
"type":"number",
"isReadOnly":false
}
}
Also see: updatePropertyDefinition
Action: issueMultiple
Issues multiple NFT instances at once. A maximum of 10 tokens can be issued by calling this action (there are some caveats however, see locked token restrictions). Issuance fees & other issuing behavior is same as for the issue action above.
- requires active key: yes
- can be called by: blockchain account or smart contract on the authorized list of issuing accounts/contracts for the NFT in question
- parameters:
instances
(array of object): a list of parameters for each token to be issued, as described above for the issue action
JSON Example
// issue 3 tokens from contract -> a combination of users & contracts
{
"contractName":"nft",
"contractAction":"issueMultiple",
"contractPayload":{
"instances":[
{
"fromType":"contract",
"symbol":"TSTNFT",
"to":"aggroed",
"feeSymbol":"ENG",
"properties":{
"level":0
}
},
{
"fromType":"contract",
"symbol":"TSTNFT",
"to":"dice",
"toType":"contract",
"feeSymbol":"ENG",
"lockTokens":{
"ENG":"5.75"
}
},
{
"fromType":"contract",
"symbol":"TSTNFT",
"to":"marc",
"feeSymbol":"PAL"
}
]
}
}
Also see: issueMultiple
Action: enableDelegation
Enables the delegation feature for a token. A fee of 1000 ENG is required to perform this action.
- requires active key: yes
- can be called by: blockchain account that owns the NFT
- parameters:
symbol
(string): symbol of the token (uppercase letters only, max length of 10)undelegationCooldown
(integer): number of days that a user will have to wait until the tokens that were delegated are returned to them (between 1 and 18,250 days - 50 years)
JSON Example
{
"contractName":"nft",
"contractAction":"enableDelegation",
"contractPayload":{
"symbol":"TESTNFT",
"undelegationCooldown":1 // 1 day to cooldown
}
}
{
"contractName":"nft",
"contractAction":"enableDelegation",
"contractPayload":{
"symbol":"TESTNFT",
"undelegationCooldown":30 // 30 days to cooldown
}
}
{
"contractName":"nft",
"contractAction":"enableDelegation",
"contractPayload":{
"symbol":"TESTNFT",
"undelegationCooldown":91 // 13 weeks to cooldown
}
}
Also see: enableDelegation
Action: delegate
Delegates one or more tokens to another account or smart contract. Can only be called if an NFT has previously had delegation enabled through the enableDelegation action. If a token is already delegated, it cannot be delegated again until it has been undelegated.
- requires active key: yes
- can be called by: blockchain account or smart contract that holds the token(s) to be delegated
- parameters:
to
(string): blockchain account or smart contract to delegate the token(s) to- (optional)
fromType
(string): indicates whether this action is being called by a blockchain account or a smart contract. Can be set to user or contract. If not specified, defaults to user. Note that a smart contract can still set this to user in order to execute the delegation on behalf of a blockchain account rather than the calling contract itself. - (optional)
toType
(string): indicates whether the target specified by the “to” parameter is a blockchain account or a smart contract. Can be set to user or contract. If not specified, defaults to user. nfts
(array of object): list of tokens to delegate. Should be formatted as follows:[{"symbol":"SYMBOLONE", "ids":["1","2","3", ...]}, {"symbol":"SYMBOLTWO", "ids":["1","2","3", ...]}, ... ]
A maximum of 50 tokens can be delegated in a single call of this action. Note that tokens cannot be delegated to the null account.
JSON Example
Also see: delegate
Action: undelegate
undelegate
JSON Example
// user -> user
{
"contractName":"nft",
"contractAction":"delegate",
"contractPayload":{
"to":"cryptomancer",
"nfts":[{"symbol":"TSTNFT", "ids":["200"]}, {
"symbol":"DRAGON",
"ids":["1", "1000", "10000", "9999"]
}]
}
}
// user -> contract
{
"contractName":"nft",
"contractAction":"delegate",
"contractPayload":{
"to":"splinterlands",
"toType":"contract",
"nfts":[{"symbol":"TSTNFT", "ids":["200"]}, {
"symbol":"DRAGON",
"ids":["1", "1000", "10000", "9999"]
}]
}
}
// contract -> contract
{
"contractName":"nft",
"contractAction":"delegate",
"contractPayload":{
"to":"splinterlands",
"toType":"contract",
"fromType":"contract",
"nfts":[{"symbol":"DRAGON", "ids":[ "111", "112"]}]
}
}
// contract -> user
{
"contractName":"nft",
"contractAction":"delegate",
"contractPayload":{
"to":"aggroed",
"toType":"user", // could have omitted this, but including it here for clarity
"fromType":"contract",
"nfts":[{"symbol":"NFTNFT", "ids":[ "987654"]}]
}
}
Also see: undelegate
Action: transfer
Transfers one or more tokens to another account or smart contract.
- requires active key: yes
- can be called by: Steem account or smart contract that holds the token(s) to be transferred
- parameters:
to
(string): Steem account or smart contract to transfer the token(s) to- (optional)
fromType
(string): indicates whether this action is being called by a Steem account or a smart contract. Can be set to user or contract. If not specified, defaults to user. Note that a smart contract can still set this to user in order to execute the transfer on behalf of a Steem account rather than the calling contract itself. - (optional)
toType
(string): indicates whether the destination specified by the “to” parameter is a Steem account or a smart contract. Can be set to user or contract. If not specified, defaults to user. nfts
(array of object): list of tokens to transfer. Should be formatted as follows:[{"symbol":"SYMBOLONE", "ids":["1","2","3", ...]}, {"symbol":"SYMBOLTWO", "ids":["1","2","3", ...]}, ... ]
A maximum of 50 tokens can be transferred in a single call of this action. Note that tokens cannot be transferred if they are currently being delegated to another account. Also, tokens cannot be transferred to null; for that you need to use the burn action.
JSON Example
// user -> user
{
"contractName": "nft",
"contractAction": "transfer",
"contractPayload": {
"to": "cryptomancer",
"nfts": [
{"symbol":"TSTNFT", "ids":["200"]},
{"symbol":"DRAGON", "ids":["1","1000","10000","9999"]}
]
}
}
// user -> contract
{
"contractName": "nft",
"contractAction": "transfer",
"contractPayload": {
"to": "splinterlands",
"toType":"contract",
"nfts": [
{"symbol":"TSTNFT", "ids":["200"]},
{"symbol":"DRAGON", "ids":["1","1000","10000","9999"]}
]
}
}
// contract -> contract
{
"contractName": "nft",
"contractAction": "transfer",
"contractPayload": {
"to": "splinterlands",
"toType":"contract",
"fromType":"contract",
"nfts": [
{"symbol":"DRAGON", "ids":["111","112"]}
]
}
}
// contract -> user
{
"contractName": "nft",
"contractAction": "transfer",
"contractPayload": {
"to": "aggroed",
"toType":"user", // could have omitted this, but including it here for clarity
"fromType":"contract",
"nfts": [
{"symbol":"NFTNFT", "ids":["987654"]}
]
}
}
// A successful transfer action will emit a "transfer" event for each token transferred: from: original token holder, fromType: u or c, to: new token holder, toType: u or c, symbol, id example:
{
"contract": "nft",
"event": "transfer",
"data": {
"from": "aggroed",
"fromType": "u",
"to": "cryptomancer",
"toType": "u",
"symbol": "TEST",
"id": "1000"
}
}
Also see: transfer
Action: burn
Burns one or more tokens. When a token is burned, it is sent to the null account and the circulating supply of that NFT is reduced by 1. In addition, any locked tokens contained within the burned token will be released and transferred back to the account that held the burned token.
- requires active key: yes
- can be called by: Steem account or smart contract that holds the token(s) to be burned
- parameters:
- (optional)
fromType
(string): indicates whether this action is being called by a Steem account or a smart contract. Can be set to user or contract. If not specified, defaults to user. Note that a smart contract can still set this to user in order to execute the action on behalf of a Steem account rather than the calling contract itself. nfts
(array of object): list of tokens to burn. Should be formatted as follows:[{"symbol":"SYMBOLONE", "ids":["1","2","3", ...]}, {"symbol":"SYMBOLTWO", "ids":["1","2","3", ...]}, ... ]
- (optional)
A maximum of 50 tokens can be burned in a single call of this action. Note that tokens cannot be burned if they are currently being delegated to another account. There are some additional caveats, see locked token restrictions.
JSON Example
{
"contractName": "nft",
"contractAction": "burn",
"contractPayload": {
"nfts": [ {"symbol":"TESTNFT", "ids":["666"]} ]
}
}
{
"contractName": "nft",
"contractAction": "burn",
"contractPayload": {
"fromType": "contract",
"nfts": [
{"symbol":"TESTNFT", "ids":["12","45","882"]},
{"symbol":"MYNFT", "ids":["672","33"]},
{"symbol":"DRAGON", "ids":["123456"]}
]
}
}
// A successful burn action will emit a "burn" event for each token burned: account: who burned it, ownedBy: u or c, unlockedTokens: released regular token list, unlockedNfts: released NFT instance list, symbol, id example:
{
"contract": "nft",
"event": "burn",
"data": {
"account": "aggroed",
"ownedBy": "u",
"unlockedTokens": {"ENG":"15", "TKN":"0.75"},
"unlockedNfts": [{"symbol": "TSTNFT", "ids": ["1","2"]}, {"symbol": "OTHERNFT", "ids": ["320"]}],
"symbol": "TSTNFT",
"id": "305"
}
}
Also see: burn
Tokens
See definitions:
Actions:
- createSSC
- updateParams
- updateUrl
- updateMetadata
- updatePrecision
- transferOwnership
- create
- issue
- issueToContract
- transfer
- transferToContract
- transferFromContract
- checkPendingUnstakes
- enableStaking
- stake
- stakeFromContract
- unstake
- cancelUnstake
- enableDelegation
- delegate
- undelegate
- checkPendingUndelegations
Also see: createSSC
Action: updateParams
JSON Example
{
"tokenCreationFee": "100",
"enableDelegationFee": "1000",
"enableStakingFee": "1000"
}
Also see: updateParams
Action: updateUrl
Update the url of a token
Also see: updateUrl
Action: updateMetadata
Update the metadata of a token
JSON Example
{
"contractName": "tokens",
"contractAction": "updateMetadata",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"metadata": {
"url": "",
"icon": "",
"desc": ""
}
}
}
Also see: updateMetadata
Action: updatePrecision
Update the precision of a token (it can only be increased)
JSON Example
{
"contractName": "tokens",
"contractAction": "updatePrecision",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"precision": 8
}
}
Also see: updatePrecision
Action: transferOwnership
Transfer ownership of a token from the current token issuer to an other account
JSON Example
{
"contractName": "tokens",
"contractAction": "transferOwnership",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"to": "alice"
}
}
Also see: transferOwnership
Action: create
Creates a token (a token creation fee might be enforced)
JSON Example
{
"contractName": "tokens",
"contractAction": "create",
"contractPayload": {
"symbol": "ORB",
"name": "Essence Orbs",
"precision": 0,
"maxSupply": "200000",
"url": "https://splinterlands.com"
}
}
Also see: create
Action: issue
Issue tokens to an account (can only be triggered by the account that created the token)
JSON Example
{
"contractName": "tokens",
"contractAction": "issue",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"to": "alice",
"quantity": "10000"
}
}
Also see: issue
Action: issueToContract
Also see: issueToContract
Action: transfer
Transfer tokens to an account
JSON Example
{
"contractName": "tokens",
"contractAction": "transfer",
"contractPayload": {
"symbol": "BEE",
"to": "hive-tokens",
"quantity": "1000",
"memo": ""
}
}
Also see: transfer
Action: transferToContract
Transfer tokens to a contract
JSON Example
{
"contractName": "tokens",
"contractPayload": {
"symbol": "BEE",
"quantity": "300",
"to": "crittermanager"
},
"contractAction": "transferToContract"
}
Also see: transferToContract
Action: transferFromContract
Transfer from contract
Also see: transferFromContract
Action: checkPendingUnstakes
check pending unstakes
Also see: checkPendingUnstakes
Action: enableStaking
Enables the staking feature for a token.
JSON Example
{
"contractName": "tokens",
"contractAction": "enableStaking",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"unstakingCooldown": 14,
"numberTransactions": 2
}
}
Also see: enableStaking
Action: stake
Stakes tokens. (if it is a token that allows staking)
JSON Example
{
"contractName": "tokens",
"contractAction": "stake",
"contractPayload": {
"to": "alice",
"symbol": "BEE",
"quantity": "0.125"
}
}
Also see: stake
Action: stakeFromContract
Also see: stakeFromContract
Action: unstake
Unstakes tokens. (if it is a token that allows staking) There is a cooldown period that is setup per token (see “enableStaking” action)
JSON Example
{
"contractName": "tokens",
"contractAction": "unstake",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"quantity": "10"
}
}
Also see: unstake
Action: cancelUnstake
Cancels an initiated unstake.
JSON Example
{
"contractName": "tokens",
"contractAction": "cancelUnstake",
"contractPayload": {
"txID": "df21a5311af93b4440e7ecca6d59d2ac7c7845eb"
}
}
Also see: cancelUnstake
Action: enableDelegation
Enables the delegation feature for a token.
JSON Example
{
"contractName": "tokens",
"contractAction": "enableDelegation",
"contractPayload": {
"symbol": "YOUR_SYMBOL",
"undelegationCooldown": 10
}
}
Also see: enableDelegation
Action: delegate
Delegates tokens. (if it is a token that allows delegation) If a delegation already exists for that account it will add the new quantity to it (to decrease a delegation you need to undelegate)
JSON Example
{
"contractName": "tokens",
"contractAction": "delegate",
"contractPayload": {
"to": "alice",
"symbol": "YOUR_SYMBOL",
"quantity": "25"
}
}
Also see: delegate
Action: undelegate
Undelegates tokens partially or totally. (if it is a token that allows delegation) There is a cooldown period that is setup per token (see “enableDelegation” action)
JSON Example
{
"contractName": "tokens",
"contractAction": "undelegate",
"contractPayload": {
"from": "alice",
"symbol": "BEE",
"quantity": "15"
}
}
Also see: undelegate
Action: checkPendingUndelegations
check pending undelegations
Also see: checkPendingUndelegations