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)
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)
getReputation(wallet)
getCurrentApr(wallet)
1000 to convert to a human-readable percentage.
getTrustTier(wallet)
A (highest) to E (lowest). Use this to display a quick at-a-glance rating.
getTrustRatio(wallet)
0 and 10,000. Higher values indicate a stronger on-chain credit history.
getCreditHistory(wallet)
getCurrentRisk(wallet)
Error handling
AllBlackSwanClient 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.