Developer Tooling

SafeFi provides a full suite of developer tools to allow seamless integration of its risk layer into DeFi applications, wallets, analytics dashboards, and even smart contracts. Developers can embed protection mechanisms, fetch real-time risk scores, and configure AI-based controls tailored to their application logic.

SDKs & API

  • REST API: Query risk scores, contract risk profiles, alert logs, and real-time AI evaluations. Supports GET and POST endpoints for:

    • /risk/contract/:address

    • /risk/wallet/:address

    • /alerts/latest

    • /score/custom (for custom payloads)

  • JavaScript SDK: Lightweight SDK to plug SafeFi into dApps, extensions, and frontend logic. Functions include:

    • getContractRisk(address)

    • monitorWallet(address, options)

    • onAlert(callback) to subscribe to real-time alerts

  • Python SDK: Designed for analytics platforms and backend services. Use cases include risk assessment pipelines, event correlation, and on-chain forensic tooling.

  • Solidity Adapter Library: A Solidity contract module that protocols can import. Provides beforeTransfer(), beforeBorrow(), or beforeSwap() hooks to perform SafeFi checks before executing high-risk actions.

  • GraphQL Access (Coming Soon): For developers needing granular, complex queries across all SafeFi indexed data (risk events, contracts, threat sources).

Use Case Examples

  • Integrate with wallet extensions for auto-alerts on risky token transfers

  • Protocols can call Guard during execute() for custom vault safety

Last updated