{
  "$defs": {
    "CauldronQuote": {
      "additionalProperties": false,
      "description": "A token↔BCH route: input and output amounts, the market price before and after the trade, and the number of pools it routes through. Build the transaction with tx.build.",
      "properties": {
        "input_amount": {
          "description": "Total input amount (integer string, base units).",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        "input_is_bch": {
          "description": "True if the input is BCH.",
          "type": "boolean"
        },
        "kind": {
          "const": "cauldron"
        },
        "market_post_price": {
          "description": "Market price after the trade (engine decimal string).",
          "type": "string"
        },
        "market_pre_price": {
          "description": "Market spot price before the trade (engine decimal string).",
          "type": "string"
        },
        "output_amount": {
          "description": "Total output amount (integer string, base units).",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        "output_is_bch": {
          "description": "True if the output is BCH.",
          "type": "boolean"
        },
        "pools": {
          "description": "How many pools the trade routes through.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "kind",
        "input_amount",
        "input_is_bch",
        "output_amount",
        "output_is_bch",
        "market_pre_price",
        "market_post_price",
        "pools"
      ],
      "type": "object"
    },
    "CombinedQuote": {
      "additionalProperties": false,
      "description": "A token↔token route (direct and/or via BCH): the amount sold, the amount received, and the number of pools it routes through. Build the transaction with tx.build.",
      "properties": {
        "kind": {
          "const": "combined"
        },
        "pools": {
          "description": "How many pools the trade routes through.",
          "minimum": 1,
          "type": "integer"
        },
        "token_a_in": {
          "description": "Total token A consumed (integer string, base units).",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        "token_b_out": {
          "description": "Total token B produced (integer string, base units).",
          "pattern": "^[0-9]+$",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "token_a_in",
        "token_b_out",
        "pools"
      ],
      "type": "object"
    },
    "FundingInput": {
      "additionalProperties": false,
      "description": "A user-supplied funding UTXO.",
      "properties": {
        "script_hex": {
          "description": "The UTXO's scriptPubKey in hex.",
          "type": "string"
        },
        "token": {
          "$ref": "#/$defs/FundingToken"
        },
        "txid": {
          "description": "Funding UTXO txid in display-order hex (32 bytes).",
          "pattern": "^[0-9a-fA-F]{64}$",
          "type": "string"
        },
        "value": {
          "description": "UTXO value in sats (integer string, JS-safe). Must be > 0.",
          "pattern": "^[1-9][0-9]*$",
          "type": "string"
        },
        "vout": {
          "description": "Output index within the funding transaction.",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "txid",
        "vout",
        "value",
        "script_hex"
      ],
      "type": "object"
    },
    "FundingToken": {
      "additionalProperties": false,
      "description": "CashToken payload of a funding UTXO.",
      "properties": {
        "amount": {
          "description": "Token amount in base units (integer string). Must be > 0.",
          "pattern": "^[1-9][0-9]*$",
          "type": "string"
        },
        "category": {
          "description": "Token category in display-order hex (32 bytes).",
          "pattern": "^[0-9a-fA-F]{64}$",
          "type": "string"
        }
      },
      "required": [
        "category",
        "amount"
      ],
      "type": "object"
    },
    "SourceOutput": {
      "additionalProperties": false,
      "description": "A prevout, index-aligned to a tx input, for WizardConnect whole-tx signing.",
      "properties": {
        "locking_script_hex": {
          "description": "Locking script in hex.",
          "type": "string"
        },
        "token": {
          "$ref": "#/$defs/SourceToken"
        },
        "value": {
          "description": "Prevout value in sats (integer string).",
          "pattern": "^[0-9]+$",
          "type": "string"
        }
      },
      "required": [
        "value",
        "locking_script_hex"
      ],
      "type": "object"
    },
    "SourceToken": {
      "additionalProperties": false,
      "description": "Token payload of a SourceOutput (category display-order hex, amount string).",
      "properties": {
        "amount": {
          "description": "Token amount (integer string, base units). Must be > 0.",
          "pattern": "^[1-9][0-9]*$",
          "type": "string"
        },
        "category": {
          "description": "Token category (display-order hex, 32 bytes).",
          "pattern": "^[0-9a-fA-F]{64}$",
          "type": "string"
        }
      },
      "required": [
        "category",
        "amount"
      ],
      "type": "object"
    },
    "WrappedQuote": {
      "additionalProperties": false,
      "description": "A BCH↔token route through Wrapped BCH: input and output amounts (native BCH on the BCH side) and the number of pools it routes through. Build the transaction with tx.build.",
      "properties": {
        "input_amount": {
          "description": "Total input amount (integer string, base units; native BCH on the BCH side).",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        "input_is_bch": {
          "description": "True if the input is BCH.",
          "type": "boolean"
        },
        "kind": {
          "const": "wrapped"
        },
        "output_amount": {
          "description": "Total output amount (integer string, base units; native BCH on the BCH side).",
          "pattern": "^[0-9]+$",
          "type": "string"
        },
        "output_is_bch": {
          "description": "True if the output is BCH.",
          "type": "boolean"
        },
        "pools": {
          "description": "How many pools the trade routes through.",
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "kind",
        "input_amount",
        "input_is_bch",
        "output_amount",
        "output_is_bch",
        "pools"
      ],
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Server-pushed notification when a snapshot change affects a subscribed route.",
  "properties": {
    "method": {
      "const": "route.update"
    },
    "params": {
      "description": "The updated route.",
      "oneOf": [
        {
          "$ref": "#/$defs/CauldronQuote"
        },
        {
          "$ref": "#/$defs/CombinedQuote"
        },
        {
          "$ref": "#/$defs/WrappedQuote"
        }
      ]
    }
  },
  "required": [
    "method",
    "params"
  ],
  "title": "RouteUpdateNotification",
  "type": "object"
}