Analyze MultiversX address

POST /{api_key}/mvx/profile/{address}

Limitations

The analyzed address must have :

  • more than 100 transactions

  • less than 10 000 transactions

If requirements are not met, the API will return an error with the code 400.

Exemple

Using React, you can have this render:

To achieve this rendering, create a React component named UserProfileAnalyzeChart.

In this code, the parameter labelsByWeight contains the repartition data from the API response.

import {
    Chart as ChartJS,
    RadialLinearScale,
    PointElement,
    LineElement,
    Filler,
    Tooltip,
    Legend,
    ArcElement,
    ChartOptions
} from 'chart.js';
import { Doughnut } from 'react-chartjs-2';

ChartJS.register(
    RadialLinearScale,
    PointElement,
    LineElement,
    Filler,
    Tooltip,
    Legend,
    ArcElement
);


export function UserProfileAnalyzeChart({
        labelsByWeight
    }) {

    const labelsFromProfile = labelsByWeight ? Object.keys(labelsByWeight) : [];
    const dataFromProfile = labelsByWeight ? Object.values(labelsByWeight) : [];

    const data = {
        labels: labelsFromProfile,
        datasets: [
            {
                label: 'percent',
                data: dataFromProfile,
                backgroundColor: [
                    'rgba(255, 145, 0, 0.1)',
                    'rgba(255, 0, 145, 0.1)',
                    'rgba(145, 255, 0, 0.1)',
                    'rgba(255, 0, 0, 0.1)',
                    'rgba(0, 255, 145, 0.1)',
                    'rgba(255, 145, 145, 0.1)',
                    'rgba(145, 0, 255, 0.1)',
                    'rgba(255, 255, 0, 0.1)'
                ],
                borderColor: [
                    'rgba(255, 145, 0, 1)',
                    'rgba(255, 0, 145, 1)',
                    'rgba(145, 255, 0, 1)',
                    'rgba(255, 0, 0, 1)',
                    'rgba(0, 255, 145, 1)',
                    'rgba(255, 145, 145, 1)',
                    'rgba(145, 0, 255, 1)',
                    'rgba(255, 255, 0, 1)'
                ],
                borderWidth: 1,
                pointRadius: 0,
                tension: 1,
            },
        ],
    };

    const options = {
        plugins: {
            legend: {
                align: "center",
                position: "right",
            }
        }
    };

    return (
        <Doughnut data={data} options={options} />
    );
}

Last updated