0.3.3 • Published 2 years ago

@chronicleprotocol/pull-oracle v0.3.3

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

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago