{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/debridge-com/json-schema/debridge-com-chain-transaction-response-v10-schema.json",
  "title": "ChainTransactionResponseV10",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/create-tx.json#/components/schemas/ChainTransactionResponseV10",
  "type": "object",
  "properties": {
    "tokenIn": {
      "$ref": "#/$defs/TokenWithUsdValue"
    },
    "tokenOut": {
      "$ref": "#/$defs/TokenWithMinAmount"
    },
    "slippage": {
      "type": "number"
    },
    "recommendedSlippage": {
      "type": "number"
    },
    "protocolFee": {
      "type": "string"
    },
    "protocolFeeApproximateUsdValue": {
      "type": "string"
    },
    "estimatedTransactionFee": {
      "description": "Estimated transaction fee (gasCost) for the transaction",
      "allOf": [
        {
          "$ref": "#/$defs/FeeInfo"
        }
      ]
    },
    "costsDetails": {
      "description": "Costs details",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CostsDetailsProperty"
      }
    },
    "comparedAggregators": {
      "description": "Comparison data for all swap aggregators that were compared",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SwapAdapterComparisonDto"
      }
    },
    "tx": {
      "description": "Transaction data. For max-amount requests, includes gasLimit, gasPrice, and estimatedTransactionFee.",
      "allOf": [
        {
          "$ref": "#/$defs/Tx"
        }
      ]
    }
  },
  "required": [
    "tokenIn",
    "tokenOut",
    "slippage",
    "recommendedSlippage",
    "comparedAggregators",
    "tx"
  ],
  "$defs": {
    "CostsDetailsProperty": {
      "type": "object",
      "properties": {
        "chain": {
          "type": "string"
        },
        "tokenIn": {
          "type": "string"
        },
        "tokenOut": {
          "type": "string"
        },
        "amountIn": {
          "type": "string"
        },
        "amountOut": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/Payload"
        }
      },
      "required": [
        "chain",
        "tokenIn",
        "tokenOut",
        "amountIn",
        "amountOut",
        "type"
      ]
    },
    "FeeDetails": {
      "type": "object",
      "properties": {
        "giveOrderState": {
          "type": "string"
        },
        "giveOrderWallet": {
          "type": "string"
        },
        "nonceMaster": {
          "type": "string"
        },
        "txFee": {
          "type": "string"
        },
        "priorityFee": {
          "type": "string"
        },
        "gasLimit": {
          "type": "string"
        },
        "gasPrice": {
          "type": "string"
        },
        "baseFee": {
          "type": "string"
        },
        "maxFeePerGas": {
          "type": "string"
        },
        "maxPriorityFeePerGas": {
          "type": "string"
        }
      }
    },
    "FeeInfo": {
      "type": "object",
      "properties": {
        "total": {
          "type": "string"
        },
        "details": {
          "$ref": "#/$defs/FeeDetails"
        },
        "approximateUsdValue": {
          "type": "number",
          "description": "USD approximate value of the transaction fee"
        }
      },
      "required": [
        "total",
        "details"
      ]
    },
    "Payload": {
      "type": "object",
      "properties": {
        "feeAmount": {
          "type": "string"
        },
        "feeBps": {
          "type": "string"
        },
        "amountOutBeforeCorrection": {
          "type": "string"
        },
        "estimatedVolatilityBps": {
          "type": "string"
        },
        "actualFeeAmount": {
          "type": "string"
        },
        "actualFeeBps": {
          "type": "string"
        },
        "subsidyAmount": {
          "type": "string"
        },
        "feeApproximateUsdValue": {
          "type": "string"
        },
        "additionalMarginAmount": {
          "type": "string"
        },
        "additionalMarginBps": {
          "type": "string"
        }
      }
    },
    "SwapAdapterComparisonDto": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the swap aggregator"
        },
        "amount": {
          "type": "string",
          "description": "Amount out from this aggregator"
        },
        "approximateUsdValue": {
          "type": "number",
          "description": "Approximate USD value of the amount out from this aggregator"
        },
        "priceDrop": {
          "type": "number",
          "description": "Price drop compared to the best aggregator in basis points (bps)"
        },
        "imageUrl": {
          "type": "string",
          "description": "Image URL of the swap aggregator"
        },
        "gas": {
          "type": "string",
          "description": "Gas units required to execute the swap via this aggregator"
        },
        "gasUsdValue": {
          "type": "number",
          "description": "Approximate USD cost of the gas required to execute the swap"
        },
        "finalAmountUsdValue": {
          "type": "number",
          "description": "Approximate USD value of the amount out minus gas cost (approximateUsdValue - gasUsdValue)"
        }
      },
      "required": [
        "name",
        "amount",
        "approximateUsdValue",
        "priceDrop",
        "imageUrl"
      ]
    },
    "TokenWithMinAmount": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        },
        "decimals": {
          "type": "integer"
        },
        "amount": {
          "type": "string"
        },
        "minAmount": {
          "type": "string"
        },
        "approximateUsdValue": {
          "type": "number"
        }
      },
      "required": [
        "address",
        "name",
        "symbol",
        "decimals",
        "amount",
        "minAmount"
      ]
    },
    "TokenWithUsdValue": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        },
        "decimals": {
          "type": "integer"
        },
        "amount": {
          "type": "string"
        },
        "approximateUsdValue": {
          "type": "number"
        }
      },
      "required": [
        "address",
        "name",
        "symbol",
        "decimals",
        "amount"
      ]
    },
    "Tx": {
      "type": "object",
      "properties": {
        "to": {
          "type": "string"
        },
        "data": {
          "type": "string"
        },
        "value": {
          "type": "string"
        }
      },
      "required": [
        "to",
        "data",
        "value"
      ]
    }
  }
}