tezos-oracle
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Oracle Client

This is client software for reading / writing from the BTC / USD oracle. The following contracts are hardcoded:

Usage

Pre-requisites

Install the dependencies of the project and ts-node (allows direct execution of typescript).

$ npm i
$ npm i -g ts-node

Retrieve a BTC / USD Price

The following will output a closing price of BTC at a given timestamp. The data is read from KT1XjYrm3AX5Ptw2ZKXTPYE5ZDFWprfdihKb.

$ ts-node src/get-btc-usd-price.ts
 
Oracle Data:
BTC / USD Price: [object Object]
As of: 2020-03-29T10:53:00Z

Update the BTC / USD Price

The following will output a command to run in tezos-client to update the storage. Data is written to KT1DiFg6TxLgsCFAFmLgc9mBBUdE7TRnQzMG.

$ ts-node src/update-price.ts
<Run given command>

TODO

  • Pass contract as a param

Readme

Keywords

none

Package Sidebar

Install

npm i tezos-oracle

Weekly Downloads

0

Version

1.3.0

License

MIT

Unpacked Size

22.4 kB

Total Files

5

Last publish

Collaborators

  • tessellated-keefer