From 0415c033b6272d171ffaf7e55af718ed7e106464 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 12 Mar 2025 00:10:05 -0700 Subject: [PATCH 01/10] Separate EVM and CosmWasm - Reorganizes all the files to separate out EVM specific content from CosmWasm specific content. - Consoldates duplicate content - Improved user quickstart - UI and code structure improvements --- content/_meta.js | 17 +- content/build/building-a-frontend.mdx | 721 ------------------ content/build/dev-frontend-dapps.mdx | 122 --- content/build/dev-smart-contracts.mdx | 135 ---- content/build/evm-cli-tutorial.mdx | 50 -- content/build/pointers/_meta.js | 6 - content/build/resources-resources.mdx | 62 -- .../build/resources-tools-and-resources.mdx | 85 --- content/{build => cosmwasm}/_meta.js | 44 +- content/cosmwasm/building-a-frontend.mdx | 542 +++++++++++++ .../{build => cosmwasm}/cosm-wasm-general.mdx | 0 content/{reference => cosmwasm}/cosmos.mdx | 0 .../{learn => cosmwasm}/execute-multiple.mdx | 0 content/{learn => cosmwasm}/fee-grants.mdx | 0 content/{build => cosmwasm}/ibc-protocol.mdx | 0 content/{build => cosmwasm}/index.mdx | 6 +- .../{build => cosmwasm}/installing-seid.mdx | 51 ++ .../multi-sig-accounts.mdx | 0 content/cosmwasm/networks.mdx | 5 + .../nft-contract-tutorial.mdx | 179 +---- content/cosmwasm/pointers/_meta.js | 5 + .../pointers/ibc.mdx} | 0 .../pointers/standard.mdx} | 0 .../pointers/tokenfactory.mdx} | 0 .../{build => cosmwasm}/querying-state.mdx | 0 content/{build => cosmwasm}/seid-devtool.mdx | 0 .../tokenfactory-allowlist.mdx | 0 .../tokenfactory-tutorial.mdx | 0 content/cosmwasm/transactions.mdx | 112 +++ content/evm/_meta.js | 44 ++ content/evm/building-a-frontend.mdx | 273 +++++++ .../differences-with-ethereum.mdx | 0 content/{build => evm}/evm-general.mdx | 0 content/evm/index.mdx | 89 +++ content/{build => evm}/ledger-ethers.mdx | 0 content/{build => evm}/networks.mdx | 2 +- content/evm/nft-contract-tutorial.mdx | 188 +++++ .../{reference => evm}/precompiles/_meta.js | 0 .../{reference => evm}/precompiles/addr.mdx | 0 .../{reference => evm}/precompiles/bank.mdx | 0 .../precompiles/cosmwasm.mdx | 0 .../precompiles/distribution.mdx | 0 .../precompiles/example-usage.mdx | 0 .../precompiles/governance.mdx | 0 .../{reference => evm}/precompiles/ibc.mdx | 0 .../{reference => evm}/precompiles/json.mdx | 0 .../{reference => evm}/precompiles/oracle.mdx | 0 .../precompiles/pointer.mdx | 0 .../precompiles/pointerview.mdx | 0 .../precompiles/staking.mdx | 0 .../{reference/evm.mdx => evm/reference.mdx} | 0 content/{build => evm}/solidity-resources.mdx | 0 content/evm/transactions.mdx | 67 ++ content/index.mdx | 41 +- content/learn/_meta.js | 87 +-- content/learn/account-structure.mdx | 206 ----- content/learn/accounts.mdx | 670 ++++++++++++++++ .../centralized-exchanges.mdx | 0 content/learn/dev-chains.mdx | 24 +- content/learn/dev-gas.mdx | 22 +- content/learn/dev-interoperability.mdx | 26 +- .../{build => learn}/dev-token-standards.mdx | 6 +- content/learn/dev-transactions.mdx | 194 ----- content/{providers => learn}/explorers.mdx | 0 content/{build => learn}/faucet.mdx | 0 content/learn/general-overview.mdx | 78 -- content/learn/hd-path-coin-types.mdx | 295 ------- content/learn/index.mdx | 107 +-- .../indexer-providers}/goldrush.mdx | 0 .../indexer-providers}/goldsky.mdx | 0 .../indexer-providers}/the-graph.mdx | 0 content/learn/indexers.mdx | 14 + content/learn/linking-addresses.mdx | 50 -- content/learn/oracles.mdx | 8 +- .../overview.mdx => learn/pointers.mdx} | 20 +- .../{providers => learn}/rpc-providers.mdx | 0 content/learn/user-quickstart.mdx | 146 +--- content/learn/wallet-association.mdx | 240 ------ .../wallet-integrations}/particle.mdx | 0 .../wallet-integrations}/pimlico.mdx | 0 content/learn/wallet-setup.mdx | 119 --- .../wallets/index.mdx => learn/wallets.mdx} | 17 +- content/providers/_meta.js | 15 - content/providers/index.mdx | 49 -- content/providers/indexers/_meta.js | 5 - content/providers/indexers/index.mdx | 8 - content/providers/oracles.mdx | 8 - content/providers/wallets/_meta.js | 4 - content/reference/_meta.js | 23 - content/reference/index.mdx | 54 -- next.config.mjs | 2 +- src/components/ChainInformation/index.tsx | 86 +-- .../EvmWalletConnect/EvmWalletConnect.tsx | 9 +- src/components/OfficeHoursCard/index.tsx | 4 +- 94 files changed, 2336 insertions(+), 3106 deletions(-) delete mode 100644 content/build/building-a-frontend.mdx delete mode 100644 content/build/dev-frontend-dapps.mdx delete mode 100644 content/build/dev-smart-contracts.mdx delete mode 100644 content/build/evm-cli-tutorial.mdx delete mode 100644 content/build/pointers/_meta.js delete mode 100644 content/build/resources-resources.mdx delete mode 100644 content/build/resources-tools-and-resources.mdx rename content/{build => cosmwasm}/_meta.js (53%) create mode 100644 content/cosmwasm/building-a-frontend.mdx rename content/{build => cosmwasm}/cosm-wasm-general.mdx (100%) rename content/{reference => cosmwasm}/cosmos.mdx (100%) rename content/{learn => cosmwasm}/execute-multiple.mdx (100%) rename content/{learn => cosmwasm}/fee-grants.mdx (100%) rename content/{build => cosmwasm}/ibc-protocol.mdx (100%) rename content/{build => cosmwasm}/index.mdx (95%) rename content/{build => cosmwasm}/installing-seid.mdx (64%) rename content/{build => cosmwasm}/multi-sig-accounts.mdx (100%) create mode 100644 content/cosmwasm/networks.mdx rename content/{build => cosmwasm}/nft-contract-tutorial.mdx (53%) create mode 100644 content/cosmwasm/pointers/_meta.js rename content/{build/pointers/pointer-ibc.mdx => cosmwasm/pointers/ibc.mdx} (100%) rename content/{build/pointers/pointer-contracts.mdx => cosmwasm/pointers/standard.mdx} (100%) rename content/{build/pointers/pointer-tokenfactory.mdx => cosmwasm/pointers/tokenfactory.mdx} (100%) rename content/{build => cosmwasm}/querying-state.mdx (100%) rename content/{build => cosmwasm}/seid-devtool.mdx (100%) rename content/{build => cosmwasm}/tokenfactory-allowlist.mdx (100%) rename content/{build => cosmwasm}/tokenfactory-tutorial.mdx (100%) create mode 100644 content/cosmwasm/transactions.mdx create mode 100644 content/evm/_meta.js create mode 100644 content/evm/building-a-frontend.mdx rename content/{learn => evm}/differences-with-ethereum.mdx (100%) rename content/{build => evm}/evm-general.mdx (100%) create mode 100644 content/evm/index.mdx rename content/{build => evm}/ledger-ethers.mdx (100%) rename content/{build => evm}/networks.mdx (67%) create mode 100644 content/evm/nft-contract-tutorial.mdx rename content/{reference => evm}/precompiles/_meta.js (100%) rename content/{reference => evm}/precompiles/addr.mdx (100%) rename content/{reference => evm}/precompiles/bank.mdx (100%) rename content/{reference => evm}/precompiles/cosmwasm.mdx (100%) rename content/{reference => evm}/precompiles/distribution.mdx (100%) rename content/{reference => evm}/precompiles/example-usage.mdx (100%) rename content/{reference => evm}/precompiles/governance.mdx (100%) rename content/{reference => evm}/precompiles/ibc.mdx (100%) rename content/{reference => evm}/precompiles/json.mdx (100%) rename content/{reference => evm}/precompiles/oracle.mdx (100%) rename content/{reference => evm}/precompiles/pointer.mdx (100%) rename content/{reference => evm}/precompiles/pointerview.mdx (100%) rename content/{reference => evm}/precompiles/staking.mdx (100%) rename content/{reference/evm.mdx => evm/reference.mdx} (100%) rename content/{build => evm}/solidity-resources.mdx (100%) create mode 100644 content/evm/transactions.mdx delete mode 100644 content/learn/account-structure.mdx create mode 100644 content/learn/accounts.mdx rename content/{providers => learn}/centralized-exchanges.mdx (100%) rename content/{build => learn}/dev-token-standards.mdx (95%) delete mode 100644 content/learn/dev-transactions.mdx rename content/{providers => learn}/explorers.mdx (100%) rename content/{build => learn}/faucet.mdx (100%) delete mode 100644 content/learn/general-overview.mdx delete mode 100644 content/learn/hd-path-coin-types.mdx rename content/{providers/indexers => learn/indexer-providers}/goldrush.mdx (100%) rename content/{providers/indexers => learn/indexer-providers}/goldsky.mdx (100%) rename content/{providers/indexers => learn/indexer-providers}/the-graph.mdx (100%) create mode 100644 content/learn/indexers.mdx delete mode 100644 content/learn/linking-addresses.mdx rename content/{build/pointers/overview.mdx => learn/pointers.mdx} (64%) rename content/{providers => learn}/rpc-providers.mdx (100%) delete mode 100644 content/learn/wallet-association.mdx rename content/{providers/wallets => learn/wallet-integrations}/particle.mdx (100%) rename content/{providers/wallets => learn/wallet-integrations}/pimlico.mdx (100%) delete mode 100644 content/learn/wallet-setup.mdx rename content/{providers/wallets/index.mdx => learn/wallets.mdx} (81%) delete mode 100644 content/providers/_meta.js delete mode 100644 content/providers/index.mdx delete mode 100644 content/providers/indexers/_meta.js delete mode 100644 content/providers/indexers/index.mdx delete mode 100644 content/providers/oracles.mdx delete mode 100644 content/providers/wallets/_meta.js delete mode 100644 content/reference/_meta.js delete mode 100644 content/reference/index.mdx diff --git a/content/_meta.js b/content/_meta.js index 2c89274e..58e1b8e6 100644 --- a/content/_meta.js +++ b/content/_meta.js @@ -1,6 +1,7 @@ export default { index: { display: 'hidden', + title: 'Home', theme: { sidebar: false, breadcrumb: false @@ -10,20 +11,16 @@ export default { title: 'Learn', type: 'page' }, - build: { - title: 'Build', + evm: { + title: 'EVM', type: 'page' }, - node: { - title: 'Operate', - type: 'page' - }, - reference: { - title: 'Reference', + cosmwasm: { + title: 'CosmWasm', type: 'page' }, - providers: { - title: 'Providers', + node: { + title: 'Operate', type: 'page' } }; diff --git a/content/build/building-a-frontend.mdx b/content/build/building-a-frontend.mdx deleted file mode 100644 index 65b49fa2..00000000 --- a/content/build/building-a-frontend.mdx +++ /dev/null @@ -1,721 +0,0 @@ -import { Callout, Tabs } from 'nextra/components'; - -# Building a Frontend - -## Introduction - -In this tutorial, we'll demonstrate how to set up a frontend project using -React. You'll learn how to connect to a Sei wallet and interact with EVM and -CosmWasm smart contracts deployed on Sei. - -Select one of the tabs below to get started! - - - -In this section, we'll explore Sei's unique interoperability features by building an EVM compatible DApp that interacts with a CosmWasm smart contract. -We will use [ethers.js](https://docs.ethers.org/v6/) to build a React app that interacts with a CosmWasm smart contract using the Sei [CosmWasm precompile](https://github.com/sei-protocol/sei-chain/tree/main/precompiles/wasmd). - -## Prerequisites - -- Complete the tutorial in [cosmwasm-general](build/cosmwasm-general) to deploy - a CosmWasm counter contract on our devnet (arctic-1). - -## Requirements - -Before starting, ensure you have: - -- Node.js & NPM installed -- One of the Sei wallets listed [here](providers/wallets/wallets) - -## Creating a React Project - -Start by creating a new React project using Vite's TypeScript template for -streamlined development: - -```bash copy -npm create vite@latest my-counter-frontend -- --template react-ts -``` - -This command creates a new folder with a React project using TypeScript. Open -`my-counter-frontend` in your favorite IDE. - -The rest of this tutorial will be in TypeScript. If you're not using TypeScript, you can easily adjust by removing the types. - -## Installing Dependencies - -Install `ethers`, an Ethereum library that facilitates interaction with the -Ethereum blockchain: - -```bash copy -npm install ethers -``` - -## Defining Contract Addresses and ABI - -In this tutorial, we will be using the **Wasm Precompile** to interact with our -CosmWasm contract from the EVM. Precompiles (short for Precompiled contracts) -are EVM compatible contracts that are built into the chain. -The Wasm Precompile -is a unique smart contract on Sei that enables EVM clients to query and execute -CosmWasm contracts. Refer to the docs on -[precompiles](reference/precompiles/example-usage) for -more details. - -First, import the address and ABI of the CosmWasm precompile from `@sei-js/evm`. - -`@sei-js` contains NPM libraries for writing applications that interact with Sei. Learn more [here](https://github.com/sei-protocol/sei-js/tree/main). - -`@sei-js/evm` is an npm package that contains useful constants and helpers for -interacting with the EVM on Sei. - -To install sei-js: - -```bash copy -npm install @sei-js/evm -``` - -At the top of `App.tsx` you can then import `WASM_PRECOMPILE_ADDRESS`, -`WASM_PRECOMPILE_ABI`. These constants allow us to interact with the Wasm -Precompile. - -```tsx copy -import { WASM_PRECOMPILE_ADDRESS, WASM_PRECOMPILE_ABI, WasmPrecompileContract } from '@sei-js/evm'; -import { ethers } from 'ethers'; -``` - -These values will be used in the app to query and execute a contract. - -## Connecting to the Wallet and Initializing the Contract - -Replace your main `App` component with the following: - -```tsx copy filename="App.tsx" -import { WASM_PRECOMPILE_ADDRESS, SEI_CHAIN_INFO, getWasmPrecompileEthersV6Contract } from '@sei-js/evm'; -import { useEffect, useState } from 'react'; -import { BrowserProvider, Contract, toUtf8Bytes, toUtf8String } from 'ethers'; -import './App.css'; - -function App() { - const [count, setCount] = useState(); - const [contract, setContract] = useState(); - const [isIncrementing, setIsIncrementing] = useState(false); - - // TODO: Replace this with your CosmWasm contract address here - const COUNTER_CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m'; - - const fetchCount = async () => { - if (!contract) { - return; - } - // Query to get the count on the counter contract - const queryMsg = { get_count: {} }; - const queryResponse = await contract.query(COUNTER_CONTRACT_ADDRESS, toUtf8Bytes(JSON.stringify(queryMsg))); - const { count } = JSON.parse(toUtf8String(queryResponse)); - setCount(count); - }; - - useEffect(() => { - fetchCount(); - }, [contract]); - - const connectWallet = async () => { - if (window.ethereum) { - const provider = new BrowserProvider(window.ethereum); - const { chainId } = await provider.getNetwork(); - const devnetChainId = SEI_CHAIN_INFO.devnet.chainId; - if (chainId !== BigInt(devnetChainId)) { - alert('Wallet is not connected to Sei EVM devnet'); - return; - } - - const signer = await provider.getSigner(); - const contract = getWasmPrecompileEthersV6Contract(signer); - - setContract(contract); - } else { - alert('No EVM compatible wallet installed'); - } - }; - - const incrementCount = async () => { - if (!contract) { - return; - } - - setIsIncrementing(true); - // Execute message to increment the count on the contract - const executeMsg = { increment: {} }; - const executeResponse = await contract.execute( - COUNTER_CONTRACT_ADDRESS, - toUtf8Bytes(JSON.stringify(executeMsg)), - toUtf8Bytes(JSON.stringify([])) // Used for sending funds if needed - ); - // Wait for the transaction to be confirmed - await executeResponse.wait(); - console.log(executeResponse); - setIsIncrementing(false); - await fetchCount(); - }; - - return ( - <> -
- {contract ? ( -
-

Count is {count}

- -
- ) : ( - - )} -
- - ); -} - -export default App; -``` - -### Detailed outline of `App.tsx` - -**State Declarations** - -- `count`: Holds the current count fetched from the smart contract. -- `contract`: An instance of the ethers Contract object, used for interacting - with the blockchain. -- `isIncrementing`: A boolean to manage UI state during contract execution - -**Effect Hooks** - -A single `useEffect` hook to fetch the current count whenever the contract state -changes, indicating that the contract instance is ready for interaction. - -**Connecting to EVM Wallet** - -A function named `connectWallet` that: - -- Checks for any EVM compatible wallet extension. -- Establishes a connection to the Ethereum network via the connected wallet, - using ethers.js BrowserProvider. -- Verifies the correct network (Sei EVM devnet) by comparing chainId. -- Creates an ethers.js Contract instance with the signer from the wallet, - setting it in the contract state for later use. - -**Fetching Contract Data** - -A function named `fetchCount` that: - -- Executes a contract query to get the current count. -- Parses and updates the count state with the response. - -**Incrementing the Counter** - -A function named `incrementCount` that: - -- Sends a transaction to the smart contract to increment the count. -- Waits for the transaction to be confirmed. -- Refetches the count to update the UI with the new value. - -To see your app in action, run `npm run dev` to spin up a local version of the -application. Once you connect your wallet, you should see a counter, as well as -a button you can use to increment the counter on the contract. - -Congrats on deploying your first interoperable dApp on Sei! - -
- -In this section, we'll use the [@sei-js](https://github.com/sei-protocol/sei-js/) library to build a React app that interacts with a CosmWasm contract. - -## Requirements - -Before starting, ensure you have: - -- Node.js & NPM installed -- A Sei wallet extension, such as: - - [Compass](https://compasswallet.io/) - - [Fin](https://finwallet.com/) - -## Creating a React Project - -If you're starting a project from scratch, consider using the TypeScript -template from Vite for easier development and debugging. - -```bash copy -npm create vite@latest my-counter-frontend -- --template react-ts -``` - -This command creates a new folder with a React project using TypeScript. Open -`my-counter-frontend` in your favorite IDE. - -The rest of this tutorial will be in TypeScript. If you're not using TypeScript, you can easily adjust by removing the types. - -## Installing Dependencies - -From the terminal at the root of your project, install the required -dependencies: `@sei-js/core` and `@sei-js/react`. - -```bash copy -npm install @sei-js/core @sei-js/react -``` - -`@sei-js` contains NPM libraries for writing applications that interact with Sei. Learn more [here](https://github.com/sei-protocol/sei-js/tree/main). - -## Wrapping App in SeiWalletProvider - -Replace the code in your `App.tsx` file with the following to set up a -`SeiWalletProvider` context, define your chain info, and set connection URLs. - -```tsx copy -import { SeiWalletProvider } from '@sei-js/react'; -import './App.css'; -import Home from './Home.tsx'; - -function App() { - return ( - // Set up SeiWalletProvider for easy wallet connection and to use hooks in @sei-js/react - - - - ); -} - -export default App; -``` - -### Detailed outline of `App.tsx` - -**Wallet Provider Setup** - -- Imports `SeiWalletProvider` from the `@sei-js/react` package. -- Wraps `App` with `SeiWalletProvider` for wallet context. - -**Chain Configuration** - -- Specifies the `chainConfiguration` prop in `SeiWalletProvider` to set up the - blockchain network: - - `chainId`: Identifies the Sei network (in this case, `arctic-1`). - - `restUrl`: REST URL for the Sei (You may need your own provider). - - `rpcUrl`: RPC URL for the Sei (You may need your own provider). - -**Supported Wallets** - -- Sets up supported wallet types (`'compass'`, `'fin'`, `'leap'`, `'keplr'`) in - the wallets prop. - -## Adding Home Component - -Create a file named `Home.tsx` in your `src` directory with the following code: - -```tsx copy -import { useCallback, useEffect, useState } from 'react'; -import { useCosmWasmClient, useSigningCosmWasmClient, useWallet, WalletConnectButton } from '@sei-js/react'; - -// arctic-1 example contract -const CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m'; - -function Home() { - const [count, setCount] = useState(); - const [error, setError] = useState(''); - const [isIncrementing, setIsIncrementing] = useState(false); - - // Helpful hook for getting the currently connected wallet and chain info - const { connectedWallet, accounts } = useWallet(); - - // For querying cosmwasm smart contracts - const { cosmWasmClient: queryClient } = useCosmWasmClient(); - - // For executing messages on cosmwasm smart contracts - const { signingCosmWasmClient: signingClient } = useSigningCosmWasmClient(); - - const fetchCount = useCallback(async () => { - const response = await queryClient?.queryContractSmart(CONTRACT_ADDRESS, { - get_count: {} - }); - return response?.count; - }, [queryClient]); - - useEffect(() => { - fetchCount().then(setCount); - }, [connectedWallet, fetchCount]); - - const incrementCounter = async () => { - setIsIncrementing(true); - try { - const senderAddress = accounts[0].address; - - // Build message content - const msg = { increment: {} }; - - // Define gas price and limit - const fee = { - amount: [{ amount: '20000', denom: 'usei' }], - gas: '200000' - }; - - // Call smart contract execute msg - await signingClient?.execute(senderAddress, CONTRACT_ADDRESS, msg, fee); - - // Updates the counter state again - const updatedCount = await fetchCount(); - setCount(updatedCount); - - setIsIncrementing(false); - setError(''); - } catch (error) { - if (error instanceof Error) { - setError(error.message); - } else { - setError('unknown error'); - } - setIsIncrementing(false); - } - }; - - // Helpful component for wallet connection - if (!connectedWallet) return ; - - return ( -
-

Count is: {count ? count : '---'}

- - {error &&

{error}

} -
- ); -} - -export default Home; -``` - -We deployed a counter contract on the `arctic-1` testnet. Contract address: -`sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m`. Learn more -about this contract [here](https://github.com/CosmWasm/cw-template). - -### Detailed outline of `Home.tsx` - -**Render Logic** - -- Shows `WalletConnectButton` if no wallet is connected. -- Otherwise, displays the counter value and an "Increment" button. -- Disables the button when a transaction is pending. -- Catches and displays error messages, if any. - -**Wallet and Client Setup** - -- Utilizes `useWallet` hook from `@sei-js/react` to get the connected wallet and - accounts. -- Uses `useCosmWasmClient` and `useSigningCosmWasmClient` hooks from - `@sei-js/react` to instantiate `queryClient` and `signingClient`. The signing - client can be used for querying, but it is not recommended to use a signing - client when only a query client is needed. - -**Fetching Counter Value** - -- `fetchCount` function uses `queryClient.queryContractSmart` to query the smart - contract with the query `{ get_count: {} }`. - -**Incrementing Counter** - -- `incrementCounter` function: - - Extracts `senderAddress` from the connected wallet's accounts. - - Builds a message with `{ increment: {} }` to be sent to the smart contract. - - Specifies the transaction fee with gas price and gas limit. - - Calls `signingClient.execute` to execute the contract with the built message - and fee. - -By leveraging `@sei-js` and its hooks, the component provides a way to connect -to a wallet, query a CosmWasm smart contract to get the current counter state, -and increment it with an execute message. - -## Running the App - -Run `npm run dev` and navigate to http://localhost:5173/ to view your -application. - -If this is your first time using Sei, you might see an error which says your account does not exist on chain. You can claim some testnet tokens for development purposes from a faucet [here](https://t.me/+31M9Ig2z2-w2OTdk). - -
-
- -🎉 Congratulations on creating a website for querying and executing a smart -contract on Sei! Explore more possibilities with your frontend at our -[@sei-js repo](https://github.com/sei-protocol/sei-js/tree/main). - -## Beyond Simple Contracts: Advanced CosmWasm Interactions - -While our counter example demonstrated the basics of connecting to and interacting with a CosmWasm contract through the WASM precompile, CosmWasm contracts offer much more sophisticated capabilities. One of their most powerful features is their ability to describe their own interfaces, eliminating the need for external ABIs (Application Binary Interfaces) that are typically required for EVM contract interactions. - -Let's explore these advanced features by building a component that interacts with a CW721 (NFT) contract. This example will demonstrate contract discovery, handling different response formats, and implementing robust error handling - skills that are essential when working with more complex CosmWasm contracts. - -# Advanced CosmWasm Contract Interactions Through the WASM Precompile - -## Introduction - -While our basic counter example demonstrated simple contract interactions, CosmWasm contracts offer much more sophisticated capabilities than traditional EVM contracts. One of their most powerful features is their ability to describe their own interfaces, eliminating the need for external ABIs (Application Binary Interfaces) that are required for EVM contract interactions. - -In this guide, we'll explore these advanced features and learn how to build more complex applications that leverage the full power of CosmWasm contracts through Sei's WASM precompile. - -## Understanding CosmWasm Contract Discovery - -Unlike EVM contracts where you need detailed interface specifications beforehand, CosmWasm contracts can tell you exactly how to interact with them. This self-describing capability makes them particularly developer-friendly and reduces the chance of interface mismatches. - -Let's explore how to implement this discovery mechanism: - -```typescript copy -async function discoverContractMethods(contractAddress: string) { - // We intentionally send an invalid query - the contract will respond with valid methods - const invalidQuery = { a: 'b' }; - - try { - await contract.query(contractAddress, toUtf8Bytes(JSON.stringify(invalidQuery))); - // If we reach here, something unexpected happened - console.log('Unexpected success - contract accepted invalid query'); - return null; - } catch (error) { - if (error.data) { - const errorMessage = toUtf8String(error.data); - - // The error message contains a list of valid methods - // Format: "expected one of method1, method2, method3: query wasm contract failed" - const match = errorMessage.match(/expected one of (.+): query wasm contract failed/); - if (match) { - const validMethods = match[1] - .replace(/`/g, '') - .split(', ') - .map((method) => method.trim()); - console.log('Valid query methods:', validMethods); - return validMethods; - } - } - console.error('Unexpected error structure:', error); - return null; - } -} -``` - -When we run this against a CW721 (NFT) contract, we might receive a response like this: - -```javascript copy -[ - 'owner_of', // Query the owner of a specific token - 'approval', // Check if an address is approved for a token - 'approvals', // List all approvals for a token - 'operator', // Check if an address is an operator - 'all_operators', // List all operators - 'num_tokens', // Get total supply of tokens - 'contract_info', // Get contract metadata - 'nft_info', // Get metadata for a specific token - 'all_nft_info', // Get all info for a specific token - 'tokens', // List tokens owned by an address - 'all_tokens', // List all tokens in the collection - 'minter', // Get the minting authority - 'extension', // Access CW721 extensions - 'ownership' // Query contract ownership -]; -``` - -## Building an NFT Information Component - -Let's create a practical example that uses these discovered methods to interact with a CW721 contract. This component will display both collection-wide information and individual token details: - -```typescript copy -function NFTViewer() { - const [methods, setMethods] = useState([]); - const [collectionOwner, setCollectionOwner] = useState(); - const [tokenOwner, setTokenOwner] = useState(); - const [contract, setContract] = useState(); - const [tokenId, setTokenId] = useState('1'); - const [isLoading, setIsLoading] = useState(false); - - const NFT_CONTRACT_ADDRESS = "sei1g2a0q3tddzs7vf7lk45c2tgufsaqerxmsdr2cprth3mjtuqxm60qdmravc"; - - // Query collection ownership - const queryCollectionOwner = async () => { - try { - // The ownership query returns collection-level ownership information - const queryMsg = { ownership: {} }; - const queryResponse = await contract.query( - NFT_CONTRACT_ADDRESS, - toUtf8Bytes(JSON.stringify(queryMsg)) - ); - const responseData = JSON.parse(toUtf8String(queryResponse)); - - // Handle different response formats - some contracts nest data differently - const owner = responseData.data?.owner || responseData.owner; - setCollectionOwner(owner); - } catch (error) { - console.error('Error querying collection owner:', error); - } - }; - - // Query specific token ownership - const queryTokenOwner = async (tokenId: string) => { - try { - setIsLoading(true); - // The owner_of query returns ownership information for a specific token - const queryMsg = { owner_of: { token_id: tokenId } }; - const queryResponse = await contract.query( - NFT_CONTRACT_ADDRESS, - toUtf8Bytes(JSON.stringify(queryMsg)) - ); - const responseData = JSON.parse(toUtf8String(queryResponse)); - const owner = responseData.data?.owner || responseData.owner; - setTokenOwner(owner); - } catch (error) { - console.error('Error querying token owner:', error); - } finally { - setIsLoading(false); - } - }; - - // Discover available methods when component mounts or contract changes - useEffect(() => { - if (!contract) return; - discoverContractMethods(NFT_CONTRACT_ADDRESS) - .then(setMethods); - }, [contract]); - - return ( -
-

NFT Collection Info

-
-

Collection Address: {NFT_CONTRACT_ADDRESS}

-

Collection Owner: {collectionOwner || 'Loading...'}

-

Available Methods: {methods?.join(', ') || 'Loading...'}

-
- -
-

Token Ownership Lookup

-
- setTokenId(e.target.value)} - placeholder="Enter token ID" - /> - -
- {tokenOwner && ( -
-

Token {tokenId} Owner: {tokenOwner}

-
- )} -
-
- ); -} -``` - -## Understanding CosmWasm Response Formats - -CosmWasm contracts can return data in various formats, and it's important to handle these variations properly. Here are some example responses you might receive: - -- Collection Ownership Query Response: - -```json copy -{ - "owner": "sei1hjsqrfdg2hvwl3gacg4fkznurf36usrv7rkzkyh29wz3guuzeh0snslz7d", - "pending_owner": null, - "pending_expiry": null -} -``` - -- Token Ownership Query Response: - -```json copy -{ - "owner": "sei1frcndtm928xln5awxz4rcrh3f5exskjczrc92f", - "approvals": [] -} -``` - -Notice how these responses have different structures. That's why our code uses a flexible approach to extract the owner: - -```typescript copy -const owner = responseData.data?.owner || responseData.owner; -``` - -## Creating a Reusable Query Function - -To make contract interactions more maintainable, consider creating a reusable query function: - -```typescript copy -async function queryContract(address: string, queryMsg: object) { - try { - const response = await contract.query(address, toUtf8Bytes(JSON.stringify(queryMsg))); - - const result = JSON.parse(toUtf8String(response)); - // Handle both nested and direct data structures - return result.data ?? result; - } catch (error) { - if (error.data) { - const errorMessage = toUtf8String(error.data); - // Check if this is a method discovery error - if (errorMessage.includes('expected one of')) { - console.log('Available methods:', errorMessage); - } - } - throw error; - } -} -``` - -## Best Practices for CosmWasm Contract Interactions - -When building applications that interact with CosmWasm contracts through the WASM precompile, follow these guidelines: - -1. **Always Start with Discovery**: Use the contract's self-describing capabilities to understand its interface. This prevents errors and makes your code more maintainable. - -2. **Handle Response Variations**: CosmWasm contracts might return data in different formats. Always implement robust response parsing that can handle various structures. - -3. **Implement Proper Error Handling**: CosmWasm contracts provide detailed error messages that can help diagnose issues. Make use of this information in your error handling. - -4. **Manage Loading States**: Always provide clear feedback about the state of contract interactions to improve user experience. - -5. **Cache Method Information**: Consider caching the discovered methods to reduce unnecessary queries, but make sure to refresh this cache periodically. - -## Error Handling Examples - -Here's how to handle different types of errors you might encounter: - -```typescript copy -try { - const result = await queryContract(address, queryMsg); - // Handle success -} catch (error) { - if (error.data) { - const errorMessage = toUtf8String(error.data); - if (errorMessage.includes('expected one of')) { - // This is a method discovery error - might be useful! - console.log('Valid methods:', errorMessage); - } else if (errorMessage.includes('not found')) { - // Handle non-existent tokens or resources - console.log('Resource not found'); - } else { - // Handle other contract-specific errors - console.log('Contract error:', errorMessage); - } - } else { - // Handle network or other errors - console.error('Network or system error:', error); - } -} -``` - -## Conclusion - -CosmWasm contracts offer powerful capabilities that go beyond traditional EVM contracts. Their self-describing nature and flexible query system make them particularly well-suited for building robust and maintainable applications. By understanding and leveraging these features through the WASM precompile, you can create more sophisticated and user-friendly applications on the Sei network. diff --git a/content/build/dev-frontend-dapps.mdx b/content/build/dev-frontend-dapps.mdx deleted file mode 100644 index 1fe4609e..00000000 --- a/content/build/dev-frontend-dapps.mdx +++ /dev/null @@ -1,122 +0,0 @@ -# Frontend Development - -Developing the frontend of a dApp on Sei involves connecting to wallets, -interacting with the blockchain via RPC endpoints, and signing and broadcasting -transactions. dApps should choose either EVM or Cosmos for their connection, but -can use interoperability features such as precompiles and pointer contracts to -support both environments. - -### Wallet Connection - -Connecting to wallets is a crucial step in developing dApps. Here are some -recommended libraries for wallet connection, each with its specific advantages: - -### EVM and EVM RPC dApps: - -- **Wagmi**: A React-based library for Ethereum dApps that simplifies wallet - connection and interaction. Provides hooks for interacting with Ethereum - wallets and contracts for use with modern frontend libraries and frameworks. - - [Wagmi Documentation](https://wagmi.sh/) -- **Viem**: A lightweight and flexible library for Ethereum development. - - [Viem Documentation](https://viem.sh/docs/getting-started) -- **Ethers.js**: A complete and compact library for interacting with the - Ethereum blockchain and its ecosystem. Known for its simplicity and extensive - functionality. - - [Ethers.js Documentation](https://docs.ethers.io/v6/) - -### CosmWasm/Cosmos RPC dApps - -- **CosmosKit**: A React-based library for Cosmos ecosystem dApps, facilitating - wallet connection and interaction. Supports all Sei native wallets as well as - cross-chain wallets like Keplr and Leap. - - [CosmosKit Documentation](https://github.com/cosmology-tech/cosmos-kit) -- **CosmJS**: A JavaScript library for interacting with Cosmos blockchains, - providing tools to handle wallet connections, transactions, and more. Offers - comprehensive tools for Cosmos SDK based blockchains. - - [CosmJS Documentation](https://cosmos.github.io/cosmjs/) - -### RPC Endpoints - -dApps need to connect to an RPC provider in order to broadcast transactions or -to query the chain. There are many free providers on testnet and devnet, and a -few rate limited providers on mainnet. See the RPC providers section for more -info and links - -### @sei-js Helper Libraries - -The `@sei-js` package provides various helper libraries to facilitate -interaction with the Sei blockchain. Use `@sei-js/cosmjs` and `@sei-js/proto` -for Cosmos side interactions, and `@sei-js/evm` for EVM side interactions. - -- **/cosmjs**: Provides helpful wrappers around CosmJS, CosmosKit, and more; - specifically tailored for the Cosmos side of Sei. - - [@sei-js/cosmjs](https://www.npmjs.com/package/@sei-js/cosmjs) -- **/evm:** A library designed to simplify EVM interaction from - Typescript/Javascript, this library includes precompile contracts and helpers - for interaction with Wagmi/Viem and Ethers.js. - - [@sei-js/evm](https://www.npmjs.com/package/@sei-js/evm) -- **/proto**: A TypeScript typed library for Cosmos and CosmWasm dApps that - provides query clients and typed message and response structures to help avoid - runtime errors. - - [@sei-js/proto](https://www.npmjs.com/package/@sei-js/proto) - -### Polyfills Warning - -When developing frontend applications for the blockchain, it's important to be -aware that some libraries may require polyfills, especially when used in browser -environments. For instance, the `Buffer` class and other Node.js-specific -features are not natively available in browsers and need to be polyfilled. - -If you are using Vite or another rollup based frontend library you can add the -following to the entry point of your app. - -```tsx copy -import { Buffer } from 'buffer'; - -// Polyfill self for browser and global for Node.js -const globalObject = typeof self !== 'undefined' ? self : global; - -Object.assign(globalObject, { - process: process, - Buffer: Buffer -}); -``` - -If you are using a Webpack based bundling tool you can use the following plugin -in you Webpack config. - -``` -yarn add -D node-polyfill-webpack-plugin -``` - -```tsx copy -import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; - -... // the rest of your webpack config -plugins: [ - ... - new NodePolyfillPlugin(), - ... -], -... -``` - -Using proto files (@sei-js/proto) - -### Tips for New Developers - -1. **Understanding Gas Fees**: Gas fees are crucial for executing transactions - on the blockchain. Ensure you understand how they work and how to optimize - your contracts to minimize gas usage. -2. **Security Practices**: Always follow best security practices. Regularly - audit your code and stay updated with the latest security vulnerabilities and - patches. -3. **Testing**: Thoroughly test your dApps in different environments to ensure - they work correctly. Use testnets and faucets to test transactions without - spending real tokens. -4. **Documentation**: Make use of the extensive documentation available for each - library and tool. Good documentation can significantly speed up your - development process. -5. **Community and Support**: Join developer communities, forums, and chat - groups. Engaging with other developers can provide valuable insights and help - you solve problems more efficiently. diff --git a/content/build/dev-smart-contracts.mdx b/content/build/dev-smart-contracts.mdx deleted file mode 100644 index d362d1e8..00000000 --- a/content/build/dev-smart-contracts.mdx +++ /dev/null @@ -1,135 +0,0 @@ -import { Callout } from 'nextra/components'; - -# VM Smart Contracts - -Smart contracts are self-executing contracts with their own state. On Sei, -developers have the flexibility to use both the EVM (Ethereum Virtual Machine) -and CosmWasm for smart contract development, allowing for a broad range of -decentralized applications (dApps) and interoperability between the two -ecosystems. - - - Sei uses optimistic parallelization to increase throughput and efficiency of both EVM and CosmWasm VM environments. This approach significantly increases the number of TPS without requiring developers to additional define dependencies in their smart contracts. - - -## Choosing a VM - -When developing smart contracts on Sei, developers have the option to choose -between using the EVM and CosmWasm. Each approach has its own benefits and -trade-offs, and the best choice depends on the specific requirements and context -of the project. Here, we will compare EVM and CosmWasm to help you make an -informed decision. - -### EVM - -The EVM is a decentralized computation engine that allows the execution of smart -contracts on Ethereum and EVM-compatible blockchains. EVM contracts are -typically written in Solidity, a language designed for Ethereum. - -**Benefits**: - -- **Compatibility**: EVM is by far the most widely supported and allows for the - use of existing Ethereum tools, libraries, and wallets (such as MetaMask). - This makes it seamless to port existing Ethereum dApps to the Sei blockchain. -- **Developer Ecosystem**: The large Ethereum developer community means - extensive resources, tutorials, and libraries are available. - -**Considerations**: - -- **Language**: Solidity, while powerful, has a steeper learning curve compared - to some other languages. - -**Use Cases**: - -- Projects requiring compatibility with existing Ethereum infrastructure. -- Developers with a background in Ethereum development. -- Applications benefiting from Ethereum’s mature tooling and ecosystem. - -The EVM is a decentralized computation engine that allows the execution of smart -contracts on Ethereum and EVM-compatible blockchains. EVM contracts are -typically written in Solidity, a language designed for Ethereum. - -- **MetaMask**: Popular Ethereum wallet. - - [MetaMask](https://metamask.io/) -- **Remix**: IDE that enables users to build Ethereum contracts. - - [Remix](https://remix.ethereum.org/) -- **Hardhat**: Development environment for Ethereum. - - [Hardhat Documentation](https://hardhat.org/hardhat-runner/docs/getting-started) -- **Foundry**: Fast and portable toolkit for Ethereum development. - - [Foundry Documentation](https://github.com/foundry-rs/foundry) -- **Wagmi**: React hooks library for Ethereum dApps. - - [Wagmi Documentation](https://wagmi.sh/) -- **Viem**: A lightweight and flexible library for Ethereum development. - - [Viem Documentation](https://viem.sh/) - -### CosmWasm - -CosmWasm is a smart contract platform built for the Cosmos ecosystem, enabling -contracts to be written in WebAssembly (Wasm) languages, with Rust being the -most commonly used. - -**Benefits**: - -- **Language Flexibility**: Supports multiple programming languages that compile - to Wasm, though Rust is preferred for its performance and safety features. -- **Modularity**: CosmWasm’s architecture encourages modular contract design, - making it easier to upgrade and maintain. -- **Integration with Cosmos**: Seamlessly integrates with other Cosmos chains, - leveraging the extensive Cosmos ecosystem and its IBC (Inter-Blockchain - Communication) protocol. - -**Considerations**: - -- **Learning Curve**: Developers need to be familiar with Rust or other - Wasm-supported languages. -- **Ecosystem**: While growing, the CosmWasm ecosystem is smaller compared to - Ethereum’s. - -**Use Cases**: - -- Projects requiring high performance and security. -- Applications benefiting from Cosmos features and interoperability. -- Developers with a background in Rust or other Wasm-supported languages. - -**Example Tools**: - -- **[CosmWasm](https://docs.cosmwasm.com/)**: Platform for building smart - contracts on Cosmos. -- **[CosmosKit](https://github.com/cosmology-tech/cosmos-kit)**: Library for - connecting to Cosmos wallets. -- **[@sei-js](https://github.com/sei-protocol/sei-js)**: Typescript library for - interacting with Sei. -- **[CosmJS](https://cosmos.github.io/cosmjs/)**: JavaScript library for - interacting with Cosmos blockchains. - - - **Built in interoperability**: - No matter which VM you choose, EVM and CosmWasm contracts can interact seamlessly with each other via two main mechanisms. - -- **EVM Precompile Contracts**: Precompiles are smart contracts pre-bundled into - the chain. Sei has many precompiles to enable EVM dApps and contracts to - access native Cosmos functions, such as staking and executing CosmWasm - contracts. -- **Pointer Contracts**: These contracts act as intermediaries, enabling calls - between EVM and CosmWasm contracts. This allows developers to leverage the - strengths of both environments and create more versatile dApps. - - - -## Best Practices - -Security is paramount in smart contract development. Here are some best -practices to ensure your contracts are secure: - -- **Code Audits**: Regularly audit your code to identify and fix - vulnerabilities. -- **Use Established Libraries**: Leverage well-tested libraries and frameworks - to reduce the risk of introducing bugs. -- **Write Quality Code**: Adhere to best practices for smart contract - development, such as proper error handling, using safe math libraries, and - avoiding unnecessary complexity. -- **Testing**: Thoroughly test your contracts, including unit tests, integration - tests, and security tests, to ensure they function as expected under various - scenarios. -- **Optimization:** Using packages like rust-optimizer for CosmWasm contracts - are critical to ensure gas fees remain low while using your smart contract. diff --git a/content/build/evm-cli-tutorial.mdx b/content/build/evm-cli-tutorial.mdx deleted file mode 100644 index f7dfb494..00000000 --- a/content/build/evm-cli-tutorial.mdx +++ /dev/null @@ -1,50 +0,0 @@ -# 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](node/getting-started)) - -## 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](providers/rpc-providers) 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](build/resources-tools-and-resources.mdx) 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/content/build/pointers/_meta.js b/content/build/pointers/_meta.js deleted file mode 100644 index 8dbbab3d..00000000 --- a/content/build/pointers/_meta.js +++ /dev/null @@ -1,6 +0,0 @@ -export default { - overview: 'Overview', - 'pointer-contracts': 'Standard [20, 721, 1155]', - 'pointer-ibc': 'IBC', - 'pointer-tokenfactory': 'Tokenfactory' -}; diff --git a/content/build/resources-resources.mdx b/content/build/resources-resources.mdx deleted file mode 100644 index 763f88e5..00000000 --- a/content/build/resources-resources.mdx +++ /dev/null @@ -1,62 +0,0 @@ -# Resources - -In this section, we'll provide a comprehensive overview of the key tools and -technologies used in the Sei blockchain ecosystem. Whether you are new to web3 -development or an experienced developer looking to expand your skills, these -resources will help you get started and deepen your understanding. Developers on -Sei have the unique advantage of choosing between CosmWasm and EVM for their -smart contract development, with the ability to seamlessly interact between the -two environments. - -### Cosmos SDK - -The Cosmos SDK is a modular framework for building custom blockchains within the -Cosmos ecosystem. It provides a set of tools and libraries that simplify the -creation and management of interoperable blockchains. - -- **Tendermint**: Tendermint is the consensus engine that powers the Cosmos SDK. - It ensures fast and secure consensus through a Byzantine Fault Tolerant (BFT) - protocol. - - [Tendermint Documentation](https://docs.tendermint.com/) -- **Module Structure**: The Cosmos SDK uses a modular architecture, allowing - developers to create and integrate various modules to build feature-rich - blockchains. - - [Module Structure Documentation](https://docs.cosmos.network/v0.46/building-modules/intro.html) -- **Transaction Structure**: Understanding the structure of transactions is - crucial for developing applications on the Cosmos SDK. Transactions are the - primary means of interacting with the blockchain. - - [Transaction Structure Documentation](https://docs.cosmos.network/main/learn/advanced/transactions) -- **IBC (Inter-Blockchain Communication)**: IBC is a protocol that enables - communication and asset transfers between different blockchains within the - Cosmos ecosystem. - - [IBC Overview](https://docs.cosmos.network/v0.45/ibc/overview.html) - -### EVM (Ethereum Virtual Machine) - -The EVM is the runtime environment for smart contracts on Ethereum and -EVM-compatible blockchains like Sei. It allows developers to write and deploy -smart contracts using Solidity. - -- **Solidity**: Solidity is the most widely used programming language for - writing smart contracts on the EVM. It is a statically-typed language that is - influenced by JavaScript, Python, and C++. - - [Solidity Documentation](https://docs.soliditylang.org/en/v0.8.25/) -- **Hardhat**: Hardhat is a development environment for compiling, deploying, - testing, and debugging Ethereum software. It is highly extensible and - integrates well with other tools. - - [Hardhat Documentation](https://hardhat.org/hardhat-runner/docs/getting-started) -- **Foundry**: Foundry is a toolkit for Ethereum application development, - providing a comprehensive suite of tools for testing and deploying smart - contracts. - - [Foundry Documentation](https://github.com/foundry-rs/foundry) - -### CosmWasm - -CosmWasm is a smart contract platform built for the Cosmos ecosystem, enabling -developers to write smart contracts in WebAssembly (Wasm). Developers on Sei can -choose CosmWasm for its safety and performance benefits, and seamlessly interact -with EVM smart contracts. - -- **Rust**: Rust is the primary programming language used for writing CosmWasm - smart contracts. It is known for its safety, performance, and concurrency. - - [Rust Documentation](https://doc.rust-lang.org/beta/) diff --git a/content/build/resources-tools-and-resources.mdx b/content/build/resources-tools-and-resources.mdx deleted file mode 100644 index 3cfb5122..00000000 --- a/content/build/resources-tools-and-resources.mdx +++ /dev/null @@ -1,85 +0,0 @@ -import { Callout, Tabs } from 'nextra/components'; - -# Tools and Resources - -Here, you'll find a curated list of development tools, public endpoints for -testing, and additional resources to support your development journey on Sei. - -## Tools - -Below, we've listed essential tools for both EVM and CosmWasm environments to -help you build, deploy, and manage your applications and smart contracts. - -- [Seiyanization](https://seiyanization.com/): Discover guides, products, and - tools to help you get started on Sei -- [Sei Ecosystem Builders Toolkit](https://sei-foundation.notion.site/Sei-Ecosystem-Builders-Toolkit-836deaebca204452909d0bf9365d8116): - Onboarding guide to help you build successfully on Sei - -**EVM** - -- [Foundry](https://getfoundry.sh/): EVM smart contract development toolchain -- [Hardhat](https://hardhat.org/): Ethereum development environment - -**CosmWasm** - -- [sei-js](https://github.com/sei-protocol/sei-js/): Sei JavaScript library -- [CosmWasm](https://docs.cosmwasm.com/docs/): Smart contracting platform built - for the Cosmos ecosystem -- [Awesome Cosmos](https://github.com/cosmos/awesome-cosmos): Collection of - other popular resources in CosmWasm - -## Resources - -To support your development and testing efforts, we provide a range of public -RPC endpoints. - -## Public Endpoints - -Public RPC endpoints should only be used for development. For production apps, use a dedicated RPC endpoint or [set up your own RPC node](/running-a-sei-node). - -Please visit our -[chain registry](https://github.com/sei-protocol/chain-registry/blob/main/chains.json) -for an updated list of RPC endpoints. - -import { CHAIN_IDS } from '@sei-js/registry'; -import { Code } from '@radix-ui/themes'; - -## Other Important Contracts - - - - -| { {CHAIN_IDS.mainnet}} (Mainnet) | { {CHAIN_IDS.testnet}} (Testnet) | { {CHAIN_IDS.devnet}} (Devnet) | -| :------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :---------------------------------------------------------------------- | -| Coming Soon | Coming Soon | 0x63600a899ad94ae1bc638504fa56d8a6144df2fe | - - - - -| { {CHAIN_IDS.mainnet}} (Mainnet) | { {CHAIN_IDS.testnet}} (Testnet) | { {CHAIN_IDS.devnet}} (Devnet) | -| :------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :---------------------------------------------------------------------- | -| Coming Soon | Coming Soon | 40258 | - - - - -| { {CHAIN_IDS.mainnet}} (Mainnet) | { {CHAIN_IDS.testnet}} (Testnet) | { {CHAIN_IDS.devnet}} (Devnet) | -| :------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :---------------------------------------------------------------------- | -| Coming Soon | Coming Soon | Coming Soon | - - - - -| { {CHAIN_IDS.mainnet}} (Mainnet) | { {CHAIN_IDS.testnet}} (Testnet) | { {CHAIN_IDS.devnet}} (Devnet) | -| :------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :---------------------------------------------------------------------- | -| Coming Soon | Coming Soon | Coming Soon | - - - - -| { {CHAIN_IDS.mainnet}} (Mainnet) | { {CHAIN_IDS.testnet}} (Testnet) | { {CHAIN_IDS.devnet}} (Devnet) | -| :------------------------------------------------------------------------ | :------------------------------------------------------------------------ | :---------------------------------------------------------------------- | -| Coming Soon | Coming Soon | Coming Soon | - - - diff --git a/content/build/_meta.js b/content/cosmwasm/_meta.js similarity index 53% rename from content/build/_meta.js rename to content/cosmwasm/_meta.js index fa266905..a226f2d2 100644 --- a/content/build/_meta.js +++ b/content/cosmwasm/_meta.js @@ -2,31 +2,34 @@ export default { index: { title: 'Home' }, - '-- Setup & Installation': { + '-- Essentials': { type: 'separator', - title: 'Setup and Installation' + title: 'Essentials' }, networks: 'Network Information', - faucet: 'Faucet', - 'dev-token-standards': 'Token Standards', + 'installing-seid': 'Installing `seid` CLI', + 'querying-state': 'Querying Blockchain State', + + '-- Transactions': { + type: 'separator', + title: 'Transactions' + }, + transactions: 'Transaction Overview', + 'execute-multiple': 'Executing Multiple Transactions', + 'seid-devtool': 'Generate Boilerplate Tx Messages', '-- Frontend Development': { type: 'separator', title: 'Frontend Development' }, - 'dev-frontend-dapps': 'Overview', 'building-a-frontend': 'Building a Frontend', '-- Smart Contracts': { type: 'separator', title: 'Smart Contracts' }, - 'dev-smart-contracts': 'Choosing a VM', - 'evm-general': 'EVM (General)', - 'solidity-resources': 'Solidity Resources', - 'evm-cli-tutorial': 'EVM (CLI)', - 'cosm-wasm-general': 'CosmWasm (General)', - 'nft-contract-tutorial': 'NFT Contracts', + 'cosm-wasm-general': 'Tutorial', + 'nft-contract-tutorial': 'CW721 (NFT) Contracts', '-- Interoperability': { type: 'separator', @@ -35,22 +38,17 @@ export default { 'ibc-protocol': 'IBC Protocol', pointers: 'Pointer Contracts', - '-- Cosmos': { + '-- Modules': { type: 'separator', - title: 'Cosmos' + title: 'Modules' }, - 'installing-seid': 'Installing seid CLI', - 'seid-devtool': 'Generate Boilerplate Tx Messages', 'tokenfactory-tutorial': 'Token Factory', 'tokenfactory-allowlist': 'Allowlists', 'multi-sig-accounts': 'Multi-Sig Accounts', - 'querying-state': 'Querying Blockchain State', + 'fee-grants': 'Fee Grants', - '-- Ecosystem & Tools': { - type: 'separator', - title: 'Ecosystem' - }, - 'ledger-ethers': 'Using Ledger with Ethers', - 'resources-tools-and-resources': 'Tools', - 'resources-resources': 'Resources' + cosmos: { + title: 'REST API', + display: 'hidden' + } }; diff --git a/content/cosmwasm/building-a-frontend.mdx b/content/cosmwasm/building-a-frontend.mdx new file mode 100644 index 00000000..6eac9555 --- /dev/null +++ b/content/cosmwasm/building-a-frontend.mdx @@ -0,0 +1,542 @@ +import { Callout } from 'nextra/components'; + +# Building a Frontend + +In this section, we'll use the [@sei-js](https://github.com/sei-protocol/sei-js/) library to build a React app that interacts with a CosmWasm contract. + +## Requirements + +Before starting, ensure you have: + +- Node.js & NPM installed +- A Sei wallet extension, such as: +- [Compass](https://compasswallet.io/) +- [Fin](https://finwallet.com/) + +### CosmWasm/Cosmos RPC dApps + +- **CosmosKit**: A React-based library for Cosmos ecosystem dApps, facilitating + wallet connection and interaction. Supports all Sei native wallets as well as + cross-chain wallets like Keplr and Leap. +- [CosmosKit Documentation](https://github.com/cosmology-tech/cosmos-kit) +- **CosmJS**: A JavaScript library for interacting with Cosmos blockchains, + providing tools to handle wallet connections, transactions, and more. Offers + comprehensive tools for Cosmos SDK based blockchains. +- [CosmJS Documentation](https://cosmos.github.io/cosmjs/) + +## Creating a React Project + +If you're starting a project from scratch, consider using the TypeScript +template from Vite for easier development and debugging. + +```bash copy +npm create vite@latest my-counter-frontend -- --template react-ts +``` + +This command creates a new folder with a React project using TypeScript. Open +`my-counter-frontend` in your favorite IDE. + +The rest of this tutorial will be in TypeScript. If you're not using TypeScript, you can easily adjust by removing the types. + +## Installing Dependencies + +From the terminal at the root of your project, install the required +dependencies: `@sei-js/core` and `@sei-js/react`. + +```bash copy +npm install @sei-js/core @sei-js/react +``` + +`@sei-js` contains NPM libraries for writing applications that interact with Sei. Learn more [here](https://github.com/sei-protocol/sei-js/tree/main). + +## Wrapping App in SeiWalletProvider + +Replace the code in your `App.tsx` file with the following to set up a +`SeiWalletProvider` context, define your chain info, and set connection URLs. + + ```tsx copy + import { SeiWalletProvider } from '@sei-js/react'; + import './App.css'; + import Home from './Home.tsx'; + + function App() { + return ( + // Set up SeiWalletProvider for easy wallet connection and to use hooks in @sei-js/react + + + + ); + } + + export default App; + ``` + +### Detailed outline of `App.tsx` + +**Wallet Provider Setup** + +- Imports `SeiWalletProvider` from the `@sei-js/react` package. +- Wraps `App` with `SeiWalletProvider` for wallet context. + +**Chain Configuration** + +- Specifies the `chainConfiguration` prop in `SeiWalletProvider` to set up the + blockchain network: +- `chainId`: Identifies the Sei network (in this case, `arctic-1`). +- `restUrl`: REST URL for the Sei (You may need your own provider). +- `rpcUrl`: RPC URL for the Sei (You may need your own provider). + +**Supported Wallets** + +- Sets up supported wallet types (`'compass'`, `'fin'`, `'leap'`, `'keplr'`) in + the wallets prop. + +## Adding Home Component + +Create a file named `Home.tsx` in your `src` directory with the following code: + + ```tsx copy + import { useCallback, useEffect, useState } from 'react'; + import { useCosmWasmClient, useSigningCosmWasmClient, useWallet, WalletConnectButton } from '@sei-js/react'; + + // arctic-1 example contract + const CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m'; + + function Home() { + const [count, setCount] = useState(); + const [error, setError] = useState(''); + const [isIncrementing, setIsIncrementing] = useState(false); + + // Helpful hook for getting the currently connected wallet and chain info + const { connectedWallet, accounts } = useWallet(); + + // For querying cosmwasm smart contracts + const { cosmWasmClient: queryClient } = useCosmWasmClient(); + + // For executing messages on cosmwasm smart contracts + const { signingCosmWasmClient: signingClient } = useSigningCosmWasmClient(); + + const fetchCount = useCallback(async () => { + const response = await queryClient?.queryContractSmart(CONTRACT_ADDRESS, { + get_count: {} + }); + return response?.count; + }, [queryClient]); + + useEffect(() => { + fetchCount().then(setCount); + }, [connectedWallet, fetchCount]); + + const incrementCounter = async () => { + setIsIncrementing(true); + try { + const senderAddress = accounts[0].address; + + // Build message content + const msg = { increment: {} }; + + // Define gas price and limit + const fee = { + amount: [{ amount: '20000', denom: 'usei' }], + gas: '200000' + }; + + // Call smart contract execute msg + await signingClient?.execute(senderAddress, CONTRACT_ADDRESS, msg, fee); + + // Updates the counter state again + const updatedCount = await fetchCount(); + setCount(updatedCount); + + setIsIncrementing(false); + setError(''); + } catch (error) { + if (error instanceof Error) { + setError(error.message); + } else { + setError('unknown error'); + } + setIsIncrementing(false); + } + }; + + // Helpful component for wallet connection + if (!connectedWallet) return ; + + return ( +
+

Count is: {count ? count : '---'}

+ + {error &&

{error}

} +
+ ); + } + + export default Home; + ``` + +We deployed a counter contract on the `arctic-1` testnet. Contract address: +`sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m`. Learn more +about this contract [here](https://github.com/CosmWasm/cw-template). + +### Detailed outline of `Home.tsx` + +**Render Logic** + +- Shows `WalletConnectButton` if no wallet is connected. +- Otherwise, displays the counter value and an "Increment" button. +- Disables the button when a transaction is pending. +- Catches and displays error messages, if any. + +**Wallet and Client Setup** + +- Utilizes `useWallet` hook from `@sei-js/react` to get the connected wallet and + accounts. +- Uses `useCosmWasmClient` and `useSigningCosmWasmClient` hooks from + `@sei-js/react` to instantiate `queryClient` and `signingClient`. The signing + client can be used for querying, but it is not recommended to use a signing + client when only a query client is needed. + +**Fetching Counter Value** + +- `fetchCount` function uses `queryClient.queryContractSmart` to query the smart + contract with the query `{ get_count: {} }`. + +**Incrementing Counter** + +- `incrementCounter` function: +- Extracts `senderAddress` from the connected wallet's accounts. +- Builds a message with `{ increment: {} }` to be sent to the smart contract. +- Specifies the transaction fee with gas price and gas limit. +- Calls `signingClient.execute` to execute the contract with the built message + and fee. + +By leveraging `@sei-js` and its hooks, the component provides a way to connect +to a wallet, query a CosmWasm smart contract to get the current counter state, +and increment it with an execute message. + +## Running the App + +Run `npm run dev` and navigate to http://localhost:5173/ to view your +application. + +If this is your first time using Sei, you might see an error which says your account does not exist on chain. You can claim some testnet tokens for development purposes from a faucet [here](https://t.me/+31M9Ig2z2-w2OTdk). + +🎉 Congratulations on creating a website for querying and executing a smart +contract on Sei! Explore more possibilities with your frontend at our +[@sei-js repo](https://github.com/sei-protocol/sei-js/tree/main). + +## Beyond Simple Contracts: Advanced CosmWasm Interactions + +While our counter example demonstrated the basics of connecting to and interacting with a CosmWasm contract through the WASM precompile, CosmWasm contracts offer much more sophisticated capabilities. One of their most powerful features is their ability to describe their own interfaces, eliminating the need for external ABIs (Application Binary Interfaces) that are typically required for EVM contract interactions. + +Let's explore these advanced features by building a component that interacts with a CW721 (NFT) contract. This example will demonstrate contract discovery, handling different response formats, and implementing robust error handling - skills that are essential when working with more complex CosmWasm contracts. + +# Advanced CosmWasm Contract Interactions Through the WASM Precompile + +## Introduction + +While our basic counter example demonstrated simple contract interactions, CosmWasm contracts offer much more sophisticated capabilities than traditional EVM contracts. One of their most powerful features is their ability to describe their own interfaces, eliminating the need for external ABIs (Application Binary Interfaces) that are required for EVM contract interactions. + +In this guide, we'll explore these advanced features and learn how to build more complex applications that leverage the full power of CosmWasm contracts through Sei's WASM precompile. + +## Understanding CosmWasm Contract Discovery + +Unlike EVM contracts where you need detailed interface specifications beforehand, CosmWasm contracts can tell you exactly how to interact with them. This self-describing capability makes them particularly developer-friendly and reduces the chance of interface mismatches. + +Let's explore how to implement this discovery mechanism: + + ```typescript copy + async function discoverContractMethods(contractAddress: string) { + // We intentionally send an invalid query - the contract will respond with valid methods + const invalidQuery = { a: 'b' }; + + try { + await contract.query(contractAddress, toUtf8Bytes(JSON.stringify(invalidQuery))); + // If we reach here, something unexpected happened + console.log('Unexpected success - contract accepted invalid query'); + return null; + } catch (error) { + if (error.data) { + const errorMessage = toUtf8String(error.data); + + // The error message contains a list of valid methods + // Format: "expected one of method1, method2, method3: query wasm contract failed" + const match = errorMessage.match(/expected one of (.+): query wasm contract failed/); + if (match) { + const validMethods = match[1] + .replace(/`/g, '') + .split(', ') + .map((method) => method.trim()); + console.log('Valid query methods:', validMethods); + return validMethods; + } + } + console.error('Unexpected error structure:', error); + return null; + } + } + ``` + +When we run this against a CW721 (NFT) contract, we might receive a response like this: + + ```javascript copy + [ + 'owner_of', // Query the owner of a specific token + 'approval', // Check if an address is approved for a token + 'approvals', // List all approvals for a token + 'operator', // Check if an address is an operator + 'all_operators', // List all operators + 'num_tokens', // Get total supply of tokens + 'contract_info', // Get contract metadata + 'nft_info', // Get metadata for a specific token + 'all_nft_info', // Get all info for a specific token + 'tokens', // List tokens owned by an address + 'all_tokens', // List all tokens in the collection + 'minter', // Get the minting authority + 'extension', // Access CW721 extensions + 'ownership' // Query contract ownership + ]; + ``` + +## Building an NFT Information Component + +Let's create a practical example that uses these discovered methods to interact with a CW721 contract. This component will display both collection-wide information and individual token details: + + ```typescript copy + function NFTViewer() { + const [methods, setMethods] = useState([]); + const [collectionOwner, setCollectionOwner] = useState(); + const [tokenOwner, setTokenOwner] = useState(); + const [contract, setContract] = useState(); + const [tokenId, setTokenId] = useState('1'); + const [isLoading, setIsLoading] = useState(false); + + const NFT_CONTRACT_ADDRESS = "sei1g2a0q3tddzs7vf7lk45c2tgufsaqerxmsdr2cprth3mjtuqxm60qdmravc"; + + // Query collection ownership + const queryCollectionOwner = async () => { + try { + // The ownership query returns collection-level ownership information + const queryMsg = { ownership: {} }; + const queryResponse = await contract.query( + NFT_CONTRACT_ADDRESS, + toUtf8Bytes(JSON.stringify(queryMsg)) + ); + const responseData = JSON.parse(toUtf8String(queryResponse)); + + // Handle different response formats - some contracts nest data differently + const owner = responseData.data?.owner || responseData.owner; + setCollectionOwner(owner); + } catch (error) { + console.error('Error querying collection owner:', error); + } + }; + + // Query specific token ownership + const queryTokenOwner = async (tokenId: string) => { + try { + setIsLoading(true); + // The owner_of query returns ownership information for a specific token + const queryMsg = { owner_of: { token_id: tokenId } }; + const queryResponse = await contract.query( + NFT_CONTRACT_ADDRESS, + toUtf8Bytes(JSON.stringify(queryMsg)) + ); + const responseData = JSON.parse(toUtf8String(queryResponse)); + const owner = responseData.data?.owner || responseData.owner; + setTokenOwner(owner); + } catch (error) { + console.error('Error querying token owner:', error); + } finally { + setIsLoading(false); + } + }; + + // Discover available methods when component mounts or contract changes + useEffect(() => { + if (!contract) return; + discoverContractMethods(NFT_CONTRACT_ADDRESS) + .then(setMethods); + }, [contract]); + + return ( +
+

NFT Collection Info

+
+

Collection Address: {NFT_CONTRACT_ADDRESS}

+

Collection Owner: {collectionOwner || 'Loading...'}

+

Available Methods: {methods?.join(', ') || 'Loading...'}

+
+ +
+

Token Ownership Lookup

+
+ setTokenId(e.target.value)} + placeholder="Enter token ID" + /> + +
+ {tokenOwner && ( +
+

Token {tokenId} Owner: {tokenOwner}

+
+ )} +
+
+ ); + } + ``` + +## Understanding CosmWasm Response Formats + +CosmWasm contracts can return data in various formats, and it's important to handle these variations properly. Here are some example responses you might receive: + +- Collection Ownership Query Response: + + ```json copy + { + "owner": "sei1hjsqrfdg2hvwl3gacg4fkznurf36usrv7rkzkyh29wz3guuzeh0snslz7d", + "pending_owner": null, + "pending_expiry": null + } + ``` + +- Token Ownership Query Response: + + ```json copy + { + "owner": "sei1frcndtm928xln5awxz4rcrh3f5exskjczrc92f", + "approvals": [] + } + ``` + +Notice how these responses have different structures. That's why our code uses a flexible approach to extract the owner: + + ```typescript copy + const owner = responseData.data?.owner || responseData.owner; + ``` + +## Creating a Reusable Query Function + +To make contract interactions more maintainable, consider creating a reusable query function: + + ```typescript copy + async function queryContract(address: string, queryMsg: object) { + try { + const response = await contract.query(address, toUtf8Bytes(JSON.stringify(queryMsg))); + + const result = JSON.parse(toUtf8String(response)); + // Handle both nested and direct data structures + return result.data ?? result; + } catch (error) { + if (error.data) { + const errorMessage = toUtf8String(error.data); + // Check if this is a method discovery error + if (errorMessage.includes('expected one of')) { + console.log('Available methods:', errorMessage); + } + } + throw error; + } + } + ``` + +## Best Practices for CosmWasm Contract Interactions + +When building applications that interact with CosmWasm contracts through the WASM precompile, follow these guidelines: + +1. **Always Start with Discovery**: Use the contract's self-describing capabilities to understand its interface. This prevents errors and makes your code more maintainable. + +2. **Handle Response Variations**: CosmWasm contracts might return data in different formats. Always implement robust response parsing that can handle various structures. + +3. **Implement Proper Error Handling**: CosmWasm contracts provide detailed error messages that can help diagnose issues. Make use of this information in your error handling. + +4. **Manage Loading States**: Always provide clear feedback about the state of contract interactions to improve user experience. + +5. **Cache Method Information**: Consider caching the discovered methods to reduce unnecessary queries, but make sure to refresh this cache periodically. + +## Error Handling Examples + +Here's how to handle different types of errors you might encounter: + + ```typescript copy + try { + const result = await queryContract(address, queryMsg); + // Handle success + } catch (error) { + if (error.data) { + const errorMessage = toUtf8String(error.data); + if (errorMessage.includes('expected one of')) { + // This is a method discovery error - might be useful! + console.log('Valid methods:', errorMessage); + } else if (errorMessage.includes('not found')) { + // Handle non-existent tokens or resources + console.log('Resource not found'); + } else { + // Handle other contract-specific errors + console.log('Contract error:', errorMessage); + } + } else { + // Handle network or other errors + console.error('Network or system error:', error); + } + } + ``` + +### Polyfills Warning + +When developing frontend applications for the blockchain, it's important to be +aware that some libraries may require polyfills, especially when used in browser +environments. For instance, the `Buffer` class and other Node.js-specific +features are not natively available in browsers and need to be polyfilled. + +If you are using Vite or another rollup based frontend library you can add the +following to the entry point of your app. + +```tsx copy +import { Buffer } from 'buffer'; + +// Polyfill self for browser and global for Node.js +const globalObject = typeof self !== 'undefined' ? self : global; + +Object.assign(globalObject, { + process: process, + Buffer: Buffer +}); +``` + +If you are using a Webpack based bundling tool you can use the following plugin +in you Webpack config. + +``` +yarn add -D node-polyfill-webpack-plugin +``` + +```tsx copy +import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; + +... // the rest of your webpack config +plugins: [ + ... + new NodePolyfillPlugin(), + ... +], +... +``` diff --git a/content/build/cosm-wasm-general.mdx b/content/cosmwasm/cosm-wasm-general.mdx similarity index 100% rename from content/build/cosm-wasm-general.mdx rename to content/cosmwasm/cosm-wasm-general.mdx diff --git a/content/reference/cosmos.mdx b/content/cosmwasm/cosmos.mdx similarity index 100% rename from content/reference/cosmos.mdx rename to content/cosmwasm/cosmos.mdx diff --git a/content/learn/execute-multiple.mdx b/content/cosmwasm/execute-multiple.mdx similarity index 100% rename from content/learn/execute-multiple.mdx rename to content/cosmwasm/execute-multiple.mdx diff --git a/content/learn/fee-grants.mdx b/content/cosmwasm/fee-grants.mdx similarity index 100% rename from content/learn/fee-grants.mdx rename to content/cosmwasm/fee-grants.mdx diff --git a/content/build/ibc-protocol.mdx b/content/cosmwasm/ibc-protocol.mdx similarity index 100% rename from content/build/ibc-protocol.mdx rename to content/cosmwasm/ibc-protocol.mdx diff --git a/content/build/index.mdx b/content/cosmwasm/index.mdx similarity index 95% rename from content/build/index.mdx rename to content/cosmwasm/index.mdx index 1665194e..e738de82 100644 --- a/content/build/index.mdx +++ b/content/cosmwasm/index.mdx @@ -1,9 +1,9 @@ -import { IconArrowsExchange, IconBrain, IconCoins, IconCode, IconLayoutDashboard, IconTools, IconSettingsAutomation } from '@tabler/icons-react'; +import { IconArrowsExchange, IconBrain, IconCoins, IconCode, IconLayoutDashboard, IconTools } from '@tabler/icons-react'; import { LinkCard } from '../../src/components/LinkCard'; -# Start Building on Sei +# Build With CosmWasm -Learn the fundamentals of Sei blockchain development. +Build dApps and protocols using well known tools like CosmWasm, @cosm-js, and Keplr.
diff --git a/content/build/nft-contract-tutorial.mdx b/content/cosmwasm/nft-contract-tutorial.mdx similarity index 53% rename from content/build/nft-contract-tutorial.mdx rename to content/cosmwasm/nft-contract-tutorial.mdx index 5453c0dc..ebc89c21 100644 --- a/content/build/nft-contract-tutorial.mdx +++ b/content/cosmwasm/nft-contract-tutorial.mdx @@ -15,179 +15,7 @@ This tutorial guides you through the creation and deployment of an NFT contract on Sei. By the end, you'll have deployed your own NFT contract. Select one of the tabs below to get started! -## EVM - -In this section, we'll use Foundry to deploy an ERC-721 contract to the Ethereum -network. ERC-721 is a standard for NFT contracts on Ethereum. Learn more about -ERC-721 [here](https://erc721.org/). - -### Requirements - -Before we start, ensure you have: - -- Installed Foundry. Follow the - [installation guide](https://book.getfoundry.sh/getting-started/installation). -- A basic understanding of Solidity and smart contract development. -- A wallet with SEI tokens on devnet - -You can obtain devnet tokens from one of the faucets listed [here](../dev-ecosystem-providers/faucets). - -### Setting Up Your Project - -1. Initialize a new Foundry project: - -```bash copy -forge init my-nft-project -cd my-nft-project -``` - -2. Install OpenZeppelin, a library for secure smart contract development. - -```bash copy -forge install OpenZeppelin/openzeppelin-contracts -``` - -3. Create a new Solidity file under `src/` for your NFT contract, e.g., - `MyNFT.sol`. - -### Writing the ERC-721 Contract - -1. In `src/MyNFT.sol`, start by importing OpenZeppelin's ERC-721 implementation: - -```solidity copy -// contracts/MyNFT.sol -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; - -import {ERC721} from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol"; - -contract MyNFT is ERC721 { - constructor() ERC721("MyNFT", "MNFT") { - } -} -``` - - -You may see an error in your IDE about importing `openzeppelin-contracts`. To -resolve this, run this command to create `remapping.txt` in the root of your -project: - -```bash copy -forge remappings > remappings.txt -``` - - - -2. Add any additional functions or overrides necessary for your NFT. - -### Testing Your Contract - -1. Write tests for your contract in the `test/` directory. -2. Run your tests with: - - ```bash copy - forge test - ``` - -### Deploying Your Contract - -1. Compile your contract: - - ```bash copy - forge build - ``` - -2. Deploy your contract to a local testnet (e.g., using Anvil, Foundry's local - Ethereum node): - - ```bash copy - anvil -a 1 - ``` - - **Flags** - - - `-a`: flag specifies the number of test accounts to create. This command - will start a local Ethereum node and create one account. In the command - output you will see created account and its private key. Use this private - key to deploy your contract. - - In a new terminal, deploy your contract: - - ```bash copy - forge create --rpc-url http://localhost:8545 --private-key src/MyNFT.sol:MyNFT --legacy - ``` - - **Flags** - - - `--rpc-url`: flag to specify the URL of the Ethereum node. In this case, - it's the URL of the local Anvil node. - - `--private-key`: flag to specify the private key of the account that will - deploy the contract. Anvil generated test account's private key is used in - this case. - -3. Deploy contract to the Sei devnet (EVM endpoint): - - ```bash copy - forge create --rpc-url https://evm-rpc.arctic-1.seinetwork.io/ --private-key src/MyNFT.sol:MyNFT --legacy - ``` - - **Flags** - - - `--rpc-url`: flag to specify the URL of the Ethereum node. In this case, - it's the Sei EVM devnet URL. - - `--private-key`: flag to specify the private key of the account that will - deploy the contract. The private key of your account on the Sei devnet is - used in this case. - -Make sure to have SEI in your account to cover the gas fees for contract deployment. - -### Interacting With Your NFT - -- You can interact with your deployed NFT contract using Foundry's `cast` tool - or through other tools like Ethers.js in a script or web application. - -### Create Pointer Contract - -To enable seamless use of this NFT contract in CosmWasm environments, you can -create a pointer contract. This process results in an CW721 token that can be -imported and used in Sei wallets and applications. - -```bash copy -seid tx evm register-cw-pointer ERC721 $ERC721_TOKEN_ADDRESS --from $ACCOUNT --chain-id=arctic-1 --fees=25000usei --node=https://rpc-arctic-1.sei-apis.com/ -``` - -**Parameters** - -- `ERC721_TOKEN_ADDRESS`: The contract address of the ERC721 token you want to - create an CW721 pointer for. - -**Flags** - -- `--from`: The Sei address from which the deployment transaction is sent. This - address must have enough balance to cover transaction fees. -- `--label`: A name for the contract instance used to identify the contract. -- `--chain-id`: Identifies the specific chain of the Sei network you're - interacting with. `arctic-1` refers to the Sei devnet. -- `--broadcast-mode`: Determines how the transaction is broadcasted. Setting - this to `block` means the transaction will wait to be included in a block - before returning a response. -- `--gas`: Specifies the maximum amount of gas that can be consumed by the - transaction. -- `--fees`: Indicates the transaction fee. -- `--node`: Points to the specific Sei node RPC URL you're connecting to for - transaction submission. -- `--no-admin`: Specifies that the contract should not have an admin. This flag - is used to indicate that the contract, once deployed, cannot be upgraded or - migrated. - -Executing this command creates an CW721 NFT contract and outputs the contract -address. This NFT contract is linked to the ERC721 NFT contract, meaning any -activities involving CW721 NFTs will also reflect on the state of the ERC721 -NFTs and vice versa. - -Learn more about EVM interoperability and pointer contracts [here](build/pointers/overview). - -## CosmWasm +## Deploying a CW721 Contract In this section, we'll be deploying a CW721 contract, a standard for NFTs in the CosmWasm ecosystem. For more about CW721, visit @@ -332,8 +160,3 @@ activities involving CW721 NFTs will also reflect on the state of the ERC721 NFTs and vice versa. Learn more about EVM interoperability and pointer contracts [here](build/pointers/pointer-contracts). - -## Conclusion - -🎉 Congratulations! You've successfully created and deployed an NFT contract on -Sei. diff --git a/content/cosmwasm/pointers/_meta.js b/content/cosmwasm/pointers/_meta.js new file mode 100644 index 00000000..8668ea11 --- /dev/null +++ b/content/cosmwasm/pointers/_meta.js @@ -0,0 +1,5 @@ +export default { + standard: 'Standard [20, 721, 1155]', + ibc: 'IBC', + tokenfactory: 'Tokenfactory' +}; diff --git a/content/build/pointers/pointer-ibc.mdx b/content/cosmwasm/pointers/ibc.mdx similarity index 100% rename from content/build/pointers/pointer-ibc.mdx rename to content/cosmwasm/pointers/ibc.mdx diff --git a/content/build/pointers/pointer-contracts.mdx b/content/cosmwasm/pointers/standard.mdx similarity index 100% rename from content/build/pointers/pointer-contracts.mdx rename to content/cosmwasm/pointers/standard.mdx diff --git a/content/build/pointers/pointer-tokenfactory.mdx b/content/cosmwasm/pointers/tokenfactory.mdx similarity index 100% rename from content/build/pointers/pointer-tokenfactory.mdx rename to content/cosmwasm/pointers/tokenfactory.mdx diff --git a/content/build/querying-state.mdx b/content/cosmwasm/querying-state.mdx similarity index 100% rename from content/build/querying-state.mdx rename to content/cosmwasm/querying-state.mdx diff --git a/content/build/seid-devtool.mdx b/content/cosmwasm/seid-devtool.mdx similarity index 100% rename from content/build/seid-devtool.mdx rename to content/cosmwasm/seid-devtool.mdx diff --git a/content/build/tokenfactory-allowlist.mdx b/content/cosmwasm/tokenfactory-allowlist.mdx similarity index 100% rename from content/build/tokenfactory-allowlist.mdx rename to content/cosmwasm/tokenfactory-allowlist.mdx diff --git a/content/build/tokenfactory-tutorial.mdx b/content/cosmwasm/tokenfactory-tutorial.mdx similarity index 100% rename from content/build/tokenfactory-tutorial.mdx rename to content/cosmwasm/tokenfactory-tutorial.mdx diff --git a/content/cosmwasm/transactions.mdx b/content/cosmwasm/transactions.mdx new file mode 100644 index 00000000..8cd2ca41 --- /dev/null +++ b/content/cosmwasm/transactions.mdx @@ -0,0 +1,112 @@ +import { Tabs } from 'nextra/components'; +import { PropertyInfo } from '../../src/components'; +import { SyntaxHighlighter } from '../../src/components/SyntaxHighlighter'; + +# Transactions + +Cosmos transactions are used for interacting with Cosmos based RPC's and +tooling. They consist of the body, auth info, and signatures. + + + + + + +
+ + + +
+
+
+ +#### Signing Cosmos Transactions + +Cosmos transactions on the Sei blockchain follow the standard Cosmos SDK format. +They include various types of messages that can be included in the transaction +body. + +Using the `seid` CLI, you can use the `--generate-only` flag to generate an +unsigned transaction in JSON format. The transaction can then be signed and +broadcasted to the network. + +Assuming you have an unsigned JSON transaction file, you can sign it using the +`seid tx sign` command. The signed transaction will be in JSON format and can be +broadcasted to the network. + +`seid tx sign unsigned_tx.json --chain-id my-test-chain --keyring-backend test --from $SIGNER_ADDRESS` diff --git a/content/evm/_meta.js b/content/evm/_meta.js new file mode 100644 index 00000000..c97e1f4c --- /dev/null +++ b/content/evm/_meta.js @@ -0,0 +1,44 @@ +export default { + index: { + title: 'Home' + }, + '-- Essentials': { + type: 'separator', + title: 'Essentials' + }, + networks: 'Network Information', + 'differences-with-ethereum': 'Divergence from Ethereum', + + '-- Frontend Development': { + type: 'separator', + title: 'Frontend Development' + }, + 'building-a-frontend': 'Building a Frontend', + + '-- Smart Contracts': { + type: 'separator', + title: 'Smart Contracts' + }, + 'evm-general': 'Overview', + 'nft-contract-tutorial': 'ERC721 (NFT) Contracts', + 'solidity-resources': 'Solidity Resources', + + '-- Reference': { + type: 'separator', + title: 'Reference' + }, + transactions: 'Transaction Overview', + reference: 'RPC Reference', + + '-- CosmWasm Interoperability': { + type: 'separator', + title: 'CosmWasm Interoperability' + }, + precompiles: 'Precompiles', + + '-- Hardware Wallets': { + type: 'separator', + title: 'Hardware Wallets' + }, + 'ledger-ethers': 'Using Ledger with Ethers' +}; diff --git a/content/evm/building-a-frontend.mdx b/content/evm/building-a-frontend.mdx new file mode 100644 index 00000000..a9d86615 --- /dev/null +++ b/content/evm/building-a-frontend.mdx @@ -0,0 +1,273 @@ +import { Callout } from 'nextra/components'; + +# Frontend Development + +Developing the frontend of a dApp on Sei involves connecting to wallets, +interacting with the blockchain via RPC endpoints, and signing and broadcasting +transactions. + +In this section, we'll explore Sei's unique interoperability features by building an EVM compatible DApp that interacts with a CosmWasm smart contract. +We will use [ethers.js](https://docs.ethers.org/v6/) to build a React app that interacts with a CosmWasm smart contract using the Sei [CosmWasm precompile](https://github.com/sei-protocol/sei-chain/tree/main/precompiles/wasmd). + +### EVM and EVM RPC dApps: + +- **Wagmi**: A React-based library for Ethereum dApps that simplifies wallet + connection and interaction. Provides hooks for interacting with Ethereum + wallets and contracts for use with modern frontend libraries and frameworks. +- [Wagmi Documentation](https://wagmi.sh/) +- **Viem**: A lightweight and flexible library for Ethereum development. +- [Viem Documentation](https://viem.sh/docs/getting-started) +- **Ethers.js**: A complete and compact library for interacting with the + Ethereum blockchain and its ecosystem. Known for its simplicity and extensive + functionality. +- [Ethers.js Documentation](https://docs.ethers.io/v6/) + +## Prerequisites + +- Complete the tutorial in [cosmwasm-general](build/cosmwasm-general) to deploy + a CosmWasm counter contract on our devnet (arctic-1). + +## Requirements + +Before starting, ensure you have: + +- Node.js & NPM installed +- One of the Sei wallets listed [here](providers/wallets/wallets) + +## Creating a React Project + +Start by creating a new React project using Vite's TypeScript template for +streamlined development: + + ```bash copy + npm create vite@latest my-counter-frontend -- --template react-ts + ``` + +This command creates a new folder with a React project using TypeScript. Open +`my-counter-frontend` in your favorite IDE. + +The rest of this tutorial will be in TypeScript. If you're not using TypeScript, you can easily adjust by removing the types. + +## Installing Dependencies + +Install `ethers`, an Ethereum library that facilitates interaction with the +Ethereum blockchain: + + ```bash copy + npm install ethers + ``` + +## Defining Contract Addresses and ABI + +In this tutorial, we will be using the **Wasm Precompile** to interact with our +CosmWasm contract from the EVM. Precompiles (short for Precompiled contracts) +are EVM compatible contracts that are built into the chain. +The Wasm Precompile +is a unique smart contract on Sei that enables EVM clients to query and execute +CosmWasm contracts. Refer to the docs on +[precompiles](reference/precompiles/example-usage) for +more details. + +First, import the address and ABI of the CosmWasm precompile from `@sei-js/evm`. + +`@sei-js` contains NPM libraries for writing applications that interact with Sei. Learn more [here](https://github.com/sei-protocol/sei-js/tree/main). + +`@sei-js/evm` is an npm package that contains useful constants and helpers for +interacting with the EVM on Sei. + +To install sei-js: + + ```bash copy + npm install @sei-js/evm + ``` + +At the top of `App.tsx` you can then import `WASM_PRECOMPILE_ADDRESS`, +`WASM_PRECOMPILE_ABI`. These constants allow us to interact with the Wasm +Precompile. + + ```tsx copy + import { WASM_PRECOMPILE_ADDRESS, WASM_PRECOMPILE_ABI, WasmPrecompileContract } from '@sei-js/evm'; + import { ethers } from 'ethers'; + ``` + +These values will be used in the app to query and execute a contract. + +## Connecting to the Wallet and Initializing the Contract + +Replace your main `App` component with the following: + + ```tsx copy filename="App.tsx" + import { WASM_PRECOMPILE_ADDRESS, SEI_CHAIN_INFO, getWasmPrecompileEthersV6Contract } from '@sei-js/evm'; + import { useEffect, useState } from 'react'; + import { BrowserProvider, Contract, toUtf8Bytes, toUtf8String } from 'ethers'; + import './App.css'; + + function App() { + const [count, setCount] = useState(); + const [contract, setContract] = useState(); + const [isIncrementing, setIsIncrementing] = useState(false); + + // TODO: Replace this with your CosmWasm contract address here + const COUNTER_CONTRACT_ADDRESS = 'sei14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sh9m79m'; + + const fetchCount = async () => { + if (!contract) { + return; + } + // Query to get the count on the counter contract + const queryMsg = { get_count: {} }; + const queryResponse = await contract.query(COUNTER_CONTRACT_ADDRESS, toUtf8Bytes(JSON.stringify(queryMsg))); + const { count } = JSON.parse(toUtf8String(queryResponse)); + setCount(count); + }; + + useEffect(() => { + fetchCount(); + }, [contract]); + + const connectWallet = async () => { + if (window.ethereum) { + const provider = new BrowserProvider(window.ethereum); + const { chainId } = await provider.getNetwork(); + const devnetChainId = SEI_CHAIN_INFO.devnet.chainId; + if (chainId !== BigInt(devnetChainId)) { + alert('Wallet is not connected to Sei EVM devnet'); + return; + } + + const signer = await provider.getSigner(); + const contract = getWasmPrecompileEthersV6Contract(signer); + + setContract(contract); + } else { + alert('No EVM compatible wallet installed'); + } + }; + + const incrementCount = async () => { + if (!contract) { + return; + } + + setIsIncrementing(true); + // Execute message to increment the count on the contract + const executeMsg = { increment: {} }; + const executeResponse = await contract.execute( + COUNTER_CONTRACT_ADDRESS, + toUtf8Bytes(JSON.stringify(executeMsg)), + toUtf8Bytes(JSON.stringify([])) // Used for sending funds if needed + ); + // Wait for the transaction to be confirmed + await executeResponse.wait(); + console.log(executeResponse); + setIsIncrementing(false); + await fetchCount(); + }; + + return ( + <> +
+ {contract ? ( +
+

Count is {count}

+ +
+ ) : ( + + )} +
+ + ); + } + + export default App; + ``` + +### Detailed outline of `App.tsx` + +**State Declarations** + +- `count`: Holds the current count fetched from the smart contract. +- `contract`: An instance of the ethers Contract object, used for interacting + with the blockchain. +- `isIncrementing`: A boolean to manage UI state during contract execution + +**Effect Hooks** + +A single `useEffect` hook to fetch the current count whenever the contract state +changes, indicating that the contract instance is ready for interaction. + +**Connecting to EVM Wallet** + +A function named `connectWallet` that: + +- Checks for any EVM compatible wallet extension. +- Establishes a connection to the Ethereum network via the connected wallet, + using ethers.js BrowserProvider. +- Verifies the correct network (Sei EVM devnet) by comparing chainId. +- Creates an ethers.js Contract instance with the signer from the wallet, + setting it in the contract state for later use. + +**Fetching Contract Data** + +A function named `fetchCount` that: + +- Executes a contract query to get the current count. +- Parses and updates the count state with the response. + +**Incrementing the Counter** + +A function named `incrementCount` that: + +- Sends a transaction to the smart contract to increment the count. +- Waits for the transaction to be confirmed. +- Refetches the count to update the UI with the new value. + +To see your app in action, run `npm run dev` to spin up a local version of the +application. Once you connect your wallet, you should see a counter, as well as +a button you can use to increment the counter on the contract. + +Congrats on deploying your first interoperable dApp on Sei! + +### Polyfills Warning + +When developing frontend applications for the blockchain, it's important to be +aware that some libraries may require polyfills, especially when used in browser +environments. For instance, the `Buffer` class and other Node.js-specific +features are not natively available in browsers and need to be polyfilled. + +If you are using Vite or another rollup based frontend library you can add the +following to the entry point of your app. + +```tsx copy +import { Buffer } from 'buffer'; + +// Polyfill self for browser and global for Node.js +const globalObject = typeof self !== 'undefined' ? self : global; + +Object.assign(globalObject, { + process: process, + Buffer: Buffer +}); +``` + +If you are using a Webpack based bundling tool you can use the following plugin +in you Webpack config. + +``` +yarn add -D node-polyfill-webpack-plugin +``` + +```tsx copy +import NodePolyfillPlugin from 'node-polyfill-webpack-plugin'; + +... // the rest of your webpack config +plugins: [ + ... + new NodePolyfillPlugin(), + ... +], +... +``` diff --git a/content/learn/differences-with-ethereum.mdx b/content/evm/differences-with-ethereum.mdx similarity index 100% rename from content/learn/differences-with-ethereum.mdx rename to content/evm/differences-with-ethereum.mdx diff --git a/content/build/evm-general.mdx b/content/evm/evm-general.mdx similarity index 100% rename from content/build/evm-general.mdx rename to content/evm/evm-general.mdx diff --git a/content/evm/index.mdx b/content/evm/index.mdx new file mode 100644 index 00000000..f01efb8b --- /dev/null +++ b/content/evm/index.mdx @@ -0,0 +1,89 @@ +import { IconArrowsExchange, IconBrain, IconCoins, IconCode, IconLayoutDashboard, IconTools, IconSettingsAutomation } from '@tabler/icons-react'; +import { LinkCard } from '../../src/components/LinkCard'; + +# Why Sei EVM? + +The EVM (Ethereum Virtual Machine) is used to process transactions in +blockchains such as Ethereum. Most crypto native developers are extremely +familiar with the EVM. + +Unfortunately, the EVM is quite inefficient - on Ethereum L1, it's not able to +process more than ~20 TPS. + +This results in + +- high transaction fees for users, often going into hundreds of dollars for + simple transactions +- a restricted design space for developers, who are unable to build high + performance applications + +Sei represents a 100x improvement on the EVM. This will unlock an entirely new +design space for application developers, and make the EVM much cheaper to access +for normal people. + +## Start building + +Learn the fundamentals of Sei EVM development. + +
+ } + title="Understanding Sei Architecture" + link="/learn/differences-with-ethereum" + description={`Explore Sei's unique architecture and how it differs from Ethereum.`} + preview={{ + content: "Learn about Sei's consensus mechanism and architecture tailored for optimized performance and scalability.", + highlights: ['Unique consensus for fast finality', 'Efficient transaction execution', 'Parallel transaction processing', 'Seamless dApp integration'] + }} + /> + } + title="Exploring Token Standards" + link="/build/dev-token-standards" + description={`Learn how to create and integrate tokens using Sei’s standards.`} + preview={{ + content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.", + highlights: ['Standardized fungible and non-fungible tokens', 'Deploying ERC-20/ERC-721 equivalents', 'Cross-chain token compatibility', 'Gas-optimized token transfers'] + }} + /> + } + title="Deploying EVM-Compatible Contracts" + link="/build/evm-general" + description={`Learn how to deploy, interact with, and optimize EVM-compatible contracts on Sei.`} + preview={{ + content: 'Step-by-step guidance for deploying Ethereum-compatible contracts on Sei.', + highlights: ['EVM compatibility explained', 'Deploying existing Solidity contracts', 'Optimizing contract performance on Sei', 'Debugging and migrating contracts'] + }} + /> + } + title="Developing CosmWasm Smart Contracts" + link="/build/cosmwasm-general" + description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`} + preview={{ + content: 'Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.', + highlights: ['Understanding CosmWasm basics', 'Use cases: DeFi, NFTs, and more', 'Deployment and testing workflows', 'Integrating CosmWasm contracts with dApps'] + }} + /> + } + title="Connecting Frontends to Smart Contracts" + link="/build/building-a-frontend" + description={`Learn how to build and connect frontend interfaces for Sei-based dApps.`} + preview={{ + content: 'Create performant and user-friendly frontends that seamlessly interact with Sei’s backend.', + highlights: ['Choosing the right frameworks (e.g., React)', 'Connecting to Sei’s smart contracts', 'Handling blockchain events', 'Best practices for dApp UX/UI'] + }} + /> + } + title="Cross-Chain Interoperability with IBC" + link="/build/ibc-protocol" + description={`Enable seamless communication between Sei and other blockchains using IBC.`} + preview={{ + content: 'Implement cross-chain features with IBC to connect Sei with the broader blockchain ecosystem.', + highlights: ['Introduction to the IBC protocol', 'Setting up cross-chain communication', 'Ensuring data integrity and security', 'Use cases: Cross-chain DeFi, NFTs, and more'] + }} + /> +
diff --git a/content/build/ledger-ethers.mdx b/content/evm/ledger-ethers.mdx similarity index 100% rename from content/build/ledger-ethers.mdx rename to content/evm/ledger-ethers.mdx diff --git a/content/build/networks.mdx b/content/evm/networks.mdx similarity index 67% rename from content/build/networks.mdx rename to content/evm/networks.mdx index 69a156e1..a080d38f 100644 --- a/content/build/networks.mdx +++ b/content/evm/networks.mdx @@ -2,4 +2,4 @@ import { ChainInformation } from '../../src/components'; # Current Sei Networks - + diff --git a/content/evm/nft-contract-tutorial.mdx b/content/evm/nft-contract-tutorial.mdx new file mode 100644 index 00000000..13c6233a --- /dev/null +++ b/content/evm/nft-contract-tutorial.mdx @@ -0,0 +1,188 @@ +import { Callout } from 'nextra/components'; +import { Nfts } from '../../src/components'; + +# NFT Contract Tutorial + +## Introduction + +Non-Fungible Tokens (NFTs) are unique digital assets, each possessing distinct +identities and attributes. Unlike fungible tokens created by the Token Factory, +NFTs cannot be exchanged on a like-for-like basis. + + + +This tutorial guides you through the creation and deployment of an NFT contract +on Sei. By the end, you'll have deployed your own NFT contract. Select one of +the tabs below to get started! + +## EVM + +In this section, we'll use Foundry to deploy an ERC-721 contract to the Ethereum +network. ERC-721 is a standard for NFT contracts on Ethereum. Learn more about +ERC-721 [here](https://erc721.org/). + +### Requirements + +Before we start, ensure you have: + +- Installed Foundry. Follow the + [installation guide](https://book.getfoundry.sh/getting-started/installation). +- A basic understanding of Solidity and smart contract development. +- A wallet with SEI tokens on devnet + +You can obtain devnet tokens from one of the faucets listed [here](../dev-ecosystem-providers/faucets). + +### Setting Up Your Project + +1. Initialize a new Foundry project: + +```bash copy +forge init my-nft-project +cd my-nft-project +``` + +2. Install OpenZeppelin, a library for secure smart contract development. + +```bash copy +forge install OpenZeppelin/openzeppelin-contracts +``` + +3. Create a new Solidity file under `src/` for your NFT contract, e.g., + `MyNFT.sol`. + +### Writing the ERC-721 Contract + +1. In `src/MyNFT.sol`, start by importing OpenZeppelin's ERC-721 implementation: + +```solidity copy +// contracts/MyNFT.sol +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import {ERC721} from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol"; + +contract MyNFT is ERC721 { + constructor() ERC721("MyNFT", "MNFT") { + } +} +``` + + + You may see an error in your IDE about importing `openzeppelin-contracts`. To + resolve this, run this command to create `remapping.txt` in the root of your + project: + + ```bash copy + forge remappings > remappings.txt + ``` + + + +2. Add any additional functions or overrides necessary for your NFT. + +### Testing Your Contract + +1. Write tests for your contract in the `test/` directory. +2. Run your tests with: + +```bash copy +forge test +``` + +### Deploying Your Contract + +1. Compile your contract: + +```bash copy +forge build +``` + +2. Deploy your contract to a local testnet (e.g., using Anvil, Foundry's local + Ethereum node): + +```bash copy +anvil -a 1 +``` + +**Flags** + +- `-a`: flag specifies the number of test accounts to create. This command + will start a local Ethereum node and create one account. In the command + output you will see created account and its private key. Use this private + key to deploy your contract. + +In a new terminal, deploy your contract: + +```bash copy +forge create --rpc-url http://localhost:8545 --private-key src/MyNFT.sol:MyNFT --legacy +``` + +**Flags** + +- `--rpc-url`: flag to specify the URL of the Ethereum node. In this case, + it's the URL of the local Anvil node. +- `--private-key`: flag to specify the private key of the account that will + deploy the contract. Anvil generated test account's private key is used in + this case. + +3. Deploy contract to the Sei devnet (EVM endpoint): + +```bash copy +forge create --rpc-url https://evm-rpc.arctic-1.seinetwork.io/ --private-key src/MyNFT.sol:MyNFT --legacy +``` + +**Flags** + +- `--rpc-url`: flag to specify the URL of the Ethereum node. In this case, + it's the Sei EVM devnet URL. +- `--private-key`: flag to specify the private key of the account that will + deploy the contract. The private key of your account on the Sei devnet is + used in this case. + +Make sure to have SEI in your account to cover the gas fees for contract deployment. + +### Interacting With Your NFT + +- You can interact with your deployed NFT contract using Foundry's `cast` tool + or through other tools like Ethers.js in a script or web application. + +### Create Pointer Contract + +To enable seamless use of this NFT contract in CosmWasm environments, you can +create a pointer contract. This process results in an CW721 token that can be +imported and used in Sei wallets and applications. + +```bash copy +seid tx evm register-cw-pointer ERC721 $ERC721_TOKEN_ADDRESS --from $ACCOUNT --chain-id=arctic-1 --fees=25000usei --node=https://rpc-arctic-1.sei-apis.com/ +``` + +**Parameters** + +- `ERC721_TOKEN_ADDRESS`: The contract address of the ERC721 token you want to + create an CW721 pointer for. + +**Flags** + +- `--from`: The Sei address from which the deployment transaction is sent. This + address must have enough balance to cover transaction fees. +- `--label`: A name for the contract instance used to identify the contract. +- `--chain-id`: Identifies the specific chain of the Sei network you're + interacting with. `arctic-1` refers to the Sei devnet. +- `--broadcast-mode`: Determines how the transaction is broadcasted. Setting + this to `block` means the transaction will wait to be included in a block + before returning a response. +- `--gas`: Specifies the maximum amount of gas that can be consumed by the + transaction. +- `--fees`: Indicates the transaction fee. +- `--node`: Points to the specific Sei node RPC URL you're connecting to for + transaction submission. +- `--no-admin`: Specifies that the contract should not have an admin. This flag + is used to indicate that the contract, once deployed, cannot be upgraded or + migrated. + +Executing this command creates an CW721 NFT contract and outputs the contract +address. This NFT contract is linked to the ERC721 NFT contract, meaning any +activities involving CW721 NFTs will also reflect on the state of the ERC721 +NFTs and vice versa. + +Learn more about EVM interoperability and pointer contracts [here](build/pointers/overview). diff --git a/content/reference/precompiles/_meta.js b/content/evm/precompiles/_meta.js similarity index 100% rename from content/reference/precompiles/_meta.js rename to content/evm/precompiles/_meta.js diff --git a/content/reference/precompiles/addr.mdx b/content/evm/precompiles/addr.mdx similarity index 100% rename from content/reference/precompiles/addr.mdx rename to content/evm/precompiles/addr.mdx diff --git a/content/reference/precompiles/bank.mdx b/content/evm/precompiles/bank.mdx similarity index 100% rename from content/reference/precompiles/bank.mdx rename to content/evm/precompiles/bank.mdx diff --git a/content/reference/precompiles/cosmwasm.mdx b/content/evm/precompiles/cosmwasm.mdx similarity index 100% rename from content/reference/precompiles/cosmwasm.mdx rename to content/evm/precompiles/cosmwasm.mdx diff --git a/content/reference/precompiles/distribution.mdx b/content/evm/precompiles/distribution.mdx similarity index 100% rename from content/reference/precompiles/distribution.mdx rename to content/evm/precompiles/distribution.mdx diff --git a/content/reference/precompiles/example-usage.mdx b/content/evm/precompiles/example-usage.mdx similarity index 100% rename from content/reference/precompiles/example-usage.mdx rename to content/evm/precompiles/example-usage.mdx diff --git a/content/reference/precompiles/governance.mdx b/content/evm/precompiles/governance.mdx similarity index 100% rename from content/reference/precompiles/governance.mdx rename to content/evm/precompiles/governance.mdx diff --git a/content/reference/precompiles/ibc.mdx b/content/evm/precompiles/ibc.mdx similarity index 100% rename from content/reference/precompiles/ibc.mdx rename to content/evm/precompiles/ibc.mdx diff --git a/content/reference/precompiles/json.mdx b/content/evm/precompiles/json.mdx similarity index 100% rename from content/reference/precompiles/json.mdx rename to content/evm/precompiles/json.mdx diff --git a/content/reference/precompiles/oracle.mdx b/content/evm/precompiles/oracle.mdx similarity index 100% rename from content/reference/precompiles/oracle.mdx rename to content/evm/precompiles/oracle.mdx diff --git a/content/reference/precompiles/pointer.mdx b/content/evm/precompiles/pointer.mdx similarity index 100% rename from content/reference/precompiles/pointer.mdx rename to content/evm/precompiles/pointer.mdx diff --git a/content/reference/precompiles/pointerview.mdx b/content/evm/precompiles/pointerview.mdx similarity index 100% rename from content/reference/precompiles/pointerview.mdx rename to content/evm/precompiles/pointerview.mdx diff --git a/content/reference/precompiles/staking.mdx b/content/evm/precompiles/staking.mdx similarity index 100% rename from content/reference/precompiles/staking.mdx rename to content/evm/precompiles/staking.mdx diff --git a/content/reference/evm.mdx b/content/evm/reference.mdx similarity index 100% rename from content/reference/evm.mdx rename to content/evm/reference.mdx diff --git a/content/build/solidity-resources.mdx b/content/evm/solidity-resources.mdx similarity index 100% rename from content/build/solidity-resources.mdx rename to content/evm/solidity-resources.mdx diff --git a/content/evm/transactions.mdx b/content/evm/transactions.mdx new file mode 100644 index 00000000..6308d9f6 --- /dev/null +++ b/content/evm/transactions.mdx @@ -0,0 +1,67 @@ +import { Tabs } from 'nextra/components'; +import { PropertyInfo } from '../../src/components'; +import { SyntaxHighlighter } from '../../src/components/SyntaxHighlighter'; + +# Transactions + +The Sei blockchain supports Ethereum Virtual Machine (EVM) transactions,allowing compatibility with Ethereum-based tools and contracts. + + + +
+ + + + + + + + + +
+
+ + + + + + +
diff --git a/content/index.mdx b/content/index.mdx index 3b40cdae..009a4510 100644 --- a/content/index.mdx +++ b/content/index.mdx @@ -2,8 +2,8 @@ title: 'Home' --- -import { Callout, Cards } from 'nextra/components'; -import { IconBolt, IconCoins, IconClipboardText, IconLock, IconBuildingBridge, IconWallet, IconBook, IconCode, IconDroplet } from '@tabler/icons-react'; +import { Cards } from 'nextra/components'; +import { IconBolt, IconLock, IconBook, IconCode, IconDroplet } from '@tabler/icons-react'; import { EvmWalletConnect, OfficeHoursCard } from '../src/components'; import HeaderIcon from '../public/assets/header.svg'; import Image from 'next/image'; @@ -20,25 +20,14 @@ import Image from 'next/image';
Sei is the first parallelized EVM blockchain delivering unmatched scalability and speed.
- - -## Developers Quickstart +## Get Started - } title="Build a frontend" href="/build/dev-frontend-dapps" /> - } title="Deploy a smart contract" href="/build/evm-general" /> - } title="Testnet & Devnet Faucet" href="/build/faucet" /> + } title="Learn more about Sei" href="/learn" /> + } title="Build on the EVM" href="/evm" /> + } title="Testnet & Devnet Faucet" href="/learn/faucet" /> } title="Run a node" href="/node" /> - } title="Tools & Integrations" href="/providers" /> - - -## Users Quickstart - - - } title="Learn about Sei" href="/learn" /> - } title="Bridge Assets to Sei" href="/learn/bridging" /> - } title="Wallet Setup" href="/learn/wallet-setup" /> - } title="Centralized Exchanges" href="/providers/centralized-exchanges" /> + } title="User Quickstart" href="/learn/user-quickstart" /> ## EVM @@ -46,21 +35,23 @@ import Image from 'next/image'; - **Chain ID**: 1329 (0x531) - **RPC URL**: [https://evm-rpc.sei-apis.com](https://evm-rpc.sei-apis.com) - **Explorers**: [SeiTrace](https://seitrace.com/?chain=pacific-1), [SeiScan](https://www.seiscan.app/?chain=pacific-1) +- **Testnet & Devnet**: [Chain Information](/evm/networks) + +
+ +} title="Start building with the EVM" href="/evm" /> ## Cosmos - **Chain ID**: pacific-1 - **RPC URL**: [https://wallet.rpc.pacific-1.seinetwork.io](https://wallet.rpc.pacific-1.seinetwork.io) - **Explorer**: [SeiTrace](https://seitrace.com/?chain=pacific-1), [SeiScan](https://www.seiscan.app/?chain=pacific-1) +- **Testnet & Devnet**: [Chain Information](/cosmwasm/networks) -> [Testnet and Devnet information](/build/networks) - -## Wallet Linking - -Connect your wallet below to view both your addresses and automatically link them on chain. + -> Learn more about [accounts and linking](/learn/account-structure). +## Connect & Link Wallet -
+> Using this wallet connection will automatically link your EVM and Cosmos addresses. diff --git a/content/learn/_meta.js b/content/learn/_meta.js index af70a45b..66d3ac0c 100644 --- a/content/learn/_meta.js +++ b/content/learn/_meta.js @@ -1,72 +1,48 @@ export default { - index: { - title: 'Home' - }, '-- Getting Started': { type: 'separator', title: 'Getting Started' }, - 'general-overview': 'About Sei', - 'user-quickstart': 'Quickstart', - 'differences-with-ethereum': 'Divergence from Ethereum', - 'dev-chains': 'Chain Setup', - - '-- Onboarding Essentials': { - type: 'separator', - title: 'Onboarding Essentials' - }, + index: 'About Sei', + 'user-quickstart': 'User Quickstart', + 'dev-chains': 'Chain Info', + accounts: 'Accounts', + 'dev-token-standards': 'Token Standards', 'dev-gas': 'Gas', - 'wallet-setup': 'Wallet Setup', - 'ledger-setup': 'Ledger Integration', - 'linking-addresses': 'Linking Address Types', - '-- Account Basics': { + '-- Network Tools & Providers': { type: 'separator', - title: 'Account Basics' + title: 'Network Tools & Providers' }, - 'wrapped-sei': 'Wrapped SEI', - 'hardware-wallets': 'Using Hardware Wallets', - 'wallet-association': 'Wallet Association', + wallets: 'Wallets', + 'rpc-providers': 'RPC Providers', + explorers: 'Block Explorers', + faucet: 'Faucet', + indexers: 'Indexers', + oracles: 'Oracles', + 'centralized-exchanges': 'Centralized Exchanges', - '-- Account Management': { + '-- Consensus': { type: 'separator', - title: 'Account Management' + title: 'Consensus' }, - 'account-structure': 'Account Structure', - 'hd-path-coin-types': 'HD Paths & Coin Types', - - '-- Staking': { - type: 'separator', - title: 'Staking' - }, - 'general-staking': 'Staking Overview', - - '-- Governance': { - type: 'separator', - title: 'Governance' - }, - 'general-governance': 'Governance Overview', + 'general-staking': 'Staking', + 'general-governance': 'Governance', proposals: 'Proposal Process', - '-- Transaction Management': { - type: 'separator', - title: 'Transaction Management' - }, - 'dev-transactions': 'Transaction Overview', - 'execute-multiple': 'Executing Multiple Transactions', - - '-- Oracles': { + '-- EVM <> CW Interoperability': { type: 'separator', - title: 'Oracles' + title: 'EVM <> CW Interoperability' }, - oracles: 'Understanding Oracles', + 'dev-interoperability': 'Overview', + pointers: 'Pointer Contracts', - '-- Cosmos': { + '-- Hardware Wallets': { type: 'separator', - title: 'Cosmos' + title: 'Hardware Wallets' }, - 'fee-grants': 'Understanding Fee Grants', - 'dev-interoperability': 'Interoperability', + 'hardware-wallets': 'Using Hardware Wallets', + 'ledger-setup': 'Ledger Integration', '-- Additional Resources': { type: 'separator', @@ -74,5 +50,14 @@ export default { }, 'user-FAQ': 'FAQ', 'general-brand-kit': 'Brand Kit', - 'general-submit-feedback': 'Submit Feedback' + 'general-submit-feedback': 'Submit Feedback', + 'wallet-integrations': { + display: 'hidden' + }, + 'indexer-providers': { + display: 'hidden' + }, + 'wrapped-sei': { + display: 'hidden' + } }; diff --git a/content/learn/account-structure.mdx b/content/learn/account-structure.mdx deleted file mode 100644 index d7f3ba4e..00000000 --- a/content/learn/account-structure.mdx +++ /dev/null @@ -1,206 +0,0 @@ -# **Sei Account Structure and Address Linking** - -On Sei, accounts are represented by two address formats: - -- **Sei native Bech32** (`sei...`) -- **EVM-compatible Hex** (`0x...`) - -Both addresses for a single account are derived from the same **public key**, -but the chain can only determine their association **after the public key is -known**. - ---- - -## **How Accounts Work on Sei** - -### **Automatic Linking** - -- When an account **broadcasts a transaction** (e.g., sending tokens), its - public key is recorded on-chain. -- Once the public key is known, the **EVM address** and **Bech32 address** are - linked automatically. -- This ensures balances and transactions are accessible across both address - formats. - -### **Manual Association** - -If the account has not broadcasted any transaction yet: - -- Use the `sei_associate` function to **manually record the public key** - on-chain. -- This is a **gasless operation** as long as the account has **at least 1 wei**. - -> **Why is the public key required?** -> The public key enables the chain to derive and validate both the Bech32 and -> EVM addresses. Without it, the chain cannot determine the relationship between -> these two addresses. - ---- - -## **Key Points** - -### **Before Linking** - -- The Bech32 (`sei...`) and EVM (`0x...`) addresses are treated as **separate - accounts**. -- They will have separate balances until linked. -- Native tokens received by the EVM address prior to association will be held in - a temporary native address, which will transfer to the associated address upon - linking. -- Some types of transactions will **not be possible** (see table below). - -### **After Linking** - -- Balances are reflected consistently across both addresses. -- Applications can query either address format seamlessly. - ---- - -## **Wallet Association and Transfer Limitations** - -Certain actions are **not possible** before wallets are associated: - -- Transfers of **CW-based tokens** (e.g., CW20/721/1155) from a non-EVM wallet - to an **unassociated EVM address**. -- Transfers of **ERC-based tokens** (e.g., ERC20/721/1155) from an EVM wallet to - an **unassociated Sei native address**. - ---- - -## Query Linked Addresses - -### Fetch EVM Address for a Sei Address - -```bash copy -curl -X POST $SEIEVM -H "Content-Type: application/json" -d \ -'{"jsonrpc": "2.0", "method": "sei_getEVMAddress", "params": [""], "id": 1}' -``` - -**Example Response**: - -```json copy -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0x4e1ae6017997128D421074FbE31d90362F181C" -} -``` - -**Failure Example**: - -```json copy -{ - "jsonrpc": "2.0", - "id": 1, - "error": { - "code": -32000, - "message": "failed to find EVM address for sei1wev8ptz..." - } -} -``` - -### Fetch Bech32 Address for an EVM Address - -```bash copy -curl -X POST $SEIEVM -H "Content-Type: application/json" -d \ -'{"jsonrpc": "2.0", "method": "sei_getSeiAddress", "params": [""], "id": 1}' -``` - -**Example Response**: - -```json copy -{ - "jsonrpc": "2.0", - "id": 1, - "result": "sei1wev8ptzj27aueu04wg..." -} -``` - ---- - -### Manual Association Using `sei_associate` - -If no transaction has been broadcasted, use this command to manually associate -the addresses: - -```bash copy -seid tx evm associate-address [optional priv key hex] --rpc= --from= [flags] -``` - -> **Note**: The account must have at least 1 wei to perform this operation. - ---- - -## **Deriving Addresses from the Public Key** - -### **Sei Address Derivation** - -The Sei native address is derived from the public key using the following steps: - -1. Hash the public key using the `keccak256` algorithm. -2. Extract the first 20 bytes of the resulting hash. -3. Encode the extracted bytes in **Bech32 format** with the `sei` prefix. - -Example implementation: - -```ts copy -import { bech32 } from 'bech32'; -import { keccak256 } from 'ethereumjs-util'; - -export function deriveSeiAddress(publicKey: Buffer): string { - const hash = keccak256(publicKey); - const words = bech32.toWords(hash.slice(0, 20)); - return bech32.encode('sei', words); -} -``` - -### **EVM Address Derivation** - -The EVM-compatible address is derived as follows: - -1. Hash the public key using the `keccak256` algorithm. -2. Extract the **last 20 bytes** of the resulting hash. -3. Prefix the extracted bytes with `0x` to obtain the EVM address. - -Example implementation: - -```ts copy -import { keccak256 } from 'ethereumjs-util'; - -export function deriveEVMAddress(publicKey: Buffer): string { - const hash = keccak256(publicKey); - return `0x${hash.slice(-20).toString('hex')}`; -} -``` - -### **Summary** - -- **Public Key Hashing**: Both derivations rely on the `keccak256` hashing - algorithm. -- **Sei Address**: Extract the **first 20 bytes** of the hash and encode it in - **Bech32 format**. -- **EVM Address**: Extract the **last 20 bytes** of the hash and format it in - **Hex** with a `0x` prefix. - -### **Why It Works** - -The `keccak256` hashing ensures a consistent and verifiable process for deriving -both address formats from the same public key. This enables a single account to -maintain compatibility across the Sei native and EVM environments. - ---- - -## **Conclusion** - -- Accounts are automatically linked when a transaction is broadcasted or can be - manually associated using `sei_associate`. -- Both address formats share the same **public key**. -- Linking enables dApps and tools to access balances consistently across both - address formats. - ---- - -## **Next Steps** - -For detailed technical instructions on how to perform account association, refer -to the **Wallet Association** section. diff --git a/content/learn/accounts.mdx b/content/learn/accounts.mdx new file mode 100644 index 00000000..98565c7f --- /dev/null +++ b/content/learn/accounts.mdx @@ -0,0 +1,670 @@ +import { ImageWithCaption } from '../../src/components'; +import addressTranslationImage from '../../public/assets/address-derivation.png'; + +# Accounts on Sei EVM and CosmWasm + +Every account on Sei has a unique public key. This public key can be used to +generate multiple wallet addresses, but it is important to note that the two are +functionally the same. They appear different, and depending on the app they may +be used interchangeably, but they both point to the same destination - your +account. The difference is like the difference between the numeral "2" and the +word "two". They both define the same value, but may be used in different +contexts. + +- **"hex" Address**: Starts with `0x` and is EVM-based. + +- **"bech32" Address**: Starts with `sei1` and is used for Sei-native functions. + + + +Although these addresses appear different, they actually share the same +underlying account. This means whatever action you take with one address will +also affect the other. + +If you deposit funds into your EVM address, you can access and use those same +funds with your SEI address, and vice versa. They are linked together as one +account, ensuring seamless integration between the EVM and SEI ecosystems. + +Both addresses for a single account are derived from the same **public key**, but the chain can only determine their association **after the public key is known by the chain** via association. + +## **Key Points** + +### **Before Linking** + +- The Bech32 (`sei...`) and EVM (`0x...`) addresses are treated as **separate + accounts**. +- They will have separate balances until linked. +- Native tokens received by the EVM address prior to association will be held in + a temporary native address, which will transfer to the associated address upon + linking. +- Some types of transactions will **not be possible** (see table below). + +### **After Linking** + +- Balances are reflected consistently across both addresses. +- Applications can query either address format seamlessly. + +--- + +## Wallet Association and Transfer Limitations + +Certain actions are **not possible** before wallets are associated: + +- Transfers of **CW-based tokens** (e.g., CW20/721/1155) from a non-EVM wallet + to an **unassociated EVM address**. +- Transfers of **ERC-based tokens** (e.g., ERC20/721/1155) from an EVM wallet to + an **unassociated Sei native address**. + +--- + +## Methods of Association + +| Method | Security Risk | User Action Required | +| ------------------------------ | ------------- | ------------------------------------------------- | +| **1. Broadcast a Transaction** | Low | Association happens automatically | +| **2. Direct Private Key** | High | Provide private key directly. | +| **3. Signed Message** | Medium | Sign a predefined message to prove ownership. | +| **4. Public Key** | Lower | Provide a compressed public key for association. | +| **5. Gasless Signed Message** | Low | Sign a message without requiring gas (if funded). | + +> Using any of these methods will ensure the **public key** is known to the chain, enabling automatic association between the EVM-compatible and Bech32 addresses. + +Constants for the `addr` precompile can also be found in the repo +[Sei-Chain/precompiles](https://github.com/sei-protocol/sei-chain/tree/44fd60cec6a5ef301df1472431d6db40b382e486/precompiles/addr): + +## **Method 1: Broadcast a Transaction** + +- When an account **broadcasts a transaction** (e.g., sending tokens), its + public key is recorded on-chain. +- Once the public key is known, the **EVM address** and **Bech32 address** are + linked automatically. +- This ensures balances and transactions are accessible across both address + formats. + +## **Method 2: Direct Private Key Association** + +> **Security Risk**: **High** – Requires the private key to be directly +> available. Exposing the private key can compromise the wallet. + +This method directly uses the private key to interact with the network. + + ```ts copy + import { createPublicClient, createWalletClient, http } from 'viem'; + import { privateKeyToAccount } from 'viem/accounts'; + import { seiTestnet } from 'viem/chains'; + import { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } from '@sei-js/evm'; + + const PRIVATE_KEY = ''; + + const publicClient = createPublicClient({ + chain: seiTestnet, + transport: http() + }); + const client = createWalletClient({ chain: seiTestnet, transport: http() }); + + const account = privateKeyToAccount(PRIVATE_KEY); + + const response = await client.writeContract({ + account, + address: ADDRESS_PRECOMPILE_ADDRESS, + abi: ADDRESS_PRECOMPILE_ABI, + functionName: 'associate', + args: ['0', '0', '0', 'example_message'], + gasPrice: BigInt(100_000_000_000) + }); + console.log(response); + ``` + +--- + +## **Method 3: Associate via Signed Message** + +> **Security Risk**: **Medium** – Requires signing a specific message using the +> private key. + +This method involves signing a predefined message to prove ownership of the +account. + + ```ts copy + import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; + import { parseSignature, toHex } from 'viem'; + + const associate = async () => { + const account = privateKeyToAccount(''); + const newPk = generatePrivateKey(); + const newAccount = privateKeyToAccount(newPk); + + const message = 'associate'; + const signature = await newAccount.signMessage({ message }); + const parsedSignature = parseSignature(signature); + + const response = await client.writeContract({ + account, + address: ADDRESS_PRECOMPILE_ADDRESS, + abi: ADDRESS_PRECOMPILE_ABI, + functionName: 'associate', + args: [toHex(Number(parsedSignature.v) - 27), parsedSignature.r, parsedSignature.s, message], + gasPrice: BigInt(100_000_000_000) + }); + console.log(response); + }; + + associate(); + ``` + +--- + +## **Method 4: Associate via Public Key** + +> **Security Risk**: **Lower** – Involves using the public key, which is less +> sensitive than the private key. + +This method compresses the public key and sends it for association. + + ```ts copy + import secp256k1 from 'secp256k1'; + import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; + + const associateViaPubkey = async () => { + const account = privateKeyToAccount(''); + const newPk = generatePrivateKey(); + const newAccount = privateKeyToAccount(newPk); + + const publicKeyBuffer = Buffer.from(newAccount.publicKey.slice(2), 'hex'); + const compressedPubKey = secp256k1.publicKeyConvert(publicKeyBuffer, true); + + const response = await client.writeContract({ + account, + address: ADDRESS_PRECOMPILE_ADDRESS, + abi: ADDRESS_PRECOMPILE_ABI, + functionName: 'associatePubKey', + args: [Buffer.from(compressedPubKey).toString('hex')], + gasPrice: BigInt(100_000_000_000) + }); + console.log(response); + }; + + associateViaPubkey(); + ``` + +--- + +## **Method 5: Gasless Association via Signed Message** + +> **Security Risk**: **Low** – Requires signing a message but does not expose +> the private key. No gas is consumed if the account already has funds. + +This method signs a message and uses the `sei_associate` RPC call to finalize +the association. + + ```ts copy + import { parseSignature, numberToHex } from 'viem'; + + interface AssociateRequest { + r: string; + s: string; + v: string; + custom_message: string; + } + + interface AssociateRequestSchema { + Method: 'sei_associate'; + Parameters: [request: AssociateRequest]; + ReturnType: null; + } + + const associateGasless = async (signature: `0x${string}`, message: string) => { + const parsedSignature = parseSignature(signature); + const messageLength = Buffer.from(message, 'utf8').length; + const messageToSign = `\x19Ethereum Signed Message:\n${messageLength}${message}`; + + const request: AssociateRequest = { + r: parsedSignature.r, + s: parsedSignature.s, + v: numberToHex(Number(parsedSignature.v) - 27), + custom_message: messageToSign + }; + + const response = await client.request({ + method: 'sei_associate', + params: [request] + }); + console.log(response); + }; + + // Example Usage + associateGasless('', 'example_message'); + ``` + +## Query Linked Addresses + +### Fetch EVM Address for a Sei Address + +```bash copy +curl -X POST $SEIEVM -H "Content-Type: application/json" -d \ +'{"jsonrpc": "2.0", "method": "sei_getEVMAddress", "params": [""], "id": 1}' +``` + +**Example Response**: + +```json copy +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x4e1ae6017997128D421074FbE31d90362F181C" +} +``` + +**Failure Example**: + +```json copy +{ + "jsonrpc": "2.0", + "id": 1, + "error": { + "code": -32000, + "message": "failed to find EVM address for sei1wev8ptz..." + } +} +``` + +### Fetch Bech32 Address for an EVM Address + +```bash copy +curl -X POST $SEIEVM -H "Content-Type: application/json" -d \ +'{"jsonrpc": "2.0", "method": "sei_getSeiAddress", "params": [""], "id": 1}' +``` + +**Example Response**: + +```json copy +{ + "jsonrpc": "2.0", + "id": 1, + "result": "sei1wev8ptzj27aueu04wg..." +} +``` + +--- + +### Manual Association Using `sei_associate` + +If no transaction has been broadcasted, use this command to manually associate +the addresses: + +```bash copy +seid tx evm associate-address [optional priv key hex] --rpc= --from= [flags] +``` + +> **Note**: The account must have at least 1 wei to perform this operation. + +--- + +## Deriving Addresses from the Public Key + +### Sei Address Derivation + +The Sei native address is derived from the public key using the following steps: + +1. Hash the public key using the `keccak256` algorithm. +2. Extract the first 20 bytes of the resulting hash. +3. Encode the extracted bytes in **Bech32 format** with the `sei` prefix. + +Example implementation: + +```ts copy +import { bech32 } from 'bech32'; +import { keccak256 } from 'ethereumjs-util'; + +export function deriveSeiAddress(publicKey: Buffer): string { + const hash = keccak256(publicKey); + const words = bech32.toWords(hash.slice(0, 20)); + return bech32.encode('sei', words); +} +``` + +### EVM Address Derivation + +The EVM-compatible address is derived as follows: + +1. Hash the public key using the `keccak256` algorithm. +2. Extract the **last 20 bytes** of the resulting hash. +3. Prefix the extracted bytes with `0x` to obtain the EVM address. + +Example implementation: + +```ts copy +import { keccak256 } from 'ethereumjs-util'; + +export function deriveEVMAddress(publicKey: Buffer): string { + const hash = keccak256(publicKey); + return `0x${hash.slice(-20).toString('hex')}`; +} +``` + +### Summary + +- **Public Key Hashing**: Both derivations rely on the `keccak256` hashing + algorithm. +- **Sei Address**: Extract the **first 20 bytes** of the hash and encode it in + **Bech32 format**. +- **EVM Address**: Extract the **last 20 bytes** of the hash and format it in + **Hex** with a `0x` prefix. + +### Why It Works + +The `keccak256` hashing ensures a consistent and verifiable process for deriving +both address formats from the same public key. This enables a single account to +maintain compatibility across the Sei native and EVM environments. + +--- + +### Recap + +- Accounts are automatically linked when a transaction is broad-casted or can be + manually associated using `sei_associate`. +- Both address formats share the same **public key**. +- Linking enables dApps and tools to access balances consistently across both + address formats. + +--- + +## HD Paths and Coin Types + +When deriving a private key from a mnemonic phrase, the hierarchical +deterministic (HD) path involves multiple parameters, including the coin type. +The coin type determines the blockchain ecosystem for which the key is derived, +making it crucial when dealing with different wallets and blockchains. + +### Coin Type Parameter + +The second parameter in the HD path specifies the coin type, which is defined by +the BIP-44 standard. This parameter identifies the blockchain ecosystem +associated with the derived keys. + +- **Ethereum (Coin Type 60)**: Wallets like MetaMask use coin type 60. The HD + path for Ethereum typically looks like this: `m/44'/60'/0'/0/0`. +- **Cosmos (Coin Type 118)**: Wallets for Cosmos-based chains, such as Compass, + use coin type 118. The HD path for Cosmos typically looks like this: + `m/44'/118'/0'/0/0`. + +### Implications + +Due to the different coin types, a mnemonic phrase used to derive keys for +Ethereum (coin type 60) cannot be directly used in a Cosmos wallet (coin +type 118) to access the same accounts. This is because the HD path determines a +different set of keys for each coin type, meaning the derived addresses will +differ. + +### Private Key Export + +Users can export their private key from MetaMask (derived using coin type 60) +and import it into any Cosmos wallet. This works because the private key, once +derived, can be used across different blockchain ecosystems, provided the +receiving wallet supports the import function. This allows users to manage their +assets across various blockchains using the same underlying cryptographic key. + +### Example HD Paths + +- **Traditional Cosmos Path**: `m/44'/118'/0'/0/0` +- **Traditional EVM Path**: `m/44'/60'/0'/0/0` + +## Generating Wallets + +### **Deriving bech32 and hex addresses from pubkey** + +Sei uses a unique method of deriving both the Cosmos/Tendermint style bech32 +address and the Ethereum-style hex address from the same public key, using the +`keccak` hashing method common in EVM networks. These extensively commented snippets demonstrate the 'proper' method of deriving +both bech32 and hex addresses from a given ECDSA SECP256k1 key: + +
+ Python - from pubkey + + ```python copy + import base64 + import json + from hashlib import sha256, new as hashlib_new + from coincurve import PublicKey + from bech32 import bech32_encode, convertbits + from Crypto.Hash import keccak + + # Example input, replace with the actual pubkey JSON string + pubkey_json = '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Agmik4xkmF57hNjzykYHP3gRu1Mpae4B5BCiwx7jmRzI"}' + + # Extract the base64-encoded key from the JSON-like string + pubkey_dict = json.loads(pubkey_json) + pubkey_base64 = pubkey_dict['key'] + + # Decode the base64-encoded public key + public_key_compressed = base64.b64decode(pubkey_base64) + + # Ensure the public key length is 33 bytes (compressed key format) + if len(public_key_compressed) != 33: + raise ValueError(f"Invalid public key length, expected 33 bytes for compressed format, got {len(public_key_compressed)}") + + # Debugging: Print the public key details + print(f"Compressed public key (hex): {public_key_compressed.hex()}") + + # SHA-256 on the compressed public key + sha256_digest = sha256(public_key_compressed).digest() + # Debugging: Print SHA-256 digest + print(f"SHA-256 Digest: {sha256_digest.hex()}") + + # RIPEMD-160 on SHA-256 hash + ripemd160 = hashlib_new('ripemd160') + ripemd160.update(sha256_digest) + ripemd160_digest = ripemd160.digest() + # Debugging: Print RIPEMD-160 digest + print(f"RIPEMD-160 Digest: {ripemd160_digest.hex()}") + + # Convert the digest to 5-bit groups for Bech32 encoding + five_bit_ripemd160 = convertbits(ripemd160_digest, 8, 5, pad=True) + bech32_address = bech32_encode("sei", five_bit_ripemd160) + + print(f"Bech32 Cosmos Address: {bech32_address}") + + # Decompress the public key to 65 bytes + public_key = PublicKey(public_key_compressed).format(compressed=False) + + # Debugging: Print the public key details + print(f"Decompressed public key length: {len(public_key)}") + print(f"Decompressed public key (hex): {public_key.hex()}") + + # Derive Ethereum Address using Keccak-256 + keccak_hash = keccak.new(digest_bits=256) + keccak_hash.update(public_key[1:]) # Exclude the first byte (0x04) + digest_keccak = keccak_hash.digest() + eth_address = digest_keccak[-20:] + eth_address_hex = '0x' + eth_address.hex() + + print(f"Ethereum Address: {eth_address_hex}") + ``` + +
+ +--- + +
+ Typescript - from pubkey + + ```typescript copy + import { fromBase64 } from '@cosmjs/encoding'; + import { sha256 } from '@noble/hashes/sha256'; + import { ripemd160 } from '@noble/hashes/ripemd160'; + import { keccak_256 } from '@noble/hashes/sha3'; + import { secp256k1 } from '@noble/curves/secp256k1'; + import { bech32 } from 'bech32'; + + // Utility function to convert bits for Bech32 encoding + function convertBits(data: Uint8Array, fromBits: number, toBits: number, pad: boolean): number[] { + let acc = 0; + let bits = 0; + const result: number[] = []; + const maxv = (1 << toBits) - 1; + + for (const value of data) { + acc = (acc << fromBits) | value; + bits += fromBits; + while (bits >= toBits) { + bits -= toBits; + result.push((acc >> bits) & maxv); + +} +} + + if (pad) { + if (bits > 0) { + result.push((acc << (toBits - bits)) & maxv); + +} +} else if (bits >= fromBits || (acc << (toBits - bits)) & maxv) { +throw new Error('Unable to convert bits'); +} + + return result; + +} + + // Define the prefix for the Bech32 address (e.g., "sei" for Sei network) + const chainPrefix = 'sei'; + + // Public key JSON string (replace with actual data) + const pubkeyJson = '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AiN+aFvHgjblWPaP9Er5p005JjPX3nj4I/+jA6W4BOho"}'; + + // Parse the JSON string to extract the public key in Base64 format + const pubkeyDict = JSON.parse(pubkeyJson); + const pubkeyBase64 = pubkeyDict.key; + + console.log('Original public key JSON:', pubkeyJson); + console.log('Parsed public key object:', pubkeyDict); + console.log('Base64-encoded public key:', pubkeyBase64); + + // Decode the Base64-encoded public key to its compressed form + const publicKeyCompressed = fromBase64(pubkeyBase64); + + console.log('Compressed public key (bytes):', publicKeyCompressed); + console.log('Compressed public key (hex):', Buffer.from(publicKeyCompressed).toString('hex')); + + // Perform SHA-256 hashing on the compressed public key + const sha256Digest = sha256(publicKeyCompressed); + console.log('SHA-256 hash of public key (hex):', Buffer.from(sha256Digest).toString('hex')); + + // Perform RIPEMD-160 hashing on the SHA-256 digest + const ripemd160Digest = ripemd160(sha256Digest); + console.log('RIPEMD-160 hash of SHA-256 hash (hex):', Buffer.from(ripemd160Digest).toString('hex')); + + // Convert the RIPEMD-160 digest to a 5-bit array for Bech32 encoding + const fiveBitArray = convertBits(ripemd160Digest, 8, 5, true); + + // Encode the 5-bit array into a Bech32 address with the specified prefix + const bech32Address = bech32.encode(chainPrefix, fiveBitArray); + + console.log(`Bech32 Cosmos Address: ${bech32Address}`); + + // Decompress the public key to its uncompressed form (65 bytes) and exclude the first byte + const publicKeyUncompressed = secp256k1.ProjectivePoint.fromHex(publicKeyCompressed).toRawBytes(false).slice(1); + + // Perform Keccak-256 hashing on the uncompressed public key to derive the Ethereum address + const keccakHash = keccak_256(publicKeyUncompressed); + const ethAddress = '0x' + Buffer.from(keccakHash.slice(-20)).toString('hex'); + + console.log('Uncompressed public key (hex):', Buffer.from(publicKeyUncompressed).toString('hex')); + console.log('Keccak-256 hash of uncompressed public key (hex):', Buffer.from(keccakHash).toString('hex')); + console.log(`Ethereum Address: ${ethAddress}`); + ``` + +
+ +--- + +
+ Typescript - Full Derivation from Private Key + + ```typescript copy + import { sha256 } from '@noble/hashes/sha256'; + import { ripemd160 } from '@noble/hashes/ripemd160'; + import { keccak_256 } from '@noble/hashes/sha3'; + import { secp256k1 } from '@noble/curves/secp256k1'; + import { bech32 } from 'bech32'; + + // Utility function to convert bits for Bech32 encoding + function convertBits(data: Uint8Array, fromBits: number, toBits: number, pad: boolean): number[] { + let acc = 0; + let bits = 0; + const result: number[] = []; + const maxv = (1 << toBits) - 1; + + for (const value of data) { + acc = (acc << fromBits) | value; + bits += fromBits; + while (bits >= toBits) { + bits -= toBits; + result.push((acc >> bits) & maxv); + +} +} + + if (pad) { + if (bits > 0) { + result.push((acc << (toBits - bits)) & maxv); + +} +} else if (bits >= fromBits || (acc << (toBits - bits)) & maxv) { +throw new Error('Unable to convert bits'); +} + + return result; + +} + + // Function to generate addresses from a private key + function generateAddresses(privateKeyHex: string): { + seiAddress: string; + ethAddress: string; + +} { +// Ensure the private key is exactly 32 bytes long +const privateKey = Uint8Array.from(Buffer.from(privateKeyHex.padStart(64, '0'), 'hex')); +if (privateKey.length !== 32) { +throw new Error('Private key must be 32 bytes long.'); +} + + // Derive the compressed public key from the private key + const publicKey = secp256k1.getPublicKey(privateKey, true); + const publicKeyBytes = publicKey; + + // Perform SHA-256 hashing on the compressed public key + const sha256Digest = sha256(publicKeyBytes); + + // Perform RIPEMD-160 hashing on the SHA-256 digest + const ripemd160Digest = ripemd160(sha256Digest); + + // Convert the RIPEMD-160 digest to a 5-bit array for Bech32 encoding + const fiveBitArray = convertBits(ripemd160Digest, 8, 5, true); + + // Bech32 address with "sei" prefix + const seiAddress = bech32.encode('sei', fiveBitArray, 256); + + // Derive the uncompressed public key from the private key and exclude the first byte + const publicKeyUncompressed = secp256k1.getPublicKey(privateKey, false).slice(1); + + // Perform Keccak-256 hashing on the uncompressed public key to derive the Ethereum address + const keccakHash = keccak_256(publicKeyUncompressed); + const ethAddress = `0x${Buffer.from(keccakHash).slice(-20).toString('hex')}`; + + return { seiAddress, ethAddress }; + +} + + // Example usage of the generateAddresses function + const privateKeyHex = '907ab4bf7fc60cff'; + const { seiAddress, ethAddress } = generateAddresses(privateKeyHex); + + console.log(`Sei Address: ${seiAddress}`); + console.log(`Ethereum Address: ${ethAddress}`); + ``` + +
+ +--- diff --git a/content/providers/centralized-exchanges.mdx b/content/learn/centralized-exchanges.mdx similarity index 100% rename from content/providers/centralized-exchanges.mdx rename to content/learn/centralized-exchanges.mdx diff --git a/content/learn/dev-chains.mdx b/content/learn/dev-chains.mdx index b38f4b2b..1e8ad57a 100644 --- a/content/learn/dev-chains.mdx +++ b/content/learn/dev-chains.mdx @@ -1,6 +1,5 @@ import { Callout } from 'nextra/components'; import { Code } from '@radix-ui/themes'; -import { CHAIN_IDS } from '@sei-js/registry'; # Chains @@ -9,40 +8,39 @@ This multi-chain approach allows developers to build, deploy, manage, and iterate confidently, ensuring thorough testing and feedback before updates go live on the mainnet. -All chain updates are first deployed to the devnet to ensure stability. They are then moved to the testnet for further testing and validation. Finally, the updates are released to the mainnet. This process allows developers to test their applications thoroughly and raise any concerns regarding the upgrades before they go live on the mainnet. +> [!NOTE] +> +> All chain updates are first deployed to the devnet to ensure stability. They are then moved to the testnet for further testing and validation. Finally, the updates are released to the mainnet. This process allows developers to test their applications thoroughly and raise any concerns regarding the upgrades before they go live on the mainnet. ## Mainnet -The {{CHAIN_IDS.mainnet}} chain is the mainnet of the Sei -blockchain. It is the live, production environment where actual transactions and +Mainnet is the live, production environment where actual transactions and smart contract deployments occur. This chain is used for all real-world applications and activities. - **Purpose**: Production -- **Chain ID**: {{CHAIN_IDS.mainnet}} +- **Chain ID**: `pacific-1` - **EVM Chain ID**: `1329` or `0x531` ## Testnet -The {{CHAIN_IDS.testnet}} chain is the testnet of the Sei -blockchain. It is used for testing and development purposes. Developers can +Testnet is used for testing and development purposes. Developers can deploy and test their dApps and smart contracts in a controlled environment that simulates the mainnet conditions. This chain is crucial for ensuring that applications work as expected before going live. - **Purpose**: Staging -- **Chain ID**: {{CHAIN_IDS.testnet}} +- **Chain ID**: `atlantic-2` - **EVM Chain ID**: `1328` or `0x530` ## Devnet -The {{CHAIN_IDS.devnet}} chain is the devnet of the Sei blockchain. -It serves as a development network for early-stage testing and experimentation. +Devnet serves as a development network for early-stage testing and experimentation. This chain is typically used by developers to test new features, perform integration testing, and develop prototypes in an isolated environment. - **Purpose**: Testing -- **Chain ID**: {{CHAIN_IDS.devnet}} +- **Chain ID**: `arctic-1` - **EVM Chain ID**: `713715` or `0xAE3F3` ## Local Chains @@ -59,6 +57,10 @@ control over all tokens and governance decisions. Please read the [Nodes Introduction](node/getting-started) section for more information on how to set up and run a local chain. +> [!TIP] +> +> View more chain specific information, RPC endpoints, and Explorers for the [EVM](/evm/networks) and for [CosmWasm](/cosmwasm/networks). + ## Chain Registry The [Sei Chain Registry](https://github.com/sei-protocol/chain-registry) diff --git a/content/learn/dev-gas.mdx b/content/learn/dev-gas.mdx index 605a35be..45b3e84d 100644 --- a/content/learn/dev-gas.mdx +++ b/content/learn/dev-gas.mdx @@ -34,16 +34,6 @@ To help developers and users estimate fees on Sei, please reference Blocknative. Their estimates are based on real-time SEI data and advanced ML modeling to accurately and consistently estimate SEI transaction fees. -**Using Blocknative's Gas API** - -To leverage Blocknative's you will need an -[API Key](https://docs.blocknative.com/gas-prediction/gas-platform#authentication). -Once you have an API key, you can request fee estimation for SEI: - -``` -curl -H "Authorization: your-apikey-here" https://api.blocknative.com/gasprices/blockprices?chainid=1329 -``` - ### Maximum Gas The maximum gas limit for a transaction ensures that complex transactions do not @@ -123,7 +113,15 @@ Optimizing gas prices involves efficient smart contract coding practices: ## Fee Grants -Sei allows users to pay for gas fees on behalf of other users. This feature is +Sei Cosmos allows users to pay for gas fees on behalf of other users. This feature is useful for dApps that want to cover the gas fees for their users. Learn more -about [Fee Grants](/dev-advanced-concepts/fee-grants) in the Advanced Concepts +about [Fee Grants](/cosmwasm/fee-grants) in the CosmWasm section. section. + +## Using Blocknative's Gas API + +To leverage Blocknative's you will need an [API Key](https://docs.blocknative.com/gas-prediction/gas-platform#authentication). Once you have an API key, you can request fee estimation for SEI: + +``` +curl -H "Authorization: your-apikey-here" https://api.blocknative.com/gasprices/blockprices?chainid=1329 +``` diff --git a/content/learn/dev-interoperability.mdx b/content/learn/dev-interoperability.mdx index d85ec666..40a3e2ab 100644 --- a/content/learn/dev-interoperability.mdx +++ b/content/learn/dev-interoperability.mdx @@ -2,7 +2,23 @@ import { ImageWithCaption } from '../../src/components/ImageWithCaption'; import interoperability from '../../public/assets/interoperability.png'; -# Virtual Machine Interoperability +# EVM and CosmWasm Interoperability + +## Dual Address Support + +Sei supports two wallet address types: + +- **EVM (0x) address:** Ethereum-style addresses prefixed with "0x". +- **Sei address:** Native Sei blockchain addresses prefixed with "sei1". + +Both addresses are derived from the same public key, ensuring seamless asset +integration across formats. You can find your corresponding wallet addresses +directly in the Sei app. + +For more details on interoperability, explore our article +[here](https://blog.sei.io/sei-v2-interoperability/). + +## Virtual Machine Interoperability EVM and CosmWasm based smart contracts co-exist on Sei, but live in different execution environments. This creates a challenge for users, who use wallets that @@ -15,9 +31,7 @@ features, allowing for smooth and easy interactions between both environments. Precompiled EVM contracts and Pointer Contracts enable all contracts to be accessible from both VM environments. - - -## Precompiled Contracts +## Precompile Contracts Sei precompiles are smart contracts embedded directly within the Sei EVM environment. They provide a gateway for users and developers to access native @@ -39,3 +53,7 @@ ERC721, etc.), and any IBC denom. Learn more about Pointer Contracts and how to deploy them [here](../../build/pointers/overview.mdx). + +## Example Diagram + + diff --git a/content/build/dev-token-standards.mdx b/content/learn/dev-token-standards.mdx similarity index 95% rename from content/build/dev-token-standards.mdx rename to content/learn/dev-token-standards.mdx index f8e90578..ced80c29 100644 --- a/content/build/dev-token-standards.mdx +++ b/content/learn/dev-token-standards.mdx @@ -111,10 +111,14 @@ ERC721 and CW721 standards as well as their counterparts with royalties (2981). ## **IBC Tokens** -Inter-Blockchain Communication (IBC) is a trustless permissionless interchain +Inter-Blockchain Communication (IBC) is a trust-less and permission-less interchain messaging protocol that enables communication between many different chains. IBC tokens are tokens bridged from one chain to another using the IBC protocol. Channels are set up to establish communication between the chains. Each channel has a unique identifier and specific configurations. View the [IBC Channel](https://github.com/sei-protocol/chain-registry/blob/main/ibc_info.json) section of the Sei chain registry for channel information. + +### **Wrapped Sei (wSei)** + +Some dApps may require Sei tokens to be wrapped in order to interact with them. Follow [this guide](/learn/wrapped-sei) to learn how to wrap Sei tokens. diff --git a/content/learn/dev-transactions.mdx b/content/learn/dev-transactions.mdx deleted file mode 100644 index 03d0ce4e..00000000 --- a/content/learn/dev-transactions.mdx +++ /dev/null @@ -1,194 +0,0 @@ -import { Tabs } from 'nextra/components'; -import { PropertyInfo } from '../../src/components'; -import { SyntaxHighlighter } from '../../src/components/SyntaxHighlighter'; - -# Transactions - -Transactions are essential on the Sei blockchain for any state updates, -including token transfers, account linking, and smart contract execution. While -creating an account doesn’t require a transaction, associating an account with -blockchain actions does. - -Each transaction is signed with the sender’s private key to verify authenticity -and ownership. For more on private keys, see -[HD Paths and Coin Types](/dev-advanced-concepts/hd-path-coin-types). - -## Transaction Types - -Since Sei supports both EVM and Cosmos SDK transactions, there are different -transaction types based on the execution environment. The following sections -provide an overview of Cosmos and EVM transactions on Sei. - -### EVM Transactions - -The Sei blockchain supports Ethereum Virtual Machine (EVM) transactions, -allowing compatibility with Ethereum-based tools and contracts. - - - -
- - - - - - - - - -
-
- - - - - - -
- -### Cosmos Transactions - -Cosmos transactions are used for interacting with Cosmos based RPC's and -tooling. They consist of the body, auth info, and signatures. - - - - - - -
- - - -
-
-
- -#### Signing Cosmos Transactions - -Cosmos transactions on the Sei blockchain follow the standard Cosmos SDK format. -They include various types of messages that can be included in the transaction -body. - -Using the `seid` CLI, you can use the `--generate-only` flag to generate an -unsigned transaction in JSON format. The transaction can then be signed and -broadcasted to the network. - -Assuming you have an unsigned JSON transaction file, you can sign it using the -`seid tx sign` command. The signed transaction will be in JSON format and can be -broadcasted to the network. - -`seid tx sign unsigned_tx.json --chain-id my-test-chain --keyring-backend test --from $SIGNER_ADDRESS` diff --git a/content/providers/explorers.mdx b/content/learn/explorers.mdx similarity index 100% rename from content/providers/explorers.mdx rename to content/learn/explorers.mdx diff --git a/content/build/faucet.mdx b/content/learn/faucet.mdx similarity index 100% rename from content/build/faucet.mdx rename to content/learn/faucet.mdx diff --git a/content/learn/general-overview.mdx b/content/learn/general-overview.mdx deleted file mode 100644 index d7a6db02..00000000 --- a/content/learn/general-overview.mdx +++ /dev/null @@ -1,78 +0,0 @@ -# About Sei - -Parallel execution, high throughput and unified VM operability establish Sei as -the standard for a scalable EVM and for interconnected blockchain ecosystems. - -Sei’s twin-turbo consensus and SeiDB achieve 400-millisecond block times and -deliver transaction throughput tailored for high-demand blockchain environments. -Advancements in performance position Sei as a pivotal force in -cross-disciplinary distributed computing and redefine EVM capabilities. The -design enables complex real-world decentralized applications and sets a new -benchmark for blockchain technology. - -Sei’s architecture offers seamless interoperability and gives EVM developers -native access to the Cosmos ecosystem with IBC tokens, multi-sig accounts and -fee grants. Pointer Contracts and Precompile Contracts bridge EVM and CosmWasm -and enable smooth interaction with assets ranging from ERC20 to CW20 tokens and -CW721 to ERC721 NFTs without sacrificing performance. Integrating IBC and Wasm -directly into the EVM through Precompile Contracts strengthens cross-VM -functionality. - -## What is the EVM? - -The EVM (Ethereum Virtual Machine) is used to process transactions in -blockchains such as Ethereum. Most crypto native developers are extremely -familiar with the EVM. - -Unfortunately, the EVM is quite inefficient - on Ethereum L1, it's not able to -process more than ~20 TPS. - -This results in - -- high transaction fees for users, often going into hundreds of dollars for - simple transactions -- a restricted design space for developers, who are unable to build high - performance applications - -## What is parallelization? - -Parallelization lets you process multiple things at the same time (i.e. in -parallel). This is commonly used in software engineering to take advantage of -modern hardware (which has multiple cores) to process multiple workstreams at -the same time. - -For Sei, parallelization is used to process multiple independent transactions at -the same time. - -## What optimizations does Sei introduce? - -Sei introduces four major innovations: - -- **Twin Turbo Consensus**: This feature allows Sei to reach the fastest time to - finality of any blockchain at 400ms, unlocking web2 like experiences for - applications. -- **Optimistic Parallelization**: This feature allows developers to unlock - parallel processing for their Ethereum applications, with no additional work. -- **SeiDB**: This major upgrade allows Sei to handle the much higher rate of - data storage, reads and writes which become extremely important for a high - performance blockchain. -- **Interoperable EVM**: This allows existing developers in the Ethereum - ecosystem to deploy their applications, tooling and infrastructure to Sei with - no changes, while benefiting from the 100x performance improvements offered by - Sei. - -All these features combine to unlock a brand new, scalable design space for the -Ethereum Ecosystem. - -## Sei performance metrics - -With these performance optimizations, Sei is able to get - -- 400 millisecond time to finality -- 5,030 transactions per second (12,500 theoretical max) - -## What are the benefits of Sei? - -Sei represents a 100x improvement on the EVM. This will unlock an entirely new -design space for application developers, and make the EVM much cheaper to access -for normal people. diff --git a/content/learn/hd-path-coin-types.mdx b/content/learn/hd-path-coin-types.mdx deleted file mode 100644 index a68171dc..00000000 --- a/content/learn/hd-path-coin-types.mdx +++ /dev/null @@ -1,295 +0,0 @@ -## **HD Paths and Coin Types** - -When deriving a private key from a mnemonic phrase, the hierarchical -deterministic (HD) path involves multiple parameters, including the coin type. -The coin type determines the blockchain ecosystem for which the key is derived, -making it crucial when dealing with different wallets and blockchains. - -### **Coin Type Parameter** - -The second parameter in the HD path specifies the coin type, which is defined by -the BIP-44 standard. This parameter identifies the blockchain ecosystem -associated with the derived keys. - -- **Ethereum (Coin Type 60)**: Wallets like MetaMask use coin type 60. The HD - path for Ethereum typically looks like this: `m/44'/60'/0'/0/0`. -- **Cosmos (Coin Type 118)**: Wallets for Cosmos-based chains, such as Compass, - use coin type 118. The HD path for Cosmos typically looks like this: - `m/44'/118'/0'/0/0`. - -### **Implications** - -Due to the different coin types, a mnemonic phrase used to derive keys for -Ethereum (coin type 60) cannot be directly used in a Cosmos wallet (coin -type 118) to access the same accounts. This is because the HD path determines a -different set of keys for each coin type, meaning the derived addresses will -differ. - -### **Private Key Export** - -Users can export their private key from MetaMask (derived using coin type 60) -and import it into any Cosmos wallet. This works because the private key, once -derived, can be used across different blockchain ecosystems, provided the -receiving wallet supports the import function. This allows users to manage their -assets across various blockchains using the same underlying cryptographic key. - -### **Example HD Paths** - -- **Traditional Cosmos Path**: `m/44'/118'/0'/0/0` -- **Traditional EVM Path**: `m/44'/60'/0'/0/0` - -## **Generating Wallets** - -### **Deriving bech32 and hex addresses from pubkey** - -Sei uses a unique method of deriving both the Cosmos/Tendermint style bech32 -address and the Ethereum-style hex address from the same public key, using the -`keccak` hashing method common in EVM networks. - -### **Examples** - -These extensively commented snippets demonstrate the 'proper' method of deriving -both bech32 and hex addresses from a given ECDSA SECP256k1 key: - -
-Python - from pubkey - -```python copy -import base64 -import json -from hashlib import sha256, new as hashlib_new -from coincurve import PublicKey -from bech32 import bech32_encode, convertbits -from Crypto.Hash import keccak - -# Example input, replace with the actual pubkey JSON string -pubkey_json = '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Agmik4xkmF57hNjzykYHP3gRu1Mpae4B5BCiwx7jmRzI"}' - -# Extract the base64-encoded key from the JSON-like string -pubkey_dict = json.loads(pubkey_json) -pubkey_base64 = pubkey_dict['key'] - -# Decode the base64-encoded public key -public_key_compressed = base64.b64decode(pubkey_base64) - -# Ensure the public key length is 33 bytes (compressed key format) -if len(public_key_compressed) != 33: - raise ValueError(f"Invalid public key length, expected 33 bytes for compressed format, got {len(public_key_compressed)}") - -# Debugging: Print the public key details -print(f"Compressed public key (hex): {public_key_compressed.hex()}") - -# SHA-256 on the compressed public key -sha256_digest = sha256(public_key_compressed).digest() -# Debugging: Print SHA-256 digest -print(f"SHA-256 Digest: {sha256_digest.hex()}") - -# RIPEMD-160 on SHA-256 hash -ripemd160 = hashlib_new('ripemd160') -ripemd160.update(sha256_digest) -ripemd160_digest = ripemd160.digest() -# Debugging: Print RIPEMD-160 digest -print(f"RIPEMD-160 Digest: {ripemd160_digest.hex()}") - -# Convert the digest to 5-bit groups for Bech32 encoding -five_bit_ripemd160 = convertbits(ripemd160_digest, 8, 5, pad=True) -bech32_address = bech32_encode("sei", five_bit_ripemd160) - -print(f"Bech32 Cosmos Address: {bech32_address}") - -# Decompress the public key to 65 bytes -public_key = PublicKey(public_key_compressed).format(compressed=False) - -# Debugging: Print the public key details -print(f"Decompressed public key length: {len(public_key)}") -print(f"Decompressed public key (hex): {public_key.hex()}") - -# Derive Ethereum Address using Keccak-256 -keccak_hash = keccak.new(digest_bits=256) -keccak_hash.update(public_key[1:]) # Exclude the first byte (0x04) -digest_keccak = keccak_hash.digest() -eth_address = digest_keccak[-20:] -eth_address_hex = '0x' + eth_address.hex() - -print(f"Ethereum Address: {eth_address_hex}") -``` - -
- ---- - -
-Typescript - from pubkey - -```typescript copy -import { fromBase64 } from '@cosmjs/encoding'; -import { sha256 } from '@noble/hashes/sha256'; -import { ripemd160 } from '@noble/hashes/ripemd160'; -import { keccak_256 } from '@noble/hashes/sha3'; -import { secp256k1 } from '@noble/curves/secp256k1'; -import { bech32 } from 'bech32'; - -// Utility function to convert bits for Bech32 encoding -function convertBits(data: Uint8Array, fromBits: number, toBits: number, pad: boolean): number[] { - let acc = 0; - let bits = 0; - const result: number[] = []; - const maxv = (1 << toBits) - 1; - - for (const value of data) { - acc = (acc << fromBits) | value; - bits += fromBits; - while (bits >= toBits) { - bits -= toBits; - result.push((acc >> bits) & maxv); - } - } - - if (pad) { - if (bits > 0) { - result.push((acc << (toBits - bits)) & maxv); - } - } else if (bits >= fromBits || (acc << (toBits - bits)) & maxv) { - throw new Error('Unable to convert bits'); - } - - return result; -} - -// Define the prefix for the Bech32 address (e.g., "sei" for Sei network) -const chainPrefix = 'sei'; - -// Public key JSON string (replace with actual data) -const pubkeyJson = '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AiN+aFvHgjblWPaP9Er5p005JjPX3nj4I/+jA6W4BOho"}'; - -// Parse the JSON string to extract the public key in Base64 format -const pubkeyDict = JSON.parse(pubkeyJson); -const pubkeyBase64 = pubkeyDict.key; - -console.log('Original public key JSON:', pubkeyJson); -console.log('Parsed public key object:', pubkeyDict); -console.log('Base64-encoded public key:', pubkeyBase64); - -// Decode the Base64-encoded public key to its compressed form -const publicKeyCompressed = fromBase64(pubkeyBase64); - -console.log('Compressed public key (bytes):', publicKeyCompressed); -console.log('Compressed public key (hex):', Buffer.from(publicKeyCompressed).toString('hex')); - -// Perform SHA-256 hashing on the compressed public key -const sha256Digest = sha256(publicKeyCompressed); -console.log('SHA-256 hash of public key (hex):', Buffer.from(sha256Digest).toString('hex')); - -// Perform RIPEMD-160 hashing on the SHA-256 digest -const ripemd160Digest = ripemd160(sha256Digest); -console.log('RIPEMD-160 hash of SHA-256 hash (hex):', Buffer.from(ripemd160Digest).toString('hex')); - -// Convert the RIPEMD-160 digest to a 5-bit array for Bech32 encoding -const fiveBitArray = convertBits(ripemd160Digest, 8, 5, true); - -// Encode the 5-bit array into a Bech32 address with the specified prefix -const bech32Address = bech32.encode(chainPrefix, fiveBitArray); - -console.log(`Bech32 Cosmos Address: ${bech32Address}`); - -// Decompress the public key to its uncompressed form (65 bytes) and exclude the first byte -const publicKeyUncompressed = secp256k1.ProjectivePoint.fromHex(publicKeyCompressed).toRawBytes(false).slice(1); - -// Perform Keccak-256 hashing on the uncompressed public key to derive the Ethereum address -const keccakHash = keccak_256(publicKeyUncompressed); -const ethAddress = '0x' + Buffer.from(keccakHash.slice(-20)).toString('hex'); - -console.log('Uncompressed public key (hex):', Buffer.from(publicKeyUncompressed).toString('hex')); -console.log('Keccak-256 hash of uncompressed public key (hex):', Buffer.from(keccakHash).toString('hex')); -console.log(`Ethereum Address: ${ethAddress}`); -``` - -
- ---- - -
-Typescript - Full Derivation from Private Key - -```typescript copy -import { sha256 } from '@noble/hashes/sha256'; -import { ripemd160 } from '@noble/hashes/ripemd160'; -import { keccak_256 } from '@noble/hashes/sha3'; -import { secp256k1 } from '@noble/curves/secp256k1'; -import { bech32 } from 'bech32'; - -// Utility function to convert bits for Bech32 encoding -function convertBits(data: Uint8Array, fromBits: number, toBits: number, pad: boolean): number[] { - let acc = 0; - let bits = 0; - const result: number[] = []; - const maxv = (1 << toBits) - 1; - - for (const value of data) { - acc = (acc << fromBits) | value; - bits += fromBits; - while (bits >= toBits) { - bits -= toBits; - result.push((acc >> bits) & maxv); - } - } - - if (pad) { - if (bits > 0) { - result.push((acc << (toBits - bits)) & maxv); - } - } else if (bits >= fromBits || (acc << (toBits - bits)) & maxv) { - throw new Error('Unable to convert bits'); - } - - return result; -} - -// Function to generate addresses from a private key -function generateAddresses(privateKeyHex: string): { - seiAddress: string; - ethAddress: string; -} { - // Ensure the private key is exactly 32 bytes long - const privateKey = Uint8Array.from(Buffer.from(privateKeyHex.padStart(64, '0'), 'hex')); - if (privateKey.length !== 32) { - throw new Error('Private key must be 32 bytes long.'); - } - - // Derive the compressed public key from the private key - const publicKey = secp256k1.getPublicKey(privateKey, true); - const publicKeyBytes = publicKey; - - // Perform SHA-256 hashing on the compressed public key - const sha256Digest = sha256(publicKeyBytes); - - // Perform RIPEMD-160 hashing on the SHA-256 digest - const ripemd160Digest = ripemd160(sha256Digest); - - // Convert the RIPEMD-160 digest to a 5-bit array for Bech32 encoding - const fiveBitArray = convertBits(ripemd160Digest, 8, 5, true); - - // Bech32 address with "sei" prefix - const seiAddress = bech32.encode('sei', fiveBitArray, 256); - - // Derive the uncompressed public key from the private key and exclude the first byte - const publicKeyUncompressed = secp256k1.getPublicKey(privateKey, false).slice(1); - - // Perform Keccak-256 hashing on the uncompressed public key to derive the Ethereum address - const keccakHash = keccak_256(publicKeyUncompressed); - const ethAddress = `0x${Buffer.from(keccakHash).slice(-20).toString('hex')}`; - - return { seiAddress, ethAddress }; -} - -// Example usage of the generateAddresses function -const privateKeyHex = '907ab4bf7fc60cff'; -const { seiAddress, ethAddress } = generateAddresses(privateKeyHex); - -console.log(`Sei Address: ${seiAddress}`); -console.log(`Ethereum Address: ${ethAddress}`); -``` - -
- ---- diff --git a/content/learn/index.mdx b/content/learn/index.mdx index bd351d3a..7a07c942 100644 --- a/content/learn/index.mdx +++ b/content/learn/index.mdx @@ -1,69 +1,46 @@ -import { IconBolt, IconClipboardText, IconCoins, IconLayoutDashboard, IconLock, IconServer } from '@tabler/icons-react'; import { LinkCard } from '../../src/components/LinkCard'; +import { IconBolt, IconClipboardText, IconCoins, IconLayoutDashboard, IconLock, IconServer } from '@tabler/icons-react'; + +# About Sei + +Parallel execution, high throughput and standard EVM interface establish Sei as +the leader in scalable and interconnected blockchain ecosystems. + +Sei’s twin-turbo consensus and SeiDB achieve 400-millisecond block times and +deliver transaction throughput tailored for high-demand blockchain environments. +Advancements in performance position Sei as a pivotal force in +cross-disciplinary distributed computing and redefine EVM capabilities. The +design enables complex real-world decentralized applications and sets a new +benchmark for blockchain technology. + +Sei’s architecture offers seamless interoperability and gives EVM developers +native access to the Cosmos ecosystem with IBC tokens, multi-sig accounts and +fee grants. Pointer Contracts and Precompile Contracts bridge EVM and CosmWasm +and enable smooth interaction with assets ranging from ERC20 to CW20 tokens and +CW721 to ERC721 NFTs without sacrificing performance. Integrating IBC and Wasm +directly into the EVM through Precompile Contracts strengthens cross-VM +functionality. + +## Sei performance metrics + +With these performance optimizations, Sei is able to get + +- 400 millisecond time to finality +- 5,030 transactions per second (12,500 theoretical max) -# Start Learning About Sei +## What optimizations does Sei introduce? -Discover Sei Features, Integrations and Usage. +Sei introduces four major innovations: -
- } - title="Divergence from Ethereum" - link="/learn/differences-with-ethereum" - description="See how Sei's architecture advances the EVM." - preview={{ - content: 'Sei advances the EVM by introducing significant architectural improvements over Ethereum.', - highlights: ['Parallel transaction execution', 'Optimized block production', 'Enhanced throughput capabilities', 'Lower gas fees structure'] - }} - /> - } - title="Wallet Setup" - link="/learn/wallet-setup" - description="Create, import, and manage wallets on Sei." - preview={{ - content: 'Learn how to install wallets, add the Sei network to MetaMask, and manage addresses (bech32 and hex) seamlessly in EVM or native contexts.', - highlights: ['Installing a wallet app', 'Adding Sei chain to MetaMask', 'hex vs. bech32 addresses', 'Viewing ERC20 & CW20 tokens'] - }} - /> - } - title="Mastering Staking" - link="/learn/general-staking" - description="Understand staking and its role in Sei." - preview={{ - content: 'Discover the ins and outs of staking on Sei to secure the network and earn rewards.', - highlights: ['Benefits of staking', 'Step-by-step guide to stake tokens', 'Understanding validator roles', 'Reward distribution mechanisms'] - }} - /> - } - title="Governance" - link="/learn/general-governance" - description="Participate in on-chain decisions to shape Sei." - preview={{ - content: 'Learn how stakers propose, discuss, and vote on network changes, ensuring continuous evolution.', - highlights: ['Proposal submission & deposit periods', 'Voting, quorum requirements & results', 'Refund/burn deposit mechanics', 'Types of proposals (params, community spend, etc.)'] - }} - /> - } - title="Transactions" - link="/learn/dev-transactions" - description="Dive into EVM & Cosmos-based transactions on Sei." - preview={{ - content: 'Learn how to create, sign, and broadcast EVM and native transactions, plus handle multiple messages atomically.', - highlights: ['Cosmos & EVM transaction structures', 'Signing & broadcasting transactions', 'Executing multiple messages', 'Integration with CosmJS & seid'] - }} - /> - } - title="VM Interoperability" - link="/learn/dev-interoperability" - description="Seamlessly bridge EVM and CosmWasm on Sei." - preview={{ - content: 'Discover how precompiled EVM contracts and pointer contracts let you traverse both EVM and Wasm environments.', - highlights: ['Precompiled contracts for native functionality', 'Pointer contracts linking tokens across VMs', 'Interoperability for advanced use-cases', 'Universal contract accessibility'] - }} - /> -
+- **Twin Turbo Consensus**: This feature allows Sei to reach the fastest time to + finality of any blockchain at 400ms, unlocking web2 like experiences for + applications. +- **Optimistic Parallelization**: This feature allows developers to unlock + parallel processing for their Ethereum applications, with no additional work such as defining dependencies in a smart contract. +- **SeiDB**: This major upgrade allows Sei to handle the much higher rate of + data storage, reads and writes which become extremely important for a high + performance blockchain. +- **Interoperable EVM**: This allows existing developers in the Ethereum + ecosystem to deploy their applications, tooling and infrastructure to Sei with + no changes, while benefiting from the 100x performance improvements offered by + Sei. diff --git a/content/providers/indexers/goldrush.mdx b/content/learn/indexer-providers/goldrush.mdx similarity index 100% rename from content/providers/indexers/goldrush.mdx rename to content/learn/indexer-providers/goldrush.mdx diff --git a/content/providers/indexers/goldsky.mdx b/content/learn/indexer-providers/goldsky.mdx similarity index 100% rename from content/providers/indexers/goldsky.mdx rename to content/learn/indexer-providers/goldsky.mdx diff --git a/content/providers/indexers/the-graph.mdx b/content/learn/indexer-providers/the-graph.mdx similarity index 100% rename from content/providers/indexers/the-graph.mdx rename to content/learn/indexer-providers/the-graph.mdx diff --git a/content/learn/indexers.mdx b/content/learn/indexers.mdx new file mode 100644 index 00000000..0aff721b --- /dev/null +++ b/content/learn/indexers.mdx @@ -0,0 +1,14 @@ +import { AppCardsGridCategory } from '../../src/components'; + +# Indexers + +Indexers collect and organize blockchain data, making it easier to query and +analyze. Key indexers for Sei include: + + + +## Integration Guides + +- [The Graph](/learn/indexer-providers/the-graph) +- [Goldsky](/learn/indexer-providers/goldsky) +- [Goldrush](/learn/indexer-providers/goldrush) diff --git a/content/learn/linking-addresses.mdx b/content/learn/linking-addresses.mdx deleted file mode 100644 index a2cf2965..00000000 --- a/content/learn/linking-addresses.mdx +++ /dev/null @@ -1,50 +0,0 @@ -import { Callout } from 'nextra/components'; -import { ImageWithCaption } from '../../src/components'; -import addressTranslationImage from '../../public/assets/address-derivation.png'; -import linkAddressesImage from '../../public/assets/link-addresses.png'; -import linkSuccessImage from '../../public/assets/link-success.png'; -import signMessageImage from '../../public/assets/sign-message.png'; - -# Linking Sei and EVM / 0x Addresses - -Each Sei address in Sei V2 has a corresponding EVM / 0x address, and vice versa. -When you use Sei V2 for the first time, it is necessary to link these two -addresses. - -**Important Note:** You cannot decide which Sei and 0x addresses are linked together. Each Sei account has exactly one specific Sei address, and one specific EVM / 0x address, associated with it. They are like 2 sides of the same coin, and cannot be combined with other addresses. - -You can link your Sei and EVM / 0x addresses using the Sei app: -https://app.sei.io/ - -1. Navigate to https://app.sei.io/ using your web browser. -2. On the Dashboard, look for the "Addresses" box. -3. Complete captcha, if required. -4. Click the "Link Addresses" button. - - This will prompt you to sign a message with your wallet - it's not a transaction, and will not charge you any gas fees. - -5. Once you have signed that message, your accounts will be linked! - - -## Advanced - -### Wallet Addresses - -Every account on Sei has a unique public key. In Sei V2, this public key -translates into two different types of addresses: - -- **EVM Address**: This address starts with `0x` and is used for EVM-based - activities. - -- **SEI Address**: This address starts with `sei` and is used for Sei-native - activities. - - - -Although these addresses appear different, they actually share the same -underlying account. This means whatever action you take with one address will -also affect the other. - -If you deposit funds into your EVM address, you can access and use those same -funds with your SEI address, and vice versa. They are linked together as one -account, ensuring seamless integration between the EVM and SEI ecosystems. diff --git a/content/learn/oracles.mdx b/content/learn/oracles.mdx index 3db734bb..6a7b7684 100644 --- a/content/learn/oracles.mdx +++ b/content/learn/oracles.mdx @@ -1,6 +1,12 @@ +import { AppCardsGridCategory } from '../../src/components'; + # Oracles -## Introduction +## Providers + + + +## Native Oracles Sei supports both Pyth and a native oracle. To learn more about Pyth you can visit their [website](https://pyth.network/). In the following section, we will diff --git a/content/build/pointers/overview.mdx b/content/learn/pointers.mdx similarity index 64% rename from content/build/pointers/overview.mdx rename to content/learn/pointers.mdx index 76595e80..cd4cc5fa 100644 --- a/content/build/pointers/overview.mdx +++ b/content/learn/pointers.mdx @@ -1,7 +1,9 @@ -import { ImageWithCaption } from '../../../src/components'; -import PointerContractsWithout from '../../../public/assets/pointer-contracts-without.png'; -import PointerContractsSimplified from '../../../public/assets/pointer-contracts-simplified.png'; -import HowItWorks from '../../../public/assets/pointer-contracts-how-it-works.png'; +import { ImageWithCaption } from '../../src/components'; +import PointerContractsWithout from '../../public/assets/pointer-contracts-without.png'; +import PointerContractsSimplified from '../../public/assets/pointer-contracts-simplified.png'; +import HowItWorks from '../../public/assets/pointer-contracts-how-it-works.png'; +import { Cards } from 'nextra/components'; +import { IconCode, IconCoin } from '@tabler/icons-react'; # Pointer Contracts @@ -33,3 +35,13 @@ regardless of the client interface. Each smart contract is limited to **one** associated pointer contract, which must be registered on chain when deploying. This prevents conflicts and provides a reference point for verifying the authenticity of the paired contract itself. + +## Deploying pointers + +View each pointer contract's documentation for more details on how to deploy by choosing a pointer type you want to use. + + + } title="Standard" href="/cosmwasm/pointers/standard" /> + } title="IBC" href="/cosmwasm/pointers/ibc" /> + } title="Token Factory" href="/cosmwasm/pointers/tokenfactory" /> + diff --git a/content/providers/rpc-providers.mdx b/content/learn/rpc-providers.mdx similarity index 100% rename from content/providers/rpc-providers.mdx rename to content/learn/rpc-providers.mdx diff --git a/content/learn/user-quickstart.mdx b/content/learn/user-quickstart.mdx index a8f7c78f..eae7e8a4 100644 --- a/content/learn/user-quickstart.mdx +++ b/content/learn/user-quickstart.mdx @@ -1,149 +1,33 @@ ---- -title: 'Connect to Sei' ---- - -import { Callout } from 'nextra/components'; -import { ImageWithCaption } from '../../src/components'; import EvmWalletConnect from '../../src/components/EvmWalletConnect/EvmWalletConnect'; -import SeiTraceSearch from '../../src/components/AddressSearch/SeiTraceSearch'; -import cexWithdrawImage from '../../public/assets/cex-withdraw.png'; -import sourceChainDropdownImage from '../../public/assets/source-chain.png'; -import selectAssetImage from '../../public/assets/select-asset.png'; -# Connect to Sei +# Get Started With Sei This getting started guide will help you set up your wallet and start using Sei, even if you're new to blockchain. By the end, you'll be ready to explore the most performant blockchain ever. -## Requirements - -- A compatible, non-custodial wallet, such as [MetaMask](https://metamask.io/), - or [Compass](https://compasswallet.io/). -- Sei tokens [from an exchange](learn/getting-tokens), or stablecoins in your - personal wallet. +## 1.) Get a Wallet -For additional help with wallet apps, see our -[Setting up a Wallet](learn/wallet-setup) guide. +Download a compatible, wallet, such as [Compass](https://compasswallet.io/), [Rabby](https://rabby.io/), [MetaMask](https://metamask.io/), or any other [supported wallet](/learn/wallets). -## Connecting Your Wallet +## 2.) Set Up and Link Your Wallet -For a quick setup, simply click the "Connect Wallet" button below to connect -directly from this guide. +Some wallets may not have Sei enabled by default, to add it, simply connect your wallet below and it will prompt you to switch networks. Additionally, if using CosmWasm (some protocols and exchanges), your EVM and Sei addresses will be linked automatically. -After connecting, your wallet will automatically prompt you to join the correct -Sei network. - -> If your wallet doesn’t automatically prompt you to join the Sei Network, -> please add it manually by following the network details -> [here](/user-guides/wallet-setup). - -After connection, you're ready to dive in, the demo below walks you through connecting to the Sei -network step-by-step. - -## Dual Address Support - -Sei supports two wallet address types: - -- **EVM (0x) address:** Ethereum-style addresses prefixed with "0x". -- **Sei address:** Native Sei blockchain addresses prefixed with "sei1". - -Both addresses are derived from the same public key, ensuring seamless asset -integration across formats. You can find your corresponding wallet addresses -directly in the Sei app. - -For more details on interoperability, explore our article -[here](https://blog.sei.io/sei-v2-interoperability/). - -### How to Link Your Addresses - -Linking addresses is recommended for all users to enable cross-VM functionality in many Sei apps. - -To use interoperability features in Sei apps, you’ll need to link your Sei and -EVM (0x) addresses. Each Sei address has a corresponding EVM address, derived -from the same public key, and this link is required on your first use. - -Address linking is automatic—each Sei account is tied to a single Sei address and a single EVM address, both derived from the same public key. - -Follow these steps to link your Sei and EVM addresses: - -1. Go to [app.sei.io](https://app.sei.io) in your browser. -2. In the Dashboard, locate the "Addresses" box. -3. Complete any required captcha. -4. Click "Link Addresses" to start the process. You’ll be prompted to sign a - message with your wallet—this is not a transaction and incurs no gas fees. -5. Once signed, your Sei and EVM addresses will be linked. - -For more details, check the [Linking Addresses guide](learn/linking-addresses). - -### How to View Your Address Pair - -You can view your wallet address on any Sei blockchain explorer to see your -transactions and balances. - - - -Alternatively, users can interact with Sei directly via API endpoints. - -## Onboarding from Centralized Exchanges - -If you're transitioning from a CEX, using both Sei and 0x addresses is simple. -CEXs will upgrade to support both over time. - -### Withdrawing to a Sei Address - -Copy your **sei1...** address and paste it into the withdrawal page of your CEX. - - - -No memo is required for withdrawals, but depositing back to a CEX may require a memo. Check your CEX's guidelines to ensure smooth transfers. - -### Withdrawing to an EVM/0x Address - -To withdraw to an 0x address, you must first link it to your Sei address. Follow -the steps in the [Linking Addresses guide](user-guides/linking-addresses). - -If your addresses aren't linked, visit the Dashboard on the -[Sei App](https://app.sei.io) to check or link them. - -## Bridging to Sei - -To move assets to Sei from another network, find recommended bridge paths via -the Sei app: - -1. Go to [app.sei.io](https://app.sei.io). -2. Select the **Source Chain** (where your assets currently reside). - -3. Choose the asset you want to bridge (e.g., stablecoins). Verify the token. - NB: Assets pictured are for illustrative purposes only and may not be supported at present. Check the Sei app to see what options are available to you. - -4. The app will recommend a bridge based on the asset and origin chain. - -Consider [Squid](https://www.squidrouter.com/) for initial bridging. New bridges -will be added over time. - - - While bridge providers work to minimize risks, always conduct your own due diligence and research before engaging in bridging. - +> Learn more about [how accounts work](/learn/accounts) on Sei. -### Gas on Arrival +## 3.) Get Tokens -Some bridges offer a "gas on arrival" feature, providing a small amount of Sei -tokens to cover initial transaction fees. To find these options, open the Sei -App, go to the "Bridge" section, select your source chain and asset, and view -the recommended third-party bridges. Bridges with "gas on arrival" support are -typically labeled in the app, making it easy to identify them. If no label -appears, check the bridge provider's official documentation or website for the -latest "gas on arrival" information. +- [Bridge from another network](https://app.sei.io/transfer) +- [Use the faucet](/learn/faucet) (testnet and devnet only) +- Transfer from another wallet or CEX by copying your address above -## Viewing Assets in Your Wallet +> [!WARNING] +> +> Typically, no memo is required for withdrawals from CEXs, but depositing back may require a memo. Check your CEX's guidelines to ensure smooth transfers. -To view your assets, use a block explorer like -[seitrace.com](https://www.seitrace.com). This explorer supports both EVM and -native Sei addresses. +## 4.) Explore the ecosystem -Simply search for your wallet address to view your holdings. To import tokens -into MetaMask, use the contract addresses found in the explorer. Learn more -[here](https://support.metamask.io/managing-my-tokens/custom-tokens/how-to-display-tokens-in-metamask/). +Sei has a diverse ecosystem of applications, ranging from DeFi to Games and beyond. Explore the [Sei Ecosystem Hub](https://www.sei.io/ecosystem) to discover the latest projects and innovations or follow [@SeiNetwork](https://x.com/SeiNetwork) on X. diff --git a/content/learn/wallet-association.mdx b/content/learn/wallet-association.mdx deleted file mode 100644 index 321f6599..00000000 --- a/content/learn/wallet-association.mdx +++ /dev/null @@ -1,240 +0,0 @@ ---- -next: true ---- - -# **Methods for Associating a Wallet on Sei** - -Wallet association on the Sei network ensures the public key becomes known to -the chain. Without this step, the chain cannot determine the Bech32 (`sei...`) -address or the EVM-compatible (`0x...`) address from one another. - -Below are **4 distinct methods** for associating a wallet along with relevant -definitions. Each method differs in terms of security considerations and -required actions. - ---- - -## **Global Constants** - -These constants for the `addr` precompile can also be found in the repo -[Sei-Chain/precompiles](https://github.com/sei-protocol/sei-chain/tree/44fd60cec6a5ef301df1472431d6db40b382e486/precompiles/addr): - -```ts copy -// Constants for precompile address and ABI -export const ADDRESS_PRECOMPILE_ADDRESS = '0x0000000000000000000000000000000000001004'; - -export const ADDRESS_PRECOMPILE_ABI = [ - { - inputs: [ - { internalType: 'string', name: 'v', type: 'string' }, - { internalType: 'string', name: 'r', type: 'string' }, - { internalType: 'string', name: 's', type: 'string' }, - { internalType: 'string', name: 'customMessage', type: 'string' } - ], - name: 'associate', - outputs: [ - { internalType: 'string', name: 'seiAddr', type: 'string' }, - { internalType: 'address', name: 'evmAddr', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [{ internalType: 'string', name: 'pubKeyHex', type: 'string' }], - name: 'associatePubKey', - outputs: [ - { internalType: 'string', name: 'seiAddr', type: 'string' }, - { internalType: 'address', name: 'evmAddr', type: 'address' } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [{ internalType: 'address', name: 'addr', type: 'address' }], - name: 'getSeiAddr', - outputs: [{ internalType: 'string', name: 'response', type: 'string' }], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [{ internalType: 'string', name: 'addr', type: 'string' }], - name: 'getEvmAddr', - outputs: [{ internalType: 'address', name: 'response', type: 'address' }], - stateMutability: 'view', - type: 'function' - } -]; -``` - ---- - -## **Method 1: Direct Private Key Association** - -> **Security Risk**: **High** – Requires the private key to be directly -> available. Exposing the private key can compromise the wallet. - -This method directly uses the private key to interact with the network. - - ```ts copy - import { createPublicClient, createWalletClient, http } from 'viem'; - import { privateKeyToAccount } from 'viem/accounts'; - import { seiTestnet } from 'viem/chains'; - import { ADDRESS_PRECOMPILE_ABI, ADDRESS_PRECOMPILE_ADDRESS } from '@sei-js/evm'; - - const PRIVATE_KEY = ''; - - const publicClient = createPublicClient({ - chain: seiTestnet, - transport: http() - }); - const client = createWalletClient({ chain: seiTestnet, transport: http() }); - - const account = privateKeyToAccount(PRIVATE_KEY); - - const response = await client.writeContract({ - account, - address: ADDRESS_PRECOMPILE_ADDRESS, - abi: ADDRESS_PRECOMPILE_ABI, - functionName: 'associate', - args: ['0', '0', '0', 'example_message'], - gasPrice: BigInt(100_000_000_000) - }); - console.log(response); - ``` - ---- - -## **Method 2: Associate via Signed Message** - -> **Security Risk**: **Medium** – Requires signing a specific message using the -> private key. - -This method involves signing a predefined message to prove ownership of the -account. - - ```ts copy - import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; - import { parseSignature, toHex } from 'viem'; - - const associate = async () => { - const account = privateKeyToAccount(''); - const newPk = generatePrivateKey(); - const newAccount = privateKeyToAccount(newPk); - - const message = 'associate'; - const signature = await newAccount.signMessage({ message }); - const parsedSignature = parseSignature(signature); - - const response = await client.writeContract({ - account, - address: ADDRESS_PRECOMPILE_ADDRESS, - abi: ADDRESS_PRECOMPILE_ABI, - functionName: 'associate', - args: [toHex(Number(parsedSignature.v) - 27), parsedSignature.r, parsedSignature.s, message], - gasPrice: BigInt(100_000_000_000) - }); - console.log(response); - }; - - associate(); - ``` - ---- - -## **Method 3: Associate via Public Key** - -> **Security Risk**: **Lower** – Involves using the public key, which is less -> sensitive than the private key. - -This method compresses the public key and sends it for association. - - ```ts copy - import secp256k1 from 'secp256k1'; - import { privateKeyToAccount, generatePrivateKey } from 'viem/accounts'; - - const associateViaPubkey = async () => { - const account = privateKeyToAccount(''); - const newPk = generatePrivateKey(); - const newAccount = privateKeyToAccount(newPk); - - const publicKeyBuffer = Buffer.from(newAccount.publicKey.slice(2), 'hex'); - const compressedPubKey = secp256k1.publicKeyConvert(publicKeyBuffer, true); - - const response = await client.writeContract({ - account, - address: ADDRESS_PRECOMPILE_ADDRESS, - abi: ADDRESS_PRECOMPILE_ABI, - functionName: 'associatePubKey', - args: [Buffer.from(compressedPubKey).toString('hex')], - gasPrice: BigInt(100_000_000_000) - }); - console.log(response); - }; - - associateViaPubkey(); - ``` - ---- - -## **Method 4: Gasless Association via Signed Message** - -> **Security Risk**: **Low** – Requires signing a message but does not expose -> the private key. No gas is consumed if the account already has funds. - -This method signs a message and uses the `sei_associate` RPC call to finalize -the association. - - ```ts copy - import { parseSignature, numberToHex } from 'viem'; - - interface AssociateRequest { - r: string; - s: string; - v: string; - custom_message: string; - } - - interface AssociateRequestSchema { - Method: 'sei_associate'; - Parameters: [request: AssociateRequest]; - ReturnType: null; - } - - const associateGasless = async (signature: `0x${string}`, message: string) => { - const parsedSignature = parseSignature(signature); - const messageLength = Buffer.from(message, 'utf8').length; - const messageToSign = `\x19Ethereum Signed Message:\n${messageLength}${message}`; - - const request: AssociateRequest = { - r: parsedSignature.r, - s: parsedSignature.s, - v: numberToHex(Number(parsedSignature.v) - 27), - custom_message: messageToSign - }; - - const response = await client.request({ - method: 'sei_associate', - params: [request] - }); - console.log(response); - }; - - // Example Usage - associateGasless('', 'example_message'); - ``` - ---- - -## **Summary of Methods** - -| Method | Security Risk | User Action Required | -| ----------------------------- | ------------- | ------------------------------------------------- | -| **1. Direct Private Key** | High | Provide private key directly. | -| **2. Signed Message** | Medium | Sign a predefined message to prove ownership. | -| **3. Public Key** | Lower | Provide a compressed public key for association. | -| **4. Gasless Signed Message** | Low | Sign a message without requiring gas (if funded). | - ---- - -Using any of these methods will ensure the **public key** is known to the chain, -enabling automatic association between the EVM-compatible and Bech32 addresses. diff --git a/content/providers/wallets/particle.mdx b/content/learn/wallet-integrations/particle.mdx similarity index 100% rename from content/providers/wallets/particle.mdx rename to content/learn/wallet-integrations/particle.mdx diff --git a/content/providers/wallets/pimlico.mdx b/content/learn/wallet-integrations/pimlico.mdx similarity index 100% rename from content/providers/wallets/pimlico.mdx rename to content/learn/wallet-integrations/pimlico.mdx diff --git a/content/learn/wallet-setup.mdx b/content/learn/wallet-setup.mdx deleted file mode 100644 index 252519d4..00000000 --- a/content/learn/wallet-setup.mdx +++ /dev/null @@ -1,119 +0,0 @@ -import { Callout } from 'nextra/components'; -import { EvmWalletConnect, ImageWithCaption } from '../../src/components'; -import addressTranslationImage from '../../public/assets/address-derivation.png'; -import evmSigningImage from '../../public/assets/evm-signing.png'; -import cosmSigningImage from '../../public/assets/cosm-signing.png'; - -## Create a Wallet and Sign Transactions - -### Installing a Wallet app - -**For complete functionality, it is recommended to use one of the wallets listed -on the [Wallets Page](providers/wallets/wallets)** - -**Attention:** Manually importing your wallet using a mnemonic from an EVM-only wallet app to a Cosmos-based wallet app, or vice versa, is not recommended. This may generate unexpected wallet addresses due to differing [cointypes](https://en.bitcoin.it/wiki/BIP_0044#Coin_type). - -### Connecting Your Wallet To Sei Networks - -Adding Sei your wallet takes only a few clicks. Connect your wallet -using the button below to import the network settings: - - - -#### Import Manually - -If you encounter any issues with the automatic connection, you can also add the -Sei EVM manually. Follow the steps outlined -[here](https://support.metamask.io/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC#h_01G63GGJ83DGDRCS2ZWXM37CV5), -using the chain information provided below: - -- **Network Name**: Sei -- **New RPC URL**: `https://evm-rpc.sei-apis.com` -- **Chain ID**: 0x531 (decimal 1329) -- **Currency Symbol**: SEI -- **Block Explorer URL**: `https://seitrace.com` - -## Advanced - -#### Wallet Addresses - -Because Sei now supports two types of wallet address, it's important to -understand how they are related. - -Every account on Sei has a unique public key. This public key can be used to -generate multiple wallet addresses, but it is important to note that the two are -functionally the same. They appear different, and depending on the app they may -be used interchangeably, but they both point to the same destination - your -account. The difference is like the difference between the numeral "2" and the -word "two". They both define the same value, but may be used in different -contexts. - -- **"hex" Address**: Starts with `0x` and is EVM-based. - -- **"bech32" Address**: Starts with `sei1` and is used for Sei-native functions. - - - -Although these addresses appear different, they actually share the same -underlying account. This means whatever action you take with one address will -also affect the other. - -If you deposit funds into your EVM address, you can access and use those same -funds with your SEI address, and vice versa. They are linked together as one -account, ensuring seamless integration between the EVM and SEI ecosystems. - -In order to associate your EVM and SEI addresses, you should initiate a -transaction from your EVM address. For example, you can send tokens to yourself -within your wallet. - -### Transaction types - -#### "Ethereum" Transactions - -Signing an EVM transaction is straightforward and consistent across EVM chains. -When an app initiates a transaction, it will prompt you for a signature through -MetaMask, requiring your approval to proceed. - -#### "Sei native" Transactions - -Signing native transactions will be nearly identical from the user experience. -Under the hood, a process similar to signing EVM transactions occurs. The -difference lies in the transaction targeting a Sei precompiled contract, where -your approval via MetaMask is needed to execute the transaction. Smart contract -developers will need to ensure that Metamask transactions target the precompiled -contract. - -
- - -
- -### Viewing Tokens - -#### ERC20 Tokens - -To view ERC20 tokens in MetaMask, the process mirrors that on other EVM chains. -For tokens not automatically listed, you'll need to manually import them into -your wallet. Detailed instructions can be found -[here](https://support.metamask.io/hc/en-us/articles/360015489031-How-to-display-tokens-in-MetaMask#h_01FWH492CHY60HWPC28RW0872H). - -#### ERC721 NFTs - -Viewing NFTs in MetaMask requires manual addition. Follow the steps provided -[here](https://support.metamask.io/hc/en-us/articles/360058238591-NFT-tokens-in-your-MetaMask-wallet) -to add and view your NFTs in the wallet. - -#### TokenFactory & CW20 Tokens - -TokenFactory and CW20 tokens can only be visible in MetaMask if there's a -pointer contract created for it. A pointer contract enables a native Sei token -to be linked across CosmWasm and EVM through an ERC20 interface. Once created -for a native token, you can import it as an ERC20 token using the steps above. - -#### CW721 NFTs - -Similarly, CW721 NFTs can only be visible in MetaMask if a pointer contract -created for it. Once created, you can import it into your wallet like a standard -ERC721 NFT. - -Visit our [Pointer Contract page](build/pointers/pointer-contracts) to learn more. diff --git a/content/providers/wallets/index.mdx b/content/learn/wallets.mdx similarity index 81% rename from content/providers/wallets/index.mdx rename to content/learn/wallets.mdx index ec268b37..6f35f416 100644 --- a/content/providers/wallets/index.mdx +++ b/content/learn/wallets.mdx @@ -1,11 +1,13 @@ -import { AppCardsGridCategory } from '../../../src/components'; +import { AppCardsGridCategory } from '../../src/components'; -# Wallets and Wallet Providers +# Wallet Providers Wallets are essential for managing assets and interacting with the Sei blockchain. There are various types of wallets available, each offering different features and levels of security. +> **Attention:** Manually importing your wallet using a mnemonic from an EVM-only wallet app to a Cosmos-based wallet app, or vice versa, is not recommended. This may generate unexpected wallet addresses due to differing [cointypes](https://en.bitcoin.it/wiki/BIP_0044#Coin_type). + ## Types of Wallets 1. **Software Wallets**: These are applications or browser extensions that @@ -25,17 +27,22 @@ different features and levels of security. | **Arculus** | ✅ | ✅ | Hardware | 118 / 60 | Software | ✅ | [Arculus](https://www.getarculus.com) | | **Compass** | ✅ | ✅ | Mnemonic / Privkey | 118 | Software | ✅ | [Compass Wallet](https://compasswallet.io) | | **Crossmint** | ✅ | ✅ | Passkey | 118 / 60 | Software | ✅ | [Crossmint Wallet](https://www.crossmint.com/) | -| **Dynamic** | ✅ | _soon_ | Any | All | Embedded | ✅ | [Dynamic Wallet](https://dynamic.xyz) | +| **Dynamic** | ✅ | ✅ | Any | All | Embedded | ✅ | [Dynamic Wallet](https://dynamic.xyz) | | **Fin** | ✅ | ✅ | Mnemonic / Privkey | 118 | Software | ❌ | [Fin Wallet](https://finwallet.com) | | **Keplr** | ✅ | ✅ | Mnemonic / Privkey | 118 | Software | ✅ | [Keplr Wallet](https://wallet.keplr.app) | -| **Ledger** | _soon_ | _soon_ | Hardware | 118 / 60 | Hardware | ❌ | [Ledger](https://compasswallet.io) | +| **Ledger** | _soon_ | ✅ \_ | Hardware | 118 / 60 | Hardware | ❌ | [Ledger](https://compasswallet.io) | | **MetaMask** | ✅ | ✅ | Mnemonic / Privkey | 60 | Software | ✅ | [MetaMask](https://metamask.io/) | | **OKX** | ✅ | ✅ | Mnemonic / Privkey | 118 / 60 | Software | ✅ | [OKX Wallet](https://www.okx.com/web3/wallet/sei) | | **Rabby** | ✅ | ❌ | Mnemonic / Priv/Passkey | 118 | Software | ✅ | [Rabby Wallet](https://chromewebstore.google.com/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch) | For more information on coin types and hierarchical deterministic (HD) paths as well as deriving wallet addresses properly, please refer to the -[Advanced Concepts on HD Path Coin Types](learn/hd-path-coin-types). +[Advanced Concepts on HD Path Coin Types](/learn/accounts#hd-paths-and-coin-types). + +## Integration Guides + +- [Pimlico Wallet](/learn/wallet-integrations/pimlico) +- [Particle Wallet](/learn/wallet-integrations/particle) ## Other Wallets diff --git a/content/providers/_meta.js b/content/providers/_meta.js deleted file mode 100644 index 15f12d38..00000000 --- a/content/providers/_meta.js +++ /dev/null @@ -1,15 +0,0 @@ -export default { - index: { - title: 'Home' - }, - '-- Network Tools & Providers': { - type: 'separator', - title: 'Network Tools & Providers' - }, - wallets: 'Wallets', - 'rpc-providers': 'RPC Providers', - 'centralized-exchanges': 'Centralized Exchanges', - indexers: 'Indexers', - oracles: 'Oracles', - explorers: 'Explorers' -}; diff --git a/content/providers/index.mdx b/content/providers/index.mdx deleted file mode 100644 index 3d7352d4..00000000 --- a/content/providers/index.mdx +++ /dev/null @@ -1,49 +0,0 @@ -import { Cards } from 'nextra/components'; -import { IconPointer } from '@tabler/icons-react'; -import { EcosystemSearchBar, EcosystemDynamicSection } from '../../src/components'; - -# Sei Ecosystem - -The Sei Ecosystem includes a variety of apps and services that bring together -creative minds and industry leaders to drive the future of Sei’s blockchain -technology. - -
- - - -## Consumer Apps - - - -## Infrastructure - - - -## DeFi - - - -## Data & Analytics - - - -## Wallets - - - -## NFTs - - - -## Exchanges & On/Off Ramps - - - -## Other - - - -
- -} title="Request to join this list" href="https://sei-forms.typeform.com/join-ecosystem" target="_blank" /> diff --git a/content/providers/indexers/_meta.js b/content/providers/indexers/_meta.js deleted file mode 100644 index 22eef126..00000000 --- a/content/providers/indexers/_meta.js +++ /dev/null @@ -1,5 +0,0 @@ -export default { - goldrush: 'Goldrush', - goldsky: 'Goldsky', - 'the-graph': 'The Graph' -}; diff --git a/content/providers/indexers/index.mdx b/content/providers/indexers/index.mdx deleted file mode 100644 index 58f8f37a..00000000 --- a/content/providers/indexers/index.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { AppCardsGridCategory } from '../../../src/components'; - -# Indexers - -Indexers collect and organize blockchain data, making it easier to query and -analyze. Key indexers for Sei include: - - diff --git a/content/providers/oracles.mdx b/content/providers/oracles.mdx deleted file mode 100644 index dcbde1c4..00000000 --- a/content/providers/oracles.mdx +++ /dev/null @@ -1,8 +0,0 @@ -import { AppCardsGridCategory } from '../../src/components'; - -# Oracles - -Oracles provide external data to smart contracts, enabling more dynamic and -responsive applications. Notable oracles for Sei include: - - diff --git a/content/providers/wallets/_meta.js b/content/providers/wallets/_meta.js deleted file mode 100644 index 8f65ef90..00000000 --- a/content/providers/wallets/_meta.js +++ /dev/null @@ -1,4 +0,0 @@ -export default { - particle: 'Particle Wallet', - pimlico: 'Pimlico' -}; diff --git a/content/reference/_meta.js b/content/reference/_meta.js deleted file mode 100644 index 14cada2e..00000000 --- a/content/reference/_meta.js +++ /dev/null @@ -1,23 +0,0 @@ -export default { - index: { - title: 'Home' - }, - '-- API Reference': { - type: 'separator', - title: 'API Reference' - }, - evm: 'EVM', - cosmos: { - title: 'Cosmos', - display: 'hidden' - }, - '-- Interoperability': { - type: 'separator', - title: 'Interoperability' - }, - precompiles: 'EVM Precompiles', - about: { - title: 'Pointer Contracts', - href: '../build/pointers/overview' - } -}; diff --git a/content/reference/index.mdx b/content/reference/index.mdx deleted file mode 100644 index 6d0493ee..00000000 --- a/content/reference/index.mdx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; -import { IconWorld, IconBrackets, IconPointer } from '@tabler/icons-react'; -import { LinkCard } from '../../src/components/LinkCard'; - -# Reference - -Explore Sei’s core reference materials, endpoints, commands, and more. - -
- } - title="EVM RPC API" - link="/reference/evm" - description="Ethereum compatibility details" - preview={{ - content: 'An overview of Sei’s EVM layer and cross-chain capabilities.', - highlights: ['Smart contract deployment', 'Op-code support', 'Integration best practices'] - }} - /> - - } - title="Pointer Contracts" - link="/reference/pointer-contracts" - description="Documentation on pointer-based contracts" - preview={{ - content: 'How pointer contracts link on-chain logic to off-chain data sources in Sei.', - highlights: ['Data feed integration', 'Contract patterns', 'Security considerations'] - }} - /> - - } - title="EVM Precompiles" - link="/reference/precompiles/example-usage" - description="Interact with native Sei modules from the EVM" - preview={{ - content: 'Available Precompile Contracts:', - highlights: ['Bank', "IBC", 'Staking', 'Governance', 'Oracle', 'CosmWasm', "Pointer", 'Pointerview', 'JSON', 'Addr', "Distribution"] - }} - /> - - } - title="Cosmos REST API" - link="/reference/cosmos" - description="Cosmos-specific references" - preview={{ - content: 'Explore how Sei leverages Cosmos-SDK modules and IBC features.', - highlights: ['Governance modules', 'IBC integration', 'Custom modules and extensions'] - }} - /> - -
diff --git a/next.config.mjs b/next.config.mjs index aebee1bd..04bfa500 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -466,7 +466,7 @@ export default withNextra({ }, { "source": "/dev-ecosystem-providers/centralized-exchanges", - "destination": "/providers/centralized-exchanges", + "destination": "/learn/centralized-exchanges", "permanent": true }, { diff --git a/src/components/ChainInformation/index.tsx b/src/components/ChainInformation/index.tsx index f80f9207..5fc1624d 100644 --- a/src/components/ChainInformation/index.tsx +++ b/src/components/ChainInformation/index.tsx @@ -1,11 +1,13 @@ 'use client'; -import { Flex, Link, Table } from '@radix-ui/themes'; +import { Flex, Table } from '@radix-ui/themes'; import React from 'react'; -import { CopyButton, CopyText } from '../CopyText'; +import { CopyButton } from '../CopyText'; import { networks } from './config'; -export const ChainInformation = () => { +type NetworkType = 'Cosmos' | 'EVM'; + +export const ChainInformation = ({ networkType }: { networkType: NetworkType }) => { return ( @@ -17,56 +19,54 @@ export const ChainInformation = () => { - {['EVM', 'Cosmos'].map((networkType) => ( - - - - - {networkType} - - - - - {networks - .filter((net) => net.type === networkType) - .map((net) => ( - - {net.name} - - - - {net.hexChainId && } - - - - - - - - {net.explorerLinks.map((explorer) => ( - - {explorer.name} - - ))} - - - - ))} - - - ))} + + + + + {networkType} + + + + + {networks + .filter((net) => net.type === networkType) + .map((net) => ( + + {net.name} + + + + {net.hexChainId && } + + + + + + + + {net.explorerLinks.map((explorer) => ( + + {explorer.name} + + ))} + + + + ))} + + - + View more RPC providers - + See more explorers diff --git a/src/components/EvmWalletConnect/EvmWalletConnect.tsx b/src/components/EvmWalletConnect/EvmWalletConnect.tsx index bb28dd6f..0a6ffbba 100644 --- a/src/components/EvmWalletConnect/EvmWalletConnect.tsx +++ b/src/components/EvmWalletConnect/EvmWalletConnect.tsx @@ -61,12 +61,9 @@ const WalletComponent = () => { } return ( -
-

Click the button below to automatically set up your wallet by adding the correct network and by linking your EVM and Cosmos addresses together.

- -
+ ); }; diff --git a/src/components/OfficeHoursCard/index.tsx b/src/components/OfficeHoursCard/index.tsx index b5a2a463..8ac8d7b9 100644 --- a/src/components/OfficeHoursCard/index.tsx +++ b/src/components/OfficeHoursCard/index.tsx @@ -25,9 +25,9 @@ export const OfficeHoursCard = () => { href='https://discord.gg/sei' target='_blank' rel='noopener noreferrer' - className='mt-16 block bg-gradient-to-r from-[#9e1f19] to-red-700 text-white p-6 rounded-2xl shadow-lg flex items-center gap-4 border border-white/20 transition-transform duration-150 hover:scale-[1.02]'> + className='mt-16 block bg-gradient-to-r from-[#9e1f1933] to-[#9e1f1944] text-[#9e1f19] dark:text-white p-6 rounded-2xl shadow-lg flex items-center gap-4 border border-red-500/20 transition-transform duration-150 hover:scale-[1.02]'>
- +

Developer Office Hours

From e1808545684eb6fc604dd3088be95df8e345e121 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 12 Mar 2025 00:23:17 -0700 Subject: [PATCH 02/10] Add Sei Accounts Tab Added a tab for EIP-6963 (Sei Accounts) --- content/evm/_meta.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/evm/_meta.js b/content/evm/_meta.js index c97e1f4c..08f49309 100644 --- a/content/evm/_meta.js +++ b/content/evm/_meta.js @@ -8,7 +8,7 @@ export default { }, networks: 'Network Information', 'differences-with-ethereum': 'Divergence from Ethereum', - + 'sei-account': 'EIP-6963 Account', '-- Frontend Development': { type: 'separator', title: 'Frontend Development' From be7b9aa391c385c10b53f29d6898352cac902bab Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 12 Mar 2025 00:41:20 -0700 Subject: [PATCH 03/10] Added content back missing from merge --- content/evm/_meta.js | 1 + content/evm/tokens.mdx | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 content/evm/tokens.mdx diff --git a/content/evm/_meta.js b/content/evm/_meta.js index 08f49309..7a9dcd38 100644 --- a/content/evm/_meta.js +++ b/content/evm/_meta.js @@ -29,6 +29,7 @@ export default { }, transactions: 'Transaction Overview', reference: 'RPC Reference', + tokens: 'View Tokens', '-- CosmWasm Interoperability': { type: 'separator', diff --git a/content/evm/tokens.mdx b/content/evm/tokens.mdx new file mode 100644 index 00000000..fb2997bc --- /dev/null +++ b/content/evm/tokens.mdx @@ -0,0 +1,29 @@ +# Viewing Tokens in MetaMask + +#### ERC20 Tokens + +To view ERC20 tokens in MetaMask, the process mirrors that on other EVM chains. +For tokens not automatically listed, you'll need to manually import them into +your wallet. Detailed instructions can be found +[here](https://support.metamask.io/hc/en-us/articles/360015489031-How-to-display-tokens-in-MetaMask#h_01FWH492CHY60HWPC28RW0872H). + +#### ERC721 NFTs + +Viewing NFTs in MetaMask requires manual addition. Follow the steps provided +[here](https://support.metamask.io/hc/en-us/articles/360058238591-NFT-tokens-in-your-MetaMask-wallet) +to add and view your NFTs in the wallet. + +#### TokenFactory & CW20 Tokens + +TokenFactory and CW20 tokens can only be visible in MetaMask if there's a +pointer contract created for it. A pointer contract enables a native Sei token +to be linked across CosmWasm and EVM through an ERC20 interface. Once created +for a native token, you can import it as an ERC20 token using the steps above. + +#### CW721 NFTs + +Similarly, CW721 NFTs can only be visible in MetaMask if a pointer contract +created for it. Once created, you can import it into your wallet like a standard +ERC721 NFT. + +> Visit our [Pointer Contract page](build/pointers/pointer-contracts) to learn more. From b83abe2769eb0e25c6d6d1f2c8e517ae074e1beb Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 12 Mar 2025 00:54:58 -0700 Subject: [PATCH 04/10] Small adjustments to layout --- content/evm/_meta.js | 2 +- content/learn/_meta.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/evm/_meta.js b/content/evm/_meta.js index 7a9dcd38..0eab5a4a 100644 --- a/content/evm/_meta.js +++ b/content/evm/_meta.js @@ -8,12 +8,12 @@ export default { }, networks: 'Network Information', 'differences-with-ethereum': 'Divergence from Ethereum', - 'sei-account': 'EIP-6963 Account', '-- Frontend Development': { type: 'separator', title: 'Frontend Development' }, 'building-a-frontend': 'Building a Frontend', + 'sei-account': 'EIP-6963 Account', '-- Smart Contracts': { type: 'separator', diff --git a/content/learn/_meta.js b/content/learn/_meta.js index 66d3ac0c..e3fe5926 100644 --- a/content/learn/_meta.js +++ b/content/learn/_meta.js @@ -6,9 +6,9 @@ export default { index: 'About Sei', 'user-quickstart': 'User Quickstart', 'dev-chains': 'Chain Info', - accounts: 'Accounts', 'dev-token-standards': 'Token Standards', 'dev-gas': 'Gas', + accounts: 'Account Linking', '-- Network Tools & Providers': { type: 'separator', From 04fe934f9e47925047dcffec22272432b2cbddf3 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 12 Mar 2025 10:39:07 -0700 Subject: [PATCH 05/10] Fixed broken links --- content/cosmwasm/index.mdx | 18 +++-------- content/cosmwasm/installing-seid.mdx | 4 +-- content/cosmwasm/nft-contract-tutorial.mdx | 2 +- content/cosmwasm/pointers/standard.mdx | 6 ++-- content/cosmwasm/pointers/tokenfactory.mdx | 2 +- content/cosmwasm/tokenfactory-allowlist.mdx | 4 +-- content/cosmwasm/tokenfactory-tutorial.mdx | 8 ++--- content/evm/building-a-frontend.mdx | 9 ++---- content/evm/index.mdx | 36 ++------------------- content/evm/nft-contract-tutorial.mdx | 4 +-- content/evm/precompiles/example-usage.mdx | 22 ++++++------- content/evm/tokens.mdx | 2 +- content/learn/dev-interoperability.mdx | 5 +-- content/learn/dev-token-standards.mdx | 6 ++-- content/learn/explorers.mdx | 3 -- next.config.mjs | 2 +- src/data/redirects.json | 2 +- 17 files changed, 42 insertions(+), 93 deletions(-) diff --git a/content/cosmwasm/index.mdx b/content/cosmwasm/index.mdx index e738de82..f5e3ac8b 100644 --- a/content/cosmwasm/index.mdx +++ b/content/cosmwasm/index.mdx @@ -19,27 +19,17 @@ Build dApps and protocols using well known tools like CosmWasm, @cosm-js, and Ke } title="Exploring Token Standards" - link="/build/dev-token-standards" + link="/learn/dev-token-standards" description={`Learn how to create and integrate tokens using Sei’s standards.`} preview={{ content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.", highlights: ['Standardized fungible and non-fungible tokens', 'Deploying ERC-20/ERC-721 equivalents', 'Cross-chain token compatibility', 'Gas-optimized token transfers'] }} /> - } - title="Deploying EVM-Compatible Contracts" - link="/build/evm-general" - description={`Learn how to deploy, interact with, and optimize EVM-compatible contracts on Sei.`} - preview={{ - content: 'Step-by-step guidance for deploying Ethereum-compatible contracts on Sei.', - highlights: ['EVM compatibility explained', 'Deploying existing Solidity contracts', 'Optimizing contract performance on Sei', 'Debugging and migrating contracts'] - }} - /> } title="Developing CosmWasm Smart Contracts" - link="/build/cosmwasm-general" + link="/cosmwasm/cosmwasm-general" description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`} preview={{ content: 'Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.', @@ -49,7 +39,7 @@ Build dApps and protocols using well known tools like CosmWasm, @cosm-js, and Ke } title="Connecting Frontends to Smart Contracts" - link="/build/building-a-frontend" + link="/cosmwasm/building-a-frontend" description={`Learn how to build and connect frontend interfaces for Sei-based dApps.`} preview={{ content: 'Create performant and user-friendly frontends that seamlessly interact with Sei’s backend.', @@ -59,7 +49,7 @@ Build dApps and protocols using well known tools like CosmWasm, @cosm-js, and Ke } title="Cross-Chain Interoperability with IBC" - link="/build/ibc-protocol" + link="/cosmwasm/ibc-protocol" description={`Enable seamless communication between Sei and other blockchains using IBC.`} preview={{ content: 'Implement cross-chain features with IBC to connect Sei with the broader blockchain ecosystem.', diff --git a/content/cosmwasm/installing-seid.mdx b/content/cosmwasm/installing-seid.mdx index f6297f3b..e7de9ed7 100644 --- a/content/cosmwasm/installing-seid.mdx +++ b/content/cosmwasm/installing-seid.mdx @@ -150,7 +150,7 @@ You can query or send transactions to Sei easily via `seid` once you have the 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](providers/rpc-providers) page for a list of +[RPC Providers](/learn/rpc-providers) page for a list of RPC endpoints. - `seid q evm sei-addr [some EVM address]`: Gets the associated Sei address of @@ -174,7 +174,7 @@ Sending transactions via CLI requires you to have keys added via 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](build/resources-tools-and-resources.mdx) page for a list +the [RPC Providers](/learn/rpc-providers) page for a list of RPC endpoints. - `seid tx evm associate-address`: Associates the Sei address and EVM address diff --git a/content/cosmwasm/nft-contract-tutorial.mdx b/content/cosmwasm/nft-contract-tutorial.mdx index ebc89c21..75ba651a 100644 --- a/content/cosmwasm/nft-contract-tutorial.mdx +++ b/content/cosmwasm/nft-contract-tutorial.mdx @@ -159,4 +159,4 @@ address. This NFT contract is linked to the CW721 NFT contract, meaning any activities involving CW721 NFTs will also reflect on the state of the ERC721 NFTs and vice versa. -Learn more about EVM interoperability and pointer contracts [here](build/pointers/pointer-contracts). +Learn more about EVM interoperability and pointer contracts [here](/learn/pointers). diff --git a/content/cosmwasm/pointers/standard.mdx b/content/cosmwasm/pointers/standard.mdx index 8920c84e..2297660c 100644 --- a/content/cosmwasm/pointers/standard.mdx +++ b/content/cosmwasm/pointers/standard.mdx @@ -1,7 +1,7 @@ import { Callout } from 'nextra/components'; - For an overview of Pointer Contracts click [here](build/pointers/overview). + For an overview of Pointer Contracts click [here](/learn/pointers). ### Deploying Pointer Contracts @@ -10,7 +10,7 @@ This section guides you through the process of deploying a Pointer Contract for various token standards using the seid CLI tool. - For an in-depth understanding of Sei token standards, click [here](/dev-token-standards). + For an in-depth understanding of Sei token standards, click [here](/learn/dev-token-standards). #### Prerequisites @@ -18,7 +18,7 @@ various token standards using the seid CLI tool. The list of requirements for deploying a pointer is fairly short: - Sei light client (CLI/daemon) installed on your machine. You can follow the - [installation guide](../../node/getting-started) if needed. + [installation guide](/cosmwasm/installing-seid) if needed. - Address for the relevant contract (the "pointee") When a pointer is registered for any given contract, the two are mapped and diff --git a/content/cosmwasm/pointers/tokenfactory.mdx b/content/cosmwasm/pointers/tokenfactory.mdx index ab1deacc..3ba6f054 100644 --- a/content/cosmwasm/pointers/tokenfactory.mdx +++ b/content/cosmwasm/pointers/tokenfactory.mdx @@ -2,7 +2,7 @@ import { Callout } from 'nextra/components'; ### **First Steps** -Refer to the [Tokenfactory tutorial](build/tokenfactory-tutorial) for details +Refer to the [Tokenfactory tutorial](cosmwasm/tokenfactory-tutorial) for details on how to create a tokenfactory denom and an associated pointer contract. ## Create Pointer Contract diff --git a/content/cosmwasm/tokenfactory-allowlist.mdx b/content/cosmwasm/tokenfactory-allowlist.mdx index f35f0791..4940a2f8 100644 --- a/content/cosmwasm/tokenfactory-allowlist.mdx +++ b/content/cosmwasm/tokenfactory-allowlist.mdx @@ -2,7 +2,7 @@ import { Callout } from 'nextra/components'; # Token Allowlists -The [Sei Token Factory module](build//tokenfactory-tutorial) +The [Sei Token Factory module](/cosmwasm/tokenfactory-tutorial) enables token creators to restrict who can interact with their custom tokens through the use of allowlists. @@ -164,7 +164,7 @@ curl -X 'GET' \ To enable usage of this token in EVM environments, you can create a pointer contract. The detailed process is outlined in the -[Token Factory tutorial](build/tokenfactory-tutorial.mdx#create-pointer-contract). +[Token Factory tutorial](cosmwasm/tokenfactory-tutorial.mdx#create-pointer-contract). For more advanced features and in-depth information, refer to the [Token Factory module documentation](https://github.com/sei-protocol/sei-chain/tree/main/x/tokenfactory). diff --git a/content/cosmwasm/tokenfactory-tutorial.mdx b/content/cosmwasm/tokenfactory-tutorial.mdx index 478538b7..abe93f2f 100644 --- a/content/cosmwasm/tokenfactory-tutorial.mdx +++ b/content/cosmwasm/tokenfactory-tutorial.mdx @@ -8,8 +8,8 @@ tokens by specifying distinct denominations (denoms). The token creator is granted "admin" privileges, enabling them to mint, burn, and transfer their token. -The "address" of these tokens is in the format: -`factory/{CREATOR_ADDRESS}/{DENOM}` +The "address" of these tokens is in the format: +`factory/{CREATOR_ADDRESS}/{DENOM}` and come with a host of native functionalities. --- @@ -21,7 +21,7 @@ Before you begin, ensure you have the following: - The `seid` CLI installed. - A wallet with SEI tokens on testnet. -You can obtain testnet tokens from the faucet available in our [Telegram Tech Chat](https://t.me/+y0eW4tn8gZZiMmJk) by typing `/faucet` followed by your hex address (e.g., `/faucet 0x...`). +> You can obtain testnet tokens [from the faucet](/learn/faucet) --- @@ -167,7 +167,7 @@ version: 1 This pointer contract allows EVM wallets and applications to interact directly with your TokenFactory token. -Learn more about EVM interoperability and pointer contracts [here](build/pointers/overview.mdx). +Learn more about EVM interoperability and pointer contracts [here](/learn/pointers). --- diff --git a/content/evm/building-a-frontend.mdx b/content/evm/building-a-frontend.mdx index a9d86615..3793db77 100644 --- a/content/evm/building-a-frontend.mdx +++ b/content/evm/building-a-frontend.mdx @@ -22,17 +22,12 @@ We will use [ethers.js](https://docs.ethers.org/v6/) to build a React app that i functionality. - [Ethers.js Documentation](https://docs.ethers.io/v6/) -## Prerequisites - -- Complete the tutorial in [cosmwasm-general](build/cosmwasm-general) to deploy - a CosmWasm counter contract on our devnet (arctic-1). - ## Requirements Before starting, ensure you have: - Node.js & NPM installed -- One of the Sei wallets listed [here](providers/wallets/wallets) +- One of the Sei wallets listed [here](/learn/wallets) ## Creating a React Project @@ -65,7 +60,7 @@ are EVM compatible contracts that are built into the chain. The Wasm Precompile is a unique smart contract on Sei that enables EVM clients to query and execute CosmWasm contracts. Refer to the docs on -[precompiles](reference/precompiles/example-usage) for +[precompiles](/evm/precompiles/example-usage) for more details. First, import the address and ABI of the CosmWasm precompile from `@sei-js/evm`. diff --git a/content/evm/index.mdx b/content/evm/index.mdx index f01efb8b..a35bc6d9 100644 --- a/content/evm/index.mdx +++ b/content/evm/index.mdx @@ -26,20 +26,10 @@ for normal people. Learn the fundamentals of Sei EVM development.
- } - title="Understanding Sei Architecture" - link="/learn/differences-with-ethereum" - description={`Explore Sei's unique architecture and how it differs from Ethereum.`} - preview={{ - content: "Learn about Sei's consensus mechanism and architecture tailored for optimized performance and scalability.", - highlights: ['Unique consensus for fast finality', 'Efficient transaction execution', 'Parallel transaction processing', 'Seamless dApp integration'] - }} - /> } title="Exploring Token Standards" - link="/build/dev-token-standards" + link="/learn/dev-token-standards" description={`Learn how to create and integrate tokens using Sei’s standards.`} preview={{ content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.", @@ -49,41 +39,21 @@ Learn the fundamentals of Sei EVM development. } title="Deploying EVM-Compatible Contracts" - link="/build/evm-general" + link="/evm/evm-general" description={`Learn how to deploy, interact with, and optimize EVM-compatible contracts on Sei.`} preview={{ content: 'Step-by-step guidance for deploying Ethereum-compatible contracts on Sei.', highlights: ['EVM compatibility explained', 'Deploying existing Solidity contracts', 'Optimizing contract performance on Sei', 'Debugging and migrating contracts'] }} /> - } - title="Developing CosmWasm Smart Contracts" - link="/build/cosmwasm-general" - description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`} - preview={{ - content: 'Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.', - highlights: ['Understanding CosmWasm basics', 'Use cases: DeFi, NFTs, and more', 'Deployment and testing workflows', 'Integrating CosmWasm contracts with dApps'] - }} - /> } title="Connecting Frontends to Smart Contracts" - link="/build/building-a-frontend" + link="/evm/building-a-frontend" description={`Learn how to build and connect frontend interfaces for Sei-based dApps.`} preview={{ content: 'Create performant and user-friendly frontends that seamlessly interact with Sei’s backend.', highlights: ['Choosing the right frameworks (e.g., React)', 'Connecting to Sei’s smart contracts', 'Handling blockchain events', 'Best practices for dApp UX/UI'] }} /> - } - title="Cross-Chain Interoperability with IBC" - link="/build/ibc-protocol" - description={`Enable seamless communication between Sei and other blockchains using IBC.`} - preview={{ - content: 'Implement cross-chain features with IBC to connect Sei with the broader blockchain ecosystem.', - highlights: ['Introduction to the IBC protocol', 'Setting up cross-chain communication', 'Ensuring data integrity and security', 'Use cases: Cross-chain DeFi, NFTs, and more'] - }} - />
diff --git a/content/evm/nft-contract-tutorial.mdx b/content/evm/nft-contract-tutorial.mdx index 13c6233a..c691e092 100644 --- a/content/evm/nft-contract-tutorial.mdx +++ b/content/evm/nft-contract-tutorial.mdx @@ -30,7 +30,7 @@ Before we start, ensure you have: - A basic understanding of Solidity and smart contract development. - A wallet with SEI tokens on devnet -You can obtain devnet tokens from one of the faucets listed [here](../dev-ecosystem-providers/faucets). +> You can obtain testnet tokens [from the faucet](/learn/faucet) ### Setting Up Your Project @@ -185,4 +185,4 @@ address. This NFT contract is linked to the ERC721 NFT contract, meaning any activities involving CW721 NFTs will also reflect on the state of the ERC721 NFTs and vice versa. -Learn more about EVM interoperability and pointer contracts [here](build/pointers/overview). +Learn more about EVM interoperability and pointer contracts [here](/learn/pointers). diff --git a/content/evm/precompiles/example-usage.mdx b/content/evm/precompiles/example-usage.mdx index bcac7401..35dcb132 100644 --- a/content/evm/precompiles/example-usage.mdx +++ b/content/evm/precompiles/example-usage.mdx @@ -11,19 +11,19 @@ execute actions on a CosmWasm contract as follows: To install `ethers`, run the following command in your project directory terminal: -```bash copy -npm install ethers -npm install @sei-js/evm -``` + ```bash copy + npm install ethers + npm install @sei-js/evm + ``` Next, you'll need to use one of the precompiles in `EVM Precompiles` section. In -this example, we're going to be using the [CosmWasm precompile](reference/precompiles/cosmwasm): +this example, we're going to be using the [CosmWasm precompile](/evm/precompiles/cosmwasm): -```typescript copy -// Import Wasm precompile address and ABI -// View the entire ABI here: https://github.com/sei-protocol/sei-chain/tree/evm/precompiles/wasmd -import { WASM_PRECOMPILE_ABI, WASM_PRECOMPILE_ADDRESS } from '@sei-js/evm'; -``` + ```typescript copy + // Import Wasm precompile address and ABI + // View the entire ABI here: https://github.com/sei-protocol/sei-chain/tree/evm/precompiles/wasmd + import { WASM_PRECOMPILE_ABI, WASM_PRECOMPILE_ADDRESS } from '@sei-js/evm'; + ``` ## Using the contract @@ -40,7 +40,7 @@ const signer = await provider.getSigner(); const contract = new ethers.Contract(WASM_PRECOMPILE_ADDRESS, WASM_PRECOMPILE_ABI, signer); ``` -If using MetaMask, the wallet must be switched to the Sei EVM Devnet chain. Information to import the Sei EVM Devnet chain can be found [here](../learn/wallet-setup). +If using MetaMask, the wallet must be switched to the Sei EVM Devnet chain. Information to import the Sei EVM Devnet chain can be found [here](/learn/wallet). #### Querying & Executing a CosmWasm Contract diff --git a/content/evm/tokens.mdx b/content/evm/tokens.mdx index fb2997bc..67a15c22 100644 --- a/content/evm/tokens.mdx +++ b/content/evm/tokens.mdx @@ -26,4 +26,4 @@ Similarly, CW721 NFTs can only be visible in MetaMask if a pointer contract created for it. Once created, you can import it into your wallet like a standard ERC721 NFT. -> Visit our [Pointer Contract page](build/pointers/pointer-contracts) to learn more. +> Visit our [Pointer Contract page](/learn/pointers) to learn more. diff --git a/content/learn/dev-interoperability.mdx b/content/learn/dev-interoperability.mdx index 40a3e2ab..b72fa79c 100644 --- a/content/learn/dev-interoperability.mdx +++ b/content/learn/dev-interoperability.mdx @@ -38,7 +38,7 @@ environment. They provide a gateway for users and developers to access native Sei functionalities through the EVM RPC interface. For instructions on utilizing EVM precompiles, refer to the -[Example Usage](reference/precompiles/example-usage.mdx) section. +[Example Usage](/evm/precompiles/example-usage) section. ## Pointer Contracts @@ -51,9 +51,6 @@ environments. Pointer contracts can be deployed for any Token Factory, Smart Contract (ERC20, ERC721, etc.), and any IBC denom. -Learn more about Pointer Contracts and how to deploy them -[here](../../build/pointers/overview.mdx). - ## Example Diagram diff --git a/content/learn/dev-token-standards.mdx b/content/learn/dev-token-standards.mdx index ced80c29..f5a63154 100644 --- a/content/learn/dev-token-standards.mdx +++ b/content/learn/dev-token-standards.mdx @@ -61,7 +61,7 @@ the smart contract directly. are priorities or for native applications. Learn more about creating tokens using TokenFactory in the -[TokenFactory Tutorial](build/tokenfactory-tutorial). +[TokenFactory Tutorial](cosmwasm/tokenfactory-tutorial). ### Smart Contract Tokens @@ -76,7 +76,7 @@ Learn more about creating tokens using TokenFactory in the - **Interoperability**: Both standards support pointer contracts, enabling seamless interaction between native and EVM environments. - **Interoperability and Pointer Contracts**: - [Pointer contracts](build/pointers/pointer-contracts) enable interoperability + [Pointer contracts](/learn/pointers) enable interoperability between ERC20 and CW20 tokens, allowing for seamless interaction between the two standards. A registry is kept to track pointer contracts and facilitate interoperability. @@ -87,7 +87,7 @@ Learn more about creating tokens using TokenFactory in the Interoperability: Regardless of the choice, both TokenFactory and CW20/ERC20 tokens can have pointer contracts deployed, facilitating seamless cross-vm interoperability. For more detailed guidance, refer to the -[Pointer Contracts Documentation](build/pointers/pointer-contracts). +[Pointer Contracts Documentation](/learn/pointers). diff --git a/content/learn/explorers.mdx b/content/learn/explorers.mdx index 3fc32748..ad94d1cc 100644 --- a/content/learn/explorers.mdx +++ b/content/learn/explorers.mdx @@ -36,9 +36,6 @@ with the network including: Note: In rare cases, some information may be misinterpreted. Off-chain data should be used as a guide only. -Please refer to the [block explorers](../dev-ecosystem-providers/explorers.mdx) -page for a list of block explorers. - ## Sei Explorers diff --git a/next.config.mjs b/next.config.mjs index 04bfa500..46391bce 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -391,7 +391,7 @@ export default withNextra({ }, { "source": "/dev-tutorials/tokenfactory-tutorial", - "destination": "/build/tokenfactory-tutorial", + "destination": "/cosmwasm/tokenfactory-tutorial", "permanent": true }, { diff --git a/src/data/redirects.json b/src/data/redirects.json index 9779d235..e11c68fb 100644 --- a/src/data/redirects.json +++ b/src/data/redirects.json @@ -356,7 +356,7 @@ }, { "source": "/dev-tutorials/tokenfactory-tutorial", - "destination": "/build/tokenfactory-tutorial", + "destination": "/cosmwasm/tokenfactory-tutorial", "permanent": true }, { From 9572a668f95db0fd0a09e1d2d51d2794c92fbb01 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Fri, 14 Mar 2025 13:29:08 -0700 Subject: [PATCH 06/10] Reorganization for split, small content adjustments - Reorganized content around seid - Fixed broken links and changed a card on the cosmos home page - Moved pointers section to evm as it is slightly more evm focused than sei focused - Made note on Blocknatives API being free, but limited --- content/cosmwasm/_meta.js | 6 +- ...{seid-devtool.mdx => evm-transactions.mdx} | 116 +++++++++++------- content/cosmwasm/index.mdx | 22 +--- content/cosmwasm/installing-seid.mdx | 51 -------- content/evm/_meta.js | 4 +- content/{cosmwasm => evm}/ibc-protocol.mdx | 0 content/{cosmwasm => evm}/pointers/_meta.js | 0 content/{cosmwasm => evm}/pointers/ibc.mdx | 0 .../{cosmwasm => evm}/pointers/standard.mdx | 0 .../pointers/tokenfactory.mdx | 0 content/learn/dev-gas.mdx | 2 +- 11 files changed, 84 insertions(+), 117 deletions(-) rename content/cosmwasm/{seid-devtool.mdx => evm-transactions.mdx} (53%) rename content/{cosmwasm => evm}/ibc-protocol.mdx (100%) rename content/{cosmwasm => evm}/pointers/_meta.js (100%) rename content/{cosmwasm => evm}/pointers/ibc.mdx (100%) rename content/{cosmwasm => evm}/pointers/standard.mdx (100%) rename content/{cosmwasm => evm}/pointers/tokenfactory.mdx (100%) diff --git a/content/cosmwasm/_meta.js b/content/cosmwasm/_meta.js index a226f2d2..a49f7b31 100644 --- a/content/cosmwasm/_meta.js +++ b/content/cosmwasm/_meta.js @@ -7,8 +7,8 @@ export default { title: 'Essentials' }, networks: 'Network Information', - 'installing-seid': 'Installing `seid` CLI', 'querying-state': 'Querying Blockchain State', + 'installing-seid': 'Installing `seid` CLI', '-- Transactions': { type: 'separator', @@ -16,7 +16,6 @@ export default { }, transactions: 'Transaction Overview', 'execute-multiple': 'Executing Multiple Transactions', - 'seid-devtool': 'Generate Boilerplate Tx Messages', '-- Frontend Development': { type: 'separator', @@ -35,8 +34,7 @@ export default { type: 'separator', title: 'Interoperability' }, - 'ibc-protocol': 'IBC Protocol', - pointers: 'Pointer Contracts', + 'evm-transactions': 'EVM on Cosmos', '-- Modules': { type: 'separator', diff --git a/content/cosmwasm/seid-devtool.mdx b/content/cosmwasm/evm-transactions.mdx similarity index 53% rename from content/cosmwasm/seid-devtool.mdx rename to content/cosmwasm/evm-transactions.mdx index c695e42a..1b6cec2d 100644 --- a/content/cosmwasm/seid-devtool.mdx +++ b/content/cosmwasm/evm-transactions.mdx @@ -1,23 +1,67 @@ -# Creating Boilerplate Transaction Messages/Data - -### Using One Simple Flag: - -#### --generate-only` - -Transaction templates form the foundation of blockchain development and -automation in Sei. Through the `--generate-only` flag and Foundry's `cast` tool, -developers can craft, analyze, and debug transactions across both native Cosmos -and EVM environments. Understanding these tools opens up powerful possibilities -for building sophisticated applications and development workflows. - -### Native Transaction Templates +# EVM Transactions on Cosmos + +On Sei, EVM transactions can be executed using the same tools as native Cosmos transactions. This is useful for developers who want to interact with both native and EVM functionality in their applications. This guide will help you understand how to query and send transactions using the Sei CLI (`seid`) and Foundry's `cast` command, as well as how to generate transaction templates for both native and EVM transactions. + +## `seid` for EVM + +You can query or send transactions to Sei easily via `seid` once you have the +`seid` command installed (see [Installing Seid](/cosmwasm/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 +[RPC Providers](/learn/rpc-providers) 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 [RPC Providers](/learn/rpc-providers) 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. + +### Transaction Template Generation The `--generate-only` flag transforms any Sei CLI transaction command into a template generator, creating complete transaction structures without -broadcasting them. These templates serve as building blocks for applications, -frontends, and automation tools. +broadcasting them. Through the `--generate-only` flag and Foundry's `cast` tool, +developers can craft, analyze, and debug transactions across both native Cosmos +and EVM environments. -#### Basic Usage Pattern +#### Basic Command Pattern The general pattern follows this structure: @@ -36,13 +80,7 @@ seid tx bank send \ --generate-only | jq ``` -### EVM Transaction Analysis - -Sei's EVM compatibility introduces additional complexity when working with -transactions. Let's explore how to generate and analyze EVM transactions using -both Sei's native tools and Foundry's `cast` command. - -#### Generating EVM Transaction Templates +### Generating EVM Transaction Templates To generate an EVM transaction template, use the `evm` module with `--generate-only`. Here's an example registering an EVM pointer: @@ -60,7 +98,7 @@ seid tx evm register-evm-pointer NATIVE \ This command returns a transaction hash that you can analyze further using Foundry's `cast` tool. -#### Analyzing EVM Transactions with Cast +### Analyzing EVM Transactions with Cast Once you have a transaction hash, you can use Foundry's `cast` command to inspect the transaction details: @@ -94,23 +132,11 @@ value 0 yParity 1 ``` -#### Understanding EVM Transaction Components - -Let's break down the key components of an EVM transaction: - -- `input`: The encoded function call data -- `maxFeePerGas`: Maximum total fee per gas unit -- `maxPriorityFeePerGas`: Maximum priority fee per gas unit -- `gasLimit`: Maximum gas allowed for the transaction -- `to`: Target contract address -- `type`: Transaction type (2 indicates EIP-1559 transaction) +> Learn more about the EVM transaction structure in the [EVM transactions documentation](/evm/transactions). ### Practical Applications -#### Development Workflow - -When developing applications that interact with both native and EVM -functionality: +When developing applications that interact with both native and EVM functionality you may want to get an eth transaction by hash from a dApp that is set up to use the Cosmos RPC interface, not the EVM RPC interface: ```javascript copy async function analyzeTransaction(txHash) { @@ -139,7 +165,7 @@ async function analyzeTransaction(txHash) { } ``` -#### Template Generation for Different Transaction Types +### Template Generation for Different Transaction Types Generate templates for various transaction types: @@ -190,8 +216,10 @@ try { } ``` -#### Security - -- Keep private keys secure and never include them in templates -- Use an `.env` file or other environment variable where possible when working - with hard coded wallet keys or mnemonics +> [!WARNING] +> +> Security Best Practices +> +> - Keep private keys secure and never include them in templates +> - Use an `.env` file or other environment variable where possible when working +> with hard coded wallet keys or mnemonics diff --git a/content/cosmwasm/index.mdx b/content/cosmwasm/index.mdx index f5e3ac8b..cbc11c43 100644 --- a/content/cosmwasm/index.mdx +++ b/content/cosmwasm/index.mdx @@ -6,30 +6,20 @@ import { LinkCard } from '../../src/components/LinkCard'; Build dApps and protocols using well known tools like CosmWasm, @cosm-js, and Keplr.
- } - title="Understanding Sei Architecture" - link="/learn/differences-with-ethereum" - description={`Explore Sei's unique architecture and how it differs from Ethereum.`} - preview={{ - content: "Learn about Sei's consensus mechanism and architecture tailored for optimized performance and scalability.", - highlights: ['Unique consensus for fast finality', 'Efficient transaction execution', 'Parallel transaction processing', 'Seamless dApp integration'] - }} - /> } - title="Exploring Token Standards" - link="/learn/dev-token-standards" - description={`Learn how to create and integrate tokens using Sei’s standards.`} + title="View Network Information" + link="/cosmwasm/networks" + description={`View essential network information like chainId, RPC providers, and explorers.`} preview={{ - content: "Detailed guidance on creating fungible and non-fungible tokens using Sei's standards.", - highlights: ['Standardized fungible and non-fungible tokens', 'Deploying ERC-20/ERC-721 equivalents', 'Cross-chain token compatibility', 'Gas-optimized token transfers'] + content: 'Detailed information about the different live Sei chains for any developer.', + highlights: ['pacific-1', 'atlantic-2', 'arctic-1'] }} /> } title="Developing CosmWasm Smart Contracts" - link="/cosmwasm/cosmwasm-general" + link="/cosmwasm/cosm-wasm-general" description={`Build high-performance, flexible smart contracts with CosmWasm on Sei.`} preview={{ content: 'Unlock new possibilities by developing CosmWasm smart contracts tailored for Sei.', diff --git a/content/cosmwasm/installing-seid.mdx b/content/cosmwasm/installing-seid.mdx index e7de9ed7..5d39566d 100644 --- a/content/cosmwasm/installing-seid.mdx +++ b/content/cosmwasm/installing-seid.mdx @@ -139,54 +139,3 @@ seid keys show $NAME to see a details about a specific wallet. ### - -# Using `seid` CLI - -You can query or send transactions to Sei easily via `seid` once you have the -`seid` command installed (see [Installing Seid](node/getting-started)) - -## 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 -[RPC Providers](/learn/rpc-providers) 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 [RPC Providers](/learn/rpc-providers) 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/content/evm/_meta.js b/content/evm/_meta.js index 0eab5a4a..c16ff1bd 100644 --- a/content/evm/_meta.js +++ b/content/evm/_meta.js @@ -13,7 +13,7 @@ export default { title: 'Frontend Development' }, 'building-a-frontend': 'Building a Frontend', - 'sei-account': 'EIP-6963 Account', + 'sei-account': 'Sei Account', '-- Smart Contracts': { type: 'separator', @@ -36,6 +36,8 @@ export default { title: 'CosmWasm Interoperability' }, precompiles: 'Precompiles', + pointers: 'Pointer Contracts', + 'ibc-protocol': 'IBC on EVM', '-- Hardware Wallets': { type: 'separator', diff --git a/content/cosmwasm/ibc-protocol.mdx b/content/evm/ibc-protocol.mdx similarity index 100% rename from content/cosmwasm/ibc-protocol.mdx rename to content/evm/ibc-protocol.mdx diff --git a/content/cosmwasm/pointers/_meta.js b/content/evm/pointers/_meta.js similarity index 100% rename from content/cosmwasm/pointers/_meta.js rename to content/evm/pointers/_meta.js diff --git a/content/cosmwasm/pointers/ibc.mdx b/content/evm/pointers/ibc.mdx similarity index 100% rename from content/cosmwasm/pointers/ibc.mdx rename to content/evm/pointers/ibc.mdx diff --git a/content/cosmwasm/pointers/standard.mdx b/content/evm/pointers/standard.mdx similarity index 100% rename from content/cosmwasm/pointers/standard.mdx rename to content/evm/pointers/standard.mdx diff --git a/content/cosmwasm/pointers/tokenfactory.mdx b/content/evm/pointers/tokenfactory.mdx similarity index 100% rename from content/cosmwasm/pointers/tokenfactory.mdx rename to content/evm/pointers/tokenfactory.mdx diff --git a/content/learn/dev-gas.mdx b/content/learn/dev-gas.mdx index 45b3e84d..d6c1e22f 100644 --- a/content/learn/dev-gas.mdx +++ b/content/learn/dev-gas.mdx @@ -120,7 +120,7 @@ section. ## Using Blocknative's Gas API -To leverage Blocknative's you will need an [API Key](https://docs.blocknative.com/gas-prediction/gas-platform#authentication). Once you have an API key, you can request fee estimation for SEI: +To leverage Blocknative's you will need an [API Key](https://docs.blocknative.com/gas-prediction/gas-platform#authentication). This API is free, but heavily rate limited, so it is recommended you get an API key. Once you have your key, you can request fee estimation for SEI: ``` curl -H "Authorization: your-apikey-here" https://api.blocknative.com/gasprices/blockprices?chainid=1329 From a0f4a00e068f48c9fda7f27908ac40dc90e9da28 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Fri, 14 Mar 2025 13:34:35 -0700 Subject: [PATCH 07/10] Fixed homepage overflow issue on header image --- content/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/index.mdx b/content/index.mdx index 009a4510..cd892e9d 100644 --- a/content/index.mdx +++ b/content/index.mdx @@ -9,7 +9,7 @@ import HeaderIcon from '../public/assets/header.svg'; import Image from 'next/image';
- Follow us on Twitter + Follow us on Twitter

From 876cbcf005f2b6dc6a2033d5feab66bd21465359 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:18:10 -0700 Subject: [PATCH 08/10] Fixed merge conflicts --- content/cosmwasm/_meta.js | 7 +------ content/reference/_meta.js | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/content/cosmwasm/_meta.js b/content/cosmwasm/_meta.js index a49f7b31..a55585bc 100644 --- a/content/cosmwasm/_meta.js +++ b/content/cosmwasm/_meta.js @@ -43,10 +43,5 @@ export default { 'tokenfactory-tutorial': 'Token Factory', 'tokenfactory-allowlist': 'Allowlists', 'multi-sig-accounts': 'Multi-Sig Accounts', - 'fee-grants': 'Fee Grants', - - cosmos: { - title: 'REST API', - display: 'hidden' - } + 'fee-grants': 'Fee Grants' }; diff --git a/content/reference/_meta.js b/content/reference/_meta.js index 5c533004..e8832c19 100644 --- a/content/reference/_meta.js +++ b/content/reference/_meta.js @@ -6,15 +6,9 @@ export default { type: 'separator', title: 'API Reference' }, - evm: 'EVM', api: 'Cosmos', '-- Interoperability': { type: 'separator', title: 'Interoperability' - }, - precompiles: 'EVM Precompiles', - about: { - title: 'Pointer Contracts', - href: '../build/pointers/overview' } }; From ab401e75cfcfbeb224b4d4ece5ccf6d9712fcb62 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Mon, 17 Mar 2025 08:27:32 -0700 Subject: [PATCH 09/10] Moved CosmWasm REST API Reference --- content/cosmwasm/_meta.js | 7 +- content/{reference => cosmwasm}/api/_meta.js | 0 .../api/cosmos/_meta.js | 0 .../api/cosmos/auth/_meta.js | 0 .../api/cosmos/auth/accounts.mdx | 0 .../api/cosmos/auth/address.mdx | 0 .../api/cosmos/auth/index.mdx | 0 .../api/cosmos/auth/nextaccountnumber.mdx | 0 .../api/cosmos/auth/params.mdx | 0 .../api/cosmos/authz/_meta.js | 0 .../api/cosmos/authz/grantee.mdx | 0 .../api/cosmos/authz/granter.mdx | 0 .../api/cosmos/authz/grants.mdx | 0 .../api/cosmos/authz/index.mdx | 0 .../api/cosmos/bank/_meta.js | 0 .../api/cosmos/bank/address.mdx | 0 .../api/cosmos/bank/by-denom.mdx | 0 .../api/cosmos/bank/denom.mdx | 0 .../api/cosmos/bank/denoms-metadata.mdx | 0 .../api/cosmos/bank/index.mdx | 0 .../api/cosmos/bank/params.mdx | 0 .../api/cosmos/bank/supply.mdx | 0 .../api/cosmos/base/_meta.js | 0 .../api/cosmos/base/height.mdx | 0 .../api/cosmos/base/index.mdx | 0 .../api/cosmos/base/latest.mdx | 0 .../api/cosmos/base/node-info.mdx | 0 .../api/cosmos/base/syncing.mdx | 0 .../api/cosmos/cosmos-sdk/_meta.js | 0 .../cosmos/cosmos-sdk/contract-address.mdx | 0 .../api/cosmos/cosmos-sdk/index.mdx | 0 .../list-resource-dependency-mapping.mdx | 0 .../list-wasm-dependency-mapping.mdx | 0 .../api/cosmos/cosmos-sdk/message-key.mdx | 0 .../api/cosmos/cosmos-sdk/params.mdx | 0 .../api/cosmos/distribution/_meta.js | 0 .../api/cosmos/distribution/commission.mdx | 0 .../cosmos/distribution/community-pool.mdx | 0 .../api/cosmos/distribution/index.mdx | 0 .../distribution/outstanding-rewards.mdx | 0 .../api/cosmos/distribution/params.mdx | 0 .../api/cosmos/distribution/rewards.mdx | 0 .../api/cosmos/distribution/slashes.mdx | 0 .../cosmos/distribution/validator-address.mdx | 0 .../api/cosmos/distribution/validators.mdx | 0 .../cosmos/distribution/withdraw-address.mdx | 0 .../api/cosmos/evidence/_meta.js | 0 .../api/cosmos/evidence/evidence-hash.mdx | 0 .../api/cosmos/evidence/evidence.mdx | 0 .../api/cosmos/evidence/index.mdx | 0 .../api/cosmos/feegrant/_meta.js | 0 .../api/cosmos/feegrant/grantee.mdx | 0 .../api/cosmos/feegrant/granter.mdx | 0 .../api/cosmos/feegrant/index.mdx | 0 .../api/cosmos/gov/_meta.js | 0 .../api/cosmos/gov/depositor.mdx | 0 .../api/cosmos/gov/deposits.mdx | 0 .../api/cosmos/gov/index.mdx | 0 .../api/cosmos/gov/params-type.mdx | 0 .../api/cosmos/gov/proposal-id.mdx | 0 .../api/cosmos/gov/proposals.mdx | 0 .../api/cosmos/gov/tally.mdx | 0 .../api/cosmos/gov/voter.mdx | 0 .../api/cosmos/gov/votes.mdx | 0 content/cosmwasm/api/cosmos/index.mdx | 73 +++++++++++++++++++ .../api/cosmos/slashing/_meta.js | 0 .../api/cosmos/slashing/cons-address.mdx | 0 .../api/cosmos/slashing/index.mdx | 0 .../api/cosmos/slashing/params.mdx | 0 .../api/cosmos/slashing/signing-infos.mdx | 0 .../api/cosmos/staking/_meta.js | 0 .../api/cosmos/staking/delegations.mdx | 0 .../api/cosmos/staking/delegator-addr.mdx | 0 .../api/cosmos/staking/height.mdx | 0 .../api/cosmos/staking/index.mdx | 0 .../api/cosmos/staking/params.mdx | 0 .../api/cosmos/staking/pool.mdx | 0 .../api/cosmos/staking/redelegations.mdx | 0 .../cosmos/staking/unbonding-delegation.mdx | 0 .../cosmos/staking/unbonding-delegations.mdx | 0 .../api/cosmos/staking/validator-addr.mdx | 0 .../api/cosmos/staking/validators.mdx | 0 .../api/cosmos/tx/_meta.js | 0 .../api/cosmos/tx/hash.mdx | 0 .../api/cosmos/tx/height.mdx | 0 .../api/cosmos/tx/index.mdx | 0 .../api/cosmos/tx/simulate.mdx | 0 .../api/cosmos/tx/txs.mdx | 0 .../api/cosmos/upgrade/_meta.js | 0 .../api/cosmos/upgrade/current-plan.mdx | 0 .../api/cosmos/upgrade/index.mdx | 0 .../api/cosmos/upgrade/last-height.mdx | 0 .../api/cosmos/upgrade/module-versions.mdx | 0 .../api/cosmos/upgrade/name.mdx | 0 .../api/cosmwasm/_meta.js | 0 content/cosmwasm/api/cosmwasm/index.mdx | 13 ++++ .../api/cosmwasm/wasm/_meta.js | 0 .../api/cosmwasm/wasm/address.mdx | 0 .../api/cosmwasm/wasm/code-id.mdx | 0 .../api/cosmwasm/wasm/code.mdx | 0 .../api/cosmwasm/wasm/contracts.mdx | 0 .../api/cosmwasm/wasm/history.mdx | 0 .../api/cosmwasm/wasm/index.mdx | 0 .../api/cosmwasm/wasm/pinned.mdx | 0 .../api/cosmwasm/wasm/query-data.mdx | 0 .../api/cosmwasm/wasm/state.mdx | 0 .../{reference => cosmwasm}/api/ibc/_meta.js | 0 .../api/ibc/apps/_meta.js | 0 .../api/ibc/apps/denom-traces.mdx | 0 .../api/ibc/apps/escrow-address.mdx | 0 .../api/ibc/apps/hash.mdx | 0 .../api/ibc/apps/index.mdx | 0 .../api/ibc/apps/params.mdx | 0 .../api/ibc/apps/trace.mdx | 0 .../api/ibc/client/_meta.js | 0 .../api/ibc/client/index.mdx | 0 .../api/ibc/client/params.mdx | 0 .../api/ibc/core/_meta.js | 0 .../api/ibc/core/channels.mdx | 0 .../api/ibc/core/client-id.mdx | 0 .../api/ibc/core/client-state.mdx | 0 .../api/ibc/core/client-states.mdx | 0 .../api/ibc/core/connection-id.mdx | 0 .../api/ibc/core/connections.mdx | 0 .../api/ibc/core/heights.mdx | 0 .../api/ibc/core/index.mdx | 0 .../api/ibc/core/next-sequence.mdx | 0 .../api/ibc/core/packet-acknowledgements.mdx | 0 .../api/ibc/core/packet-commitments.mdx | 0 .../api/ibc/core/port-id.mdx | 0 .../api/ibc/core/revision-height.mdx | 0 .../api/ibc/core/sequence.mdx | 0 .../api/ibc/core/unreceived-acks.mdx | 0 .../api/ibc/core/unreceived-packets.mdx | 0 .../api/ibc/core/upgraded-client-states.mdx | 0 .../ibc/core/upgraded-consensus-states.mdx | 0 content/cosmwasm/api/ibc/index.mdx | 23 ++++++ content/{reference => cosmwasm}/api/index.mdx | 0 .../api/sei-protocol/_meta.js | 0 content/cosmwasm/api/sei-protocol/index.mdx | 18 +++++ .../api/sei-protocol/sei-chain/_meta.js | 0 .../api/sei-protocol/sei-chain/actives.mdx | 0 .../sei-protocol/sei-chain/exchange-rate.mdx | 0 .../sei-protocol/sei-chain/exchange-rates.mdx | 0 .../api/sei-protocol/sei-chain/feeder.mdx | 0 .../api/sei-protocol/sei-chain/index.mdx | 0 .../sei-chain/lookback-seconds.mdx | 0 .../api/sei-protocol/sei-chain/params.mdx | 0 .../sei-chain/price-snapshot-history.mdx | 0 .../sei-protocol/sei-chain/slash-window.mdx | 0 .../sei-chain/vote-penalty-counter.mdx | 0 .../sei-protocol/sei-chain/vote-targets.mdx | 0 .../api/sei-protocol/seichain/_meta.js | 0 .../api/sei-protocol/seichain/account.mdx | 0 .../api/sei-protocol/seichain/asset-list.mdx | 0 .../api/sei-protocol/seichain/assetDenom.mdx | 0 .../seichain/authority-metadata.mdx | 0 .../sei-protocol/seichain/contractAddr.mdx | 0 .../api/sei-protocol/seichain/creator.mdx | 0 .../api/sei-protocol/seichain/denom.mdx | 0 .../api/sei-protocol/seichain/epoch.mdx | 0 .../api/sei-protocol/seichain/evm-address.mdx | 0 .../api/sei-protocol/seichain/id.mdx | 0 .../api/sei-protocol/seichain/index.mdx | 0 .../seichain/lookbackInSeconds.mdx | 0 .../sei-protocol/seichain/lookbackSeconds.mdx | 0 .../api/sei-protocol/seichain/metadata.mdx | 0 .../sei-protocol/seichain/numOfPeriods.mdx | 0 .../api/sei-protocol/seichain/params.mdx | 0 .../sei-protocol/seichain/pointer-version.mdx | 0 .../api/sei-protocol/seichain/pointer.mdx | 0 .../api/sei-protocol/seichain/price.mdx | 0 .../seichain/registered-pairs.mdx | 0 .../api/sei-protocol/seichain/sei-address.mdx | 0 .../api/sei-protocol/seichain/static-call.mdx | 0 .../api/sei-protocol/seichain/timestamp.mdx | 0 .../api/seichain/_meta.js | 0 content/cosmwasm/api/seichain/index.mdx | 13 ++++ .../api/seichain/mint/_meta.js | 0 .../api/seichain/mint/index.mdx | 0 .../api/seichain/mint/minter.mdx | 0 .../api/seichain/mint/params.mdx | 0 content/reference/_meta.js | 14 ---- content/reference/api/cosmos/index.mdx | 73 ------------------- content/reference/api/cosmwasm/index.mdx | 13 ---- content/reference/api/ibc/index.mdx | 23 ------ content/reference/api/sei-protocol/index.mdx | 18 ----- content/reference/api/seichain/index.mdx | 13 ---- content/reference/index.mdx | 54 -------------- .../APIModulePaths/APIModulePaths.tsx | 2 +- 190 files changed, 147 insertions(+), 210 deletions(-) rename content/{reference => cosmwasm}/api/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/accounts.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/nextaccountnumber.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/auth/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/authz/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/authz/grantee.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/authz/granter.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/authz/grants.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/authz/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/by-denom.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/denom.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/denoms-metadata.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/bank/supply.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/base/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/base/height.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/base/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/base/latest.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/base/node-info.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/base/syncing.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/contract-address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/list-resource-dependency-mapping.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/list-wasm-dependency-mapping.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/message-key.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/cosmos-sdk/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/commission.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/community-pool.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/outstanding-rewards.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/rewards.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/slashes.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/validator-address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/validators.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/distribution/withdraw-address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/evidence/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/evidence/evidence-hash.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/evidence/evidence.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/evidence/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/feegrant/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/feegrant/grantee.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/feegrant/granter.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/feegrant/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/depositor.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/deposits.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/params-type.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/proposal-id.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/proposals.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/tally.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/voter.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/gov/votes.mdx (100%) create mode 100644 content/cosmwasm/api/cosmos/index.mdx rename content/{reference => cosmwasm}/api/cosmos/slashing/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/slashing/cons-address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/slashing/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/slashing/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/slashing/signing-infos.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/delegations.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/delegator-addr.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/height.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/params.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/pool.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/redelegations.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/unbonding-delegation.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/unbonding-delegations.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/validator-addr.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/staking/validators.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/hash.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/height.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/simulate.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/tx/txs.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/current-plan.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/last-height.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/module-versions.mdx (100%) rename content/{reference => cosmwasm}/api/cosmos/upgrade/name.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/_meta.js (100%) create mode 100644 content/cosmwasm/api/cosmwasm/index.mdx rename content/{reference => cosmwasm}/api/cosmwasm/wasm/_meta.js (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/address.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/code-id.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/code.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/contracts.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/history.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/index.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/pinned.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/query-data.mdx (100%) rename content/{reference => cosmwasm}/api/cosmwasm/wasm/state.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/_meta.js (100%) rename content/{reference => cosmwasm}/api/ibc/apps/_meta.js (100%) rename content/{reference => cosmwasm}/api/ibc/apps/denom-traces.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/apps/escrow-address.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/apps/hash.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/apps/index.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/apps/params.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/apps/trace.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/client/_meta.js (100%) rename content/{reference => cosmwasm}/api/ibc/client/index.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/client/params.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/_meta.js (100%) rename content/{reference => cosmwasm}/api/ibc/core/channels.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/client-id.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/client-state.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/client-states.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/connection-id.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/connections.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/heights.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/index.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/next-sequence.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/packet-acknowledgements.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/packet-commitments.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/port-id.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/revision-height.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/sequence.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/unreceived-acks.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/unreceived-packets.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/upgraded-client-states.mdx (100%) rename content/{reference => cosmwasm}/api/ibc/core/upgraded-consensus-states.mdx (100%) create mode 100644 content/cosmwasm/api/ibc/index.mdx rename content/{reference => cosmwasm}/api/index.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/_meta.js (100%) create mode 100644 content/cosmwasm/api/sei-protocol/index.mdx rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/_meta.js (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/actives.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/exchange-rate.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/exchange-rates.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/feeder.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/index.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/lookback-seconds.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/params.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/price-snapshot-history.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/slash-window.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/vote-penalty-counter.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/sei-chain/vote-targets.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/_meta.js (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/account.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/asset-list.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/assetDenom.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/authority-metadata.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/contractAddr.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/creator.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/denom.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/epoch.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/evm-address.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/id.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/index.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/lookbackInSeconds.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/lookbackSeconds.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/metadata.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/numOfPeriods.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/params.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/pointer-version.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/pointer.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/price.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/registered-pairs.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/sei-address.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/static-call.mdx (100%) rename content/{reference => cosmwasm}/api/sei-protocol/seichain/timestamp.mdx (100%) rename content/{reference => cosmwasm}/api/seichain/_meta.js (100%) create mode 100644 content/cosmwasm/api/seichain/index.mdx rename content/{reference => cosmwasm}/api/seichain/mint/_meta.js (100%) rename content/{reference => cosmwasm}/api/seichain/mint/index.mdx (100%) rename content/{reference => cosmwasm}/api/seichain/mint/minter.mdx (100%) rename content/{reference => cosmwasm}/api/seichain/mint/params.mdx (100%) delete mode 100644 content/reference/_meta.js delete mode 100644 content/reference/api/cosmos/index.mdx delete mode 100644 content/reference/api/cosmwasm/index.mdx delete mode 100644 content/reference/api/ibc/index.mdx delete mode 100644 content/reference/api/sei-protocol/index.mdx delete mode 100644 content/reference/api/seichain/index.mdx delete mode 100644 content/reference/index.mdx diff --git a/content/cosmwasm/_meta.js b/content/cosmwasm/_meta.js index a55585bc..d036510e 100644 --- a/content/cosmwasm/_meta.js +++ b/content/cosmwasm/_meta.js @@ -43,5 +43,10 @@ export default { 'tokenfactory-tutorial': 'Token Factory', 'tokenfactory-allowlist': 'Allowlists', 'multi-sig-accounts': 'Multi-Sig Accounts', - 'fee-grants': 'Fee Grants' + 'fee-grants': 'Fee Grants', + '-- Reference': { + type: 'separator', + title: 'Reference' + }, + api: 'REST API' }; diff --git a/content/reference/api/_meta.js b/content/cosmwasm/api/_meta.js similarity index 100% rename from content/reference/api/_meta.js rename to content/cosmwasm/api/_meta.js diff --git a/content/reference/api/cosmos/_meta.js b/content/cosmwasm/api/cosmos/_meta.js similarity index 100% rename from content/reference/api/cosmos/_meta.js rename to content/cosmwasm/api/cosmos/_meta.js diff --git a/content/reference/api/cosmos/auth/_meta.js b/content/cosmwasm/api/cosmos/auth/_meta.js similarity index 100% rename from content/reference/api/cosmos/auth/_meta.js rename to content/cosmwasm/api/cosmos/auth/_meta.js diff --git a/content/reference/api/cosmos/auth/accounts.mdx b/content/cosmwasm/api/cosmos/auth/accounts.mdx similarity index 100% rename from content/reference/api/cosmos/auth/accounts.mdx rename to content/cosmwasm/api/cosmos/auth/accounts.mdx diff --git a/content/reference/api/cosmos/auth/address.mdx b/content/cosmwasm/api/cosmos/auth/address.mdx similarity index 100% rename from content/reference/api/cosmos/auth/address.mdx rename to content/cosmwasm/api/cosmos/auth/address.mdx diff --git a/content/reference/api/cosmos/auth/index.mdx b/content/cosmwasm/api/cosmos/auth/index.mdx similarity index 100% rename from content/reference/api/cosmos/auth/index.mdx rename to content/cosmwasm/api/cosmos/auth/index.mdx diff --git a/content/reference/api/cosmos/auth/nextaccountnumber.mdx b/content/cosmwasm/api/cosmos/auth/nextaccountnumber.mdx similarity index 100% rename from content/reference/api/cosmos/auth/nextaccountnumber.mdx rename to content/cosmwasm/api/cosmos/auth/nextaccountnumber.mdx diff --git a/content/reference/api/cosmos/auth/params.mdx b/content/cosmwasm/api/cosmos/auth/params.mdx similarity index 100% rename from content/reference/api/cosmos/auth/params.mdx rename to content/cosmwasm/api/cosmos/auth/params.mdx diff --git a/content/reference/api/cosmos/authz/_meta.js b/content/cosmwasm/api/cosmos/authz/_meta.js similarity index 100% rename from content/reference/api/cosmos/authz/_meta.js rename to content/cosmwasm/api/cosmos/authz/_meta.js diff --git a/content/reference/api/cosmos/authz/grantee.mdx b/content/cosmwasm/api/cosmos/authz/grantee.mdx similarity index 100% rename from content/reference/api/cosmos/authz/grantee.mdx rename to content/cosmwasm/api/cosmos/authz/grantee.mdx diff --git a/content/reference/api/cosmos/authz/granter.mdx b/content/cosmwasm/api/cosmos/authz/granter.mdx similarity index 100% rename from content/reference/api/cosmos/authz/granter.mdx rename to content/cosmwasm/api/cosmos/authz/granter.mdx diff --git a/content/reference/api/cosmos/authz/grants.mdx b/content/cosmwasm/api/cosmos/authz/grants.mdx similarity index 100% rename from content/reference/api/cosmos/authz/grants.mdx rename to content/cosmwasm/api/cosmos/authz/grants.mdx diff --git a/content/reference/api/cosmos/authz/index.mdx b/content/cosmwasm/api/cosmos/authz/index.mdx similarity index 100% rename from content/reference/api/cosmos/authz/index.mdx rename to content/cosmwasm/api/cosmos/authz/index.mdx diff --git a/content/reference/api/cosmos/bank/_meta.js b/content/cosmwasm/api/cosmos/bank/_meta.js similarity index 100% rename from content/reference/api/cosmos/bank/_meta.js rename to content/cosmwasm/api/cosmos/bank/_meta.js diff --git a/content/reference/api/cosmos/bank/address.mdx b/content/cosmwasm/api/cosmos/bank/address.mdx similarity index 100% rename from content/reference/api/cosmos/bank/address.mdx rename to content/cosmwasm/api/cosmos/bank/address.mdx diff --git a/content/reference/api/cosmos/bank/by-denom.mdx b/content/cosmwasm/api/cosmos/bank/by-denom.mdx similarity index 100% rename from content/reference/api/cosmos/bank/by-denom.mdx rename to content/cosmwasm/api/cosmos/bank/by-denom.mdx diff --git a/content/reference/api/cosmos/bank/denom.mdx b/content/cosmwasm/api/cosmos/bank/denom.mdx similarity index 100% rename from content/reference/api/cosmos/bank/denom.mdx rename to content/cosmwasm/api/cosmos/bank/denom.mdx diff --git a/content/reference/api/cosmos/bank/denoms-metadata.mdx b/content/cosmwasm/api/cosmos/bank/denoms-metadata.mdx similarity index 100% rename from content/reference/api/cosmos/bank/denoms-metadata.mdx rename to content/cosmwasm/api/cosmos/bank/denoms-metadata.mdx diff --git a/content/reference/api/cosmos/bank/index.mdx b/content/cosmwasm/api/cosmos/bank/index.mdx similarity index 100% rename from content/reference/api/cosmos/bank/index.mdx rename to content/cosmwasm/api/cosmos/bank/index.mdx diff --git a/content/reference/api/cosmos/bank/params.mdx b/content/cosmwasm/api/cosmos/bank/params.mdx similarity index 100% rename from content/reference/api/cosmos/bank/params.mdx rename to content/cosmwasm/api/cosmos/bank/params.mdx diff --git a/content/reference/api/cosmos/bank/supply.mdx b/content/cosmwasm/api/cosmos/bank/supply.mdx similarity index 100% rename from content/reference/api/cosmos/bank/supply.mdx rename to content/cosmwasm/api/cosmos/bank/supply.mdx diff --git a/content/reference/api/cosmos/base/_meta.js b/content/cosmwasm/api/cosmos/base/_meta.js similarity index 100% rename from content/reference/api/cosmos/base/_meta.js rename to content/cosmwasm/api/cosmos/base/_meta.js diff --git a/content/reference/api/cosmos/base/height.mdx b/content/cosmwasm/api/cosmos/base/height.mdx similarity index 100% rename from content/reference/api/cosmos/base/height.mdx rename to content/cosmwasm/api/cosmos/base/height.mdx diff --git a/content/reference/api/cosmos/base/index.mdx b/content/cosmwasm/api/cosmos/base/index.mdx similarity index 100% rename from content/reference/api/cosmos/base/index.mdx rename to content/cosmwasm/api/cosmos/base/index.mdx diff --git a/content/reference/api/cosmos/base/latest.mdx b/content/cosmwasm/api/cosmos/base/latest.mdx similarity index 100% rename from content/reference/api/cosmos/base/latest.mdx rename to content/cosmwasm/api/cosmos/base/latest.mdx diff --git a/content/reference/api/cosmos/base/node-info.mdx b/content/cosmwasm/api/cosmos/base/node-info.mdx similarity index 100% rename from content/reference/api/cosmos/base/node-info.mdx rename to content/cosmwasm/api/cosmos/base/node-info.mdx diff --git a/content/reference/api/cosmos/base/syncing.mdx b/content/cosmwasm/api/cosmos/base/syncing.mdx similarity index 100% rename from content/reference/api/cosmos/base/syncing.mdx rename to content/cosmwasm/api/cosmos/base/syncing.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/_meta.js b/content/cosmwasm/api/cosmos/cosmos-sdk/_meta.js similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/_meta.js rename to content/cosmwasm/api/cosmos/cosmos-sdk/_meta.js diff --git a/content/reference/api/cosmos/cosmos-sdk/contract-address.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/contract-address.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/contract-address.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/contract-address.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/index.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/index.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/index.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/index.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/list-resource-dependency-mapping.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/list-resource-dependency-mapping.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/list-resource-dependency-mapping.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/list-resource-dependency-mapping.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/list-wasm-dependency-mapping.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/list-wasm-dependency-mapping.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/list-wasm-dependency-mapping.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/list-wasm-dependency-mapping.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/message-key.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/message-key.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/message-key.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/message-key.mdx diff --git a/content/reference/api/cosmos/cosmos-sdk/params.mdx b/content/cosmwasm/api/cosmos/cosmos-sdk/params.mdx similarity index 100% rename from content/reference/api/cosmos/cosmos-sdk/params.mdx rename to content/cosmwasm/api/cosmos/cosmos-sdk/params.mdx diff --git a/content/reference/api/cosmos/distribution/_meta.js b/content/cosmwasm/api/cosmos/distribution/_meta.js similarity index 100% rename from content/reference/api/cosmos/distribution/_meta.js rename to content/cosmwasm/api/cosmos/distribution/_meta.js diff --git a/content/reference/api/cosmos/distribution/commission.mdx b/content/cosmwasm/api/cosmos/distribution/commission.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/commission.mdx rename to content/cosmwasm/api/cosmos/distribution/commission.mdx diff --git a/content/reference/api/cosmos/distribution/community-pool.mdx b/content/cosmwasm/api/cosmos/distribution/community-pool.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/community-pool.mdx rename to content/cosmwasm/api/cosmos/distribution/community-pool.mdx diff --git a/content/reference/api/cosmos/distribution/index.mdx b/content/cosmwasm/api/cosmos/distribution/index.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/index.mdx rename to content/cosmwasm/api/cosmos/distribution/index.mdx diff --git a/content/reference/api/cosmos/distribution/outstanding-rewards.mdx b/content/cosmwasm/api/cosmos/distribution/outstanding-rewards.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/outstanding-rewards.mdx rename to content/cosmwasm/api/cosmos/distribution/outstanding-rewards.mdx diff --git a/content/reference/api/cosmos/distribution/params.mdx b/content/cosmwasm/api/cosmos/distribution/params.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/params.mdx rename to content/cosmwasm/api/cosmos/distribution/params.mdx diff --git a/content/reference/api/cosmos/distribution/rewards.mdx b/content/cosmwasm/api/cosmos/distribution/rewards.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/rewards.mdx rename to content/cosmwasm/api/cosmos/distribution/rewards.mdx diff --git a/content/reference/api/cosmos/distribution/slashes.mdx b/content/cosmwasm/api/cosmos/distribution/slashes.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/slashes.mdx rename to content/cosmwasm/api/cosmos/distribution/slashes.mdx diff --git a/content/reference/api/cosmos/distribution/validator-address.mdx b/content/cosmwasm/api/cosmos/distribution/validator-address.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/validator-address.mdx rename to content/cosmwasm/api/cosmos/distribution/validator-address.mdx diff --git a/content/reference/api/cosmos/distribution/validators.mdx b/content/cosmwasm/api/cosmos/distribution/validators.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/validators.mdx rename to content/cosmwasm/api/cosmos/distribution/validators.mdx diff --git a/content/reference/api/cosmos/distribution/withdraw-address.mdx b/content/cosmwasm/api/cosmos/distribution/withdraw-address.mdx similarity index 100% rename from content/reference/api/cosmos/distribution/withdraw-address.mdx rename to content/cosmwasm/api/cosmos/distribution/withdraw-address.mdx diff --git a/content/reference/api/cosmos/evidence/_meta.js b/content/cosmwasm/api/cosmos/evidence/_meta.js similarity index 100% rename from content/reference/api/cosmos/evidence/_meta.js rename to content/cosmwasm/api/cosmos/evidence/_meta.js diff --git a/content/reference/api/cosmos/evidence/evidence-hash.mdx b/content/cosmwasm/api/cosmos/evidence/evidence-hash.mdx similarity index 100% rename from content/reference/api/cosmos/evidence/evidence-hash.mdx rename to content/cosmwasm/api/cosmos/evidence/evidence-hash.mdx diff --git a/content/reference/api/cosmos/evidence/evidence.mdx b/content/cosmwasm/api/cosmos/evidence/evidence.mdx similarity index 100% rename from content/reference/api/cosmos/evidence/evidence.mdx rename to content/cosmwasm/api/cosmos/evidence/evidence.mdx diff --git a/content/reference/api/cosmos/evidence/index.mdx b/content/cosmwasm/api/cosmos/evidence/index.mdx similarity index 100% rename from content/reference/api/cosmos/evidence/index.mdx rename to content/cosmwasm/api/cosmos/evidence/index.mdx diff --git a/content/reference/api/cosmos/feegrant/_meta.js b/content/cosmwasm/api/cosmos/feegrant/_meta.js similarity index 100% rename from content/reference/api/cosmos/feegrant/_meta.js rename to content/cosmwasm/api/cosmos/feegrant/_meta.js diff --git a/content/reference/api/cosmos/feegrant/grantee.mdx b/content/cosmwasm/api/cosmos/feegrant/grantee.mdx similarity index 100% rename from content/reference/api/cosmos/feegrant/grantee.mdx rename to content/cosmwasm/api/cosmos/feegrant/grantee.mdx diff --git a/content/reference/api/cosmos/feegrant/granter.mdx b/content/cosmwasm/api/cosmos/feegrant/granter.mdx similarity index 100% rename from content/reference/api/cosmos/feegrant/granter.mdx rename to content/cosmwasm/api/cosmos/feegrant/granter.mdx diff --git a/content/reference/api/cosmos/feegrant/index.mdx b/content/cosmwasm/api/cosmos/feegrant/index.mdx similarity index 100% rename from content/reference/api/cosmos/feegrant/index.mdx rename to content/cosmwasm/api/cosmos/feegrant/index.mdx diff --git a/content/reference/api/cosmos/gov/_meta.js b/content/cosmwasm/api/cosmos/gov/_meta.js similarity index 100% rename from content/reference/api/cosmos/gov/_meta.js rename to content/cosmwasm/api/cosmos/gov/_meta.js diff --git a/content/reference/api/cosmos/gov/depositor.mdx b/content/cosmwasm/api/cosmos/gov/depositor.mdx similarity index 100% rename from content/reference/api/cosmos/gov/depositor.mdx rename to content/cosmwasm/api/cosmos/gov/depositor.mdx diff --git a/content/reference/api/cosmos/gov/deposits.mdx b/content/cosmwasm/api/cosmos/gov/deposits.mdx similarity index 100% rename from content/reference/api/cosmos/gov/deposits.mdx rename to content/cosmwasm/api/cosmos/gov/deposits.mdx diff --git a/content/reference/api/cosmos/gov/index.mdx b/content/cosmwasm/api/cosmos/gov/index.mdx similarity index 100% rename from content/reference/api/cosmos/gov/index.mdx rename to content/cosmwasm/api/cosmos/gov/index.mdx diff --git a/content/reference/api/cosmos/gov/params-type.mdx b/content/cosmwasm/api/cosmos/gov/params-type.mdx similarity index 100% rename from content/reference/api/cosmos/gov/params-type.mdx rename to content/cosmwasm/api/cosmos/gov/params-type.mdx diff --git a/content/reference/api/cosmos/gov/proposal-id.mdx b/content/cosmwasm/api/cosmos/gov/proposal-id.mdx similarity index 100% rename from content/reference/api/cosmos/gov/proposal-id.mdx rename to content/cosmwasm/api/cosmos/gov/proposal-id.mdx diff --git a/content/reference/api/cosmos/gov/proposals.mdx b/content/cosmwasm/api/cosmos/gov/proposals.mdx similarity index 100% rename from content/reference/api/cosmos/gov/proposals.mdx rename to content/cosmwasm/api/cosmos/gov/proposals.mdx diff --git a/content/reference/api/cosmos/gov/tally.mdx b/content/cosmwasm/api/cosmos/gov/tally.mdx similarity index 100% rename from content/reference/api/cosmos/gov/tally.mdx rename to content/cosmwasm/api/cosmos/gov/tally.mdx diff --git a/content/reference/api/cosmos/gov/voter.mdx b/content/cosmwasm/api/cosmos/gov/voter.mdx similarity index 100% rename from content/reference/api/cosmos/gov/voter.mdx rename to content/cosmwasm/api/cosmos/gov/voter.mdx diff --git a/content/reference/api/cosmos/gov/votes.mdx b/content/cosmwasm/api/cosmos/gov/votes.mdx similarity index 100% rename from content/reference/api/cosmos/gov/votes.mdx rename to content/cosmwasm/api/cosmos/gov/votes.mdx diff --git a/content/cosmwasm/api/cosmos/index.mdx b/content/cosmwasm/api/cosmos/index.mdx new file mode 100644 index 00000000..02e1b433 --- /dev/null +++ b/content/cosmwasm/api/cosmos/index.mdx @@ -0,0 +1,73 @@ +# Cosmos API + +This section covers the Cosmos related endpoints. Choose a category to continue. + +## Categories + + diff --git a/content/reference/api/cosmos/slashing/_meta.js b/content/cosmwasm/api/cosmos/slashing/_meta.js similarity index 100% rename from content/reference/api/cosmos/slashing/_meta.js rename to content/cosmwasm/api/cosmos/slashing/_meta.js diff --git a/content/reference/api/cosmos/slashing/cons-address.mdx b/content/cosmwasm/api/cosmos/slashing/cons-address.mdx similarity index 100% rename from content/reference/api/cosmos/slashing/cons-address.mdx rename to content/cosmwasm/api/cosmos/slashing/cons-address.mdx diff --git a/content/reference/api/cosmos/slashing/index.mdx b/content/cosmwasm/api/cosmos/slashing/index.mdx similarity index 100% rename from content/reference/api/cosmos/slashing/index.mdx rename to content/cosmwasm/api/cosmos/slashing/index.mdx diff --git a/content/reference/api/cosmos/slashing/params.mdx b/content/cosmwasm/api/cosmos/slashing/params.mdx similarity index 100% rename from content/reference/api/cosmos/slashing/params.mdx rename to content/cosmwasm/api/cosmos/slashing/params.mdx diff --git a/content/reference/api/cosmos/slashing/signing-infos.mdx b/content/cosmwasm/api/cosmos/slashing/signing-infos.mdx similarity index 100% rename from content/reference/api/cosmos/slashing/signing-infos.mdx rename to content/cosmwasm/api/cosmos/slashing/signing-infos.mdx diff --git a/content/reference/api/cosmos/staking/_meta.js b/content/cosmwasm/api/cosmos/staking/_meta.js similarity index 100% rename from content/reference/api/cosmos/staking/_meta.js rename to content/cosmwasm/api/cosmos/staking/_meta.js diff --git a/content/reference/api/cosmos/staking/delegations.mdx b/content/cosmwasm/api/cosmos/staking/delegations.mdx similarity index 100% rename from content/reference/api/cosmos/staking/delegations.mdx rename to content/cosmwasm/api/cosmos/staking/delegations.mdx diff --git a/content/reference/api/cosmos/staking/delegator-addr.mdx b/content/cosmwasm/api/cosmos/staking/delegator-addr.mdx similarity index 100% rename from content/reference/api/cosmos/staking/delegator-addr.mdx rename to content/cosmwasm/api/cosmos/staking/delegator-addr.mdx diff --git a/content/reference/api/cosmos/staking/height.mdx b/content/cosmwasm/api/cosmos/staking/height.mdx similarity index 100% rename from content/reference/api/cosmos/staking/height.mdx rename to content/cosmwasm/api/cosmos/staking/height.mdx diff --git a/content/reference/api/cosmos/staking/index.mdx b/content/cosmwasm/api/cosmos/staking/index.mdx similarity index 100% rename from content/reference/api/cosmos/staking/index.mdx rename to content/cosmwasm/api/cosmos/staking/index.mdx diff --git a/content/reference/api/cosmos/staking/params.mdx b/content/cosmwasm/api/cosmos/staking/params.mdx similarity index 100% rename from content/reference/api/cosmos/staking/params.mdx rename to content/cosmwasm/api/cosmos/staking/params.mdx diff --git a/content/reference/api/cosmos/staking/pool.mdx b/content/cosmwasm/api/cosmos/staking/pool.mdx similarity index 100% rename from content/reference/api/cosmos/staking/pool.mdx rename to content/cosmwasm/api/cosmos/staking/pool.mdx diff --git a/content/reference/api/cosmos/staking/redelegations.mdx b/content/cosmwasm/api/cosmos/staking/redelegations.mdx similarity index 100% rename from content/reference/api/cosmos/staking/redelegations.mdx rename to content/cosmwasm/api/cosmos/staking/redelegations.mdx diff --git a/content/reference/api/cosmos/staking/unbonding-delegation.mdx b/content/cosmwasm/api/cosmos/staking/unbonding-delegation.mdx similarity index 100% rename from content/reference/api/cosmos/staking/unbonding-delegation.mdx rename to content/cosmwasm/api/cosmos/staking/unbonding-delegation.mdx diff --git a/content/reference/api/cosmos/staking/unbonding-delegations.mdx b/content/cosmwasm/api/cosmos/staking/unbonding-delegations.mdx similarity index 100% rename from content/reference/api/cosmos/staking/unbonding-delegations.mdx rename to content/cosmwasm/api/cosmos/staking/unbonding-delegations.mdx diff --git a/content/reference/api/cosmos/staking/validator-addr.mdx b/content/cosmwasm/api/cosmos/staking/validator-addr.mdx similarity index 100% rename from content/reference/api/cosmos/staking/validator-addr.mdx rename to content/cosmwasm/api/cosmos/staking/validator-addr.mdx diff --git a/content/reference/api/cosmos/staking/validators.mdx b/content/cosmwasm/api/cosmos/staking/validators.mdx similarity index 100% rename from content/reference/api/cosmos/staking/validators.mdx rename to content/cosmwasm/api/cosmos/staking/validators.mdx diff --git a/content/reference/api/cosmos/tx/_meta.js b/content/cosmwasm/api/cosmos/tx/_meta.js similarity index 100% rename from content/reference/api/cosmos/tx/_meta.js rename to content/cosmwasm/api/cosmos/tx/_meta.js diff --git a/content/reference/api/cosmos/tx/hash.mdx b/content/cosmwasm/api/cosmos/tx/hash.mdx similarity index 100% rename from content/reference/api/cosmos/tx/hash.mdx rename to content/cosmwasm/api/cosmos/tx/hash.mdx diff --git a/content/reference/api/cosmos/tx/height.mdx b/content/cosmwasm/api/cosmos/tx/height.mdx similarity index 100% rename from content/reference/api/cosmos/tx/height.mdx rename to content/cosmwasm/api/cosmos/tx/height.mdx diff --git a/content/reference/api/cosmos/tx/index.mdx b/content/cosmwasm/api/cosmos/tx/index.mdx similarity index 100% rename from content/reference/api/cosmos/tx/index.mdx rename to content/cosmwasm/api/cosmos/tx/index.mdx diff --git a/content/reference/api/cosmos/tx/simulate.mdx b/content/cosmwasm/api/cosmos/tx/simulate.mdx similarity index 100% rename from content/reference/api/cosmos/tx/simulate.mdx rename to content/cosmwasm/api/cosmos/tx/simulate.mdx diff --git a/content/reference/api/cosmos/tx/txs.mdx b/content/cosmwasm/api/cosmos/tx/txs.mdx similarity index 100% rename from content/reference/api/cosmos/tx/txs.mdx rename to content/cosmwasm/api/cosmos/tx/txs.mdx diff --git a/content/reference/api/cosmos/upgrade/_meta.js b/content/cosmwasm/api/cosmos/upgrade/_meta.js similarity index 100% rename from content/reference/api/cosmos/upgrade/_meta.js rename to content/cosmwasm/api/cosmos/upgrade/_meta.js diff --git a/content/reference/api/cosmos/upgrade/current-plan.mdx b/content/cosmwasm/api/cosmos/upgrade/current-plan.mdx similarity index 100% rename from content/reference/api/cosmos/upgrade/current-plan.mdx rename to content/cosmwasm/api/cosmos/upgrade/current-plan.mdx diff --git a/content/reference/api/cosmos/upgrade/index.mdx b/content/cosmwasm/api/cosmos/upgrade/index.mdx similarity index 100% rename from content/reference/api/cosmos/upgrade/index.mdx rename to content/cosmwasm/api/cosmos/upgrade/index.mdx diff --git a/content/reference/api/cosmos/upgrade/last-height.mdx b/content/cosmwasm/api/cosmos/upgrade/last-height.mdx similarity index 100% rename from content/reference/api/cosmos/upgrade/last-height.mdx rename to content/cosmwasm/api/cosmos/upgrade/last-height.mdx diff --git a/content/reference/api/cosmos/upgrade/module-versions.mdx b/content/cosmwasm/api/cosmos/upgrade/module-versions.mdx similarity index 100% rename from content/reference/api/cosmos/upgrade/module-versions.mdx rename to content/cosmwasm/api/cosmos/upgrade/module-versions.mdx diff --git a/content/reference/api/cosmos/upgrade/name.mdx b/content/cosmwasm/api/cosmos/upgrade/name.mdx similarity index 100% rename from content/reference/api/cosmos/upgrade/name.mdx rename to content/cosmwasm/api/cosmos/upgrade/name.mdx diff --git a/content/reference/api/cosmwasm/_meta.js b/content/cosmwasm/api/cosmwasm/_meta.js similarity index 100% rename from content/reference/api/cosmwasm/_meta.js rename to content/cosmwasm/api/cosmwasm/_meta.js diff --git a/content/cosmwasm/api/cosmwasm/index.mdx b/content/cosmwasm/api/cosmwasm/index.mdx new file mode 100644 index 00000000..78cf3ae0 --- /dev/null +++ b/content/cosmwasm/api/cosmwasm/index.mdx @@ -0,0 +1,13 @@ +# Cosmwasm API + +This section covers the Cosmwasm related endpoints. Choose a category to continue. + +## Categories + + diff --git a/content/reference/api/cosmwasm/wasm/_meta.js b/content/cosmwasm/api/cosmwasm/wasm/_meta.js similarity index 100% rename from content/reference/api/cosmwasm/wasm/_meta.js rename to content/cosmwasm/api/cosmwasm/wasm/_meta.js diff --git a/content/reference/api/cosmwasm/wasm/address.mdx b/content/cosmwasm/api/cosmwasm/wasm/address.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/address.mdx rename to content/cosmwasm/api/cosmwasm/wasm/address.mdx diff --git a/content/reference/api/cosmwasm/wasm/code-id.mdx b/content/cosmwasm/api/cosmwasm/wasm/code-id.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/code-id.mdx rename to content/cosmwasm/api/cosmwasm/wasm/code-id.mdx diff --git a/content/reference/api/cosmwasm/wasm/code.mdx b/content/cosmwasm/api/cosmwasm/wasm/code.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/code.mdx rename to content/cosmwasm/api/cosmwasm/wasm/code.mdx diff --git a/content/reference/api/cosmwasm/wasm/contracts.mdx b/content/cosmwasm/api/cosmwasm/wasm/contracts.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/contracts.mdx rename to content/cosmwasm/api/cosmwasm/wasm/contracts.mdx diff --git a/content/reference/api/cosmwasm/wasm/history.mdx b/content/cosmwasm/api/cosmwasm/wasm/history.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/history.mdx rename to content/cosmwasm/api/cosmwasm/wasm/history.mdx diff --git a/content/reference/api/cosmwasm/wasm/index.mdx b/content/cosmwasm/api/cosmwasm/wasm/index.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/index.mdx rename to content/cosmwasm/api/cosmwasm/wasm/index.mdx diff --git a/content/reference/api/cosmwasm/wasm/pinned.mdx b/content/cosmwasm/api/cosmwasm/wasm/pinned.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/pinned.mdx rename to content/cosmwasm/api/cosmwasm/wasm/pinned.mdx diff --git a/content/reference/api/cosmwasm/wasm/query-data.mdx b/content/cosmwasm/api/cosmwasm/wasm/query-data.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/query-data.mdx rename to content/cosmwasm/api/cosmwasm/wasm/query-data.mdx diff --git a/content/reference/api/cosmwasm/wasm/state.mdx b/content/cosmwasm/api/cosmwasm/wasm/state.mdx similarity index 100% rename from content/reference/api/cosmwasm/wasm/state.mdx rename to content/cosmwasm/api/cosmwasm/wasm/state.mdx diff --git a/content/reference/api/ibc/_meta.js b/content/cosmwasm/api/ibc/_meta.js similarity index 100% rename from content/reference/api/ibc/_meta.js rename to content/cosmwasm/api/ibc/_meta.js diff --git a/content/reference/api/ibc/apps/_meta.js b/content/cosmwasm/api/ibc/apps/_meta.js similarity index 100% rename from content/reference/api/ibc/apps/_meta.js rename to content/cosmwasm/api/ibc/apps/_meta.js diff --git a/content/reference/api/ibc/apps/denom-traces.mdx b/content/cosmwasm/api/ibc/apps/denom-traces.mdx similarity index 100% rename from content/reference/api/ibc/apps/denom-traces.mdx rename to content/cosmwasm/api/ibc/apps/denom-traces.mdx diff --git a/content/reference/api/ibc/apps/escrow-address.mdx b/content/cosmwasm/api/ibc/apps/escrow-address.mdx similarity index 100% rename from content/reference/api/ibc/apps/escrow-address.mdx rename to content/cosmwasm/api/ibc/apps/escrow-address.mdx diff --git a/content/reference/api/ibc/apps/hash.mdx b/content/cosmwasm/api/ibc/apps/hash.mdx similarity index 100% rename from content/reference/api/ibc/apps/hash.mdx rename to content/cosmwasm/api/ibc/apps/hash.mdx diff --git a/content/reference/api/ibc/apps/index.mdx b/content/cosmwasm/api/ibc/apps/index.mdx similarity index 100% rename from content/reference/api/ibc/apps/index.mdx rename to content/cosmwasm/api/ibc/apps/index.mdx diff --git a/content/reference/api/ibc/apps/params.mdx b/content/cosmwasm/api/ibc/apps/params.mdx similarity index 100% rename from content/reference/api/ibc/apps/params.mdx rename to content/cosmwasm/api/ibc/apps/params.mdx diff --git a/content/reference/api/ibc/apps/trace.mdx b/content/cosmwasm/api/ibc/apps/trace.mdx similarity index 100% rename from content/reference/api/ibc/apps/trace.mdx rename to content/cosmwasm/api/ibc/apps/trace.mdx diff --git a/content/reference/api/ibc/client/_meta.js b/content/cosmwasm/api/ibc/client/_meta.js similarity index 100% rename from content/reference/api/ibc/client/_meta.js rename to content/cosmwasm/api/ibc/client/_meta.js diff --git a/content/reference/api/ibc/client/index.mdx b/content/cosmwasm/api/ibc/client/index.mdx similarity index 100% rename from content/reference/api/ibc/client/index.mdx rename to content/cosmwasm/api/ibc/client/index.mdx diff --git a/content/reference/api/ibc/client/params.mdx b/content/cosmwasm/api/ibc/client/params.mdx similarity index 100% rename from content/reference/api/ibc/client/params.mdx rename to content/cosmwasm/api/ibc/client/params.mdx diff --git a/content/reference/api/ibc/core/_meta.js b/content/cosmwasm/api/ibc/core/_meta.js similarity index 100% rename from content/reference/api/ibc/core/_meta.js rename to content/cosmwasm/api/ibc/core/_meta.js diff --git a/content/reference/api/ibc/core/channels.mdx b/content/cosmwasm/api/ibc/core/channels.mdx similarity index 100% rename from content/reference/api/ibc/core/channels.mdx rename to content/cosmwasm/api/ibc/core/channels.mdx diff --git a/content/reference/api/ibc/core/client-id.mdx b/content/cosmwasm/api/ibc/core/client-id.mdx similarity index 100% rename from content/reference/api/ibc/core/client-id.mdx rename to content/cosmwasm/api/ibc/core/client-id.mdx diff --git a/content/reference/api/ibc/core/client-state.mdx b/content/cosmwasm/api/ibc/core/client-state.mdx similarity index 100% rename from content/reference/api/ibc/core/client-state.mdx rename to content/cosmwasm/api/ibc/core/client-state.mdx diff --git a/content/reference/api/ibc/core/client-states.mdx b/content/cosmwasm/api/ibc/core/client-states.mdx similarity index 100% rename from content/reference/api/ibc/core/client-states.mdx rename to content/cosmwasm/api/ibc/core/client-states.mdx diff --git a/content/reference/api/ibc/core/connection-id.mdx b/content/cosmwasm/api/ibc/core/connection-id.mdx similarity index 100% rename from content/reference/api/ibc/core/connection-id.mdx rename to content/cosmwasm/api/ibc/core/connection-id.mdx diff --git a/content/reference/api/ibc/core/connections.mdx b/content/cosmwasm/api/ibc/core/connections.mdx similarity index 100% rename from content/reference/api/ibc/core/connections.mdx rename to content/cosmwasm/api/ibc/core/connections.mdx diff --git a/content/reference/api/ibc/core/heights.mdx b/content/cosmwasm/api/ibc/core/heights.mdx similarity index 100% rename from content/reference/api/ibc/core/heights.mdx rename to content/cosmwasm/api/ibc/core/heights.mdx diff --git a/content/reference/api/ibc/core/index.mdx b/content/cosmwasm/api/ibc/core/index.mdx similarity index 100% rename from content/reference/api/ibc/core/index.mdx rename to content/cosmwasm/api/ibc/core/index.mdx diff --git a/content/reference/api/ibc/core/next-sequence.mdx b/content/cosmwasm/api/ibc/core/next-sequence.mdx similarity index 100% rename from content/reference/api/ibc/core/next-sequence.mdx rename to content/cosmwasm/api/ibc/core/next-sequence.mdx diff --git a/content/reference/api/ibc/core/packet-acknowledgements.mdx b/content/cosmwasm/api/ibc/core/packet-acknowledgements.mdx similarity index 100% rename from content/reference/api/ibc/core/packet-acknowledgements.mdx rename to content/cosmwasm/api/ibc/core/packet-acknowledgements.mdx diff --git a/content/reference/api/ibc/core/packet-commitments.mdx b/content/cosmwasm/api/ibc/core/packet-commitments.mdx similarity index 100% rename from content/reference/api/ibc/core/packet-commitments.mdx rename to content/cosmwasm/api/ibc/core/packet-commitments.mdx diff --git a/content/reference/api/ibc/core/port-id.mdx b/content/cosmwasm/api/ibc/core/port-id.mdx similarity index 100% rename from content/reference/api/ibc/core/port-id.mdx rename to content/cosmwasm/api/ibc/core/port-id.mdx diff --git a/content/reference/api/ibc/core/revision-height.mdx b/content/cosmwasm/api/ibc/core/revision-height.mdx similarity index 100% rename from content/reference/api/ibc/core/revision-height.mdx rename to content/cosmwasm/api/ibc/core/revision-height.mdx diff --git a/content/reference/api/ibc/core/sequence.mdx b/content/cosmwasm/api/ibc/core/sequence.mdx similarity index 100% rename from content/reference/api/ibc/core/sequence.mdx rename to content/cosmwasm/api/ibc/core/sequence.mdx diff --git a/content/reference/api/ibc/core/unreceived-acks.mdx b/content/cosmwasm/api/ibc/core/unreceived-acks.mdx similarity index 100% rename from content/reference/api/ibc/core/unreceived-acks.mdx rename to content/cosmwasm/api/ibc/core/unreceived-acks.mdx diff --git a/content/reference/api/ibc/core/unreceived-packets.mdx b/content/cosmwasm/api/ibc/core/unreceived-packets.mdx similarity index 100% rename from content/reference/api/ibc/core/unreceived-packets.mdx rename to content/cosmwasm/api/ibc/core/unreceived-packets.mdx diff --git a/content/reference/api/ibc/core/upgraded-client-states.mdx b/content/cosmwasm/api/ibc/core/upgraded-client-states.mdx similarity index 100% rename from content/reference/api/ibc/core/upgraded-client-states.mdx rename to content/cosmwasm/api/ibc/core/upgraded-client-states.mdx diff --git a/content/reference/api/ibc/core/upgraded-consensus-states.mdx b/content/cosmwasm/api/ibc/core/upgraded-consensus-states.mdx similarity index 100% rename from content/reference/api/ibc/core/upgraded-consensus-states.mdx rename to content/cosmwasm/api/ibc/core/upgraded-consensus-states.mdx diff --git a/content/cosmwasm/api/ibc/index.mdx b/content/cosmwasm/api/ibc/index.mdx new file mode 100644 index 00000000..72c760f9 --- /dev/null +++ b/content/cosmwasm/api/ibc/index.mdx @@ -0,0 +1,23 @@ +# Ibc API + +This section covers the Ibc related endpoints. Choose a category to continue. + +## Categories + + diff --git a/content/reference/api/index.mdx b/content/cosmwasm/api/index.mdx similarity index 100% rename from content/reference/api/index.mdx rename to content/cosmwasm/api/index.mdx diff --git a/content/reference/api/sei-protocol/_meta.js b/content/cosmwasm/api/sei-protocol/_meta.js similarity index 100% rename from content/reference/api/sei-protocol/_meta.js rename to content/cosmwasm/api/sei-protocol/_meta.js diff --git a/content/cosmwasm/api/sei-protocol/index.mdx b/content/cosmwasm/api/sei-protocol/index.mdx new file mode 100644 index 00000000..be624e85 --- /dev/null +++ b/content/cosmwasm/api/sei-protocol/index.mdx @@ -0,0 +1,18 @@ +# Sei-protocol API + +This section covers the Sei-protocol related endpoints. Choose a category to continue. + +## Categories + + diff --git a/content/reference/api/sei-protocol/sei-chain/_meta.js b/content/cosmwasm/api/sei-protocol/sei-chain/_meta.js similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/_meta.js rename to content/cosmwasm/api/sei-protocol/sei-chain/_meta.js diff --git a/content/reference/api/sei-protocol/sei-chain/actives.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/actives.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/actives.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/actives.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/exchange-rate.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/exchange-rate.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/exchange-rate.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/exchange-rate.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/exchange-rates.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/exchange-rates.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/exchange-rates.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/exchange-rates.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/feeder.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/feeder.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/feeder.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/feeder.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/index.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/index.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/index.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/index.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/lookback-seconds.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/lookback-seconds.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/lookback-seconds.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/lookback-seconds.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/params.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/params.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/params.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/params.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/price-snapshot-history.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/price-snapshot-history.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/price-snapshot-history.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/price-snapshot-history.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/slash-window.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/slash-window.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/slash-window.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/slash-window.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/vote-penalty-counter.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/vote-penalty-counter.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/vote-penalty-counter.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/vote-penalty-counter.mdx diff --git a/content/reference/api/sei-protocol/sei-chain/vote-targets.mdx b/content/cosmwasm/api/sei-protocol/sei-chain/vote-targets.mdx similarity index 100% rename from content/reference/api/sei-protocol/sei-chain/vote-targets.mdx rename to content/cosmwasm/api/sei-protocol/sei-chain/vote-targets.mdx diff --git a/content/reference/api/sei-protocol/seichain/_meta.js b/content/cosmwasm/api/sei-protocol/seichain/_meta.js similarity index 100% rename from content/reference/api/sei-protocol/seichain/_meta.js rename to content/cosmwasm/api/sei-protocol/seichain/_meta.js diff --git a/content/reference/api/sei-protocol/seichain/account.mdx b/content/cosmwasm/api/sei-protocol/seichain/account.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/account.mdx rename to content/cosmwasm/api/sei-protocol/seichain/account.mdx diff --git a/content/reference/api/sei-protocol/seichain/asset-list.mdx b/content/cosmwasm/api/sei-protocol/seichain/asset-list.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/asset-list.mdx rename to content/cosmwasm/api/sei-protocol/seichain/asset-list.mdx diff --git a/content/reference/api/sei-protocol/seichain/assetDenom.mdx b/content/cosmwasm/api/sei-protocol/seichain/assetDenom.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/assetDenom.mdx rename to content/cosmwasm/api/sei-protocol/seichain/assetDenom.mdx diff --git a/content/reference/api/sei-protocol/seichain/authority-metadata.mdx b/content/cosmwasm/api/sei-protocol/seichain/authority-metadata.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/authority-metadata.mdx rename to content/cosmwasm/api/sei-protocol/seichain/authority-metadata.mdx diff --git a/content/reference/api/sei-protocol/seichain/contractAddr.mdx b/content/cosmwasm/api/sei-protocol/seichain/contractAddr.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/contractAddr.mdx rename to content/cosmwasm/api/sei-protocol/seichain/contractAddr.mdx diff --git a/content/reference/api/sei-protocol/seichain/creator.mdx b/content/cosmwasm/api/sei-protocol/seichain/creator.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/creator.mdx rename to content/cosmwasm/api/sei-protocol/seichain/creator.mdx diff --git a/content/reference/api/sei-protocol/seichain/denom.mdx b/content/cosmwasm/api/sei-protocol/seichain/denom.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/denom.mdx rename to content/cosmwasm/api/sei-protocol/seichain/denom.mdx diff --git a/content/reference/api/sei-protocol/seichain/epoch.mdx b/content/cosmwasm/api/sei-protocol/seichain/epoch.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/epoch.mdx rename to content/cosmwasm/api/sei-protocol/seichain/epoch.mdx diff --git a/content/reference/api/sei-protocol/seichain/evm-address.mdx b/content/cosmwasm/api/sei-protocol/seichain/evm-address.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/evm-address.mdx rename to content/cosmwasm/api/sei-protocol/seichain/evm-address.mdx diff --git a/content/reference/api/sei-protocol/seichain/id.mdx b/content/cosmwasm/api/sei-protocol/seichain/id.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/id.mdx rename to content/cosmwasm/api/sei-protocol/seichain/id.mdx diff --git a/content/reference/api/sei-protocol/seichain/index.mdx b/content/cosmwasm/api/sei-protocol/seichain/index.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/index.mdx rename to content/cosmwasm/api/sei-protocol/seichain/index.mdx diff --git a/content/reference/api/sei-protocol/seichain/lookbackInSeconds.mdx b/content/cosmwasm/api/sei-protocol/seichain/lookbackInSeconds.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/lookbackInSeconds.mdx rename to content/cosmwasm/api/sei-protocol/seichain/lookbackInSeconds.mdx diff --git a/content/reference/api/sei-protocol/seichain/lookbackSeconds.mdx b/content/cosmwasm/api/sei-protocol/seichain/lookbackSeconds.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/lookbackSeconds.mdx rename to content/cosmwasm/api/sei-protocol/seichain/lookbackSeconds.mdx diff --git a/content/reference/api/sei-protocol/seichain/metadata.mdx b/content/cosmwasm/api/sei-protocol/seichain/metadata.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/metadata.mdx rename to content/cosmwasm/api/sei-protocol/seichain/metadata.mdx diff --git a/content/reference/api/sei-protocol/seichain/numOfPeriods.mdx b/content/cosmwasm/api/sei-protocol/seichain/numOfPeriods.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/numOfPeriods.mdx rename to content/cosmwasm/api/sei-protocol/seichain/numOfPeriods.mdx diff --git a/content/reference/api/sei-protocol/seichain/params.mdx b/content/cosmwasm/api/sei-protocol/seichain/params.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/params.mdx rename to content/cosmwasm/api/sei-protocol/seichain/params.mdx diff --git a/content/reference/api/sei-protocol/seichain/pointer-version.mdx b/content/cosmwasm/api/sei-protocol/seichain/pointer-version.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/pointer-version.mdx rename to content/cosmwasm/api/sei-protocol/seichain/pointer-version.mdx diff --git a/content/reference/api/sei-protocol/seichain/pointer.mdx b/content/cosmwasm/api/sei-protocol/seichain/pointer.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/pointer.mdx rename to content/cosmwasm/api/sei-protocol/seichain/pointer.mdx diff --git a/content/reference/api/sei-protocol/seichain/price.mdx b/content/cosmwasm/api/sei-protocol/seichain/price.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/price.mdx rename to content/cosmwasm/api/sei-protocol/seichain/price.mdx diff --git a/content/reference/api/sei-protocol/seichain/registered-pairs.mdx b/content/cosmwasm/api/sei-protocol/seichain/registered-pairs.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/registered-pairs.mdx rename to content/cosmwasm/api/sei-protocol/seichain/registered-pairs.mdx diff --git a/content/reference/api/sei-protocol/seichain/sei-address.mdx b/content/cosmwasm/api/sei-protocol/seichain/sei-address.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/sei-address.mdx rename to content/cosmwasm/api/sei-protocol/seichain/sei-address.mdx diff --git a/content/reference/api/sei-protocol/seichain/static-call.mdx b/content/cosmwasm/api/sei-protocol/seichain/static-call.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/static-call.mdx rename to content/cosmwasm/api/sei-protocol/seichain/static-call.mdx diff --git a/content/reference/api/sei-protocol/seichain/timestamp.mdx b/content/cosmwasm/api/sei-protocol/seichain/timestamp.mdx similarity index 100% rename from content/reference/api/sei-protocol/seichain/timestamp.mdx rename to content/cosmwasm/api/sei-protocol/seichain/timestamp.mdx diff --git a/content/reference/api/seichain/_meta.js b/content/cosmwasm/api/seichain/_meta.js similarity index 100% rename from content/reference/api/seichain/_meta.js rename to content/cosmwasm/api/seichain/_meta.js diff --git a/content/cosmwasm/api/seichain/index.mdx b/content/cosmwasm/api/seichain/index.mdx new file mode 100644 index 00000000..fd45950f --- /dev/null +++ b/content/cosmwasm/api/seichain/index.mdx @@ -0,0 +1,13 @@ +# Seichain API + +This section covers the Seichain related endpoints. Choose a category to continue. + +## Categories + + diff --git a/content/reference/api/seichain/mint/_meta.js b/content/cosmwasm/api/seichain/mint/_meta.js similarity index 100% rename from content/reference/api/seichain/mint/_meta.js rename to content/cosmwasm/api/seichain/mint/_meta.js diff --git a/content/reference/api/seichain/mint/index.mdx b/content/cosmwasm/api/seichain/mint/index.mdx similarity index 100% rename from content/reference/api/seichain/mint/index.mdx rename to content/cosmwasm/api/seichain/mint/index.mdx diff --git a/content/reference/api/seichain/mint/minter.mdx b/content/cosmwasm/api/seichain/mint/minter.mdx similarity index 100% rename from content/reference/api/seichain/mint/minter.mdx rename to content/cosmwasm/api/seichain/mint/minter.mdx diff --git a/content/reference/api/seichain/mint/params.mdx b/content/cosmwasm/api/seichain/mint/params.mdx similarity index 100% rename from content/reference/api/seichain/mint/params.mdx rename to content/cosmwasm/api/seichain/mint/params.mdx diff --git a/content/reference/_meta.js b/content/reference/_meta.js deleted file mode 100644 index e8832c19..00000000 --- a/content/reference/_meta.js +++ /dev/null @@ -1,14 +0,0 @@ -export default { - index: { - title: 'Home' - }, - '-- API Reference': { - type: 'separator', - title: 'API Reference' - }, - api: 'Cosmos', - '-- Interoperability': { - type: 'separator', - title: 'Interoperability' - } -}; diff --git a/content/reference/api/cosmos/index.mdx b/content/reference/api/cosmos/index.mdx deleted file mode 100644 index 38b6e1b4..00000000 --- a/content/reference/api/cosmos/index.mdx +++ /dev/null @@ -1,73 +0,0 @@ -# Cosmos API - -This section covers the Cosmos related endpoints. Choose a category to continue. - -## Categories - - diff --git a/content/reference/api/cosmwasm/index.mdx b/content/reference/api/cosmwasm/index.mdx deleted file mode 100644 index b375218a..00000000 --- a/content/reference/api/cosmwasm/index.mdx +++ /dev/null @@ -1,13 +0,0 @@ -# Cosmwasm API - -This section covers the Cosmwasm related endpoints. Choose a category to continue. - -## Categories - - diff --git a/content/reference/api/ibc/index.mdx b/content/reference/api/ibc/index.mdx deleted file mode 100644 index 235e57ab..00000000 --- a/content/reference/api/ibc/index.mdx +++ /dev/null @@ -1,23 +0,0 @@ -# Ibc API - -This section covers the Ibc related endpoints. Choose a category to continue. - -## Categories - - diff --git a/content/reference/api/sei-protocol/index.mdx b/content/reference/api/sei-protocol/index.mdx deleted file mode 100644 index d97a8aa9..00000000 --- a/content/reference/api/sei-protocol/index.mdx +++ /dev/null @@ -1,18 +0,0 @@ -# Sei-protocol API - -This section covers the Sei-protocol related endpoints. Choose a category to continue. - -## Categories - - diff --git a/content/reference/api/seichain/index.mdx b/content/reference/api/seichain/index.mdx deleted file mode 100644 index 347ea58c..00000000 --- a/content/reference/api/seichain/index.mdx +++ /dev/null @@ -1,13 +0,0 @@ -# Seichain API - -This section covers the Seichain related endpoints. Choose a category to continue. - -## Categories - - diff --git a/content/reference/index.mdx b/content/reference/index.mdx deleted file mode 100644 index a87bee98..00000000 --- a/content/reference/index.mdx +++ /dev/null @@ -1,54 +0,0 @@ -import React from 'react'; -import { IconWorld, IconBrackets, IconPointer } from '@tabler/icons-react'; -import { LinkCard } from '../../src/components/LinkCard'; - -# Reference - -Explore Sei’s core reference materials, endpoints, commands, and more. - -
- } - title="EVM RPC API" - link="/reference/evm" - description="Ethereum compatibility details" - preview={{ - content: 'An overview of Sei’s EVM layer and cross-chain capabilities.', - highlights: ['Smart contract deployment', 'Op-code support', 'Integration best practices'] - }} - /> - - } - title="Pointer Contracts" - link="/reference/pointer-contracts" - description="Documentation on pointer-based contracts" - preview={{ - content: 'How pointer contracts link on-chain logic to off-chain data sources in Sei.', - highlights: ['Data feed integration', 'Contract patterns', 'Security considerations'] - }} - /> - - } - title="EVM Precompiles" - link="/reference/precompiles/example-usage" - description="Interact with native Sei modules from the EVM" - preview={{ - content: 'Available Precompile Contracts:', - highlights: ['Bank', "IBC", 'Staking', 'Governance', 'Oracle', 'CosmWasm', "Pointer", 'Pointerview', 'JSON', 'Addr', "Distribution"] - }} - /> - - } - title="Cosmos REST API" - link="/reference/api" - description="Cosmos-specific references" - preview={{ - content: 'Explore how Sei leverages Cosmos-SDK modules and IBC features.', - highlights: ['Governance modules', 'IBC integration', 'Custom modules and extensions'] - }} - /> - -
diff --git a/src/components/APIModulePaths/APIModulePaths.tsx b/src/components/APIModulePaths/APIModulePaths.tsx index 9f244790..2e835603 100644 --- a/src/components/APIModulePaths/APIModulePaths.tsx +++ b/src/components/APIModulePaths/APIModulePaths.tsx @@ -4,7 +4,7 @@ export const APIModulePaths = ({ basePaths, prefix }: { basePaths: any[]; prefix return ( {Object.values(basePaths).map((path) => { - return ; + return ; })} ); From bf5516e42f2a3ae3b83b6a68cd7af38e92b391b1 Mon Sep 17 00:00:00 2001 From: Carson <104383295+codebycarson@users.noreply.github.com> Date: Mon, 17 Mar 2025 09:50:17 -0700 Subject: [PATCH 10/10] Hide Sei Account Hide for now --- content/evm/_meta.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/evm/_meta.js b/content/evm/_meta.js index c16ff1bd..936473c9 100644 --- a/content/evm/_meta.js +++ b/content/evm/_meta.js @@ -13,7 +13,10 @@ export default { title: 'Frontend Development' }, 'building-a-frontend': 'Building a Frontend', - 'sei-account': 'Sei Account', + 'sei-account': { + title: 'Sei Account', + display: 'hidden' + }, '-- Smart Contracts': { type: 'separator',