Unleashing Developer Power: The Complete Guide to XDB CHAIN’s TypeScript SDK

The blockchain development landscape has just gotten significantly more accessible with the release of XDB CHAIN’s comprehensive TypeScript SDK. This developer-focused toolkit provides everything needed to build sophisticated blockchain applications on one of the most innovative and eco-friendly blockchain networks available today.

What is XDB CHAIN?

XDB CHAIN is a user-friendly, open-source blockchain platform designed to facilitate digital assets such as branded coins, NFTs, payment tokens, and more. Originally starting as a fork of the Stellar Blockchain, XDB CHAIN has evolved into a completely independent blockchain with groundbreaking features that enable seamless support for all Stellar-based blockchains.

Key Network Features:

  • High Performance: Processing speed of 10,000 TPS, with plans to increase to 1.19 million TPS upon the launch of a layer 2 solution
  • Eco-Friendly: Built with sustainability as a core principle
  • Enterprise-Grade: Designed specifically for brands and enterprise use cases
  • Cross-Chain Compatibility: Allows users from any Stellar-based blockchain to import their accounts

Introducing the TypeScript SDK

The newly released ts-xdbchain-sdk is available on both npm and GitHub, providing developers with a robust toolkit for building on XDB CHAIN. This SDK abstracts the complexity of blockchain interactions while maintaining full access to the network’s powerful features.

Quick Start

Getting started with the XDB Chain SDK is remarkably simple:

Core SDK Features for Developers

1. Comprehensive Wallet Management

The SDK provides complete wallet functionality out of the box:

Wallet Creation & Management:

  • createWallet() – Generate new random wallets
  • loadWallet(secretKey) – Import existing wallets
  • createWalletFromSeed(seed) – Create wallets from seed phrases
  • isValidAddress(address) – Address validation
  • isValidSecretKey(secretKey) – Secret key validation

Advanced Cryptographic Operations:

  • generateKeypair() – Generate cryptographic keypairs
  • keypairFromSecret(secretKey) – Create keypairs from secret keys
  • keypairFromPublicKey(publicKey) – Create keypairs from public keys

2. Account Operations

Complete account lifecycle management is built into the SDK:

Account Creation & Management:

  • createAccount(source, destination, startingBalance) – Create new blockchain accounts
  • loadAccount(publicKey) – Retrieve account information
  • setAccountOptions(secretKey, options) – Configure account settings
  • mergeAccount(sourceSecret, destination) – Merge accounts
  • bumpSequence(secretKey, bumpTo) – Update sequence numbers

3. Payment & Transfer System

The SDK supports multiple payment methods and patterns:

Standard Payments:

  • sendPayment(senderSecret, options) – Simple peer-to-peer payments
  • sendBatchPayments(senderSecret, payments) – Multiple payments in a single transaction

Advanced Path Payments:

  • sendPathPaymentStrictReceive(senderSecret, options) – Fixed receive amount with automatic currency conversion
  • sendPathPaymentStrictSend(senderSecret, options) – Fixed send amount with automatic conversion
  • getPaymentPaths(sourcePublicKey, destination, amount) – Find optimal payment routes

4. Asset & Token Management

Create and manage custom assets with ease:

Asset Operations:

  • createAssetObject(code, issuer) – Create asset definitions
  • issueAsset(issuerSecret, distributorPublicKey, assetCode, amount, limit) – Issue new tokens

Trustline Management:

  • addTrustline(walletSecret, options) – Enable asset receiving
  • removeTrustline(walletSecret, options) – Remove asset support
  • getTrustlines(publicKey) – Query account trustlines
  • allowTrust(trustorSecret, trusteePublicKey, assetCode, authorize) – Authorize/revoke asset trust

5. Decentralized Exchange (DEX) Integration

XDB CHAIN features the first Decentralized Exchange (DEX) on the network, designed specifically to elevate digital asset trading experience:

Trading Operations:

  • createSellOffer(secretKey, options) – Create sell orders
  • createBuyOffer(secretKey, options) – Create buy orders
  • createPassiveSellOffer(secretKey, options) – Create passive orders
  • cancelOffer(secretKey, offerId, selling, buying) – Cancel existing orders

