Cleos Examples

Note, these actions can be accessed through a visual interface here: https://wax.bloks.io/account/simpleassets?loadContract=true&tab=Actions&account=simpleassets&scope=simpleassets

  • 1. View Assets
  • 2. Author’s data
  • 3. Create SimpleAssets
  • 4. Update Assets
  • 5. Transfer Assets
  • 6. Burn Assets
  • 7. Offer/Cancel Offer/Claim Assets
  • 8. Delegate/ Undelegate/ Delegate more Assets
  • 9. Attach / Detach
  • 10. More Data
  • 11. FT accounts open/close
  • 12. author-RAM-payer
  •  


     

    1. View Assets

     

    1.1 List all user’s asstes

     

    NFT:

    ./cleos.sh get table simpleassets <acount> sassets

    FT:

    ./cleos.sh get table simpleassets <acount> accounts

    NTT:

    ./cleos.sh get table simpleassets <acount> snttassets

     

    1.2. Get one NFT data (By owner and assetid)

     

    ./cleos.sh get table simpleassets <owner> sassets -L <assetid> -l 1

     

    1.3. Get list users NFTs filtered by author

     

    ./cleos.sh get table simpleassets <owner> sassets --index 2 --key-type i64 -L <author account> -U <author>

     

    1.4. Get one NTT data (by owner and assetid)

     

    ./cleos.sh get table simpleassets <owner> snttassets -L <assetid> -l 1

     

    1.5. Get list users NFTs filtered by author

     

    ./cleos.sh get table simpleassets <owner> sassets --index 2 --key-type i64 -L <author account> -U <author>

     

    1.6 Get all FTs by author

     

    ./cleos.sh get table simpleassets <author account> stat

     

    1.7 Get all FTs by author and symbol

     

    ./cleos.sh get table simpleassets <author account> stat -L <SYMBOL> -U <SYMBOL>

     

    2. Author’s data

     

    2.1 Author registration

     

    ./cleos.sh push action simpleassets authorreg '{
         "author": "<author account>", 
         "dappinfo" : "{ \
               \"name\": \"<DAPP Name>\", \
               \"company\": \"<DAPP Company>\", \
               \"info\": \"<DAPP INFO>\", \
               \"logo\": \"<DAPP logo url>\", \
               \"url\": \"<web-site url>\", \
               \"defaultfee\":<market fee> \
               }", 
         "fieldtypes": "{\
               \"<mdata or idata key 1>\": \"<fieldtype>\", \
               \"<mdata or idata key 2>\": \"<fieldtype>\" \
               }", 
         "priorityimg": "{\
               \"<category name>\": \"<mdata or idata key>\", \
               \"*\": \"<mdata or idata key>\" \
               }" 
    }' -p <author account>

    Example

    ./cleos.sh push action simpleassets authorreg '{
         "author": "ilovekolobok", 
         "dappinfo" : "{ \
               \"name\": \"Kolobok Breeding Game\", \
               \"company\": \"CryptoLions\", \
               \"info\": \"Breed your Kolobok\", \
               \"logo\": \"https://imgs.cryptolions.io/logo_256.png\", \
               \"url\": \"https://kolobok.io\", \
               \"defaultfee\":200 \
               }", 
         "fieldtypes": "{\
               \"bdate\": \"timestamp\", \
               \"cd\": \"timestamp\", \
               \"img\": \"img\", \
               \"st\": \"hide\", \
               \"url\": \"url\" \
               }", 
         "priorityimg": "{\
               \"kolobok\": \"img\", \
               \"*\": \"img\" \
               }" 
    }' -p ilovekolobok

     

    2.2 Author data update

     

    ./cleos.sh push action simpleassets authorupdate '{
         "author": "<author account>", 
         "dappinfo" : "{ \
               \"name\": \"<DAPP Name>\", \
               \"company\": \"<DAPP Company>\", \
               \"info\": \"<DAPP INFO>\", \
               \"logo\": \"<DAPP logo url>\", \
               \"url\": \"<web-site url>\", \
               \"defaultfee\":<market fee> \
               }", 
         "fieldtypes": "{\
               \"<mdata or idata key 1>\": \"<fieldtype>\", \
               \"<mdata or idata key 2>\": \"<fieldtype>\" \
               }", 
         "priorityimg": "{\
               \"<category name>\": \"<mdata or idata key>\", \
               \"*\": \"<mdata or idata key>\" \
               }" 
    }' -p <author account>

    Example

    ./cleos.sh push action simpleassets authorupdate '{
         "author": "ilovekolobok", 
         "dappinfo" : "{ \
               \"name\": \"Kolobok Breeding Game\", \
               \"company\": \"CryptoLions\", \
               \"info\": \"Breed your Kolobok\", \
               \"logo\": \"https://imgs.cryptolions.io/logo_256.png\", \
               \"url\": \"https://kolobok.io\", \
               \"defaultfee\":200 \
               }", 
         "fieldtypes": "{\
               \"bdate\": \"timestamp\", \
               \"cd\": \"timestamp\", \
               \"img\": \"img\", \
               \"st\": \"hide\", \
               \"url\": \"url\" \
               }", 
         "priorityimg": "{\
               \"kolobok\": \"img\", \
               \"*\": \"img\" \
               }" 
    }' -p ilovekolobok
    

     

    3. Create SimpleAssets

     

    3.1 Create NFT

     

    ./cleos.sh push action simpleassets create '{
        "author": "<author acc>",
        "category": "<category>",
        "owner": "<owner acc>",
        "idata": "<sting ot stringfy json>",
        "mdata": &quot
  • 12. author-RAM-payer
  •  

     

     

    ;<sting ot stringfy json>“, „requireclaim“ : <0 or 1> }‘ -p <author acc>

    Example

    ./cleos.sh push action simpleassets create '{
        "author": "testertester",
        "category": "sword",
        "owner": "bohdanbohdan",
        "idata": "{\
            \"name\":\"test\" \
        }",
        "mdata": "{ \
            \"img\": \"https://bit.ly/2MYh8EA\", \
            \"power\": 10, \
            \"broken\": false \
        }",
        "requireclaim" : 0  
    }' -p testertester

     

    3.2 Create and Issue FT

     

    Create FT:

    ./cleos.sh push action simpleassets createf '{
         "author" : "<author account>", 
         "maximum_supply": "<max token supply with symbol>", 
         authorctrl: <author control - 1 or 0>, 
         data: "{ \
            \"name\":\"<FT name>\", \
            \"img\":\"<FT image>\" }" \
            \"<any key>\":\"<value>\" }" \
    }' -p <author account>

    Issue FT:

    ./cleos.sh push action simpleassets issuef '{
         "to": "<new owner>", 
         "author": "<author account>", 
         "quantity": "<amount and symbol>", 
         "memo": "<memo message>"
    }' -p testertester

    Examples Create FT:

    ./cleos.sh push action simpleassets createf '{
         "author" : "testertester", 
         "maximum_supply": "10000000 WOOD", 
         authorctrl: 1, 
         data: "{ \
            \"name\":\"Game wood\", \
            \"img\":\"https://bit.ly/2FQhH12\" \
            }"
    }' -p testertester
    
    ./cleos.sh push action simpleassets createf '{
         "author" : "testertester", 
         "maximum_supply": "10000000.00 ROCK", 
         authorctrl: 1, 
         data: "{ \
            \"name\":\"Game rock\", \
            \"img\":\"https://i.imgur.com/v2Buhsb.png\" \
            }"
    }' -p testertester
    

    Issue FT:

    ./cleos.sh push action simpleassets issuef '{
         "to": "bohdanbohdan", 
         "author": "testertester", 
         "quantity": "500 WOOD", 
         "memo": "demo issue"
    }' -p testertester
    
    
    ./cleos.sh push action simpleassets issuef '{
         "to": "bohdanbohdan", 
         "author": "testertester", 
         "quantity": "100.50 ROCK", 
         "memo": "demo issue"
    }' -p testertester
    

     

    3.3 Create NTT

     

    ./cleos.sh push action simpleassets createntt '{
        "author": "<author acc>",
        "category": "<category>",
        "owner": "<owner acc>",
        "idata": "<sting ot stringfy json>",
        "mdata": "<sting ot stringfy json>",
        "requireclaim" : <0 or 1>  
    }' -p <author acc>

    Example

    ./cleos.sh push action simpleassets createntt '{
        "author": "testertester",
        "category": "sword",
        "owner": "bohdanbohdan",
        "idata": "{ \
            \"name\":\"test ntt\", \
            \"expiration\":2030, \
            \"sn\":\"AB444555\" \
        }",
        "mdata": "{
            \"img\": \"https://i.imgur.com/I8Ygxbo.png\", \
            \"valid\": 1 \
        }",
        "requireclaim" : 0  
    }' -p testertester

     

    4. Update Assets

     

    4.1 Update NFT

     

    ./cleos.sh push action simpleassets update '{
      "author": "<author acc>",
      "owner": "<owner acc>",
      "assetID": <asset id>
      "mdata": "<sting ot stringfy json>"   
    }' -p <author acc>
    

    Example

    ./cleos.sh push action simpleassets update '{
      "author": "testertester",
      "owner": "bohdanbohdan",
      "assetID": 100000000000074
      "mdata": "{ \
            \"img\": \"https://bit.ly/2MYh8EA\", \
            \"power\": 10, \
            \"broken\": true \
      }"
    
    }' -p testertester

     

    4.2 Update FT

     

    ./cleos.sh push action simpleassets updatef '{
         "author": "<author acc>", 
         "sym": "<precision,SYMBOL>", 
         data: "{ \
            \"name\":\"<FT name>\", \
            \"img\":\"<FT image>\", \
            \"<any key>\":\"<any value>\" \
            }"
    }' -p <author acc>

    Examples

    ./cleos.sh push action simpleassets updatef '{
         "author": "testertester", 
         "sym": "0,WOOD", 
         data: "{ \
            \"name\":\"Game wood\", \
            \"img\":\"https://bit.ly/2FQhH12\", \
            \"moreinfo\":\"some description\", \
            }"
    }' -p testertester
    
    
    ./cleos.sh push action simpleassets updatef '{
         "author": "testertester", 
         "sym": "2,ROCK", 
         data: "{ \
            \"name\":\"Game rock\", \
            \"img\":\"https://i.imgur.com/v2Buhsb.png\", \
            \"moreinfo\":\"some description\", \
            }"
    }' -p testertester

     

    4.3 Update NTT

     

    ./cleos.sh push action simpleassets updatentt '{
      "author": "<author acc>",
      "owner": "<owner acc>",
      "assetID": <asset id>
      "mdata": "<sting ot stringfy json>"   
    }' -p <author acc>
    

    Example

    ./cleos.sh push action simpleassets updatentt '{
      "author": "testertester",
      "owner": "bohdanbohdan",
      "assetID": 100000000000111
      "mdata": "{ \
            \"img\": \"https://i.imgur.com/I8Ygxbo.png\", \
            \"valid\": 0 \
      }"
    
    }' -p testertester

     

    5. Transfer Assets

     

    5.1 Transfer NFT

     

    ./cleos.sh push action simpleassets transfer '{
      "from": "<NFT owner account>", 
      "to": "<NFT receiver account>", 
      "assetids": <array [] of assetids>, 
      "memo": "<text memo>"
    }' -p <NFT owner account>

    Example (transfer one ore more assets)

    ./cleos.sh push action simpleassets transfer '{
      "from": "bohdanbohdan", 
      "to": "lioninjungle", 
      "assetids": [100000000000111], 
      "memo": "nft transfer example"
    }' -p bohdanbohdan
    
    ./cleos.sh push action simpleassets transfer '{
      "from": "bohdanbohdan", 
      "to": "lioninjungle", 
      "assetids": [100000000000111, 100000000000202, 100000000000232], 
      "memo": "nft transfer example"
    }' -p bohdanbohdan
    

     

    5.2 Transfer FT

     

    ./cleos.sh push action simpleassets transferf '{
      "from": "<FT owner account>", 
      "to": "<FT receiver account>", 
      "author": "<FT author account>", 
      "quantity" : "<amount and SYMBOL>", 
      "memo": "<text memo>"
    }' -p <FT owner account>

    Examples

    ./cleos.sh push action simpleassets transferf '{
      "from": "bohdanbohdan", 
      "to": "lioninjungle", 
      "author": "testertester", 
      "quantity" : "15 WOOD", 
      "memo": "ft transfer example"
    }' -p bohdanbohdan
    
    
    ./cleos.sh push action simpleassets transferf '{
      "from": "bohdanbohdan", 
      "to": "lioninjungle", 
      "author": "testertester", 
      "quantity" : "20.00 ROCK", 
      "memo": "ft transfer example"
    }' -p bohdanbohdan

     

    6. Burn Assets

     

    6.1 Burn NFT

     

    ./cleos.sh push action simpleassets burn '{
      "owner": "<NFT owner account>", 
      "assetids": <array [] of asset ids>, 
      "memo": "<text memo>"
    }' -p <NFT owner account>

    Example

    ./cleos.sh push action simpleassets burn '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111], 
      "memo": "burn one"
    }' -p bohdanbohdan
    
    ./cleos.sh push action simpleassets burn '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111, 100000000000112], 
      "memo": "burn two"
    }' -p bohdanbohdan   

     

    6.2 Burn FT

     

    ./cleos.sh push action simpleassets burnf '{
      "from": "<FT owner account>", 
      "author": "<FT author account>", 
      "quantity": "<amount SYMBOL>", 
      "memo": "<text memo>"
    }' -p <FT owner account or authors account if author control is enabled for FT>

    Examples

    ./cleos.sh push action simpleassets burnf '{
      "from": "bohdanbohdan", 
      "author": "testertester", 
      "quantity": "10 WOOD", 
      "memo": "burn wood"
    }' -p bohdanbohdan
    
    ./cleos.sh push action simpleassets burnf '{
      "from": "bohdanbohdan", 
      "author": "testertester", 
      "quantity": "10.50 ROCK", 
      "memo": "burn rock"
    }' -p bohdanbohdan
    

     

    6.3 Burn NTT

     

    ./cleos.sh push action simpleassets burnntt '{
      "owner": "<NTT owner account>", 
      "assetids": <array [] of asset ids>, 
      "memo": "<text memo>"
    }' -p <NTT owner account or authors account if NTT was not claimed>

    Example

    ./cleos.sh push action simpleassets burnntt '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111], 
      "memo": "burn one"
    }' -p bohdanbohdan
    
    ./cleos.sh push action simpleassets burnntt '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111, 100000000000112], 
      "memo": "burn two"
    }' -p bohdanbohdan   

     

    7. Offer/Cancel Offer/Claim Assets

     

    7.1 Offer NFT

     

    ./cleos.sh push action simpleassets offer '{
      "owner": "<NFT owner account>", 
      "newowner": "<NFT receiver account>",
      "assetids": <array [] of assets ids>, 
      "memo": "<text memo>"
    }' -p <NFT owner account>

    Example

    ./cleos.sh push action simpleassets offer '{
      "owner": "bohdanbohdan", 
      "newowner": "lioninjungle",
      "assetids": [100000000000111, 100000000000112], 
      "memo": "two assets offerd for claim"
    }' -p bohdanbohdan

     

    7.2 Cancel NFT Offer

     

    ./cleos.sh push action simpleassets canceloffer '{
      "owner": "<NFT owner account>", 
      "assetids": <array [] of assets ids>
    }' -p <NFT owner account>

    Example

    ./cleos.sh push action simpleassets canceloffer '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111, 100000000000112],
    }' -p bohdanbohdan

     

    7.4 Claim NFT

     

    ./cleos.sh push action simpleassets claim '{
      "claimer": "<NFT claimer account>", 
      "assetids": <array [] of assets ids>
    }' -p <NFT claimer account>

    Example

    ./cleos.sh push action simpleassets claim '{
      "claimer": "lioninjungle", 
      "assetids": [100000000000111, 100000000000112],
    }' -p lioninjungle

     

    7.5 Offer FT

     

    ./cleos.sh push action simpleassets offerf '{
      "owner": "<FT owner account>", 
      "newowner": "<FT receiver account>",
      "author": "<FT author>"
      "quantity": <amount and SYMBOL>, 
      "memo": "<text memo>"
    }' -p <FT owner account>

    Examples

    ./cleos.sh push action simpleassets offer '{
      "owner": "bohdanbohdan", 
      "newowner": "lioninjungle",
      "author": "testertester",
      "quantity": "10 WOOD", 
      "memo": "FT WOOD delagate"
    }' -p bohdanbohdan
    
    ./cleos.sh push action simpleassets offer '{
      "owner": "bohdanbohdan", 
      "newowner": "lioninjungle",
      "author": "testertester",
      "quantity": "10.50 ROCK", 
      "memo": "FT ROCK delagate"
    }' -p bohdanbohdan

     

    7.6 Cancel Offer FT

     

    ./cleos.sh push action simpleassets cancelofferf '{
      "owner": "<FT owner account>", 
      "ftofferids": <array [] of offerfs ids >
    }' -p <FT owner account>

    Example

    ./cleos.sh push action simpleassets cancelofferf '{
      "owner": "bohdanbohdan", 
      "ftofferids": [55, 56],
    }' -p bohdanbohdan

     

    7.7 Claim FT

     

    ./cleos.sh push action simpleassets claimf '{
      "claimer": "<FT claimer account>", 
      "ftofferids": <array [] of offerfs ids>
    }' -p <FT claimer account>

    Example

    ./cleos.sh push action simpleassets claimf '{
      "claimer": "lioninjungle", 
      "ftofferids": [55, 56],
    }' -p lioninjungle

     

    7.8 Claim NTT (if was created if requireClaim = true)

     

    ./cleos.sh push action simpleassets claimntt '{
      "claimer": "<NTT claimer account>", 
      "assetids": <array [] of NTT ids>
    }' -p <NTT claimer account>

    Example

    ./cleos.sh push action simpleassets claimntt '{
      "claimer": "lioninjungle", 
      "assetids": [100000000000111, 100000000000112],
    }' -p lioninjungle

     

    8. Delegate/ Undelegate/ Delegate more Assets

     

    8.1 Delegate NFT

     

    ./cleos.sh push action simpleassets delegate '{
      "owner": "<NFT owner account>", 
      "to": "<NFT receiver account>", 
      "assetids": <array [] of asset ids>, 
      "period": <wait in seconds until undelegate will be possible, 86400=1day>,
      "redelegate": <set 1 will allow redelegate asset,0 -not>,  
      "memo": "<text memo>"
    }' -p <NFT owner account>   

    Example

    ./cleos.sh push action simpleassets delegate '{
      "owner": "bohdanbohdan", 
      "to": "lioninjungle", 
      "assetids": [100000000000111, 100000000000112], 
      "period": 86400,
      "redelegate": 0,    
      "memo": "delegation for one day"
    }' -p bohdanbohdan   

     

    8.2 Undelegate NFT

     

    ./cleos.sh push action simpleassets undelegate '{
      "owner": "<NFT real owner account>", 
      "assetids": <array [] of asset ids>
    }' -p <NFT real owner account>   

    Example

    ./cleos.sh push action simpleassets undelegate '{
      "owner": "bohdanbohdan", 
      "assetids": [100000000000111, 100000000000112]
    }' -p bohdanbohdan   

     

    8.3 DelegateMore NFT (extend period of delegation)

     

    ./cleos.sh push action simpleassets delegatemore '{
      "owner": "<NFT owner account>", 
      "assetidc": <array [] of asset ids>, 
      "period": <will add to existing period  seconds until undelegate will be possible, 86400=1day>
    }' -p <NFT owner account>   

    Example

    ./cleos.sh push action simpleassets delegatemore '{
      "owner": "bohdanbohdan", 
      "assetidc": [100000000000111, 100000000000112], 
      "period": 86400
    }' -p bohdanbohdan   

     

    9. Attach / Detach

     

    9.1 Attach NFT(s) to another NFT

     

    ./cleos.sh push action simpleassets attach '{
      "owner": "<NFT owner account>", 
      "assetidc": <container NFT id>,
      "assetids": <array [] of attaching NFTs ids>
    }' -p <NFT author account>  

    Example

    ./cleos.sh push action simpleassets attach '{
      "owner": "bohdanbohdan", 
      "assetidc": 100000000000110,
      "assetids": [100000000000111, 100000000000112], 
    }' -p testertester  

     

    9.2 Attach FT to NFT

     

    ./cleos.sh push action simpleassets attachf '{
      "owner": "<FT owner account>", 
      "author": "<FT author account>", 
      "quantity": <FT amount and SYMBOL>, 
      "assetidc": <container NFT id>
    
    }' -p <NFT author account>  

    Example

    ./cleos.sh push action simpleassets attach '{
      "owner": "bohdanbohdan", 
      "author": "testertester", 
      "quantity": "10 WOOD", 
      "assetidc": 100000000000110
    }' -p testertester  

     

    9.3 Detach NFT

     

    ./cleos.sh push action simpleassets detach '{
      "owner": "<NFT owner account>", 
      "assetidc": <container NFT id>,
      "assetids": <array [] of detaching NFTs ids>
    }' -p <NFT owner account>  

    Example

    ./cleos.sh push action simpleassets detach '{
      "owner": "bohdanbohdan", 
      "assetidc": 100000000000110,
      "assetids": [100000000000111, 100000000000112], 
    }' -p bohdanbohdan  

     

    9.4 Detach FT

     

    ./cleos.sh push action simpleassets detachf '{
      "owner": "<FT owner account>", 
      "author": "<FT author account>", 
      "quantity": <FT amount and SYMBOL>, 
      "assetidc": <container NFT id>
    
    }' -p <NFT owner account>  

    Example

    ./cleos.sh push action simpleassets detachf '{
      "owner": "bohdanbohdan", 
      "author": "testertester", 
      "quantity": "10 WOOD", 
      "assetidc": 100000000000110
    }' -p bohdanbohdan  

     

    10. More Data

     

    10.1. Add more data

     

    ./cleos.sh push action simpleassets mdadd '{
      "author": "<author acc>", 
      "data": "<sting ot stringfy json>", 
    }' -p <author acc>  

    Examples

    ./cleos.sh push action simpleassets mdadd '{
      "author": "testertester", 
      "data": "{ \
            \"material\": \"wood\", \
            \"look\": \"pristine\" \
      }", 
    }' -p testertester  

     

    10.2. Update more data

     

    ./cleos.sh push action simpleassets mdupdate '{
      "id": <mdata id>,
      "author": "<author acc>", 
      "data": "<sting ot stringfy json>" 
    }' -p <author acc>  

    Example

    ./cleos.sh push action simpleassets mdupdate '{
      "id": 28,
      "author": "testertester", 
      "data": "{ \
            \"material\": \"wood\", \
            \"look\": \"pristine\" \
            \"newdata\": \"something\" \
      }", 
    }' -p testertester  

     

    10.3. Remove more data

     

    ./cleos.sh push action simpleassets mdremove '{"id": <mdata id> }' -p <author acc>  

    Examples

    ./cleos.sh push action simpleassets mdremove '{"id": 28}' -p testertester  

     

    11. FT accounts open/close

     

    11.1. Open empty FT account

     

    ./cleos.sh push action simpleassets openf '{
      "owner": <accout where FT with 0 balance will be created>,
      "author": "<FT author acc>", 
      "symbol": "<precision,SYMBOLS>",
      "ram_payer": "<ram payer account>",
    }' -p <ram payer account>  

    Example

    ./cleos.sh push action simpleassets openf '{
      "owner": "lioninjungle",
      "author": "testertester", 
      "symbol": "0,WOOD",
      "ram_payer": "bohdanbohdan", 
    }' -p bohdanbohdan  

     

    11.2. Close empty FT account

     

    ./cleos.sh push action simpleassets closef '{
      "owner": <accout where FT with 0 balance will be created>,
      "author": "<FT author acc>", 
      "symbol": "<precision,SYMBOLS>"
    }' -p <ram payer account>  

    Example

    ./cleos.sh push action simpleassets closef '{
      "owner": "lioninjungle",
      "author": "testertester", 
      "symbol": "0,WOOD"
    }' -p bohdanbohdan  

     

    12. author-RAM-payer

     

    12.1. Check Author RAM payer status

     

    
    ./cleos.sh get table simpleassets simpleassets arampayers --index 2 --key-type i64 -L  -U 
    

     

    12.2. Enable (or toggle) Author RAM payer

     

    
    ./cleos.sh push action simpleassets setarampayer ‘[“”, “”, <1 or 0>]’ -p AUTHORS_ACC