0.3.3 • Published 1 year ago

@chronicleprotocol/pull-oracle v0.3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Documentation

Check the documentation for more details.

Getting Started

Install the SDK

npm install --save @chronicleprotocol/pull-oracle

Usage

Generating authentication tokens on the server:

import { signAuthToken } from "@chronicleprotocol/pull-oracle";

const { token, message } = signAuthToken({
	// private key is 0x prefixed 32 byte hex string
	privateKey: "0xabc...",
});

Your public signing address must be allow-listed on our servers before your tokens will be valid.

Authenticating a user session on the client and fetching prices:

import { authenticate, getPrices } from "@chronicleprotocol/pull-oracle";

// token is received from the server
// `authenticate` caches the token in memory so it only needs to be called once per session
authenticate(token);

const prices = await getPrices([{ wat: "MKR/USD" }, { wat: "ETH/USD" }]);
0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago