Nx monorepo that prepared to develop contract and frontend in one repository. Main feature of that is contracts' SDK for web applications. Develop and build full typed applications.
- Nx. Monorepo orchestrator
- eth-sdk. Type-safe, lightweight SDKs for Ethereum smart contracts
- Hardhat. Ethereum development environment
First, install dependencies. Installing will build contract SDK for you. If you have any config in packages/contracts/sdk folder
yarn installThen, create a web application (React, Vue, Angular) and add contracts package for you dependencies
// packages/sample/package.json
{
"name": "sample",
"version": "0.0.0",
"main": "dist/index.js",
"devDependencies": {},
"scripts": {
"build": "tsc index.ts --outDir dist"
},
"dependencies": {
"contracts": "*" // <-- add this line
}
}It need to tell Nx that your package is depend on contracts package. After that on every build script in your package Nx will regenerate SDK for you.
So, you always have a fresh SDK of contracts
Configure your SDK using eth-sdk package
Check out the sample for examples