Skip to content

NPM package Vite, Nextjs Dapp Scaffolding for Selendra

Notifications You must be signed in to change notification settings

selendra/selendra-kit

Repository files navigation

SelendraKit

SelendraKit is a toolkit for building decentralized applications (dApps) on the Selendra Network. It provides a set of utilities and templates to streamline the development process and make it easier to interact with the Selendra blockchain.

Features

  • Easy project scaffolding with CLI
  • Pre-configured Hardhat setup for Selendra Network
  • Frontend templates (Next.js and Vite)
  • Selendra-specific utilities for contract deployment and interaction
  • Comprehensive testing suite

Installation

To install Selendrakit globally, run:

npm install -g selendra-kit

Usage

Creating a new project

To create a new Selendra project, run:

selendra create my-selendra-app

This will create a new directory with a basic project structure, including Hardhat configuration and a frontend template.

Project Structure

A typical project created with Selendrakit will have the following structure:

my-selendra-app/
├── contracts/
│   └── Lock.sol
├── frontend/
│   ├── (Next.js or Vite files)
├── scripts/
│   └── deploy.js
├── test/
├── utils/
│   ├── selendraConfig.js
│   └── contractInteraction.js
├── hardhat.config.js
└── .env

Configuring your project

  1. Navigate to your project directory:

    cd my-selendra-app
  2. Install dependencies:

    npm install
  3. Set up your environment variables by copying the .env.example file to .env and filling in your private key:

    cp .env.example .env

Compiling and deploying contracts

  1. Compile your smart contracts:

    npx hardhat compile
  2. Deploy your contracts to Selendra Network:

    npx hardhat run scripts/deploy.js --network selendra

Running the frontend

  1. Navigate to the frontend directory:

    cd frontend
  2. Install frontend dependencies:

    npm install
  3. Start the development server:

    npm run dev

Selendra Utilities

Selendrakit provides utility functions to interact with the Selendra Network:

  • getSelendraProvider(network): Get a provider for Selendra Network
  • getSelendraWallet(privateKey, network): Get a wallet instance for Selendra Network
  • deployContract(contractJson, constructorArgs, privateKey, network): Deploy a contract to Selendra Network
  • getContract(contractAddress, contractAbi, signerOrProvider): Get a contract instance
  • estimateGas(contract, method, args): Estimate gas for a contract method
  • sendTransaction(contract, method, args, options): Send a transaction to a contract

For detailed usage of these utilities, refer to the API Documentation.

Contributing

We welcome contributions to Selendrakit! Please see our Contributing Guide for more details.

License

Selendrakit is released under the MIT License.

About

NPM package Vite, Nextjs Dapp Scaffolding for Selendra

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published