Skip to main content

Wallet Graph Response Contract v1

GET /api/wallet?address=<0x-or-ens> returns a WalletGraph document for the read-only Ethereum wallet explorer. The contract is normalized by api/wallet-contract.js before the route sends JSON.

Top-level fields

Required stable metadata:
FieldTypeNotes
contractVersion"walletGraph.v1"Stable version tag — never remove or rename
addressstringResolved Ethereum address. ENS input resolves to 0x when a provider is configured.
chain"ethereum"Currently Ethereum only
providerstringPrimary wallet activity provider, e.g. etherscan, alchemy_only, or demo. Falls back to "unknown" when not derivable.
sourcestringNormalized source class: live, real, partial, or mock
sourcesobjectProvider map for backwards compatibility. Current fields: walletActivity, prices
dataQualityobjectNormalized quality object
isFallbackbooleanTop-level alias for dataQuality.isFallback
transactionSampleobjectSample metadata for loaded normal transactions
apiErrorsarrayUser-safe provider/config warnings. No provider keys, URLs, or secrets.
nodesarrayGraph nodes
edgesarrayGraph edges
Existing wallet metrics remain available for compatibility: ens, ownedENSNames, totalValueUSD, totalValueEstimated, ethBalance, firstSeen, lastActive, txCount, overallRiskScore, dataConfidence, dataSource, transactions, and fingerprintScore.

Data quality

dataQuality preserves legacy booleans and adds explicit flags:
{
  "isFallback": false,
  "isDemo": false,
  "isPartial": true,
  "warnings": [],
  "flags": {
    "partial": true,
    "sampled": false,
    "fallback": false,
    "demo": false,
    "providerErrors": true
  },
  "providerErrors": [],
  "updatedAt": "2026-05-01T00:00:00.000Z"
}
FlagMeaning
partialRoute sampled data or a provider/config warning means the graph may be incomplete
sampledtransactionSample.isSampled is true
fallbackFallback pricing or demo/fallback data is being served
demoExplicit mock/demo wallet data
providerErrorsapiErrors contains partial or error severities
updatedAtIncluded only when derivable from loaded transaction sample freshness

Transaction sample

transactionSample describes loaded normal transactions, not global wallet totals:
FieldDescription
loadedCountNumber of normal transactions loaded into this response
sampleLimitConfigured sample limit, or null when no sampling limit applies
isSampledtrue when the response hit the configured sample limit
firstLoadedTxAtISO timestamp of earliest loaded transaction, or null
lastLoadedTxAtISO timestamp of latest loaded transaction, or null
totalKnownCurrently null — the route does not claim a provider total it does not have

Nodes

Each node is normalized to include:
FieldTypeNotes
idstringStable graph-local identifier, normalized to string
labelstringSanitized display label via sanitizeLabel
typestringOne of: wallet, token, defi, nft, counterparty, anomaly
volumeUSDnumberUses 0 when unavailable
interactionsnumberUses 0 when unavailable
Optional fields that may be present: fullAddress, color, volumeEstimated, riskScore, balanceUSD, priceUSD, firstSeen, lastActive, protocolAttributionConfidence, timeline, topCounterparties, delta7d, anomalies, opportunities.
Node type values are constrained to the six values listed above. Do not add new node types without updating this contract.

Edges

Each edge is normalized to include:
FieldTypeNotes
sourcestringSource node id
targetstringTarget node id
weightUSDnumberUSD-like edge weight used by the current graph
weightnumberNumeric alias, derived from weightUSD when no explicit weight exists
txCountnumberNumeric interaction count
Current edge relationships: wallet-to-token, token-to-protocol, and token-to-counterparty, derived from loaded Ethereum wallet activity.

Serialization guardrails

  • _observabilityMeta is stripped before the response is sent and must not appear in the response body.
  • No provider API key or secret material may appear in any serialized field.
  • apiErrors[].message is sanitized via sanitizeApiErrorMessage before the route returns.
  • Node label values are sanitized via sanitizeLabel — phishing/spam symbols are redacted.

Non-goals

  • No Solana holder analytics are claimed or implied.
  • No new provider data is invented.
  • No UI layout, loading screen, typography, or graph rendering behavior is part of this contract.
  • Do not add new top-level fields to the wallet response without updating this document.