LayerHop · Schema

TxPreview

BlockchainSwappingCross-ChainDeFiNon-Custodial

Properties

Name Type Description
kind string
chainId integer
from string
summary string One plain sentence; starts with "Danger:" when a flag is `danger`.
risk string The worst flag's level.
actions array Step by step, in plain language.
balanceChanges array Net changes for `from` (negative = leaves the wallet).
transfers array Who gets what (at most 50).
approvals array Permissions granted to spend the wallet's tokens.
flags array
simulation object
community array Community reports on the addresses involved (only those with reports).
addresses array
View JSON Schema on GitHub

JSON Schema

layerhop-com-tx-preview-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/layerhop-com/json-schema/layerhop-com-tx-preview-schema.json",
  "title": "TxPreview",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/layerhop-com-openapi.json#/components/schemas/TxPreview",
  "type": "object",
  "required": [
    "kind",
    "chainId",
    "summary",
    "risk",
    "actions",
    "balanceChanges",
    "transfers",
    "approvals",
    "flags",
    "simulation",
    "community",
    "addresses"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "evm_tx",
        "typed_data",
        "solana_tx"
      ]
    },
    "chainId": {
      "type": "integer"
    },
    "from": {
      "type": "string"
    },
    "summary": {
      "type": "string",
      "description": "One plain sentence; starts with \"Danger:\" when a flag is `danger`."
    },
    "risk": {
      "type": "string",
      "enum": [
        "ok",
        "caution",
        "danger"
      ],
      "description": "The worst flag's level."
    },
    "actions": {
      "type": "array",
      "description": "Step by step, in plain language.",
      "items": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "method": {
            "type": "string",
            "description": "Decoded function signature or EIP-712 primary type."
          }
        }
      }
    },
    "balanceChanges": {
      "type": "array",
      "description": "Net changes for `from` (negative = leaves the wallet).",
      "items": {
        "type": "object",
        "required": [
          "token",
          "delta"
        ],
        "properties": {
          "token": {
            "type": "string",
            "description": "Token address or mint; `native` for the chain's coin."
          },
          "symbol": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "delta": {
            "type": "string",
            "description": "Signed integer in base units."
          },
          "tokenId": {
            "type": "string"
          },
          "standard": {
            "type": "string",
            "enum": [
              "native",
              "erc20",
              "erc721",
              "erc1155",
              "spl"
            ]
          }
        }
      }
    },
    "transfers": {
      "type": "array",
      "description": "Who gets what (at most 50).",
      "items": {
        "type": "object",
        "required": [
          "token",
          "from",
          "to",
          "amount"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "tokenId": {
            "type": "string"
          }
        }
      }
    },
    "approvals": {
      "type": "array",
      "description": "Permissions granted to spend the wallet's tokens.",
      "items": {
        "type": "object",
        "required": [
          "token",
          "spender",
          "amount",
          "unlimited",
          "via"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "symbol": {
            "type": "string"
          },
          "decimals": {
            "type": "integer"
          },
          "spender": {
            "type": "string"
          },
          "spenderLabel": {
            "type": "string",
            "description": "A spender LayerHop can name (Permit2, LI.FI, Uniswap …)."
          },
          "spenderIsContract": {
            "type": "boolean"
          },
          "amount": {
            "type": "string",
            "description": "Base units, or `all` for setApprovalForAll."
          },
          "unlimited": {
            "type": "boolean"
          },
          "via": {
            "type": "string",
            "enum": [
              "approve",
              "increaseAllowance",
              "setApprovalForAll",
              "permit",
              "permit2"
            ]
          },
          "expiresAt": {
            "type": "integer",
            "description": "Unix seconds the permission or signature ends."
          }
        }
      }
    },
    "flags": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "level",
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "unlimited_approval",
              "approval_to_eoa",
              "approval_to_unknown",
              "approve_all_nfts",
              "permit_to_unknown",
              "permit_to_eoa",
              "long_permit",
              "value_to_eoa",
              "unverified_contract",
              "new_contract",
              "gives_away_assets",
              "community_reports",
              "simulation_failed",
              "unknown_function",
              "wrong_chain"
            ]
          },
          "level": {
            "type": "string",
            "enum": [
              "caution",
              "danger"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      }
    },
    "simulation": {
      "type": "object",
      "required": [
        "method",
        "ok"
      ],
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "eth_simulateV1",
            "debug_traceCall",
            "eth_call",
            "decode",
            "simulateTransaction",
            "none"
          ]
        },
        "ok": {
          "type": "boolean",
          "description": "`false`: the transaction would fail (see `error`)."
        },
        "error": {
          "type": "string"
        },
        "gasUsed": {
          "type": "string"
        }
      }
    },
    "community": {
      "type": "array",
      "description": "Community reports on the addresses involved (only those with reports).",
      "items": {
        "$ref": "#/$defs/CommunityReports"
      }
    },
    "addresses": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "address",
          "role"
        ],
        "properties": {
          "address": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "`to`, `spender`, `recipient` or `program`."
          },
          "label": {
            "type": "string"
          },
          "isContract": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean",
            "description": "Source published on Etherscan (only when the deployment has a key)."
          }
        }
      }
    }
  },
  "$defs": {
    "CommunityNote": {
      "type": "object",
      "required": [
        "category",
        "note",
        "chainId",
        "createdAt"
      ],
      "properties": {
        "category": {
          "$ref": "#/$defs/ReportCategory"
        },
        "note": {
          "type": "string"
        },
        "txHash": {
          "type": "string"
        },
        "chainId": {
          "type": "integer"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "CommunityReports": {
      "type": "object",
      "description": "Community reports for one address or token. `count` includes reports not reviewed yet; notes\nshow only after an admin approved them. A signal from users, never a verdict.\n",
      "required": [
        "target",
        "count",
        "categories",
        "chainIds",
        "notes"
      ],
      "properties": {
        "target": {
          "type": "string",
          "description": "EVM address (lower-case) or Solana address."
        },
        "count": {
          "type": "integer",
          "description": "Reports that aren't hidden."
        },
        "approved": {
          "type": "integer",
          "description": "Of `count`, the reports an admin approved. Only approved reports raise a transaction preview's risk."
        },
        "categories": {
          "type": "object",
          "description": "Reports per category.",
          "properties": {
            "scam": {
              "type": "integer"
            },
            "phishing": {
              "type": "integer"
            },
            "poisoning": {
              "type": "integer"
            },
            "rug": {
              "type": "integer"
            }
          }
        },
        "chainIds": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Chains the reports were filed on."
        },
        "notes": {
          "type": "array",
          "description": "Newest approved notes (at most 5).",
          "items": {
            "$ref": "#/$defs/CommunityNote"
          }
        },
        "lastReportedAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "ReportCategory": {
      "type": "string",
      "enum": [
        "scam",
        "phishing",
        "poisoning",
        "rug"
      ],
      "description": "`phishing` covers drainer sites and malicious approvals; `poisoning` look-alike addresses and zero-value transfers."
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/layerhop-com-tx-preview"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.