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.

Version License TypeScript

๐Ÿš€ 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

๐Ÿ—๏ธ Architecture

๐Ÿ‘จโ€๐Ÿ’ป Development

๐Ÿ“– Usage Guide

๐Ÿš€ Deployment

๐Ÿ”ง Troubleshooting

๐ŸŒŸ 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


๐Ÿ”— Navigation