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 client
    • getERC20Balance(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โ€‘20 balanceOf read.
  • getTokenDecimals(agent, tokenAddress): Reads ERCโ€‘20 decimals.
  • 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

NetworkChain IDRPC URLStatus
SEI Mainnet1329https://evm-rpc.sei-apis.comโœ… Production
SEI Testnet1328https://evm-rpc-testnet.sei-apis.comโœ… Testing

Installation

# Install the SEI provider
pnpm add @axiomkit/sei

# Install required dependencies
pnpm add viem @sei-js/evm

Quick 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


Ready to build the future of Web3 AI? Start with our Quick Start Guide and create your first SEI agent today!