{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/layerhop-com/json-schema/layerhop-com-quote-request-body-schema.json",
  "title": "QuoteRequestBody",
  "description": "`POST /v1/quote` body. The fields of `GET /v1/quote` (chains may also be numbers), plus\ndestination calls. Send `amount` for a plain quote, `dstAmount` alone for an exact-output\nquote, or `dstAmount` with `calls` or `action`.\n",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/layerhop-com-openapi.yaml#/components/schemas/QuoteRequestBody",
  "type": "object",
  "required": [
    "srcChain",
    "srcToken",
    "dstChain",
    "dstToken",
    "sender",
    "recipient"
  ],
  "properties": {
    "srcChain": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ],
      "description": "Source chain id or slug."
    },
    "srcToken": {
      "type": "string",
      "description": "Source token address, curated symbol, native symbol or popular-token symbol."
    },
    "amount": {
      "type": "string",
      "pattern": "^\\d+$",
      "description": "Input amount in base units of `srcToken` (1 to 2^256 - 1, leading zeros ignored). Not with `dstAmount` (nor with `calls` / `action`)."
    },
    "dstAmount": {
      "type": "string",
      "pattern": "^\\d+$",
      "description": "Exact amount of `dstToken` the recipient (or the destination calls) receives, in base units. Required with `calls` / `action`; without them, an exact-output quote as for `GET /v1/quote`. Not with `amount`."
    },
    "dstChain": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "integer"
        }
      ],
      "description": "Destination chain id or slug. EVM only with calls."
    },
    "dstToken": {
      "type": "string",
      "description": "Destination token address, curated symbol, native symbol or popular-token symbol."
    },
    "sender": {
      "type": "string",
      "minLength": 1,
      "description": "Address that signs and pays on the source chain (receives refunds). Must be an address of the source chain's VM."
    },
    "recipient": {
      "type": "string",
      "minLength": 1,
      "description": "Who the output (or what the calls produce) is for. Must be an address of the destination chain's VM (an EVM address with calls)."
    },
    "slippageBps": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5000,
      "default": 50
    },
    "channel": {
      "$ref": "#/$defs/FeeChannel"
    },
    "integrator": {
      "type": "string",
      "pattern": "^[a-z0-9-]{1,32}$",
      "description": "Partner id, as for `GET /v1/quote`."
    },
    "integratorFeeBps": {
      "type": "integer",
      "minimum": 0,
      "description": "Partner fee override, as for `GET /v1/quote`."
    },
    "referrer": {
      "type": "string",
      "description": "Referring wallet (attribution only), as for `GET /v1/quote`. Invalid values are ignored."
    },
    "copyOf": {
      "type": "string",
      "maxLength": 100,
      "description": "Copy this trade: the copied trade card or wallet, as for `GET /v1/quote`. Invalid values are ignored."
    },
    "gasOnArrival": {
      "type": "boolean",
      "description": "As for `GET /v1/quote`. Not allowed with calls or `dstAmount`."
    },
    "gasOnArrivalUsd": {
      "type": "number",
      "minimum": 0.5,
      "maximum": 20,
      "description": "As for `GET /v1/quote`. Not allowed with calls or `dstAmount`."
    },
    "gasless": {
      "type": "boolean",
      "description": "As for `GET /v1/quote`. Not allowed with calls or `dstAmount`."
    },
    "excludeProviders": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "maxItems": 40,
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "As for `GET /v1/quote`: provider ids, as an array or a comma-separated string."
    },
    "excludeBridges": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "maxItems": 40,
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "As for `GET /v1/quote`: bridge ids, as an array or a comma-separated string."
    },
    "excludeExchanges": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "maxItems": 40,
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "As for `GET /v1/quote`: exchange ids, as an array or a comma-separated string."
    },
    "purpose": {
      "type": "string",
      "enum": [
        "tip",
        "split",
        "payout",
        "gather",
        "rebalance",
        "fund"
      ],
      "description": "As for `GET /v1/quote` (attribution only)."
    },
    "splitId": {
      "type": "string",
      "description": "As for `GET /v1/quote`: pay one share of a split, with `splitShare`."
    },
    "splitShare": {
      "type": "integer",
      "minimum": 0,
      "description": "As for `GET /v1/quote`."
    },
    "note": {
      "type": "string",
      "maxLength": 1000,
      "description": "As for `GET /v1/quote`: a message on a tip or split payment (kept to 140 characters)."
    },
    "calls": {
      "type": "array",
      "minItems": 1,
      "maxItems": 8,
      "description": "Destination calls, run in order by the provider's executor with the output. At most 8, at\nmost 10,000 bytes of calldata each and 24,000 in total. Not with `action`.\n",
      "items": {
        "$ref": "#/$defs/DestinationCall"
      }
    },
    "action": {
      "$ref": "#/$defs/DestinationAction"
    }
  },
  "$defs": {
    "DestinationAction": {
      "type": "object",
      "description": "A preset that builds the calls server-side. `aave-v3-supply`: `approve(pool, dstAmount)` on\n`dstToken`, then `supply(dstToken, dstAmount, recipient, 0)` on the chain's Aave v3 Pool, so the\naTokens go to `recipient`. Chains: Ethereum, Optimism, BNB Chain, Polygon, Base, Arbitrum.\n`dstToken` must be an ERC-20 that Aave lists on that chain (else `CALLS_REVERTED`).\n",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "aave-v3-supply"
          ]
        }
      }
    },
    "DestinationCall": {
      "type": "object",
      "description": "One contract call on the destination chain. `msg.sender` is the provider's executor, not the user.",
      "required": [
        "to",
        "data"
      ],
      "properties": {
        "to": {
          "type": "string",
          "pattern": "^0x[0-9a-fA-F]{40}$",
          "description": "Target contract. Not the zero address, a precompile or Permit2."
        },
        "data": {
          "type": "string",
          "pattern": "^0x([0-9a-fA-F]{2})*$",
          "description": "ABI-encoded calldata. `transferFrom`, `safeTransferFrom`, `safeBatchTransferFrom` and `permit` are rejected."
        },
        "value": {
          "type": "string",
          "pattern": "^\\d+$",
          "default": "0",
          "description": "Native coin to send with the call, in wei. Only when `dstToken` is the native coin; the values together must not exceed `dstAmount`."
        }
      }
    },
    "FeeChannel": {
      "type": "string",
      "description": "Where the trade comes from; decides LayerHop's fee. Defaults: `web` 15 bps, `widget`\n15 bps, `api` 10 bps, `bot` 45 bps (operators can override them).\n",
      "enum": [
        "web",
        "widget",
        "bot",
        "api"
      ],
      "default": "api"
    }
  }
}