-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
- user_uuid is the unique identifier for a user account in the game.
- source_uuid is the unique identifier for a wallet.
- key is necessary to access these features: get the balance, create transactions and delete the wallet.
- send_amount is the amount of Morphcoins being sent to another wallet.
- destination_uuid is the unique identifier of the destination wallet.
- usage is the optional information for a transaction.
-
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" }
Errors:
{"error": "already_own_a_wallet"}
-
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:
{ "user_uuid": "68410351-8ddb-4a25-984a-0e99d2cec73c", "amount": 142, "time_stamp": "2019-07-07 19:59:49.786443", "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "key": "665c7aaf15", "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 } ] }
Errors:
{"error": "unknown_source_or_destination"} {"error": "permission_denied"}
-
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 }
Errors:
{"error": "permission_denied"} {"error": "unknown_source_or_destination"} {"error": "not_enough_coins"}
-
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 }
Errors:
{"error": "unknown_source_or_destination"} {"error": "permission_denied"}
-
Endpoint ['delete'] is to delete the wallet:
Input:
{ "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "key": "665c7aaf15" }
Returns:
{ "ok": true }
Errors:
{"error": "unknown_source_or_destination"}
-
Endpoint ['exists'] is to check if a specific wallet exists:
Input:
{ "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c" }
Returns:
{ "exists": true }
-
Endpoint ['put'] is to increase the balance of a wallet and optionally to create a transaction:
Input:
{ "destination_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "amount": 1337, "create_transaction": false }
Returns:
{ "ok": true }
Input:
{ "destination_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "amount": 1337, "create_transaction": true, "source_uuid": "380bd7e7-e5a6-4a84-9291-aa04f251fb64", "usage": "gift", "origin": 1 }
Returns:
{ "send_amount": 1337, "time_stamp": "2019-07-07 21:32:48.863748", "destination_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "usage": "gift", "origin": 1, "source_uuid": "380bd7e7-e5a6-4a84-9291-aa04f251fb64", "id": 2 }
Errors:
{"error": "unknown_source_or_destination"}
-
Endpoint ['dump'] is to decrease the balance of a wallet and optionally to create a transaction:
Input:
{ "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "key": "665c7aaf15", "amount": 1337, "create_transaction": false }
Returns:
{ "ok": true }
Input:
{ "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "key": "665c7aaf15", "amount": 1337, "create_transaction": true, "destination_uuid": "e6a75864-5fc0-40f7-a317-3318c4d9500c", "usage": "electricity costs", "origin": 2 }
Returns:
{ "send_amount": 1337, "time_stamp": "2019-07-07 22:17:21.935761", "destination_uuid": "e6a75864-5fc0-40f7-a317-3318c4d9500c", "usage": "electricity costs", "origin": 2, "source_uuid": "c826e20a-387a-4227-993d-9e5496705a9c", "id": 3 }
Errors:
{"error": "unknown_source_or_destination"} {"error": "permission_denied"} {"error": "not_enough_coins"}