Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@cowprotocol/ts-dune-client

Package Overview
Dependencies
Maintainers
8
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cowprotocol/ts-dune-client

Node Client for Dune Analytics' officially supported API.

  • 0.0.0-beta.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created
Source

Dune Client TS

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

Install the package

yarn add @cowprotocol/ts-dune-client
import { QueryParameter, DuneClient } from "@cowprotocol/ts-dune-client";

const client = new DuneClient(apiKey);
const queryID = 1215383;
const 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"),
];

const execution_result = await client.refresh(queryID, parameters);

console.log(execution_result.result?.rows);

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

Note also that the client has methods execute, getStatus, getResult and cancelExecution

FAQs

Package last updated on 05 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc