@cryptocadet/sdk v1.2.1
Cadet SDK
The Cadet SDK is a simple and robust JavaScript/TypeScript library for interacting with the CryptoCadet API. This SDK enables developers to seamlessly integrate CryptoCadet's features into their applications.
Features
- User Management: Create users, retrieve user details, and update information.
- Product Management: Add, update, delete, and fetch product details.
- Network Integration: Manage and query blockchain network details.
- Subscription Management: Handle user subscriptions easily.
Installation
Install the SDK using npm or yarn:
npm install @cryptocadet/sdkor
yarn add @cryptocadet/sdkUsage
Initialization
Import and initialize the SDK with your API and Secret keys:
import CadetSDK from 'cryptocadet/sdk';
const sdk = new CadetSDK('your-public-api-key', 'your-secret-key');
await sdk.authenticate();Methods
User Management
Create User
const response = await sdk.createUser('user@example.com');
console.log(response);Get User
const user = await sdk.getUser();
console.log(user);Product Management
Create Product
const product = { productId: 'prod123', price: 99.99 };
const response = await sdk.createProduct(product);
console.log(response);Delete Product
const response = await sdk.deleteProduct('prod123');
console.log(response);Get Product Price
const response = await sdk.getProductPrice('prod123');
console.log(response);Network Management
Add Network
const response = await sdk.addNetwork('Ethereum');
console.log(response);Get Network Details
const response = await sdk.getNetwork('Ethereum');
console.log(response);Subscription Management
Cancel Subscription
const response = await sdk.cancelSubscription();
console.log(response);Wallet Management
Update Wallet Address
const response = await sdk.updateWalletAddress('0x1234567890abcdef1234567890abcdef12345678');
console.log(response);API Reference
For a detailed description of all available endpoints and parameters, refer to the CryptoCadet API Documentation.
Development
Build
To build the project:
npm run buildRun Tests
The SDK is tested using Jest. To run tests:
npm testLinting
Ensure your code meets the project's style guidelines:
npm run lintContributing
We welcome contributions! Please fork the repository and submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
If you encounter any issues, feel free to open an issue on GitHub or contact us at hello@cryptocadet.app.
Happy Coding! 🎉