Introduction
The Fibrous Router SDK is a TypeScript library that provides a simple and efficient way to integrate optimal token swaps into your decentralized applications. Built on top of the Fibrous Router API, it handles all the complexity of finding the best routes and executing swaps across multiple chains.Why Use the SDK?
Type Safety
Full TypeScript support with comprehensive type definitions
Multi-Chain
Single interface for Base, HyperEVM, Scroll, and Starknet
Easy Integration
Simple API that abstracts away complex routing logic
Optimized Routes
Automatically finds the best swap paths across all DEXs
Supported Chains
The SDK supports the following blockchain networks:| Chain | Chain ID | Status |
|---|---|---|
| Starknet | SN_MAIN | β Full Support |
| Base | 8453 | β Full Support |
| Scroll | 534352 | β Full Support |
| HyperEVM | 998 | β Full Support |
Quick Start
1
Install the SDK
2
Initialize the Router
3
Get the Best Route
4
Execute the Swap
Key Features
π Smart Routing
The SDK automatically finds the optimal route by:- Aggregating liquidity from multiple DEX protocols
- Splitting large trades across multiple paths
- Minimizing price impact and slippage
- Considering gas costs in route optimization
π Batch Operations
Execute multiple swaps in a single transaction (Starknet):π― Token Management
Easy access to supported tokens:β‘ Protocol Flexibility
Exclude specific protocols or use only certain ones:Complete Example
Hereβs a complete example of swapping tokens on Base:Chain-Specific Examples
- Base
- HyperEVM
- Scroll
- Starknet
SDK vs API
- When to Use SDK
- When to Use API
β
Use the SDK when:
- Building a TypeScript/JavaScript application
- You want type safety and autocomplete
- You need simplified integration
- Working with multiple chains
- You want built-in error handling
Requirements
- Node.js: Version 18.x or higher
- Web3 Provider: ethers.js v6+ or starknet.js v5+
- TypeScript: Version 4.5+ (recommended)
Installation
Next Steps
Installation Guide
Detailed installation and setup instructions
Core Functions
Explore all available SDK methods
Get Best Route
Learn how to find optimal swap routes
Execute Swaps
Build and execute swap transactions
Resources
Support
Need help? Weβre here for you:- π¬ Join our Discord
- π§ Email Support
- π Report Issues