@sentio/api

1.0.2 • Public • Published

Sentio API

npm version Release

Setup

pnpm add @sentio/api

Usage

Example 1: get project list

import { client, WebService } from "@sentio/api";

client.setConfig({
  auth: process.env.SENTIO_API_KEY,
});
const projects = await WebService.getProjectList();
console.log(projects);

Example 2: insight query

import { client, DataService } from "@sentio/api";

client.setConfig({
  auth: process.env.SENTIO_API_KEY,
});

const res = await DataService.query({
  path: {
    owner: "sentio",
    slug: "coinbase",
  },
  body: {
    timeRange: {
      start: "now-30d",
      end: "now",
      step: 3600,
      timezone: "America/Los_Angeles",
    },
    limit: 20,
    queries: [
      {
        metricsQuery: {
          query: "cbETH_price",
          alias: "",
          id: "a",
          labelSelector: {},
          aggregate: undefined,
          functions: [],
          disabled: false,
        },
        dataSource: "METRICS",
        sourceName: "",
      },
    ],
    formulas: [],
    cachePolicy: {
      noCache: false,
      cacheTtlSecs: 1296000,
      cacheRefreshTtlSecs: 1800,
    },
  },
});
console.log(res);

Documentation

Sentio API Reference

Readme

Keywords

none

Package Sidebar

Install

npm i @sentio/api

Weekly Downloads

1,665

Version

1.0.2

License

Apache-2.0

Unpacked Size

315 kB

Total Files

19

Last publish

Collaborators

  • zfy0701
  • longw
  • allendragon
  • pooytr1
  • rnons
  • lzx_lizixing