Created
September 15, 2019 19:13
-
-
Save fccoelho/026e1ff96488f1d3009660ea7af58d40 to your computer and use it in GitHub Desktop.
openApi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"openapi": "3.0.0", "servers": [{"url": "http://localhost:8080"}], "info": {"title": "Hathor API", "version": "0.16.0-beta"}, "consumes": ["application/json"], "produces": ["application/json"], "paths": {"/p2p/peers": {"x-visibility": "private", "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"]}}}}}}}}}, "/mining": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "200r/s", "burst": 200, "delay": 100}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "get": {"tags": ["p2p"], "operationId": "mining_get", "summary": "Block to be mined", "description": "Returns the base64 of the block to be mined inbytes and an array of the hash of parents in hex", "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"}}}}}}}, "/status": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "200r/s", "burst": 200, "delay": 100}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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": [], "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}}}}}}}}}}, "/dashboard_tx": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "50r/s", "burst": 100, "delay": 50}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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": {"transactions": [{"tx_id": "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2", "nonce": 91696, "timestamp": 1539271483, "version": 1, "weight": 14, "parents": ["00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb4", "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb9"], "inputs": [], "outputs": [], "tokens": []}, {"tx_id": "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f", "nonce": 17076, "timestamp": 1539271482, "version": 1, "weight": 14, "parents": ["00000b8792cb13e8adb51cc7d866541fc29b532e8dec95ae4661cf3da4d42cb5", "00001417652b9d7bd53eb14267834eab08f27e5cbfaca45a24370e79e0348bb1"], "inputs": [], "outputs": [], "tokens": []}], "blocks": [{"tx_id": "0001e29bf6271d15a6c89bffdf99a94351007a3aeb63a113d33493ce28b9de19", "nonce": 20133, "timestamp": 1547143591, "version": 1, "weight": 14, "parents": ["00035e46a20d0ecbda0dc6fdcaa243e93a7120baa8c90739e0d011370576de83", "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2", "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f"], "inputs": [], "outputs": [{"value": 2000, "script": "dqkUixvdsajkV6vO+9Jjgjbaheqn016IrA=="}], "tokens": []}, {"tx_id": "00035e46a20d0ecbda0dc6fdcaa243e93a7120baa8c90739e0d011370576de83", "nonce": 6024, "timestamp": 1547143590, "version": 1, "weight": 14, "parents": ["000133cc80b625b1babbd454edc3474e0a130dafee5d359c52aabcee3d1193ee", "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2", "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f"], "inputs": [], "outputs": [{"value": 2000, "script": "dqkUdNQbj29Md1xsAYinK+RsDJCCB7eIrA=="}], "tokens": []}, {"tx_id": "000133cc80b625b1babbd454edc3474e0a130dafee5d359c52aabcee3d1193ee", "nonce": 4527, "timestamp": 1547143589, "version": 1, "weight": 14, "parents": ["0001e298570e37d46f9101bcf903bde67186f26a83d88b9cb196f38b49623457", "00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f", "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2"], "inputs": [], "outputs": [{"value": 2000, "script": "dqkU0AoLEAX+1b36s+VyaMc9bkj/5byIrA=="}], "tokens": []}]}}}}}}}}}, "/transaction": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "50r/s", "burst": 100, "delay": 50}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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 indicatesif 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": 10, "score": 12, "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", "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": []}, {"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": []}], "has_more": true}}}}}}}}}, "/decode_tx": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "200r/s", "burst": 200, "delay": 100}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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": 10, "score": 12, "first_block": null}, "spent_outputs": {"0": "00002b3ce4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22e"}, "success": true}}, "error": {"summary": "Error when decoding transaction", "value": {"success": false}}}}}}}}}, "/graphviz/full.{format}": {"x-visibility": "private", "get": {"tags": ["transaction"], "operationId": "graphviz", "summary": "Dashboard of transactions", "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}": {"x-visibility": "public", "x-path-params-regex": {"format": "dot"}, "x-rate-limit": {"global": [{"rate": "20r/s", "burst": 20, "delay": 10}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "get": {"tags": ["transaction"], "operationId": "graphviz", "summary": "Dashboard of transactions", "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": {}}}}}}}}}, "/graphviz": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "20r/s", "burst": 20, "delay": 10}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "get": {"tags": ["transaction"], "operationId": "graphviz", "summary": "Dashboard of transactions", "description": "Returns the generated file with the graph in the format requested.Can be the full graph of the neighborhood graph of a transaction.", "parameters": [{"name": "format", "in": "query", "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": "tx", "in": "query", "description": "Id of the transaction or block to generate the neighborhood graph", "required": false, "schema": {"type": "string"}}, {"name": "graph_type", "in": "query", "description": "Type of the graph in case of a neighborhood graph.", "required": false, "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": false, "schema": {"type": "int"}}], "responses": {"200": {"description": "Success", "content": {"application/json": {"examples": {"success": {"summary": "Success", "value": {}}, "error": {"summary": "Error", "value": {"success": false, "message": "Graph max level is 10"}}}}}}}}}, "/push_tx": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "100r/s"}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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."}}}}}}}}}, "/tips": {"x-visibility": "private", "get": {"tags": ["transaction"], "operationId": "tips", "summary": "Tips", "description": "Returns a list of tips hashes in hexadecimal", "parameters": [{"name": "timestamp", "in": "query", "description": "Timestamp to search for the tips", "required": false, "schema": {"type": "int"}}], "responses": {"200": {"description": "Success", "content": {"application/json": {"examples": {"success": {"summary": "Success", "value": ["00002b3be4e3876e67b5e090d76dcd71cde1a30ca1e54e38d65717ba131cd22f", "0002bb171de3490828028ec5eef3325956acb6bcffa6a50466bb9a81d38363c2"]}}}}}}}}, "/tips-histogram": {"x-visibility": "private", "get": {"tags": ["transaction"], "operationId": "tips_histogram", "summary": "Histogram of tips", "description": "Returns a list of tuples (timestamp, quantity)for each timestamp in the requested interval", "parameters": [{"name": "begin", "in": "query", "description": "Beggining of the timestamp interval", "required": true, "schema": {"type": "int"}}, {"name": "end", "in": "query", "description": "End of the timestamp interval", "required": true, "schema": {"type": "int"}}], "responses": {"200": {"description": "Success", "content": {"application/json": {"examples": {"success": {"summary": "Success", "value": [[1547163020, 1], [1547163021, 4], [1547163022, 2]]}}}}}}}}, "/transaction_acc_weight": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "10r/s", "burst": 20, "delay": 10}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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, "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"}}}}}}}}}, "/wallet/address": {"x-visibility": "private", "get": {"tags": ["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": {"x-visibility": "private", "get": {"tags": ["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": {"x-visibility": "private", "get": {"tags": ["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": {"x-visibility": "private", "post": {"tags": ["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": {"x-visibility": "private", "post": {"tags": ["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}}}}}}}}}}, "/wallet/sign_tx": {"x-visibility": "private", "get": {"tags": ["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": {"x-visibility": "private", "get": {"tags": ["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": {"x-visibility": "private", "post": {"tags": ["wallet"], "operationId": "wallet_unlock", "summary": "Unlock a wallet", "description": "Unlock HD Wallet or Keypair Wallet, depending on the parameters sent. For Keypair Walletwe 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": {"x-visibility": "private", "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": {"x-visibility": "private", "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": {"x-visibility": "private", "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_history": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "100r/s", "burst": 100, "delay": 50}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "get": {"tags": ["thin_wallet"], "operationId": "address_history", "summary": "History of some addresses", "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": {"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"}]}]}}, "error": {"summary": "Invalid address", "value": {"success": false, "message": "The address xx is invalid"}}}}}}}}}, "/thin_wallet/send_tokens": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "100r/s"}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "post": {"tags": ["thin_wallet"], "operationId": "thin_wallet_send_tokens", "summary": "Send tokens in a thin wallet", "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", "value": {"success": false, "message": "The address abc is invalid"}}, "error2": {"summary": "Insufficient funds", "value": {"success": false, "message": "Insufficient funds"}}, "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, "height": 1, "parents": [], "inputs": [], "outputs": [], "tokens": [], "accumulated_weight": 14}}}, "error5": {"summary": "Double spending error", "value": {"success": false, "message": "Invalid transaction. At least one of your inputs hasalready been spent."}}}}}}}}}, "/thin_wallet/token": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "100r/s", "burst": 100, "delay": 50}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "get": {"tags": ["thin_wallet"], "operationId": "token", "summary": "Get information about a token", "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}}, "error": {"summary": "Invalid token id", "value": {"success": false, "message": "Invalid token id"}}}}}}}}}, "/version": {"x-visibility": "public", "x-rate-limit": {"global": [{"rate": "360r/s", "burst": 360, "delay": 180}], "per-ip": [{"rate": "3r/s", "burst": 10, "delay": 3}]}, "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}}}}}}}}}, "/profiler": {"x-visibility": "private", "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}}, "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}}}}}}}}}, "/websocket_stats": {"x-visibility": "private", "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"}}}, "Output": {"type": "object", "required": ["address", "value"], "properties": {"address": {"type": "string", "description": "Destination address in base58"}, "value": {"type": "int", "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": "int", "description": "Timestamp until when the output is locked"}}}, "Input": {"type": "object", "required": ["tx_id", "index"], "properties": {"tx_id": {"type": "string", "description": "Hash in hex of the spending transaction"}, "index": {"type": "int", "description": "Index of the output is being spent"}}}, "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/Output"}}, "inputs": {"type": "array", "description": "List of inputs to spend the tokens (can be empty)", "items": {"$ref": "#/components/schemas/Input"}}, "timestamp": {"type": "int", "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": "int", "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": "int", "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": "int", "description": "Total value of the nano contract"}, "input_value": {"type": "int", "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": "int", "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)"}}}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment