0.1.5 • Published 6 days ago

@duneanalytics/client-sdk v0.1.5

Weekly downloads
-
License
-
Repository
github
Last release
6 days ago

Styled With Prettier Build

Dune Client TS

This NPM package implements all the basic routes defined in the Dune API Docs. It also introduces a convenience method refresh which combines executeQuery, getExecutionStatus and gettExecutionResults in a way that makes it nearly trivial to fetch query execution results.

Install the package

yarn add @duneanalytics/client-sdk
import { QueryParameter, DuneClient } from "@duneanalytics/client-sdk";
const { DUNE_API_KEY } = process.env;

const client = new DuneClient(DUNE_API_KEY ?? "");
const queryID = 1215383;
const params = {
  query_parameters = [
    QueryParameter.text("TextField", "Plain Text"),
    QueryParameter.number("NumberField", 3.1415926535),
    QueryParameter.date("DateField", "2022-05-04 00:00:00"),
    QueryParameter.enum("ListField", "Option 1"),
  ]
};

client
  .runQuery(queryID, params)
  .then((executionResult) => console.log(executionResult.result?.rows));

// should look like
// [
//    {
//      date_field: "2022-05-04 00:00:00.000",
//      list_field: "Option 1",
//      number_field: "3.1415926535",
//      text_field: "Plain Text",
//    },
//  ]

Note also that the client has methods executeQuery, getExecutionStatus, getExecutionResult and cancelExecution

Check out this Demo Project!

0.1.5

6 days ago

0.1.4

1 month ago

0.1.0

1 month ago

0.1.2

1 month ago

0.1.1

1 month ago

0.0.5

2 months ago

0.1.3

1 month ago

0.0.4

3 months ago

0.0.3

3 months ago