README - saltict/Demo-Docs GitHub Wiki
SubWallet Services SDK Documentation
A comprehensive TypeScript SDK for integrating with SubWallet services, providing seamless access to balance detection, price history, swap operations, XCM transfers, and Cardano functionality.
๐ Quick Start
import subwalletApiSdk from '@subwallet-monorepos/subwallet-services-sdk';
// Get price history for a token
const priceHistory = await subwalletApiSdk.priceHistoryApi.getPriceHistory('DOT', '1W');
// Detect token balances
const balances = await subwalletApiSdk.balanceDetectionApi.getBalances({
addresses: ['your-wallet-address'],
chains: ['polkadot']
});
๐ Documentation Index
๐ฏ Getting Started
- ๐ Overview - Detailed project overview and capabilities
- โก Installation - Quick setup and installation guide
- ๐ก Examples - Basic usage examples and common patterns
๐๏ธ Architecture
- ๐๏ธ Architecture Overview - High-level system design
- ๐งฉ Component Architecture - Service components and relationships
- ๐ Data Flow - Request/response flow and integration points
- ๐จ Design Patterns - Singleton pattern and API design
๐จโ๐ป Development
- ๐ ๏ธ Development Setup - Environment setup and prerequisites
- ๐จ Build Instructions - Build process and compilation
- ๐งช Testing Guide - Testing strategies and procedures
- ๐ Development Workflow - Contributing and development process
๐ Usage Guide
- โ๏ธ Configuration - SDK configuration and customization
- ๐ API Reference - Complete API documentation with examples
- ๐ป Code Examples - Integration examples and best practices
๐ Deployment
- ๐ฆ Version Management - Semantic versioning and release strategy
- ๐ข Release Procedures - Release process and publishing
- ๐ Environment Setup - Environment configuration
๐ง Troubleshooting
- โ Common Issues - Troubleshooting guide and FAQ
๐ Key Features
๐ Price History API
- Real-time and historical price data
- Multiple timeframe support (1D, 1W, 1M, 3M, YTD, 1Y, ALL)
- Chart-ready data format
๐ฐ Balance Detection API
- Multi-chain balance detection
- Real-time balance updates
- Support for various token standards
๐ Swap API
- Cross-chain swap operations
- Route optimization
- Slippage protection
๐ XCM API
- Cross-consensus message passing
- Parachain interoperability
- Asset transfers between chains
๐ Cardano API
- Cardano-specific operations
- Native token support
- Staking operations
๐ ๏ธ Technical Specifications
- Language: TypeScript 5.x
- Runtime: Node.js 18+, Browser (ES2020+)
- Module System: ES Modules
- Package Manager: npm/yarn/pnpm
- Build System: Nx monorepo
๐โโ๏ธ Quick Installation
# Using npm
npm install @subwallet-monorepos/subwallet-services-sdk
# Using yarn
yarn add @subwallet-monorepos/subwallet-services-sdk
# Using pnpm
pnpm add @subwallet-monorepos/subwallet-services-sdk
๐ฏ Basic Usage
import { SubWalletServiceSDK } from '@subwallet-monorepos/subwallet-services-sdk';
// Get singleton instance
const sdk = SubWalletServiceSDK.getInstance();
// Configure for your platform
sdk.updateConfig({
platform: 'webapp', // 'extension' | 'mobile' | 'webapp'
baseUrl: 'https://your-custom-endpoint.com' // optional
});
// Use specific services
const prices = await sdk.priceHistoryApi.getPriceHistory('DOT', '1W');
const swapQuote = await sdk.swapApi.getQuote(/* swap params */);
๐ค Contributing
We welcome contributions! Please see our Development Workflow for guidelines on:
- Setting up the development environment
- Code standards and linting
- Testing requirements
- Pull request process
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
- ๐ Documentation
- ๐ Issue Tracker
- ๐ฌ Community Discord
- ๐ง Contact Support
๐ Navigation