Skip to main content
Every wallet on BlackSwan has a trust score expressed as a ratio and a corresponding tier (A through E). This tutorial shows you how to fetch that data and build visual components that communicate creditworthiness at a glance.

Prerequisites

Install the BlackSwan JavaScript SDK:

Client Setup

Create a shared client instance to use across your components:

Fetching the Trust Ratio

Use getTrustRatio to retrieve the raw trust score for a wallet address:

Visual Trust Indicator

The trust ratio maps to a letter tier. Render a colored badge that reflects that tier so users can immediately understand their credit standing:

Trust Progress Bar

A progress bar gives users an intuitive sense of how close they are to the next tier. The trust ratio is a value from 0 to 10000, so divide by 100 to express it as a 0–100% bar width: