Steemit Learning Club S23W1 || Developing Tradingboard Web for Checking the Balances of Bitget Accounts via Bitget APIs keys.

in #clubtech-s23w13 days ago (edited)

Crypto Trading Tool_20250219_163120_0000.png

Thumbnails Designed through Canva

Hello Friends, let's meet me again i am your very own Faran Nabeel and today am here to participate in steemit learning club. I am very happy & excited to sharing my first development on trading dashboard in flask framework.

In today era as everyone rapidly evolving digital economy, cryptocurrencies have emerged as a modern financial innovation. With an increasing number of trading platforms, investors and traders as like seek to efficient and secure ways to manage their digital assets in this digital world.

This is my web-based project address the need by providing a user-friendly interface to me that easily integrates with Bitget—a leading cryptocurrency platform—through the use of the API keys. with the power of Flask, a well known lightweight Python web framework, this project enables me to securely fetch and view all their account balances of my master and my all clients, transforming the process of portfolio management into an genetic experience.

page.PNG

And I am happy to share my project in this amazing tech Club. The Dashboard in which I can connect multiple accounts, It's solve multiple problems like if user manage multiple accounts, its will provide help to user to see all the balances of user on the same page. this web based application is designed with both simplicity in mind.

When user being enter their Bitget API keys from user input forms into the secure input fields provided from the Bitget. These provided keys, which include a public key and a secret key, and a Passphrase which is created by user on bitget exchange act as a personalize credentials that authorize the bItget application to access the user’s account information.

It will save in Environment Variable (env file)when user Enter from frontend page, then Flask’s backend process all these credentials, it will establish a secure connection to the Bitget API with the based on REST API. And It's also show the websocket status on the dashboard page. This connection is crucial as it allow to the application to retrieve real-time balance data of all type accounts, ensure that user always have the most up-to-date view of their holdings in USDT.

TradingBoard

After adding both Account details it will show like this, and it will appear with separate sections, e.g, master will appear in separate and clients also look separate from master with connection title and Balance fetching status, after some milliseconds it will show the real time balances and connection status of both master and clients.

pic2.PNG

I call this TradingBoard, It is also a Trading Dashboard and user interact with real-time balances, The decision to build my this project using Flask was drive by the framework’s flexibility. As we know that Flask’s modular architecture allow us to quickly develop a system that is easy to maintain. By decoding the frontend from the backend, our design ensure that any future changes—such as add some new features and integrate additional exchanges.

jdfjdjd.PNG

User also add more clients as he wants, there is no limits to add clients, the execute button is untenable untill user add at least one account in both master and client section, it also has the functionality to add only one master, because as we know that in the master client section, master always become a supreme and it's always be a one single account, still I am working on it and it is not complete yet.

It has two sections,

  • Master Section
  • Clients Section

In the Master Section, User can connect the main account which should be a master Account, It will display in a separate section, As It will display the balance of the main account. the question is that how it will display the balance of account, same as for the Clients Sections, we see the multiple clients in the client section, and it is also in the separate section and display the clients Balances, the whole project is based on Bitget API Documentation


Bitget API Documentation

Bitget APIs.PNG

Bitget API documentation offer the complete guidelines for developers to connect with Bitget cryptocurrency trading platform. The documentation details use endpoint, strong authentication mechanism, request/response formats, and error handling to handle errors. It covers both REST and WebSocket APIs, ensuring that correct data retrieval and trading functionality.


Balance Fetching Mechanism

Capture.PNG

Balance fetching in my web based application involve securely querying Bitget’s API to retrieve balance details using REST Api mode. Here’s how it works:

  1. Authentication: After the user store their Bitget API keys in .env file, the Flask backend generates a signed request using these credentials, ensure the secure access. it will also generate timestamp and Signature.

  2. Endpoint Request: The application sends the HTTP GET (or POST) request to the designate Bitget balance endpoint, which is responsible for returned the real account balance data.

  3. Data Parsing: Bitget send the response with a JSON object contain the details like available balance, spot, future, funding and earn. The Flask app parse this given response to extract and format the balance information and it will display on the web page.

  4. Error Handling: If there is an authentication error or any connectivity issue, the system catch these exceptions and informs the user with error messages on console and on webpage.

This process ensures that user receive accurate, real-time insights into their digital asset portfolio in USDT.

BALANCE.PNG

Here is the general program to fetch all your available balances using REST APIs mode, and when user put their credentials in the program, and then execute the program, the console show the output like this,


Balance Response: {'code': '00000', 'msg': 'success', 'requestTime': 1739956310587, 'data': [{'accountType': 'spot', 'usdtBalance': '0.00707836'}, {'accountType': 'futures', 'usdtBalance': '0.000000006'}, {'accountType': 'funding', 'usdtBalance': '0.00865601'}, {'accountType': 'earn', 'usdtBalance': '0'}, {'accountType': 'bots', 'usdtBalance': '0'}, {'accountType': 'margin', 'usdtBalance': '0'}]}


master.PNG

It is the basic algorithm to show how can we detect the all balances of our Bitget accounts, the basic end point is '/api/v2/account/all-account-balance' to detect all balances, it's also look like this, I also wanna share how it look like. It's the view which we can see how it's appear the balance of master on the webpage.


Still i am working on this project and I need to add a lot of features but for this week I have worked on the basic structure like frontend, backend planning, testing, possible sceneries and others.


GitHub repository

I have created the GitHub repository, and upload all the necessary files to understand how will it work, and the basic idea about fetching the balances of master clients accounts.


Now am inviting my friends @suboohi, @kouba01, @sergeyk, @sualeha, and @wilmer1988 to participate in steem leaning club.

Special thanks to the mentors @kafio @mohammadfaisal @alejos7ven, I am looking forward for your suggestions and your guide for my this development project.


Regards,
Faran Nabeel

faran.png

Sort:  
Loading...

Hi @faran-nabeel, thank you for joining our club. I noticed that this is the first repo on your GitHub. Is this your first time using Git?

Yes, you are right, this is first time i used git because this is first development project in which i am working. Actually i worked on it only for myself.

I developed this just for myself because i have to full fill my trading tasks and handle my trading accounts by using just one master account.

But when i saw your development club, i decide to participate and think that other's can also get benefits through my this project.

Brother I am really impressed by your work as you have been made the trading dashboard looks cool.🔥The thing which I like the most is the one feature, from which we can manage a lot of accounts wisely and greatly.Keep up the great work my friend. 💪
Best Wishes👏

Thanks Bro.... you also did good work.

Thanks for the motivation my brother.
Oblighed.

This is a useful dashboard for adding master account and other small account and to see the detailed balance of different accounts at one place. Best of luck for the further work.

Thank you so much dear for this wonderful feedback.