{
	"openapi": "3.0.0",
	"info": {
		"title": "Quai JSON RPC API",
		"version": "1.0.0"
	},
	"servers": [
		{
			"url": "https://rpc.quai.network/cyprus1"
		}
	],
	"paths": {
		"/": {
			"post": {
				"summary": "quai_getTransactionReceipt",
				"description": "Returns a transaction receipt for a given hash.",
				"requestBody": {
					"required": true,
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/Request"
							}
						}
					}
				},
				"responses": {
					"200": {
						"description": "Successful response",
						"content": {
							"application/json": {
								"schema": {
									"oneOf": [
										{ "title": "Quai Transaction Receipt", "$ref": "#/components/schemas/QuaiResponse" },
										{ "title": "External Transaction Receipt", "$ref": "#/components/schemas/EtxResponse" }
									]
								}
							}
						}
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"Request": {
				"type": "object",
				"required": ["jsonrpc", "method", "params", "id"],
				"properties": {
					"jsonrpc": {
						"type": "string",
						"example": "2.0",
						"enum": ["2.0"]
					},
					"method": {
						"type": "string",
						"description": "The name of the method to be invoked.",
						"example": "quai_getTransactionReceipt",
						"enum": ["quai_getTransactionReceipt"]
					},
					"params": {
						"type": "array",
						"description": "The transaction hash.",
						"items": {
							"type": "string"
						},
						"maxItems": 1,
						"minItems": 1,
						"example": ["0x0006005f22c4c34e57855d9f73ac7356c4f3f6ce56f3d17cd2885bfb8175bc81"]
					},
					"id": {
						"type": "integer",
						"description": "A unique identifier for the request.",
						"example": 1
					}
				}
			},
			"EtxResponse": {
				"type": "object",
				"properties": {
					"jsonrpc": {
						"type": "string",
						"example": "2.0"
					},
					"result": {
						"type": "object",
						"properties": {
							"blockHash": {
								"type": "string",
								"description": "The hash of the block containing the transaction."
							},
							"blockNumber": {
								"type": "string",
								"description": "The number of the block containing the transaction."
							},
							"contractAddress": {
								"type": "string",
								"nullable": true,
								"description": "The contract address created, if the transaction was a contract creation, otherwise null."
							},
							"cumulativeGasUsed": {
								"type": "string",
								"description": "The total amount of gas used when this transaction was executed in the block."
							},
							"effectiveGasPrice": {
								"type": "string",
								"description": "The effective gas price of the transaction."
							},
							"etxType": {
								"type": "string",
								"description": "The type of the external transaction. (0: External, 1: Coinbase, 2: Conversion)"
							},
							"from": {
								"type": "string",
								"description": "The address of the sender."
							},
							"gasUsed": {
								"type": "string",
								"description": "The amount of gas used by this specific transaction alone."
							},
							"logs": {
								"type": "array",
								"description": "The logs generated by this transaction."
							},
							"logsBloom": {
								"type": "string",
								"description": "The bloom filter for the logs of the transaction."
							},
							"originatingTxHash": {
								"type": "string",
								"description": "The hash of the transaction that spawned this externaltransaction."
							},
							"status": {
								"type": "string",
								"description": "The status of the transaction."
							},
							"to": {
								"type": "string",
								"description": "The address of the receiver."
							},
							"transactionHash": {
								"type": "string",
								"description": "The hash of the transaction."
							},
							"transactionIndex": {
								"type": "string",
								"description": "The index of the transaction in the block."
							},
							"type": {
								"type": "string",
								"description": "The type of the transaction."
							}
						},
						"example": {
							"blockHash": "0x95296c99a4c5bb79876296be7b1a1506b55596e257867746dc6e22c96025e602",
							"blockNumber": "0x18e",
							"contractAddress": null,
							"cumulativeGasUsed": "0x0",
							"effectiveGasPrice": "0x0",
							"etxType": "0x1",
							"from": "0x0003e45Aa16163f2663015B6695894D918866D19",
							"gasUsed": "0x0",
							"logs": [],
							"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
							"originatingTxHash": "0x0000875718a41b7d95bfac9848cbbec32b64a3debaf1d76efa8bb4bbecf6f063",
							"status": "0x0",
							"to": "0x0003e45Aa16163f2663015B6695894D918866D19",
							"transactionHash": "0x8751004e41a6520343b2e3b3c7181bfaa9f8e63f4c0e3ee595db96c14ab55a51",
							"transactionIndex": "0x1a",
							"type": "0x1"
						},
						"description": "The external transaction receipt."
					},
					"id": {
						"type": "integer",
						"example": 1
					}
				}
			},
			"QuaiResponse": {
				"type": "object",
				"properties": {
					"jsonrpc": {
						"type": "string",
						"example": "2.0"
					},
					"result": {
						"type": "object",
						"properties": {
							"blockHash": {
								"type": "string",
								"description": "The hash of the block containing the transaction."
							},
							"blockNumber": {
								"type": "string",
								"description": "The number of the block containing the transaction."
							},
							"contractAddress": {
								"type": "string",
								"nullable": true,
								"description": "The contract address created, if the transaction was a contract creation, otherwise null."
							},
							"cumulativeGasUsed": {
								"type": "string",
								"description": "The total amount of gas used when this transaction was executed in the block."
							},
							"effectiveGasPrice": {
								"type": "string",
								"description": "The effective gas price of the transaction."
							},
							"from": {
								"type": "string",
								"description": "The address of the sender."
							},
							"gasUsed": {
								"type": "string",
								"description": "The amount of gas used by this specific transaction alone."
							},
							"logs": {
								"type": "array",
								"description": "The logs generated by this transaction."
							},
							"logsBloom": {
								"type": "string",
								"description": "The bloom filter for the logs of the transaction."
							},
							"status": {
								"type": "string",
								"description": "The status of the transaction."
							},
							"to": {
								"type": "string",
								"description": "The address of the receiver."
							},
							"transactionHash": {
								"type": "string",
								"description": "The hash of the transaction."
							},
							"transactionIndex": {
								"type": "string",
								"description": "The index of the transaction in the block."
							},
							"type": {
								"type": "string",
								"description": "The type of the transaction. For Quai transactions, this will always be 0x0"
							}
						},
						"example": {
							"blockHash": "0xc39d41b6a94a3dba16c251dfcdd3e0a2269233dbc7de8f1577fad7fe06ea9cf0",
							"blockNumber": "0x4651",
							"contractAddress": null,
							"cumulativeGasUsed": "0xdd8a",
							"effectiveGasPrice": "0x77359400",
							"from": "0x0033D6534AcA0B8a344aA5597133c15DFe787F97",
							"gasUsed": "0xdd8a",
							"logs": [],
							"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
							"status": "0x1",
							"to": "0x005f644097F8f0E9f996Dca4F4F23aBB6C1Cc8b3",
							"transactionHash": "0x0006005f22c4c34e57855d9f73ac7356c4f3f6ce56f3d17cd2885bfb8175bc81",
							"transactionIndex": "0x0",
							"type": "0x0"
						},
						"description": "The Quai EVM transaction receipt."
					},
					"id": {
						"type": "integer",
						"example": 1
					}
				}
			}
		}
	}
}
