Skip to content

Commit 96d9e1c

Browse files
feat!: limit Sei chain support to mainnet and testnet (#328)
* feat(precompiles): export Sei chain definitions Expose canonical Viem mainnet and testnet chains plus a stable devnet definition through the package's public entrypoints. Co-authored-by: Cursor <cursoragent@cursor.com> * feat!: remove Sei devnet support Limit public chain configuration to mainnet and testnet, and update Viem to the supported baseline. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: harden supported network configuration Mark the Viem peer-floor change as major and derive registry filtering from the shared chain ID map. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 29311bc commit 96d9e1c

37 files changed

Lines changed: 211 additions & 224 deletions

File tree

.changeset/migrate-monorepo-to-bun.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ Migrate the monorepo to Bun and publish ESM-only packages.
1010

1111
**Breaking:** all packages drop CommonJS (`require`) entry points and flatten `dist/`. Consumers must use ESM `import`. `@sei-js/precompiles` now ships an `exports` map with working `./ethers`, `./viem`, and `./precompiles` subpaths. `@sei-js/sei-global-wallet` keeps the `./solana` entrypoint.
1212

13-
Install, build, and test with Bun (`bun install`, `bun run build`, `bun run test`). `@sei-js/mcp-server` now requires Node.js 20 or newer. The MCP server and precompiles development toolchain pin Viem to `2.37.2`, the last compatible release that includes `seiDevnet`. Generated apps target the new `@sei-js/precompiles` major. Packages continue to publish to npm via Changesets.
13+
Install, build, and test with Bun (`bun install`, `bun run build`, `bun run test`). `@sei-js/mcp-server` now requires Node.js 20 or newer. The MCP server and precompiles development toolchain use Viem 2.55.16. Generated apps target the new `@sei-js/precompiles` major. Packages continue to publish to npm via Changesets.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sei-js/precompiles': major
3+
---
4+
5+
Export Viem's canonical Sei mainnet and testnet definitions from the package root and `viem` entrypoint. Viem 2.55.16 or newer is now required.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@sei-js/mcp-server': major
3+
'@sei-js/registry': major
4+
---
5+
6+
Remove Sei devnet support. The MCP server no longer accepts `sei-devnet`, chain ID `713715`, or `DEVNET_RPC_URL`. Registry exports now contain only `pacific-1` and `atlantic-2`, and `CHAIN_IDS.devnet` has been removed.

REVIEW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ invariants are load-bearing and are enforced in code rather than by convention:
3232
Beyond those, scrutinise anything that widens what a caller controls: contract
3333
ABIs reach `JSON.parse` from tool arguments in `src/core/tools.ts`, addresses
3434
and call arguments arrive unvalidated from the model, and RPC endpoints are
35-
overridable through `MAINNET_RPC_URL` / `TESTNET_RPC_URL` / `DEVNET_RPC_URL` in
36-
`src/core/chains.ts`. Private keys are read from the environment in
35+
overridable through `MAINNET_RPC_URL` / `TESTNET_RPC_URL` in `src/core/chains.ts`.
36+
Private keys are read from the environment in
3737
`src/core/config.ts` and must never reach a log line, an error message, or a
3838
tool response.
3939

bun.lock

Lines changed: 7 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/create-sei/templates/next-template/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Chain configuration
2-
# Options: mainnet, testnet, devnet
2+
# Options: mainnet, testnet
33
# Defaults to mainnet if not set; this example overrides it to testnet
44
NEXT_PUBLIC_CHAIN=testnet
55

packages/create-sei/templates/next-template/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ In addition, this app uses [RainbowKit](https://www.rainbowkit.com/docs/wallet-b
3434
To change the list of supported wallets, as well as connection configurations you can modify the `src/app/components/Web3Provider.tsx` component.
3535

3636
### Changing the Chain
37-
This application connects to the arctic-1 devnet by default, using chain configurations uploaded to viem.
37+
This application connects to Sei mainnet by default.
3838

39-
To change the chain the app connects to, edit the `selectedChain` variable in the `chain.ts` file in `src/app/constants`
39+
Set `NEXT_PUBLIC_CHAIN=testnet` in `.env.local` to use Sei testnet. The chain selection logic is in `src/components/providers/providers.tsx`.
4040

4141
## Learn More
4242

packages/create-sei/templates/next-template/src/app/development/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ export default function DevelopmentPage() {
109109
<Code block>
110110
{`# .env.local
111111
NEXT_PUBLIC_CHAIN=mainnet # Default: Sei Pacific-1
112-
# NEXT_PUBLIC_CHAIN=testnet # Sei Atlantic-2
113-
# NEXT_PUBLIC_CHAIN=devnet # Sei Devnet`}
112+
# NEXT_PUBLIC_CHAIN=testnet # Sei Atlantic-2`}
114113
</Code>
115114
</Paper>
116115
<Text size="sm" c="gray.6">

packages/create-sei/templates/next-template/src/components/providers/providers.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,8 @@ import { type ReactNode, useMemo } from "react";
99
import { createConfig, http, WagmiProvider } from "wagmi";
1010

1111
import "@rainbow-me/rainbowkit/styles.css";
12-
import { defineChain } from "viem";
1312
import { sei, seiTestnet } from "viem/chains";
1413

15-
const seiDevnet = defineChain({
16-
id: 713715,
17-
name: "Sei Devnet",
18-
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
19-
rpcUrls: {
20-
default: {
21-
http: ["https://evm-rpc-arctic-1.sei-apis.com"],
22-
},
23-
},
24-
blockExplorers: {
25-
default: {
26-
name: "Seitrace",
27-
url: "https://seitrace.com",
28-
},
29-
},
30-
testnet: true,
31-
});
32-
3314
const queryClient = new QueryClient();
3415

3516
const connectors = connectorsForWallets(
@@ -56,8 +37,6 @@ export default function Providers({ children }: ProvidersProps) {
5637
switch (chainName.toLowerCase()) {
5738
case "testnet":
5839
return seiTestnet;
59-
case "devnet":
60-
return seiDevnet;
6140
default:
6241
return sei;
6342
}
@@ -73,7 +52,6 @@ export default function Providers({ children }: ProvidersProps) {
7352
transports: {
7453
[sei.id]: http(),
7554
[seiTestnet.id]: http(),
76-
[seiDevnet.id]: http(),
7755
},
7856
ssr: true,
7957
}),

packages/mcp-server/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ SERVER_PATH=/mcp
2121
# Optional, only needed if you want to use a custom RPC URL
2222
MAINNET_RPC_URL=your_mainnet_rpc_url_here
2323
TESTNET_RPC_URL=your_testnet_rpc_url_here
24-
DEVNET_RPC_URL=your_devnet_rpc_url_here

0 commit comments

Comments
 (0)