1.15.0 • Published 5 years ago

@tokenanalyst/sdk v1.15.0

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

TokenAnalyst SDK

The full documentation for the SDK can be found on the official documentation website https://docs.tokenanalyst.io/.

How to use it in the browser

Just add it to the head of your HTML document. The function console.log is called everytime a new event arrives on that stream.

<head>
  <script src="https://s3.amazonaws.com/cdn.tokenanalyst.io/sdk.latest.js"></script>
  <script>
    const t = new ta.TokenAnalyst();
    t.streams.transactionsWithLabelsAndPrice.subscribe(console.log);
  </script>
</head>

How to use it in your NodeJS project

Create a new project

$ npm init
$ npm install @tokenanalyst/sdk

Then you are able to consume the latest transaction stream with prices and labels. The .subscribe function takes a callback function, called for every new event and optionally a list of predicates that have to match to filter the stream.

const {TokenAnalyst, FromAddress, FromOrToLabelExists, USDGreaterThan } =\
	require('@tokenanalyst/sdk');

const ta = new TokenAnalyst()
ta.streams.transactionsWithLabelsAndPrice.subscribe(console.log,
  predicates = [
  new FromAddress("0x0d0707963952f2fba59dd06f2b425ace40b492fe"),
  new FromOrToLabelExists(),
  new USDGreaterThan(100)
]);

How to build the library

$ npm install 

For building the browser library to interface the API

$ npm run build-web

For building the NodeJS module to interface the API

$ npm run build-node
1.15.0

5 years ago

1.14.0

5 years ago

1.13.0

5 years ago

1.12.0

5 years ago

1.11.0

5 years ago

1.10.0

5 years ago

1.9.0

5 years ago

1.8.5

5 years ago

1.8.4

5 years ago

1.8.3

5 years ago

1.8.2

5 years ago

1.8.1

5 years ago

1.8.0

5 years ago

1.7.0

5 years ago

1.6.0

5 years ago

1.5.0

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago