Skip to main content
Once you have a configured BlackSwanClient instance, you can call any of the methods below to read on-chain credit data for a given wallet address. All methods are asynchronous and return promises, so you can use them with await or chain .then() callbacks.

hasSoulboundToken(wallet)

Returns true if the wallet holds a BlackSwan Soulbound Token (SBT), which is minted when a borrower takes their first loan. Use this to gate UI flows or API responses that only make sense for active borrowers.

getCreditDashboard(wallet)

Returns the complete on-chain credit profile for a wallet in a single call. This is the most comprehensive method — use it when you need to display a full credit summary.

getReputation(wallet)

Returns a concise reputation summary: total repaid volume, number of loans, and the current trust ratio.

getCurrentApr(wallet)

Returns the wallet’s current APR expressed in basis points. Divide by 1000 to convert to a human-readable percentage.

getTrustTier(wallet)

Returns the wallet’s trust tier as a single letter from A (highest) to E (lowest). Use this to display a quick at-a-glance rating.

getTrustRatio(wallet)

Returns the raw trust score as an integer between 0 and 10,000. Higher values indicate a stronger on-chain credit history.

getCreditHistory(wallet)

Returns a breakdown of the wallet’s loan history: total loans taken, loans repaid on time, and defaults.

getCurrentRisk(wallet)

Returns the wallet’s current risk score. Higher values indicate greater credit risk.

Error handling

All BlackSwanClient methods throw if the RPC call fails, the wallet address is invalid, or the on-chain data cannot be decoded. Wrap calls in a try/catch block to handle errors gracefully.