跳转至主要内容
返回示例应用

Ethereum Wallet Explorer

The Ethereum Wallet Explorer uses Quicknode's Ethereum endpoint and APIs to query the blockchain for tokens, transactions, and NFTs associated with a given wallet.

前端框架/库:
Next.js
语言:
TypeScript
构建工具/开发服务器:
Next.js
示例应用预览

概述

The Ethereum Wallet Explorer demonstrates how to use your Quicknode Ethereum Node Endpoint and APIs from the Quicknode Marketplace to query the Ethereum blockchain for tokens, transactions, and NFTs associated with a given wallet.

To run this demo to its full capabilities, you will need both the Token and NFT API v2 bundle (free) and EVM Blockbook add-ons from the Quicknode Marketplace installed.

The demo uses Next.js 14 该项目通过以下方式启动: create-next-app.


入门指南

安装依赖项

首先,安装依赖项:

npm 安装
# 或
yarn
# 或
pnpm 安装
# 或
bun install

设置环境变量

重命名 .env.example.env.local and update with your Quicknode Ethereum Node Endpoint.

ETHEREUM_RPC_URL=https://example.ethereum-mainnet.quiknode.pro/123456/

首先,运行开发服务器:

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

请使用浏览器打开http://localhost:3000以查看结果。


使用 Dapp

Search for an Ethereum wallet address and press enter. The Dapp will redirect to /wallet/[地址] and query the Ethereum 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 Ethereum RPC calls. These can be accessed from the client via /api/wallet/[method]?walletAddress=[address]. 这些 GET 请求使用了 Ethers library, which lets us interact with Ethereum via our RPC URL and helps us parse and decode data, the Token and NFT API v2 bundle add-on from the Quicknode Marketplace to get information about NFTs and ERC-20 Tokens via simple RPC request, and the EVM Blockbook add-on to obtain transaction history for any Ethereum address.

  • 组件 - 包含该去中心化应用(dapp)的 React 组件。

    • 资源管理器 该组件包含客户端组件,这些组件会调用 API 路由并渲染结果。
    • 页眉 该组件包含该去中心化应用(dapp)的搜索栏。

部署到 Vercel

使用 Vercel 进行部署


预览

预览

预览


Next.js 文档

如需进一步了解 Next.js,请参考以下资源:

您可以查看Next.js 的 GitHub 仓库——欢迎大家提出反馈和贡献!


投稿与反馈
我们非常希望听到您的反馈,并欢迎大家为这个示例应用做出任何贡献!
如需报告问题或提供反馈,请在 qn-guide-示例 存储库。
如需贡献,请按照以下步骤操作:
  1. 分叉该仓库
  2. 创建一个功能分支:
    git checkout -b feature/amazing-feature
  3. 提交您的更改:
    git commit -m "添加超棒的功能"
  4. 推送您的分支:
    git push origin feature/amazing-feature
  5. 提交一个拉取请求。