https://github.com/solguru310/wormhole-queries-ts-sdk-example
This project showcases how the Wormhole Queries TS-SDK facilitates on-demand, attested, and on-chain verifiable RPC results across blockchain networks, using a simple REST API call.
https://github.com/solguru310/wormhole-queries-ts-sdk-example
blockchain queries rest-api rpc solana typescript-sdk wormhole
Last synced: 5 months ago
JSON representation
This project showcases how the Wormhole Queries TS-SDK facilitates on-demand, attested, and on-chain verifiable RPC results across blockchain networks, using a simple REST API call.
- Host: GitHub
- URL: https://github.com/solguru310/wormhole-queries-ts-sdk-example
- Owner: solguru310
- Created: 2024-10-04T06:53:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-04T07:10:40.000Z (over 1 year ago)
- Last Synced: 2024-10-18T18:53:38.001Z (over 1 year ago)
- Topics: blockchain, queries, rest-api, rpc, solana, typescript-sdk, wormhole
- Language: TypeScript
- Homepage:
- Size: 41 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solana Wormhole Queries TS-SDK Example
## Overview
This project showcases how the Wormhole Queries TS-SDK provides on-demand, attested, and on-chain verifiable RPC results across blockchain networks via a user-friendly REST API call. Before running the scripts, ensure that the required configurations are in place and the QUERIES_API_KEY environment variable is set.
## Prerequisites
Ensure you have the following installed on your system:
- Node.js & TypeScript
- npm or yarn
- A Wormhole Queries API Key
- Request your API key through [this form](https://forms.clickup.com/45049775/f/1aytxf-10244/JKYWRUQ70AUI99F32Q)
## Setup
1. **Clone the Repository:**
```bash
git clone https://github.com/solguru310/wormhole-queries-ts-sdk-example.git
cd /wormhole-queries-ts-sdk-example
```
2. **Install Dependencies:**
```bash
npm install
```
or
```bash
yarn
```
## Running one of the Scripts
```bash
QUERIES_API_KEY= npx tsx query_usdc_sep.ts
```
## Error Handling
When using the Wormhole Queries TS-SDK, you may encounter various error codes. Here's what they mean:
- 400 - bad request (malformed input or bytes)
- 401 - authorization required (missing API key)
- 403 - forbidden (invalid API key)
- 500 - future failed to reach consensus (e.g. received 14 responses but 7 with one result and 7 with another)
- 504 - did not reach consensus in < 1m. The network drops malformed requests, so a persistent 504 is likely due to an invalid query request.
If you encounter any of these errors, double-check your API key, ensure your input is correctly formatted, and verify your network connection.
## Further Reading
For a deeper insight into Wormhole Queries and its foundational concepts, we recommend reviewing the detailed [whitepaper](https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0013_ccq.md#cross-chain-queries-ccq).
It offers extensive information on the architecture, security considerations, and implementation details of Wormhole Cross-chain Queries.
## Contact me
If you need more technical support and development inquires, you can contact below.
Telegram: [@dwlee918](https://t.me/@dwlee918)
Twitter: [@derricklee918](https://x.com/derricklee918)