tranzguard-sdk
v1.0.0
Published
TranzGuard crypto address verification SDK — verify any wallet address against 44 real-time threat feeds before signing.
Maintainers
Readme
tranzguard-sdk
Crypto address verification SDK for TranzGuard's public API.
npm install tranzguard-sdkQuick start
import TranzGuard from 'tranzguard-sdk'
const tg = new TranzGuard()
const result = await tg.verifyAddress({
address: '0x71C7656EC7ab88b098defB751B7401B5f6d8976F',
chain: 'ethereum',
})
if (!result.safe) {
console.warn('Block transaction:', result.flags, result.recommendation)
}With API key (10K req/day)
const tg = new TranzGuard({ apiKey: process.env.TRANZGUARD_API_KEY })Email [email protected] for an API key.
Supported chains
ethereum, bitcoin, solana, tron, bnb, polygon, arbitrum,
optimism, avalanche, base.
Result shape
type VerifyResult = {
address: string
chain: Chain
safe: boolean // true if risk_score < 30
risk_score: number // 0..100, higher = riskier
flags: string[] // ['known_drainer', 'tornado_cash_connected', …]
sources: string[] // ['tranzguard_db', 'cisa_kev', 'ofac_sdn', …]
recommendation: string
latency_ms: number
checked_at: string // ISO 8601
powered_by: string
}Rate-limit awareness
After every call, tg.lastRateLimit is populated with { limit, remaining,
resetAt } parsed from the X-RateLimit-* response headers. On 429 the SDK
throws a TranzGuardError whose retryAfterSeconds field is set from the
Retry-After header.
import { TranzGuardError } from 'tranzguard-sdk'
try {
const r = await tg.verifyAddress({ address, chain })
} catch (e) {
if (e instanceof TranzGuardError && e.status === 429) {
console.warn(`Rate-limited, retry in ${e.retryAfterSeconds}s`)
}
}Browser usage
The SDK uses the global fetch. Works in any modern browser, in service
workers, in Node 18+, in Cloudflare Workers, in Deno, and in React Native.
Custom fetch / proxy / Node 16 fallback
import nodeFetch from 'node-fetch'
const tg = new TranzGuard({
fetch: nodeFetch as unknown as typeof fetch,
timeoutMs: 5_000,
})License
MIT
