0.3.3 • Published 10 months ago

@chronicleprotocol/pull-oracle v0.3.3

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

10 months ago

0.3.2

10 months ago

0.3.1

11 months ago

0.3.0

11 months ago

0.2.9

11 months ago

0.2.8

11 months ago

0.2.7

11 months ago

0.2.6

11 months ago

0.2.5

12 months ago