tezos-oracle

This is client software for reading / writing from the BTC / USD oracle. The following contracts are hardcoded: - [Oracle contract to read from](https://you.better-call.dev/carthagenet/KT1XjYrm3AX5Ptw2ZKXTPYE5ZDFWprfdihKb/storage) - [Oracle contract to wr

Usage no npm install needed!

<script type="module">
  import tezosOracle from 'https://cdn.skypack.dev/tezos-oracle';
</script>

README

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