Installation
Install the Magic Router SDK using your preferred package manager:Basic Setup
Import the SDK functions you need:Understanding the Fundamentals
Before diving into usage examples, it’s important to understand the core concepts behind Magic Router SDK. These concepts explain why certain methods exist and how they optimize your transaction flow.Core Concepts
Learn about account delegation, blockhash management, and validator selection in the Magic Router ecosystem.
Basic Usage Examples
Preparing Transactions (Browser Wallets)
UseprepareMagicTransaction when working with browser wallets that handle signing:
Sending Transactions (Local Signers)
UsesendMagicTransaction when you have local signers or session keys:
Validator Discovery
Find the optimal validator for your connection:Delegating Accounts to a Validator
Once you have the closest validator, you can delegate accounts to enable Ephemeral Rollup execution:Complete Example
Here’s a full example combining all concepts:Next Steps
Core Concepts
Deep dive into the fundamental concepts behind Magic Router SDK.
Magic Router Overview
Learn more about account delegation and how Magic Router works.
Session Keys
Explore Session Keys for gasless gaming experiences.

