Socket
Socket
Sign inDemoInstall

@asbjornenge/tzkt-api

Package Overview
Dependencies
29
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @asbjornenge/tzkt-api

TzKTApi is a Node.js module to communicate with a [tzkt API](https://api.tzkt.io/).


Version published
Weekly downloads
5
increased by150%
Maintainers
1
Install size
5.60 MB
Created
Weekly downloads
 

Readme

Source

TzKTAPI

TzKTApi is a Node.js module to communicate with a tzkt API.

Heavily inspired by the dipdup-sdk.

It uses the openapi-typescript-codegen to generate the api code from the spec. It transpiles and modified this code to produce a module for Node.js in Javascript. It uses the module pattern.

It also exposes a wrapper around SignalR to ease consumption of the available websocket methods.

Install

npm i @asbjornenge/tzkt-api

Use

TzKTAPI

import { TzKTAPI } from '@asbjornenge/tzkt-api'

const api = new TzKTAPI({ BASE: 'https://api.tzkt.io' })

const contracts = await api.accounts.accountsGet({
  type: 'contract',
  limit: 10
})

console.log(contracts)

TzKTEvents

import { TzKTEvents } from '@asbjornenge/tzkt-api'

const events = new TzKTEvents({ BASE: 'https://api.tzkt.io/v1/events' })
await events.start()
events.on('head', async (head) => console.log(head))
await events.listen('head')

Test

npm test

enjoy.

FAQs

Last updated on 04 Feb 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc