跳至主要內容
返回範例應用程式

Solana 瀏覽器

The Solana Wallet Explorer leverages a Quicknode Solana Endpoint to retrieve token balances, transaction history, and NFTs for a specified wallet on the Solana blockchain.

前端框架/函式庫:
React/Next.js
語言:
TypeScript
建置工具/開發伺服器:
Next.js
範例應用程式預覽

概覽

The Solana Wallet Explorer leverages a Quicknode Solana Endpoint to retrieve token balances, transaction history, and NFTs for a specified wallet on the Solana blockchain. It uses a Next.js 14 此專案採用以下方式啟動: create-next-app.


開始使用

安裝依賴項

首先,安裝依賴項:

npm 安裝
# 或
yarn
# 或
pnpm 安裝
# 或
bun 安裝

設定環境變數

Make sure you have a Quicknode endpoint handy--you can get one free here.

重新命名 .env.example.env.local and add your Quicknode Solana endpoint. Set DAS_API_ENABLEDtrue only if you have access to the Metaplex product.

SOLANA_RPC_URL=https://example.solana-mainnet.quiknode.pro/123456/
DAS_API_ENABLED=true
NEXT_PUBLIC_FETCH_JUPLIST=true

首先,執行開發伺服器:

npm 執行 dev
# 或
yarn dev
# 或
pnpm dev
# 或
bun dev

請使用瀏覽器開啟http://localhost:3000以查看結果。


使用 Dapp

Search for a Solana wallet address and press enter. The Dapp will redirect to /wallet/[地址] and query the Solana blockchain for the wallet's token balances, transactions, and NFTs. Results are rendered in respective cards.

建築

src/
├── app/
│ └── api/
│ └── wallet/
├── components/
├── 探索器/
└── header/
  • api - Contains the API routes for the Solana RPC calls. These can be accessed from the client via /api/wallet/[method]?walletAddress=[address]. 這些 GET 請求使用 @solana/web3.js library and Metaplex Digital Asset Standard framework to handle queries.
  • 元件 - 包含該去中心化應用程式(dapp)所需的 React 元件。
    • 探索者 該元件包含會呼叫 API 路由並渲染結果的客戶端元件。
    • 頁首 此元件包含該去中心化應用(dapp)的搜尋欄。

部署至 Vercel

透過 Vercel 進行部署


預覽

預覽


Next.js 文件

若想進一步了解 Next.js,請參考以下資源:

您可以瀏覽Next.js 的 GitHub 儲存庫——歡迎提供您的意見回饋與貢獻!

貢獻與回饋
我們非常樂意聽取您的意見,並歡迎您為這個範例應用程式提供任何貢獻!
若要回報問題或提供意見回饋,請在 qn-guide-examples 儲存庫。
若要貢獻,請依照以下步驟操作:
  1. 分叉此儲存庫
  2. 建立功能分支:
    git checkout -b feature/amazing-feature
  3. 將您的變更提交:
    git commit -m "新增超棒的功能"
  4. 推送您的分支:
    git push origin feature/amazing-feature
  5. 開啟一個 Pull Request。