Skip to content
Closed
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
74 changes: 56 additions & 18 deletions packages/precompiles/src/viem/__tests__/chain.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,58 @@
import { seiLocal } from '../chain';
import { seiLocal, seiMainnet, seiTestnet } from "../chain";

describe('seiLocal chain', () => {
it('should be a valid chain definition', () => {
expect(seiLocal).toMatchObject({
id: 713714,
name: 'Sei Local',
nativeCurrency: {
name: 'Sei',
symbol: 'SEI',
decimals: 18
},
rpcUrls: {
default: {
http: ['http://localhost:8545']
}
}
});
});
describe("seiLocal chain", () => {
it("should be a valid chain definition", () => {
expect(seiLocal).toMatchObject({
id: 713714,
name: "Sei Local",
nativeCurrency: {
name: "Sei",
symbol: "SEI",
decimals: 18,
},
rpcUrls: {
default: {
http: ["http://localhost:8545"],
},
},
});
});
});

describe("seiTestnet chain", () => {
it("should be a valid chain definition", () => {
expect(seiTestnet).toMatchObject({
id: 1328,
name: "Sei Testnet",
nativeCurrency: {
name: "Sei",
symbol: "SEI",
decimals: 18,
},
rpcUrls: {
default: {
http: ["https://evm-rpc-testnet.sei-apis.com"],
},
},
});
});
});

describe("seiMainnet chain", () => {
it("should be a valid chain definition", () => {
expect(seiMainnet).toMatchObject({
id: 1329,
name: "Sei Mainnet",
nativeCurrency: {
name: "Sei",
symbol: "SEI",
decimals: 18,
},
rpcUrls: {
default: {
http: ["https://evm-rpc.sei-apis.com"],
},
},
});
});
});
40 changes: 31 additions & 9 deletions packages/precompiles/src/viem/chain.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,38 @@
import { defineChain } from 'viem';
import { defineChain } from "viem";

/**
* The Viem chain definition for the Sei local chain.
* @category Chain
*/
export const seiLocal = defineChain({
id: 713714,
name: 'Sei Local',
nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
rpcUrls: {
default: {
http: ['http://localhost:8545']
}
}
id: 713714,
name: "Sei Local",
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
rpcUrls: {
default: {
http: ["http://localhost:8545"],
},
},
});

export const seiTestnet = defineChain({
id: 1328,
name: "Sei Testnet",
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
rpcUrls: {
default: {
http: ["https://evm-rpc-testnet.sei-apis.com"],
},
},
});

export const seiMainnet = defineChain({
id: 1329,
name: "Sei Mainnet",
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
rpcUrls: {
default: {
http: ["https://evm-rpc.sei-apis.com"],
},
},
});