Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/helius-labs/websocket-widget
This is a landing page to test Helius Geyser Enhanced Websockets
https://github.com/helius-labs/websocket-widget
Last synced: about 2 months ago
JSON representation
This is a landing page to test Helius Geyser Enhanced Websockets
- Host: GitHub
- URL: https://github.com/helius-labs/websocket-widget
- Owner: helius-labs
- Created: 2024-04-17T18:50:20.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-05-01T15:20:01.000Z (8 months ago)
- Last Synced: 2024-05-02T10:20:08.026Z (8 months ago)
- Language: JavaScript
- Homepage: https://websocket-widget.vercel.app
- Size: 181 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Websocket Widgets
The Websocket Widget repository is a frontend playground for Helius Geyser Enhanced Websockets.
## Documentation
Hosted frontend link coming soon.
Explore the Helius Geyser Enhanced Websockets through the [Helius Websockets Documentation](https://docs.helius.dev/webhooks-and-websockets/websockets).
## Prerequisites
To run the frontend locally, ensure these requirements are met:
- Node.js 14.x or higher
- npm or yarn
- A Helius API Key## Installation
Clone the repository and install the dependencies:
```bash
git clone https://github.com/HeliusLabs/websocket-widgets.git
cd websocket-widgets/app
npm install
```## Websocket Example
Here’s a simple example of how you can open the `transactionSubscribe` Helius Geyser Enhanced Websocket using Javascript:
```javascript
const request = {
jsonrpc: "2.0",
id: 420,
method: "transactionSubscribe",
params: [
{
accountInclude: accountsIncluded,
accountRequire: accountsRequired
},
{
commitment: commitmentState,
encoding: encoding,
transactionDetails: details,
showRewards: true,
maxSupportedTransactionVersion: 1
}
]
};const wsUrl = `wss://atlas-mainnet.helius-rpc.com?api-key=${apiKey}`;
ws.current = new WebSocket(wsUrl);
ws.current.onopen = () => {
console.log('WebSocket is open');
ws.current.send(JSON.stringify(request));
};
```
## Contributing
Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.