본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)7.0k · #13653

near-dapp

하는 일

이 스킬은 시작 템플릿으로 새 NEAR 웹 앱을 만들거나, 이미 있는 앱에 지갑 로그인을 추가하는 방법을 다룹니다. React 훅 방식과 순수 JavaScript 방식을 포함하며, NEAR에서 웹을 개발하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓템플릿으로 새 NEAR 웹 앱을 시작하고 싶을 때.
  • ✓기존 React 앱에 NEAR 지갑 로그인과 컨트랙트 호출을 추가하고 싶을 때.
  • ✓순수 JavaScript에서 NEAR 지갑을 연결해야 할 때.

스킬 링크

https://github.com/internet-court/internet-court-skill/blob/main/vendored/near/near-dapp/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/internet-court/internet-court-skill/blob/main/vendored/near/near-dapp/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 기존 React 앱에 NEAR 지갑 로그인을 추가해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

새 프로젝트라면 에이전트는 선택한 프레임워크와 컨트랙트 언어로 create-near-app 도구를 실행합니다. 기존 앱이라면 연결 패키지를 설치하고, 앱을 provider로 감싸고, 훅으로 로그인하고 컨트랙트를 호출합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

NEAR dApp

Decision Router

Determine which path to follow:

Path A: New Project

User wants to create a new NEAR dApp from scratch.

  1. Read references/create-near-app.md
  2. Run scaffolding:
npx create-near-app@latest

Or with arguments:

npx create-near-app my-app --frontend vite-react --contract rs --install

Framework options: vite-react | next-app | next-page Contract options: rs (Rust) | ts (TypeScript)

  1. If user needs wallet connection in the scaffolded app, also follow Path B.

Path B: Existing Project

User wants to add NEAR wallet connection to an existing React app.

  1. Read references/near-connect-hooks.md — React hooks API and patterns
  2. If user needs low-level wallet API or non-React integration, also read references/near-connect.md

Quick setup:

npm install near-connect-hooks @hot-labs/near-connect near-api-js
// 1. Wrap app root with NearProvider
import { NearProvider } from 'near-connect-hooks';

<NearProvider config={{ network: 'mainnet' }}>
  <App />
</NearProvider>

// 2. Use hook in components
import { useNearWallet } from 'near-connect-hooks';

const { signedAccountId, signIn, signOut, viewFunction, callFunction } = useNearWallet();

Path C: Non-React or Vanilla JS

Use @hot-labs/near-connect directly without React hooks.

  1. Read references/near-connect.md
npm install @hot-labs/near-connect
import { NearConnector } from "@hot-labs/near-connect";

const connector = new NearConnector({ network: "mainnet" });
connector.on("wallet:signIn", async (t) => {
  const wallet = await connector.wallet();
  const address = t.accounts[0].accountId;
});
await connector.connect();

Key Patterns

  • Read contract state (no wallet): viewFunction({ contractId, method, args })
  • Write to contract (wallet required): callFunction({ contractId, method, args, deposit })
  • Transfer NEAR: transfer({ receiverId, amount })
  • NEAR ↔ yoctoNEAR: Use nearToYocto() / yoctoToNear() from near-api-js
  • 1 NEAR = "1000000000000000000000000" yoctoNEAR
  • Default gas: "30000000000000" (30 TGas)
자주 묻는 질문

시작 템플릿은 어떤 프레임워크를 쓸 수 있나요?

Vite와 React, App Router를 쓰는 Next.js, 또는 pages를 쓰는 Next.js입니다.

어떤 컨트랙트 언어를 지원하나요?

Rust와 TypeScript를 지원합니다.

React 없이도 쓸 수 있나요?

네. 스킬은 하위 수준 지갑 라이브러리를 쓰는 순수 JavaScript 경로를 따로 제공합니다.

상세 정보

작성자의 원본 설명

Build NEAR Protocol dApps. Use for: (1) creating new NEAR dApps with `create-near-app` (Vite+React, Next.js), (2) adding NEAR wallet connection to existing apps with `@hot-labs/near-connect` and `near-connect-hooks`, (3) building frontend UI for NEAR smart contracts, (4) integrating wallet sign-in/sign-out, contract calls, and transaction signing into web applications.

repo: internet-court/internet-court-skill

인기도

GitHub 스타
7.0k
순위
#13653
라이선스
—
업데이트
2026. 10. 26.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