What you’ll learn
This tutorial shows you how to:- Set up and configure Moralis for Sei
- Work with different Moralis APIs (Wallet, NFT, Token, and Blockchain APIs)
- Fetch wallet transactions and balances
- Get NFT holder information and metadata
- Get transaction details and token information
Prerequisites
Before you start, make sure that 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
These are the Sei configuration details for a 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 has several APIs that work across multiple blockchains:- NFT API: Access NFT data, including metadata, ownership details, and transaction history
- Wallet API: Get 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: Get 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
- Go 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
This example combines several of the previous calls into one service:Working with Testnet
For a complete API reference and more guides, see the Moralis documentation.