Selendra

Documentation

Development Tools

Development environment setup for Selendra

Development tools for EVM and WASM smart contracts.

EVM Development

Full-featured development environment with built-in testing framework.

npm install --save-dev hardhat
npx hardhat init

hardhat.config.js:

require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.19",
  networks: {
    selendra: {
      url: "https://rpc.selendra.org",
      accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
      chainId: 1961,
    },
    selendraTestnet: {
      url: "https://rpc-testnet.selendra.org",
      accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
      chainId: 1953,
    },
  },
};

Foundry (Fast Testing & Deployment)

Blazing-fast Rust-based toolkit for Ethereum development.

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Create project
forge init my-project
cd my-project

# Install dependencies
forge install

# Run tests
forge test

# Deploy
forge create src/MyToken.sol:MyToken \
  --rpc-url https://rpc-testnet.selendra.org \
  --private-key $PRIVATE_KEY

foundry.toml:

[profile.default]
src = "src"
out = "out"
libs = ["lib"]

[rpc_endpoints]
selendra = "https://rpc.selendra.org"
selendra_testnet = "https://rpc-testnet.selendra.org"

Why Foundry: 10-100x faster than Hardhat for large test suites. Write tests in Solidity.

Remix IDE

Web-based IDE for quick prototyping:

  1. Visit remix.ethereum.org
  2. Connect via "Injected Provider - MetaMask"
  3. Select Selendra network in MetaMask
  4. Compile and deploy

Truffle

// truffle-config.js
module.exports = {
  networks: {
    selendra: {
      provider: () => new HDWalletProvider(
        process.env.PRIVATE_KEY,
        "https://rpc.selendra.org"
      ),
      network_id: 1961,
    },
  },
};

Frontend Integration

Wagmi (React Hooks)

Modern React hooks for Ethereum - wallet connections, transactions, contract interactions.

npm install wagmi viem@2.x @tanstack/react-query
import { WagmiConfig, createConfig, configureChains } from 'wagmi'
import { publicProvider } from 'wagmi/providers/public'

const selendra = {
  id: 1961,
  name: 'Selendra',
  network: 'selendra',
  nativeCurrency: { name: 'SEL', symbol: 'SEL', decimals: 18 },
  rpcUrls: {
    default: { http: ['https://rpc.selendra.org'] },
    public: { http: ['https://rpc.selendra.org'] },
  },
}

const { chains, publicClient } = configureChains(
  [selendra],
  [publicProvider()],
)

const config = createConfig({
  autoConnect: true,
  publicClient,
})

function App() {
  return (
    <WagmiConfig config={config}>
      <YourApp />
    </WagmiConfig>
  )
}

Use Wagmi for: React dApps, wallet integration, contract hooks

Viem (TypeScript APIs)

Lightweight, performant TypeScript alternative to ethers.js/web3.js.

npm install viem
import { createPublicClient, http } from 'viem'

const client = createPublicClient({
  chain: {
    id: 1961,
    name: 'Selendra',
    network: 'selendra',
    nativeCurrency: { name: 'SEL', symbol: 'SEL', decimals: 18 },
    rpcUrls: {
      default: { http: ['https://rpc.selendra.org'] },
      public: { http: ['https://rpc.selendra.org'] },
    },
  },
  transport: http(),
})

const blockNumber = await client.getBlockNumber()

Why Viem: Type-safe, faster than ethers.js, tree-shakeable, better DX.

RainbowKit (Wallet UI)

Beautiful wallet connection UI for React (pairs with Wagmi).

npm install @rainbow-me/rainbowkit
import '@rainbow-me/rainbowkit/styles.css'
import { RainbowKitProvider, getDefaultWallets } from '@rainbow-me/rainbowkit'

const { connectors } = getDefaultWallets({
  appName: 'My Selendra dApp',
  projectId: 'YOUR_PROJECT_ID', // Get from WalletConnect Cloud
  chains,
})

<RainbowKitProvider chains={chains}>
  <App />
</RainbowKitProvider>

Use RainbowKit for: Professional wallet UI, multi-wallet support

Developer APIs & SDKs

Alchemy SDK

Powerful APIs for Ethereum and EVM chains (enhanced node access, NFT APIs, webhooks).

npm install alchemy-sdk
import { Alchemy, Network } from 'alchemy-sdk'

const alchemy = new Alchemy({
  apiKey: 'YOUR_API_KEY',
  network: Network.ETH_MAINNET, // Use custom RPC for Selendra
})

// Note: Use Selendra RPC directly or request Alchemy to add Selendra support

Use Alchemy for: Enhanced RPC, NFT indexing, real-time notifications (when supported)

Moralis SDK

Multi-chain SDKs for data indexing and monitoring (NodeJS, Python, NextJS).

npm install moralis
import Moralis from 'moralis'

await Moralis.start({ apiKey: 'YOUR_API_KEY' })

// For Selendra, use EVM API with custom RPC
const response = await Moralis.EvmApi.token.getTokenPrice({
  address: '0x...',
  chain: '0x7a9', // 1961 in hex for Selendra
})

Use Moralis for: Token data, wallet history, transaction parsing

WASM Development

cargo-contract

# Install
cargo install cargo-contract --force

# Create project
cargo contract new my_contract

# Build
cargo contract build

# Test
cargo test

Local Development

# Download binary
wget https://github.com/selendra/selendra/releases/latest/download/selendra

# Run dev node
./selendra --dev --ws-external --rpc-external

Smart Contract Development (Foundry)

# 1. Setup
forge init my-project && cd my-project

# 2. Develop & Test (ultra-fast)
forge test --gas-report

# 3. Deploy to testnet
forge create src/MyToken.sol:MyToken \
  --rpc-url https://rpc-testnet.selendra.org \
  --private-key $PRIVATE_KEY \
  --verify

React dApp (Wagmi + RainbowKit)

# 1. Setup
npx create-next-app@latest my-dapp
cd my-dapp
npm install wagmi viem @rainbow-me/rainbowkit

# 2. Configure chains and connectors
# (See Wagmi + RainbowKit examples above)

# 3. Build UI with hooks
# useAccount(), useBalance(), useContractRead()

# 4. Deploy
npm run build

Testing & Deployment (Hardhat)

# 1. Setup
npm init -y && npm install --save-dev hardhat
npx hardhat init

# 2. Develop & Test
npx hardhat compile
npx hardhat test

# 3. Deploy
npx hardhat run scripts/deploy.js --network selendraTestnet

# 4. Verify
npx hardhat verify --network selendraTestnet <ADDRESS>

Environment Variables

PRIVATE_KEY=your_private_key
SELENDRA_RPC_URL=https://rpc.selendra.org
ALCHEMY_API_KEY=your_key  # If using Alchemy
MORALIS_API_KEY=your_key  # If using Moralis

VS Code Extensions

  • Solidity (Nomic Foundation)
  • Rust Analyzer
  • Prettier
  • ESLint
  • Hardhat Solidity

Tool Selection Matrix

Use CaseRecommended Tool
Smart Contract TestingFoundry (fast) or Hardhat (full-featured)
Quick PrototypingRemix IDE
Legacy ProjectsTruffle
React dApp FrontendWagmi + RainbowKit
TypeScript APIsViem (modern) or ethers.js
WASM Contractscargo-contract
Local NodeSelendra dev node
Enhanced RPC/APIsAlchemy SDK, Moralis SDK
Wallet UIRainbowKit

Quick Reference

EVM Smart Contracts:

  • Development: Foundry (fast) or Hardhat (established)
  • Testing: Foundry forge test (Solidity tests)
  • Deployment: Foundry forge create or Hardhat

Frontend Integration:

  • React: Wagmi (hooks) + RainbowKit (UI)
  • TypeScript: Viem (modern) or ethers.js (established)
  • Vanilla JS: Web3.js

Data & APIs:

  • Enhanced Node: Alchemy SDK
  • Multi-chain Data: Moralis SDK
  • Direct RPC: Selendra native endpoints

Next: Smart ContractsBuild dApps

Contribute

Found an issue or want to contribute?

Help us improve this documentation by editing this page on GitHub.

Edit this page on GitHub