{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "PostConditionFungible",
  "type": "object",
  "allOf": [
    {
      "type": "object",
      "required": ["principal"],
      "properties": {
        "principal": {
          "$ref": "./post-condition-principal.schema.json"
        }
      }
    },
    {
      "type": "object",
      "required": ["condition_code", "amount", "type", "asset"],
      "properties": {
        "condition_code": {
          "$ref": "./post-condition-fungible-condition-code.schema.json"
        },
        "type": {
          "enum": ["fungible"],
          "type": "string"
        },
        "amount": {
          "type": "string"
        },
        "asset": {
          "type": "object",
          "required": ["asset_name", "contract_address", "contract_name"],
          "additionalProperties": false,
          "properties": {
            "asset_name": {
              "type": "string"
            },
            "contract_address": {
              "type": "string"
            },
            "contract_name": {
              "type": "string"
            }
          }
        }
      }
    }
  ]
}
