JSON Data Preview
Last updated
Last updated
The JSON Data Preview is a powerful tool designed to help users understand and interact with the output of Read Functions. At any point when you use a read function (excluding Read Smart Contract and Read Deployment), the function’s output will be displayed as a JSON Preview in the Function Parameters area. This preview helps users visualize the structure and actual content of the data being retrieved.
The JSON Data Preview is divided into two modals: Data Structure and Data Details. Let’s break down how these work using an example of reading price data for ETH and BTC.
The Data Structure modal provides a hierarchical preview of the data received based on the inputs of a specific read function. It shows the format and organization of the data, helping users understand how the data is structured before diving into the actual content.
For example: If you’re using a Read Market Data function to fetch the prices of ETH and BTC, the Data Structure preview will show:
ETH
USD (indicating the price in USD)
BTC
USD (indicating the price in USD)
The Data Details modal allows users to drill deeper into the actual data received. Users can open this modal by pressing the Expand button located in the top-right corner of the Data Structure preview.
In the Data Details modal, you can:
Preview Actual Data: See the live data received, such as the current price of ETH in USD or BTC in USD. For example:
ETH/USD: $3,395.07
BTC/USD: $94,349.65
Copy Data: Easily copy the data for use in downstream applications or external tools.