Getting Started

Helps user get their API keys and interact with the protocol.

Quick Setup

After you are done with per-requisites, follow the given steps :

  • Visit www.doot.foundation and click on the Dashboard.

  • As soon as you visit the Dashboard, you will be shown a prompt asking you to connect your wallet with the website. Click on connect.

  • If you are a new user, another pop-up will now appear before you to generate an API key. Hit Onboard and wait for a few seconds for the next wallet interaction to appear.

  • Once clicked, the Auro Wallet extension will ask for your signature over a simple message, the signature is to prove the ownership of the account and one such signature is only valid for 60 seconds.

  • After you have copied the API key, navigate to your project and install the client package using npm/yarn as :

cd my_project/
npm install @doot-oracles/client

As of now, Doot supports 5 asset prices including : $MINA, $ETH, $BTC, $LINK and $SOL.

  • Move over to your interact.ts script (Or the .ts file through which you are interacting with your zkApp's smart contract) and include the following lines to fetch the latest price of say $MINA.

The valid values for client.Price() are : 'mina', 'ethereum', 'chainlink', 'solana' and 'bitcoin'.

The following step fetches the latest price of $MINA and stores it in your variable.

ClientResultObject is an interface defining the data returned and their types. The Result contains the following data :

  • asset : The name of the asset.

  • price : The fetched price as a multiple of 10**decimals since Mina smart contracts can't handle floating point numbers.

  • decimals : The multiplication factor.

  • signature : The signature over price. The signature is crucial and can be used as a proof that yes the price was returned by the oracle's Public Key. Is a base58 value.

  • oracle : The Public Key of the oracle. Is a base58 value.

Last updated