Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Defelo edited this page Jul 7, 2019 · 7 revisions

cryptic-currency

Python Microservice for the community project Cryptic

Explanation of dict keys:
  1. user_uuid is the unique identifier for a user account in the game.
  2. source_uuid is the unique identifier for a wallet.
  3. key is necessary to access these features: get the balance, create transactions and delete the wallet.
  4. send_amount is the amount of Morphcoins being sent to another wallet.
  5. destination_uuid is the unique identifier of the destination wallet.
  6. usage is the optional information for a transaction.
User Endpoints:
  • Endpoint ['create'] is to create a new wallet:

    input:

      {}
    

    returns:

      {
          "user_uuid": "68410351-8ddb-4a25-984a-0e99d2cec73c",
          "amount": 100,
          "time_stamp": "2019-07-07 19:59:49.786443",
          "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c",
          "key": "665c7aaf15"
      }
    
  • Endpoint ['get'] is to get the current amount of Morphcoins and the transaction history:

    input:

      {
          "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c",
          "key": "665c7aaf15"
      }
    

    returns:

      {
          "success": {
              "amount": 142,
              "transactions": [
                  {
                      "send_amount": 42,
                      "time_stamp": "2019-07-07 20:01:57.450734",
                      "destination_uuid": "c826e20a-387a-4227-993d-9e5496705a9c",
                      "usage": "",
                      "origin": 0,
                      "source_uuid": "ea49b986-e86b-4d98-b212-3d2969831135",
                      "id": 1
                  }
              ]
          }
      }
    
  • Endpoint ['list'] is to get all wallets of this user:

    input:

      {}
    

    returns:

      {
          "wallets": [
              "c826e20a-387a-4227-993d-9e5496705a9c"
          ]
      }
    
  • Endpoint ['send'] is to transfer coins from one wallet to another:

    input:

      {
          "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c",
          "key": "665c7aaf15",
          "send_amount": 17,
          "destination_uuid": "ea49b986-e86b-4d98-b212-3d2969831135",
          "usage": "information about this transaction"
      }
    

    returns:

      {
          "ok": true
      }
    
  • Endpoint ['reset'] is to delete the wallet if the key is unknown. Can only be used by the owner:

    input:

      {
          "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c"
      }
    

    returns:

      {
          "ok": true
      }
    
  • Endpoint ['delete'] is to delete the wallet:

    input:

      {
          "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c",
          "key": "665c7aaf15"
      }
    

    returns:

      {
          "ok": true
      }
    
Clone this wiki locally