@exodus/account-security

中文文档
1.1.1发布于 2026/10/10MITTypeScriptES Module近 30 天下载 1.1万

This Exodus SDK feature reports active account security warnings (GLOBAL_SCAM / LOST_PERMISSIONS) into the Safe Report.

原始使用文档
文档目录6 节
  1. Install
  2. Usage
  3. What it reports
  4. Severity precedence
  5. How an asset opts in
  6. Dependencies

@exodus/account-security

This Exodus SDK feature reports active account security warnings (GLOBAL_SCAM / LOST_PERMISSIONS) into the Safe Report.

These warnings already surface to users as modals in the desktop and mobile apps, but the Safe Report carried no record of them. When a user hits one and reaches out to support, there was previously no way to tell from the report which asset triggered the alert or which warning fired. This feature closes that gap.

Install

pnpm add @exodus/account-security

Usage

This feature is designed to be used together with @exodus/headless, where it is already wired in. See using the sdk.

It contributes a report node namespaced at accountSecurity, so its output shows up under that key whenever a Safe Report is assembled via exodus.reporting.export(). There is no exodus.* API surface, no atoms, and no plugin: the feature only reads existing state at report time.

What it reports

At report time the feature walks the account states of every enabled base asset, runs that asset's api.securityChecks({ accountState }), and collects any account that comes back insecure.

The report is null when there is no wallet or the wallet is locked. Otherwise it has the shape:

{
  summary: {
    // The most severe active warning, or null when there are none.
    warningType: 'GLOBAL_SCAM' | 'LOST_PERMISSIONS' | null
    hasWarnings: boolean
  }
  // One entry per (wallet account, asset) that failed its security check.
  warnings: Array<{
    walletAccount: string
    assetName: string
    type: 'GLOBAL_SCAM' | 'LOST_PERMISSIONS'
    reason: string
  }>
  // One entry per base asset whose securityChecks method threw.
  checkFailures: Array<{
    walletAccount: string
    assetName: string
    error: SafeError
  }>
}

Example output:

{
  "summary": { "warningType": "GLOBAL_SCAM", "hasWarnings": true },
  "warnings": [
    {
      "walletAccount": "exodus_0",
      "assetName": "tron",
      "type": "GLOBAL_SCAM",
      "reason": "Account is globally blacklisted."
    },
    {
      "walletAccount": "exodus_1",
      "assetName": "ethereum",
      "type": "LOST_PERMISSIONS",
      "reason": "Account is delegated to a non-whitelisted EIP-7702 address."
    }
  ],
  "checkFailures": []
}

Severity precedence

GLOBAL_SCAM outranks LOST_PERMISSIONS because it can block the app at startup. When both kinds are present across accounts, summary.warningType reports GLOBAL_SCAM, while warnings still lists every individual warning regardless of type.

How an asset opts in

This feature does not implement any detection logic itself, it only aggregates. The actual checks live in each asset's plugin, which exposes a synchronous api.securityChecks method:

asset.api.securityChecks({ accountState }): {
  isSecure: boolean
  type: 'GLOBAL_SCAM' | 'LOST_PERMISSIONS' | null
  reason: string | null
}

An account is only included in warnings when isSecure is false. To keep the report robust, the following are handled conservatively:

  • Tokens and non-base assets: only base assets (where asset.baseAsset.name === assetName) are checked.
  • Assets without securityChecks: assets that don't implement the method are ignored.
  • Disabled assets: anything not enabled in enabledAssetsAtom is skipped.
  • Throwing checks: if a single asset's securityChecks throws, the error is captured in checkFailures as a SafeError with the safe hint account-security: report/security-checks. The loop still continues, so one broken asset cannot sink the rest of the report.

Dependencies

The report node depends on assetsModule, accountStatesAtom, and enabledAssetsAtom, all provided by the SDK.

版本与发布记录

@exodus/account-security 共发布 3 个版本,首次发布于 2026/06/25;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.1.1latest2026/10/101 个月前
1.1.02026/06/254 个月前
1.0.02026/06/254 个月前

关于 @exodus/account-security 的常见问题

@exodus/account-security 是什么?

This Exodus SDK feature reports active account security warnings (GLOBAL_SCAM / LOST_PERMISSIONS) into the Safe Report.

如何安装 @exodus/account-security?

在项目目录运行 npm install @exodus/account-security,或使用 pnpm add / yarn add / bun add。

@exodus/account-security 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@exodus/account-security 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@exodus/account-security 可以商用吗?

@exodus/account-security 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@exodus/account-security 的下载量有多少?

根据 npm 官方下载统计,@exodus/account-security 在 2026/10/14 – 2026/11/12 这 30 天内被下载 10,899 次,日均约 363 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@exodus/account-security 还在维护吗?

最新版本 1.1.1 发布于 2026/10/10(1 个月前);至今共发布 3 个版本,其中过去 12 个月发布了 3 个;首次发布于 2026/06/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。