{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://taips.tap.rsvp/schemas/messages/settle.json",
  "title": "Settle Message",
  "description": "Indicates settlement has been initiated on-chain per TAIP-4",
  "type": "object",
  "allOf": [
    {
      "$ref": "../common/didcomm-base.json#/$defs/didcommHeader"
    }
  ],
  "properties": {
    "type": {
      "const": "https://tap.rsvp/schema/1.0#Settle"
    },
    "body": {
      "type": "object",
      "required": ["@context", "@type", "settlementAddress"],
      "properties": {
        "@context": {
          "const": "https://tap.rsvp/schema/1.0"
        },
        "@type": {
          "const": "https://tap.rsvp/schema/1.0#Settle"
        },
        "settlementAddress": {
          "$ref": "../common/settlement-address.json",
          "description": "Destination address of the transaction in either CAIP-10 or RFC 8905 format"
        },
        "settlementId": {
          "type": "string",
          "pattern": "^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}:(tx|txn)/[-%a-zA-Z0-9]{1,128}$",
          "description": "CAIP-220 identifier of the settlement transaction on a blockchain",
          "examples": ["eip155:1:tx/0x3edb98c24d46d148eb926c714f4fbaa117c47b0c0821f38bfce9763604457c33"]
        },
        "amount": {
          "$ref": "../common/base-types.json#/$defs/amount",
          "description": "Amount settled (optional, defaults to full amount from original transaction)"
        }
      },
      "additionalProperties": false
    }
  },
  "required": ["type", "body"]
}