Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ai/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Pre-configured prompts for common tasks:

<div className="bg-white dark:bg-neutral-800/50 p-4 border-l-4 border-purple-500">
<p className="text-sm font-medium text-purple-600 dark:text-purple-400 mb-1">Send Transaction</p>
<p className="text-neutral-700 dark:text-neutral-300">"Send 1 SEI to 0x742d35Cc6634C0532925a3b8D4C1C4e3153DC"</p>
<p className="text-neutral-700 dark:text-neutral-300">"Send 1 SEI to 0x742d35Cc6634C0532925a3b844De3e9Fe0b5BaDa"</p>
<p className="text-sm text-neutral-600 dark:text-neutral-400 mt-2">→ Executes transfer and returns transaction hash</p>
</div>

Expand Down
50 changes: 25 additions & 25 deletions ai/x402.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
---
x402 Protocol brings HTTP micro payments to Sei, enabling you to monetize APIs, premium content, and digital services with instant, low-cost payments. Whether you're building AI APIs, data feeds, or premium content platforms, x402 makes it simple to add payment gates to any HTTP endpoint.

**Works with Sei's advantages:** Sei's fast finality, low gas fees, and EVM compatibility make it perfect for micro payments. x402 leverages these features to enable seamless payment flows that complete in milliseconds.

Check warning on line 9 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L9

Use 'gas' instead of 'gas fees' (Sei terminology).


<Info>

**Why x402 on Sei?**

- **Fast & Cheap Payments**: Sei's 400ms finality and low gas fees make micropayments practical. Perfect for pay-per-request APIs and streaming content.

Check warning on line 16 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L16

Use 'gas' instead of 'gas fees' (Sei terminology).
- **EVM Compatible**: Use familiar tools like Viem, Ethers.js, and Hardhat. All existing Ethereum tooling works seamlessly on Sei.
- **Built-in Wallet Support**: Integrates with Sei wallets, MetaMask, and any EIP-6963 compatible wallet for smooth user experiences.

</Info>

## Use Cases on Sei

Check warning on line 22 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L22

Use sentence case for headings: 'Use Cases on Sei'.

The x402 protocol enables a wide range of monetization strategies for web services and APIs:

Expand All @@ -32,14 +32,14 @@

The `sei-js` library provides a suite of packages to simplify working with x402 on Sei. You can find more details in the [sei-js x402 repository](https://github.com/sei-protocol/sei-x402).

### Core Concepts

Check warning on line 35 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L35

Use sentence case for headings: 'Core Concepts'.

- [**Protocol Overview**](https://github.com/sei-protocol/sei-x402/blob/main/docs/core-concepts/client-server.md): Learn about the architecture of x402.
- [**Quickstart Guide**](https://github.com/sei-protocol/sei-x402/blob/main/docs/getting-started/quickstart-for-sellers.md): Build your first paid API.
- [**Facilitators**](https://github.com/sei-protocol/sei-x402/blob/main/docs/core-concepts/facilitator.md): Understanding payment facilitators.
- [**Client Integration**](https://github.com/sei-protocol/sei-x402/blob/main/docs/getting-started/quickstart-for-buyers.md): How to integrate x402 in your frontend.

### Available Packages

Check warning on line 42 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L42

Use sentence case for headings: 'Available Packages'.

- [**x402**](https://www.npmjs.com/package/@sei-js/x402): The core protocol implementation.
- [**x402-fetch**](https://www.npmjs.com/package/@sei-js/x402-fetch): A fetch wrapper for making x402-compliant requests.
Expand All @@ -52,23 +52,23 @@

---

# Axiom Kit Integration
## Axiom Kit Integration

Check warning on line 55 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L55

[Sei.Headings] Use sentence case for headings: 'Axiom Kit Integration'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Axiom Kit Integration'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 55, "column": 4}}}, "severity": "WARNING"}

Check warning on line 55 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L55

Use sentence case for headings: 'Axiom Kit Integration'.

While you can build x402 integrations using standard tools and the libraries mentioned above, you can also optionally use Axiom Kit for a more agent-centric approach. This guide demonstrates an end-to-end x402 (HTTP 402 Payment Required) micropayment flow on the Sei testnet using AxiomKit.

## What is x402?
### What is x402?

x402 is an open standard protocol for internet-native payments that enables users to send and receive payments globally in a simple, secure, and interoperable manner. The protocol leverages the HTTP 402 status code ("Payment Required") to facilitate blockchain-based micropayments directly through HTTP requests.

### Key Features of x402:
#### Key Features of x402:

Check warning on line 63 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L63

[Sei.Headings] Use sentence case for headings: 'Key Features of x402:'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Key Features of x402:'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 63, "column": 6}}}, "severity": "WARNING"}

Check warning on line 63 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L63

Use sentence case for headings: 'Key Features of x402:'.

- **HTTP-Native**: Uses standard HTTP status codes and headers
- **Blockchain Integration**: Supports multiple blockchain networks
- **Real-time Settlement**: Enables instant payment verification
- **Interoperable**: Works across different payment schemes and networks
- **Micropayment Support**: Designed for small, frequent transactions

## Protocol Overview
### Protocol Overview

Check warning on line 71 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L71

[Sei.Headings] Use sentence case for headings: 'Protocol Overview'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Protocol Overview'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 71, "column": 5}}}, "severity": "WARNING"}

Check warning on line 71 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L71

Use sentence case for headings: 'Protocol Overview'.

The x402 protocol follows a specific flow:

Expand All @@ -78,22 +78,22 @@
4. **Payment Proof**: Client includes payment proof in subsequent request
5. **Resource Access**: Server verifies payment and grants access

## Axiom Integration
### Axiom Integration

Axiom is a blockchain interaction framework that provides tools and libraries for building decentralized applications. In this implementation, Axiom integrates with x402 to enable seamless blockchain payments within Sei network applications.

### Axiom Components Used:
#### Axiom Components Used:

Check warning on line 85 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L85

[Sei.Headings] Use sentence case for headings: 'Axiom Components Used:'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Axiom Components Used:'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 85, "column": 6}}}, "severity": "WARNING"}

Check warning on line 85 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L85

Use sentence case for headings: 'Axiom Components Used:'.

- **@axiomkit/core**: Core framework for building blockchain agents
- **@axiomkit/sei**: Sei blockchain integration
- **AxiomSeiWallet**: Wallet management for Sei transactions
- **Context and Actions**: Framework for building interactive blockchain agents

## Sei Blockchain Implementation
### Sei Blockchain Implementation

Check warning on line 92 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L92

[Sei.Headings] Use sentence case for headings: 'Sei Blockchain Implementation'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Sei Blockchain Implementation'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 92, "column": 5}}}, "severity": "WARNING"}

Check warning on line 92 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L92

Use sentence case for headings: 'Sei Blockchain Implementation'.

This implementation uses the Sei testnet for x402 payments with the following configuration:

### Network Configuration
#### Network Configuration

Check warning on line 96 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L96

[Sei.Headings] Use sentence case for headings: 'Network Configuration'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Network Configuration'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 96, "column": 6}}}, "severity": "WARNING"}

Check warning on line 96 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L96

Use sentence case for headings: 'Network Configuration'.

```typescript
export const X402_CONFIG = {
Expand All @@ -107,11 +107,11 @@
};
```

## Technical Architecture
### Technical Architecture

Check warning on line 110 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L110

[Sei.Headings] Use sentence case for headings: 'Technical Architecture'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Technical Architecture'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 110, "column": 5}}}, "severity": "WARNING"}

Check warning on line 110 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L110

Use sentence case for headings: 'Technical Architecture'.

The x402 implementation consists of several key components:

### 1. Payment Challenge Generation
#### 1. Payment Challenge Generation

Check warning on line 114 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L114

[Sei.Headings] Use sentence case for headings: '1. Payment Challenge Generation'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '1. Payment Challenge Generation'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 114, "column": 6}}}, "severity": "WARNING"}

Check warning on line 114 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L114

Use sentence case for headings: '1. Payment Challenge Generation'.

```typescript
function generatePaymentChallenge() {
Expand Down Expand Up @@ -142,7 +142,7 @@
}
```

### 2. Payment Verification
#### 2. Payment Verification

Check warning on line 145 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L145

[Sei.Headings] Use sentence case for headings: '2. Payment Verification'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '2. Payment Verification'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 145, "column": 6}}}, "severity": "WARNING"}

Check warning on line 145 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L145

Use sentence case for headings: '2. Payment Verification'.

```typescript
async function verifyPayment(paymentHeader: string) {
Expand All @@ -163,7 +163,7 @@
}
```

### 3. Axiom Agent Integration
#### 3. Axiom Agent Integration

Check warning on line 166 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L166

[Sei.Headings] Use sentence case for headings: '3. Axiom Agent Integration'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '3. Axiom Agent Integration'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 166, "column": 6}}}, "severity": "WARNING"}

Check warning on line 166 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L166

Use sentence case for headings: '3. Axiom Agent Integration'.

The Axiom agent handles the complete x402 flow:

Expand Down Expand Up @@ -201,16 +201,16 @@
});
```

## Payment Flow
### Payment Flow

Check warning on line 204 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L204

[Sei.Headings] Use sentence case for headings: 'Payment Flow'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Payment Flow'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 204, "column": 5}}}, "severity": "WARNING"}

Check warning on line 204 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L204

Use sentence case for headings: 'Payment Flow'.

### 1. Initial Request
#### 1. Initial Request

Check warning on line 206 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L206

[Sei.Headings] Use sentence case for headings: '1. Initial Request'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '1. Initial Request'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 206, "column": 6}}}, "severity": "WARNING"}

Check warning on line 206 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L206

Use sentence case for headings: '1. Initial Request'.

```
Client → GET /api/weather
Server → 402 Payment Required + Payment Challenge
```

### 2. Payment Challenge Response
#### 2. Payment Challenge Response

Check warning on line 213 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L213

[Sei.Headings] Use sentence case for headings: '2. Payment Challenge Response'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '2. Payment Challenge Response'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 213, "column": 6}}}, "severity": "WARNING"}

Check warning on line 213 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L213

Use sentence case for headings: '2. Payment Challenge Response'.

```json
{
Expand All @@ -236,7 +236,7 @@
}
```

### 3. Payment Execution
#### 3. Payment Execution

Check warning on line 239 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L239

[Sei.Headings] Use sentence case for headings: '3. Payment Execution'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '3. Payment Execution'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 239, "column": 6}}}, "severity": "WARNING"}

Check warning on line 239 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L239

Use sentence case for headings: '3. Payment Execution'.

The Axiom agent executes a USDC transfer on Sei testnet:

Expand Down Expand Up @@ -264,16 +264,16 @@
});
```

### 4. Payment Proof Submission
#### 4. Payment Proof Submission

Check warning on line 267 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L267

[Sei.Headings] Use sentence case for headings: '4. Payment Proof Submission'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: '4. Payment Proof Submission'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 267, "column": 6}}}, "severity": "WARNING"}

Check warning on line 267 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L267

Use sentence case for headings: '4. Payment Proof Submission'.

```
Client → GET /api/weather + X-Payment Header (base64 encoded payment proof)
Server → Verifies payment + Returns weather data
```

## Code Examples
### Code Examples

Check warning on line 274 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L274

[Sei.Headings] Use sentence case for headings: 'Code Examples'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Code Examples'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 274, "column": 5}}}, "severity": "WARNING"}

Check warning on line 274 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L274

Use sentence case for headings: 'Code Examples'.

### Complete Weather API Implementation
#### Complete Weather API Implementation

Check warning on line 276 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L276

[Sei.Headings] Use sentence case for headings: 'Complete Weather API Implementation'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Complete Weather API Implementation'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 276, "column": 6}}}, "severity": "WARNING"}

Check warning on line 276 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L276

Use sentence case for headings: 'Complete Weather API Implementation'.

```typescript
export async function GET(req: NextRequest) {
Expand Down Expand Up @@ -309,7 +309,7 @@
}
```

### Axiom Agent Weather Action
#### Axiom Agent Weather Action

Check warning on line 312 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L312

[Sei.Headings] Use sentence case for headings: 'Axiom Agent Weather Action'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Axiom Agent Weather Action'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 312, "column": 6}}}, "severity": "WARNING"}

Check warning on line 312 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L312

Use sentence case for headings: 'Axiom Agent Weather Action'.

```typescript
action({
Expand Down Expand Up @@ -392,29 +392,29 @@
});
```

## Security Considerations
### Security Considerations

Check warning on line 395 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L395

[Sei.Headings] Use sentence case for headings: 'Security Considerations'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Security Considerations'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 395, "column": 5}}}, "severity": "WARNING"}

Check warning on line 395 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L395

Use sentence case for headings: 'Security Considerations'.

### Payment Verification
#### Payment Verification

Check warning on line 397 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L397

[Sei.Headings] Use sentence case for headings: 'Payment Verification'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Payment Verification'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 397, "column": 6}}}, "severity": "WARNING"}

Check warning on line 397 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L397

Use sentence case for headings: 'Payment Verification'.

- **On-chain Verification**: All payments are verified against the Sei blockchain.
- **Transaction Receipt Validation**: Ensures transaction success and proper recipient.
- **Payment Caching**: Prevents double-spending by caching verified payments.
- **Reference Validation**: Unique payment references prevent replay attacks.

### Network Security
#### Network Security

Check warning on line 404 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L404

[Sei.Headings] Use sentence case for headings: 'Network Security'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Network Security'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 404, "column": 6}}}, "severity": "WARNING"}

Check warning on line 404 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L404

Use sentence case for headings: 'Network Security'.

- **HTTPS Required**: All API communications use secure connections.
- **Base64 Encoding**: Payment proofs are base64 encoded for safe transmission.
- **Timeout Handling**: Payment challenges include timeout mechanisms.
- **Error Handling**: Comprehensive error handling prevents information leakage.

### Wallet Security
#### Wallet Security

Check warning on line 411 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L411

[Sei.Headings] Use sentence case for headings: 'Wallet Security'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Wallet Security'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 411, "column": 6}}}, "severity": "WARNING"}

Check warning on line 411 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L411

Use sentence case for headings: 'Wallet Security'.

- **Private Key Management**: Private keys are stored securely in environment variables.
- **Transaction Signing**: All transactions are properly signed before submission.
- **Balance Validation**: Sufficient balance checks before payment execution.

## Tutorials & Resources
### Tutorials & Resources

Check warning on line 417 in ai/x402.mdx

View workflow job for this annotation

GitHub Actions / vale

[vale] ai/x402.mdx#L417

[Sei.Headings] Use sentence case for headings: 'Tutorials & Resources'.
Raw output
{"message": "[Sei.Headings] Use sentence case for headings: 'Tutorials \u0026 Resources'.", "location": {"path": "ai/x402.mdx", "range": {"start": {"line": 417, "column": 5}}}, "severity": "WARNING"}

Check warning on line 417 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

ai/x402.mdx#L417

Use sentence case for headings: 'Tutorials & Resources'.

- **[Sei-js X402 Repository](https://github.com/sei-protocol/sei-x402)**: Comprehensive guide on using the x402 protocol with the sei-js library, including package details and examples.
- **[AxiomKit X402 Demo Repository](https://github.com/AxiomKit/axiomkit-showcase)**: The complete source code for the Axiom integration demo used in this guide, including installation and configuration instructions.
2 changes: 1 addition & 1 deletion evm/ai-tooling/mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<Info>The Sei MCP Server is open source. Contribute at [github.com/sei-protocol/sei-js](https://github.com/sei-protocol/sei-js/tree/main/packages/mcp-server)</Info>

## What is MCP?

Check warning on line 10 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L10

Use sentence case for headings: 'What is MCP?'.

The Model Context Protocol is an open standard that connects AI systems with external tools and data sources. It enables:

Expand All @@ -29,12 +29,12 @@
| Networks | Mainnet • Testnet |


## Setup Guide

Check warning on line 32 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L32

Use sentence case for headings: 'Setup Guide'.

<Tabs>
<Tab title="Cursor">

### Cursor Setup

Check warning on line 37 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L37

Use sentence case for headings: 'Cursor Setup'.

<Steps>

Expand Down Expand Up @@ -69,7 +69,7 @@
</Tab>
<Tab title="Windsurf">

### Windsurf Setup

Check warning on line 72 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L72

Use sentence case for headings: 'Windsurf Setup'.

<Steps>

Expand Down Expand Up @@ -104,7 +104,7 @@
</Tab>
<Tab title="Claude Desktop">

### Claude Desktop Setup

Check warning on line 107 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L107

Use sentence case for headings: 'Claude Desktop Setup'.

<Steps>

Expand Down Expand Up @@ -139,7 +139,7 @@
</Tab>
<Tab title="Claude CLI">

### Claude CLI Setup

Check warning on line 142 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L142

Use sentence case for headings: 'Claude CLI Setup'.

<Steps>

Expand Down Expand Up @@ -168,7 +168,7 @@
</Tab>
</Tabs>

## Private Key Setup

Check warning on line 171 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L171

Use sentence case for headings: 'Private Key Setup'.

<Warning>**Security Notice**: Generate a dedicated wallet for MCP operations. Never use your main wallet's private key.</Warning>

Expand All @@ -182,23 +182,23 @@

The Sei MCP Server enables your AI assistant to:

### Blockchain Operations

Check warning on line 185 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L185

Use sentence case for headings: 'Blockchain Operations'.

- Query account balances and transaction history
- Execute token transfers
- Interact with smart contracts
- Monitor network status

### Coming Soon

Check warning on line 192 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L192

Use sentence case for headings: 'Coming Soon'.

- Documentation search and explanation
- @sei-js library integration
- Boilerplate generation
- DeFi protocol interactions

## Available Tools

Check warning on line 199 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L199

Use sentence case for headings: 'Available Tools'.

### Core Operations

Check warning on line 201 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L201

Use sentence case for headings: 'Core Operations'.

| Tool | Purpose | Example |
| --- | --- | --- |
Expand All @@ -208,7 +208,7 @@
| `is_contract` | Verify contract address | "Is 0x789... a contract?" |


### Token Management

Check warning on line 211 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L211

Use sentence case for headings: 'Token Management'.

| Tool | Purpose | Example |
| --- | --- | --- |
Expand All @@ -218,7 +218,7 @@
| `approve_token_spending` | Token approval | "Approve DEX for USDC" |


### NFT Operations

Check warning on line 221 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L221

Use sentence case for headings: 'NFT Operations'.

| Tool | Purpose | Example |
| --- | --- | --- |
Expand All @@ -228,7 +228,7 @@
| `get_nft_balance` | Collection balance | "How many NFTs do I own?" |


### Blockchain Data

Check warning on line 231 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L231

Use sentence case for headings: 'Blockchain Data'.

| Tool | Purpose | Example |
| --- | --- | --- |
Expand All @@ -239,30 +239,30 @@
| `read_contract` | Contract state | "Read DEX reserves" |


## AI Prompts

Check warning on line 242 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L242

Use sentence case for headings: 'AI Prompts'.

Pre-configured prompts for common tasks:

<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
<div className="bg-white dark:bg-neutral-800/50 p-4 border border-neutral-200 dark:border-neutral-700">
<h4 className="font-medium text-purple-600 dark:text-purple-400 mb-1">my_wallet_address</h4>

Check warning on line 248 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L248

Use sentence case for headings: 'my_wallet_address'.
<p className="text-sm text-neutral-600 dark:text-neutral-400">Get your wallet address</p>
</div>
<div className="bg-white dark:bg-neutral-800/50 p-4 border border-neutral-200 dark:border-neutral-700">
<h4 className="font-medium text-purple-600 dark:text-purple-400 mb-1">explore_block</h4>

Check warning on line 252 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L252

Use sentence case for headings: 'explore_block'.
<p className="text-sm text-neutral-600 dark:text-neutral-400">Analyze block data</p>
</div>
<div className="bg-white dark:bg-neutral-800/50 p-4 border border-neutral-200 dark:border-neutral-700">
<h4 className="font-medium text-purple-600 dark:text-purple-400 mb-1">analyze_transaction</h4>

Check warning on line 256 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L256

Use sentence case for headings: 'analyze_transaction'.
<p className="text-sm text-neutral-600 dark:text-neutral-400">Transaction details</p>
</div>
<div className="bg-white dark:bg-neutral-800/50 p-4 border border-neutral-200 dark:border-neutral-700">
<h4 className="font-medium text-purple-600 dark:text-purple-400 mb-1">analyze_address</h4>

Check warning on line 260 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L260

Use sentence case for headings: 'analyze_address'.
<p className="text-sm text-neutral-600 dark:text-neutral-400">Address analysis</p>
</div>
</div>

## Usage Examples

Check warning on line 265 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L265

Use sentence case for headings: 'Usage Examples'.

<div className="space-y-4 my-6">
<div className="bg-white dark:bg-neutral-800/50 p-4 border-l-4 border-purple-500">
Expand All @@ -273,7 +273,7 @@

<div className="bg-white dark:bg-neutral-800/50 p-4 border-l-4 border-purple-500">
<p className="text-sm font-medium text-purple-600 dark:text-purple-400 mb-1">Send Transaction</p>
<p className="text-neutral-700 dark:text-neutral-300">"Send 1 SEI to 0x742d35Cc6634C0532925a3b8D4C1C4e3153DC"</p>
<p className="text-neutral-700 dark:text-neutral-300">"Send 1 SEI to 0x742d35Cc6634C0532925a3b844De3e9Fe0b5BaDa"</p>
<p className="text-sm text-neutral-600 dark:text-neutral-400 mt-2">→ Executes transfer and returns transaction hash</p>
</div>

Expand Down Expand Up @@ -312,7 +312,7 @@

## Configuration

### Environment Setup

Check warning on line 315 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L315

Use sentence case for headings: 'Environment Setup'.

```bash
# .env file
Expand All @@ -323,7 +323,7 @@
CUSTOM_CHAIN_ID=1329
```

### HTTP Server Mode

Check warning on line 326 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L326

Use sentence case for headings: 'HTTP Server Mode'.

For web applications:

Expand All @@ -335,7 +335,7 @@
const eventSource = new EventSource('http://localhost:3001/sse');
```

## Security Guidelines

Check warning on line 338 in evm/ai-tooling/mcp-server.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/ai-tooling/mcp-server.mdx#L338

Use sentence case for headings: 'Security Guidelines'.

<Warning>
**Security Guidelines:**
Expand Down
2 changes: 1 addition & 1 deletion evm/bridging/layerzero.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This guide provides a comprehensive, step-by-step tutorial for integrating LayerZero V2 with the SEI blockchain. By the end of this guide, you will understand how to create, deploy, and manage omnichain tokens that can seamlessly move between SEI and any other LayerZero-supported blockchain.

### What This Guide Covers

Check warning on line 11 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L11

Use sentence case for headings: 'What This Guide Covers'.

- **Understanding LayerZero**: Core concepts and architecture
- **Project Setup**: Creating a LayerZero-enabled project from scratch
Expand All @@ -20,21 +20,21 @@

- Basic knowledge of Solidity and smart contracts
- Node.js and npm installed
- A wallet with SEI and other chain tokens for gas fees

Check warning on line 23 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L23

Use 'gas' instead of 'gas fees' (Sei terminology).
- Familiarity with Hardhat or Foundry

## What is LayerZero?

Check warning on line 26 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L26

Use sentence case for headings: 'What is LayerZero?'.

LayerZero is an **omnichain interoperability protocol** that enables secure, permissionless communication between different blockchains. Think of it as a universal translator that allows blockchains to talk to each other.

### Core Concepts

Check warning on line 30 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L30

Use sentence case for headings: 'Core Concepts'.

- **Endpoints**: Immutable smart contracts deployed on each blockchain that serve as entry/exit points for messages
- **Messages**: Data packets sent between blockchains containing instructions or information
- **Security Stack**: Customizable verification system ensuring message authenticity
- **Omnichain Applications**: Smart contracts that can operate across multiple blockchains

### Key Applications

Check warning on line 37 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L37

Use sentence case for headings: 'Key Applications'.

- **Omnichain Fungible Tokens (OFT)**: Tokens that exist across multiple chains with unified supply
- **Omnichain NFTs (ONFT)**: NFTs that can move between blockchains
Expand All @@ -42,7 +42,7 @@
- **Unified Governance**: DAOs that function across chains
- **Message Passing**: Send arbitrary data between blockchains

## SEI Network Information

Check warning on line 45 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L45

Use sentence case for headings: 'SEI Network Information'.

<Info>
**SEI Mainnet Configuration**
Expand All @@ -56,7 +56,7 @@

</Info>

### Contract Deployments

Check warning on line 59 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L59

Use sentence case for headings: 'Contract Deployments'.

The following are the official LayerZero V2 protocol contract addresses deployed on Sei networks.

Expand Down Expand Up @@ -108,7 +108,7 @@

</Accordion>

## Step 1: Project Setup

Check warning on line 111 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L111

Use sentence case for headings: 'Step 1: Project Setup'.

### Project scaffold

Expand All @@ -130,7 +130,7 @@

At a minimum, you need to have the `PRIVATE_KEY`. RPC URLs are optional, but strongly recommended. If you don't provide them, public RPCs will be used, but public RPCs can be unreliable or slow, leading to long waiting times for transactions to be confirmed or, at worst, cause your transactions to fail.

## Step 2: Configure Networks

Check warning on line 133 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L133

Use sentence case for headings: 'Step 2: Configure Networks'.

### Hardhat network config

Expand All @@ -154,7 +154,7 @@
}
```

### LayerZero wiring config

Check warning on line 157 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L157

Use sentence case for headings: 'LayerZero wiring config'.

Modify your `layerzero.config.ts` file to include the chains and channel security settings you want for each connection:

Expand Down Expand Up @@ -228,11 +228,11 @@

</Info>

## Step 3: Create Utility Tasks

Check warning on line 231 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L231

Use sentence case for headings: 'Step 3: Create Utility Tasks'.

Before deployment, let's create a utility task for minting tokens that we'll need later.

### Create Minting Task

Check warning on line 235 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L235

Use sentence case for headings: 'Create Minting Task'.

Create `tasks/mint.ts`:

Expand Down Expand Up @@ -267,7 +267,7 @@
});
```

### Update Hardhat Configuration

Check warning on line 270 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L270

Use sentence case for headings: 'Update Hardhat Configuration'.

Now update your `hardhat.config.ts` to import the mint task:

Expand Down Expand Up @@ -349,7 +349,7 @@

<Warning>**Important**: You must create and import the mint task before deployment, otherwise Hardhat will throw an error when trying to resolve the task dependencies during compilation.</Warning>

## Step 4: Smart Contract Development

Check warning on line 352 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L352

Use sentence case for headings: 'Step 4: Smart Contract Development'.

### The token contract

Expand All @@ -369,7 +369,7 @@
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { OFT } from "@layerzerolabs/oft-evm/contracts/OFT.sol";

contract MyOFT is OFT, Ownable {
contract MyOFT is OFT {
constructor(string memory name, string memory symbol, address endpoint, address owner)
OFT(name, symbol, endpoint, owner) Ownable(owner) {}

Expand All @@ -391,7 +391,7 @@

</Warning>

### Understanding OFT Functions

Check warning on line 394 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L394

Use sentence case for headings: 'Understanding OFT Functions'.

Key inherited functions from the OFT contract:

Expand All @@ -403,7 +403,7 @@
| `_lzReceive()` | Internal function that receives messages |


## Step 5: Deployment Process

Check warning on line 406 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L406

Use sentence case for headings: 'Step 5: Deployment Process'.

### Deploy

Expand All @@ -415,7 +415,7 @@

<Warning>Fund your deployer with native gas tokens beforehand.</Warning>

## Step 6: Wire the Contracts

Check warning on line 418 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L418

Use sentence case for headings: 'Step 6: Wire the Contracts'.

After deployment, contracts need to be connected:

Expand All @@ -425,7 +425,7 @@
npx hardhat lz:oapp:wire --oapp-config layerzero.config.ts
```

### Verify Configuration

Check warning on line 428 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L428

Use sentence case for headings: 'Verify Configuration'.

Verify peers:

Expand All @@ -435,7 +435,7 @@

This command will show you the current LayerZero wiring configuration, including the connected chains and their peer addresses.

## Step 7: Mint Initial Tokens

Check warning on line 438 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L438

Use sentence case for headings: 'Step 7: Mint Initial Tokens'.

Before transferring, you need tokens to send. Let's mint some tokens on SEI:

Expand All @@ -444,13 +444,13 @@
npx hardhat mint --to 0xYourAddress --amount 10000 --network sei-mainnet
```

## Step 8: Transfer Tokens Cross-Chain

Check warning on line 447 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L447

Use sentence case for headings: 'Step 8: Transfer Tokens Cross-Chain'.

### Calling send

Since the `send` logic has already been defined, we'll instead view how the function should be called.

#### Option 1: Hardhat Task

Check warning on line 453 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L453

Use sentence case for headings: 'Option 1: Hardhat Task'.

Create `tasks/sendOFT.ts`:

Expand Down Expand Up @@ -554,7 +554,7 @@
--network sei-mainnet
```

#### Option 2: Foundry Script

Check warning on line 557 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L557

Use sentence case for headings: 'Option 2: Foundry Script'.

Create `script/SendOFT.s.sol`:

Expand Down Expand Up @@ -630,11 +630,11 @@
forge script script/SendOFT.s.sol:SendOFT --rpc-url $RPC_URL_SEI --broadcast
```

## Step 9: Done!

Check warning on line 633 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L633

Use sentence case for headings: 'Step 9: Done!'.

You've issued an omnichain token and bridged it from Sei Mainnet to Optimism. Customize supply logic, fees, or add more chains by applying changes to the core contract, redeploying, and repeating the wiring step.

### Track Your Transaction

Check warning on line 637 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L637

Use sentence case for headings: 'Track Your Transaction'.

1. Visit https://layerzeroscan.com/tx/YOUR_TX_HASH
2. You'll see:
Expand All @@ -646,7 +646,7 @@

## Troubleshooting

### Common Issues and Solutions

Check warning on line 649 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L649

Use sentence case for headings: 'Common Issues and Solutions'.

<Danger>
**Quote Send Reverts**
Expand Down Expand Up @@ -699,14 +699,14 @@

</Tip>

## Next Steps

Check warning on line 702 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L702

Use sentence case for headings: 'Next Steps'.

- **Add More Chains**: Expand to Arbitrum, Base, Polygon, etc.
- **Advanced Features**: Implement rate limiting, pausable transfers, fee collection
- **Composed Messages**: Execute actions after token arrival
- **Build a UI**: Create a frontend for easy transfers

### Learn More

Check warning on line 709 in evm/bridging/layerzero.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/bridging/layerzero.mdx#L709

Use sentence case for headings: 'Learn More'.

- See the [Configuring Pathways](https://docs.layerzero.network/v2/get-started/create-lz-oapp/configuring-pathways) section to learn more about managing your OFTs across the entire network mesh.
- See the [Available DVNs](https://docs.layerzero.network/v2/deployments/dvn-addresses?chains=sei) and [Executor](https://docs.layerzero.network/v2/deployments/deployed-contracts?chains=sei) to configure between.
Expand Down
18 changes: 10 additions & 8 deletions evm/building-a-frontend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

</Tip>

## When to Use Each Library

Check warning on line 26 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L26

Use sentence case for headings: 'When to Use Each Library'.

### Ethers.js

Check warning on line 28 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L28

Use sentence case for headings: 'Ethers.js'.

Ethers.js is ideal for developers who want a comprehensive, battle-tested library with straightforward API design. It's great for both simple and complex dApps, especially when you're not using React or need custom state management.

Expand All @@ -38,7 +38,7 @@
- Larger bundle size compared to Viem
- Not specifically designed for React hooks integration

### Viem

Check warning on line 41 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L41

Use sentence case for headings: 'Viem'.

Viem is perfect for developers who want fine-grained control over their blockchain interactions and appreciate a modular, lightweight approach. It's a good choice when bundle size matters and when you have specific requirements for how contract interactions should work.

Expand All @@ -52,7 +52,7 @@
- Requires more boilerplate code for some operations
- Requires separate handling for wallet connection and contract interactions

### Wagmi

Check warning on line 55 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L55

Use sentence case for headings: 'Wagmi'.

Wagmi is the best choice for React developers building dApps who want to leverage React's state management capabilities. It abstracts away much of the complexity of blockchain interactions via hooks, making it easy to build reactive UIs that respond to chain state.

Expand All @@ -73,7 +73,7 @@
- Node.js & NPM installed
- One of the Sei wallets listed [here](/learn/wallets)

## Creating a React Project

Check warning on line 76 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L76

Use sentence case for headings: 'Creating a React Project'.

Start by creating a new React project using Vite's TypeScript template for streamlined development:

Expand All @@ -85,7 +85,7 @@

<Info>This tutorial uses TypeScript. If you're not using TypeScript, you can easily adjust by removing the types.</Info>

## Project Structure

Check warning on line 88 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L88

Use sentence case for headings: 'Project Structure'.

For clarity, we'll create separate components for each library implementation. First, let's set up the project structure:

Expand All @@ -100,7 +100,7 @@
touch src/wagmi.ts
```

## Defining the ERC20 Contract Details

Check warning on line 103 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L103

Use sentence case for headings: 'Defining the ERC20 Contract Details'.

<Info>Make sure to deploy your ERC20 token contract first — for example with [Hardhat](/evm/evm-hardhat) or [Foundry](/evm/evm-foundry), or generate one with the [contract wizard](/evm/evm-wizard) (see also [deploy & verify](/evm/evm-parity/examples/deploy-verify)) — and replace `TOKEN_CONTRACT_ADDRESS` in the constants file with your actual deployed contract address, and update the RPC URL in the Sei chain configuration. You can find a list of existing ERC20 contracts on Sei Mainnet here: [Sei Assets](https://seiscan.io/tokens)</Info>

Expand Down Expand Up @@ -222,7 +222,7 @@
export const TOKEN_CONTRACT_ADDRESS = '0xYourTokenContractAddress';
```

## Option 1: Ethers.js Implementation

Check warning on line 225 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L225

Use sentence case for headings: 'Option 1: Ethers.js Implementation'.

Install ethers.js first:

Expand Down Expand Up @@ -375,7 +375,7 @@
}
```

## Option 2: Viem Implementation

Check warning on line 378 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L378

Use sentence case for headings: 'Option 2: Viem Implementation'.

Install Viem first:

Expand Down Expand Up @@ -553,7 +553,7 @@
}
```

## Option 3: Wagmi Implementation

Check warning on line 556 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L556

Use sentence case for headings: 'Option 3: Wagmi Implementation'.

Install Wagmi and configure it:

Expand Down Expand Up @@ -581,7 +581,7 @@
Now implement the Wagmi interface:

```tsx title="src/components/WagmiInterface.tsx"
import { useState } from 'react';
import { useState, useEffect } from 'react';
import { useAccount, useConnect, useReadContract, useWriteContract, useWaitForTransactionReceipt } from 'wagmi';
import { injected } from 'wagmi/connectors';
import { parseEther, formatEther } from 'viem';
Expand Down Expand Up @@ -654,11 +654,13 @@
};

// Handle successful transfer
if (isConfirmed) {
refetchBalance();
setRecipientAddress('');
setAmount('');
}
useEffect(() => {
if (isConfirmed) {
refetchBalance();
setRecipientAddress('');
setAmount('');
}
}, [isConfirmed, refetchBalance]);

return (
<div className="card">
Expand Down Expand Up @@ -693,7 +695,7 @@
}
```

## Updating the Main App to Display all Implementations

Check warning on line 698 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L698

Use sentence case for headings: 'Updating the Main App to Display all Implementations'.

Now update your `App.tsx` to include all three interface options:

Expand Down Expand Up @@ -751,7 +753,7 @@
export default App;
```

## Polyfills for Browser Environment

Check warning on line 756 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L756

Use sentence case for headings: 'Polyfills for Browser Environment'.

When developing frontend applications for the blockchain, you might need polyfills for Node.js-specific features like `Buffer`. Add these polyfills to your project:

Expand All @@ -776,7 +778,7 @@
);
```

## Running the Application

Check warning on line 781 in evm/building-a-frontend.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/building-a-frontend.mdx#L781

Use sentence case for headings: 'Running the Application'.

To see your app in action, run:

Expand All @@ -792,10 +794,10 @@
npm run build
```

Then deploy via:
Then preview the production build locally:

