
概覽
The Solana Action Blinker application allows you to create and interact with Solana Actions by parsing Solana Action URLs into their corresponding actions. With this tool, you can input a valid Action URL to view its details, connect your wallet to execute available actions, and create new actions following the provided structure. Whether you're parsing existing actions or building new ones, this app simplifies the process of interacting with Solana Action URLs.
It uses a Next.js 14 此專案採用以下方式啟動: create-next-app.
Background
Solana Actions provide a standardized way to deliver signable transactions or messages from an application directly to a user. Blinks are client apps that convert Solana Actions into shareable, metadata-rich UIs for interacting with and executing Actions. For more information, check out our Guide on Solana Actions.
開始使用
安裝依賴項
開啟專案目錄:
cd sample-dapps/solana-action-blinker
接著,安裝依賴項:
npm 安裝
# 或
yarn
# 或
pnpm 安裝
# 或
bun 安裝
設定環境變數
Make sure you have a Quicknode endpoint handy--you can get one free here.
- 重新命名
.env.example至.env.localand update with your Quicknode Solana Node Endpoint. - Make sure to update the cluster to ensure your transaction URLs point to the correct explorer (use only of the enum values provided in the
.env.examplefile).
QN_ENDPOINT=https://example.solana-mainnet.quiknode.pro/123456
NEXT_PUBLIC_CLUSTER=mainnet-beta # mainnet-beta | devnet | testnet | local
首先,執行開發伺服器:
npm 執行 dev
# 或
yarn dev
# 或
pnpm dev
# 或
bun dev
請使用瀏覽器開啟http://localhost:3000以查看結果。
使用 Dapp
- Enter a valid Solana Action URL in the input field. You may copy and paste one of the example links on the homepage.
- Click "Parse Action" to see the parsed action details.
- You will see the parsed details of the action URL. To see and execute available actions, connect a wallet.

- Click any of the available actions to execute the action (you will need to sign the transaction when prompted by your wallet).
- You may create additional actions by following the structure in
solana-action-blinker/app/api/actions
建築
src/
├── app/
│ ├── page.tsx # Main page for Blink
│ └── layout.tsx # layout for the page
│ └── api/
│ └── solana/
│ └── sendAndConfirm/route.ts # Send and Confirm Transaction
│ └── actions/
│ └── memo/route.ts # Creates a Memo Solana Action
│ └── donate/route.ts # Creates a Donate Solana Action
└── components/
│ ├── ActionComponents/ # includes components for parsing and executing Solana Actions
│ ├── Blink.tsx # Main component
│ ├── SolanaProviders.tsx # Wallet Adapter Context providers
│ └── [supporting components]
└── hooks/
│ ├── useActionFetch.ts # Fetches and parses Solana Actions from URLs
│ └── useTransactionProcessor.ts # Executes Solana Transactions
└── utils/ # includes various utility functions and constants
部署至 Vercel
Next.js 文件
若想進一步了解 Next.js,請參考以下資源:
- Next.js 文件— 了解 Next.js 的功能與 API。
- 學習 Next.js—— 一套互動式 Next.js 教學指南。
您可以瀏覽Next.js 的 GitHub 儲存庫——歡迎提供您的意見回饋與貢獻!
- 分叉此儲存庫
- 建立功能分支:git checkout -b feature/amazing-feature
- 將您的變更提交:git commit -m "新增超棒的功能"
- 推送您的分支:git push origin feature/amazing-feature
- 開啟一個 Pull Request。
