near/create-near-app
关于
创建一个接入 NEAR 区块链的入门应用。
商业与金融实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Create NEAR App
Scaffold a Rust smart contract or a React frontend for the NEAR blockchain.
Prerequisites
Install Node.js 22.22.2+, 24.15+, or 26+. For contracts, install Rust and cargo-near. Windows contract developers should use WSL.
Getting started
npx create-near-app@latest
Choose one project type:
- Smart contract: a basic auction using NEAR, or an advanced auction using fungible tokens with an NFT prize. Both use
near-sdk, with local integration tests usingnear-sandboxandnear-api. - Frontend: Next.js with App Router, or Vite with React. Both use TypeScript, NEAR Connect, and
near-api-jsto interact with the deployed Hello NEAR contract.
Follow the generated project's README for build, testing, and deployment instructions. See the contract quickstart or frontend quickstart to learn more.
CLI arguments
Create a Rust contract (defaults to the basic auction):
npx create-near-app@latest my-contract --contract
npx create-near-app@latest my-auction --contract --template auction-adv
Create a frontend:
npx create-near-app@latest my-web-app --frontend next-app --install
npx create-near-app@latest my-web-app --frontend vite-react --install
Choose exactly one of --contract or --frontend. --template auction|auction-adv applies only to contracts; --install runs npm install for a frontend.
Contract language arguments (--contract rs, --contract ts), none values, and the legacy next-page frontend are no longer supported. Use --contract for Rust and --frontend next-app for Next.js App Router.
Contributing
npm install
npm test
npm run lint
Package versions follow stable releases. TypeScript stays on 6.0 while the lint/test tools require it; the Next.js template uses ESLint 9 because its React lint plugins do not yet support ESLint 10. The scaffolder and Vite template use ESLint 10.
Templates live in templates/contracts/auction, templates/contracts/auction-adv, and templates/frontend/{next-app,vite-react}. Contract templates follow auctions-tutorial; frontend wallet integration follows hello-near-examples.
Run npm run test-e2e to scaffold and test both contracts and build and lint both frontends. This requires the Rust toolchain and cargo-near, and downloads dependencies and the NEAR sandbox binary.
Use Conventional Commits for changes. Maintainers with npm publish and GitHub repository access can publish with npm run release (requires GITHUB_TOKEN).
Getting help
Read the documentation or join Discord.
License
Distributed under the MIT and Apache 2.0 licenses. See LICENSE and LICENSE-APACHE.
探索相关项目
加载中…