```bash
npm run preview
```

This will start a local production server, at `http://localhost:4173`. You can toggle between the different library implementations to see how each one works.
This serves the built app at `http://localhost:4173` so you can verify it before deploying. To go live, deploy the contents of the `dist` directory to any static hosting provider.
17 changes: 8 additions & 9 deletions evm/evm-hardhat.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

</Tip>

## Table of Contents

Check warning on line 19 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L19

Use sentence case for headings: 'Table of Contents'.

- [Prerequisites](#prerequisites)
- [Setting Up Your Development Environment](#setting-up-your-development-environment)
Expand All @@ -34,7 +34,7 @@
- [npm](https://www.npmjs.com/) (v7.0.0 or later) or [yarn](https://yarnpkg.com/)
- A code editor (VS Code recommended)

## Setting Up Your Development Environment

Check warning on line 37 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L37

Use sentence case for headings: 'Setting Up Your Development Environment'.

Let's create a new project and set up Hardhat:

Expand Down Expand Up @@ -123,15 +123,11 @@

<Warning>Use a dedicated, throwaway deploy key funded with only what you need — never a personal wallet holding real funds.</Warning>

## Using OpenZeppelin Contracts

Check warning on line 126 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L126

Use sentence case for headings: 'Using OpenZeppelin Contracts'.

OpenZeppelin provides a library of secure, tested smart contract components that you can use to build your applications. First, let's install the OpenZeppelin Contracts package:

```bash
npm install @openzeppelin/contracts
```
OpenZeppelin provides a library of secure, tested smart contract components that you can use to build your applications. The `@openzeppelin/contracts` package was already installed during setup, so you're ready to import its contracts directly.

## Creating and Deploying an ERC20 Token, ERC721 NFT or an Upgradeable UUPS Token

Check warning on line 130 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L130

Use sentence case for headings: 'Creating and Deploying an ERC20 Token, ERC721 NFT or an Upgradeable UUPS Token'.

<Tabs>
<Tab title="ERC20">
Expand Down Expand Up @@ -303,9 +299,12 @@

// Mint an example NFT
console.log('Minting an example NFT...');
const mintTx = await seiNFT.safeMint(deployer.address, '1.json');
await mintTx.wait();
console.log('NFT minted with ID: 1');
const mintTx = await seiNFT.safeMint(deployer.address, '0.json');
const receipt = await mintTx.wait();
// _nextTokenId starts at 0, so the first minted token has ID 0.
// Read the actual ID from the Transfer event:
const transferEvent = receipt.logs.map((log) => seiNFT.interface.parseLog(log)).find((parsed) => parsed?.name === 'Transfer');
console.log('NFT minted with ID:', transferEvent.args.tokenId.toString());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NFT mint log unchecked

Low Severity

The deploy script logs transferEvent.args.tokenId without checking that a Transfer log was parsed, so a missing or unparsed event causes a runtime throw instead of a clear message.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 714fca6. Configure here.

```

Deploy the NFT contract to the Sei testnet:
Expand Down Expand Up @@ -493,7 +492,7 @@
</Tab>
</Tabs>

## Testing Your Smart Contracts

Check warning on line 495 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L495

Use sentence case for headings: 'Testing Your Smart Contracts'.

Hardhat makes it easy to test your contracts before deploying them. Create a test file `test/sei-token-test.ts`:

Expand Down Expand Up @@ -577,12 +576,12 @@
npx hardhat test
```

## Deploying to Sei Testnet and Mainnet

Check warning on line 579 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L579

Use sentence case for headings: 'Deploying to Sei Testnet and Mainnet'.

Once you've tested your contracts, you can deploy them to the Sei testnet or mainnet. To deploy, you'll need:

1. SEI tokens in your wallet for gas fees

Check warning on line 583 in evm/evm-hardhat.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-hardhat.mdx#L583

Use 'gas' instead of 'gas fees' (Sei terminology).
2. Your private key in the `.env` file
2. Your private key stored in the encrypted keystore (`npx hardhat keystore set SEI_PRIVATE_KEY`) — or exported as a `SEI_PRIVATE_KEY` environment variable in CI

Deploy to the testnet:

Expand Down
53 changes: 33 additions & 20 deletions evm/evm-parity/examples/deploy-verify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
description: 'Deploying and verifying smart contracts on Sei with viem, ethers, Foundry, and Hardhat'
---

# Deploy and Verify

Check warning on line 6 in evm/evm-parity/examples/deploy-verify.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-parity/examples/deploy-verify.mdx#L6

Use sentence case for headings: 'Deploy and Verify'.

Sei is EVM-compatible — standard deployment tooling works without modification. This page covers deploying a contract and verifying its source on the Sei block explorer.

Expand Down Expand Up @@ -68,36 +68,42 @@

## Deploying with Hardhat

Add Sei networks to your `hardhat.config.ts`:
Add Sei networks to your `hardhat.config.ts` (Hardhat 3):

```ts
import { HardhatUserConfig } from 'hardhat/config';
import { defineConfig, configVariable } from 'hardhat/config';

const config: HardhatUserConfig = {
export default defineConfig({
networks: {
sei: {
url: 'https://evm-rpc.sei-apis.com',
type: 'http',
chainId: 1329,
accounts: [process.env.PRIVATE_KEY!],
url: 'https://evm-rpc.sei-apis.com',
accounts: [configVariable('SEI_PRIVATE_KEY')],
},
seiTestnet: {
url: 'https://evm-rpc-testnet.sei-apis.com',
type: 'http',
chainId: 1328,
accounts: [process.env.PRIVATE_KEY!],
url: 'https://evm-rpc-testnet.sei-apis.com',
accounts: [configVariable('SEI_PRIVATE_KEY')],
},
},
};
});
```

export default config;
Store your private key in Hardhat's encrypted keystore so it never lives in a plaintext file:

```bash
npx hardhat keystore set SEI_PRIVATE_KEY
```

Then deploy:
Then deploy with Hardhat Ignition:

```bash
npx hardhat run scripts/deploy.ts --network sei
npx hardhat ignition deploy ignition/modules/MyContract.ts --network sei
```

## Verifying Contracts

Check warning on line 106 in evm/evm-parity/examples/deploy-verify.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-parity/examples/deploy-verify.mdx#L106

Use sentence case for headings: 'Verifying Contracts'.

Sei's block explorer is [Seiscan](https://seiscan.io). The recommended verification method is [Sourcify](https://sourcify.dev/) — no API key required.

Expand Down Expand Up @@ -134,28 +140,33 @@
npm install --save-dev @nomicfoundation/hardhat-verify
```

Add it to `hardhat.config.ts` — no additional Sourcify config block is needed:
Add it to the `plugins` array in `hardhat.config.ts` — Sourcify verification is enabled by default in `hardhat-verify` and needs no API key:

```ts
import '@nomicfoundation/hardhat-verify';
import { defineConfig, configVariable } from 'hardhat/config';
import hardhatVerify from '@nomicfoundation/hardhat-verify';

const config: HardhatUserConfig = {
export default defineConfig({
networks: {
sei: {
url: 'https://evm-rpc.sei-apis.com',
type: 'http',
chainId: 1329,
accounts: [process.env.PRIVATE_KEY!],
url: 'https://evm-rpc.sei-apis.com',
accounts: [configVariable('SEI_PRIVATE_KEY')],
},
seiTestnet: {
url: 'https://evm-rpc-testnet.sei-apis.com',
type: 'http',
chainId: 1328,
accounts: [process.env.PRIVATE_KEY!],
url: 'https://evm-rpc-testnet.sei-apis.com',
accounts: [configVariable('SEI_PRIVATE_KEY')],
},
},
};

plugins: [hardhatVerify],
});
```

Verify a deployed contract:
Verify a deployed contract on Sourcify:

```bash
npx hardhat verify sourcify --network sei 0xDeployedContractAddress
Expand All @@ -167,7 +178,9 @@
npx hardhat verify sourcify --network sei 0xDeployedContractAddress "arg1" "arg2"
```

Running `npx hardhat verify` without the `sourcify` subtask attempts verification on all enabled providers (Etherscan, Blockscout, and Sourcify) simultaneously.

## Network Reference

Check warning on line 183 in evm/evm-parity/examples/deploy-verify.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

evm/evm-parity/examples/deploy-verify.mdx#L183

Use sentence case for headings: 'Network Reference'.

| Network | Chain ID | RPC | Explorer |
| --- | --- | --- | --- |
Expand Down
Loading
Loading