This project implements a simple stock management system on the Azle platform, allowing users to create accounts, manage stock portfolios, and perform stock transactions. The system is built using the Azle library, providing a secure and decentralized environment for stock-related operations.
- Node
- Typescript
- DFX
- Clone the repository:
git clone https://github.com/ImanuelSG/Stock-Canister.git cd stock-canister nvm install 18 nvm use 18 npm install
- INSTALL DFX
DFX_VERSION=0.14.1 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
- Add DFX to your path
echo 'export PATH="$PATH:$HOME/bin"' >> "$HOME/.bashrc"
Here are the main functionalities provided by this system:
createAccount
- Creates a new user account for stock management.
createStock
- Creates a new stock with specified details.
deleteStock
- Deletes a stock with specified details.
buyStock
- Allows a user to buy a certain quantity of a stock.
sellStock
- Allows a user to sell a certain quantity of a stock.
getPortfolio
- Retrieves the stock portfolio of the user.
- Make sure you have the required environment for running ICP canisters, and dfx is running in the background (
dfx start --background --clean
). - Deploy the canisters:
dfx deploy
. - Open the URL for the Backend canister via the Candid interface.
To conclude your work session, you can stop your local Azle replica by executing the following command in your terminal:
dfx stop