1.1.11 • Published 25 days ago

@parsiq/tsunami-client v1.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
25 days ago

PARSIQ Tsunami API JS client

Easy access to PARSIQ Tsunami API, using this JS client.

Getting Started

Install via npm:

$ npm i @parsiq/tsunami-client

Set credentials and select a chain to query:

import { ChainId, TsunamiApiClient } from '@parsiq/tsunami-client';

const tsunami = new TsunamiApiClient(process.env.TSUNAMI_API_KEY, ChainId.ETH_MAINNET);

Don't forget to pass TSUNAMI_API_KEY environment variable to your script.

Usage

Run requests to Tsunami API:

console.log((await tsunami.getLatestBlock()).number);

Fetch events:

for await (const event of tsunami.getEvents(
  { contract: ['0x1e2fbe6be9eb39fc894d38be976111f332172d83'] },
  { block_number_start: 0, block_number_end: 'latest' },
)) {
  console.log(event);
}

Switch to another chain:

tsunami.setChain(ChainId.AVALANCHE_MAINNET);
console.log((await tsunami.getLatestBlock()).number);

More documentation

Documentation and examples are available at https://docs.parsiq.net/

1.1.11

25 days ago

1.1.10

3 months ago

1.1.9

4 months ago

1.1.8

9 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

10 months ago

1.1.4

10 months ago

1.1.1

12 months ago

1.1.0

1 year ago

1.1.3

11 months ago

1.1.2

12 months ago

1.0.0

1 year ago

0.0.1

1 year ago