{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Simulation",
  "oneOf": [
    {
      "description": "Simulation reverted with an optional string.",
      "type": "object",
      "required": [
        "revert"
      ],
      "properties": {
        "revert": {
          "$ref": "#/definitions/Revert"
        }
      },
      "additionalProperties": false
    },
    {
      "description": "Successful simulation, contains a set of asset changes (which may be empty!)",
      "type": "object",
      "required": [
        "success"
      ],
      "properties": {
        "success": {
          "$ref": "#/definitions/AssetChanges"
        }
      },
      "additionalProperties": false
    }
  ],
  "definitions": {
    "AssetChanges": {
      "type": "object",
      "required": [
        "erc1155",
        "erc20",
        "erc721",
        "native"
      ],
      "properties": {
        "erc1155": {
          "description": "Mapping of contract to ERC1155 events.\n\nThere could be multiple events coming from the same address. This could be empty.",
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/ERC1155"
            }
          }
        },
        "erc20": {
          "description": "Mapping of contract to ERC20 events.\n\nThere could be multiple events coming from the same address. This could be empty.",
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/ERC20"
            }
          }
        },
        "erc721": {
          "description": "Mapping of contract to ERC721 events.\n\nThere could be multiple events coming from the same address. This could be empty.",
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/ERC721"
            }
          }
        },
        "native": {
          "description": "Native eth changes.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/Native"
          }
        }
      }
    },
    "ERC1155": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "transferSingle"
          ],
          "properties": {
            "transferSingle": {
              "$ref": "#/definitions/ERC1155TransferSingle"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "transferBatch"
          ],
          "properties": {
            "transferBatch": {
              "$ref": "#/definitions/ERC1155TransferBatch"
            }
          },
          "additionalProperties": false
        },
        {
          "type": "object",
          "required": [
            "approvalForAll"
          ],
          "properties": {
            "approvalForAll": {
              "$ref": "#/definitions/ERC1155ApprovalForAll"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ERC1155ApprovalForAll": {
      "description": "ERC1155 ApprovalForAll Event\n\n- event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);",
      "type": "object",
      "required": [
        "approved",
        "from",
        "to"
      ],
      "properties": {
        "approved": {
          "type": "boolean"
        },
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "ERC1155TransferBatch": {
      "description": "ERC1155 TransferBatch event\n\n- event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);",
      "type": "object",
      "required": [
        "from",
        "id",
        "operator",
        "to",
        "value"
      ],
      "properties": {
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "id": {
          "type": "array",
          "items": {
            "description": "Number in hex prefixed by 0x.",
            "type": "string",
            "format": "hex (u256)"
          }
        },
        "operator": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "value": {
          "type": "array",
          "items": {
            "description": "Number in hex prefixed by 0x.",
            "type": "string",
            "format": "hex (u256)"
          }
        }
      }
    },
    "ERC1155TransferSingle": {
      "description": "ERC1155 TransferSingle event\n\n- event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);",
      "type": "object",
      "required": [
        "from",
        "id",
        "operator",
        "to",
        "value"
      ],
      "properties": {
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "id": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "operator": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "value": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        }
      }
    },
    "ERC20": {
      "oneOf": [
        {
          "description": "An ERC20 Transfer\n\nWe include WETH Desposit/Withdraw events here as well.",
          "type": "object",
          "required": [
            "transfer"
          ],
          "properties": {
            "transfer": {
              "$ref": "#/definitions/ERC20Transfer"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Approval for a set of tokens.\n\nWe include approvals for 0 tokens here as well.",
          "type": "object",
          "required": [
            "approval"
          ],
          "properties": {
            "approval": {
              "$ref": "#/definitions/ERC20Approval"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ERC20Approval": {
      "description": "ERC20 Approval Event\n\n- event Approval(address indexed owner, address indexed spender, uint256 value);",
      "type": "object",
      "required": [
        "amount",
        "from",
        "to"
      ],
      "properties": {
        "amount": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "ERC20Transfer": {
      "description": "ERC20 Transfer event\n\n- event Transfer(address indexed _from, address indexed _to, uint256 _value);",
      "type": "object",
      "required": [
        "amount",
        "from",
        "to"
      ],
      "properties": {
        "amount": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "ERC2309ConsecutiveTransfer": {
      "description": "ERC2309 Consecutive Transfer event\n\n- event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed fromAddress, address indexed toAddress);",
      "type": "object",
      "required": [
        "from",
        "from_id",
        "to",
        "to_id"
      ],
      "properties": {
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "from_id": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to_id": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        }
      }
    },
    "ERC721": {
      "oneOf": [
        {
          "description": "An ERC721 Transfer",
          "type": "object",
          "required": [
            "transfer"
          ],
          "properties": {
            "transfer": {
              "$ref": "#/definitions/ERC721Approval"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Approval for an NFT",
          "type": "object",
          "required": [
            "approval"
          ],
          "properties": {
            "approval": {
              "$ref": "#/definitions/ERC721Approval"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Approval for all NFTs",
          "type": "object",
          "required": [
            "approvalForAll"
          ],
          "properties": {
            "approvalForAll": {
              "$ref": "#/definitions/ERC721ApprovalForAll"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "Consecutive Transfer",
          "type": "object",
          "required": [
            "consecutiveTransfer"
          ],
          "properties": {
            "consecutiveTransfer": {
              "$ref": "#/definitions/ERC2309ConsecutiveTransfer"
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "ERC721Approval": {
      "description": "ERC721 Transfer event\n\n- event Transfer(address indexed _from, address indexed _to, uint256 indexed _tokenId);",
      "type": "object",
      "required": [
        "from",
        "id",
        "to"
      ],
      "properties": {
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "id": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "ERC721ApprovalForAll": {
      "description": "ERC721 ApprovalForAll Event\n\n- event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);",
      "type": "object",
      "required": [
        "approved",
        "from",
        "to"
      ],
      "properties": {
        "approved": {
          "type": "boolean"
        },
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "Native": {
      "type": "object",
      "required": [
        "amount",
        "from",
        "to"
      ],
      "properties": {
        "amount": {
          "description": "Number in hex prefixed by 0x.",
          "type": "string",
          "format": "hex (u256)"
        },
        "from": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        },
        "to": {
          "description": "Ethereum address in hex prefixed with 0x.",
          "type": "string",
          "format": "hex (h160)"
        }
      }
    },
    "Revert": {
      "type": "object",
      "properties": {
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}