https://github.com/tiagocavalcante/walletchain
A centralized cryptocurrency based on wallet chain technology made in TypeScript with Deno
https://github.com/tiagocavalcante/walletchain
cryptocurrency deno typescript
Last synced: 11 months ago
JSON representation
A centralized cryptocurrency based on wallet chain technology made in TypeScript with Deno
- Host: GitHub
- URL: https://github.com/tiagocavalcante/walletchain
- Owner: TiagoCavalcante
- License: gpl-3.0
- Archived: true
- Created: 2020-12-25T02:32:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-15T19:34:08.000Z (over 3 years ago)
- Last Synced: 2025-03-24T06:16:53.609Z (over 1 year ago)
- Topics: cryptocurrency, deno, typescript
- Language: TypeScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# walletChain
A centralized cryptocurrency based on wallet chain technology made in TypeScript with Deno
## Run
To run the server: `export PORT=xxxx && deno run --allow-read --allow-env --allow-net src/server.ts`. The default port is `3000`
## Testing
To run the tests: `deno test --allow-net test/*`
## Routes
| method | path | description |
| ------ | -------------- | ----------- |
| GET | /newWallet | create a new wallet and return its `number` and its one time password `uri` |
| POST | /newBlock | create a new block, receives a `application/json` body with the required paramenters `oneTimePassword`, `lastHash`, `walletNumber`, `proofNumber`
| POST | /transferBlock | transfer a block, receives a `application/json` body with the required paramenters `senderOneTimePassword`, `senderWalletNumber`, `receiverWalletNumber`, `blockNumber` |
| GET | /difficulty | return the number of 0s on the start of the hash |
| GET | /lastBlock | return the `hash` and the `blockNumber` of the last block |