{
  "openapi": "3.1.0",
  "info": {
    "title": "Wallet Sweep API",
    "description": "\n<div>\n  <h3>Wallet Sweep</h3>\n  <p>XCoin Sweep provides realtime wallet sweep APIs for TRON addresses, including sweep setting management, monitored address maintenance, and admin queries.</p>\n  <p>Open API endpoints use API Key signature authentication with <code>CF-ACCESS-KEY</code>, <code>CF-ACCESS-TIMESTAMP</code>, and <code>CF-ACCESS-SIGN</code> request headers.</p>\n  <p>Public, realtime, and admin endpoints use <code>Authorization: Bearer &lt;token&gt;</code> when authentication is required.</p>\n</div>\n",
    "version": "0.1#29"
  },
  "servers": [
    {
      "url": "http://api.catfee.io",
      "description": "Generated server url"
    }
  ],
  "security": [{ "Authorization": [] }],
  "tags": [
    {
      "name": "Sweep Open API Service",
      "description": "Sweep Open API 服务(API Key)"
    }
  ],
  "paths": {
    "/v1/sweep/open/address": {
      "post": {
        "tags": ["Sweep Open API Service"],
        "summary": "添加地址",
        "operationId": "sweepAddressAdd",
        "parameters": [
          {
            "name": "setting_id",
            "in": "query",
            "description": "设置ID",
            "required": true,
            "schema": { "type": "integer", "format": "int64" }
          },
          {
            "name": "address",
            "in": "query",
            "description": "地址",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "name": "CF-ACCESS-KEY",
            "in": "header",
            "description": "API所使用的KEY",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your api key"
          },
          {
            "name": "CF-ACCESS-SIGN",
            "in": "header",
            "description": "使用HMAC SHA256哈希函数获得哈希值，再使用Base-64编码（请参阅签名）",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "signature"
          },
          {
            "name": "CF-ACCESS-TIMESTAMP",
            "in": "header",
            "description": "发起请求的时间（UTC），如：2008-08-08T08:08:08.888Z",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/XRealtimeSetting" }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Sweep Open API Service"],
        "summary": "删除地址",
        "operationId": "sweepAddressDelete",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "地址",
            "required": true,
            "schema": { "type": "string" }
          },
          {
            "name": "CF-ACCESS-KEY",
            "in": "header",
            "description": "API所使用的KEY",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "your api key"
          },
          {
            "name": "CF-ACCESS-SIGN",
            "in": "header",
            "description": "使用HMAC SHA256哈希函数获得哈希值，再使用Base-64编码（请参阅签名）",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "signature"
          },
          {
            "name": "CF-ACCESS-TIMESTAMP",
            "in": "header",
            "description": "发起请求的时间（UTC），如：2008-08-08T08:08:08.888Z",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/XRealtimeSetting" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RealtimeSetting": {
        "properties": {
          "id": { "type": "integer", "format": "int64" },
          "member_id": {
            "type": "integer",
            "format": "int64",
            "description": "关联会员ID"
          },
          "balance_threshold": {
            "type": "integer",
            "format": "int64",
            "description": "触发余额阈值,单位:sun"
          },
          "energy_quantity": {
            "type": "integer",
            "format": "int32",
            "description": "每次补充的能量数量"
          },
          "address_count": {
            "type": "integer",
            "format": "int32",
            "description": "地址数量"
          },
          "bandwidth_guarantee": {
            "type": "boolean",
            "description": "带宽保护"
          },
          "remark": { "type": "string", "description": "备注" },
          "status": {
            "type": "string",
            "description": "状态: 1=正常 2=暂停",
            "enum": ["ACTIVE", "PAUSED"]
          },
          "created_at": {
            "type": "integer",
            "format": "int64",
            "description": "创建时间"
          },
          "updated_at": {
            "type": "integer",
            "format": "int64",
            "description": "更新时间"
          },
          "version": { "type": "integer", "format": "int32" }
        }
      },
      "XRealtimeSetting": {
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "description": "成功返回0，其他均为错误"
          },
          "msg": { "type": "string", "description": "发生错误时候返回的消息" },
          "sub_code": { "type": "string" },
          "sub_msg": { "type": "string" },
          "data": { "$ref": "#/components/schemas/RealtimeSetting" }
        }
      }
    },
    "securitySchemes": {
      "API_KEY": {
        "type": "apiKey",
        "name": "CF-ACCESS-KEY",
        "in": "header"
      },
      "API_SIGN": {
        "type": "apiKey",
        "name": "CF-ACCESS-SIGN",
        "in": "header"
      },
      "API_TIMESTAMP": {
        "type": "apiKey",
        "name": "CF-ACCESS-TIMESTAMP",
        "in": "header"
      }
    }
  }
}
