0.1.2 • Published 3 months ago

@riverfl0w/dune-client v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Dune API Client

A TypeScript client for querying the Dune API, designed to simplify the integration of Dune's powerful analytics into your projects.

!IMPORTANT
This package is still in very early development and cannot be considered as stable until v1. Riverflow commits to maintain this project as best as possible.

Install

npm install @riverfl0w/dune-client

Usage

First, you have to get an Dune API key.

Instanciate the DuneClient:

import { DuneClient } from '@riverfl0w/'

const client = new DuneClient('[your api key]');
const result = await client.query.execute({ query_id: 3453659 });

console.log('Execution ID:', result.execution_id);

Supported API methods

We implemented a 1:1 mapping of the Dune API routes:

RouteMethod
POST /v1/query/{{query_id}}/executeclient.query.execute
GET /v1/query/{{query_id}}/resultsclient.query.results
POST /v1/execution/{{execution_id}}/cancelclient.execution.cancel
GET /v1/execution/{{execution_id}}/statusclient.execution.status
GET /v1/execution/{{execution_id}}/resultsclient.execution.results

Custom refresh method

We added a method to refresh a query (execute + wait for results):

// execute query 3453659 and wait for the execution results
const results = await client.refresh({ query_id: 3453659 });

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thank you to all the contributors who have helped with the development of this client.
  • Special thanks to Dune for providing the API that inspired this project.
0.1.2

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago