This project is a Lightning Web Component (LWC) application that allows users to subscribe to a crypto newsletter and track reserve percentages for major cryptocurrency exchanges using the Nansen API (Future Scope). The project integrates both client-side and server-side logic using LWC and Salesforce Apex.
- Subscription Form: A simple subscription form where users can enter their email and subscribe to crypto updates.
- Proof of Reserves Tracking: Has the latest reserve percentages of major crypto exchanges (Binance, Kraken, Coinbase, etc.).
- Dynamic Success Screen: Displays a confirmation screen after successful subscription.
- Responsive Design: Uses Salesforce Lightning Design System (SLDS) for a clean and responsive user interface.
- Salesforce Developer Org
- Salesforce CLI
- Clone the repository to your local machine:
git clone https://github.com/your-username/crypto-subscription-reserve-tracker.git cd crypto-subscription-reserve-tracker
- Authenticate into your Salesforce org:
sfdx auth:web:login
- Push the code to your org:
sfdx force:source:push
- Assign the appropriate permission set (if applicable):
sfdx force:user:permset:assign -n YourPermissionSet
- Test the app by navigating to the corresponding Lightning App.
Users can enter their email and subscribe to the latest crypto updates. The subscription form checks for valid input before submitting.
The project fetches exchange reserves from the Nansen API and displays reserve percentages for major exchanges such as:
- Binance
- Kraken
- Coinbase
- Gemini
Future Scope - The project uses an Apex controller to handle backend logic:
CryptoSubscriptionController
: Manages the subscription form logic, saving user emails.CryptoReserveController
: Fetches reserve data from the Nansen API and returns it to the LWC.
This component handles user subscription:
- Displays an email input form
- Shows a success message upon successful submission
This displays reserve percentages for major exchanges using data fetched from the backend.
import { LightningElement } from 'lwc';
import saveEmailToContact from '@salesforce/apex/CryptoSubscriptionController.saveEmailToContact';
export default class SubscribeForm extends LightningElement {
handleSubmit(event) {
event.preventDefault();
const email = this.template.querySelector('input').value;
saveEmailToContact({ email })
.then(() => this.isSubmitted = true)
.catch(error => console.error(error));
}
}
To track reserve percentages of major crypto exchanges, we integrate with the Nansen API. The API is used to fetch data such as reserve percentages and asset holdings for exchanges like Binance, Kraken, and more.
- Obtain a Nansen API key by signing up here.
- Store the API key securely in Salesforce or use a secure method to access it in your Apex controller.
- Modify
CryptoReserveController
to include the Nansen API integration.
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.