diff --git a/.changeset/great-jars-marry.md b/.changeset/great-jars-marry.md
new file mode 100644
index 000000000..c6c136349
--- /dev/null
+++ b/.changeset/great-jars-marry.md
@@ -0,0 +1,5 @@
+---
+"@sei-js/precompiles": minor
+---
+
+Rename @sei-js/evm to @sei-js/precompiles
diff --git a/.gitignore b/.gitignore
index f34a74843..3ed30996a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
# testing
packages/*/coverage
+examples/
# compiled output
dist
diff --git a/README.md b/README.md
index 7d9ab025a..6c1260124 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ please refer to the table below.
| Package | Description |
|---------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
-| [@sei-js/evm](packages/evm) | Typescript library containing helper functions for interacting with the EVM on Sei. |
+| [@sei-js/precompiles](packages/precompiles) | Typescript library containing helper functions for interacting with Sei's precompile contracts. |
| [@sei-js/create-sei](packages/create-sei) | CLI Tool used to quickly spin up Sei Projects and dApps in either the cosmos or EVM ecosystem |
| [@sei-js/mcp-server](packages/mcp-server) | MCP server for interacting with Sei via LLM's and agents |
| [@sei-js/sei-global-wallet](packages/sei-global-wallet) | A global wallet conforming to EIP-6963 allowing for AA across dApps. |
diff --git a/codecov.yml b/codecov.yml
index 44d486387..2e11accce 100644
--- a/codecov.yml
+++ b/codecov.yml
@@ -2,9 +2,9 @@ flags:
create-sei:
paths:
- packages/create-sei/**
- evm:
+ precompiles:
paths:
- - packages/registry/**
+ - packages/precompiles/**
ledger:
paths:
- packages/ledger/**
@@ -21,10 +21,10 @@ coverage:
target: 80%
flags:
- create-sei
- evm:
+ precompiles:
target: 80%
flags:
- - evm
+ - precompiles
ledger:
target: 80%
flags:
diff --git a/packages/create-sei/package.json b/packages/create-sei/package.json
index 383b79c0b..7eda2baab 100644
--- a/packages/create-sei/package.json
+++ b/packages/create-sei/package.json
@@ -6,7 +6,8 @@
"bin": "./dist/main.js",
"scripts": {
"build": "tsc && cp -r ./templates ./dist/templates",
- "dev": "node --loader ts-node/esm src/main.ts"
+ "dev": "node --loader ts-node/esm src/main.ts",
+ "docs": "typedoc --out docs"
},
"dependencies": {
"boxen": "^7.1.1",
diff --git a/packages/create-sei/tsconfig.json b/packages/create-sei/tsconfig.json
index 86b7187f0..ed06d9e8a 100644
--- a/packages/create-sei/tsconfig.json
+++ b/packages/create-sei/tsconfig.json
@@ -15,5 +15,11 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
- "include": ["src"]
+ "include": ["src"],
+ "typedocOptions": {
+ "readme": "./README.md",
+ "name": "create-sei",
+ "entryPoints": ["src/main.ts"],
+ "exclude": ["node_modules"]
+ }
}
diff --git a/packages/evm/README.md b/packages/evm/README.md
deleted file mode 100644
index 217b237bc..000000000
--- a/packages/evm/README.md
+++ /dev/null
@@ -1,270 +0,0 @@
-# @sei-js/evm
-
-Typescript library containing helper functions for interacting with the EVM on Sei.
-
-## Installation
-
-```bash
-yarn add @sei-js/evm ethers viem
-```
-
-
-
-
-## Wallet Connection
-This package provides exports for easily interacting with wagmi, viem, and ethers.js. You can interact with the Sei EVM using all the same hooks and helper functions these tools offer. Read the [Wagmi]('https://wagmi.sh/), [viem]('https://viem.sh/'), and [ethers v6]('https://docs.ethers.org/v6/) documentation for more information on how to use these tools.
-
-### Wallet network setup
-Ensure that your EVM wallet has the Sei network enabled. Learn more on how to [set up your wallet]('https://v2.docs.sei.io/setting-up-a-wallet').
-
-
-
-### Connection with Wagmi
-The WagmiProvider is a React context provider that allows you to easily interact with the EVM. It provides many useful hooks for reading and writing on Sei via the EVM JSON-RPC.
-```tsx
-import { ReactNode } from 'react';
-import { WagmiProvider } from 'wagmi';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { ARCTIC_1_VIEM_CHAIN, createWagmiConfig } from '@sei-js/evm';
-
-const queryClient = new QueryClient();
-
-export const WalletProvider = ({ children }: { children: ReactNode }) => {
- return (
-
- {children}
-
- );
-};
-```
-
-
-
-### Connection with ethers v6
-The 'ethers' package is a popular library for interacting with the Ethereum blockchain. This package provides a helper function for creating an ethers provider that is connected to the Sei EVM.
-```tsx
-import { ADDRESS_PRECOMPILE_ADDRESS } from '@sei-js/evm';
-import { ethers } from 'ethers';
-
-const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
-const signer = await provider.getSigner();
-
-const accounts = await provider.send('eth_requestAccounts', []);
-
-const contract = getAddressPrecompileEthersV6Contract(ADDRESS_PRECOMPILE_ADDRESS, signer);
-
-const cosmosAddress = await contract.getSeiAddr(accounts[0]);
-```
-
-
-
-### Usage with viem
-This package exports `viem` Chains and precompile ABI's for Sei. The ABI used in the ethers example above is a viem ABI instance and the `ARCTIC_1_VIEM_CHAIN` is a `viem Chain` instance.
-
-
-
-
-
-## Utils
-This package also exports a set of utility functions for interacting with the EVM on Sei.
-
-### `parseSei`
-Parses an amount of Sei to the smallest unit of Sei (uSei).
-```ts
-import { parseSei } from '@sei-js/evm';
-
-const amount = parseSei('1000000');
-console.log(amount); // 1000000000000000000
-```
-
-
-
-
-## Interoperability with Cosmos
-Sei v2 supports both EVM JSON-RPC and Cosmos RPC interfaces. In order to easily interact with certain Cosmos modules, Sei v2 has a set of precompiled contracts that can be called from the EVM.
-
-| Precompile | Description |
-|---------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
-| [Address Precompile](#address-precompile) | Enables the retrieval of associated EVM addresses for given Cosmos addresses and vice versa. |
-| [Bank Precompile](#bank-precompile) | Provides functionalities for managing balances, supply, symbols, and more. |
-| [Confidential Transfers Precompile](#confidential-transfers-precompile) | Used for interacting with the Confidential Transfers module. |
-| [Distribution Precompile](#distribution-precompile) | Facilitates operations related to rewards withdrawal and distribution. |
-| [Governance Precompile](#governance-precompile) | Supports actions such as depositing funds into proposals and voting. |
-| [JSON Precompile](#json-precompile) | Facilitates interoperability between the EVM and Cosmos. |
-| [Staking Precompile](#staking-precompile) | Enables staking functionalities like delegation and undelegation. |
-| [WASM Precompile](#wasm-precompile) | Provides functionalities for executing WebAssembly (WASM) code. |
-
-
-
-### Interoperability using Wagmi, viem, and ethers
-Each precompile has contract exports a typed 'ethers' contracts and provides the ABI and contract addresses for each precompile for usage with Wagmi and viem.
-
-
-
-
-
-### Address Precompile
-
-The Address precompile contract enables the retrieval of associated EVM addresses for given Cosmos addresses and vice versa.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|----------------------------------------------------------------------------------------|-------------------|------------------------|------------------------------------------------------------------|
-| [`getEvmAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getEvmAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated EVM address for a given Cosmos address. |
-| [`getSeiAddr`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#getSeiAddr) | `addr: ` `string` | `{ response: string }` | Retrieves the associated Cosmos address for a given EVM address. |
-| [`associate`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associate) | `v: ` `string`, `r: ` `string`, `s: ` `string`, `customMessage: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Sei Native address on chain using a signature. |
-| [`associatePubKey`](/sei-js/docs/interfaces/evm.AddressPrecompileFunctions.html#associatePubKey) | `pubKeyHex: ` `string` | `{ response: string }` | Associates an EVM address with it's corresponding Cosmos address on chain using the Hex-Encoded compressed pubkey (excluding the '0x'). |
-
-
-#### Precompile Address
-0x0000000000000000000000000000000000001004
-
-
-
-
-### Bank Precompile
-
-The Bank precompile contract provides functionalities for managing balances, supply, symbols, and more.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|------------------------|----------------------------------------------------------------------------|
-| [`balance`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#balance) | `acc: ` `string`, `denom: ` `string` | `{ amount: string }` | Retrieves the balance of the specified account for the given denomination. |
-| [`decimals`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#decimals) | `denom: ` `string` | `{ response: string }` | Retrieves the number of decimal places for the specified denomination. |
-| [`name`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#name) | `denom: ` `string` | `{ response: string }` | Retrieves the name of the specified denomination. |
-| [`send`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#send) | `fromAddress: ` `string`, `toAddress: ` `string`, `denom: ` `string`, `amount: ` `number` | `{ success: boolean }` | Sends tokens from one address to another. |
-| [`supply`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#supply) | `denom: ` `string` | `{ response: string }` | Retrieves the total supply of tokens for the specified denomination. |
-| [`symbol`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#symbol) | `denom: ` `string` | `{ response: string }` | Retrieves the symbol of the specified denomination. |
-| [`sendNative`](/sei-js/docs/interfaces/evm.BankPrecompileFunctions.html#sendNative) | `toNativeAddress: ` `string`, `value: ` `string` | `{ success: boolean }` | Sends native tokens to a specified address. |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001001
-
-
-
-
-### Confidential Transfers Precompile
-
-The Confidential Transfers precompile contract provides functionalities for interacting with the Confidential Transfers module, including depositing, withdrawing, and transferring confidential balances.
-
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
-| `initializeAccount` | `fromAddress: string`, `denom: string`, `publicKey: bytes`, `decryptableBalance: string`, `pendingBalanceLo: bytes`, `pendingBalanceHi: bytes`, `availableBalance: bytes`, `proofs: bytes` | `{ success: boolean }` | Initializes a confidential account with balances, public key, and ZK proofs. |
-| `transfer` | `toAddress: string`, `denom: string`, `fromAmountLo: bytes`, `fromAmountHi: bytes`, `toAmountLo: bytes`, `toAmountHi: bytes`, `remainingBalance: bytes`, `decryptableBalance: string`, `proofs: bytes` | `{ success: boolean }` | Transfers funds confidentially from sender to receiver. |
-| `transferWithAuditors` | All `transfer` inputs + `auditors: Auditor[]` where each Auditor contains: `auditorAddress`, `encryptedTransferAmountLo`, `encryptedTransferAmountHi`, `transferAmountLoValidityProof`, `transferAmountHiValidityProof`, `transferAmountLoEqualityProof`, `transferAmountHiEqualityProof` | `{ success: boolean }` | Transfers funds with ZK auditor verification data. |
-| `deposit` | `denom: string`, `amount: uint64` | `{ success: boolean }` | Deposits tokens into the confidential account. |
-| `applyPendingBalance` | `denom: string`, `decryptableBalance: string`, `pendingBalanceCreditCounter: uint32`, `availableBalance: bytes` | `{ success: boolean }` | Applies previously received pending balance to the account. |
-| `withdraw` | `denom: string`, `amount: uint256`, `decryptableBalance: string`, `remainingBalanceCommitment: bytes`, `proofs: bytes` | `{ success: boolean }` | Withdraws funds from a confidential account. |
-| `closeAccount` | `denom: string`, `proofs: bytes` | `{ success: boolean }` | Closes a confidential account using ZK proofs. |
-| `account` | `addr: string`, `denom: string` | `{ ctAccount: { publicKey: bytes; pendingBalanceLo: bytes; pendingBalanceHi: bytes; pendingBalanceCreditCounter: uint32; availableBalance: bytes; decryptableAvailableBalance: string } }` | Retrieves confidential account state. |
-
-#### Precompile Address
-`0x0000000000000000000000000000000000001010`
-
-
-
-
-### Distribution Precompile
-
-The Distribution precompile contract facilitates operations related to rewards withdrawal and distribution.
-
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [`setWithdrawAddress`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#setWithdrawAddress) | `withdrawAddress: ` `string` | `{ success: boolean }` | Sets the withdrawal address for rewards. |
-| [`withdrawDelegationRewards`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#withdrawDelegationRewards) | `validator: ` `string` | `{ success: boolean }` | Withdraws delegation rewards for a given validator. |
-| [`withdrawMultipleDelegationRewards`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#withdrawMultipleDelegationRewards) | `validators: ` `string[]` | `{ success: boolean }` | Withdraws delegation rewards for given validators. |
-| [`rewards`](/sei-js/docs/interfaces/evm.DistributionPrecompileFunctions.html#rewards) | `delegatorAddress: ` `address` | `{ rewards: Rewards }` | Queries rewards available for a given delegator address. Rewards are usually returned as decimals. To calculate the actual amount, divide the amount by decimals. |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001007
-
-
-
-
-### Governance Precompile
-
-The Governance precompile contract supports actions to deposit funds into proposals and vote on them.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|-------------------------------------------------------------------------------------|----------------------------------------------|------------------------|--------------------------------------------|
-| [`deposit`](/sei-js/docs/interfaces/evm.GovernancePrecompileFunctions.html#deposit) | `proposalID: ` `string` | `{ success: boolean }` | Deposits funds into a governance proposal. |
-| [`vote`](/sei-js/docs/interfaces/evm.GovernancePrecompileFunctions.html#vote) | `proposalID: ` `string`, `option: ` `string` | `{ success: boolean }` | Votes on a governance proposal. |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001006
-
-
-
-
-### JSON Precompile
-
-The JSON precompile contract facilitates interoperability between the EVM and Cosmos by providing functions to extract data in various formats.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|-----------------------------------------------------------------------------------------------------|--------------------------------------|--------------------------|--------------------------------------------------------------------------|
-| [`extractAsBytes`](/sei-js/docs/interfaces/evm.JSONPrecompileFunctions.html#extractAsBytes) | `input: ` `string`, `key: ` `string` | `{ response: string }` | Extracts data as bytes from the input using the specified key. |
-| [`extractAsBytesList`](/sei-js/docs/interfaces/evm.JSONPrecompileFunctions.html#extractAsBytesList) | `input: ` `string`, `key: ` `string` | `{ response: string[] }` | Extracts data as a list of bytes from the input using the specified key. |
-| [`extractAsUint256`](/sei-js/docs/interfaces/evm.JSONPrecompileFunctions.html#extractAsUint256) | `input: ` `string`, `key: ` `string` | `{ response: string }` | Extracts data as a uint256 from the input using the specified key. |
-
-#### Precompile Addresses
-- [arctic-1](/sei-js/docs/variables/evm.JSON_PRECOMPILE_ADDRESS.html)
-
-
-
-
-### Staking Precompile
-
-The Staking precompile contract provides functions for delegation, re-delegation, and un-delegation staking operations.
-
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|----------------------------------------------------------------------------------------|-----------------------------------------------------------------------|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [`delegate`](/sei-js/docs/interfaces/evm.StakingPrecompileFunctions.html#delegate) | `valAddress: ` `string` | `{ success: boolean }` | Delegates tokens to the specified validator. |
-| [`redelegate`](/sei-js/docs/interfaces/evm.StakingPrecompileFunctions.html#redelegate) | `srcAddress: ` `string`, `dstAddress: ` `string`, `amount: ` `string` | `{ success: boolean }` | Redelegates tokens from the source validator to the destination validator. |
-| [`undelegate`](/sei-js/docs/interfaces/evm.StakingPrecompileFunctions.html#undelegate) | `valAddress: ` `string`, `amount: ` `string` | `{ success: boolean }` | Undelegates tokens from the specified validator. |
-| [`delegation`](/sei-js/docs/interfaces/evm.StakingPrecompileFunctions.html#delegation) | `delegator`: `address`, `valAddress: ` `string` | `{ delegation: Delegation }` | Queries delegation by delegator and validator address. Shares in DelegationDetails are usually returned as decimals. To calculate the actual amount, divide the shares by decimals. |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001005
-
-
-
-
-### WASM Precompile
-
-The WASM precompile contract facilitates execution, instantiation, and querying of WebAssembly (WASM) contracts on the Sei platform.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------|---------------------------------------------------------------------------|
-| [`execute`](/sei-js/docs/interfaces/evm.WasmPrecompileFunctions.html#execute) | `contractAddress: ` `string`, `msg: ` `Uint8Array`, `coins: ` `Uint8Array` | `{ response: Uint8Array }` | Executes a message on the specified contract with provided coins. |
-| [`instantiate`](/sei-js/docs/interfaces/evm.WasmPrecompileFunctions.html#instantiate) | `codeID: ` `string`, `admin: ` `string`, `msg: ` `Uint8Array`, `label: ` `string`, `coins: ` `Uint8Array` | `{ contractAddr: string; data: Uint8Array }` | Instantiates a new contract with the specified code ID, admin, and coins. |
-| [`query`](/sei-js/docs/interfaces/evm.WasmPrecompileFunctions.html#query) | `contractAddress: ` `string`, `req: ` `Uint8Array` | `{ response: Uint8Array }` | Queries the specified contract with the provided request. |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001002
-
-
-
-
-
-### IBC Precompile
-
-The IBC precompile contract facilitates messages exchange between Sei and other IBC compatible blockchains.
-#### Functions
-
-| Function Name | Input Parameters | Return Value | Description |
-|------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| [`transfer`](/sei-js/docs/interfaces/evm.IbcPrecompileFunctions.html#transfer) | `toAddress: ` `string`, `port: ` `string`, `channel: ` `string`, `denom: ` `string`, `amount: ` `ethers.BigNumberish`, `revisionNumber: ` `BigInt`, `revisionHeight: ` `BigInt`, `timeoutTimestamp: ` `BigInt`, `memo: ` `String` | `{ success: boolean }` | Transfers tokens from the caller's address to another on a different (IBC compatible) chain. |
-| [`transferWithDefaultTimeout`](/sei-js/docs/interfaces/evm.IbcPrecompileFunctions.html#transferWithDefaultTimeout) | `toAddress: ` `string`, `port: ` `string`, `channel: ` `string`, `denom: ` `string`, `amount: ` `ethers.BigNumberish`, `memo: ` `String` | `{ success: boolean }` | Transfers tokens from the caller's address to another on a different (IBC compatible) chain. Calculates default timeout height as opposed to `transfer` function |
-
-#### Precompile Addresses
-0x0000000000000000000000000000000000001009
-
diff --git a/packages/ledger/tsconfig.json b/packages/ledger/tsconfig.json
index b6378c81a..37425ac79 100644
--- a/packages/ledger/tsconfig.json
+++ b/packages/ledger/tsconfig.json
@@ -7,7 +7,7 @@
},
"typedocOptions": {
"readme": "./README.md",
- "name": "registry",
+ "name": "ledger",
"entryPoints": ["src/index.ts"]
}
}
diff --git a/packages/evm/.npmignore b/packages/precompiles/.npmignore
similarity index 100%
rename from packages/evm/.npmignore
rename to packages/precompiles/.npmignore
diff --git a/packages/evm/CHANGELOG.md b/packages/precompiles/CHANGELOG.md
similarity index 96%
rename from packages/evm/CHANGELOG.md
rename to packages/precompiles/CHANGELOG.md
index dd8dd5d49..273beaa1e 100644
--- a/packages/evm/CHANGELOG.md
+++ b/packages/precompiles/CHANGELOG.md
@@ -1,4 +1,6 @@
-# @sei-js/evm
+# @sei-js/precompiles
+
+
## 2.0.5
diff --git a/packages/precompiles/README.md b/packages/precompiles/README.md
new file mode 100644
index 000000000..aa29c2ac3
--- /dev/null
+++ b/packages/precompiles/README.md
@@ -0,0 +1,147 @@
+# @sei-js/precompiles
+
+[](https://badge.fury.io/js/@sei-js%2Fprecompiles)
+[](https://opensource.org/licenses/MIT)
+
+TypeScript utilities and helpers for interacting with Sei's precompile contracts. Provides seamless integration with popular Ethereum development tools like Viem and Ethers.js, offering typed interfaces, contract factories, ABI's, contract addresses, and utilities specifically designed for Sei's precompile ecosystem.
+
+## 📦 Installation
+
+```bash
+npm install @sei-js/precompiles
+```
+
+```bash
+yarn add @sei-js/precompiles
+```
+
+```bash
+pnpm add @sei-js/precompiles
+```
+
+### Peer Dependencies
+
+This package requires either `ethers` (v6+) or `viem` (v2+) as peer dependencies:
+
+```bash
+# For Ethers.js users
+npm install ethers@^6.0.0
+
+# For Viem users
+npm install viem@^2.0.0
+```
+
+## 🚀 Quick Start
+
+### With Viem
+
+```typescript
+import { createPublicClient, http } from 'viem'
+import { seiMainnet } from '@sei-js/precompiles/viem'
+import { BANK_PRECOMPILE_ADDRESS, bankPrecompileAbi } from '@sei-js/precompiles'
+
+const client = createPublicClient({
+ chain: seiMainnet,
+ transport: http()
+})
+
+// Read token balance
+const balance = await client.readContract({
+ address: BANK_PRECOMPILE_ADDRESS,
+ abi: bankPrecompileAbi,
+ functionName: 'balance',
+ args: ['0x...', 'usei']
+})
+```
+
+### With Ethers.js
+
+```typescript
+import { ethers } from 'ethers'
+import { getBankPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers'
+
+const provider = new ethers.JsonRpcProvider('https://evm-rpc.sei-apis.com')
+const bankContract = getBankPrecompileEthersV6Contract(provider)
+
+// Read token balance
+const balance = await bankContract.balance('0x...', 'usei')
+```
+
+## 📋 Available Precompiles
+
+| Precompile | Address | Description |
+|------------|---------|-------------|
+| **Bank** | `0x0000000000000000000000000000000000001001` | Token operations and balance management |
+| **Oracle** | `0x0000000000000000000000000000000000001002` | Price feeds and TWAP data |
+| **JSON** | `0x0000000000000000000000000000000000001003` | JSON parsing utilities |
+| **Address** | `0x0000000000000000000000000000000000001004` | Address association between EVM and Cosmos |
+| **Staking** | `0x0000000000000000000000000000000000001005` | Validator operations and delegation |
+| **Governance** | `0x0000000000000000000000000000000000001006` | Voting and proposal management |
+| **Distribution** | `0x0000000000000000000000000000000000001007` | Reward distribution and claiming |
+| **IBC** | `0x0000000000000000000000000000000000001009` | Cross-chain transfers |
+| **Pointerview** | `0x000000000000000000000000000000000000100A` | Token pointer queries |
+| **Pointer** | `0x000000000000000000000000000000000000100B` | Token pointer creation |
+| **Confidential Transfers** | `0x0000000000000000000000000000000000001010` | Privacy-preserving transactions |
+| **WASM** | `0x0000000000000000000000000000000000001002` | CosmWasm contract interaction |
+
+## 📖 Documentation
+
+For comprehensive guides, examples, and API reference, visit our documentation:
+
+**📚 [Complete Documentation →](https://seilabs.mintlify.app/precompiles)**
+
+### Quick Links
+
+- **[Quick Start Guide](https://seilabs.mintlify.app/precompiles/quick-start)** - Get up and running in 5 minutes
+- **[Viem Integration](https://seilabs.mintlify.app/precompiles/precompiles/viem)** - Type-safe precompile interactions with Viem
+- **[Ethers.js Integration](https://seilabs.mintlify.app/precompiles/precompiles/ethers)** - Use precompile contract factories with Ethers.js
+
+## 🏗️ Usage Examples
+
+### Bank Precompile - Token Operations
+
+```typescript
+import { BANK_PRECOMPILE_ADDRESS, bankPrecompileAbi } from '@sei-js/precompiles'
+
+// Send tokens
+await writeContract({
+ address: BANK_PRECOMPILE_ADDRESS,
+ abi: bankPrecompileAbi,
+ functionName: 'send',
+ args: [fromAddress, toAddress, 'usei', amount]
+})
+```
+
+### Oracle Precompile - Price Data
+
+```typescript
+import { ORACLE_PRECOMPILE_ADDRESS, oraclePrecompileAbi } from '@sei-js/precompiles'
+
+// Get exchange rate
+const rate = await readContract({
+ address: ORACLE_PRECOMPILE_ADDRESS,
+ abi: oraclePrecompileAbi,
+ functionName: 'getExchangeRate',
+ args: ['ATOM']
+})
+```
+
+### Staking Precompile - Validator Operations
+
+```typescript
+import { STAKING_PRECOMPILE_ADDRESS, stakingPrecompileAbi } from '@sei-js/precompiles'
+
+// Delegate to validator
+await writeContract({
+ address: STAKING_PRECOMPILE_ADDRESS,
+ abi: stakingPrecompileAbi,
+ functionName: 'delegate',
+ args: [validatorAddress, amount]
+})
+```
+
+## 🆘 Support
+
+- **Documentation**: [https://seilabs.mintlify.app](https://seilabs.mintlify.app)
+- **Discord**: [Sei Discord](https://discord.gg/sei)
+- **GitHub Issues**: [Report a bug](https://github.com/sei-protocol/sei-js/issues)
diff --git a/packages/evm/jest.config.js b/packages/precompiles/jest.config.js
similarity index 100%
rename from packages/evm/jest.config.js
rename to packages/precompiles/jest.config.js
diff --git a/packages/evm/package.json b/packages/precompiles/package.json
similarity index 100%
rename from packages/evm/package.json
rename to packages/precompiles/package.json
diff --git a/packages/evm/src/ethers/__tests__/ethersPrecompiles.spec.ts b/packages/precompiles/src/ethers/__tests__/ethersPrecompiles.spec.ts
similarity index 100%
rename from packages/evm/src/ethers/__tests__/ethersPrecompiles.spec.ts
rename to packages/precompiles/src/ethers/__tests__/ethersPrecompiles.spec.ts
diff --git a/packages/evm/src/ethers/addressPrecompile.ts b/packages/precompiles/src/ethers/addressPrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/addressPrecompile.ts
rename to packages/precompiles/src/ethers/addressPrecompile.ts
index e2f46d6bd..24c163b6f 100644
--- a/packages/evm/src/ethers/addressPrecompile.ts
+++ b/packages/precompiles/src/ethers/addressPrecompile.ts
@@ -1,9 +1,9 @@
-import { ContractRunner, Contract, InterfaceAbi } from 'ethers';
+import { type ContractRunner, Contract, type InterfaceAbi } from 'ethers';
import { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Address precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_ADDRESS_PRECOMPILE_ABI = ADDRESS_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_ADDRESS_PRECOMPILE_ABI = ADDRESS_PRECOMPILE_ABI as Interface
*
* @example
* ```tsx
- * import { getAddressPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getAddressPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -28,7 +28,7 @@ export const ETHERS_ADDRESS_PRECOMPILE_ABI = ADDRESS_PRECOMPILE_ABI as Interface
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export function getAddressPrecompileEthersV6Contract(runner: ContractRunner) {
return new Contract(ADDRESS_PRECOMPILE_ADDRESS, ETHERS_ADDRESS_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/bankPrecompile.ts b/packages/precompiles/src/ethers/bankPrecompile.ts
similarity index 80%
rename from packages/evm/src/ethers/bankPrecompile.ts
rename to packages/precompiles/src/ethers/bankPrecompile.ts
index 2be42c2f1..b4aa7f655 100644
--- a/packages/evm/src/ethers/bankPrecompile.ts
+++ b/packages/precompiles/src/ethers/bankPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { BANK_PRECOMPILE_ABI, BANK_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Bank precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_BANK_PRECOMPILE_ABI = BANK_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_BANK_PRECOMPILE_ABI = BANK_PRECOMPILE_ABI as InterfaceAbi;
*
* @example
* ```tsx
- * import { getBankPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getBankPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -29,8 +29,8 @@ export const ETHERS_BANK_PRECOMPILE_ABI = BANK_PRECOMPILE_ABI as InterfaceAbi;
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Bank precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getBankPrecompileEthersV6Contract = (runner: ContractRunner) => {
- return new Contract(BANK_PRECOMPILE_ADDRESS, BANK_PRECOMPILE_ABI, runner);
+ return new Contract(BANK_PRECOMPILE_ADDRESS, ETHERS_BANK_PRECOMPILE_ABI, runner);
};
diff --git a/packages/evm/src/ethers/confidentialTransfersPrecompile.ts b/packages/precompiles/src/ethers/confidentialTransfersPrecompile.ts
similarity index 94%
rename from packages/evm/src/ethers/confidentialTransfersPrecompile.ts
rename to packages/precompiles/src/ethers/confidentialTransfersPrecompile.ts
index e44ef528c..b13b411be 100644
--- a/packages/evm/src/ethers/confidentialTransfersPrecompile.ts
+++ b/packages/precompiles/src/ethers/confidentialTransfersPrecompile.ts
@@ -3,7 +3,7 @@ import { CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI, CONFIDENTIAL_TRANSFERS_PRECOMPIL
/**
* The ABI for the Confidential Transfers precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI = CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI = CONFIDENTIAL_TRANSFE
*
* @example
* ```tsx
- * import { getConfidentialTransfersPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getConfidentialTransfersPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -28,7 +28,7 @@ export const ETHERS_CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI = CONFIDENTIAL_TRANSFE
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export function getConfidentialTransfersPrecompileEthersV6Contract(runner: ContractRunner) {
return new Contract(CONFIDENTIAL_TRANSFERS_PRECOMPILE_ADDRESS, ETHERS_CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/distributionPrecompile.ts b/packages/precompiles/src/ethers/distributionPrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/distributionPrecompile.ts
rename to packages/precompiles/src/ethers/distributionPrecompile.ts
index 71ef11c8f..8e90abf88 100644
--- a/packages/evm/src/ethers/distributionPrecompile.ts
+++ b/packages/precompiles/src/ethers/distributionPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { DISTRIBUTION_PRECOMPILE_ADDRESS, DISTRIBUTION_PRECOMPILE_ABI } from '../precompiles';
/**
* The ABI for the Distribution precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_DISTRIBUTION_PRECOMPILE_ABI = DISTRIBUTION_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_DISTRIBUTION_PRECOMPILE_ABI = DISTRIBUTION_PRECOMPILE_ABI as
*
* @example
* ```tsx
- * import { getDistributionPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getDistributionPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_DISTRIBUTION_PRECOMPILE_ABI = DISTRIBUTION_PRECOMPILE_ABI as
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Distribution precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getDistributionPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(DISTRIBUTION_PRECOMPILE_ADDRESS, ETHERS_DISTRIBUTION_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/governancePrecompile.ts b/packages/precompiles/src/ethers/governancePrecompile.ts
similarity index 80%
rename from packages/evm/src/ethers/governancePrecompile.ts
rename to packages/precompiles/src/ethers/governancePrecompile.ts
index f5145895c..8ea3f2b3e 100644
--- a/packages/evm/src/ethers/governancePrecompile.ts
+++ b/packages/precompiles/src/ethers/governancePrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { GOVERNANCE_PRECOMPILE_ABI, GOVERNANCE_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Governance precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_GOVERNANCE_PRECOMPILE_ABI = GOVERNANCE_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,8 +13,8 @@ export const ETHERS_GOVERNANCE_PRECOMPILE_ABI = GOVERNANCE_PRECOMPILE_ABI as Int
*
* @example
* ```tsx
- * import { getGovernancePrecompileEthersV6Contract, parseSei } from '@sei-js/evm/ethers';
- * import { ethers } from 'ethers';
+ * import { getGovernancePrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
+ * import { ethers, parseEther } from 'ethers';
*
* const provider = new ethers.BrowserProvider(); // or any other provider
* const signer = provider.getSigner();
@@ -22,13 +22,13 @@ export const ETHERS_GOVERNANCE_PRECOMPILE_ABI = GOVERNANCE_PRECOMPILE_ABI as Int
* const governancePrecompileContract = getGovernancePrecompileEthersV6Contract(signer);
*
* // Surround with try/catch for detailed errors
- * const depositResponse = await governancePrecompileContract.connect(signer).deposit('1', { value: parseSei(1) });
+ * const depositResponse = await governancePrecompileContract.connect(signer).deposit('1', { value: parseEther(1) });
* console.log('Deposit Response:', depositResponse);
* ```
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Governance precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getGovernancePrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(GOVERNANCE_PRECOMPILE_ADDRESS, ETHERS_GOVERNANCE_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/ibcPrecompile.ts b/packages/precompiles/src/ethers/ibcPrecompile.ts
similarity index 85%
rename from packages/evm/src/ethers/ibcPrecompile.ts
rename to packages/precompiles/src/ethers/ibcPrecompile.ts
index fa179eebc..d9a15ad55 100644
--- a/packages/evm/src/ethers/ibcPrecompile.ts
+++ b/packages/precompiles/src/ethers/ibcPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { IBC_PRECOMPILE_ABI, IBC_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the IBC precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_IBC_PRECOMPILE_ABI = IBC_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_IBC_PRECOMPILE_ABI = IBC_PRECOMPILE_ABI as InterfaceAbi;
*
* @example
* ```tsx
- * import { getIbcPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getIbcPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -28,7 +28,7 @@ export const ETHERS_IBC_PRECOMPILE_ABI = IBC_PRECOMPILE_ABI as InterfaceAbi;
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the IBC precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getIbcPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(IBC_PRECOMPILE_ADDRESS, ETHERS_IBC_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/index.ts b/packages/precompiles/src/ethers/index.ts
similarity index 100%
rename from packages/evm/src/ethers/index.ts
rename to packages/precompiles/src/ethers/index.ts
diff --git a/packages/evm/src/ethers/jsonPrecompile.ts b/packages/precompiles/src/ethers/jsonPrecompile.ts
similarity index 85%
rename from packages/evm/src/ethers/jsonPrecompile.ts
rename to packages/precompiles/src/ethers/jsonPrecompile.ts
index e6df5cddc..f59fc7cde 100644
--- a/packages/evm/src/ethers/jsonPrecompile.ts
+++ b/packages/precompiles/src/ethers/jsonPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { JSON_PRECOMPILE_ABI, JSON_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the JSON precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_JSON_PRECOMPILE_ABI = JSON_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_JSON_PRECOMPILE_ABI = JSON_PRECOMPILE_ABI as InterfaceAbi;
*
* @example
* ```tsx
- * import { getJSONPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getJSONPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -29,7 +29,7 @@ export const ETHERS_JSON_PRECOMPILE_ABI = JSON_PRECOMPILE_ABI as InterfaceAbi;
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the JSON precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getJSONPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(JSON_PRECOMPILE_ADDRESS, ETHERS_JSON_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/oraclePrecompile.ts b/packages/precompiles/src/ethers/oraclePrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/oraclePrecompile.ts
rename to packages/precompiles/src/ethers/oraclePrecompile.ts
index 0acf055c7..3e35794b2 100644
--- a/packages/evm/src/ethers/oraclePrecompile.ts
+++ b/packages/precompiles/src/ethers/oraclePrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { ORACLE_PRECOMPILE_ABI, ORACLE_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Oracle precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_ORACLE_PRECOMPILE_ABI = ORACLE_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_ORACLE_PRECOMPILE_ABI = ORACLE_PRECOMPILE_ABI as InterfaceAb
*
* @example
* ```tsx
- * import { getOraclePrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getOraclePrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_ORACLE_PRECOMPILE_ABI = ORACLE_PRECOMPILE_ABI as InterfaceAb
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Oracle precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getOraclePrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(ORACLE_PRECOMPILE_ADDRESS, ETHERS_ORACLE_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/pointerPrecompile.ts b/packages/precompiles/src/ethers/pointerPrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/pointerPrecompile.ts
rename to packages/precompiles/src/ethers/pointerPrecompile.ts
index d6949ff07..c745d05d2 100644
--- a/packages/evm/src/ethers/pointerPrecompile.ts
+++ b/packages/precompiles/src/ethers/pointerPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { POINTER_PRECOMPILE_ABI, POINTER_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Pointer precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_POINTER_PRECOMPILE_ABI = POINTER_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_POINTER_PRECOMPILE_ABI = POINTER_PRECOMPILE_ABI as Interface
*
* @example
* ```tsx
- * import { getPointerPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getPointerPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_POINTER_PRECOMPILE_ABI = POINTER_PRECOMPILE_ABI as Interface
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Pointer precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getPointerPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(POINTER_PRECOMPILE_ADDRESS, ETHERS_POINTER_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/pointerviewPrecompile.ts b/packages/precompiles/src/ethers/pointerviewPrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/pointerviewPrecompile.ts
rename to packages/precompiles/src/ethers/pointerviewPrecompile.ts
index 8767ee0dc..1170faa7f 100644
--- a/packages/evm/src/ethers/pointerviewPrecompile.ts
+++ b/packages/precompiles/src/ethers/pointerviewPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { POINTERVIEW_PRECOMPILE_ABI, POINTERVIEW_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Pointerview precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_POINTERVIEW_PRECOMPILE_ABI = POINTERVIEW_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_POINTERVIEW_PRECOMPILE_ABI = POINTERVIEW_PRECOMPILE_ABI as I
*
* @example
* ```tsx
- * import { getPointerviewPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getPointerviewPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_POINTERVIEW_PRECOMPILE_ABI = POINTERVIEW_PRECOMPILE_ABI as I
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Pointerview precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getPointerviewPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(POINTERVIEW_PRECOMPILE_ADDRESS, ETHERS_POINTERVIEW_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/soloPrecompile.ts b/packages/precompiles/src/ethers/soloPrecompile.ts
similarity index 89%
rename from packages/evm/src/ethers/soloPrecompile.ts
rename to packages/precompiles/src/ethers/soloPrecompile.ts
index a1bbd6f64..2f1495db5 100644
--- a/packages/evm/src/ethers/soloPrecompile.ts
+++ b/packages/precompiles/src/ethers/soloPrecompile.ts
@@ -3,7 +3,7 @@ import { SOLO_PRECOMPILE_ABI, SOLO_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Solo precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_SOLO_PRECOMPILE_ABI = SOLO_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_SOLO_PRECOMPILE_ABI = SOLO_PRECOMPILE_ABI as InterfaceAbi;
*
* @example
* ```tsx
- * import { getSoloPrecompileEthersV6Contract } from '@sei-js/evm/ethers';
+ * import { getSoloPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_SOLO_PRECOMPILE_ABI = SOLO_PRECOMPILE_ABI as InterfaceAbi;
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Oracle precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getSoloPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(SOLO_PRECOMPILE_ADDRESS, ETHERS_SOLO_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/stakingPrecompile.ts b/packages/precompiles/src/ethers/stakingPrecompile.ts
similarity index 82%
rename from packages/evm/src/ethers/stakingPrecompile.ts
rename to packages/precompiles/src/ethers/stakingPrecompile.ts
index 3287f78cb..58884f4fc 100644
--- a/packages/evm/src/ethers/stakingPrecompile.ts
+++ b/packages/precompiles/src/ethers/stakingPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { STAKING_PRECOMPILE_ABI, STAKING_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Staking precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_STAKING_PRECOMPILE_ABI = STAKING_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,8 +13,8 @@ export const ETHERS_STAKING_PRECOMPILE_ABI = STAKING_PRECOMPILE_ABI as Interface
*
* @example
* ```tsx
- * import { getStakingPrecompileEthersV6Contract, parseSei } from '@sei-js/evm';
- * import { ethers } from 'ethers';
+ * import { getStakingPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
+ * import { ethers, parseEther } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
* const signer = await provider.getSigner();
@@ -23,13 +23,13 @@ export const ETHERS_STAKING_PRECOMPILE_ABI = STAKING_PRECOMPILE_ABI as Interface
*
* const contract = getStakingPrecompileEthersV6Contract(signer);
*
- * const response = await contract.delegate('0xVALIDATOR_ADDRESS', parseSei(1));
+ * const response = await contract.delegate('0xVALIDATOR_ADDRESS', parseEther(1));
* console.log('Delegate Response:', response);
* ```
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Staking precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getStakingPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(STAKING_PRECOMPILE_ADDRESS, ETHERS_STAKING_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/ethers/wasmPrecompile.ts b/packages/precompiles/src/ethers/wasmPrecompile.ts
similarity index 85%
rename from packages/evm/src/ethers/wasmPrecompile.ts
rename to packages/precompiles/src/ethers/wasmPrecompile.ts
index 376a101f7..4ac8b297e 100644
--- a/packages/evm/src/ethers/wasmPrecompile.ts
+++ b/packages/precompiles/src/ethers/wasmPrecompile.ts
@@ -1,9 +1,9 @@
-import { Contract, ContractRunner, InterfaceAbi } from 'ethers';
+import { Contract, type ContractRunner, type InterfaceAbi } from 'ethers';
import { WASM_PRECOMPILE_ABI, WASM_PRECOMPILE_ADDRESS } from '../precompiles';
/**
* The ABI for the Wasm precompile contract, used to create an Ethers contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ETHERS_WASM_PRECOMPILE_ABI = WASM_PRECOMPILE_ABI as InterfaceAbi;
@@ -13,7 +13,7 @@ export const ETHERS_WASM_PRECOMPILE_ABI = WASM_PRECOMPILE_ABI as InterfaceAbi;
*
* @example
* ```tsx
- * import { getWasmPrecompileEthersV6Contract } from '@sei-js/evm';
+ * import { getWasmPrecompileEthersV6Contract } from '@sei-js/precompiles/ethers';
* import { ethers } from 'ethers';
*
* const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider
@@ -27,7 +27,7 @@ export const ETHERS_WASM_PRECOMPILE_ABI = WASM_PRECOMPILE_ABI as InterfaceAbi;
*
* @param runner A [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract.
* @returns The typed contract instance for interacting with the Wasm precompile contract.
- * @category Cosmos Interoperability
+ * @category Contract Factory
*/
export const getWasmPrecompileEthersV6Contract = (runner: ContractRunner) => {
return new Contract(WASM_PRECOMPILE_ADDRESS, ETHERS_WASM_PRECOMPILE_ABI, runner);
diff --git a/packages/evm/src/index.ts b/packages/precompiles/src/index.ts
similarity index 100%
rename from packages/evm/src/index.ts
rename to packages/precompiles/src/index.ts
diff --git a/packages/evm/src/precompiles/address.ts b/packages/precompiles/src/precompiles/address.ts
similarity index 95%
rename from packages/evm/src/precompiles/address.ts
rename to packages/precompiles/src/precompiles/address.ts
index c7d37a52f..f2ef103e6 100644
--- a/packages/evm/src/precompiles/address.ts
+++ b/packages/precompiles/src/precompiles/address.ts
@@ -1,13 +1,13 @@
/**
* The address of the Address precompile contract.
* This contract gets associated Sei and EVM addresses.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const ADDRESS_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001004';
/**
* The ABI for the Address precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ADDRESS_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/bank.ts b/packages/precompiles/src/precompiles/bank.ts
similarity index 97%
rename from packages/evm/src/precompiles/bank.ts
rename to packages/precompiles/src/precompiles/bank.ts
index 62fd01dd3..6f293efcd 100644
--- a/packages/evm/src/precompiles/bank.ts
+++ b/packages/precompiles/src/precompiles/bank.ts
@@ -1,12 +1,12 @@
/**
* The address of the Bank precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const BANK_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001001';
/**
* The ABI for the Bank precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const BANK_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/confidential_transfers.ts b/packages/precompiles/src/precompiles/confidential_transfers.ts
similarity index 98%
rename from packages/evm/src/precompiles/confidential_transfers.ts
rename to packages/precompiles/src/precompiles/confidential_transfers.ts
index 8191f23f7..eb767ec27 100644
--- a/packages/evm/src/precompiles/confidential_transfers.ts
+++ b/packages/precompiles/src/precompiles/confidential_transfers.ts
@@ -1,13 +1,13 @@
/**
* The address of the Confidential Transfers precompile contract.
* This contract facilitates the interaction with the Confidential Transfers module using the EVM.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const CONFIDENTIAL_TRANSFERS_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001010';
/**
* The ABI for the Confidential Transfers precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/distribution.ts b/packages/precompiles/src/precompiles/distribution.ts
similarity index 96%
rename from packages/evm/src/precompiles/distribution.ts
rename to packages/precompiles/src/precompiles/distribution.ts
index 8da90edb4..caf93ccde 100644
--- a/packages/evm/src/precompiles/distribution.ts
+++ b/packages/precompiles/src/precompiles/distribution.ts
@@ -1,12 +1,12 @@
/**
* The address of the Distribution precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const DISTRIBUTION_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001007';
/**
* The ABI for the Distribution precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const DISTRIBUTION_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/governance.ts b/packages/precompiles/src/precompiles/governance.ts
similarity index 91%
rename from packages/evm/src/precompiles/governance.ts
rename to packages/precompiles/src/precompiles/governance.ts
index 134d6e5ad..8a773da0e 100644
--- a/packages/evm/src/precompiles/governance.ts
+++ b/packages/precompiles/src/precompiles/governance.ts
@@ -1,12 +1,12 @@
/**
* The address of the Governance precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const GOVERNANCE_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001006';
/**
* The ABI for the Governance precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const GOVERNANCE_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/ibc.ts b/packages/precompiles/src/precompiles/ibc.ts
similarity index 95%
rename from packages/evm/src/precompiles/ibc.ts
rename to packages/precompiles/src/precompiles/ibc.ts
index ee1a32663..fae7b0187 100644
--- a/packages/evm/src/precompiles/ibc.ts
+++ b/packages/precompiles/src/precompiles/ibc.ts
@@ -1,12 +1,12 @@
/**
* The address of the IBC precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const IBC_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001009';
/**
* The ABI for the IBC precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const IBC_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/index.ts b/packages/precompiles/src/precompiles/index.ts
similarity index 100%
rename from packages/evm/src/precompiles/index.ts
rename to packages/precompiles/src/precompiles/index.ts
diff --git a/packages/evm/src/precompiles/json.ts b/packages/precompiles/src/precompiles/json.ts
similarity index 93%
rename from packages/evm/src/precompiles/json.ts
rename to packages/precompiles/src/precompiles/json.ts
index baa60022a..5cff00257 100644
--- a/packages/evm/src/precompiles/json.ts
+++ b/packages/precompiles/src/precompiles/json.ts
@@ -1,12 +1,12 @@
/**
* The address of the JSON precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const JSON_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001003';
/**
* The ABI for the JSON precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const JSON_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/oracle.ts b/packages/precompiles/src/precompiles/oracle.ts
similarity index 95%
rename from packages/evm/src/precompiles/oracle.ts
rename to packages/precompiles/src/precompiles/oracle.ts
index 77b36dede..b2f86ee55 100644
--- a/packages/evm/src/precompiles/oracle.ts
+++ b/packages/precompiles/src/precompiles/oracle.ts
@@ -1,12 +1,12 @@
/**
* The address of the Oracle precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const ORACLE_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001002';
/**
* The ABI for the Oracle precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const ORACLE_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/pointer.ts b/packages/precompiles/src/precompiles/pointer.ts
similarity index 92%
rename from packages/evm/src/precompiles/pointer.ts
rename to packages/precompiles/src/precompiles/pointer.ts
index 2b2398cf4..293588a1d 100644
--- a/packages/evm/src/precompiles/pointer.ts
+++ b/packages/precompiles/src/precompiles/pointer.ts
@@ -1,12 +1,12 @@
/**
* The address of the Pointer precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const POINTER_PRECOMPILE_ADDRESS: `0x${string}` = '0x000000000000000000000000000000000000100B';
/**
* The ABI for the Pointer precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const POINTER_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/pointerview.ts b/packages/precompiles/src/precompiles/pointerview.ts
similarity index 94%
rename from packages/evm/src/precompiles/pointerview.ts
rename to packages/precompiles/src/precompiles/pointerview.ts
index 87400bc4e..12f78493c 100644
--- a/packages/evm/src/precompiles/pointerview.ts
+++ b/packages/precompiles/src/precompiles/pointerview.ts
@@ -1,12 +1,12 @@
/**
* The address of the Pointerview precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const POINTERVIEW_PRECOMPILE_ADDRESS: `0x${string}` = '0x000000000000000000000000000000000000100A';
/**
* The ABI for the Pointerview precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const POINTERVIEW_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/solo.ts b/packages/precompiles/src/precompiles/solo.ts
similarity index 92%
rename from packages/evm/src/precompiles/solo.ts
rename to packages/precompiles/src/precompiles/solo.ts
index a184f0721..48613d268 100644
--- a/packages/evm/src/precompiles/solo.ts
+++ b/packages/precompiles/src/precompiles/solo.ts
@@ -1,12 +1,12 @@
/**
* The address of the Solo precompile contract.
- * @category Cosmos Migration
+ * @category Address
*/
export const SOLO_PRECOMPILE_ADDRESS: `0x${string}` = '0x000000000000000000000000000000000000100C';
/**
* The ABI for the Solo precompile contract.
- * @category Cosmos Migration
+ * @category ABI
*/
export const SOLO_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/staking.ts b/packages/precompiles/src/precompiles/staking.ts
similarity index 96%
rename from packages/evm/src/precompiles/staking.ts
rename to packages/precompiles/src/precompiles/staking.ts
index dc46b5cb5..75660bbe8 100644
--- a/packages/evm/src/precompiles/staking.ts
+++ b/packages/precompiles/src/precompiles/staking.ts
@@ -1,12 +1,12 @@
/**
* The address of the Staking precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const STAKING_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001005';
/**
* The ABI for the Staking precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const STAKING_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/precompiles/wasm.ts b/packages/precompiles/src/precompiles/wasm.ts
similarity index 96%
rename from packages/evm/src/precompiles/wasm.ts
rename to packages/precompiles/src/precompiles/wasm.ts
index f9261ef35..c5ee4b37c 100644
--- a/packages/evm/src/precompiles/wasm.ts
+++ b/packages/precompiles/src/precompiles/wasm.ts
@@ -1,12 +1,12 @@
/**
* The address of the Wasm precompile contract.
- * @category Cosmos Interoperability
+ * @category Address
*/
export const WASM_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001002';
/**
* The ABI for the Wasm precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const WASM_PRECOMPILE_ABI = [
{
diff --git a/packages/evm/src/viem/__tests__/chain.spec.ts b/packages/precompiles/src/viem/__tests__/chain.spec.ts
similarity index 95%
rename from packages/evm/src/viem/__tests__/chain.spec.ts
rename to packages/precompiles/src/viem/__tests__/chain.spec.ts
index 10c473704..1cfd54ced 100644
--- a/packages/evm/src/viem/__tests__/chain.spec.ts
+++ b/packages/precompiles/src/viem/__tests__/chain.spec.ts
@@ -3,7 +3,7 @@ import { seiLocal } from '../chain';
describe('seiLocal chain', () => {
it('should be a valid chain definition', () => {
expect(seiLocal).toMatchObject({
- id: 713715,
+ id: 713714,
name: 'Sei Local',
nativeCurrency: {
name: 'Sei',
diff --git a/packages/evm/src/viem/__tests__/viemPrecompiles.spec.ts b/packages/precompiles/src/viem/__tests__/viemPrecompiles.spec.ts
similarity index 100%
rename from packages/evm/src/viem/__tests__/viemPrecompiles.spec.ts
rename to packages/precompiles/src/viem/__tests__/viemPrecompiles.spec.ts
diff --git a/packages/evm/src/viem/addressPrecompile.ts b/packages/precompiles/src/viem/addressPrecompile.ts
similarity index 74%
rename from packages/evm/src/viem/addressPrecompile.ts
rename to packages/precompiles/src/viem/addressPrecompile.ts
index 60ccc912e..4ecc5e917 100644
--- a/packages/evm/src/viem/addressPrecompile.ts
+++ b/packages/precompiles/src/viem/addressPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { ADDRESS_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Address precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_ADDRESS_PRECOMPILE_ABI = ADDRESS_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/bankPrecompile.ts b/packages/precompiles/src/viem/bankPrecompile.ts
similarity index 73%
rename from packages/evm/src/viem/bankPrecompile.ts
rename to packages/precompiles/src/viem/bankPrecompile.ts
index 9e8cf70a5..6fcc78be1 100644
--- a/packages/evm/src/viem/bankPrecompile.ts
+++ b/packages/precompiles/src/viem/bankPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { BANK_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Bank precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_BANK_PRECOMPILE_ABI = BANK_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/chain.ts b/packages/precompiles/src/viem/chain.ts
similarity index 70%
rename from packages/evm/src/viem/chain.ts
rename to packages/precompiles/src/viem/chain.ts
index 0e63f437b..ae0db9f2a 100644
--- a/packages/evm/src/viem/chain.ts
+++ b/packages/precompiles/src/viem/chain.ts
@@ -1,7 +1,11 @@
import { defineChain } from 'viem';
+/**
+ * The Viem chain definition for the Sei local chain.
+ * @category Chain
+ */
export const seiLocal = defineChain({
- id: 713715,
+ id: 713714,
name: 'Sei Local',
nativeCurrency: { name: 'Sei', symbol: 'SEI', decimals: 18 },
rpcUrls: {
diff --git a/packages/evm/src/viem/confidentialTransfersPrecompile.ts b/packages/precompiles/src/viem/confidentialTransfersPrecompile.ts
similarity index 70%
rename from packages/evm/src/viem/confidentialTransfersPrecompile.ts
rename to packages/precompiles/src/viem/confidentialTransfersPrecompile.ts
index 3aab37e8d..2ef7a867d 100644
--- a/packages/evm/src/viem/confidentialTransfersPrecompile.ts
+++ b/packages/precompiles/src/viem/confidentialTransfersPrecompile.ts
@@ -2,7 +2,7 @@ import type { Abi } from 'viem';
import { CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI } from '../precompiles';
/**
- * The Viem ABI for the Address precompile contract.
- * @category Cosmos Interoperability
+ * The Viem ABI for the Confidential Transfers precompile contract.
+ * @category ABI
*/
export const VIEM_CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI = CONFIDENTIAL_TRANSFERS_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/distributionPrecompile.ts b/packages/precompiles/src/viem/distributionPrecompile.ts
similarity index 76%
rename from packages/evm/src/viem/distributionPrecompile.ts
rename to packages/precompiles/src/viem/distributionPrecompile.ts
index 81efff15a..a93467098 100644
--- a/packages/evm/src/viem/distributionPrecompile.ts
+++ b/packages/precompiles/src/viem/distributionPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { DISTRIBUTION_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Distribution precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_DISTRIBUTION_PRECOMPILE_ABI = DISTRIBUTION_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/governancePrecompile.ts b/packages/precompiles/src/viem/governancePrecompile.ts
similarity index 75%
rename from packages/evm/src/viem/governancePrecompile.ts
rename to packages/precompiles/src/viem/governancePrecompile.ts
index 19cff56da..17118ed37 100644
--- a/packages/evm/src/viem/governancePrecompile.ts
+++ b/packages/precompiles/src/viem/governancePrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { GOVERNANCE_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Governance precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_GOVERNANCE_PRECOMPILE_ABI = GOVERNANCE_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/ibcPrecompile.ts b/packages/precompiles/src/viem/ibcPrecompile.ts
similarity index 73%
rename from packages/evm/src/viem/ibcPrecompile.ts
rename to packages/precompiles/src/viem/ibcPrecompile.ts
index 8b456c4b8..e93f4c144 100644
--- a/packages/evm/src/viem/ibcPrecompile.ts
+++ b/packages/precompiles/src/viem/ibcPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { IBC_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the IBC precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_IBC_PRECOMPILE_ABI = IBC_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/index.ts b/packages/precompiles/src/viem/index.ts
similarity index 100%
rename from packages/evm/src/viem/index.ts
rename to packages/precompiles/src/viem/index.ts
diff --git a/packages/evm/src/viem/jsonPrecompile.ts b/packages/precompiles/src/viem/jsonPrecompile.ts
similarity index 73%
rename from packages/evm/src/viem/jsonPrecompile.ts
rename to packages/precompiles/src/viem/jsonPrecompile.ts
index 03ca91ab2..f73f64a7a 100644
--- a/packages/evm/src/viem/jsonPrecompile.ts
+++ b/packages/precompiles/src/viem/jsonPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { JSON_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the JSON precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_JSON_PRECOMPILE_ABI = JSON_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/oraclePrecompile.ts b/packages/precompiles/src/viem/oraclePrecompile.ts
similarity index 74%
rename from packages/evm/src/viem/oraclePrecompile.ts
rename to packages/precompiles/src/viem/oraclePrecompile.ts
index 3417195a5..a57534d80 100644
--- a/packages/evm/src/viem/oraclePrecompile.ts
+++ b/packages/precompiles/src/viem/oraclePrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { ORACLE_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Oracle precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_ORACLE_PRECOMPILE_ABI = ORACLE_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/pointerPrecompile.ts b/packages/precompiles/src/viem/pointerPrecompile.ts
similarity index 74%
rename from packages/evm/src/viem/pointerPrecompile.ts
rename to packages/precompiles/src/viem/pointerPrecompile.ts
index 50edb826b..56449200a 100644
--- a/packages/evm/src/viem/pointerPrecompile.ts
+++ b/packages/precompiles/src/viem/pointerPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { POINTER_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Pointer precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_POINTER_PRECOMPILE_ABI = POINTER_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/pointerviewPrecompile.ts b/packages/precompiles/src/viem/pointerviewPrecompile.ts
similarity index 76%
rename from packages/evm/src/viem/pointerviewPrecompile.ts
rename to packages/precompiles/src/viem/pointerviewPrecompile.ts
index 6d60485b7..f47e9736b 100644
--- a/packages/evm/src/viem/pointerviewPrecompile.ts
+++ b/packages/precompiles/src/viem/pointerviewPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { POINTERVIEW_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Ponterview precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_POINTERVIEW_PRECOMPILE_ABI = POINTERVIEW_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/soloPrecompile.ts b/packages/precompiles/src/viem/soloPrecompile.ts
similarity index 85%
rename from packages/evm/src/viem/soloPrecompile.ts
rename to packages/precompiles/src/viem/soloPrecompile.ts
index d466eacb9..5d8aafb9a 100644
--- a/packages/evm/src/viem/soloPrecompile.ts
+++ b/packages/precompiles/src/viem/soloPrecompile.ts
@@ -3,6 +3,6 @@ import { SOLO_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Solo precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_SOLO_PRECOMPILE_ABI = SOLO_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/stakingPrecompile.ts b/packages/precompiles/src/viem/stakingPrecompile.ts
similarity index 74%
rename from packages/evm/src/viem/stakingPrecompile.ts
rename to packages/precompiles/src/viem/stakingPrecompile.ts
index 52817f31c..11d55343f 100644
--- a/packages/evm/src/viem/stakingPrecompile.ts
+++ b/packages/precompiles/src/viem/stakingPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { STAKING_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Staking precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_STAKING_PRECOMPILE_ABI = STAKING_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/src/viem/wasmPrecompile.ts b/packages/precompiles/src/viem/wasmPrecompile.ts
similarity index 73%
rename from packages/evm/src/viem/wasmPrecompile.ts
rename to packages/precompiles/src/viem/wasmPrecompile.ts
index 6d7f7be30..94418af4c 100644
--- a/packages/evm/src/viem/wasmPrecompile.ts
+++ b/packages/precompiles/src/viem/wasmPrecompile.ts
@@ -1,8 +1,8 @@
-import { Abi } from 'viem';
+import type { Abi } from 'viem';
import { WASM_PRECOMPILE_ABI } from '../precompiles';
/**
* The Viem ABI for the Wasm precompile contract.
- * @category Cosmos Interoperability
+ * @category ABI
*/
export const VIEM_WASM_PRECOMPILE_ABI = WASM_PRECOMPILE_ABI as Abi;
diff --git a/packages/evm/tsconfig.declaration.json b/packages/precompiles/tsconfig.declaration.json
similarity index 100%
rename from packages/evm/tsconfig.declaration.json
rename to packages/precompiles/tsconfig.declaration.json
diff --git a/packages/evm/tsconfig.json b/packages/precompiles/tsconfig.json
similarity index 90%
rename from packages/evm/tsconfig.json
rename to packages/precompiles/tsconfig.json
index 4a28b7af1..feb1d80b5 100644
--- a/packages/evm/tsconfig.json
+++ b/packages/precompiles/tsconfig.json
@@ -6,7 +6,7 @@
},
"typedocOptions": {
"readme": "./README.md",
- "name": "evm",
+ "name": "precompiles",
"entryPoints": ["src/index.ts"],
"exclude": ["node_modules"]
}
diff --git a/typedoc.config.js b/typedoc.config.js
index 0698d2758..1caa2c1d0 100644
--- a/typedoc.config.js
+++ b/typedoc.config.js
@@ -1,5 +1,5 @@
module.exports = {
- entryPoints: ['packages/evm', 'packages/cosmjs', 'packages/cosmos', 'packages/create-sei', 'packages/registry', 'packages/sei-account', 'packages/ledger'],
+ entryPoints: ['packages/precompiles', 'packages/cosmjs', 'packages/cosmos', 'packages/create-sei', 'packages/registry', 'packages/sei-account', 'packages/ledger'],
name: '@sei-js',
entryPointStrategy: 'packages',
includeVersion: false,
diff --git a/yarn.lock b/yarn.lock
index a94a58656..e106600db 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2040,9 +2040,9 @@ __metadata:
languageName: unknown
linkType: soft
-"@sei-js/evm@workspace:packages/evm":
+"@sei-js/evm@workspace:packages/precompiles":
version: 0.0.0-use.local
- resolution: "@sei-js/evm@workspace:packages/evm"
+ resolution: "@sei-js/evm@workspace:packages/precompiles"
dependencies:
ethers: "npm:^6.0.0"
viem: "npm:2.x"