Documentation

Command Reference

Complete reference for Selendra CLI commands

Command Reference

Complete reference for all @selendrajs/cli commands.

Project Commands

init

Initialize a new Selendra project.

selendra init <project-name> [options]

Options:

  • -t, --template <type>: Project template to use (evm or wasm). Default: evm.

Examples:

selendra init my-dapp
selendra init my-contract --template wasm

compile

Compile smart contracts in the current project.

selendra compile [options]

Options:

  • --target <target>: Force compilation target (evm or wasm). Auto-detected if omitted.

Examples:

selendra compile
selendra compile --target evm

deploy

Deploy a smart contract to the network.

selendra deploy <contract-name> [options]

Options:

  • -n, --network <network>: Network to deploy to (mainnet or testnet).

Examples:

selendra deploy MyToken
selendra deploy MyToken --network testnet

Network Commands

status

Show live network statistics.

selendra status [options]

Options:

  • -n, --network <network>: Network to query (mainnet, testnet, local). Default: mainnet.

Output:

  • Block Height
  • Gas Price
  • Chain ID
  • RPC URL

Example:

selendra status
selendra status --network testnet

chain

Display detailed chain information.

selendra chain [options]

Options:

  • -n, --network <network>: Network to query (mainnet, testnet, local). Default: mainnet.
  • --json: Output as JSON.

Output (Substrate):

  • Chain name
  • Node name & version
  • Spec name & version
  • Latest block number

Output (EVM):

  • Chain ID
  • Block number
  • Gas price

Examples:

selendra chain
selendra chain --network testnet
selendra chain --json

block

Show information about a specific block.

selendra block [number] [options]

Arguments:

  • [number]: Block number to query. If omitted, shows latest block.

Options:

  • -n, --network <network>: Network to query (mainnet, testnet, local). Default: mainnet.
  • --json: Output as JSON.

Output:

  • Block number
  • Block hash
  • Parent hash
  • State root
  • Extrinsics count

Examples:

selendra block
selendra block 1000000
selendra block --network testnet --json

Account Commands

account

Manage accounts and keys.

selendra account <action>

Actions:

  • new: Generate a new EVM-compatible wallet (0x address).
  • new-substrate: Generate a new Substrate wallet (SS58 address).
  • list: List managed accounts (coming soon).
  • import: Import existing account (coming soon).

account new

Generate a new EVM-compatible account.

selendra account new

Output:

═══════════════════════════════════════════════════════════════════════
                        Creating New EVM Account
═══════════════════════════════════════════════════════════════════════

✓ Account created successfully!

Address (EVM):    0x742d35Cc6634C0532925a3b844Bc9e7595f...

Private Key:
0x123abc...

Mnemonic (Seed Phrase):
word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12

⚠️  Never share your private key or seed phrase!

account new-substrate

Generate a new Substrate account with SS58 address (Selendra format).

selendra account new-substrate

Output:

═══════════════════════════════════════════════════════════════════════
                     Creating New Substrate Account
═══════════════════════════════════════════════════════════════════════

 Account created successfully!

Address (SS58):   5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
Public Key:       0x...
SS58 Format:      204 (Selendra)

Mnemonic (Seed Phrase):
word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12

⚠️  Never share your seed phrase!

balance

Query account balance (native SEL tokens).

selendra balance <address> [options]

Arguments:

  • <address>: The account address (0x... or Substrate format).

Options:

  • -n, --network <network>: Network to query (mainnet, testnet, local). Default: mainnet.
  • --json: Output as JSON.

Output:

  • EVM balance (for 0x addresses)
  • Substrate balance breakdown (free, reserved, frozen)

Examples:

selendra balance 0x742d35Cc6634C0532925a3b844Bc9e7595f...
selendra balance 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
selendra balance 0x742d35... --network testnet --json

transfer

Transfer SEL tokens between accounts.

selendra transfer <to-address> [options]

Arguments:

  • <to-address>: Recipient EVM address (0x...).

Options:

  • -n, --network <network>: Network to use (mainnet, testnet, local).
  • -a, --amount <amount>: Amount to transfer (in SEL).

Environment Variables:

  • SELENDRA_PRIVATE_KEY: Your private key for signing.

Examples:

# Interactive (prompts for network and amount)
selendra transfer 0x742d35...

# Non-interactive
selendra transfer 0x742d35... --network testnet --amount 10

Transaction Flow:

  1. Validates recipient address
  2. Checks sender balance
  3. Estimates gas fee
  4. Shows transfer details
  5. Prompts for confirmation
  6. Submits and waits for confirmation

faucet

Request testnet tokens.

selendra faucet <address>

Arguments:

  • <address>: The recipient address (0x...).

Example:

selendra faucet 0x742d35...

Staking Commands

stake

Staking operations via Nomination Pools.

selendra stake <action> [options]

Actions:

stake info

Show staking overview and network stats.

selendra stake info [options]

Options:

  • -n, --network <network>: Network to query. Default: mainnet.

Output:

  • Active Era
  • Current Era
  • Min Join Bond
  • Min Create Bond
  • Max Pools
  • Pool Members count

stake pools

List available nomination pools.

selendra stake pools [options]

Options:

  • -n, --network <network>: Network to query. Default: mainnet.

Output:
Lists all active pools with:

  • Pool ID
  • Pool name/metadata
  • State (Open, Blocked, Destroying)
  • Points/stake amount

stake join

Join a nomination pool to start earning rewards.

selendra stake join [options]

Options:

  • -n, --network <network>: Network to use. Default: mainnet.
  • -p, --pool <pool-id>: Pool ID to join.
  • -a, --amount <amount>: Amount to stake (in SEL).

Environment Variables:

  • SELENDRA_SEED: Your mnemonic seed phrase for signing.

Example:

selendra stake join --pool 1 --amount 100

stake claim

Claim pending staking rewards.

selendra stake claim [options]

Options:

  • -n, --network <network>: Network to use. Default: mainnet.

stake unbond

Unbond tokens from a nomination pool.

selendra stake unbond [options]

Options:

  • -n, --network <network>: Network to use. Default: mainnet.
  • -a, --amount <amount>: Amount to unbond (in SEL).

Environment Variables

VariableDescription
SELENDRA_PRIVATE_KEYEVM private key for signing transactions
SELENDRA_SEEDSubstrate mnemonic seed phrase
SELENDRA_NETWORKDefault network (mainnet, testnet, local)

Network Endpoints

NetworkRPC (Substrate)RPC (EVM)Chain ID
mainnetwss://rpc.selendra.orghttps://rpc.selendra.org1961
testnetwss://rpc-testnet.selendra.orghttps://rpc-testnet.selendra.org1953
localws://127.0.0.1:9944http://127.0.0.1:8545-

Global Options

All commands support:

OptionDescription
-h, --helpShow help for command
-V, --versionShow CLI version

Exit Codes

CodeMeaning
0Success
1Error (invalid input, network error, etc.)

Learning & Development Commands

learn

Interactive tutorials for learning Selendra development.

selendra learn [topic] [options]

Arguments:

  • [topic]: Optional tutorial topic to start directly.

Options:

  • --list: List all available tutorials.
  • --reset: Reset tutorial progress.

Available Tutorials:

TutorialDifficultyDurationDescription
getting-startedBeginner~15 minNetwork basics, accounts, testnet tokens
first-contractBeginner~25 minDeploy your first ERC-20 token
defi-basicsIntermediate~30 minAMM, liquidity pools, yield farming
nft-creationIntermediate~35 minBuild an NFT collection

Examples:

# Interactive menu
selendra learn

# Start specific tutorial
selendra learn getting-started
selendra learn first-contract

# List available tutorials
selendra learn --list

# Reset progress
selendra learn --reset

Progress Tracking:

Progress is saved in ~/.selendra/tutorial-progress.json and includes completed tutorials, current step, and quiz answers.


plugin

Manage CLI plugins for extending functionality.

selendra plugin <command> [options]

Subcommands:

plugin install

Install a plugin from npm, git, or local path.

selendra plugin install <plugin-name>
selendra plugin install <path> --local
selendra plugin install <git-url> --git

Options:

  • --local: Install from local path.
  • --git: Install from git repository.

plugin uninstall

Remove an installed plugin.

selendra plugin uninstall <plugin-name>

plugin list

List installed or available plugins.

selendra plugin list
selendra plugin list --available

Options:

  • --available: Show available official plugins.

plugin enable/disable

Toggle a plugin on or off.

selendra plugin enable <plugin-name>
selendra plugin disable <plugin-name>

plugin update

Update installed plugins.

selendra plugin update              # Update all
selendra plugin update <plugin>     # Update specific

plugin info

Show detailed plugin information.

selendra plugin info <plugin-name>

plugin create

Scaffold a new plugin project.

selendra plugin create <name>

Official Plugins:

PluginDescription
@selendrajs/plugin-hardhat-bridgeHardhat integration
@selendrajs/plugin-foundry-bridgeFoundry integration
@selendrajs/plugin-gas-reporterGas usage reporting
@selendrajs/plugin-contract-sizerContract size analyzer
@selendrajs/plugin-coverageTest coverage tools
@selendrajs/plugin-ipfs-deployIPFS deployment

Plugin Hooks:

Plugins can hook into the CLI lifecycle:

HookDescription
preCompileBefore compiling contracts
postCompileAfter compiling contracts
preDeployBefore deploying
postDeployAfter deploying
preTestBefore running tests
postTestAfter running tests

Examples:

# Install from npm
selendra plugin install @selendrajs/plugin-gas-reporter

# Install from local
selendra plugin install ./my-plugin --local

# Install from git
selendra plugin install https://github.com/user/plugin.git --git

# Create new plugin
selendra plugin create my-awesome-plugin

# List all plugins
selendra plugin list
Contribute

Found an issue or want to contribute?

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

Edit this page on GitHub
Selendra - Build on Cambodian Blockchain with Testnet