This repository contains reference implementations of Solana Actions using Hono.
First, run the development server:
npm install
npm run dev- Place your api key to
TENSOR_API_KEYconstant in tensor-api.ts
- See Jupiter Swap Action example
- Build your own action
- Use specified openapi
responsesfrom openapi.ts for your POST, GET methods - Use specified openapi
bodyfrom openapi.ts for your POST methods
- Use specified openapi
- Add your router to index.ts
Open http://localhost:3000/swagger-ui with your browser to explore actions.
To check and unfurl your or existing action open
https://actions.dialect.to/
e.g action for swap on Jupiter: localhost:3000/api/jupiter/swap/SOL-Bonk
There is a simple donate action in this repo which serves as a template for creating your own actions.
There are also a few example actions in this repository for Jupiter (swap), Helius (stake), Meteora (swap), Sanctum (stake), and Tensor (buy floor or bid).
You can find the code for these actions in the examples directory.
You can also unfurl these actions into Blinks on https://dial.to by entering the action URL into the Blink URL field.
For example, to unfurl the Helius stake action, you would enter the following URL into the Blink URL field:
http://localhost:3000/api/helius/stake
To learn more about Hono, take a look at the following resources:
- Hono Documentation - learn about Hono features and API.