Frontend and Node engineers · ships in 3 minutes

How to scan any wallet with the TrustLayer SDK

You want wallet intelligence inside your app without writing fetch calls or handling an API key.

The problem

Most reputation APIs only answer for addresses already in their database, so a first-time visitor gets a blank. The wallet endpoint resolves cold-start addresses from public chain data instead, and the SDK wraps it in two typed calls.

Step by step

  1. 1. Import the browser SDK

    ESM module served from the edge — nothing to install, works in the browser, Deno and Bun.

    import { scanWallet, isTrustworthyWallet }
      from 'https://trustlayer.web.id/sdk/trustlayer.js';
  2. 2. Scan an address

    Returns the score plus the intelligence breakdown. Cached reads answer in well under a second; a first live deep scan takes a few seconds.

    const scan = await scanWallet('0xB25583Dfae9f70e5b234c4472c93B05Cb4B77aAc');
    
    scan.trust_score;                      // 0-100
    scan.intelligence.wallet_age_days;
    scan.intelligence.chains_active;
    scan.intelligence.sybil_risk;          // low | medium | high | critical | unknown
    scan.intelligence.entropy_status;      // insufficient_data | human_like | machine_like
    scan.scan_type;                        // cache_hit | live_deep_scan
  3. 3. Gate in one line

    Set your own thresholds; the rule is evaluated locally so it is deterministic and easy to unit-test.

    const ok = await isTrustworthyWallet(address, {
      minScore: 50,
      maxSybilRisk: 'low',
      blockAutomated: true,
    });
    if (!ok) return res.status(403).json({ error: 'wallet_rejected' });
  4. 4. Handle thin histories honestly

    Addresses with fewer than ten transactions return insufficient_data instead of a guessed verdict. Treat that as "ask for another signal", not as "reject".

    if (scan.intelligence.entropy_status === 'insufficient_data') {
      // fall back to a vouch, a badge or your own KYC step
    }

Share the proof

Once you are live, show it. This badge stays up to date on its own and links visitors back to the verifiable profile behind the score.

<a href="https://trustlayer.web.id/u/your-handle">
  <img src="https://trustlayer.web.id/badge/your-handle.svg" alt="Verified on TrustLayer" height="28" />
</a>

Frequently asked questions

Next recipes

All 7 recipes are on the API recipes index.