### Install Dependencies Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/example-usage.mdx Install the required ethers.js library and the Sei EVM package to enable interaction with precompiled contracts. ```bash npm install ethers @sei-js/evm ``` -------------------------------- ### Setup Provider and Signer Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/example-usage.mdx Initialize a provider and signer for either browser-based environments like MetaMask or Node.js environments using a private key. ```typescript import { ethers } from 'ethers'; // Browser environment with MetaMask const provider = new ethers.BrowserProvider(window.ethereum); await provider.send('eth_requestAccounts', []); const signer = await provider.getSigner(); // Or Node.js environment const provider = new ethers.JsonRpcProvider('https://evm-rpc-testnet.sei-apis.com'); const signer = new ethers.Wallet('YOUR_PRIVATE_KEY', provider); ``` -------------------------------- ### Development Environment Setup: Node.js and Hardhat Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/migrate-from-solana.mdx Provides bash commands to install Node.js and Hardhat, a recommended tool for developers transitioning from Solana. It includes instructions for installing Node.js and then the Hardhat package using npm. ```bash # Install Node.js (if not already installed) # https://nodejs.org/ # Install Hardhat (recommended for Solana devs transitioning) npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox ``` -------------------------------- ### Execute Integration Demo Script Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/oracles/pyth-network.mdx A standalone usage example showing how to import the integration module and execute the demonstration function within a Node.js environment. ```javascript import { demonstrateSeiPriceIntegration } from './SeiPythIntegration.js'; process.env.PRIVATE_KEY = 'your_private_key_here'; process.env.CONTRACT_ADDRESS = 'your_deployed_contract_address'; demonstrateSeiPriceIntegration() .then(() => console.log('Integration demo completed successfully!')) .catch((error) => console.error('Demo failed:', error)); ``` -------------------------------- ### Install API3 and OpenZeppelin Contracts Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/oracles/api3.mdx Installs the necessary API3 and OpenZeppelin Contracts libraries for smart contract development. Supports npm, yarn, and pnpm package managers. ```bash # npm npm install @openzeppelin/contracts @api3/contracts # yarn yarn add @openzeppelin/contracts @api3/contracts # pnpm pnpm add @openzeppelin/contracts @api3/contracts ``` -------------------------------- ### Initialize Cambrian Agent Kit Project Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/ai-tooling/cambrian-agent-kit.mdx Commands to clone the repository, install dependencies, and configure environment variables for the Cambrian Agent Kit. This setup is required to authenticate with OpenAI and the SEI blockchain. ```bash git clone https://github.com/CambrianAgents/sei-agent-kit.git cd sei-agent-kit cp .env.example .env npm install ``` ```env OPENAI_API_KEY=your_openai_api_key SEI_PRIVATE_KEY=your_wallet_private_key RPC_URL=https://evm-rpc.sei-apis.com ``` -------------------------------- ### Check Go Installation (Bash) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/node/index.mdx Verifies if Go is installed on the system and displays its version. This is a preliminary step before installing a specific Go version. ```bash # Check for existing Go installation go version ``` -------------------------------- ### Example: Delegate Tokens using Ledger Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/sei-js/ledger.mdx A complete example demonstrating how to delegate tokens on the Sei network using a Ledger device. It connects to the RPC, gets addresses, creates a signer, and broadcasts a delegation transaction. ```typescript import { coins, SigningStargateClient, StdFee } from '@cosmjs/stargate'; import { createTransportAndApp, getAddresses, SeiLedgerOfflineAminoSigner } from '@sei-js/ledger'; async function delegateWithLedger() { const rpcUrl = 'https://rpc-testnet.sei-apis.com/'; const path = "m/44'/60'/0'/0/0"; const { app } = await createTransportAndApp(); const { nativeAddress } = await getAddresses(app, path); const ledgerSigner = new SeiLedgerOfflineAminoSigner(app, path); const client = await SigningStargateClient.connectWithSigner(rpcUrl, ledgerSigner); const msgDelegate = { typeUrl: '/cosmos.staking.v1beta1.MsgDelegate', value: { delegatorAddress: nativeAddress.address, validatorAddress: 'seivaloper1...', amount: coins(500, 'usei') } }; const fee: StdFee = { amount: [{ denom: 'usei', amount: '20000' }], gas: '200000' }; const result = await client.signAndBroadcast(nativeAddress.address, [msgDelegate], fee, 'Delegation via Ledger'); console.log('Broadcast result:', result); } delegateWithLedger(); ``` -------------------------------- ### Run JavaScript EVM Precompile Example Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/example-usage.mdx This command shows how to execute the JavaScript example for interacting with Sei EVM precompiles. It requires you to set the PRIVATE_KEY environment variable with your actual private key before running the script. ```bash PRIVATE_KEY=your_key node multi-precompile-demo.js ``` -------------------------------- ### Install Dependencies for Ledger EVM Integration Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/ledger-ethers.mdx Installs the necessary Ethers.js libraries and Ledger hardware transport packages required to facilitate communication between a Node.js environment and a Ledger device. ```bash npm install ethers @ethers-ext/signer-ledger @ledgerhq/hw-transport-node-hid ``` -------------------------------- ### Install Pyth Network SDKs Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/oracles/pyth-network.mdx Commands to install the required Pyth EVM JavaScript and Solidity SDKs using popular package managers. These dependencies are essential for interacting with Pyth price feeds in a Sei EVM environment. ```bash # npm npm install @pythnetwork/pyth-evm-js @pythnetwork/pyth-sdk-solidity # yarn yarn add @pythnetwork/pyth-evm-js @pythnetwork/pyth-sdk-solidity # pnpm pnpm add @pythnetwork/pyth-evm-js @pythnetwork/pyth-sdk-solidity ``` -------------------------------- ### Interact with Sei EVM Precompiles using JavaScript Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/example-usage.mdx This example demonstrates how to initialize and interact with multiple Sei EVM precompiles, such as Staking and Governance, using ethers.js. It requires setting up the provider, wallet, and then calling specific precompile functions like checking delegations and voting on proposals. Ensure you have the necessary environment variables and dependencies installed. ```javascript // multi-precompile-demo.js const { ethers } = require('ethers'); const { STAKING_PRECOMPILE_ABI, STAKING_PRECOMPILE_ADDRESS, GOVERNANCE_PRECOMPILE_ABI, GOVERNANCE_PRECOMPILE_ADDRESS } = require('@sei-js/evm'); async function main() { // Setup const provider = new ethers.JsonRpcProvider('https://evm-rpc.sei-apis.com'); const wallet = new ethers.Wallet(process.env.PRIVATE_KEY, provider); // Initialize precompiles const staking = new ethers.Contract(STAKING_PRECOMPILE_ADDRESS, STAKING_PRECOMPILE_ABI, wallet); const governance = new ethers.Contract(GOVERNANCE_PRECOMPILE_ADDRESS, GOVERNANCE_PRECOMPILE_ABI, wallet); // Check delegation const delegation = await staking.delegation(wallet.address, 'seivaloper1...'); console.log('Current delegation:', delegation.balance.amount.toString()); // Vote on a proposal const tx = await governance.vote(1, 1); await tx.wait(); console.log('Vote cast successfully'); } main().catch(console.error); ``` -------------------------------- ### Development Environment Setup: Foundry Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/migrate-from-solana.mdx Offers bash commands to install Foundry, a Rust-based development toolkit that may be more familiar to developers with a Rust background. It uses a curl command to download the installer and then runs foundryup to install/update. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup ``` -------------------------------- ### Solidity: Complete Contract Example Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/cosmwasm-precompiles/bank.mdx This Solidity code snippet provides a starting point for a complete smart contract example on the Sei blockchain. It includes the SPDX license identifier and is intended to be expanded with specific contract logic for Sei-based applications. ```solidity // SPDX-License-Identifier: MIT ``` -------------------------------- ### Install Hardhat and Verification Plugin Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-verify-contracts.mdx Commands to initialize a Hardhat project and install the necessary verification plugin for Sei network compatibility. ```bash npm install --save-dev hardhat yarn add --dev hardhat npm install -D @nomicfoundation/hardhat-verify yarn add -D @nomicfoundation/hardhat-verify ``` -------------------------------- ### Preview Production Build Locally (Bash) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/building-a-frontend.mdx This command starts a local server to preview the production build of the application using npm. It allows developers to test the optimized and bundled application before deploying it. The server typically runs on a different port than the development server, such as `http://localhost:4173`. This is useful for final checks. ```bash npm run preview ``` -------------------------------- ### Install and Initialize Foundry Project Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-foundry.mdx Installs Foundry using a curl command and then initializes a new Foundry project. It also sets up a git repository, which is necessary for installing dependencies. ```bash curl -L https://foundry.paradigm.xyz | bash foundryup # Create a new directory for your project mkdir sei-foundry-project cd sei-foundry-project # Initialize a new Foundry project forge init --no-git # Initialize git repository (required for installing dependencies) git init ``` -------------------------------- ### Hardhat Smart Contract Deployment Setup Source: https://context7.com/sei-protocol/sei-docs/llms.txt Configures Hardhat for Sei network deployment and provides an example ERC20 token contract. Requires OpenZeppelin contracts and environment variables for private key management. ```typescript import { HardhatUserConfig } from 'hardhat/config'; import '@nomicfoundation/hardhat-toolbox'; import 'dotenv/config'; const PRIVATE_KEY = process.env.PRIVATE_KEY || '0x0000000000000000000000000000000000000000000000000000000000000000'; const config: HardhatUserConfig = { solidity: { version: '0.8.28', settings: { optimizer: { enabled: true, runs: 200 } } }, networks: { seitestnet: { url: 'https://evm-rpc-testnet.sei-apis.com', accounts: [PRIVATE_KEY], chainId: 1328 }, seimainnet: { url: 'https://evm-rpc.sei-apis.com', accounts: [PRIVATE_KEY], chainId: 1329 } } }; export default config; ``` ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.22; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract SeiToken is ERC20, Ownable { constructor(address initialOwner) ERC20("Sei Token", "SEI") Ownable(initialOwner) { _mint(msg.sender, 1000000 * 10 ** decimals()); } function mint(address to, uint256 amount) public onlyOwner { _mint(to, amount); } function burn(uint256 amount) public { _burn(msg.sender, amount); } } ``` -------------------------------- ### Install and Set Up OpenZeppelin Contracts Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-foundry.mdx Installs the OpenZeppelin contracts library using the `forge install` command. It also generates a `remappings.txt` file to ensure proper import paths for the installed contracts. ```bash forge install OpenZeppelin/openzeppelin-contracts forge remappings > remappings.txt ``` -------------------------------- ### Install seid CLI from source Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/installing-seid-cli.mdx Clones the sei-chain repository, checks out a specific version, and compiles the binary using make. ```bash git clone https://github.com/sei-protocol/sei-chain cd sei-chain git checkout [VERSION] make install ``` -------------------------------- ### Install Ethers.js for Sei Integration Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/building-a-frontend.mdx This command installs the ethers.js library, which is essential for interacting with EVM-compatible blockchains like Sei Mainnet. It is a prerequisite for the subsequent code examples. ```bash npm install ethers ``` -------------------------------- ### Install and Configure Tailwind CSS (Bash) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/wallet-integrations/thirdweb-7702.mdx Commands to install Tailwind CSS and its peer dependencies, initialize its configuration file, and update the main CSS file. This setup is crucial for styling the React application. ```bash npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p ``` -------------------------------- ### Install Viem Dependency Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/building-a-frontend.mdx Command to install the Viem library via npm for use in your project. ```bash npm install viem ``` -------------------------------- ### Install Wagmi and Dependencies Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/building-a-frontend.mdx Installs the necessary packages for Wagmi integration, including wagmi, viem, and @tanstack/react-query for state management. ```bash npm install wagmi viem @tanstack/react-query ``` -------------------------------- ### Deployment and Verification Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/migrate-from-solana.mdx Command-line instructions for deploying and verifying smart contracts on Sei EVM using Hardhat and Foundry tools. ```Bash # Hardhat Deployment npx hardhat run scripts/deploy.ts --network seiTestnet # Foundry Deployment forge create --rpc-url https://evm-rpc-testnet.sei-apis.com \ --private-key $PRIVATE_KEY \ src/Counter.sol:Counter # Hardhat Verification npx hardhat verify --network seiTestnet # Foundry Verification forge verify-contract \ --chain-id 1328 \ --verifier blockscout \ --verifier-url https://seitrace.com/atlantic-2/api \ \ src/Counter.sol:Counter ``` -------------------------------- ### Initialize Vite App and Install Dependencies (Bash) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/sei-global-wallet.mdx Commands to create a new Vite React TypeScript project and install necessary dependencies for Web3Auth and Sei Global Wallet integration. ```bash npm create vite@latest my-sei-dapp -- --template react-ts cd my-sei-dapp npm install @web3auth/modal @web3auth/modal/react \ wagmi viem @tanstack/react-query \ @sei-js/sei-global-wallet ``` -------------------------------- ### Run Demo Script Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/vrf/pyth-network-vrf.mdx Command to execute the demonstration script via the Node.js runtime. ```bash node demo.js ``` -------------------------------- ### Set Up Environment Variable for Private Key Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-hardhat.mdx This bash command demonstrates how to create a `.env` file to store your private key. It is crucial to keep this file secure and not commit it to version control to prevent loss of funds. ```bash PRIVATE_KEY=your_private_key_here ``` -------------------------------- ### Set Up Project Directory Structure Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/building-a-frontend.mdx Creates the necessary directory structure and component files for implementing Ethers.js, Viem, and Wagmi interfaces within the project. ```bash cd sei-token-interface mkdir src/components touch src/components/EthersInterface.tsx touch src/components/ViemInterface.tsx touch src/components/WagmiInterface.tsx mkdir src/shared touch src/shared/constants.ts touch src/wagmi.ts ``` -------------------------------- ### Run Development Server Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/sei-global-wallet.mdx Starts the development server for the Sei Protocol project, allowing for live reloading and testing of changes during development. ```bash npm run dev ``` -------------------------------- ### Vyper Smart Contract Example Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-general.mdx An example of an 'Open Auction' smart contract written in Vyper. This contract outlines auction parameters, current state, and functions for bidding. It is designed for security and auditability, with deliberately fewer features than Solidity. ```python # Open Auction # Auction params # Beneficiary receives money from the highest bidder beneficiary: public(address) auctionStart: public(uint256) auctionEnd: public(uint256) # Current state of auction highestBidder: public(address) highestBid: public(uint256) # Set to true at the end, disallows any change ended: public(bool) # Keep track of refunded bids so we can follow the withdraw pattern pendingReturns: public(HashMap[address, uint256]) # Create a simple auction with `_bidding_time` # seconds bidding time on behalf of the # beneficiary address `_beneficiary`. @external def __init__(_beneficiary: address, _bidding_time: uint256): self.beneficiary = _beneficiary self.auctionStart = block.timestamp self.auctionEnd = self.auctionStart + _bidding_time # Bid on the auction with the value sent # together with this transaction. # The value will only be refunded if the ``` -------------------------------- ### Manage Node Service Maintenance Source: https://github.com/sei-protocol/sei-docs/blob/main/content/node/validators.mdx Standard commands to gracefully stop and start the Sei node service during planned maintenance windows. ```bash # Gracefully stop the node sudo systemctl stop seid # Perform maintenance tasks # Restart services sudo systemctl start seid ``` -------------------------------- ### Display seid command help Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/installing-seid-cli.mdx Prints the help menu for the seid CLI, listing all available subcommands and global flags for interacting with the Sei blockchain. ```bash seid ``` -------------------------------- ### Initialize Project and Dependencies Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/wallet-integrations/thirdweb.mdx Commands to scaffold a new React TypeScript application using Vite and install the necessary thirdweb SDK version 5. ```bash npm create vite@latest sei-thirdweb-app -- --template react-ts cd sei-thirdweb-app npm install npm install thirdweb@^5 ``` -------------------------------- ### Solidity Smart Contract Example Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/evm-general.mdx An example of a simple 'Coin' smart contract written in Solidity. This contract demonstrates basic functionalities like minting new coins, transferring existing coins, and emitting events. It requires Solidity version 0.7.0 or higher. ```solidity // SPDX-License-Identifier: GPL-3.0 pragma solidity >= 0.7.0; contract Coin { // The keyword "public" makes variables // accessible from other contracts address public minter; mapping (address => uint) public balances; // Events allow clients to react to specific // contract changes you declare event Sent(address from, address to, uint amount); // Constructor code is only run when the contract // is created constructor() { minter = msg.sender; } // Sends an amount of newly created coins to an address // Can only be called by the contract creator function mint(address receiver, uint amount) public { require(msg.sender == minter); require(amount < 1e60); balances[receiver] += amount; } // Sends an amount of existing coins // from any caller to an address function send(address receiver, uint amount) public { require(amount <= balances[msg.sender], "Insufficient balance."); balances[msg.sender] -= amount; balances[receiver] += amount; emit Sent(msg.sender, receiver, amount); } } ``` -------------------------------- ### Environment Setup for Sei Integration Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/json.mdx Shell commands to initialize a Node.js project, install necessary dependencies like ethers and @sei-js/precompiles, and configure environment variables. ```bash mkdir sei-json-mainnet cd sei-json-mainnet npm init -y npm install ethers @sei-js/precompiles@^2.1.2 dotenv echo "PRIVATE_KEY=your_private_key_here" > .env node json-precompile-mainnet.js ``` -------------------------------- ### Demonstrate SEI Price Integration Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/oracles/pyth-network.mdx This function initializes the integration process by setting up RPC connections and environment variables. It calls the update and query functions to retrieve and log the final SEI price data. ```javascript async function demonstrateSeiPriceIntegration() { const contractAddress = process.env.CONTRACT_ADDRESS; const privateKey = process.env.PRIVATE_KEY; const rpcUrl = 'https://evm-rpc.sei-apis.com'; try { const result = await updateAndQuerySeiPrice(contractAddress, privateKey, rpcUrl); console.log(`Transaction: ${result.txHash}, Price: ${result.price}`); } catch (error) { console.error('Demo failed:', error.message); } } ``` -------------------------------- ### Install @sei-js SDK Packages Source: https://context7.com/sei-protocol/sei-docs/llms.txt Installs essential @sei-js packages for Sei development, including precompiles, global wallet connection, and Ledger hardware wallet support. Also includes commands to scaffold a new Sei project and run the MCP server for AI integration. ```bash # Install packages npm install @sei-js/precompiles # Precompile ABIs and addresses npm install @sei-js/sei-global-wallet # Cross-application wallet connection npm install @sei-js/ledger # Ledger hardware wallet support # Scaffold new project npx @sei-js/create-sei app cd app && npm install && npm run dev # Run MCP server for AI integration npx @sei-js/mcp-server ``` -------------------------------- ### Lending and Borrowing with Takara Protocol Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/ai-tooling/cambrian-agent-kit.mdx Facilitates lending and borrowing operations on Takara Protocol using the SeiAgentKit. This function shows how to supply liquidity by minting tTokens, borrow assets against collateral, and repay borrowed amounts. It's crucial to monitor your collateral ratio to avoid liquidation. ```typescript async function takaraLending() { try { const agent = new SeiAgentKit(process.env.SEI_PRIVATE_KEY, 'openai'); // Mint tTokens (supply liquidity) const mintTx = await agent.mintTakara('USDC', '10'); console.log('Mint Takara:', mintTx); if (mintTx.status === 'success') { console.log('✅ Successfully supplied USDC to Takara'); console.log('💰 You are now earning interest on your supply'); } // Borrow against collateral const borrowTx = await agent.borrowTakara('USDC', '5'); console.log('Borrow Takara:', borrowTx); if (borrowTx.status === 'success') { console.log('✅ Successfully borrowed USDC from Takara'); console.log('⚠️ Remember to monitor your collateral ratio'); } // Repay borrowed amount const repayTx = await agent.repayTakara('USDC', '5'); console.log('Repay Takara:', repayTx); } catch (error) { console.error('Takara error:', error.message); if (error.message.includes('collateral')) { console.log('💡 Tip: Add more collateral to maintain healthy ratio'); } else if (error.message.includes('liquidity')) { console.log('💡 Tip: Insufficient liquidity in the pool'); } } } ``` -------------------------------- ### Configure Hardware Security Module (HSM) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/node/validators.mdx Steps to install necessary utilities and configure the Sei node to use a YubiHSM2 for protecting the consensus key. This is recommended for production environments to prevent key compromise. ```bash # Install required libraries sudo apt-get install opensc pkcs11-utils # Configure YubiHSM2 yubihsm-connector -d # Generate key in HSM yubihsm-shell # Configure seid to use HSM tee "$HOME/.sei/config/priv_validator_config.json" << EOF { "chain_id": "sei-chain", "key_type": "yubihsm", "state_file": "$HOME/.sei/data/priv_validator_state.json", "hsm_serial": "YOUR_HSM_SERIAL", "hsm_key_id": "YOUR_KEY_ID" } EOF ``` -------------------------------- ### Contract Integration Example Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/precompiles/cosmwasm-precompiles/bank.mdx A JavaScript example demonstrating how to interact with the deployed contract to manage supported tokens and query user portfolio data. ```javascript const tokenManager = new ethers.Contract(address, TokenManager.abi, deployer); const tokens = ['usei', 'uatom', 'ubtc']; for (const token of tokens) { const tx = await tokenManager.addSupportedToken(token); await tx.wait(); } const allBalances = await tokenManager.getUserPortfolio(deployer.address); ``` -------------------------------- ### Create React App with Vite (Bash) Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/wallet-integrations/thirdweb-7702.mdx Command to create a new React TypeScript project using Vite and install necessary dependencies. This sets up the foundational structure for the EIP-7702 integration demo. ```bash npm create vite@latest eip7702-demo -- --template react-ts cd eip7702-demo npm install npm install thirdweb@^5 ``` -------------------------------- ### Initialize Subgraph Project Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/indexer-providers/the-graph.mdx Initializes a new subgraph project using the Graph CLI. It requires your subgraph slug from Subgraph Studio and prompts for necessary subgraph details. The CLI automatically fetches the contract ABI and sets up the subgraph. ```bash graph init --studio ``` -------------------------------- ### Sei Node Systemd Service Management Source: https://github.com/sei-protocol/sei-docs/blob/main/content/node/node-operators.mdx This bash snippet demonstrates common systemd commands for managing the Sei node service. It covers checking status, starting, stopping, restarting the service, and viewing real-time logs. ```bash # Check service status systemctl status seid # Start service systemctl start seid # Stop service systemctl stop seid # Restart service systemctl restart seid # View logs in real time journalctl -fu seid -o cat ``` -------------------------------- ### Configure Symphony Swap Widget with Parameters Source: https://github.com/sei-protocol/sei-docs/blob/main/content/evm/in-app-swaps.mdx Advanced implementation demonstrating how to pass query parameters for token selection, theme, and notification settings. Examples are provided for standard HTML, React components, and Next.js applications. ```html ``` ```jsx function SwapWidget() { const tokenIn = "0xe15fC38F6D8c56aF07bbCBe3BAf5708A2Bf42392"; const tokenOut = "0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7"; return (