In this wiki it will be explained how to access to the different endpoints from the Stockmind Platform.

Create token NonFungible

Create a new Non Fungible Token.

  • POST /v3/tokens-nonfungible

Request:

curl -X POST -i \
    -H 'Content-Type: application/json' \
    -d '{
      "name": "Stockmind Collection",
      "symbol": "STK721"
    }' \
    https://your-domain.com/v3/tokens-nonfungible
    

Response:

{
  "txHash": "0x4f68da68b315f0210832f0316a11241ea30d3b42ad733bd3f71fac74d46e00e2"
}

Create a new NonFungible unit token inside the given NonFungible collection, previously created.

  • POST /v3/tokens-nonfungible/:symbol

Request:

curl -X POST -i \
-H 'Content-Type: application/json' \
-d '{
  "metadata": "Hello Crypto!"
}' \
https://your-domain.com/v3/tokens-nonfungible/:symbol

Response:

{
  "txHash": "0xa4969c308bcf0e1f3655316cb636e364a685407ffb739b4380cb0e79608fc951"
}

Transfer token NonFungible

Transfer an NonFungible token to an email address.

  • POST /v3/transactions-nonfungible

Request:

curl -X POST -i \
      -H 'Content-Type: application/json' \
      -d '{
        "destination": "username@domain.io",
        "tokenSymbol": "STK721",
        "id": "71120786848863412851373030999642871879808768922518165984257232620739138279176",
        "metaInf": {
          "comments": "This is a textfield; just an example",
          "explanations": "Names of the keys for this object can be arbitrary",
          "thisIsFreetext": "Both keys and values can be whatever. They will be stored as they are associated to the transaction"
        }
      }' \
      https://your-domain.com/v3/transactions-nonfungible
      

Response:

HTTP/1.1 201 Created
  Vary: Origin
  Date: Thu, 22 Nov 2018 12:02:57 GMT
  Content-Length: 0
  

Transfer an NonFungible token to a Twitter username. The username should be written whithour the @ symbol.

  • POST /v3/transactions-nonfungible

Request:

curl -X POST -i \
      -H 'Content-Type: application/json' \
      -d '{
        "destination": "StockmindD",
        "tokenSymbol": "STK721",
        "id": "71120786848863412851373030999642871879808768922518165984257232620739138279176",
        "metaInf": {
          "comments": "This is a textfield; just an example",
          "explanations": "Names of the keys for this object can be arbitrary",
          "thisIsFreetext": "Both keys and values can be whatever. They will be stored as they are associated to the transaction"
        }
      }' \
      https://your-domain.com/v3/transactions-nonfungible
      

Response:

HTTP/1.1 201 Created
  Vary: Origin
  Date: Thu, 22 Nov 2018 12:02:57 GMT
  Content-Length: 0
  

View all transactions with NonFungible

Returns all your requested transactions.

  • GET /v3/transactions-nonfungible

Request:

curl -X GET -i https://your-domain.com/v3/transactions-nonfungible
      

Response:

[
        {
           "id":"8",
           "direction":"send",
           "pending":false,
           "counterparty":{
              "ethaddr":"0x8538a2b9821aa82a4fcc31a3e5277d526de65f8c"
           },
           "token":"STCK1",
           "decimals":2,
           "amount":{
              "whole":"20",
              "decimal":"00"
           },
           "date":"22/11/2018 12:02:57"
        },
        {
           "id":"3",
           "direction":"receive",
           "pending":false,
           "counterparty":{
              "ethaddr":"0x8cda193791db75e3590e5ee6525a8b32ed696781"
           },
           "token":"STCK1",
           "decimals":2,
           "amount":{
              "whole":"209999",
              "decimal":"99"
           },
           "txHash":"0x34abf404127f11a5b50a49413c57a9ed1261adb2c52a3866e3739b459f625c3e",
           "date":"22/11/2018 11:35:24"
        }
     ]