@gudman/four-life-sdk
v0.1.0
Published
TypeScript SDK for the FOUR-LIFE Certified trust layer — Four.meme token grading, risk snapshots, creator scores, operator checklists.
Maintainers
Readme
@gudman/four-life-sdk
TypeScript SDK for the FOUR-LIFE Certified trust layer — Four.meme token grading, risk snapshots, creator scores, operator checklists.
Zero runtime dependencies. Works in browsers, Node 18+, Deno, Bun, and edge runtimes.
Install
npm install @gudman/four-life-sdkQuick start
import { FourLife } from "@gudman/four-life-sdk";
const fl = new FourLife();
// Grade any Four.meme token — deterministic, auditable.
const { badge } = await fl.getBadge("0x00ea33ab439c3fad06a6a824f3dbfade01334444");
console.log(badge.tier); // "graduation_watch"
console.log(badge.label); // "Graduation Watch"
console.log(badge.why[0].rule); // "curve_advanced"
console.log(badge.why[0].passed); // trueWhat you can do
Grade a token
const { badge } = await fl.getBadge(tokenAddress);
// badge.tier: "graduated" | "graduation_watch" | "healthy" | "at_risk" | "observed"
// badge.why[] — full rule trace: rule name, metric, value, threshold, operator, pass/failPull the full risk snapshot
const snap = await fl.getRiskSnapshot(tokenAddress);
// snap.risk_level: "critical" | "high" | "medium" | "info" | "low"
// snap.evidence[] — every flag with severity, metric, and human-readable messageCheck a creator's track record
const creator = await fl.getCreatorScore(walletAddress);
// creator.trust_tier: "proven" | "emerging" | "new_creator" | "unproven" | "unknown"
// creator.graduation_rate, creator.evidence[] — every launch we've observedScan the live radar
const { radar } = await fl.getGraduationRadar({
limit: 20,
quoteAsset: "BNB",
minConfidence: "high",
sortBy: "graduation_probability",
});
for (const token of radar) {
console.log(token.symbol, token.graduation_probability, token.confidence_score);
}Watch a token or the full radar
const unwatch = fl.watchToken(tokenAddress, (badge) => {
if (badge.badge.tier === "at_risk") alertDiscord(badge);
if (badge.badge.tier === "graduated") celebrate(badge);
});
// Stop later
unwatch();Get the 72h operator checklist
const { checklist } = await fl.getOperatorChecklist(tokenAddress);
// Deterministic, phase-aware action items (nurture/defend/accelerate/graduated).Inspect contract-level rug risk
const risk = await fl.getContractRisk(tokenAddress);
// risk.risk_score (0-100), risk.flags[] — mint, blacklist, pause, proxy, ownershipTrigger an AI-generated raise plan
const plan = await fl.generateRaisePlan(tokenAddress);
// 72h phased plan using the actual pair-aware graduation targetVerify on-chain identity (ERC-8004 / BRC-8004)
const identity = await fl.getIdentity();
// identity.registration.agent_id, identity.reputation_attestations[]Monitor DGrid gateway usage
const stats = await fl.getDGridStats();
// stats.usage_by_provider, stats.fallback_events, stats.task_model_mapConfiguration
const fl = new FourLife({
baseUrl: "https://four-life.gudman.xyz", // default
apiSecret: "sk_...", // only needed for trackToken()
timeoutMs: 20_000, // per-request timeout
fetch: customFetch, // override for Node < 18
});Error handling
Every call throws FourLifeError on failure:
import { FourLife, FourLifeError } from "@gudman/four-life-sdk";
try {
await fl.getBadge(addr);
} catch (err) {
if (err instanceof FourLifeError) {
console.log(err.status, err.body); // HTTP status + parsed body
}
}Why FOUR-LIFE Certified?
Every badge is computed from raw on-chain metrics — no LLM in the trust path. Each response includes a why[] rule trace so you can verify the grade yourself.
- Pair-aware graduation targets — sources live from Four.meme's
/public/config(BNB → 18, USD1 → 12 000, etc.) - Deterministic risk flags — whale concentration, sell pressure, stalled curve, holder stagnation, contract rug overrides
- ERC-8004 reputation — every graduated token produces an on-chain attestation
- Contract-level rug detection — mint, blacklist, proxy, pause, ownership, honeypot patterns
License
MIT — see LICENSE.
Links
- Live site: https://four-life.gudman.xyz
- Radar: https://four-life.gudman.xyz/radar
- Browser extension: https://github.com/Ridwannurudeen/four-life/tree/master/extension
- One-line embed widget: https://four-life.gudman.xyz/embed
- Main repo: https://github.com/Ridwannurudeen/four-life
