The app for polkadot accounts to obtain their secrets
Screen.Recording.2023-05-20.at.14.48.31.mov
Before running this application, you will need to have the following installed on your machine:
- Node.js (version ^16)
- NPM or Yarn
- Polkadot JS browser extension
To install the project dependencies, follow these steps:
- Clone the repository:
git clone https://github.com/Traf333/WebN3.git - Change to the project directory:
cd WebN3 - Install dependencies using NPM:
npm installor using Yarn:yarn install
For the configuration the app uses .env file so don't forget to add it cp .env.example .env.local
To run the application, use the following command:
npm run devOr if you're using Yarn:
yarn devThis will start the development server, and you can access the app in your browser at http://localhost:3000.
- URL:
GET /api/v1/secret - Description: Returns a secret message from the database for specific address
- URL:
POST /api/v1/signin - Description: The endpoint for obtaining session token or store session within cookies
- Parameters:
- address:
string. The user’s address. Alphanumeric. No spaces or symbols. - message:
Sign-in request for address <address>..<address>must be the same asaddress. - signature:
string. The signature of the message using the user’s address.List any parameters required by this endpoint, if applicable.
- address:
- Example:
POST /api/v1/signin
Payload {
"address": "14GgSVJ1unwjVw4CuMGXYz4P4yT1HzVqEDEiExhiCS84EGQo",
"message": "Sign-in request for address 14GgSVJ1unwjVw4CuMGXYz4P4yT1HzVqEDEiExhiCS84EGQo.",
"signature": "0xfc03197bd2110f613677913e3d52afbc1ecda9099109f01300a97acde7122d305d87d115cf173632319c6666d829a4585a45462cb3d2df5513f7d5a68c9f1785",
}
- URL:
DELETE /api/v1/signout - Description: Drops session
PS: Readme content was created with help of ChatGPT