What You’ll Learn
By the end of this tutorial, you’ll understand:- How to set up and configure Moralis for Sei blockchain integration
- Working with different Moralis APIs (Wallet, NFT, Token, and Blockchain APIs)
- Fetching wallet transactions and balances
- Retrieving NFT holder information and metadata
- Getting transaction details and token information
Prerequisites
Before starting with this guide, ensure you have:- Moralis Account: Create a free account at moralis.io
- Node.js: Version 14 or higher installed
- Package Manager: npm, yarn, or pnpm
- TypeScript: Basic knowledge (optional but recommended)
Sei Network Configuration
Following is the configuration details of Sei for Moralis integration:
- Chain ID: 1329 (0x531)
- RPC URL: https://evm-rpc.sei-apis.com
- Chain ID: 1328 (0x530)
- RPC URL: https://evm-rpc-testnet.sei-apis.com
Moralis APIs Overview
Moralis offers several powerful APIs that work seamlessly across multiple blockchains:- NFT API: Access comprehensive NFT data including metadata, ownership details, and transaction history
- Wallet API: Retrieve real-time wallet data including balances, transaction history, and token holdings
- Token API: Get token information, prices, and transfer data
- Blockchain API: Fetch raw blockchain data - blocks, transactions, and logs
- Price API: Retrieve real-time and historical crypto token prices
- DeFi API: Query DeFi protocol data including pools, positions, and yields
Setting Up Your Project
Install Moralis SDK
First, create a new project and install the Moralis SDK:Get Your API Key
- Sign up at moralis.io
- Navigate to “Project Settings”
- Copy your API key from the dashboard
Basic Configuration
Create a.env file in your project root:
Initialize Moralis
Create anindex.ts or index.js file:
Wallet Transactions API
NFT Holders API
Transaction Details API
Token API
Complete Integration Example
Here’s a comprehensive example that brings everything together:Working with Testnet
For a complete API reference and additional guides visit the Moralis Documentation