SEI Provider
Build Axiom agents that interact with the SEI blockchain
@axiomkit/sei
The SEI provider for Axiom enables you to create AI agents that can interact with the SEI blockchain ecosystem. Build intelligent Web3 applications that can manage wallets, execute token operations, interact with smart contracts, and integrate with DeFi protocols.
What is SEI?
SEI is a high-performance Layer 1 blockchain optimized for trading and DeFi applications. It features:
- โก Ultra-fast finality - Sub-second transaction confirmation
- ๐ EVM compatibility - Deploy Ethereum smart contracts seamlessly
- ๐ฐ Built-in order matching - Native DEX infrastructure
- ๐ Cosmos ecosystem - Interoperable with IBC networks
Why Use Axiom with SEI?
Combine the power of AI with SEI's trading-optimized infrastructure:
- Speed for DeFi: Sub-second finality helps agents act on opportunities quickly.
- Autonomous agents: Observe markets, decide, and execute on-chainโend to end.
- Simplicity: High-level primitives reduce boilerplate for common tasks.
- Safety by design: Guardrails and validations minimize on-chain mistakes.
- Interoperability: EVM support and ecosystem integrations streamline workflows.
- Scalability: Seamless movement from testnets to mainnet with consistent tooling.
Key Features
๐ฆ Wallet Management
- Secure private key handling
- Balance monitoring and alerts
- Transaction history tracking
๐ Token Operations
- Native SEI token transfers
- ERC-20 token interactions
- Token discovery via DexScreener
- Balance queries and formatting
๐ Smart Contract Integration
- Read contract state
- Execute contract methods
- Event monitoring
- Gas optimization
๐ Provider Integrations
- DexScreener API for token data
- Price feeds and market data
- DEX integration capabilities
- Cross-chain bridge support
SEI Function Showcase
Wallet Client
AxiomSeiWallet: High-level wallet clientgetERC20Balance(contractAddress?): Returns formatted balance for native SEI or a given ERCโ20.getTokenAddressFromTicker(ticker): Looks up token address via DexScreener.ERC20Transfer(amount, recipient, ticker?): Sends native SEI or ERCโ20 tokens.
ERCโ20 Tokens
get_erc20_balance(agent, contractAddress?): Reads balance (native or ERCโ20) and formats it.erc20_transfer(agent, amount, recipient, ticker?): Transfers native SEI or an ERCโ20 by ticker.
ERCโ721 (NFTs)
get_erc721_balance(agent, tokenAddress): Reads NFT balance for the wallet.erc721Mint(agent, recipient, tokenAddress, tokenId): Mints an NFT to a recipient.
Providers
getTokenAddressFromTicker(ticker): Queries DexScreener and returns the base token address on SEI if found.
Utils
formatSei(amount, decimals): Converts human amount to on-chain units.formatWei(amount, decimals): Formats wei-like amounts to human-readable.getBalance(agent, tokenAddress): Low-level ERCโ20balanceOfread.getTokenDecimals(agent, tokenAddress): Reads ERCโ20decimals.isContract(agent, address): Checks if an address has contract code.getChainConfig(chainId?): Returns RPC/REST/explorer config for SEI chains.TOKENS,SEI_RPC_URL: Common token metadata and default RPC.
Supported Networks
| Network | Chain ID | RPC URL | Status |
|---|---|---|---|
| SEI Mainnet | 1329 | https://evm-rpc.sei-apis.com | โ Production |
| SEI Testnet | 1328 | https://evm-rpc-testnet.sei-apis.com | โ Testing |
Installation
# Install the SEI provider
pnpm add @axiomkit/sei
# Install required dependencies
pnpm add viem @sei-js/evmQuick Example
Here's a simple agent that checks your SEI balance:
import { createAgent, context, action } from "@axiomkit/core";
import { AxiomSeiWallet } from "@axiomkit/sei";
import { groq } from "@ai-sdk/groq";
import { z } from "zod";
// Initialize SEI wallet
const seiWallet = new AxiomSeiWallet({
rpcUrl: "https://evm-rpc.sei-apis.com/",
privateKey: "0x...", // Your private key
});
// Create SEI context with balance checking action
const seiContext = context({
type: "sei-wallet",
schema: z.object({
walletAddress: z.string(),
}),
actions: [
action({
name: "check-balance",
description: "Check the SEI balance of the wallet",
schema: z.object({}),
handler: async () => {
const balance = await seiWallet.getERC20Balance();
return `Your SEI balance is: ${balance} SEI`;
},
}),
],
});
// Create the agent
const agent = createAgent({
model: groq("gemma2-9b-it"),
contexts: [seiContext],
});
// Use the agent
await agent.start();
const response = await agent.send({
context: seiContext,
args: { walletAddress: "0x..." },
input: { type: "text", data: { text: "What's my SEI balance?" } },
});What's Next?
Ready to build your SEI AI agent? Follow these guides:
๐ Quick Start Guide
Get up and running with your first SEI agent in minutes.
๐ผ Wallet Management
Learn how to securely manage wallets and handle private keys.
๐ Token Operations
Master SEI and ERC-20 token transfers, balance queries, and token discovery.
๐ Smart Contracts
Interact with smart contracts, read state, and execute methods.
๐ MCP Context Integration
Build SEI AI agents using Model Context Protocol for standardized blockchain interactions.
๐ Providers & Integrations
Integrate with DexScreener, price feeds, and other SEI ecosystem services.
๐ Examples
Real-world examples and use cases for SEI AI agents.
Community & Support
- ๐ฌ Discord Community - Get help and share projects
- ๐ GitHub Repository - Source code and issues
- ๐ฆ Twitter - Latest updates and announcements
Ready to build the future of Web3 AI? Start with our Quick Start Guide and create your first SEI agent today!