diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..4f291a8c --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# @sei-protocol/sei-core will be requested for +# review when someone opens a pull request. +* @sei-protocol/sei-core \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..b63f2d68 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,10 @@ +## What is the purpose of the change? + + + +## Describe the changes to the documentation + + + +## Notes + \ No newline at end of file diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..c5791e19 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,24 @@ +name: Validate Changes + +on: + workflow_dispatch: + pull_request: + + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: yarn + + - name: Build docs + run: yarn build \ No newline at end of file diff --git a/README.md b/README.md index 7b334733..9ac8594a 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,48 @@ -# Nextra Docs Template +## Quick Start +Ensure you have `yarn` installed (macOS users can Run `brew install yarn`) -This is a template for creating documentation with [Nextra](https://nextra.site). +1. Use `yarn` to install dependencies +2. Use `yarn dev` to run the docs locally. +3. Use `yarn build` to build the docs. -[**Live Demo →**](https://nextra-docs-template.vercel.app) +You should always run `yarn build` before pushing any changes to validate that there are no syntax errors. -[![](.github/screenshot.png)](https://nextra-docs-template.vercel.app) +## Contributing -## Quick Start +This documentation is created using [Nextra](https://nextra.site). + +### Structure +Each page is generated from a single `.mdx` file under the `./pages` directory. + +Each directory represents a page grouping. Each directory contains a `_meta.json` file, which dictates the order and name of the items in the navbar. + +For more information on how the docs are structured, please refer to the [Nextra docs](https://nextra.site/docs/guide). + +### Changing Content +All content submitted will be reviewed by a maintainer + +To standardize the documentation, please follow the [style guide]() for instructions on how to format changes to the docs. + + +## Open Source Contributors -Click the button to clone this repository and deploy it on Vercel: +As an open source and decentralized protocol, we **greatly appreciate** any contributions! +If you feel like the docs can be better in some way, please feel free to fork this repo and make a pull request or open an issue in this Repository. -[![](https://vercel.com/button)](https://vercel.com/new/clone?s=https%3A%2F%2Fgithub.com%2Fshuding%2Fnextra-docs-template&showOptionalTeamCreation=false) +### Make changes yourself +While the contents of this repository are not technical in nature, contributing requires a basic understanding of +- [Git](https://git-scm.com/downloads) +- Github -## Local Development +To propose changes directly, you can open a Pull Request against this repository. -First, run `pnpm i` to install the dependencies. +1. [Fork the repository](https://guides.github.com/activities/forking/), then [clone](https://docs.github.com/en/get-started/exploring-projects-on-github/contributing-to-a-project#cloning-a-fork) the forked repository locally. +2. Make changes to the repository. You can refer to the contribution guide above on how or where to make specific changes. +3. Validate your changes by running the docs locally (Refer to the [Quick Start](#quick-start) section above for instructions) +4. Commit and push your changes to your forked repository. +5. Once your changes have been pushed to your forked repository, [make a Pull Request](https://git-scm.com/downloads) against this repository. Ensure that your Pull Request follows the template so we can understand and review your changes clearly. -Then, run `pnpm dev` to start the development server and visit localhost:3000. +### Open an Issue. +Alternatively, if you have more general suggestions on how we can improve or correct these docs, you can [open an issue](https://github.com/sei-protocol/sei-docs/issues). -## License -This project is licensed under the MIT License. diff --git a/STYLE_GUIDE.mdx b/STYLE_GUIDE.mdx new file mode 100644 index 00000000..9f95fcba --- /dev/null +++ b/STYLE_GUIDE.mdx @@ -0,0 +1,201 @@ +# Sei Docs style guide + +This style guide contains general rules and principles to ensure the documentation is cohesive, useful and organized. + +## Principles + +This documentation strives to be + +### Beginner Friendly +The Sei community welcomes members from all walks of life. As such, the documentation should be understandable by anyone, including those who are new to Web3 or non-technical. + +The docs should strive to be Jargon Free +- Advanced terms and concepts, especially Web3 related terms and ideas, should be properly explained. +- Where appropriate, we should provide links to resources that can help the reader understand. +- Acronyms should be spelled out + + +### Simple + +Great documentation is simple and to the point. It should aim to convey more meaning with less words. + +- To be clear and inclusive, avoid using jargon and obscure words where possible. +- Limit the number of clauses in a sentence and make sure that your points are structured. +- Avoid qualifying language, which is ~~quite~~ often ~~completely~~ uneccessary. +- Information should be simply organized and easy to find. + +### Self-explanatory + +Great documentation is self-explanatory. Documentation shouldn't need more documentation to explain itself. +- Aim to provide as much context as possible. Code snippets and diagrams are great ways to illustrate complex concepts and provide examples. + +## Organization + +The Sei Docs are structured using the [Nextra](https://nextra.site). Are a guideline, we have split the pages by target audience. + +### General +Docs in these section describe Sei and topics that are applicable to all audiences. This is general information that is not specfic to users or developers. Information here is meant to be as layman as possible and should be understandable by everyone. + +Information here might include: +- What is Sei? +- How does a blockchain work? +- General information about how things work. + +### For Users +This section includes information specific to enabling people to interact with the Sei blockchain. + +Examples include information about standard resources used to interact with the chain (Wallets, Block Explorers), as well as tutorials on how to get started on Sei (Where to find tokens, apps etc.) + +### For Devs +This section includes resources for developers looking to build Dapps on Sei. Examples of what goes in here include: +- Smart contract tutorials +- Endpoints and config information that developers should use to interact with Sei (RPC Endpoints, Chain IDs etc) +- Information about clients and libraries that developers can use to easily develop apps. + +### Advanced +This section covers topics that are more specific to chain infrastructure. These are topics that are typically abstracted away from regular users and developers, but might be relevant to those looking to contribute chain infrastructure. Examples of topics here include: +- How to run a Sei Node +- How to run a Sei Validator + +### Misc +This section houses other pages that do not fall under the buckets above. + +## Style guidelines + +### Acronyms and Abbreviations + +To maximize clarity, we should avoid Acronyms and Abbreviations where possible, especially for shorter, more ambiguous acronyms +- Just use 'CosmWasm' instead of 'CW' + +However, there are occasions where acronyms might be more easily understandable (Eg. NFT instead of Non-Fungible Token, RPC instead of Remote Procedure Call), or referred to very frequently. + +In these cases, we should first use the use the spelled-out term followed by the shortened form in parentheses. +- Command Line Interface (CLI) +- Denomination (Denom) + +On subsequent occurrences in the same topic, we can then use the acronym. + +### Links + +You can add links to text using the followings syntax +```md +[text_to_highlight](link) +``` + +Some examples (These examples assume the page is in the `/pages` directory): +1. Link to section of [same document](#style-guidelines). +```md +[same document](#style-guidelines) +``` + +2. Link to [another document](/pages/overview.mdx). +```md +# Path is relative +[another document](/overview) +``` + +3. Link to [section of another document](/pages/overview.mdx#Staking). +```md +[section of another document](/overview#Staking) +``` + +4. External [Link](www.app.sei.io). +```md +[Link](www.app.sei.io) +``` + +Sentence ending punctuation should always be included outside the link. + +Links should be as descriptive as possible to let the reader know where they are going. + +- Bad Example: Interested to learn more about staking? Click [here](#links) to find out more + +- Better Example: Interested to learn more about staking? Refer to our [staking guide](#links) to find out more! + + +### Code +Code should either be specified as `inline` +```md +Code should either be specified as `inline` +``` + +Or within code blocks. +```ts +const codeBlockString = "codeBlock" +``` + +```md + ```ts + const codeBlockString = "codeBlock" + ``` +``` + +`Inline Code` should be used when referring to +- File and directory names. (eg. `./pages/overview.mdx`) +- References to variables in code (eg. `codeBlockString`) + +Code Blocks should be used when +- Sharing code snippets +```ts +const codeBlockString = () => { + const text = "codeblock" + let codeBlockSize: Number = 1 +} +``` + +- Scripts that users should copy and execute directly +```sh +git clone https://github.com/sei-protocol/sei-chain +cd sei-chain +git checkout v4.1.4-evm-devnet +make install +``` + +When code blocks are used, they should always be prettified by specifying the language. For example: +```md + TypeScript code block labelled with 'ts' + ```ts + const variable = value; + ``` + + Bash command line code block labelled with 'sh' + ```sh + git clone https://github.com/sei-protocol/sei-chain + cd sei-chain + ``` +``` + +When writing code blocks, avoid +1. Creating large code blocks. Break your code into smaller, more digestible pieces. +2. Writing too much documentation in between lines. If neccessary, break the code block up and add text to explain each code block instead. + +For tutorials, the goal should be to write code blocks that can be directly copied and used by the reader. + +Remember, code is used to elaborate or provide an example, make your point clearly first before using code to substantiate it! + +### Headings + +Headings should be use to denote the start of each section. There are 4 levels of headings that correspond to different sizes (avoid using anything more than level 4 headings) + +``` +# Page Title +## Main Topic(s) on page +### Sub Topics +#### Use only if more required +``` + +Headings levels should never be skipped. A level 2 heading should follow a level 1 heading, and a level 3 heading should follow a level 2 heading etc. + +### Images + +To use images, first add them to the `./public/assets` folder. + +Afterwards, they can be imported in each page using an import statement. For example: +```md +import nameOfImage from "../../public/assets/nameOfImage.png"; +``` + +Lastly, use the `ImageWithCaption` component to add the image to the page, along with a descriptive label: +```md + +``` \ No newline at end of file diff --git a/pages/differences-with-ethereum.mdx b/pages/differences-with-ethereum.mdx new file mode 100644 index 00000000..934c80e1 --- /dev/null +++ b/pages/differences-with-ethereum.mdx @@ -0,0 +1,50 @@ +# Differences with Ethereum + +While Sei features full EVM compatibility, there are some differences between Sei's EVM and Ethereum itself. + +## EVM Differences +Unlike Ethereum mainnet which is on Cancun for its execution layer, Sei uses the Shanghai version of EVM. This means that features like blob transactions are not supported on Sei. + +## Opcode Differences + +### PREVRANDAO + +Since Sei doesn’t rely on the same pseudo-randomness way of determining the next validator like Proof of Stake (PoS) Ethereum does, it doesn’t really have the `RANDOM` artifact that can be set as `PREVRANDO`'s return value. +In Sei `PREVRANDAO` is set to return the hash of the current block time. For strong randomness guarantee needs in contracts logic, it’s advised to use external verifiable oracles (as is advised on Ethereum itself). + +### COINBASE + +Coinbase address on Sei is always set to (the EVM address of) the global fee collector. + +## State Root + +Since Sei uses AVL-tree instead of Merkle Patricia Trie (MPT) for data storage, Sei doesn’t have per-account state root. The global state root is the AVL-tree root which is also not equivalent to Ethereum’s overall state root (which is a MPT root) + +## Block Hash + +The block hash on Sei is computed based on the block header in Tendermint data format, and is different from Ethereum’s block Hash as a result. + +## Base Fee & Tips + +Sei supports all transaction types. However Sei's base fee does not fluctuate due to block congestion. Base fee will always be 0 on Sei - all fees will go to the validators (i.e. tips) and none will be burnt. + +## Block Limit + +Sei has a gas limit of 10M on pacific-1, compared to Ethereum’s 30M. + +In addition, Sei also has a byte size limit of 21MB, whereas Ethereum doesn’t have byte-denominated limits. + +## Non-EVM Transactions + +On Sei there exists non-EVM transactions which may update states accessible by EVM transactions. The simplest example would be bank balances, which may be updated by both native Cosmos bank send transactions and EVM send transactions. +As a result, if certain offchain applications only parse EVM transactions, they may find certain state changes unattributable to any EVM transaction. + +## Finality + +Sei has instant finality, meaning that commitment levels of “safe”, “latest”, “justified”, and “finalized” on Ethereum are all the same thing on Sei. + +## Pending State + +On Ethereum the block proposer would execute its proposed block first (and update its local state) before broadcasting the proposal to others (the updated state would be marked “pending” until the node is accepted by other nodes). + +However, on Sei, the block proposer would broadcast first and only execute the proposal if it’s accepted (i.e. every node would execute the block at roughly the same time), so Sei does not really have a window when “pending state” exists. diff --git a/pages/evm-rpc-endpoints.mdx b/pages/evm-rpc-endpoints.mdx new file mode 100644 index 00000000..5fec0e26 --- /dev/null +++ b/pages/evm-rpc-endpoints.mdx @@ -0,0 +1,470 @@ +# EVM RPC Endpoints +Below is a list of EVM-RPC endpoints provided by default on a Sei RPC node. Your RPC provider may offer slightly different/extended specifications. + +All endpoints are in the form of JSON-RPC and share the following request/response structure: +- Request + - HTTP method: always "GET". + - header: `accept: application/json` + - header: `content-type: application/json` + - body (JSON): + - id: an arbitrary string identifier. + - jsonrpc: always "2.0". + - method: endpoint name (e.g. "eth_sendRawTransaction"). + - params: an array that differs from endpoint to endpoint. +- Response + - body (JSON): + - id: the same identifier in request. + - jsonrpc: always "2.0". + - result: an object that differs from endpoint to endpoint. + + +## Send Transactions +### eth_sendRawTransaction +Sends a signed transaction. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hex-encoding of the signed transaction. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The transaction hash. | + +### sei_associate +Sends a transaction to establish association between the signer's Sei address and EVM address on-chain. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | A custom object containing a string message and the v, r, s of the signed message. | + +Object Schema: +```json +{ + custom_message: // Any string message + r: // The R-part of the signature over the Keccak256 hash of the custom message. + s: // The S-part of the signature over the Keccak256 hash of the custom message. + v: // The V-part of the signature over the Keccak256 hash of the custom message. +} +``` + +## Transaction Lookup +### eth_getTransactionReceipt +Gets the receipt of a sent transaction +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The transaction hash. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [receipt object](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt). | + +### eth_getTransactionByBlockNumberAndIndex +Gets transaction by the block number and the index of the transaction in the block + +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | +| string | The transaction index as a hexadecimal number. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash). | + +### eth_getTransactionByBlockHashAndIndex +Gets transaction by the block hash and the index of the transaction in the block. + +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block hash. | +| string | The transaction index as a hexadecimal number. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash). | + +### eth_getTransactionByHash +Gets transaction by the transaction hash. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The transaction hash. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [transaction details](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionbyhash).| + +## Account Information +### eth_getTransactionCount +Gets the number of transactions sent by the account +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address to look up. | +| string | The block number, which can either be a hexadecimal number, or one of "safe", "finalized", "latest", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the number of transactions. | + +### eth_getBalance +Gets the balance in wei (i.e. 10^-12 usei) of the account +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address to look up. | +| string | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the wei balance. | + +### eth_getCode +Gets EVM code stored at the account address +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address to look up. | +| string | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the code binary. | + +### eth_getStorageAt +Gets value at given key of the account +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address to look up. | +| string | The hexadecimal form of the key. | +| string | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the storage value. | + +### eth_getProof +Gets the IAVL proof (note: not a MPT proof) of the given keys for an account. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address to look up. | +| string[] | The hexadecimal form of the keys. | +| string | The block number or hash, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | An object with data from the IAVL proof. | + +Object Schema: +```json +{ + address: // The requested address. + hexValues: // An array of the hexdecimal form of the values at the given keys. + storageProof: // An array of storage proofs. +} +``` + +Note: The storage proofs in the return object follow this [format](https://github.com/sei-protocol/sei-tendermint/blob/main/proto/tendermint/crypto/proof.pb.go#L272-L274). + +## Block Information +### eth_getBlockTransactionCountByNumber +Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its number. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block number, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the count. | + +### eth_getBlockTransactionCountByHash +Gets the count of EVM transactions (i.e. excluding native Cosmos transactions) in a block by its hash. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block hash. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the count. | + +### eth_getBlockByHash +Gets the block metadata and/or its EVM transactions by block hash +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block hash. | +| bool | Whether to include transactions in the response. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash). | + +### eth_getBlockByNumber +Gets the block metadata and/or its EVM transactions by block number. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block number, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | +| bool | Whether to include transactions in the response. | + + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The [block info](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash). | + +### eth_getBlockReceipts +Gets an array of EVM transaction receipt in a block by block number +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The block number, which can be one of 1. block hash, 2. hexadecimal block number, 3. one of "safe", "finalized", "latest", "pending", or "earliest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object[] | An array of [receipt objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt). | + +## Blockchain Information +### eth_blockNumber +Gets the latest committed block number. +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the block number. | + +### eth_chainId +Gets the chain ID. +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the chain ID. | + +### eth_coinbase +Gets the fee collector address. +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The address of the fee collector. | + +### eth_feeHistory +Gets fee history over the requested block range. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The number of blocks to look at, in either decimal or hexadecimal form. | +| string | The block number, which can either be a hexadecimal number, or one of "safe", "finalized", or "latest". Note that "safe", "finalized", and "latest" mean the same thing on Sei due to its instant finality. | +| float[] | The reward percentiles. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The fee history over the requested block range. | + +### eth_gasPrice +Gets the 50% percentile of gas prices in the most recent block. +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the gas price. | + +### net_version +Gets the version (equal to Chain ID). +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The hexadecimal form of the chainID. | + +### web3_clientVersion +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The RPC node's runtime version. | + +## Filter Endpoints +Note that log filters are subject to the following limits by default: +- 10000 logs in one response if block range is open-ended +- 2000 blocks to query over if block range is close-ended + +Your RPC provider may tweak these limits. + +### eth_newFilter +Creates a new log filter for later queries. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter). | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The newly created filter's ID. | + +### eth_newBlockFilter +Creates a new block filter for later queries. +- **Parameters**: + + None +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The newly created filter's ID. | + +### eth_getFilterChanges +Gets all the updates since the filter was last queried. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The filter ID. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string[] OR object[] | For block filters, the result would be an array of block hashes; for log filters, the result would be an array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). | + +### eth_getFilterLogs +Get all logs for a given log filter, including the logs that have been returned before. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The filter ID. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object[] | An array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). | + + +### eth_getLogs +Get all logs for the given filter criteria. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object | The [filter criteria](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter). | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| object[] | An array of [log objects](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges). | + +### eth_uninstallFilter +Removes a created filter. +- **Parameters**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| string | The filter ID. | + +- **Result**: + +| Type | Description | +| :------------------- | :------------------------------------------------------------------- | +| bool | Whether the filter existed. | + +## Simulation Endpoints +### eth_estimateGas +Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas). + +### eth_call +Same as [the official specification](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call). + +## Debugging Endpoints +### debug_traceTransaction +Same as [Alchemy](https://docs.alchemy.com/reference/debug-tracetransaction). + +### debug_traceBlockByNumber +Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbynumber). + +### debug_traceBlockByHash +Same as [Alchemy](https://docs.alchemy.com/reference/debug-traceblockbyhash). \ No newline at end of file diff --git a/pages/interoperability/overview.mdx b/pages/interoperability/overview.mdx index cf8d6841..98607fff 100644 --- a/pages/interoperability/overview.mdx +++ b/pages/interoperability/overview.mdx @@ -1,6 +1,9 @@ import { ImageWithCaption } from "../../components"; import interoperability from "../../public/assets/interoperability.png"; +# EVM version +Shanghai + # EVM \<\> Wasm Interoperability EVM and Cosmos based applications co-exist on Sei, but live in different execution environments. This creates a challenge for users, who use wallets that typically only support a single execution environment. diff --git a/pages/quickstart/evm-cli-tutorial.mdx b/pages/quickstart/evm-cli-tutorial.mdx new file mode 100644 index 00000000..f0a91edd --- /dev/null +++ b/pages/quickstart/evm-cli-tutorial.mdx @@ -0,0 +1,24 @@ +# Interact with EVM on Sei via CLI +You can query or send transactions to Sei easily via CLI once you have the `seid` command installed (see [Installing Seid](./installing-seid)) + +## Queries +If the machine you run these commands from are not running a node of the network, you'll need to append `--node http://url-to-sei-cosmos-rpc` to your command. Refer to the [Tools and Resources](/tools-and-resources) page for a list of RPC endpoints. + +- `seid q evm sei-addr [some EVM address]`: Gets the associated Sei address of the queried EVM address, if it exists on-chain. +- `seid q evm evm-addr [some Sei address]`: Gets the associated EVM address of the queried Sei address, if it exists on-chain. +- `seid q evm erc20 [erc20 address] [method] [arguments...]`: Query the ERC20 contract at given address using the given method/arguments. +- `seid q evm payload [abi-filepath] [method] [arguments...]`: Generate the hexadecimal payload of the requested method call given an ABI. +- `seid q evm pointer [type] [pointee]`: Gets the pointer contract of the requested pointee. The `type` parameter can be one of "NATIVE", "CW20", "CW721", "ERC20", or "ERC721", and `pointee` is the target contract address. +For "NATIVE" type, `pointee` would be the native denom name instead. + +## Transactions +Sending transactions via CLI requires you to have keys added via `seid keys add`. You can then specify the key you want to use by appending `--from=[key name]` to your command. + +If the machine you run these commands from are not a node of the network, you'd need to append `--evm-rpc http://url-to-sei-evm-rpc` to your command. Refer to the [Tools and Resources](/tools-and-resources) page for a list of RPC endpoints. + +- `seid tx evm associate-address`: Associates the Sei address and EVM address on-chain for the sending key. +- `seid tx evm send [to EVM address] [amount in wei]`: Sends native tokens to the target EVM address. +- `seid tx evm deploy [path_to_binary]`: Deploys the EVM contract specified in `path_to_binary`. +- `seid tx evm call-contract [addr] [payload hex]`: Sends a transaction that calls contract at the target address with the provided payload. +- `seid tx evm erc20-send [addr] [recipient] [amount]`: Sends ERC20 tokens of contract at `addr` to the target recipient. +- `seid tx evm delegate [val-addr] [amount]`: Delegates specified amount to the target validator address. The validator address must be in Sei/Cosmos validator address format. diff --git a/pages/tools-and-resources.mdx b/pages/tools-and-resources.mdx index eb8839f8..e5d318f3 100644 --- a/pages/tools-and-resources.mdx +++ b/pages/tools-and-resources.mdx @@ -45,3 +45,42 @@ To support your development and testing efforts, we provide a range of public RP For more endpoint options, please visit our [chain registry](https://github.com/sei-protocol/chain-registry/blob/main/chains.json). + +## Other Important Contracts + + + +| pacific-1 (Mainnet) | atlantic-2 (Testnet) | arctic-1 (Devnet) | +| :--------------------------------- | :------------------------------------ | :----------------------------------------- | +| Coming Soon | Coming Soon | 0x63600a899ad94ae1bc638504fa56d8a6144df2fe | + + + + +| pacific-1 (Mainnet) | atlantic-2 (Testnet) | arctic-1 (Devnet) | +| :--------------------------------- | :------------------------------------ | :--------------------------------- | +| Coming Soon | Coming Soon | 40258 | + + + + +| pacific-1 (Mainnet) | atlantic-2 (Testnet) | arctic-1 (Devnet) | +| :--------------------------------- | :------------------------------------ | :----------------------------------------- | +| Coming Soon | Coming Soon | Coming Soon | + + + + +| pacific-1 (Mainnet) | atlantic-2 (Testnet) | arctic-1 (Devnet) | +| :--------------------------------- | :------------------------------------ | :--------------------------------- | +| Coming Soon | Coming Soon | Coming Soon | + + + + +| pacific-1 (Mainnet) | atlantic-2 (Testnet) | arctic-1 (Devnet) | +| :--------------------------------- | :------------------------------------ | :--------------------------------- | +| Coming Soon | Coming Soon | Coming Soon | + + + \ No newline at end of file diff --git a/theme.config.tsx b/theme.config.tsx index f022a513..ce59fdb0 100644 --- a/theme.config.tsx +++ b/theme.config.tsx @@ -15,7 +15,6 @@ const config: DocsThemeConfig = { text: "Sei Docs © 2024", }, editLink: { - component: null, }, feedback: { content: null,