network-wiredMetric builder via API example

1

Building metic via API

Go to: https://wocfr.vercel.app/community/metric-builder?view=customarrow-up-right

2

First Dataset — PWR Committers (Find JSON URL)

On the Resources section of https://beta-api.wavesonchain.com/ you can also build custom metrics using your own API

Copy the Get All Committers link

Append it to the base URL: https://beta-api.wavesonchain.com/v1/

Final URL: https://beta-api.wavesonchain.com/v1/on-chain/power/committersarrow-up-right

Add this link into the WOC Customizer by pressing Add URL.

3

Second Dataset — PWR Stakers (Find JSON URL)

Use the PWR Stakers endpoint on the WOC API: https://beta-api.wavesonchain.com/v1/on-chain/power/stakersarrow-up-right

Add this JSON URL into the Customizer as well. Then click: Fetch JSON from URLs and Analyze JSON

4

Select Metric Type

Choose Table as the metric type.

5

Build the Table

Drag the commit list array and the stakers array into the Drop keys area.

6

Column Settings — Hide Column

For the source with address 3PEwRcYNAUtoFvKpBhKoiwajnZfdoDR6h4h:

  • Deactivate Show column to hide the column.

7

Edit “Total” Column (Source 0)

Enter the column name.

  • Set the suffix to "PWR" (add a space before the unit).

  • Divide the value by 10⁸.

8

Percentage Columns

For percentage columns:

  • Activate Display as percentage.

  • Divide the value by 100.

9

Final Steps

After entering the names of all columns:

  • Click Publish to Community

  • Enter the metric title and descriptions

  • Publish the metric