{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/debridge-com/json-schema/debridge-com-same-chain-swap-dto-schema.json",
  "title": "SameChainSwapDTO",
  "description": "Represents a Data Transfer Object (DTO) used to encapsulate the details of a swap operation on one blockchain (NOT cross-chain).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/debridge-com-samechainswap-api-openapi.yml#/components/schemas/SameChainSwapDTO",
  "type": "object",
  "properties": {
    "swapId": {
      "oneOf": [
        {
          "$ref": "#/$defs/StringPropertyDTO"
        },
        {
          "$ref": "#/$defs/TransactionHashPropertyDto"
        }
      ],
      "description": "Id of the swap"
    },
    "chainId": {
      "$ref": "#/$defs/IntPropertyDTO"
    },
    "sender": {
      "$ref": "#/$defs/AddressPropertyDTO"
    },
    "recipient": {
      "$ref": "#/$defs/AddressPropertyDTO"
    },
    "tokenIn": {
      "$ref": "#/$defs/TokenAmountDTO"
    },
    "tokenOut": {
      "$ref": "#/$defs/TokenAmountDTO"
    },
    "transactionHash": {
      "$ref": "#/$defs/TransactionHashPropertyDto"
    },
    "blockTimeStamp": {
      "type": "integer",
      "description": "Timestamp of the block in which the event was recorded, represented as a Unix time in seconds.",
      "format": "int64"
    },
    "affiliateFee": {
      "$ref": "#/$defs/SameChainSwapAffiliateFeeDTO"
    },
    "swapFee": {
      "$ref": "#/$defs/TokenAmountDTO"
    },
    "referralCode": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Referral program code",
      "format": "int32"
    },
    "swapRouterInfo": {
      "$ref": "#/$defs/RouterInfoDTO"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "AddressPropertyDTO": {
      "type": "object",
      "properties": {
        "Base64Value": {
          "type": [
            "string",
            "null"
          ],
          "description": "Binary representation of the property value",
          "format": "byte"
        },
        "bytesArrayValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bytes array representation of the value",
          "readOnly": true
        },
        "stringValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "String representation of the property value",
          "readOnly": true
        }
      },
      "additionalProperties": false
    },
    "IntPropertyDTO": {
      "type": "object",
      "properties": {
        "bytesValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Binary representation of the property value",
          "format": "byte"
        },
        "bytesArrayValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bytes array representation of the value",
          "readOnly": true
        },
        "bigIntegerValue": {
          "type": [
            "number",
            "null"
          ],
          "description": "Integer representation of the property value",
          "format": "int64",
          "readOnly": true
        },
        "stringValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "String representation of the property value",
          "readOnly": true
        }
      },
      "additionalProperties": false
    },
    "MetadataDTO": {
      "type": "object",
      "properties": {
        "decimals": {
          "type": "integer",
          "description": "Decimals of the token",
          "format": "int32"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the token"
        },
        "symbol": {
          "type": [
            "string",
            "null"
          ],
          "description": "Symbol of the token"
        },
        "logoURI": {
          "type": [
            "string",
            "null"
          ],
          "description": "URI of the token's logo"
        }
      },
      "additionalProperties": false,
      "description": "Token metadata DTO"
    },
    "RouterInfoDTO": {
      "type": "object",
      "properties": {
        "address": {
          "$ref": "#/$defs/AddressPropertyDTO"
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Router name"
        },
        "logoUri": {
          "type": [
            "string",
            "null"
          ],
          "description": "Token logo Uri"
        }
      },
      "additionalProperties": false,
      "description": "Information about the router used for executing the token swap"
    },
    "SameChainSwapAffiliateFeeDTO": {
      "type": "object",
      "properties": {
        "affiliateFee": {
          "$ref": "#/$defs/TokenAmountDTO"
        },
        "beneficiarySrc": {
          "$ref": "#/$defs/AddressPropertyDTO"
        }
      },
      "additionalProperties": false,
      "description": "Represents details regarding the affiliate fee for same chain swap."
    },
    "StringPropertyDTO": {
      "type": "object",
      "properties": {
        "bytesValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Binary representation of the property value",
          "format": "byte"
        },
        "bytesArrayValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bytes array representation of the value",
          "readOnly": true
        },
        "stringValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "String representation of the property value",
          "readOnly": true
        }
      },
      "additionalProperties": false
    },
    "TokenAmountDTO": {
      "type": "object",
      "properties": {
        "tokenAddress": {
          "$ref": "#/$defs/AddressPropertyDTO"
        },
        "amount": {
          "$ref": "#/$defs/IntPropertyDTO"
        },
        "metadata": {
          "$ref": "#/$defs/MetadataDTO"
        }
      },
      "additionalProperties": false,
      "description": "Info about a token"
    },
    "TransactionHashPropertyDto": {
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/StringPropertyDTO"
        }
      ],
      "properties": {
        "stringValue": {
          "type": [
            "string",
            "null"
          ],
          "description": "String representation of the transaction hash value",
          "readOnly": true
        }
      },
      "additionalProperties": false,
      "description": "Transaction Hash property"
    }
  }
}