{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "http://localhost:8080"
    }
  ],
  "info": {
    "title": "Hathor API",
    "version": "0.63.1"
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/event": {
      "get": {
        "operationId": "event",
        "summary": "Hathor Events",
        "description": "Returns information about past events",
        "parameters": [
          {
            "name": "last_ack_event_id",
            "in": "query",
            "description": "ID of last acknowledged event",
            "required": false,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "Amount of events",
            "required": false,
            "schema": {
              "type": "int"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "events": [
                      {
                        "peer_id": "315d290c818091e5f01b8e52c45e7e24f2558ba4376f423358fdc4c71d70da9a",
                        "id": 0,
                        "timestamp": 1676332496.991634,
                        "type": "consensus:tx_update",
                        "data": {
                          "hash": "00000000030b86022eaea447484bd4d770be0fbd7e03678967f601c315673c5c"
                        },
                        "group_id": null
                      },
                      {
                        "peer_id": "315d290c818091e5f01b8e52c45e7e24f2558ba4376f423358fdc4c71d70da9a",
                        "id": 1,
                        "timestamp": 1676332497.1872509,
                        "type": "network:new_tx_accepted",
                        "data": {
                          "hash": "00000000030b86022eaea447484bd4d770be0fbd7e03678967f601c315673c5c"
                        },
                        "group_id": null
                      }
                    ],
                    "latest_event_id": 342
                  }
                }
              }
            }
          }
        }
      }
    },
    "/feature": {
      "get": {
        "operationId": "feature",
        "summary": "Feature Activation",
        "description": "Returns information about features in the Feature Activation process",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "block_hash": "00000000083580e5b299e9cb271fd5977103897e8640fcd5498767b6cefba6f5",
                    "block_height": 123,
                    "features": [
                      {
                        "name": "NOP_FEATURE_1",
                        "state": "ACTIVE",
                        "acceptance": null,
                        "threshold": 0.75,
                        "start_height": 0,
                        "minimum_activation_height": 0,
                        "timeout_height": 100,
                        "lock_in_on_timeout": false,
                        "version": "0.1.0"
                      },
                      {
                        "name": "NOP_FEATURE_2",
                        "state": "STARTED",
                        "acceptance": 0.25,
                        "threshold": 0.5,
                        "start_height": 200,
                        "minimum_activation_height": 0,
                        "timeout_height": 300,
                        "lock_in_on_timeout": false,
                        "version": "0.2.0"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "healthcheck"
        ],
        "operationId": "get",
        "summary": "Health status of the fullnode",
        "description": "\nReturns 200 if the fullnode should be considered healthy.\n\nReturns 503 otherwise. The response will contain the components that were considered for the healthcheck\nand the reason why they were unhealthy.\n\nReturning 503 with a response body is not the standard behavior for our API, but it was chosen because\nmost healthcheck tools expect a 503 response code to indicate that the service is unhealthy.\n\nOptionally, there is a query parameter 'strict_status_code' that can be used to return 200 even if the fullnode\nis unhealthy. When its value is 1, the response will always be 200.\n\nWe currently perform 2 checks in the sync mechanism for the healthcheck:\n1. Whether the fullnode has recent block activity, i.e. if the fullnode has blocks with recent timestamps.\n2. Whether the fullnode has at least one synced peer\n            ",
        "parameters": [
          {
            "name": "strict_status_code",
            "in": "query",
            "description": "Enables strict status code. If set to 1, the response will always be 200.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Healthy",
            "content": {
              "application/json": {
                "examples": {
                  "healthy": {
                    "summary": "Healthy node",
                    "value": {
                      "status": "pass",
                      "description": "Hathor-core v0.56.0",
                      "checks": {
                        "sync": [
                          {
                            "componentName": "sync",
                            "componentType": "internal",
                            "status": "pass",
                            "output": "Healthy"
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Unhealthy",
            "content": {
              "application/json": {
                "examples": {
                  "no_recent_activity": {
                    "summary": "Node with no recent activity",
                    "value": {
                      "status": "fail",
                      "description": "Hathor-core v0.56.0",
                      "checks": {
                        "sync": [
                          {
                            "componentName": "sync",
                            "componentType": "internal",
                            "status": "fail",
                            "output": "Node doesn't have recent blocks"
                          }
                        ]
                      }
                    }
                  },
                  "no_synced_peer": {
                    "summary": "Node with no synced peer",
                    "value": {
                      "status": "fail",
                      "description": "Hathor-core v0.56.0",
                      "checks": {
                        "sync": [
                          {
                            "componentName": "sync",
                            "componentType": "internal",
                            "status": "fail",
                            "output": "Node doesn't have a synced peer"
                          }
                        ]
                      }
                    }
                  },
                  "peer_best_block_far_ahead": {
                    "summary": "Peer with best block too far ahead",
                    "value": {
                      "status": "fail",
                      "description": "Hathor-core v0.56.0",
                      "checks": {
                        "sync": [
                          {
                            "componentName": "sync",
                            "componentType": "internal",
                            "status": "fail",
                            "output": "Node's peer with highest height is too far ahead."
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p2p/peers": {
      
      "post": {
        "tags": [
          "p2p"
        ],
        "operationId": "p2p_peers",
        "summary": "Add p2p peers",
        "description": "Connect to the given peers",
        "requestBody": {
          "description": "Peers you want to connect to",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "description": "List of peers to connect in the format \"protocol://host:port\"",
                "items": {
                  "type": "string"
                }
              },
              "examples": {
                "peer_list": {
                  "summary": "List of peers",
                  "value": [
                    "tcp:localhost:8000",
                    "tcp:17.24.137.234:40403"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The peers we connected to (we don't try connecting to already known peers)",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Peers added",
                    "value": {
                      "success": true,
                      "peers": [
                        "tcp:localhost:8000",
                        "tcp:17.24.137.234:40403"
                      ]
                    }
                  },
                  "error": {
                    "summary": "Invalid data",
                    "value": {
                      "success": false,
                      "message": "Invalid format for post data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p2p/readiness": {
      "get": {
        "tags": [
          "p2p"
        ],
        "operationId": "readiness",
        "summary": "Readiness status of the fullnode",
        "description": "\nReturns 200 if the fullnode should be considered ready from the perspective of the sync mechanism.\n\nReturns 503 otherwise. The response will contain the reason why it is not ready in this case.\n\nWe currently check 2 things for the readiness:\n1. Whether the fullnode has recent block activity, i.e. if the fullnode has blocks with recent timestamps.\n2. Whether the fullnode has at least one synced peer\n\nIt's possible to customize the behavior of this endpoint by tweaking what should be considered recent activity.\nSee the setting P2P_RECENT_ACTIVITY_THRESHOLD_MULTIPLIER and the comment above it in hathor/conf/settings.py\nfor more info.\n            ",
        "responses": {
          "200": {
            "description": "Ready",
            "content": {
              "application/json": {
                "examples": {
                  "ready": {
                    "summary": "Ready",
                    "value": {
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Not Ready",
            "content": {
              "application/json": {
                "examples": {
                  "no_recent_activity": {
                    "summary": "Node with no recent activity",
                    "value": {
                      "success": false,
                      "reason": "Node doesn't have recent blocks"
                    }
                  },
                  "no_synced_peer": {
                    "summary": "Node with no synced peer",
                    "value": {
                      "success": false,
                      "reason": "Node doesn't have a synced peer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mining": {
      "get": {
        "tags": [
          "p2p"
        ],
        "operationId": "mining_get",
        "summary": "Block to be mined",
        "description": "Returns the base64 of the block to be mined in bytes and an array of the hash of parents in hex",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "Address to send the mined tokens",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "503": {
            "description": "Node still syncing",
            "content": {
              "application/json": {
                "examples": {
                  "error": {
                    "summary": "Node still syncing",
                    "value": {
                      "reason": "Node still syncing"
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Block in bytes and array with hash of parents in hex",
                    "value": {
                      "parents": [
                        "0001e298570e37d46f9101bcf903bde67186f26a83d88b9cb196f38b49623457",
                        "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2"
                      ],
                      "block_bytes": "AAFALAAAAAAAAFw3hyYAAAAAAAAAAgAAAAEAAwAAAeKYVw431G+RAbz5A73mcYbyaoPYi5yxlvOLSWI0VwAAKzvk44duZ7XgkNdtzXHN4aMMoeVOONZXF7oTHNIvAAK7Fx3jSQgoAo7F7vMyWVastrz/pqUEZruagdODY8IAAAfQAAAZdqkUjb8SxMLMIljwVbjaYSHUbiVSjt6IrAAAAAA="
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "p2p"
        ],
        "operationId": "mining_post",
        "summary": "Propagate a mined block",
        "description": "Propagate to the Hathor network a complete block after the proof-of-work",
        "requestBody": {
          "description": "Data to be propagated",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MinedBlock"
              },
              "examples": {
                "mined_block": {
                  "summary": "Mined block",
                  "value": {
                    "block_bytes": "AAFALAAAAAAAAFw3iaUAAAAAAAAAAgAAAAEAAwAAAeKYVw431G+RAbz5A73mcYbyaoPYi5yxlvOLSWI0VwAAKzvk44duZ7XgkNdtzXHN4aMMoeVOONZXF7oTHNIvAAK7Fx3jSQgoAo7F7vMyWVastrz/pqUEZruagdODY8IAAAfQAAAZdqkU0AoLEAX+1b36s+VyaMc9bkj/5byIrAAAEa8="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": "1",
                  "error": "0"
                }
              }
            }
          }
        }
      }
    },
    "/getmininginfo": {
      "get": {
        "tags": [
          "p2p"
        ],
        "operationId": "mining_info",
        "summary": "Mining info",
        "description": "Return the block's height, global hashrate, and mining difficulty.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Block's height, global hashrate, and mining difficulty.",
                    "value": {
                      "blocks": 6354,
                      "mined_tokens": 40665600,
                      "difficulty": 1023.984375,
                      "networkhashps": 146601550370.13358,
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Node still syncing",
                    "value": {
                      "success": false,
                      "message": "Node still syncing"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/p2p/netfilter": {
      
      "get": {
        "tags": [
          "p2p",
          "netfilter"
        ],
        "operationId": "p2p_netfilter_rule_get",
        "summary": "Get netfilter rules by chain",
        "description": "Returns the list of all netfilter rules from one chain.",
        "parameters": [
          {
            "name": "chain",
            "in": "query",
            "description": "Chain to get the netfilter rules.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "rules": [
                        {
                          "uuid": "93095688-8ad5-4b9a-ab6b-c9e7b6d1fab5",
                          "chain": {
                            "name": "post_peerid",
                            "table": {
                              "name": "filter"
                            },
                            "policy": {
                              "type": "NetfilterAccept",
                              "target_params": {}
                            }
                          },
                          "target": {
                            "type": "NetfilterReject",
                            "target_params": {}
                          },
                          "match": {
                            "type": "NetfilterMatchPeerId",
                            "match_params": {
                              "peer_id": "f7397705bc07aabf6fc3f68de6605d93b560bc832d9ebbdfb0d3bd41e1f9480b"
                            }
                          }
                        },
                        {
                          "uuid": "93095688-8ad5-4b9a-ab6b-c9e7b6d1fab5",
                          "chain": {
                            "name": "post_peerid",
                            "table": {
                              "name": "filter"
                            },
                            "policy": {
                              "type": "NetfilterAccept",
                              "target_params": {}
                            }
                          },
                          "target": {
                            "type": "NetfilterLog",
                            "target_params": {
                              "msg": "Wat"
                            }
                          },
                          "match": {
                            "type": "NetfilterMatchPeerId",
                            "match_params": {
                              "peer_id": "f7397705bc07aabf6fc3f68de6605d93b560bc832d9ebbdfb0d3bd41e1f9480b"
                            }
                          }
                        }
                      ]
                    }
                  },
                  "error": {
                    "summary": "Chain not found",
                    "value": {
                      "success": false,
                      "message": "Invalid netfilter chain."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "p2p",
          "netfilter"
        ],
        "operationId": "p2p_netfilter_rule_add",
        "summary": "Add p2p netfilter rule",
        "description": "Add netfilter rules.",
        "requestBody": {
          "description": "Netfilter rule data to add.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Data of rule to add in the netfilter chain.",
                "properties": {
                  "chain": "string",
                  "match": "string",
                  "match_params": "object",
                  "target": "string",
                  "target_params": "object"
                }
              },
              "examples": {
                "peer_id_reject": {
                  "summary": "Add rule to reject a peer id",
                  "value": {
                    "chain": {
                      "name": "post_peerid"
                    },
                    "target": {
                      "type": "NetfilterReject",
                      "target_params": {}
                    },
                    "match": {
                      "type": "NetfilterMatchPeerId",
                      "match_params": {
                        "peer_id": "f7397705bc07aabf6fc3f68de6605d93b560bc832d9ebbdfb0d3bd41e1f9480b"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Add rule.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Rule added",
                    "value": {
                      "success": true,
                      "uuid": "93095688-8ad5-4b9a-ab6b-c9e7b6d1fab5",
                      "chain": {
                        "name": "post_peerid",
                        "table": {
                          "name": "filter"
                        },
                        "policy": {
                          "type": "NetfilterAccept",
                          "target_params": {}
                        }
                      },
                      "target": {
                        "type": "NetfilterReject",
                        "target_params": {}
                      },
                      "match": {
                        "type": "NetfilterMatchPeerId",
                        "match_params": {
                          "peer_id": "f7397705bc07aabf6fc3f68de6605d93b560bc832d9ebbdfb0d3bd41e1f9480b"
                        }
                      }
                    }
                  },
                  "error": {
                    "summary": "Invalid chain",
                    "value": {
                      "success": false,
                      "message": "Invalid netfilter chain."
                    }
                  },
                  "error2": {
                    "summary": "Invalid match",
                    "value": {
                      "success": false,
                      "message": "Invalid netfilter match."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "p2p",
          "netfilter"
        ],
        "operationId": "p2p_netfilter_rule_delete",
        "summary": "Delete p2p netfilter rule",
        "description": "Delete netfilter rules.",
        "requestBody": {
          "description": "Netfilter rule data to delete.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Data of rule to delete in the netfilter chain.",
                "properties": {
                  "chain": "string",
                  "match": "string",
                  "match_params": "object",
                  "target": "string",
                  "target_params": "object"
                }
              },
              "examples": {
                "peer_id_reject": {
                  "summary": "Delete rule to reject a peer id",
                  "value": {
                    "chain": "post_peerid",
                    "rule_uuid": "93095688-8ad5-4b9a-ab6b-c9e7b6d1fab5"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Delete rules.",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Rule deleted",
                    "value": {
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Invalid chain",
                    "value": {
                      "success": false,
                      "message": "Invalid netfilter chain."
                    }
                  },
                  "error2": {
                    "summary": "Invalid match",
                    "value": {
                      "success": false,
                      "message": "Invalid netfilter match."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/status": {
      "get": {
        "tags": [
          "p2p"
        ],
        "operationId": "status",
        "summary": "Status of Hathor network",
        "description": "Returns the server data and the details of peers",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Server and peers data",
                    "value": {
                      "server": {
                        "id": "5578ab3bcaa861fb9d07135b8b167dd230d4487b147be8fd2c94a79bd349d123",
                        "app_version": "Hathor v0.14.0-beta",
                        "state": "READY",
                        "network": "testnet",
                        "uptime": 118.37029600143433,
                        "entrypoints": [
                          "tcp:localhost:8000"
                        ]
                      },
                      "known_peers": [],
                      "connections": {
                        "connected_peers": [
                          {
                            "id": "5578ab3bcaa861fb9d07135b8b167dd230d4487b147be8fd2c94a79bd349d123",
                            "app_version": "Hathor v0.14.0-beta",
                            "uptime": 118.37029600143433,
                            "address": "192.168.1.1:54321",
                            "state": "READY",
                            "last_message": 1539271481,
                            "plugins": {
                              "node-sync-timestamp": {
                                "is_enabled": true,
                                "latest_timestamp": 1685310912,
                                "synced_timestamp": 1685310912
                              }
                            },
                            "warning_flags": [
                              "no_entrypoints"
                            ],
                            "protocol_version": "sync-v1.1",
                            "peer_best_blockchain": [
                              [
                                59,
                                "0000045de9ac8365c43ccc96222873cb80c340c6c9c8949b56d2e2e51b6a3dbe"
                              ]
                            ]
                          }
                        ],
                        "handshaking_peers": [
                          {
                            "address": "192.168.1.1:54321",
                            "state": "HELLO",
                            "uptime": 0.0010249614715576172,
                            "app_version": "Unknown"
                          }
                        ],
                        "connecting_peers": [
                          {
                            "deferred": "<bound method TCP4ClientEndpoint.connect of <twisted.internet.endpoints.TCP4ClientEndpoint object at 0x10b16b470>>",
                            "address": "192.168.1.1:54321"
                          }
                        ]
                      },
                      "dag": {
                        "first_timestamp": 1539271481,
                        "latest_timestamp": 1539271483,
                        "best_block_tips": [
                          {
                            "hash": "000007eb968a6cdf0499e2d033faf1e163e0dc9cf41876acad4d421836972038",
                            "height": 0
                          }
                        ],
                        "best_block": {
                          "hash": "000007eb968a6cdf0499e2d033faf1e163e0dc9cf41876acad4d421836972038",
                          "height": 0
                        },
                        "best_blockchain": [
                          [
                            59,
                            "0000045de9ac8365c43ccc96222873cb80c340c6c9c8949b56d2e2e51b6a3dbe"
                          ]
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/top": {
      
      "get": {
        "operationId": "cpu-profiler",
        "summary": "Get process data for top command.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "enabled": true,
                      "last_update": 1619215625.833846,
                      "error": "",
                      "proc_list": [
                        [
                          [
                            "profiler"
                          ],
                          {
                            "percent_cpu": 2.679275019698697,
                            "total_time": 0.00018599999999990846
                          }
                        ],
                        [
                          [
                            "http-api!/v1a/top/:127.0.0.1"
                          ],
                          {
                            "percent_cpu": 0.0,
                            "total_time": 4.799999999993698e-05
                          }
                        ]
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/profiler": {
      
      "post": {
        "operationId": "profiler",
        "summary": "Run full node profiler",
        "requestBody": {
          "description": "Profiler data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfilerPOST"
              },
              "examples": {
                "start": {
                  "summary": "Start profiler",
                  "value": {
                    "start": true
                  }
                },
                "start-reset": {
                  "summary": "Start profiler",
                  "value": {
                    "start": true,
                    "reset": true
                  }
                },
                "stop": {
                  "summary": "Stop profiler",
                  "value": {
                    "stop": true,
                    "filepath": "filepath"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success_start": {
                    "summary": "Success start",
                    "value": {
                      "success": true
                    }
                  },
                  "success_stop": {
                    "summary": "Success stop",
                    "value": {
                      "success": true,
                      "saved_to": "filepath"
                    }
                  },
                  "error": {
                    "summary": "Error",
                    "value": {
                      "success": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/miners": {
      
      "get": {
        "operationId": "miners",
        "summary": "Mining Statistics",
        "description": "Returns information about each miner connected to the current node",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": [
                    {
                      "address": "127.0.0.1:39182",
                      "blocks_found": 2,
                      "completed_jobs": 13,
                      "connection_start_time": 1557834759,
                      "estimated_hash_rate": 19.2314,
                      "miner_id": "1b332d80753e4288a9906d3eb258f318"
                    },
                    {
                      "address": "134.182.2.57:5328",
                      "blocks_found": 7,
                      "completed_jobs": 17,
                      "connection_start_time": 1557834861,
                      "estimated_hash_rate": 24.1923,
                      "miner_id": "052c48854f1a4fddb902678304ac4864"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/block_at_height": {
      "get": {
        "tags": [
          "block"
        ],
        "operationId": "block",
        "summary": "Get block at height",
        "description": "Returns the block at specific height in the best chain.",
        "parameters": [
          {
            "name": "height",
            "in": "query",
            "description": "Height of the block to get",
            "required": true,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "include_transactions",
            "in": "query",
            "description": "Add transactions confirmed by this block.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "txid",
                "full"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success block height 1",
                    "value": {
                      "success": true,
                      "block": {
                        "tx_id": "080c8086376ab7105d17df1127a68ededf54029a21b5d98841448cc23b5123ff",
                        "version": 0,
                        "weight": 1.0,
                        "timestamp": 1616094323,
                        "is_voided": false,
                        "inputs": [],
                        "outputs": [
                          {
                            "value": 6400,
                            "token_data": 0,
                            "script": "dqkU4yipgEZjbphR/M3gUGjsbyb1s76IrA==",
                            "decoded": {
                              "type": "P2PKH",
                              "address": "HTEEV9FJeqBCYLUvkEHsWAAi6UGs9yxJKj",
                              "timelock": null
                            },
                            "token": "00",
                            "spent_by": null
                          }
                        ],
                        "parents": [
                          "339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792",
                          "16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952",
                          "33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869"
                        ],
                        "height": 1
                      }
                    }
                  },
                  "error": {
                    "summary": "Block not found",
                    "value": {
                      "success": false,
                      "message": "Does not have a block with height 100."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/create_tx": {
      "post": {
        "tags": [
          "transaction"
        ],
        "operationId": "create_tx",
        "summary": "Create unsigned unmined raw transaction",
        "requestBody": {
          "description": "Inputs and outputs to use",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "inputs": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TxInput"
                    }
                  },
                  "outputs": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/AddressOutput"
                        },
                        {
                          "$ref": "#/components/schemas/ScriptOutput"
                        }
                      ]
                    }
                  }
                }
              },
              "examples": {
                "tx": {
                  "summary": "Example tx creation",
                  "value": {
                    "inputs": [
                      {
                        "tx_id": "000005551d7740fd7d3c0acc50b5677fdd844f1225985aa431e1712af2a2fd89",
                        "index": 1
                      }
                    ],
                    "outputs": [
                      {
                        "address": "HNXsVtRUmwDCtpcCJUrH4QiHo9kUKx199A",
                        "value": 5600
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "success": {
                    "type": "boolean"
                  },
                  "hex_data": {
                    "type": "string"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "timestamp": {
                        "type": "integer"
                      },
                      "version": {
                        "type": "integer"
                      },
                      "weight": {
                        "type": "number"
                      },
                      "parents": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "inputs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/TxInput"
                        }
                      },
                      "outputs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/TxOutput"
                        }
                      },
                      "tokens": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "tx": {
                    "summary": "This is what could be returned from the example request.",
                    "value": {
                      "success": true,
                      "hex_data": "0001000101000005551d7740fd7d3c0acc50b5677fdd844f1225985aa431e1712af2a2fd89010000000015e000001976a914afa600556bf43ece9b8e0486baa31bd46a82c3af88ac40310c373eed982e5f63d94d0200000000b0e8be665f308f1d48d2201060846203280062b1cccc4e3d657486e90000000071c0d2cafa192b421bb5727c84174c999f9400d3be74331e7feba08a00000000",
                      "data": {
                        "timestamp": 1600379213,
                        "version": 1,
                        "weight": 17.047717984205683,
                        "parents": [
                          "00000000b0e8be665f308f1d48d2201060846203280062b1cccc4e3d657486e9",
                          "0000000071c0d2cafa192b421bb5727c84174c999f9400d3be74331e7feba08a"
                        ],
                        "inputs": [
                          {
                            "tx_id": "000005551d7740fd7d3c0acc50b5677fdd844f1225985aa431e1712af2a2fd89",
                            "index": 1,
                            "data": ""
                          }
                        ],
                        "outputs": [
                          {
                            "value": 5600,
                            "token_data": 0,
                            "script": "dqkUr6YAVWv0Ps6bjgSGuqMb1GqCw6+IrA=="
                          }
                        ],
                        "tokens": []
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/dashboard_tx": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "dashboard_tx",
        "summary": "Dashboard of transactions",
        "parameters": [
          {
            "name": "tx",
            "in": "query",
            "description": "Quantity of transactions in the dashboard",
            "required": true,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "block",
            "in": "query",
            "description": "Quantity of blocks in the dashboard",
            "required": true,
            "schema": {
              "type": "int"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Transaction decoded",
                    "value": {
                      "success": true,
                      "transactions": [
                        {
                          "tx_id": "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2",
                          "timestamp": 1539271483,
                          "version": 1,
                          "weight": 14,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9"
                          ],
                          "inputs": [],
                          "outputs": [],
                          "tokens": [],
                          "first_block": null
                        },
                        {
                          "tx_id": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                          "timestamp": 1539271482,
                          "version": 1,
                          "weight": 14,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb5",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb1"
                          ],
                          "inputs": [],
                          "outputs": [],
                          "tokens": [],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        }
                      ],
                      "blocks": [
                        {
                          "tx_id": "0001e29bf6271d15a6c89bffdf99a94351007a3aeb63a113d33493ce28b9de19",
                          "timestamp": 1547143591,
                          "height": 1233,
                          "version": 1,
                          "weight": 14,
                          "parents": [
                            "00035e46a20d0ecbda0dc6fdcaa243e93a7120baa8c90739e0d011370576de83",
                            "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2",
                            "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f"
                          ],
                          "inputs": [],
                          "outputs": [
                            {
                              "value": 2000,
                              "script": "dqkUixvdsajkV6vO+9Jjgjbaheqn016IrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        },
                        {
                          "tx_id": "00035e46a20d0ecbda0dc6fdcaa243e93a7120baa8c90739e0d011370576de83",
                          "timestamp": 1547143590,
                          "height": 1234,
                          "version": 1,
                          "weight": 14,
                          "parents": [
                            "000133cc80b625b1babbd454edc3474e0a130dafee5d359c52aabcee3d1193ee",
                            "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2",
                            "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f"
                          ],
                          "inputs": [],
                          "outputs": [
                            {
                              "value": 2000,
                              "script": "dqkUdNQbj29Md1xsAYinK+RsDJCCB7eIrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        },
                        {
                          "tx_id": "000133cc80b625b1babbd454edc3474e0a130dafee5d359c52aabcee3d1193ee",
                          "timestamp": 1547143589,
                          "height": 1235,
                          "version": 1,
                          "weight": 14,
                          "parents": [
                            "0001e298570e37d46f9101bcf903bde67186f26a83d88b9cb196f38b49623457",
                            "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                            "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2"
                          ],
                          "inputs": [],
                          "outputs": [
                            {
                              "value": 2000,
                              "script": "dqkU0AoLEAX+1b36s+VyaMc9bkj/5byIrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": null
                        }
                      ]
                    }
                  },
                  "error": {
                    "summary": "Invalid parameters",
                    "value": {
                      "success": false,
                      "message": "Invalid parameter, cannot convert to int: block"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transaction": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "transaction",
        "summary": "Transaction or list of transactions/blocks",
        "description": "Returns a transaction by hash or a list of transactions/blocks depending on the parameters sent. If \"id\" is sent as parameter, we return only one transaction, else we return a list. In the list return we have a key \"has_more\" that indicates if there are more transactions/blocks to be fetched",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Hash in hex of the transaction/block",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "description": "Type of list to return (block or tx)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Quantity of elements to return",
            "required": false,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "If the user clicked \"previous\" or \"next\" button",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hash",
            "in": "query",
            "description": "Hash reference for the pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "One success",
                    "value": {
                      "tx": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "nonce": "17076",
                        "timestamp": 1539271482,
                        "version": 1,
                        "weight": 14.0,
                        "parents": [],
                        "inputs": [
                          {
                            "value": 42500000044,
                            "script": "dqkURJPA8tDMJHU8tqv3SiO18ZCLEPaIrA==",
                            "decoded": {
                              "type": "P2PKH",
                              "address": "17Fbx9ouRUD1sd32bp4ptGkmgNzg7p2Krj",
                              "timelock": null
                            },
                            "token": "00",
                            "tx": "000002d28696f94f89d639022ae81a1d870d55d189c27b7161d9cb214ad1c90c",
                            "index": 0
                          }
                        ],
                        "outputs": [],
                        "tokens": []
                      },
                      "meta": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "spent_outputs": [
                          [
                            "0",
                            [
                              "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                            ]
                          ],
                          [
                            "1",
                            [
                              "00002b3ce4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                            ]
                          ]
                        ],
                        "received_by": [],
                        "children": [
                          "00002b3ee4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22d"
                        ],
                        "conflict_with": [],
                        "voided_by": [],
                        "twins": [],
                        "accumulated_weight": "1024",
                        "score": "4096",
                        "first_block": null
                      },
                      "spent_outputs": {
                        "0": "00002b3ce4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                      },
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Transaction not found",
                    "value": {
                      "success": false,
                      "message": "Transaction not found"
                    }
                  },
                  "success_list": {
                    "summary": "List success",
                    "value": {
                      "transactions": [
                        {
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "timestamp": 1547163030,
                          "version": 1,
                          "weight": 18.861583646228,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 1,
                              "data": "RzBFAiEAvv17vp8XyHYq36PFlOGd7V2vzIkf+XIuqfyUnc2fZugCIDnwM7PdkA/qwt2QXLB3WnegtdOqV8gv+H63voWVbsScIQPqg7y2RanTdnQcDvFneIzjrUzJoPzkmoNStoN8XtLTUA=="
                            },
                            {
                              "tx_id": "0000003398322f99355f37439e32881c83ff08b83e744e799b1d6a67f73bee45",
                              "index": 0,
                              "data": "RzBFAiEAqPvD18Uzd6NsMVkGMaI9RsxWqLow22W1KBHUUW/35UECIEUU9pxJEHBvXyEwYAB2/bCiWxNd4iLvyvQXGKaSaDV2IQPDL3iZvsDS8jdFDmlcvc2Em/ZNYYDOBWd3oZWxpuA5DQ=="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1909,
                              "script": "dqkUllFFDJByV5TjVUly3Zc3bB4mMH2IrA=="
                            },
                            {
                              "value": 55,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": [],
                          "height": 12345,
                          "first_block": null
                        },
                        {
                          "tx_id": "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                          "timestamp": 1547163025,
                          "version": 1,
                          "weight": 17.995048894541107,
                          "parents": [
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9",
                            "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 0,
                              "data": "SDBGAiEA/rtsn1oQ68uGeTj/7IVtqijxoUxzr9S/u3UGAC7wQvUCIQDaYkL1R8LICfSCpYIn4xx6A+lxU0Fw3oKR1hK91fRnSiEDCoA74tfBQa4IR7iXtlz+jH9UV7+YthKX4yQNaMSMfb0="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1894,
                              "script": "dqkUduvtU77hZm++Pwavtl9OrOSA+XiIrA=="
                            },
                            {
                              "value": 84,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        }
                      ],
                      "has_more": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/decode_tx": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "decode_tx",
        "summary": "Decode transaction",
        "parameters": [
          {
            "name": "hex_tx",
            "in": "query",
            "description": "Transaction to be decoded in hexadecimal",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Transaction decoded",
                    "value": {
                      "tx": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "nonce": 17076,
                        "timestamp": 1539271482,
                        "version": 1,
                        "weight": 14.0,
                        "parents": [],
                        "inputs": [
                          {
                            "value": 42500000044,
                            "script": "dqkURJPA8tDMJHU8tqv3SiO18ZCLEPaIrA==",
                            "decoded": {
                              "type": "P2PKH",
                              "address": "17Fbx9ouRUD1sd32bp4ptGkmgNzg7p2Krj",
                              "timelock": null
                            },
                            "token": "00",
                            "tx": "000002d28696f94f89d639022ae81a1d870d55d189c27b7161d9cb214ad1c90c",
                            "index": 0
                          }
                        ],
                        "outputs": [],
                        "tokens": []
                      },
                      "meta": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "spent_outputs": [
                          [
                            "0",
                            [
                              "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                            ]
                          ],
                          [
                            "1",
                            [
                              "00002b3ce4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                            ]
                          ]
                        ],
                        "received_by": [],
                        "children": [
                          "00002b3ee4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22d"
                        ],
                        "conflict_with": [],
                        "voided_by": [],
                        "twins": [],
                        "accumulated_weight": "1024",
                        "score": "4096",
                        "first_block": null
                      },
                      "spent_outputs": {
                        "0": "00002b3ce4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"
                      },
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Error when decoding transaction",
                    "value": {
                      "success": false
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/graphviz/full.{format}": {
      
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "graphviz",
        "summary": "Graphviz",
        "description": "Returns the generated file with the graph of the full DAG in the format requested.",
        "parameters": [
          {
            "name": "format",
            "in": "path",
            "description": "Format of the returned file",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "png",
                "jpg",
                "dot"
              ]
            }
          },
          {
            "name": "weight",
            "in": "query",
            "description": "If we will show the weight",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "acc_weight",
            "in": "query",
            "description": "If we will show the accumulated weight",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "verifications",
            "in": "query",
            "description": "Wether to show the verifications graph",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "funds",
            "in": "query",
            "description": "If we will generate the network graph or the funds graph",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "only_blocks",
            "in": "query",
            "description": "Only show blocks, hides transactions",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/graphviz/neighbours.{format}": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "graphviz_neighbours",
        "summary": "Graphviz neighbours",
        "description": "Returns the generated file with the graph of neighbours of a tx in the format requested.",
        "parameters": [
          {
            "name": "format",
            "in": "path",
            "description": "Format of the returned file",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pdf",
                "png",
                "jpg",
                "dot"
              ]
            }
          },
          {
            "name": "tx",
            "in": "query",
            "description": "Id of the transaction or block to generate the neighborhood graph",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "graph_type",
            "in": "query",
            "description": "Type of the graph in case of a neighborhood graph.",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "verification",
                "funds"
              ]
            }
          },
          {
            "name": "max_level",
            "in": "query",
            "description": "How many levels the neighbor can appear in the graph.Max level is 3",
            "required": true,
            "schema": {
              "type": "int"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/mempool": {
      "get": {
        "tags": [
          "mempool"
        ],
        "operationId": "mempool",
        "summary": "List of mempool transactions",
        "description": "Returns a list of all transactions currently on the mempool",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "transactions": [
                        "339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792",
                        "16ba3dbe424c443e571b00840ca54b9ff4cff467e10b6a15536e718e2008f952",
                        "33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/get_block_template": {
      "get": {
        "tags": [
          "mining"
        ],
        "operationId": "get_block_template",
        "summary": "EXPERIMENTAL: Get parameters for a miner, pool or proxy, to build mining block.",
        "parameters": [
          {
            "name": "capabilities",
            "in": "query",
            "description": "Requested capabilities when generating a block template",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "mergedmining"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "integer"
                    },
                    "version": {
                      "type": "integer"
                    },
                    "weight": {
                      "type": "number"
                    },
                    "parents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "outputs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "integer"
                          },
                          "token_data": {
                            "type": "integer"
                          },
                          "script": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/submit_block": {
      "post": {
        "tags": [
          "mining"
        ],
        "operationId": "submit_block",
        "summary": "EXPERIMENTAL: Called by a miner to submit a block they found",
        "requestBody": {
          "description": "Data to be propagated",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hexdata": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "result": {
                      "type": "bool"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/push_tx": {
      "post": {
        "tags": [
          "transaction"
        ],
        "operationId": "push_tx",
        "summary": "Push transaction to the network",
        "requestBody": {
          "description": "Transaction to be pushed in hexadecimal",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hex_tx": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true
                    }
                  },
                  "error1": {
                    "summary": "Transaction invalid",
                    "value": {
                      "success": false,
                      "message": "This transaction is invalid.",
                      "can_force": false
                    }
                  },
                  "error2": {
                    "summary": "Error propagating transaction",
                    "value": {
                      "success": false,
                      "message": "Error message",
                      "can_force": true
                    }
                  },
                  "error3": {
                    "summary": "Double spending error",
                    "value": {
                      "success": false,
                      "message": "Invalid transaction. At least one of your inputs hasalready been spent."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "push_tx",
        "summary": "Push transaction to the network",
        "parameters": [
          {
            "name": "hex_tx",
            "in": "query",
            "description": "Transaction to be pushed in hexadecimal",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true
                    }
                  },
                  "error1": {
                    "summary": "Transaction invalid",
                    "value": {
                      "success": false,
                      "message": "This transaction is invalid.",
                      "can_force": false
                    }
                  },
                  "error2": {
                    "summary": "Error propagating transaction",
                    "value": {
                      "success": false,
                      "message": "Error message",
                      "can_force": true
                    }
                  },
                  "error3": {
                    "summary": "Double spending error",
                    "value": {
                      "success": false,
                      "message": "Invalid transaction. At least one of your inputs hasalready been spent."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/transaction_acc_weight": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "transaction_acc_weight",
        "summary": "Accumulated weight data of a transaction",
        "description": "Returns the accumulated weight and confirmation level of a transaction",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Hash in hex of the transaction/block",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "accumulated_weight": 15.4,
                      "accumulated_weight_raw": "43238",
                      "confirmation_level": 0.88,
                      "stop_value": 14.5,
                      "accumulated_bigger": true,
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Transaction not found",
                    "value": {
                      "success": false,
                      "message": "Transaction not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/tx_parents": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "tx_parents",
        "summary": "Return tx parents for new transactions",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "tx_parents": [
                        "000000001cd4fd3559222ebb40d39189e46ae3982d93f7be2f68652d0653a224",
                        "00000000ce12d48152bd5e36a6a40bc9b501251bb7f1df2350c4c4ac34ad1f21"
                      ]
                    }
                  },
                  "error1": {
                    "summary": "Node syncing",
                    "value": {
                      "success": false,
                      "message": "Node syncing"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/utxo_search": {
      "get": {
        "tags": [
          "utxo"
        ],
        "operationId": "utxo_search",
        "summary": "Search UTXOs with given address/token/amount",
        "description": "For a given token-uid, address and target-amount, get a list of UTXOs that are candidates to be inputs for a total of target-value. The results will try to include the first UTXO with value higher or equal value as target-amount. No more than 256 entries will ever be returned by this API.",
        "parameters": [
          {
            "name": "token_uid",
            "in": "query",
            "description": "The UID of the token formatted as a HEX string, use \"00\" for HTR",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target_amount",
            "in": "query",
            "description": "The target amount that the UTXOs should sum-up to, 1 means 0.01 HTR",
            "required": true,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "address",
            "in": "query",
            "description": "The address that all UTXOs have",
            "required": true,
            "schema": {
              "type": "str"
            }
          },
          {
            "name": "target_timestamp",
            "in": "query",
            "description": "What timestamp to consider for timelocked outputs, by default uses the timestamp from the current best block",
            "required": false,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "target_height",
            "in": "query",
            "description": "What timestamp to consider for reward outputs (which are heightlocked), by default uses the height from the current best block",
            "required": false,
            "schema": {
              "type": "int"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success UTXO search",
                    "value": {
                      "success": true,
                      "utxos": [
                        {
                          "txid": "339f47da87435842b0b1b528ecd9eac2495ce983b3e9c923a37e1befbe12c792",
                          "index": 0,
                          "amount": 1000000000,
                          "timelock": null,
                          "heightlock": 10
                        }
                      ]
                    }
                  },
                  "error": {
                    "summary": "Invalid parameter",
                    "value": {
                      "success": false,
                      "message": "Failed to parse 'address': foobar"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/validate_address/{address}": {
      "get": {
        "tags": [
          "transaction"
        ],
        "operationId": "validate_address",
        "summary": "Validate address and also create output script",
        "parameters": [
          {
            "in": "path",
            "name": "address",
            "description": "Base58 address to be decoded",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "script": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "p2pkh",
                        "multisig"
                      ]
                    }
                  }
                },
                "examples": {
                  "valid_address": {
                    "summary": "Valid P2PKH address response",
                    "value": {
                      "valid": true,
                      "script": "dqkUr6YAVWv0Ps6bjgSGuqMb1GqCw6+IrA==",
                      "address": "HNXsVtRUmwDCtpcCJUrH4QiHo9kUKx199A"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/version": {
      "get": {
        "operationId": "version",
        "summary": "Hathor version",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "version": "0.16.0-beta",
                      "network": "testnet-bravo",
                      "min_weight": 14,
                      "min_tx_weight": 14,
                      "min_tx_weight_coefficient": 1.6,
                      "min_tx_weight_k": 100,
                      "token_deposit_percentage": 0.01,
                      "reward_spend_min_blocks": 300,
                      "max_number_inputs": 256,
                      "max_number_outputs": 256
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/address": {
      
      "get": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_address",
        "summary": "Address",
        "description": "Returns an address to be used in the wallet",
        "parameters": [
          {
            "name": "new",
            "in": "query",
            "description": "New or old address",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "address": "15VZc2jy1L3LGFweZeKVbWMsTzfKFJLpsN"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/balance": {
      
      "get": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_address",
        "summary": "Balance",
        "description": "Returns the current balance of the wallet (available and locked tokens)",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "balance": {
                        "available": 5000,
                        "locked": 1000
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/history": {
      
      "get": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_history",
        "summary": "History of transactions of the wallet",
        "description": "Returns a list with all the transactions of this wallet (in the page requested) and the total pages",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Number of requested page",
            "required": true,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Quantity of elements in each page",
            "required": true,
            "schema": {
              "type": "int"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "history": [
                        {
                          "timestamp": 1547163030,
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "index": 0,
                          "value": 1909,
                          "address": "1EhoiVeWRDqzyabqNhsnSzhUvhBWNWvCsg",
                          "voided": false
                        },
                        {
                          "timestamp": 1547163030,
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "index": 1,
                          "value": 55,
                          "address": "1Dxu6qynYeX8CmipocnYPQy8X7TaHHCtrM",
                          "voided": false
                        }
                      ],
                      "total_pages": 7
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/lock": {
      
      "post": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_lock",
        "summary": "Lock a wallet",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Wallet locked",
                    "value": {
                      "success": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/send_tokens": {
      
      "post": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_send_tokens",
        "summary": "Send tokens",
        "requestBody": {
          "description": "Data to create transactions",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendToken"
              },
              "examples": {
                "data": {
                  "summary": "Data to create transactions",
                  "value": {
                    "data": {
                      "outputs": [
                        {
                          "address": "15VZc2jy1L3LGFweZeKVbWMsTzfKFJLpsN",
                          "value": 1000
                        },
                        {
                          "address": "1C5xEjewerH4zTWPC6wqzhoEkMhiHEHPZ8",
                          "value": 800
                        }
                      ],
                      "inputs": [
                        {
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "index": 0
                        }
                      ],
                      "timestamp": 1549667726
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "message": "",
                      "tx": {
                        "hash": "00000c064ec72c8561a24b65bd50095a401b8d9a66c360cfe99cfcfeed73afc4",
                        "nonce": 2979,
                        "timestamp": 1547211690,
                        "version": 1,
                        "weight": 17.93619278054934,
                        "parents": [
                          "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4"
                        ],
                        "inputs": [
                          {
                            "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                            "index": 0,
                            "data": "RzBFAiAh6Jq+HOn9laOq3A5uUcaGLdWB4gM6RehsaP9OIMrOrwIhAOjWT+4ceSQI8CNXqaNNJgaOzCDhmFF1z1rhxOMCgonxIQNhXZKwBZeKxJpsJEqP4gIS4FFbEpG284HhmBfp1p5gUw=="
                          }
                        ],
                        "outputs": [
                          {
                            "value": 1109,
                            "script": "dqkUMUdd0fmGCmGfv7B5UriM5VS5g16IrA=="
                          },
                          {
                            "value": 800,
                            "script": "dqkUeZkoJssEgwjPw/1ubA9XXZNk+xGIrA=="
                          }
                        ],
                        "tokens": []
                      }
                    }
                  },
                  "error1": {
                    "summary": "Invalid address",
                    "value": {
                      "success": false,
                      "message": "The address abc is invalid"
                    }
                  },
                  "error2": {
                    "summary": "Insufficient funds",
                    "value": {
                      "success": false,
                      "message": "Insufficient funds. Requested amount: 200 / Available: 50"
                    }
                  },
                  "error3": {
                    "summary": "Invalid input",
                    "value": {
                      "success": false,
                      "message": "Invalid input to create transaction"
                    }
                  },
                  "error4": {
                    "summary": "Propagation error",
                    "value": {
                      "success": false,
                      "message": "Propagation error message",
                      "tx": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "nonce": 17076,
                        "timestamp": 1539271482,
                        "version": 1,
                        "weight": 14.0,
                        "parents": [],
                        "inputs": [],
                        "outputs": [],
                        "tokens": [],
                        "accumulated_weight": 14.0,
                        "accumulated_weight_raw": "16384"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/sign_tx": {
      
      "get": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_sign_tx",
        "summary": "Sign transaction",
        "description": "Returns a transaction after signing. If \"prepare_to_send\" is true, it also add the parents, weight, timestamp and solves proof-of-work.",
        "parameters": [
          {
            "name": "hex_tx",
            "in": "query",
            "description": "Transaction in hex to be signed",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prepare_to_send",
            "in": "query",
            "description": "If proof-of-work should be done",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "hex_tx": "00014032dc90beef51545c37d59600000000000000000002000200020000000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb400001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb90000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f601006a473045022100befd7bbe9f17c8762adfa3c594e19ded5dafcc891ff9722ea9fc949dcd9f66e8022039f033b3dd900feac2dd905cb0775a77a0b5d3aa57c82ff87eb7be85956ec49c2103ea83bcb645a9d376741c0ef167788ce3ad4cc9a0fce49a8352b6837c5ed2d3500000003398322f99355f37439e32881c83ff08b83e744e799b1d6a67f73bee4500006a473045022100a8fbc3d7c53377a36c31590631a23d46cc56a8ba30db65b52811d4516ff7e54102204514f69c4910706f5f2130600076fdb0a25b135de222efcaf41718a6926835762103c32f7899bec0d2f237450e695cbdcd849bf64d6180ce056777a195b1a6e0390d0000077500001976a9149651450c90725794e3554972dd97376c1e26307d88ac0000003700001976a9148e33e0fb3c06e890def74d48d326d0c5c00fac0b88ac000184fb",
                      "success": true
                    }
                  },
                  "error": {
                    "summary": "Invalid transaction",
                    "value": {
                      "success": false,
                      "message": "Transaction invalid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/state": {
      
      "get": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_state",
        "summary": "State of the wallet",
        "description": "Returns if the wallet is locked and its type",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "is_locked": false,
                      "type": "hd"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/unlock": {
      
      "post": {
        "tags": [
          "private_wallet"
        ],
        "operationId": "wallet_unlock",
        "summary": "Unlock a wallet",
        "description": "Unlock HD Wallet or Keypair Wallet, depending on the parameters sent. For Keypair Wallet, we need the password and for HD Wallet the passphrase and the words (optional)",
        "requestBody": {
          "description": "Data to unlock your wallet",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlockBody"
              },
              "examples": {
                "unlock_hd_with_words": {
                  "summary": "HD Wallet complete",
                  "value": {
                    "passphrase": "1234",
                    "words": "yellow viable junk brand mosquito sting rhythm stumble cricket report circle elite gasp kingdom spy capable beach peanut plastic finish robot venue mixture talent"
                  }
                },
                "unlock_hd_without_words": {
                  "summary": "HD Wallet no words",
                  "value": {
                    "passphrase": "1234"
                  }
                },
                "unlock_hd_without_anything": {
                  "summary": "HD Wallet with nothing",
                  "value": {
                    "passphrase": ""
                  }
                },
                "unlock_keypair": {
                  "summary": "Data to unlock keypair wallet",
                  "value": {
                    "password": "1234"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success_hd": {
                    "summary": "HD Wallet unlocked",
                    "value": {
                      "success": true,
                      "words": "yellow viable junk brand mosquito sting rhythm stumble cricket report circle elite gasp kingdom spy capable beach peanut plastic finish robot venue mixture talent"
                    }
                  },
                  "success_keypair": {
                    "summary": "Keypair Wallet unlocked",
                    "value": {
                      "success": true
                    }
                  },
                  "error_hd": {
                    "summary": "Error unlocking HD wallet",
                    "value": {
                      "success": false,
                      "message": "Invalid words"
                    }
                  },
                  "error_keypair": {
                    "summary": "Error unlocking keypair wallet",
                    "value": {
                      "success": false,
                      "message": "Invalid password"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/nano-contract/decode": {
      
      "get": {
        "tags": [
          "nano-contract"
        ],
        "operationId": "nano_contract_decode",
        "summary": "Decode nano contract",
        "description": "Returns the nano contract transaction decoded",
        "parameters": [
          {
            "name": "hex_tx",
            "in": "query",
            "description": "Nano contract to be decoded in hexadecimal",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "nano_contract": {
                        "type": "NanoContractMatchValues",
                        "oracle_pubkey_hash": "6o6ul2c+sqAariBVW+CwNaSJb9w=",
                        "min_timestamp": 1,
                        "oracle_data_id": "some_id",
                        "value_dict": {
                          "1Pa4MMsr5DMRAeU1PzthFXyEJeVNXsMHoz": 300
                        },
                        "fallback_pubkey_hash": "13Y2oCMN8Lb6F3RLoPEofZz1bvX75dvEb",
                        "value": 2000
                      },
                      "outputs": [
                        {
                          "type": "P2PKH",
                          "address": "1Q4qyTjhpUXUZXzwKs6Yvh2RNnF5J1XN9a",
                          "timelock": null,
                          "value": 4294967295,
                          "token_data": 0
                        }
                      ],
                      "my_inputs": [
                        {
                          "tx_id": "7918fd6dfe9df2abf3010b1403efbedafcc86167a5c44cf65cd525ca40ca43b7",
                          "index": 0,
                          "data": ""
                        }
                      ],
                      "other_inputs": []
                    }
                  },
                  "error": {
                    "summary": "Invalid transaction",
                    "value": {
                      "success": false,
                      "message": "Invalid transaction"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/nano-contract/execute": {
      
      "post": {
        "tags": [
          "nano-contract"
        ],
        "operationId": "nano_contract_execute",
        "summary": "Execute nano contract",
        "description": "Returns the hexadecimal of the propagated transaction",
        "requestBody": {
          "description": "Data to execute nano contract",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NanoContractExecute"
              },
              "examples": {
                "data": {
                  "summary": "Data to execute nano contract",
                  "value": {
                    "spent_tx_id": "6da000cdbd93d71052a45d33809f9fbd4400f0ec614ed7fcec7e01071629946e",
                    "spent_tx_index": 0,
                    "oracle_data": "B3NvbWVfaWQEW/xjGQIBLA==",
                    "oracle_signature": "MEUCIGeqbmLRI6lrgXMy4sQEgK94F5m14oVL5Z7oLLVII7BUAiEApKTMuWlwvws574+jtqKW5/AuH+ICD0u+HyMyHe0aric=",
                    "oracle_pubkey": "Awmloohhey8WhajdDURgvbk1z3JHX2vxDSBjz9uG9wEp",
                    "address": "1Pa4MMsr5DMRAeU1PzthFXyEJeVNXsMHoz",
                    "value": 2000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "hex_tx": "00013ff00000000000005c3899fc0000000000000000000100010002005d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd30002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c25d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd300007b1007736f6d655f6964045bfc631902012c473045022067aa6e62d123a96b817332e2c40480af781799b5e2854be59ee82cb54823b054022100a4a4ccb96970bf0b39ef8fa3b6a296e7f02e1fe2020f4bbe1f23321ded1aae27210309a5a288617b2f1685a8dd0d4460bdb935cf72475f6bf10d2063cfdb86f70129000007d000001976a914f7934a91973cd100d753304f9a98267c8d4e6c0a88ac00000000"
                    }
                  },
                  "error1": {
                    "summary": "Parameter error",
                    "value": {
                      "success": false,
                      "message": "Parameter error message"
                    }
                  },
                  "error2": {
                    "summary": "Propagation error",
                    "value": {
                      "success": false,
                      "message": "Propagation error message"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/wallet/nano-contract/match-value": {
      
      "post": {
        "tags": [
          "nano-contract"
        ],
        "operationId": "nano_contract_match_value_post",
        "summary": "Create a match value nano contract",
        "description": "Returns the hexadecimal of the created nano contract",
        "requestBody": {
          "description": "Data to create the nano contract",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NanoContractPOST"
              },
              "examples": {
                "data": {
                  "summary": "Data to create the nano contract",
                  "value": {
                    "oracle_data_id": "some_id",
                    "total_value": 2000,
                    "input_value": 2000,
                    "min_timestamp": 1,
                    "fallback_address": "1CBxvu6tFPTU8ygSPj9vyEadf9DsqTwy3D",
                    "values": [
                      {
                        "address": "1Pa4MMsr5DMRAeU1PzthFXyEJeVNXsMHoz",
                        "value": 300
                      }
                    ],
                    "oracle_pubkey_hash": "6o6ul2c+sqAariBVW+CwNaSJb9w="
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "hex_tx": "00013ff00000000000005c3899fc0000000000000000000100010002005d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd30002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c25d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd300007b1007736f6d655f6964045bfc631902012c473045022067aa6e62d123a96b817332e2c40480af781799b5e2854be59ee82cb54823b054022100a4a4ccb96970bf0b39ef8fa3b6a296e7f02e1fe2020f4bbe1f23321ded1aae27210309a5a288617b2f1685a8dd0d4460bdb935cf72475f6bf10d2063cfdb86f70129000007d000001976a914f7934a91973cd100d753304f9a98267c8d4e6c0a88ac00000000"
                    }
                  },
                  "error": {
                    "summary": "Parameter error",
                    "value": {
                      "success": false,
                      "message": "Parameter error message"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "nano-contract"
        ],
        "operationId": "nano_contract_match_value_put",
        "summary": "Update a match value nano contract",
        "description": "Returns the hexadecimal of the updated nano contract",
        "requestBody": {
          "description": "Data to update the nano contract",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NanoContractPUT"
              },
              "examples": {
                "data": {
                  "summary": "Data to update the nano contract",
                  "value": {
                    "new_values": [
                      {
                        "address": "1CBxvu6tFPTU8ygSPj9vyEadf9DsqTwy3D",
                        "value": 500
                      }
                    ],
                    "input_value": 2000,
                    "hex_tx": "000100000000000000005c38a2bd00000000000000000001000200000075b16110c1bb244c6b8f23882c1846c1f6ec4e03427ecb676549381cecf11711000000000007d000006676a914ea8eae97673eb2a01aae20555be0b035a4896fdc88ba5007736f6d655f6964c0510400000001c15219007abc3b0c0425d3065c43f6bccdc16aa871f3bbad9ced28f002012c1900f7934a91973cd100d753304f9a98267c8d4e6c0a5554da250101d1d0ffffffff00001976a914fd05059b6006249543b82f36876a17c73fd2267b88ac00000000"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "hex_tx": "00013ff00000000000005c3899fc0000000000000000000100010002005d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd30002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c25d9e609fb85c512ac590221aed8cc5e7b7f646a4511e61ec401eba7bda794bd300007b1007736f6d655f6964045bfc631902012c473045022067aa6e62d123a96b817332e2c40480af781799b5e2854be59ee82cb54823b054022100a4a4ccb96970bf0b39ef8fa3b6a296e7f02e1fe2020f4bbe1f23321ded1aae27210309a5a288617b2f1685a8dd0d4460bdb935cf72475f6bf10d2063cfdb86f70129000007d000001976a914f7934a91973cd100d753304f9a98267c8d4e6c0a88ac00000000"
                    }
                  },
                  "error1": {
                    "summary": "Parameter error",
                    "value": {
                      "success": false,
                      "message": "Parameter error message"
                    }
                  },
                  "error2": {
                    "summary": "Nano contract not found",
                    "value": {
                      "success": false,
                      "message": "Nano contract not found"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/address_balance": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "address_balance",
        "summary": "Balance of an address",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "Address to get balance",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "total_transactions": 5,
                      "tokens_data": {
                        "00": {
                          "name": "Hathor",
                          "symbol": "HTR",
                          "received": 1000,
                          "spent": 800
                        },
                        "00000828d80dd4cd809c959139f7b4261df41152f4cce65a8777eb1c3a1f9702": {
                          "name": "NewCoin",
                          "symbol": "NCN",
                          "received": 100,
                          "spent": 20
                        }
                      }
                    }
                  },
                  "error": {
                    "summary": "Invalid address",
                    "value": {
                      "success": false,
                      "message": "The address xx is invalid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/address_history": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "address_history",
        "summary": "History of some addresses. Important note: different requests (even pagination requests) may return the same transaction for different addresses. We just validate if a transactions was already added in the same request.",
        "parameters": [
          {
            "name": "addresses[]",
            "in": "query",
            "description": "Stringified array of addresses",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "has_more": true,
                      "first_hash": "00000299670db5814f69cede8b347f830f73985eaa4cd1ce87c9a7c793771332",
                      "first_address": "1Pz5s5WVL52MK4EwBy9XVQUzWjF2LWWKiS",
                      "history": [
                        {
                          "hash": "00000299670db5814f69cede8b347f830f73985eaa4cd1ce87c9a7c793771336",
                          "timestamp": 1552422415,
                          "is_voided": false,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb5",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb1"
                          ],
                          "inputs": [
                            {
                              "value": 42500000044,
                              "script": "dqkURJPA8tDMJHU8tqv3SiO18ZCLEPaIrA==",
                              "decoded": {
                                "type": "P2PKH",
                                "address": "17Fbx9ouRUD1sd32bp4ptGkmgNzg7p2Krj",
                                "timelock": null
                              },
                              "token": "00",
                              "tx": "000002d28696f94f89d639022ae81a1d870d55d189c27b7161d9cb214ad1c90c",
                              "index": 0
                            }
                          ],
                          "outputs": [
                            {
                              "value": 42499999255,
                              "script": "dqkU/B6Jbf5OnslsQrvHXQ4WKDTSEGKIrA==",
                              "decoded": {
                                "type": "P2PKH",
                                "address": "1Pz5s5WVL52MK4EwBy9XVQUzWjF2LWWKiS",
                                "timelock": null
                              },
                              "token": "00"
                            },
                            {
                              "value": 789,
                              "script": "dqkUrWoWhiP+qPeI/qwfwb5fgnmtd4CIrA==",
                              "decoded": {
                                "type": "P2PKH",
                                "address": "1GovzJvbzLw6x4H2a1hHb529cpEWzh3YRd",
                                "timelock": null
                              },
                              "token": "00"
                            }
                          ],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        }
                      ]
                    }
                  },
                  "error": {
                    "summary": "Invalid address",
                    "value": {
                      "success": false,
                      "message": "The address xx is invalid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/address_search": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "address_search",
        "summary": "Search history transactions of an address with pagination",
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "description": "Address to be searched",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "count",
            "in": "query",
            "description": "Quantity of elements to return",
            "required": true,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "If the user clicked \"previous\" or \"next\" button",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hash",
            "in": "query",
            "description": "Hash reference for the pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "transactions": [
                        {
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "timestamp": 1547163030,
                          "version": 1,
                          "weight": 18.861583646228,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 1,
                              "data": "RzBFAiEAvv17vp8XyHYq36PFlOGd7V2vzIkf+XIuqfyUnc2fZugCIDnwM7PdkA/qwt2QXLB3WnegtdOqV8gv+H63voWVbsScIQPqg7y2RanTdnQcDvFneIzjrUzJoPzkmoNStoN8XtLTUA=="
                            },
                            {
                              "tx_id": "0000003398322f99355f37439e32881c83ff08b83e744e799b1d6a67f73bee45",
                              "index": 0,
                              "data": "RzBFAiEAqPvD18Uzd6NsMVkGMaI9RsxWqLow22W1KBHUUW/35UECIEUU9pxJEHBvXyEwYAB2/bCiWxNd4iLvyvQXGKaSaDV2IQPDL3iZvsDS8jdFDmlcvc2Em/ZNYYDOBWd3oZWxpuA5DQ=="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1909,
                              "script": "dqkUllFFDJByV5TjVUly3Zc3bB4mMH2IrA=="
                            },
                            {
                              "value": 55,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": [],
                          "height": 12345
                        },
                        {
                          "tx_id": "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                          "timestamp": 1547163025,
                          "version": 1,
                          "weight": 17.995048894541107,
                          "parents": [
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9",
                            "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 0,
                              "data": "SDBGAiEA/rtsn1oQ68uGeTj/7IVtqijxoUxzr9S/u3UGAC7wQvUCIQDaYkL1R8LICfSCpYIn4xx6A+lxU0Fw3oKR1hK91fRnSiEDCoA74tfBQa4IR7iXtlz+jH9UV7+YthKX4yQNaMSMfb0="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1894,
                              "script": "dqkUduvtU77hZm++Pwavtl9OrOSA+XiIrA=="
                            },
                            {
                              "value": 84,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": []
                        }
                      ],
                      "has_more": true,
                      "total": 10
                    }
                  },
                  "error": {
                    "summary": "Invalid address",
                    "value": {
                      "success": false,
                      "message": "The address xx is invalid"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/send_tokens": {
      "post": {
        "tags": [
          "wallet"
        ],
        "operationId": "send_tokens",
        "summary": "Send tokens",
        "requestBody": {
          "description": "Data to create the transaction",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ThinWalletSendToken"
              },
              "examples": {
                "data": {
                  "summary": "Data to create the transaction",
                  "value": {
                    "tx_hex": "00000c064ec72c8561a24b65bd50095a401b8d9a66c360cfe99cfcfeed73afc4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "message": "",
                      "tx": {
                        "hash": "00000c064ec72c8561a24b65bd50095a401b8d9a66c360cfe99cfcfeed73afc4",
                        "nonce": 2979,
                        "timestamp": 1547211690,
                        "version": 1,
                        "weight": 17.93619278054934,
                        "height": 0,
                        "parents": [
                          "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4"
                        ],
                        "inputs": [
                          {
                            "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                            "index": 0,
                            "data": "RzBFAiAh6Jq+HOn9laOq3A5uUcaGLdWB4gM6RehsaP9OIMrOrwIhAOjWT+4ceSQI8CNXqaNNJgaOzCDhmFF1z1rhxOMCgonxIQNhXZKwBZeKxJpsJEqP4gIS4FFbEpG284HhmBfp1p5gUw=="
                          }
                        ],
                        "outputs": [
                          {
                            "value": 1109,
                            "script": "dqkUMUdd0fmGCmGfv7B5UriM5VS5g16IrA=="
                          },
                          {
                            "value": 800,
                            "script": "dqkUeZkoJssEgwjPw/1ubA9XXZNk+xGIrA=="
                          }
                        ],
                        "tokens": []
                      }
                    }
                  },
                  "error1": {
                    "summary": "Invalid address",
                    "return_code": "stratum_resolve",
                    "value": {
                      "success": false,
                      "message": "The address abc is invalid"
                    }
                  },
                  "error2": {
                    "summary": "Insufficient funds",
                    "return_code": "python_resolve",
                    "value": {
                      "success": false,
                      "message": "Insufficient funds"
                    }
                  },
                  "error3": {
                    "summary": "Invalid input",
                    "return_code": "python_resolve",
                    "value": {
                      "success": false,
                      "message": "Invalid input to create transaction"
                    }
                  },
                  "error4": {
                    "summary": "Propagation error",
                    "value": {
                      "success": false,
                      "return_code": "propagating_error",
                      "message": "Propagation error message",
                      "tx": {
                        "hash": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f",
                        "nonce": 17076,
                        "timestamp": 1539271482,
                        "version": 1,
                        "weight": 14.0,
                        "height": 1,
                        "parents": [],
                        "inputs": [],
                        "outputs": [],
                        "tokens": [],
                        "accumulated_weight": 14.0,
                        "accumulated_weight_raw": "16384"
                      }
                    }
                  },
                  "error5": {
                    "summary": "Double spending error",
                    "value": {
                      "success": false,
                      "return_code": "double_spending",
                      "message": "Invalid transaction. At least one of your inputs hasalready been spent."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/token_history": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "tokenHistory",
        "summary": "Get history transactions of a token",
        "parameters": [
          {
            "name": "count",
            "in": "query",
            "description": "Quantity of elements to return",
            "required": false,
            "schema": {
              "type": "int"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "If the user clicked \"previous\" or \"next\" button",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hash",
            "in": "query",
            "description": "Hash reference for the pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "description": "Timestamp reference for the pagination",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "id",
            "in": "query",
            "description": "Token id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "transactions": [
                        {
                          "tx_id": "00000257054251161adff5899a451ae974ac62ca44a7a31179eec5750b0ea406",
                          "nonce": 99579,
                          "timestamp": 1547163030,
                          "version": 1,
                          "weight": 18.861583646228,
                          "parents": [
                            "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 1,
                              "data": "RzBFAiEAvv17vp8XyHYq36PFlOGd7V2vzIkf+XIuqfyUnc2fZugCIDnwM7PdkA/qwt2QXLB3WnegtdOqV8gv+H63voWVbsScIQPqg7y2RanTdnQcDvFneIzjrUzJoPzkmoNStoN8XtLTUA=="
                            },
                            {
                              "tx_id": "0000003398322f99355f37439e32881c83ff08b83e744e799b1d6a67f73bee45",
                              "index": 0,
                              "data": "RzBFAiEAqPvD18Uzd6NsMVkGMaI9RsxWqLow22W1KBHUUW/35UECIEUU9pxJEHBvXyEwYAB2/bCiWxNd4iLvyvQXGKaSaDV2IQPDL3iZvsDS8jdFDmlcvc2Em/ZNYYDOBWd3oZWxpuA5DQ=="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1909,
                              "script": "dqkUllFFDJByV5TjVUly3Zc3bB4mMH2IrA=="
                            },
                            {
                              "value": 55,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": null
                        },
                        {
                          "tx_id": "00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4",
                          "nonce": 119816,
                          "timestamp": 1547163025,
                          "version": 1,
                          "weight": 17.995048894541107,
                          "parents": [
                            "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9",
                            "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6"
                          ],
                          "inputs": [
                            {
                              "tx_id": "0000088c5a4dfcef7fd3c04a5b1eccfd2de032b23749deff871b0a090000f5f6",
                              "index": 0,
                              "data": "SDBGAiEA/rtsn1oQ68uGeTj/7IVtqijxoUxzr9S/u3UGAC7wQvUCIQDaYkL1R8LICfSCpYIn4xx6A+lxU0Fw3oKR1hK91fRnSiEDCoA74tfBQa4IR7iXtlz+jH9UV7+YthKX4yQNaMSMfb0="
                            }
                          ],
                          "outputs": [
                            {
                              "value": 1894,
                              "script": "dqkUduvtU77hZm++Pwavtl9OrOSA+XiIrA=="
                            },
                            {
                              "value": 84,
                              "script": "dqkUjjPg+zwG6JDe901I0ybQxcAPrAuIrA=="
                            }
                          ],
                          "tokens": [],
                          "first_block": "000005af290a55b079014a0be3246479e84eeb635f02010dbf3e5f3414a85bbb"
                        }
                      ],
                      "has_more": true
                    }
                  },
                  "error": {
                    "summary": "Invalid token id",
                    "value": {
                      "success": false,
                      "message": "Invalid token id"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/thin_wallet/token": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "token",
        "summary": "Get information about a token if send token ID, otherwise return list of tokens",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "Token id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "success": true,
                      "name": "MyCoin",
                      "symbol": "MYC",
                      "mint": [
                        {
                          "tx_id": "00000299670db5814f69cede8b347f830f73985eaa4cd1ce87c9a7c793771336",
                          "index": 0
                        }
                      ],
                      "melt": [
                        {
                          "tx_id": "00000299670db5814f69cede8b347f830f73985eaa4cd1ce87c9a7c793771336",
                          "index": 1
                        }
                      ],
                      "total": 50000,
                      "transactions_count": 3
                    }
                  },
                  "error": {
                    "summary": "Invalid token id",
                    "value": {
                      "success": false,
                      "message": "Invalid token id"
                    }
                  },
                  "success_list": {
                    "summary": "List of tokens success",
                    "value": {
                      "success": true,
                      "truncated": false,
                      "tokens": [
                        {
                          "uid": "00000b1b8b1df522489f9aa38cba82a450b1fe58093e97bc94a0275fbeb226b2",
                          "name": "MyCoin",
                          "symbol": "MYC"
                        },
                        {
                          "uid": "00000093f76f44c664907a017bbf9ef6bb289692e30c7cf7361e6872c5ee1796",
                          "name": "New Token",
                          "symbol": "NTK"
                        }
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/websocket_stats": {
      
      "get": {
        "operationId": "websocket_stats",
        "summary": "Websocket stats",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "examples": {
                  "success": {
                    "summary": "Success",
                    "value": {
                      "connections": 4,
                      "addresses": 6
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UnlockBody": {
        "type": "object",
        "properties": {
          "words": {
            "type": "string",
            "description": "24 words for HD Wallet"
          },
          "passphrase": {
            "type": "string",
            "description": "Passphrase for HD Wallet (can be empty string)"
          },
          "password": {
            "type": "string",
            "description": "Password to unlock keypair wallet"
          }
        }
      },
      "MinedBlock": {
        "type": "object",
        "required": [
          "block_bytes"
        ],
        "properties": {
          "block_bytes": {
            "type": "string",
            "description": "Bytes of block after pow in base 64"
          }
        }
      },
      "AddressOutput": {
        "type": "object",
        "required": [
          "address",
          "value"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Destination address in base58"
          },
          "value": {
            "type": "integer",
            "description": "Value to be sent to the address (without decimal places, e.g. if you want to send 10.02 the value must be 1002)"
          },
          "timelock": {
            "type": "integer",
            "description": "Timestamp until when the output is locked"
          },
          "token_uid": {
            "type": "string",
            "description": "Hex encoded token uid, ommit for HTR"
          }
        }
      },
      "ScriptOutput": {
        "type": "object",
        "required": [
          "script",
          "value"
        ],
        "properties": {
          "script": {
            "type": "string",
            "description": "Output script in base64"
          },
          "value": {
            "type": "integer",
            "description": "Value to be sent to the address (without decimal places, e.g. if you want to send 10.02 the value must be 1002)"
          },
          "token_uid": {
            "type": "string",
            "description": "Hex encoded token uid, ommit for HTR"
          }
        }
      },
      "Input": {
        "type": "object",
        "required": [
          "tx_id",
          "index"
        ],
        "properties": {
          "tx_id": {
            "type": "string",
            "description": "Hash in hex of the spending transaction"
          },
          "index": {
            "type": "integer",
            "description": "Index of the output is being spent"
          }
        }
      },
      "TxInput": {
        "type": "object",
        "properties": {
          "tx_id": {
            "type": "string",
            "description": "Hash in hex of the spending transaction"
          },
          "index": {
            "type": "integer",
            "description": "Index of the output is being spent"
          },
          "data": {
            "type": "string",
            "description": "Data appended to input for verifying utxo, aka signature"
          }
        }
      },
      "TxOutput": {
        "type": "object",
        "properties": {
          "script": {
            "type": "string",
            "description": "Output script in base64"
          },
          "value": {
            "type": "integer",
            "description": "Value to be sent to the address (without decimal places, e.g. if you want to send 10.02 the value must be 1002)"
          },
          "token_data": {
            "type": "integer",
            "description": "Index selecting token_uid from list"
          }
        }
      },
      "SendToken": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "outputs",
              "inputs"
            ],
            "properties": {
              "outputs": {
                "type": "array",
                "description": "List of outputs to send the tokens",
                "items": {
                  "$ref": "#/components/schemas/AddressOutput"
                }
              },
              "inputs": {
                "type": "array",
                "description": "List of inputs to spend the tokens (can be empty)",
                "items": {
                  "$ref": "#/components/schemas/Input"
                }
              },
              "timestamp": {
                "type": "integer",
                "description": "The timestamp for the transaction. If sent without the inputs, server will chose inputs whose timestamp is smaller than the given value (so the tx is valid). If user sends timestamp=0, server will use current time."
              }
            }
          }
        }
      },
      "ThinWalletSendToken": {
        "type": "object",
        "required": [
          "tx_hex"
        ],
        "properties": {
          "tx_hex": {
            "type": "string",
            "description": "Serialized transaction in hexadecimal before parents and pow"
          }
        }
      },
      "NanoContractExecute": {
        "type": "object",
        "required": [
          "spent_tx_id",
          "spent_tx_index",
          "oracle_data",
          "oracle_signature",
          "oracle_pubkey",
          "address",
          "value"
        ],
        "properties": {
          "spent_tx_id": {
            "type": "string",
            "description": "Id in hex of the transaction being spent"
          },
          "spent_tx_index": {
            "type": "index",
            "description": "Index of the output of the transaction being spent"
          },
          "oracle_data": {
            "type": "string",
            "description": "Data in base64 provided by the oracle"
          },
          "oracle_signature": {
            "type": "string",
            "description": "Signature in base64 of the oracle data"
          },
          "oracle_pubkey": {
            "type": "string",
            "description": "Public key of the oracle in base64"
          },
          "address": {
            "type": "string",
            "description": "Winning address in base58"
          },
          "value": {
            "type": "integer",
            "description": "Total value of the nano contract (without decimal places)"
          }
        }
      },
      "NanoContractBet": {
        "type": "object",
        "required": [
          "address",
          "value"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Destination address of the bet in base58"
          },
          "value": {
            "type": "integer",
            "description": "Value of the bet"
          }
        }
      },
      "NanoContractPOST": {
        "type": "object",
        "required": [
          "values",
          "fallback_address",
          "oracle_pubkey_hash",
          "oracle_data_id",
          "total_value",
          "input_value"
        ],
        "properties": {
          "values": {
            "type": "array",
            "description": "List of bets",
            "items": {
              "$ref": "#/components/schemas/NanoContractBet"
            }
          },
          "fallback_address": {
            "type": "string",
            "description": "Address in base58 that will execute the contract in case none of the bets is the winner"
          },
          "oracle_pubkey_hash": {
            "type": "string",
            "description": "Oracle public key in base64"
          },
          "oracle_data_id": {
            "type": "string",
            "description": "Id of the oracle of this nano contract"
          },
          "total_value": {
            "type": "integer",
            "description": "Total value of the nano contract"
          },
          "input_value": {
            "type": "integer",
            "description": "Amount this wallet should stake in the nano contract"
          }
        }
      },
      "NanoContractPUT": {
        "type": "object",
        "required": [
          "hex_tx",
          "new_values",
          "input_value"
        ],
        "properties": {
          "hex_tx": {
            "type": "string",
            "description": "Nano contract transaction being updated in hexadecimal"
          },
          "new_values": {
            "type": "array",
            "description": "New list of bets",
            "items": {
              "$ref": "#/components/schemas/NanoContractBet"
            }
          },
          "input_value": {
            "type": "integer",
            "description": "New amount this wallet should stake in the nano contract"
          }
        }
      },
      "ProfilerPOST": {
        "type": "object",
        "properties": {
          "start": {
            "type": "bool",
            "description": "Only sent if should start profiler"
          },
          "stop": {
            "type": "bool",
            "description": "Only sent if should stop profiler"
          },
          "filepath": {
            "type": "string",
            "description": "Path to save the profiler path (only in case of stop)"
          }
        }
      }
    }
  }
}