Market Data:

  • getOffers(publicKey, options) – Retrieve account orders
  • getOrderbook(selling, buying, limit) – Access market orderbooks
  • getTrades(publicKey, options) – Query trade history
  • getTradesForAssetPair(baseAsset, counterAsset, options) – Asset pair trading data

6. Real-Time Monitoring

The SDK includes powerful streaming capabilities for real-time applications:

Balance Monitoring:

  • getBalances(publicKey) – Get all account balances
  • getXDBBalance(publicKey) – Get native XDB balance
  • watchBalances(publicKey, callback) – Real-time balance updates

Transaction Streaming:

  • watchTransactions(publicKey, callback) – Monitor transactions in real-time
  • watchPayments(publicKey, callback) – Track payment activities
  • getTransactionHistory(publicKey, options) – Historical transaction data

7. Advanced Features

Claimable Balances:

  • createClaimableBalance(senderSecret, claimantPublicKey, amount, asset) – Create conditional payments
  • claimBalance(claimantSecret, balanceId) – Claim pending balances
  • getClaimableBalances(publicKey) – Query claimable balances

Multi-Signature Support:

  • signTransaction(transaction, signers) – Sign transactions with multiple keys
  • createMultiSigTransaction(sourceAccount, operations, signers) – Create complex multi-signature transactions

Data Management:

  • manageData(secretKey, options) – Store arbitrary data on-chain

Network Configuration

The SDK supports both mainnet and testnet environments:

Mainnet Configuration:

  • Horizon URL: https://horizon.livenet.xdbchain.com/
  • Network Passphrase: LiveNet Global XDBChain Network ; November 2023

Futurenet Configuration (Testnet):

  • Horizon URL: https://horizon.futurenet.xdbchain.com/
  • Network Passphrase: Future XDBChain Network ; November 2023
  • Friendbot: https://friendbot.futurenet.xdbchain.com

Type Safety & Developer Experience

The SDK is built with TypeScript-first principles, providing:

Comprehensive Type Definitions:

  • XDBChainConfig – SDK configuration
  • XDBWallet – Wallet representation
  • XDBAsset – Asset definitions
  • XDBPaymentOptions – Payment configurations
  • XDBTransaction – Transaction objects

Robust Error Handling:

  • XDBChainError – Generic errors
  • XDBNetworkError – Network-related issues
  • XDBValidationError – Input validation errors
  • XDBTransactionError – Transaction-specific errors

Utility Functions:

  • xdbToStroops(amount) / stroopsToXdb(stroops) – Currency conversion
  • isValidAmount(amount) – Amount validation
  • formatAmount(amount, decimals) – Amount formatting
  • calculateFee(operationCount, baseFee) – Fee estimation

Real-World Use Cases

Building a Payment Application

Creating a Trading Bot

Integration with Branded Coins (BCO)

XDB CHAIN features Branded Coins (BCO), where every new BCO allocates up to 2.5% of its total supply for regular XDB buyback and burning, creating a deflationary mechanism. The SDK provides full support for creating and managing these branded assets:

Getting Started Today

To begin building with the XDB CHAIN SDK:

  1. Install the SDK:
  1. Initialize for development:
  1. Explore the documentation:

Community and Support

XDB CHAIN has over 100,000 community members and provides extensive support through multiple channels:

The Future of Blockchain Development

The XDB CHAIN TypeScript SDK represents a significant leap forward in blockchain development accessibility. By providing comprehensive functionality, excellent developer experience, and powerful features like real-time streaming and DEX integration, it enables developers to build sophisticated blockchain applications without getting bogged down in low-level protocol details.

Whether you’re building payment applications, trading platforms, asset management tools, or innovative DeFi solutions, the XDB CHAIN SDK provides the foundation you need to bring your blockchain vision to life. The combination of high performance, eco-friendly architecture, and developer-friendly tooling makes XDB CHAIN a compelling choice for your next blockchain project.

Start building today and join the growing ecosystem of developers creating the future of decentralized applications on XDB CHAIN.

Share the Post:

Related Posts

XDB Chain

Contact us

Fill out the form below, and we will be in touch shortly.

Support

Fill out the form below, and we will be in touch shortly.