1.1.11 • Published 12 months ago

@parsiq/tsunami-client v1.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months 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

12 months ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago