{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/simpleeasytransactions-com/json-schema/simpleeasytransactions-com-escrow-safe-bundle-schema.json",
  "title": "EscrowSafeBundle",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/simpleeasytransactions-com-openapi.json#/components/schemas/EscrowSafeBundle",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "escrow_safe_bundle"
    },
    "escrow": {
      "type": "string"
    },
    "network": {
      "type": "string"
    },
    "chainId": {
      "type": "integer"
    },
    "chainLabel": {
      "type": "string"
    },
    "token": {
      "type": "string"
    },
    "safe": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "owners": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "threshold": {
          "type": "integer"
        },
        "saltNonce": {
          "type": "string"
        },
        "factory": {
          "type": "string"
        },
        "singleton": {
          "type": "string"
        },
        "fallbackHandler": {
          "type": "string"
        },
        "deployment": {
          "type": "object",
          "properties": {
            "to": {
              "type": "string"
            },
            "value": {
              "type": "string"
            },
            "data": {
              "type": "string"
            }
          },
          "required": [
            "to",
            "value",
            "data"
          ]
        }
      },
      "required": [
        "address",
        "owners",
        "threshold",
        "saltNonce",
        "deployment"
      ]
    },
    "termsHash": {
      "type": "string",
      "description": "0x and 64 hex characters.",
      "pattern": "^0x[0-9a-fA-F]{64}$"
    },
    "proposals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "esp_ and 32 hex characters."
          },
          "object": {
            "type": "string",
            "const": "escrow_proposal"
          },
          "kind": {
            "type": "string",
            "enum": [
              "release",
              "refund"
            ]
          },
          "milestone": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "awaiting_signatures",
              "ready",
              "executed",
              "failed",
              "cancelled"
            ]
          },
          "amount": {
            "type": "string",
            "description": "A decimal string in USDC, never a float."
          },
          "destination": {
            "type": "string"
          },
          "destinationKind": {
            "type": "string",
            "enum": [
              "seller_wallet",
              "cash_out_address",
              "prefunding",
              "buyer_wallet"
            ]
          },
          "safeNonce": {
            "type": "integer"
          },
          "safeTxHash": {
            "type": "string",
            "description": "0x and 64 hex characters.",
            "pattern": "^0x[0-9a-fA-F]{64}$"
          },
          "signatures": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "signer": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "enum": [
                    "buyer",
                    "seller",
                    "arbiter"
                  ]
                },
                "at": {
                  "type": "string"
                }
              },
              "required": [
                "signer",
                "role",
                "at"
              ]
            }
          },
          "threshold": {
            "type": "integer"
          },
          "typedData": {
            "type": "object",
            "properties": {
              "domain": {
                "type": "object",
                "additionalProperties": true
              },
              "types": {
                "type": "object",
                "additionalProperties": true
              },
              "primaryType": {
                "type": "string"
              },
              "message": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "domain",
              "types",
              "primaryType",
              "message"
            ],
            "description": "The SafeTx an owner signs with eth_signTypedData_v4."
          },
          "executedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "executedSource": {
            "type": [
              "string",
              "null"
            ],
            "description": "chain, or simulator in the sandbox."
          },
          "createdAt": {
            "type": "string"
          },
          "tx": {
            "type": "object",
            "properties": {
              "to": {
                "type": "string"
              },
              "value": {
                "type": "string"
              },
              "data": {
                "type": "string"
              },
              "operation": {
                "type": "integer"
              },
              "safeTxGas": {
                "type": "string"
              },
              "baseGas": {
                "type": "string"
              },
              "gasPrice": {
                "type": "string"
              },
              "gasToken": {
                "type": "string"
              },
              "refundReceiver": {
                "type": "string"
              },
              "nonce": {
                "type": "string"
              }
            },
            "required": [
              "to",
              "value",
              "data",
              "operation",
              "nonce"
            ]
          },
          "ownerSignatures": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "signer": {
                  "type": "string"
                },
                "signature": {
                  "type": "string"
                }
              },
              "required": [
                "signer",
                "signature"
              ]
            }
          }
        },
        "required": [
          "id",
          "object",
          "kind",
          "milestone",
          "state",
          "amount",
          "destination",
          "destinationKind",
          "safeNonce",
          "safeTxHash",
          "signatures",
          "threshold",
          "typedData",
          "executedAt",
          "executedSource",
          "createdAt",
          "tx",
          "ownerSignatures"
        ]
      }
    },
    "howTo": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "object",
    "escrow",
    "network",
    "chainId",
    "chainLabel",
    "token",
    "safe",
    "termsHash",
    "proposals",
    "howTo"
  ]
}