Skip to content

arkandas/vulkanite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vulkanite

vulkanite banner

This is a simple toy app I wrote over a weekend when I started learning Android. It serves as a proof of concept for exchanging a simulated currency called vulkanite.

When an account is created successfully, the user receives some starting currency and a unique wallet.

The app allows a user to:

  • Transfer currency by wallet ID
  • Transfer currency by QR
  • Exchange QR vouchers for currency/rewards
  • Generate a unique QR code to request currency

Android Screenshots

Login

login

Home

Home

Voucher

Voucher

Transactions

Transactions

Requests

Requests

Vulkanite API

API Endpoints and Parameters

1. User

1.1 Login

  • Description: Takes a username and a password (SHA512) as input and returns a JWT token for the user.

  • Type: POST

  • Request URL: http://localhost:8080/login

login

  • Query Response:

login response

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
405 Method Not Allowed
  • Example:
curl -X POST "http://localhost:8080/login" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"password\": \"testpwd\", \"username\": \"johndoe\"}"

1.2 Register

login

  • Query Response:

Empty body with 200 Ok response code.

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
405 Method Not Allowed
  • Example:
curl -X POST "http://localhost:8080/register" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"email\": \"testmail@test.com\", \"fullname\": \"John Doe\", \"password\": \"e8603172175d138e1724d75c91f788738fcbcc74fc98ee68837075bbb0aaf0f6db567cca1b61ec57ad646d79e39b3b2ed452b8a048f22b265fb74b8a244a828c\", \"username\": \"johndoe\"}"

1.3 Account Information

Header Description
token Bearer token

login

  • Query Response:

login

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
405 Method Not Allowed
  • Example:
curl -X GET "http://localhost:8080/accountInfo" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww"

2. Transactions

2.1 User Transactions

  • Description: Returns all transactions for the user.

  • Type: GET

  • Headers:

Header Description
token Bearer token

transactions

  • Query Response:

transactions response

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
405 Method Not Allowed
  • Example:
curl -X GET "http://localhost:8080/transactions" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww"

2.2 Transaction by Id

  • Description: Returns a single user transaction by its id.

  • Type: GET

  • Headers:

Header Description
token Bearer token
  • Parameters:
Parameter Description
transactionId Transaction Id

transactions

  • Query Response:

transactions response

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
404 Not Found
405 Method Not Allowed
  • Example:
curl -X GET "http://localhost:8080/transactions/22" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww"

2.3 Send Currency Transaction

  • Description: Transfers currency to another user wallet.

  • Type: POST

  • Headers:

Header Description
token Bearer token

transactions

  • Query Response:

Empty body with 200 Ok response code.

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
405 Method Not Allowed
  • Example:
curl -X POST "http://localhost:8080/transactions/sendCurrency" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww" -H "Content-Type: application/json" -d "{ \"amount\": 10, \"note\": \"Test transaction\", \"walletDestination\": \"8f0b86952c58f2\"}"

3. Vouchers

3.1 User Vouchers

  • Description: Returns all vouchers for the user.

  • Type: GET

  • Headers:

Header Description
token Bearer token

transactions

  • Query Response:

transactions response

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
405 Method Not Allowed
  • Example:
curl -X GET "http://localhost:8080/vouchers" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww"

3.2 Redeem Voucher

  • Description: Adds a voucher to the current user.

  • Type: POST

  • Headers:

Header Description
token Bearer token
  • Parameters:
Parameter Description
voucherCode Voucher Code

voucher redemption

  • Query Response:

Empty body with 200 Ok response code.

  • Supported Response Codes:
Code Description
200 Ok
400 Bad request
401 Unauthorized
405 Method Not Allowed
  • Example:
curl -X POST "http://localhost:8080/vouchers/redeem/5513146043" -H "accept: */*" -H "token: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJnY2FycmVyYXQiLCJleHAiOjE2MDc5ODYzMzgsImlhdCI6MTYwNzk2ODMzOH0.1CnwCWGePeZQl9kd_bRGdIxdVWGWHNarH8qEITTsRy6BFVUAYfE0VPQFpSd54X7_ii_1KZrOU6m1uHrYryiwww"

About

A simple Android app to exchange vulkanites!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published