diff --git a/api.php b/api.php index e0a4ffe..4580879 100755 --- a/api.php +++ b/api.php @@ -23,6 +23,50 @@ DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +/** + * @api {get} /api.php 01. Basic Information + * @apiName Info + * @apiGroup API + * @apiDescription Each API call will return the result in JSON format. + * There are 2 objects, "status" and "data". + * + * The "status" object returns "ok" when the transaction is successful and "error" on failure. + * + * The "data" object returns the requested data, as sub-objects. + * + * The parameters must be sent either as POST['data'], json encoded array or independently as GET. + * + * @apiSuccess {String} status "ok" + * @apiSuccess {String} data The data provided by the api will be under this object. + * + * @apiSuccessExample {json} Success-Response: + *{ + * "status":"ok", + * "data":{ + * "obj1":"val1", + * "obj2":"val2", + * "obj3":{ + * "obj4":"val4", + * "obj5":"val5" + * } + * } + *} + * + * @apiError {String} status "error" + * @apiError {String} result Information regarding the error + * + * @apiErrorExample {json} Error-Response: + * { + * "status": "error", + * "data": "The requested action could not be completed." + * } + */ + + + + require_once("include/init.inc.php"); error_reporting(0); $ip=$_SERVER['REMOTE_ADDR']; @@ -42,15 +86,49 @@ if(!empty($_POST['data'])){ } +/** + * @api {get} /api.php?q=getAddress 02. getAddress + * @apiName getAddress + * @apiGroup API + * @apiDescription Converts the public key to an ARO address. + * + * @apiParam {string} public_key The public key + * + * @apiSuccess {string} data Contains the address + */ + if($q=="getAddress"){ $public_key=$data['public_key']; if(strlen($public_key)<32) api_err("Invalid public key"); api_echo($acc->get_address($public_key)); } elseif($q=="base58"){ +/** + * @api {get} /api.php?q=base58 03. base58 + * @apiName base58 + * @apiGroup API + * @apiDescription Converts a string to base58. + * + * @apiParam {string} data Input string + * + * @apiSuccess {string} data Output string + */ + api_echo(base58_encode($data['data'])); } elseif($q=="getBalance"){ +/** + * @api {get} /api.php?q=getBalance 04. getBalance + * @apiName getBalance + * @apiGroup API + * @apiDescription Returns the balance of a specific account or public key. + * + * @apiParam {string} [public_key] Public key + * @apiParam {string} [account] Account id / address + * + * @apiSuccess {string} data The ARO balance + */ + $public_key=$data['public_key']; $account=$data['account']; if(!empty($public_key)&&strlen($public_key)<32) api_err("Invalid public key"); @@ -60,28 +138,86 @@ elseif($q=="getBalance"){ api_echo($acc->balance($account)); } elseif($q=="getPendingBalance"){ +/** + * @api {get} /api.php?q=getPendingBalance 05. getPendingBalance + * @apiName getPendingBalance + * @apiGroup API + * @apiDescription Returns the pending balance, which includes pending transactions, of a specific account or public key. + * + * @apiParam {string} [public_key] Public key + * @apiParam {string} [account] Account id / address + * + * @apiSuccess {string} data The ARO balance + */ $account=$data['account']; + if(!empty($public_key)&&strlen($public_key)<32) api_err("Invalid public key"); + if(!empty($public_key)) $account=$acc->get_address($public_key); if(empty($account)) api_err("Invalid account id"); $account=san($account); api_echo($acc->pending_balance($account)); } elseif($q=="getTransactions"){ +/** + * @api {get} /api.php?q=getTransactions 06. getTransactions + * @apiName getTransactions + * @apiGroup API + * @apiDescription Returns the latest transactions of an account. + * + * @apiParam {string} [public_key] Public key + * @apiParam {string} [account] Account id / address + * @apiParam {numeric} [limit] Number of confirmed transactions, max 1000, min 1 + * + * @apiSuccess {string} block Block ID + * @apiSuccess {numeric} confirmation Number of confirmations + * @apiSuccess {numeric} date Transaction's date in UNIX TIMESTAMP format + * @apiSuccess {string} dst Transaction destination + * @apiSuccess {numeric} fee The transaction's fee + * @apiSuccess {numeric} height Block height + * @apiSuccess {string} id Transaction ID/HASH + * @apiSuccess {string} message Transaction's message + * @apiSuccess {string} signature Transaction's signature + * @apiSuccess {string} public_key Account's public_key + * @apiSuccess {string} src Sender's address + * @apiSuccess {string} type "debit", "credit" or "mempool" + * @apiSuccess {numeric} val Transaction value + * @apiSuccess {numeric} version Transaction version + */ + $account=san($data['account']); + if(!empty($public_key)&&strlen($public_key)<32) api_err("Invalid public key"); + if(!empty($public_key)) $account=$acc->get_address($public_key); + if(empty($account)) api_err("Invalid account id"); + $limit=intval($data['limit']); $transactions=$acc->get_mempool_transactions($account); $transactions=array_merge($transactions, $acc->get_transactions($account,$limit)); api_echo($transactions); -} -elseif($q=="getPublicKey"){ - $account=san($data['account']); - if(empty($account)) api_err("Invalid account id"); - $public_key=$acc->public_key($account); - if($public_key===false) api_err("No public key found for this account"); - else api_echo($public_key); - } elseif($q=="getTransaction"){ +/** + * @api {get} /api.php?q=getTransaction 07. getTransaction + * @apiName getTransaction + * @apiGroup API + * @apiDescription Returns one transaction. + * + * @apiParam {string} transaction Transaction ID + * + * @apiSuccess {string} block Block ID + * @apiSuccess {numeric} confirmation Number of confirmations + * @apiSuccess {numeric} date Transaction's date in UNIX TIMESTAMP format + * @apiSuccess {string} dst Transaction destination + * @apiSuccess {numeric} fee The transaction's fee + * @apiSuccess {numeric} height Block height + * @apiSuccess {string} id Transaction ID/HASH + * @apiSuccess {string} message Transaction's message + * @apiSuccess {string} signature Transaction's signature + * @apiSuccess {string} public_key Account's public_key + * @apiSuccess {string} src Sender's address + * @apiSuccess {string} type "debit", "credit" or "mempool" + * @apiSuccess {numeric} val Transaction value + * @apiSuccess {numeric} version Transaction version + */ $id=san($data['transaction']); $res=$trx->get_transaction($id); @@ -90,18 +226,145 @@ elseif($q=="getPublicKey"){ if($res===false) api_err("invalid transaction"); } api_Echo($res); +} elseif($q=="getPublicKey"){ +/** + * @api {get} /api.php?q=getPublicKey 08. getPublicKey + * @apiName getPublicKey + * @apiGroup API + * @apiDescription Returns the public key of a specific account. + * + * @apiParam {string} account Account id / address + * + * @apiSuccess {string} data The public key + */ + + $account=san($data['account']); + if(empty($account)) api_err("Invalid account id"); + $public_key=$acc->public_key($account); + if($public_key===false) api_err("No public key found for this account"); + else api_echo($public_key); + } elseif($q=="generateAccount"){ +/** + * @api {get} /api.php?q=generateAccount 09. generateAccount + * @apiName generateAccount + * @apiGroup API + * @apiDescription Generates a new account. This function should only be used when the node is on the same host or over a really secure network. + * + * @apiSuccess {string} address Account address + * @apiSuccess {string} public_key Public key + * @apiSuccess {string} private_key Private key + */ + $acc=new Account; $res=$acc->generate_account(); api_echo($res); } elseif($q=="currentBlock"){ +/** + * @api {get} /api.php?q=currentBlock 10. currentBlock + * @apiName currentBlock + * @apiGroup API + * @apiDescription Returns the current block. + * + * @apiSuccess {string} id Blocks id + * @apiSuccess {string} generator Block Generator + * @apiSuccess {numeric} height Height + * @apiSuccess {numeric} date Block's date in UNIX TIMESTAMP format + * @apiSuccess {string} nonce Mining nonce + * @apiSuccess {string} signature Signature signed by the generator + * @apiSuccess {numeric} difficulty The base target / difficulty + * @apiSuccess {string} argon Mining argon hash + + + */ + $current=$block->current(); api_echo($current); + +} elseif($q=="getBlock"){ +/** + * @api {get} /api.php?q=getBlock 11. getBlock + * @apiName getBlock + * @apiGroup API + * @apiDescription Returns the block. + * + * @apiParam {numeric} height Block Height + * + * @apiSuccess {string} id Block id + * @apiSuccess {string} generator Block Generator + * @apiSuccess {numeric} height Height + * @apiSuccess {numeric} date Block's date in UNIX TIMESTAMP format + * @apiSuccess {string} nonce Mining nonce + * @apiSuccess {string} signature Signature signed by the generator + * @apiSuccess {numeric} difficulty The base target / difficulty + * @apiSuccess {string} argon Mining argon hash + */ + $height=san($data['height']); + $ret=$block->get($height); + if($ret==false) api_err("Invalid block"); + else api_echo($ret); +} elseif($q=="getBlockTransactions"){ +/** + * @api {get} /api.php?q=getBlockTransactions 12. getBlockTransactions + * @apiName getBlockTransactions + * @apiGroup API + * @apiDescription Returns the transactions of a specific block. + * + * @apiParam {numeric} [height] Block Height + * @apiParam {string} [block] Block id + * + * @apiSuccess {string} block Block ID + * @apiSuccess {numeric} confirmation Number of confirmations + * @apiSuccess {numeric} date Transaction's date in UNIX TIMESTAMP format + * @apiSuccess {string} dst Transaction destination + * @apiSuccess {numeric} fee The transaction's fee + * @apiSuccess {numeric} height Block height + * @apiSuccess {string} id Transaction ID/HASH + * @apiSuccess {string} message Transaction's message + * @apiSuccess {string} signature Transaction's signature + * @apiSuccess {string} public_key Account's public_key + * @apiSuccess {string} src Sender's address + * @apiSuccess {string} type "debit", "credit" or "mempool" + * @apiSuccess {numeric} val Transaction value + * @apiSuccess {numeric} version Transaction version + */ + $height=san($data['height']); + $block=san($data['block']); + $ret=$trx->get_transactions($height, $block); + if($ret===false) api_err("Invalid block"); + else api_echo($ret); + } elseif($q=="version"){ +/** + * @api {get} /api.php?q=version 13. version + * @apiName version + * @apiGroup API + * @apiDescription Returns the node's version. + * + * + * @apiSuccess {string} data Version +*/ api_echo(VERSION); } elseif($q=="send"){ +/** + * @api {get} /api.php?q=send 14. send + * @apiName send + * @apiGroup API + * @apiDescription Sends a transaction. + * + * @apiParam {numeric} val Transaction value (without fees) + * @apiParam {string} dst Destination address + * @apiParam {string} public_key Sender's public key + * @apiParam {string} [signature] Transaction signature. It's recommended that the transaction is signed before being sent to the node to avoid sending your private key to the node. + * @apiParam {string} [private_key] Sender's private key. Only to be used when the transaction is not signed locally. + * @apiParam {numeric} [date] Transaction's date in UNIX TIMESTAMP format. Requried when the transaction is pre-signed. + * @apiParam {string} [message] A message to be included with the transaction. Maximum 128 chars. + * @apiParam {numeric} [version] The version of the transaction. 1 to send coins. + * + * @apiSuccess {string} data Transaction id + */ $current=$block->current(); if($current['height']>10790&&$current['height']<10810) api_err("Hard fork in progress. Please retry the transaction later!"); //10800 @@ -140,8 +403,7 @@ elseif($q=="getPublicKey"){ if($fee>10&&$current['height']>10800) $fee=10; //10800 if($val<0.00000001) api_err("Invalid value"); - - if($version<1) api_err("Invalid version"); + if($version<1) $version=1; $val=number_format($val,8,'.',''); $fee=number_format($fee,8,'.',''); @@ -204,6 +466,15 @@ elseif($q=="getPublicKey"){ system("php propagate.php transaction $hash &>/dev/null &"); api_echo($hash); } elseif($q=="mempoolSize"){ +/** + * @api {get} /api.php?q=mempoolSize 15. mempoolSize + * @apiName mempoolSize + * @apiGroup API + * @apiDescription Returns the number of transactions in mempool. + * + * @apiSuccess {numeric} data Number of mempool transactions + */ + $res=$db->single("SELECT COUNT(1) FROM mempool"); api_echo($res); diff --git a/doc/api_data.js b/doc/api_data.js new file mode 100644 index 0000000..4a5e12a --- /dev/null +++ b/doc/api_data.js @@ -0,0 +1,1030 @@ +define({ "api": [ + { + "type": "get", + "url": "/api.php", + "title": "01. Basic Information", + "name": "Info", + "group": "API", + "description": "
Each API call will return the result in JSON format. There are 2 objects, "status" and "data".
The "status" object returns "ok" when the transaction is successful and "error" on failure.
The "data" object returns the requested data, as sub-objects.
The parameters must be sent either as POST['data'], json encoded array or independently as GET.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "status", + "description": ""ok"
" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "data", + "description": "The data provided by the api will be under this object.
" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"status\":\"ok\",\n \"data\":{\n \"obj1\":\"val1\",\n \"obj2\":\"val2\",\n \"obj3\":{\n \"obj4\":\"val4\",\n \"obj5\":\"val5\"\n }\n }\n}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "status", + "description": ""error"
" + }, + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "result", + "description": "Information regarding the error
" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"status\": \"error\",\n \"data\": \"The requested action could not be completed.\"\n}", + "type": "json" + } + ] + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=base58", + "title": "03. base58", + "name": "base58", + "group": "API", + "description": "Converts a string to base58.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "data", + "description": "Input string
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Output string
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=currentBlock", + "title": "10. currentBlock", + "name": "currentBlock", + "group": "API", + "description": "Returns the current block.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Blocks id
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "generator", + "description": "Block Generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Height
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Block's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "nonce", + "description": "Mining nonce
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Signature signed by the generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "difficulty", + "description": "The base target / difficulty
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "argon", + "description": "Mining argon hash
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=generateAccount", + "title": "09. generateAccount", + "name": "generateAccount", + "group": "API", + "description": "Generates a new account. This function should only be used when the node is on the same host or over a really secure network.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "address", + "description": "Account address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "private_key", + "description": "Private key
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getAddress", + "title": "02. getAddress", + "name": "getAddress", + "group": "API", + "description": "Converts the public key to an ARO address.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "public_key", + "description": "The public key
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Contains the address
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBalance", + "title": "04. getBalance", + "name": "getBalance", + "group": "API", + "description": "Returns the balance of a specific account or public key.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The ARO balance
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBlock", + "title": "11. getBlock", + "name": "getBlock", + "group": "API", + "description": "Returns the block.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block Height
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Block id
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "generator", + "description": "Block Generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Height
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Block's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "nonce", + "description": "Mining nonce
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Signature signed by the generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "difficulty", + "description": "The base target / difficulty
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "argon", + "description": "Mining argon hash
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBlockTransactions", + "title": "12. getBlockTransactions", + "name": "getBlockTransactions", + "group": "API", + "description": "Returns the transactions of a specific block.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "height", + "description": "Block Height
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "block", + "description": "Block id
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getPendingBalance", + "title": "05. getPendingBalance", + "name": "getPendingBalance", + "group": "API", + "description": "Returns the pending balance, which includes pending transactions, of a specific account or public key.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The ARO balance
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getPublicKey", + "title": "08. getPublicKey", + "name": "getPublicKey", + "group": "API", + "description": "Returns the public key of a specific account.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The public key
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getTransaction", + "title": "07. getTransaction", + "name": "getTransaction", + "group": "API", + "description": "Returns one transaction.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "transaction", + "description": "Transaction ID
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getTransactions", + "title": "06. getTransactions", + "name": "getTransactions", + "group": "API", + "description": "Returns the latest transactions of an account.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "limit", + "description": "Number of confirmed transactions, max 1000, min 1
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=mempoolSize", + "title": "15. mempoolSize", + "name": "mempoolSize", + "group": "API", + "description": "Returns the number of transactions in mempool.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "data", + "description": "Number of mempool transactions
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=send", + "title": "14. send", + "name": "send", + "group": "API", + "description": "Sends a transaction.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value (without fees)
" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "dst", + "description": "Destination address
" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Sender's public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "signature", + "description": "Transaction signature. It's recommended that the transaction is signed before being sent to the node to avoid sending your private key to the node.
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "private_key", + "description": "Sender's private key. Only to be used when the transaction is not signed locally.
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format. Requried when the transaction is pre-signed.
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "message", + "description": "A message to be included with the transaction. Maximum 128 chars.
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "version", + "description": "The version of the transaction. 1 to send coins.
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Transaction id
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=version", + "title": "13. version", + "name": "version", + "group": "API", + "description": "Returns the node's version.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "optional": false, + "field": "varname1", + "description": "No type.
" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "varname2", + "description": "With type.
" + } + ] + } + }, + "type": "", + "url": "", + "version": "0.0.0", + "filename": "./doc/main.js", + "group": "_github_node_doc_main_js", + "groupTitle": "_github_node_doc_main_js", + "name": "" + } +] }); diff --git a/doc/api_data.json b/doc/api_data.json new file mode 100644 index 0000000..3c0d956 --- /dev/null +++ b/doc/api_data.json @@ -0,0 +1,1030 @@ +[ + { + "type": "get", + "url": "/api.php", + "title": "01. Basic Information", + "name": "Info", + "group": "API", + "description": "Each API call will return the result in JSON format. There are 2 objects, "status" and "data".
The "status" object returns "ok" when the transaction is successful and "error" on failure.
The "data" object returns the requested data, as sub-objects.
The parameters must be sent either as POST['data'], json encoded array or independently as GET.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "status", + "description": ""ok"
" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "data", + "description": "The data provided by the api will be under this object.
" + } + ] + }, + "examples": [ + { + "title": "Success-Response:", + "content": "{\n \"status\":\"ok\",\n \"data\":{\n \"obj1\":\"val1\",\n \"obj2\":\"val2\",\n \"obj3\":{\n \"obj4\":\"val4\",\n \"obj5\":\"val5\"\n }\n }\n}", + "type": "json" + } + ] + }, + "error": { + "fields": { + "Error 4xx": [ + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "status", + "description": ""error"
" + }, + { + "group": "Error 4xx", + "type": "String", + "optional": false, + "field": "result", + "description": "Information regarding the error
" + } + ] + }, + "examples": [ + { + "title": "Error-Response:", + "content": "{\n \"status\": \"error\",\n \"data\": \"The requested action could not be completed.\"\n}", + "type": "json" + } + ] + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=base58", + "title": "03. base58", + "name": "base58", + "group": "API", + "description": "Converts a string to base58.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "data", + "description": "Input string
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Output string
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=currentBlock", + "title": "10. currentBlock", + "name": "currentBlock", + "group": "API", + "description": "Returns the current block.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Blocks id
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "generator", + "description": "Block Generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Height
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Block's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "nonce", + "description": "Mining nonce
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Signature signed by the generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "difficulty", + "description": "The base target / difficulty
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "argon", + "description": "Mining argon hash
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=generateAccount", + "title": "09. generateAccount", + "name": "generateAccount", + "group": "API", + "description": "Generates a new account. This function should only be used when the node is on the same host or over a really secure network.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "address", + "description": "Account address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "private_key", + "description": "Private key
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getAddress", + "title": "02. getAddress", + "name": "getAddress", + "group": "API", + "description": "Converts the public key to an ARO address.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "public_key", + "description": "The public key
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Contains the address
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBalance", + "title": "04. getBalance", + "name": "getBalance", + "group": "API", + "description": "Returns the balance of a specific account or public key.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The ARO balance
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBlock", + "title": "11. getBlock", + "name": "getBlock", + "group": "API", + "description": "Returns the block.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block Height
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Block id
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "generator", + "description": "Block Generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Height
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Block's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "nonce", + "description": "Mining nonce
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Signature signed by the generator
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "difficulty", + "description": "The base target / difficulty
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "argon", + "description": "Mining argon hash
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getBlockTransactions", + "title": "12. getBlockTransactions", + "name": "getBlockTransactions", + "group": "API", + "description": "Returns the transactions of a specific block.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "height", + "description": "Block Height
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "block", + "description": "Block id
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getPendingBalance", + "title": "05. getPendingBalance", + "name": "getPendingBalance", + "group": "API", + "description": "Returns the pending balance, which includes pending transactions, of a specific account or public key.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The ARO balance
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getPublicKey", + "title": "08. getPublicKey", + "name": "getPublicKey", + "group": "API", + "description": "Returns the public key of a specific account.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "account", + "description": "Account id / address
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "The public key
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getTransaction", + "title": "07. getTransaction", + "name": "getTransaction", + "group": "API", + "description": "Returns one transaction.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "transaction", + "description": "Transaction ID
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=getTransactions", + "title": "06. getTransactions", + "name": "getTransactions", + "group": "API", + "description": "Returns the latest transactions of an account.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "public_key", + "description": "Public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "account", + "description": "Account id / address
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "limit", + "description": "Number of confirmed transactions, max 1000, min 1
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "block", + "description": "Block ID
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "confirmation", + "description": "Number of confirmations
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "dst", + "description": "Transaction destination
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "fee", + "description": "The transaction's fee
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "height", + "description": "Block height
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "id", + "description": "Transaction ID/HASH
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "message", + "description": "Transaction's message
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "signature", + "description": "Transaction's signature
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Account's public_key
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "src", + "description": "Sender's address
" + }, + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "type", + "description": ""debit", "credit" or "mempool"
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value
" + }, + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "version", + "description": "Transaction version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=mempoolSize", + "title": "15. mempoolSize", + "name": "mempoolSize", + "group": "API", + "description": "Returns the number of transactions in mempool.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "numeric", + "optional": false, + "field": "data", + "description": "Number of mempool transactions
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=send", + "title": "14. send", + "name": "send", + "group": "API", + "description": "Sends a transaction.
", + "parameter": { + "fields": { + "Parameter": [ + { + "group": "Parameter", + "type": "numeric", + "optional": false, + "field": "val", + "description": "Transaction value (without fees)
" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "dst", + "description": "Destination address
" + }, + { + "group": "Parameter", + "type": "string", + "optional": false, + "field": "public_key", + "description": "Sender's public key
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "signature", + "description": "Transaction signature. It's recommended that the transaction is signed before being sent to the node to avoid sending your private key to the node.
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "private_key", + "description": "Sender's private key. Only to be used when the transaction is not signed locally.
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "date", + "description": "Transaction's date in UNIX TIMESTAMP format. Requried when the transaction is pre-signed.
" + }, + { + "group": "Parameter", + "type": "string", + "optional": true, + "field": "message", + "description": "A message to be included with the transaction. Maximum 128 chars.
" + }, + { + "group": "Parameter", + "type": "numeric", + "optional": true, + "field": "version", + "description": "The version of the transaction. 1 to send coins.
" + } + ] + } + }, + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Transaction id
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "type": "get", + "url": "/api.php?q=version", + "title": "13. version", + "name": "version", + "group": "API", + "description": "Returns the node's version.
", + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "type": "string", + "optional": false, + "field": "data", + "description": "Version
" + } + ] + } + }, + "version": "0.0.0", + "filename": "./api.php", + "groupTitle": "API" + }, + { + "success": { + "fields": { + "Success 200": [ + { + "group": "Success 200", + "optional": false, + "field": "varname1", + "description": "No type.
" + }, + { + "group": "Success 200", + "type": "String", + "optional": false, + "field": "varname2", + "description": "With type.
" + } + ] + } + }, + "type": "", + "url": "", + "version": "0.0.0", + "filename": "./doc/main.js", + "group": "_github_node_doc_main_js", + "groupTitle": "_github_node_doc_main_js", + "name": "" + } +] diff --git a/doc/api_project.js b/doc/api_project.js new file mode 100644 index 0000000..2b3643a --- /dev/null +++ b/doc/api_project.js @@ -0,0 +1,14 @@ +define({ + "name": "", + "version": "0.0.0", + "description": "", + "sampleUrl": false, + "defaultVersion": "0.0.0", + "apidoc": "0.3.0", + "generator": { + "name": "apidoc", + "time": "2018-02-15T01:57:51.098Z", + "url": "http://apidocjs.com", + "version": "0.17.6" + } +}); diff --git a/doc/api_project.json b/doc/api_project.json new file mode 100644 index 0000000..4613f93 --- /dev/null +++ b/doc/api_project.json @@ -0,0 +1,14 @@ +{ + "name": "", + "version": "0.0.0", + "description": "", + "sampleUrl": false, + "defaultVersion": "0.0.0", + "apidoc": "0.3.0", + "generator": { + "name": "apidoc", + "time": "2018-02-15T01:57:51.098Z", + "url": "http://apidocjs.com", + "version": "0.17.6" + } +} diff --git a/doc/css/style.css b/doc/css/style.css new file mode 100644 index 0000000..6468b2b --- /dev/null +++ b/doc/css/style.css @@ -0,0 +1,569 @@ +/* ------------------------------------------------------------------------------------------ + * Content + * ------------------------------------------------------------------------------------------ */ +body { + min-width: 980px; + max-width: 1280px; +} + +body, p, a, div, th, td { + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 16px; +} + +td.code { + font-size: 14px; + font-family: "Source Code Pro", monospace; + font-style: normal; + font-weight: 400; +} + +#content { + padding-top: 16px; + z-Index: -1; + margin-left: 270px; +} + +p { + color: #808080; +} + +h1 { + font-family: "Source Sans Pro Semibold", sans-serif; + font-weight: normal; + font-size: 44px; + line-height: 50px; + margin: 0 0 10px 0; + padding: 0; +} + +h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: normal; + font-size: 24px; + line-height: 40px; + margin: 0 0 20px 0; + padding: 0; +} + +section { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +section h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +article { + padding: 14px 0 30px 0; +} + +article h1 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 24px; + line-height: 26px; +} + +article h2 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 18px; + line-height: 24px; + margin: 0 0 10px 0; +} + +article h3 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 16px; + line-height: 18px; + margin: 0 0 10px 0; +} + +article h4 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 14px; + line-height: 16px; + margin: 0 0 8px 0; +} + +table { + border-collapse: collapse; + width: 100%; + margin: 0 0 20px 0; +} + +th { + background-color: #f5f5f5; + text-align: left; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + padding: 4px 8px; + border: #e0e0e0 1px solid; +} + +td { + vertical-align: top; + padding: 10px 8px 0 8px; + border: #e0e0e0 1px solid; +} + +#generator .content { + color: #b0b0b0; + border-top: 1px solid #ebebeb; + padding: 10px 0; +} + +.label-optional { + float: right; + background-color: grey; + margin-top: 4px; +} + +.open-left { + right: 0; + left: auto; +} + +/* ------------------------------------------------------------------------------------------ + * apidoc - intro + * ------------------------------------------------------------------------------------------ */ + +#apidoc .apidoc { + border-top: 1px solid #ebebeb; + padding: 30px 0; +} + +#apidoc h1 { + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 32px; + line-height: 40px; + padding-bottom: 14px; + margin: 0 0 20px 0; + padding: 0; +} + +#apidoc h2 { + font-family: "Source Sans Pro Bold", sans-serif; + font-weight: 600; + font-size: 22px; + line-height: 26px; + padding-top: 14px; +} + +/* ------------------------------------------------------------------------------------------ + * pre / code + * ------------------------------------------------------------------------------------------ */ +pre { + background-color: #292b36; + color: #ffffff; + padding: 10px; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; + overflow-x: auto; +} + +pre.prettyprint { + width: 100%; +} + +code.language-text { + word-wrap: break-word; +} + +pre.language-json { + overflow: auto; +} + +pre.language-html { + margin: 0 0 20px 0; +} + +.type { + font-family: "Source Sans Pro", sans-serif; + font-weight: 600; + font-size: 15px; + display: inline-block; + margin: 0 0 5px 0; + padding: 4px 5px; + border-radius: 6px; + text-transform: uppercase; + background-color: #3387CC; + color: #ffffff; +} + +.type__get { + background-color: green; +} + +.type__put { + background-color: #e5c500; +} + +.type__post { + background-color: #4070ec; +} + +.type__delete { + background-color: #ed0039; +} + +pre.language-api .str { + color: #ffffff; +} + +pre.language-api .pln, +pre.language-api .pun { + color: #65B042; +} + +pre code { + display: block; + font-size: 14px; + font-family: "Source Code Pro", monospace; + font-style: normal; + font-weight: 400; + word-wrap: normal; + white-space: pre; +} + +pre code.sample-request-response-json { + white-space: pre-wrap; + max-height: 500px; + overflow: auto; +} + +/* ------------------------------------------------------------------------------------------ + * Sidenav + * ------------------------------------------------------------------------------------------ */ +.sidenav { + width: 228px; + margin: 0; + padding: 0 20px 20px 20px; + position: fixed; + top: 50px; + left: 0; + bottom: 0; + overflow-x: hidden; + overflow-y: auto; + background-color: #f5f5f5; + z-index: 10; +} + +.sidenav > li > a { + display: block; + width: 192px; + margin: 0; + padding: 2px 11px; + border: 0; + border-left: transparent 4px solid; + border-right: transparent 4px solid; + font-family: "Source Sans Pro", sans-serif; + font-weight: 400; + font-size: 14px; +} + +.sidenav > li.nav-header { + margin-top: 8px; + margin-bottom: 8px; +} + +.sidenav > li.nav-header > a { + padding: 5px 15px; + border: 1px solid #e5e5e5; + width: 190px; + font-family: "Source Sans Pro", sans-serif; + font-weight: 700; + font-size: 16px; + background-color: #ffffff; +} + +.sidenav > li.active > a { + position: relative; + z-index: 2; + background-color: #0088cc; + color: #ffffff; +} + +.sidenav > li.has-modifications a { + border-right: #60d060 4px solid; +} + +.sidenav > li.is-new a { + border-left: #e5e5e5 4px solid; +} + +/* ------------------------------------------------------------------------------------------ + * Side nav search + * ------------------------------------------------------------------------------------------ */ +.sidenav-search { + width: 228px; + left: 0px; + position: fixed; + padding: 16px 20px 10px 20px; + background-color: #F5F5F5; + z-index: 11; +} + +.sidenav-search .search { + height: 26px; +} + +.search-reset { + position: absolute; + display: block; + cursor: pointer; + width: 20px; + height: 20px; + text-align: center; + right: 28px; + top: 17px; + background-color: #fff; +} + +/* ------------------------------------------------------------------------------------------ + * Compare + * ------------------------------------------------------------------------------------------ */ + +ins { + background: #60d060; + text-decoration: none; + color: #000000; +} + +del { + background: #f05050; + color: #000000; +} + +.label-ins { + background-color: #60d060; +} + +.label-del { + background-color: #f05050; + text-decoration: line-through; +} + +pre.ins { + background-color: #60d060; +} + +pre.del { + background-color: #f05050; + text-decoration: line-through; +} + +table.ins th, +table.ins td { + background-color: #60d060; +} + +table.del th, +table.del td { + background-color: #f05050; + text-decoration: line-through; +} + +tr.ins td { + background-color: #60d060; +} + +tr.del td { + background-color: #f05050; + text-decoration: line-through; +} + +/* ------------------------------------------------------------------------------------------ + * Spinner + * ------------------------------------------------------------------------------------------ */ + +#loader { + position: absolute; + width: 100%; +} + +#loader p { + padding-top: 80px; + margin-left: -4px; +} + +.spinner { + margin: 200px auto; + width: 60px; + height: 60px; + position: relative; +} + +.container1 > div, .container2 > div, .container3 > div { + width: 14px; + height: 14px; + background-color: #0088cc; + + border-radius: 100%; + position: absolute; + -webkit-animation: bouncedelay 1.2s infinite ease-in-out; + animation: bouncedelay 1.2s infinite ease-in-out; + /* Prevent first frame from flickering when animation starts */ + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +.spinner .spinner-container { + position: absolute; + width: 100%; + height: 100%; +} + +.container2 { + -webkit-transform: rotateZ(45deg); + transform: rotateZ(45deg); +} + +.container3 { + -webkit-transform: rotateZ(90deg); + transform: rotateZ(90deg); +} + +.circle1 { top: 0; left: 0; } +.circle2 { top: 0; right: 0; } +.circle3 { right: 0; bottom: 0; } +.circle4 { left: 0; bottom: 0; } + +.container2 .circle1 { + -webkit-animation-delay: -1.1s; + animation-delay: -1.1s; +} + +.container3 .circle1 { + -webkit-animation-delay: -1.0s; + animation-delay: -1.0s; +} + +.container1 .circle2 { + -webkit-animation-delay: -0.9s; + animation-delay: -0.9s; +} + +.container2 .circle2 { + -webkit-animation-delay: -0.8s; + animation-delay: -0.8s; +} + +.container3 .circle2 { + -webkit-animation-delay: -0.7s; + animation-delay: -0.7s; +} + +.container1 .circle3 { + -webkit-animation-delay: -0.6s; + animation-delay: -0.6s; +} + +.container2 .circle3 { + -webkit-animation-delay: -0.5s; + animation-delay: -0.5s; +} + +.container3 .circle3 { + -webkit-animation-delay: -0.4s; + animation-delay: -0.4s; +} + +.container1 .circle4 { + -webkit-animation-delay: -0.3s; + animation-delay: -0.3s; +} + +.container2 .circle4 { + -webkit-animation-delay: -0.2s; + animation-delay: -0.2s; +} + +.container3 .circle4 { + -webkit-animation-delay: -0.1s; + animation-delay: -0.1s; +} + +@-webkit-keyframes bouncedelay { + 0%, 80%, 100% { -webkit-transform: scale(0.0) } + 40% { -webkit-transform: scale(1.0) } +} + +@keyframes bouncedelay { + 0%, 80%, 100% { + transform: scale(0.0); + -webkit-transform: scale(0.0); + } 40% { + transform: scale(1.0); + -webkit-transform: scale(1.0); + } +} + +/* ------------------------------------------------------------------------------------------ + * Tabs + * ------------------------------------------------------------------------------------------ */ +ul.nav-tabs { + margin: 0; +} + +p.deprecated span{ + color: #ff0000; + font-weight: bold; + text-decoration: underline; +} + +/* ------------------------------------------------------------------------------------------ + * Print + * ------------------------------------------------------------------------------------------ */ + +@media print { + + #sidenav, + #version, + #versions, + section .version, + section .versions { + display: none; + } + + #content { + margin-left: 0; + } + + a { + text-decoration: none; + color: inherit; + } + + a:after { + content: " [" attr(href) "] "; + } + + p { + color: #000000 + } + + pre { + background-color: #ffffff; + color: #000000; + padding: 10px; + border: #808080 1px solid; + border-radius: 6px; + position: relative; + margin: 10px 0 20px 0; + } + +} /* /@media print */ diff --git a/doc/fonts/glyphicons-halflings-regular.eot b/doc/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 0000000..b93a495 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.eot differ diff --git a/doc/fonts/glyphicons-halflings-regular.svg b/doc/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 0000000..94fb549 --- /dev/null +++ b/doc/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + \ No newline at end of file diff --git a/doc/fonts/glyphicons-halflings-regular.ttf b/doc/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 0000000..1413fc6 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.ttf differ diff --git a/doc/fonts/glyphicons-halflings-regular.woff b/doc/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 0000000..9e61285 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.woff differ diff --git a/doc/fonts/glyphicons-halflings-regular.woff2 b/doc/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 0000000..64539b5 Binary files /dev/null and b/doc/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/doc/img/favicon.ico b/doc/img/favicon.ico new file mode 100644 index 0000000..c307a04 Binary files /dev/null and b/doc/img/favicon.ico differ diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 0000000..5f04ded --- /dev/null +++ b/doc/index.html @@ -0,0 +1,669 @@ + + + + +Loading...
+