From c956f07ca65b570d75505fbb2f60dc9fec5e51d3 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 31 Mar 2018 17:13:49 -0700 Subject: [PATCH 01/10] daemon RPC wrapper inline documentation update --- src/daemonRPC.php | 78 ++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/src/daemonRPC.php b/src/daemonRPC.php index 230d42c..06957fc 100644 --- a/src/daemonRPC.php +++ b/src/daemonRPC.php @@ -1,8 +1,8 @@ * Andrew LeCody [EasyBitcoin-PHP] * Kacper Rowinski [jsonRPCClient] - * + * * @author Monero Integrations Team (https://github.com/monero-integrations) * @copyright 2018 * @license MIT - * + * * ============================================================================ - * + * + * // See example.php for more examples + * * // Initialize Monero connection/object * $daemonRPC = new daemonRPC(); - * + * * // Examples: * $height = $daemonRPC->getblockcount(); * $block = $daemonRPC->getblock_by_height(1); - * + * */ require_once('jsonRPCClient.php'); @@ -43,20 +45,20 @@ class daemonRPC /** * - * Start a connection with the Monero daemon - * - * @param string $host IP address of Monero daemon to connect to (optional) - * @param int $port Port to use when accessing Monero daemon (optional) - * @param string $protocol Protocol to acces daemon over (eg. 'http') (optional) - * @param string $user Username (optional) - * @param string $password Password (optional) + * Start a connection with the the Monero daemon (monerod) + * + * @param string $host Monero daemon IP hostname (optional) + * @param int $port Monero daemon port (optional) + * @param string $protocol Monero daemon protocol (eg. 'http') (optional) + * @param string $user Moenro daemon RPC username (optional) + * @param string $password Monero daemon RPC passphrase (optional) * */ function __construct($host = '127.0.0.1', $port = 18081, $protocol = 'http', $user = null, $password = null) { $this->host = $host; $this->port = $port; - $this->protocol = $protocol; + $this->protocol = $protocol; $this->user = $user; $this->password = $password; @@ -66,10 +68,10 @@ function __construct($host = '127.0.0.1', $port = 18081, $protocol = 'http', $us /** * - * Execute command on the Monero RPC API + * Execute command via jsonRPCClient * * @param string $method RPC method to call - * @param string $params Options to include (optional) + * @param string $params Parameters to pass (optional) * * @return string Call result * @@ -85,10 +87,10 @@ protected function _run($method, $params = null) * * @param none * - * @return object Example: { - * "count": 993163, - * "status": "OK" - * } + * @return object Example: { + * "count": 993163, + * "status": "OK" + * } * */ public function getblockcount() @@ -100,7 +102,7 @@ public function getblockcount() * * Look up a block's hash by its height * - * @param array $height Height of block to look up + * @param array $height Height of block to look up * * @return string Example: 'e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6' * @@ -114,10 +116,10 @@ public function on_getblockhash($height) /** * - * Retrieve a block template that can be mined upon + * Construct a block template that can be mined upon * * @param string $wallet_address Address of wallet to receive coinbase transactions if block is successfully mined - * @param int $reserve_size Reserve size + * @param int $reserve_size Reserve size * * @return object Example: { * "blocktemplate_blob": "01029af88cb70568b84a11dc9406ace9e635918ca03b008f7728b9726b327c1b482a98d81ed83000000000018bd03c01ffcfcf3c0493d7cec7020278dfc296544f139394e5e045fcda1ba2cca5b69b39c9ddc90b7e0de859fdebdc80e8eda1ba01029c5d518ce3cc4de26364059eadc8220a3f52edabdaf025a9bff4eec8b6b50e3d8080dd9da417021e642d07a8c33fbe497054cfea9c760ab4068d31532ff0fbb543a7856a9b78ee80c0f9decfae01023ef3a7182cb0c260732e7828606052a0645d3686d7a03ce3da091dbb2b75e5955f01ad2af83bce0d823bf3dbbed01ab219250eb36098c62cbb6aa2976936848bae53023c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f12d7c87346d6b84e17680082d9b4a1d84e36dd01bd2c7f3b3893478a8d88fb3", @@ -140,9 +142,9 @@ public function getblocktemplate($wallet_address, $reserve_size) * * Submit a mined block to the network * - * @param string $block Block blob data string + * @param string $block Block blob * - * @return string // TODO: example + * @return // TODO: example * */ public function submitblock($block) @@ -152,7 +154,7 @@ public function submitblock($block) /** * - * Block header information for the most recent block is easily retrieved with this method + * Look up a block header for the latest block in the longest chain known to the node * * @param none * @@ -181,7 +183,7 @@ public function getlastblockheader() /** * - * Block header information can be retrieved using either a block's hash or height + * Look up a block header from a block hash * * @param string $hash The block's SHA256 hash * @@ -212,9 +214,9 @@ public function getblockheaderbyhash($hash) /** * - * Similar to getblockheaderbyhash() above, this method includes a block's height as an input parameter to retrieve basic information about the block + * Look up a block header by height * - * @param int $height The block's height + * @param int $height Height of block * * @return object Example: { * "block_header": { @@ -241,9 +243,9 @@ public function getblockheaderbyheight($height) /** * - * Get block information by its SHA256 hash + * Look up block information by SHA256 hash * - * @param string The block's SHA256 hash + * @param string SHA256 hash of block * * @return object Example: { * "blob": "...", @@ -272,9 +274,9 @@ public function getblock_by_hash($hash) /** * - * Get block information by its height + * Look up block information by height * - * @param int $height The block's height + * @param int $height Height of block * * @return object Example: { * "blob": "...", @@ -304,7 +306,7 @@ public function getblock_by_height($height) /** * - * Retrieve information about incoming and outgoing connections to your node + * Look up incoming and outgoing connections to your node * * @param none * @@ -340,7 +342,7 @@ public function get_connections() /** * - * Retrieve general information about the state of your node and the network + * Look up general information about the state of your node and the network * * @param none * @@ -409,7 +411,7 @@ public function hardfork_info() /** * - * Ban another node by IP. + * Ban another node by IP * * @param none * @@ -425,7 +427,7 @@ public function setbans($ip) /** * - * Get list of banned IPs. + * Get list of banned IPs * * @param none * From 58bd818a25b951b4802765c8b3aad3286a4c39a7 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 31 Mar 2018 17:47:59 -0700 Subject: [PATCH 02/10] wallet RPC wrapper inline documentation update and linting --- src/walletRPC.php | 383 +++++++++++++++++++++++----------------------- 1 file changed, 194 insertions(+), 189 deletions(-) diff --git a/src/walletRPC.php b/src/walletRPC.php index 0855fb7..6d1f790 100644 --- a/src/walletRPC.php +++ b/src/walletRPC.php @@ -1,8 +1,8 @@ (https://serhack.me) * TheKoziTwo [xmr-integration] * Kacper Rowinski [jsonRPCClient] - * + * * @author Monero Integrations Team (https://github.com/monero-integrations) * @copyright 2018 * @license MIT - * + * * ============================================================================ - * + * + * // See example.php for more examples + * * // Initialize Monero connection/object * $walletRPC = new walletRPC(); - * + * * // Examples: - * $address = $walletRPC->getaddress(); - * $walletRPC->sign('The Times 03/Jan/2009 Chancellor on brink of second bailout for banks'); - * + * $address = $walletRPC->get_address(); + * $signed = $walletRPC->sign('The Times 03/Jan/2009 Chancellor on brink of second bailout for banks'); + * */ require_once('jsonRPCClient.php'); @@ -33,22 +35,22 @@ class walletRPC { private $client; - private $protocol; + private $protocol; private $host; private $port; private $url; private $user; private $password; - + /** * - * Start a connection with monero-wallet-rpc + * Start a connection with the Monero wallet RPC interface (monero-wallet-rpc) * - * @param string $host IP address of monero-wallet-rpc to connect to (optional) - * @param int $port Port to use when accessing monero-wallet-rpc (optional) - * @param string $protocol Protocol to acces daemon over (eg. 'http') (optional) - * @param string $user RPC username (optional) - * @param string $password RPC password (optional) + * @param string $host monero-wallet-rpc hostname (optional) + * @param int $port monero-wallet-rpc port (optional) + * @param string $protocol monero-wallet-rpc protocol (eg. 'http') (optional) + * @param string $user monero-wallet-rpc RPC username (optional) + * @param string $password monero-wallet-rpc RPC passphrase (optional) * */ function __construct ($host = '127.0.0.1', $port = 18083, $protocol = 'http', $user = null, $password = null) @@ -62,13 +64,13 @@ function __construct ($host = '127.0.0.1', $port = 18083, $protocol = 'http', $u $this->url = $protocol.'://'.$host.':'.$port.'/json_rpc'; $this->client = new jsonRPCClient($this->url, $this->user, $this->password); } - + /** * - * Execute command on the monero-wallet-rpc API + * Execute command via jsonRPCClient * * @param string $method RPC method to call - * @param object $params Parameters to include with call (optional) + * @param object $params Parameters to to pass (optional) * * @return string Call result * @@ -78,7 +80,7 @@ private function _run($method, $params = null) $result = $this->client->_run($method, $params); return $result; } - + /** * * Print JSON object (for API) @@ -90,10 +92,9 @@ private function _run($method, $params = null) */ public function _print($json) { - $json_parsed = json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - echo $json_parsed; + echo json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } - + /** * * Convert from moneroj to tacoshi (piconero) @@ -105,13 +106,13 @@ public function _print($json) */ public function _transform($amount = 0) { - // + // return $amount * 1000000000000; } /** * - * Get an account's balance + * Look up an account's balance * * @param number $account_index Index of account to look up (optional) * @@ -126,7 +127,7 @@ public function get_balance($account_index = 0) $get_balance_parameters = array('account_index' => $account_index); return $this->_run('get_balance', $get_balance_parameters); } - + /** * * Alias of get_balance() @@ -144,7 +145,7 @@ public function getbalance($account_index = 0) $getbalance_parameters = array('account_index' => $account_index); return $this->_run('getbalance', $getbalance_parameters); } - + /** * * Look up wallet address(es) @@ -175,7 +176,7 @@ public function get_address($account_index = 0, $address_index = 0) $get_address_parameters = array('account_index' => $account_index, 'address_index' => $address_index); return $this->_run('get_address', $get_address_parameters); } - + /** * * Alias of get_address() @@ -193,7 +194,7 @@ public function getaddress($account_index = 0, $address_index = 0) $getaddress_parameters = array('account_index' => $account_index, 'address_index' => $address_index); return $this->_run('getaddress', $getaddress_parameters); } - + /** * * Create a new subaddress @@ -216,13 +217,13 @@ public function create_address($account_index = 0, $label = '') return $create_address_method; } - + /** * * Label a subaddress * - * @param number The subaddress index to label - * @param string The label to use + * @param number The index of the subaddress to label + * @param string The label to apply * * @return none * @@ -235,7 +236,7 @@ public function label_address($index, $label) /** * - * Get current accounts from wallet + * Look up wallet accounts * * @param none * @@ -266,12 +267,12 @@ public function get_accounts() { return $this->_run('get_accounts'); } - + /** * - * Create a new sub-account from your wallet + * Create a new account * - * @param string A label for the account + * @param string The label to use apply * * @return none * @@ -285,7 +286,7 @@ public function create_account($label = '') return $create_account_method; } - + /** * * Label an account @@ -305,10 +306,10 @@ public function label_account($account_index, $label) return $label_account_method; } - + /** * - * Get account tags + * Look up account tags * * @param none * @@ -330,12 +331,12 @@ public function get_account_tags() { return $this->_run('get_account_tags'); } - + /** * - * Apply a tag to accounts + * Tag accounts * - * @param array $accounts Account indices to tag + * @param array $accounts The indeices of the accounts to tag * @param string $tag Tag to apply * * @return none @@ -350,12 +351,12 @@ public function tag_accounts($accounts, $tag) return $tag_accounts_method; } - + /** * * Untag accounts * - * @param array $accounts Account indices to untag + * @param array $accounts The indices of the accounts to untag * * @return none * @@ -369,11 +370,11 @@ public function untag_accounts($accounts) return $untag_accounts_method; } - + /** * * Describe a tag - * + * * @param string $tag Tag to describe * @param string $description Description to apply to tag * @@ -391,10 +392,10 @@ public function set_account_tag_description($tag, $description) return $set_account_tag_description_method; } - + /** * - * Look up current block height of wallet + * Look up how many blocks are in the longest chain known to the wallet * * @param none * @@ -407,7 +408,7 @@ public function get_height() { return $this->_run('get_height'); } - + /** * * Alias of get_height() @@ -426,20 +427,22 @@ public function getheight() /** * - * Send monero. Parameters can be passed in individually (as listed below) or as an object/dictionary (as listed at bottom.) If multiple destinations are required, use the object/dictionary (bottom) format and pass an array of objects containing recipient addresses and amount in the destinations field, like destinations: [['amount' => 1, 'address' => ...], ['amount' => 2, 'address' => ...}] - * - * @param string $amount Amount to transfer - * @param string $address Address to transfer to + * Send monero + * Parameters can be passed in individually (as listed below) or as an object/dictionary (as listed at bottom) + * To send to multiple recipients, use the object/dictionary (bottom) format and pass an array of recipient addresses and amount arrays in the destinations field (as in "destinations = [['amount' => 1, 'address' => ...], ['amount' => 2, 'address' => ...]]") + * + * @param string $amount Amount of monero to send + * @param string $address Address to receive funds * @param string $payment_id Payment ID (optional) - * @param number $mixin Mixin number (optional) + * @param number $mixin Mixin number (ringsize - 1) (optional) * @param number $account_index Account to send from (optional) * @param string $subaddr_indices Comma-separeted list of subaddress indices to spend from (optional) * @param number $priority Transaction priority (optional) * @param number $unlock_time UNIX time or block height to unlock output (optional) * @param boolean $do_not_relay Do not relay transaction (optional) - * + * * OR - * + * * @param object $params Array containing any of the options listed above, where only amount and address or a destionarions array are required * * @return object Example: { @@ -517,7 +520,7 @@ public function transfer($amount, $address = '', $payment_id = '', $mixin = 6, $ return $transfer_method; } - + /** * * Same as transfer, but splits transfer into more than one transaction if necessary @@ -593,10 +596,10 @@ public function transfer_split($amount, $address = '', $payment_id = '', $mixin return $transfer_method; } - + /** * - * Send all dust outputs back to the wallet to make them easier to spend (and mix) + * Send all dust outputs back to the wallet * * @param none * @@ -609,10 +612,10 @@ public function sweep_dust() { return $this->_run('sweep_dust'); } - + /** * - * Send all unmixable output back to the wallet + * Send all unmixable outputs back to the wallet * * @param none * @@ -625,23 +628,23 @@ public function sweep_unmixable() { return $this->_run('sweep_unmixable'); } - + /** * - * Send all unlocked balance from an account to an address - * - * @param string $address Address to transfer to + * Send all unlocked outputs from an account to an address + * + * @param string $address Address to receive funds * @param string $subaddr_indices Comma-seperated list of subaddress indices to sweep (optional) - * @param number $account_index Account to sweep from (optional) + * @param number $account_index Index of the account to sweep (optional) * @param string $payment_id Payment ID (optional) - * @param number $mixin Mixin number (optional) + * @param number $mixin Mixin number (ringsize - 1) (optional) * @param number $priority Payment ID (optional) * @param number $below_amount Only send outputs below this amount (optional) * @param number $unlock_time UNIX time or block height to unlock output (optional) * @param boolean $do_not_relay Do not relay transaction (optional) - * + * * OR - * + * * @param object $params Array containing any of the options listed above, where only address is required * * @return object Example: { @@ -695,22 +698,22 @@ public function sweep_all($address, $subaddr_indices = '', $account_index = 0, $ return $sweep_all_method; } - + /** * * Sweep a single key image to an address - * + * * @param string $key_image Key image to sweep - * @param string $address Address to transfer to + * @param string $address Address to receive funds * @param string $payment_id Payment ID (optional) * @param number $below_amount Only send outputs below this amount (optional) - * @param number $mixin Mixin number (optional) + * @param number $mixin Mixin number (ringsize - 1) (optional) * @param number $priority Payment ID (optional) * @param number $unlock_time UNIX time or block height to unlock output (optional) * @param boolean $do_not_relay Do not relay transaction (optional) - * + * * OR - * + * * @param object $params Array containing any of the options listed above, where only address is required * * @return object Example: { @@ -770,12 +773,12 @@ public function sweep_single($key_image, $address, $payment_id = '', $mixin = 6, return $sweep_single_method; } - + /** * * Relay a transaction * - * @param string $hex Transaction blob to relay + * @param string $hex Blob of transaction to relay * * @return object // TODO example * @@ -789,7 +792,7 @@ public function relay_tx($hex) return $this->_run('relay_tx'); } - + /** * * Save wallet @@ -799,10 +802,10 @@ public function store() { return $this->_run('store'); } - + /** * - * Get a list of incoming payments using a given payment ID + * Look up incoming payments by payment ID * * @param string $payment_id Payment ID to look up * @@ -824,12 +827,12 @@ public function get_payments($payment_id) $get_payments_parameters['payment_id'] = $payment_id; return $this->_run('get_payments', $get_payments_parameters); } - + /** * - * Get a list of incoming payments using a given payment ID (or a list of payments IDs) from a given height + * Look up incoming payments by payment ID (or a list of payments IDs) from a given height * - * @param array $payment_ids Array of payment ID to look up + * @param array $payment_ids Array of payment IDs to look up * @param string $min_block_height Height to begin search * * @return object Example: { @@ -859,7 +862,7 @@ public function get_bulk_payments($payment_ids, $min_block_height) } return $this->_run('get_bulk_payments', $get_bulk_payments_parameters); } - + /** * * Look up incoming transfers @@ -895,12 +898,12 @@ public function incoming_transfers($type = 'all', $account_index = 0, $subaddr_i $incoming_parameters = array('transfer_type' => $type, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices); return $this->_run('incoming_transfers', $incoming_parameters); } - + /** * - * Query wallet key + * Look up a wallet key * - * @param string $key_type Type of key to look up; must be 'view_key', 'spend_key', or 'mnemonic' + * @param string $key_type Type of key to look up; must be 'view_key', 'spend_key', or 'mnemonic' * * @return object Example: { * "key": "7e341d..." @@ -912,7 +915,7 @@ public function query_key($key_type) $query_key_parameters = array('key_type' => $key_type); return $this->_run('query_key', $query_key_parameters); } - + /** * * Look up wallet view key @@ -929,7 +932,7 @@ public function view_key() $view_key_parameters = array('key_type' => 'view_key'); return $this->_run('query_key', $view_key_parameters); } - + /** * * Look up wallet spend key @@ -946,10 +949,10 @@ public function spend_key() $spend_key_parameters = array('key_type' => 'spend_key'); return $this->_run('query_key', $spend_key_parameters); } - + /** * - * Look up wallet spend key + * Look up wallet mnemonic seed * * @param none * @@ -963,12 +966,12 @@ public function mnemonic() $mnemonic_parameters = array('key_type' => 'mnemonic'); return $this->_run('query_key', $mnemonic_parameters); } - + /** * - * Make an integrated address from the wallet address and a payment ID + * Create an integrated address from a given payment ID * - * @param string $payment_id Payment ID to use when generating an integrated address (optional) + * @param string $payment_id Payment ID (optional) * * @return object Example: { * "integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhhwiH1FsHYGQQ8H2RRJveAtUeiFs6J" @@ -980,10 +983,10 @@ public function make_integrated_address($payment_id = null) $integrate_address_parameters = array('payment_id' => $payment_id); return $this->_run('make_integrated_address', $integrate_address_parameters); } - + /** * - * Retrieve the standard address and payment ID corresponding to an integrated address + * Look up the wallet address and payment ID corresponding to an integrated address * * @param string $integrated_address Integrated address to split * @@ -998,7 +1001,7 @@ public function split_integrated_address($integrated_address) $split_parameters = array('integrated_address' => $integrated_address); return $this->_run('split_integrated_address', $split_parameters); } - + /** * * Stop the wallet, saving the state @@ -1012,27 +1015,27 @@ public function stop_wallet() { return $this->_run('stop_wallet'); } - + /* * - * Rescan blockchain from scratch + * Rescan the blockchain from scratch * * @param none * * @return none * */ - + public function rescan_blockchain() { return $this->_run('rescan_blockchain'); } - + /** * - * Set arbitrary string notes for transactions + * Add notes to transactions * - * @param array $txids Array of transaction IDs (strings) to apply notes to + * @param array $txids Array of transaction IDs to note * @param array $notes Array of notes (strings) to add * * @return none @@ -1043,14 +1046,16 @@ public function set_tx_notes($txids, $notes) $notes_parameters = array('txids' => $txids, 'notes' => $notes); return $this->_run('set_tx_notes', $notes_parameters); } - + /** * - * Get string notes for transactions + * Look up transaction note * * @param array $txids Array of transaction IDs (strings) to look up * - * @return none + * @return obect Example: { + * // TODO example + * } * */ public function get_tx_notes($txids) @@ -1058,10 +1063,10 @@ public function get_tx_notes($txids) $notes_parameters = array('txids' => $txids); return $this->_run('get_tx_notes', $notes_parameters); } - + /** * - * Set an option in the wallet + * Set a wallet option * * @param string $key Option to set * @param string $value Value to set @@ -1074,7 +1079,7 @@ public function set_attribute($key, $value) $set_attribute_parameters = array('key' => $key, 'value' => $value); return $this->_run('set_attribute', $set_attribute_parameters); } - + /** * * Look up a wallet option @@ -1091,12 +1096,12 @@ public function get_attribute($key) $get_attribute_parameters = array('key' => $key); return $this->_run('get_attribute', $get_attribute_parameters); } - + /** * - * Get a transaction key + * Look up a transaction key * - * @param string $txid Transaction ID + * @param string $txid Transaction ID to look up * * @return object Example: { * "tx_key": "e8e97866b1606bd87178eada8f995bf96d2af3fec5db0bc570a451ab1d589b0f" @@ -1108,12 +1113,12 @@ public function get_tx_key($txid) $get_tx_key_parameters = array('txid' => $txid); return $this->_run('get_tx_key', $get_tx_key_parameters); } - + /** * * Check a transaction key * - * @param string $address Address that sent transfer + * @param string $address Address that sent transaction * @param string $txid Transaction ID * @param string $tx_key Transaction key * @@ -1129,10 +1134,10 @@ public function check_tx_key($address, $txid, $tx_key) $check_tx_key_parameters = array('address' => $address, 'txid' => $txid, 'tx_key' => $tx_key); return $this->_run('check_tx_key', $check_tx_key_parameters); } - + /** * - * Get proof (signature) of transaction + * Create proof (signature) of transaction * * @param string $address Address that spent funds * @param string $txid Transaction ID @@ -1147,7 +1152,7 @@ public function get_tx_proof($address, $txid) $get_tx_proof_parameters = array('address' => $address, 'txid' => $txid); return $this->_run('get_tx_proof', $get_tx_proof_parameters); } - + /** * * Verify transaction proof @@ -1169,10 +1174,10 @@ public function check_tx_proof($address, $txid, $signature) $check_tx_proof_parameters = array('address' => $address, 'txid' => $txid, 'signature' => $signature); return $this->_run('check_tx_proof', $check_tx_proof_parameters); } - + /** * - * Get proof of a spend + * Create proof of a spend * * @param string $txid Transaction ID * @@ -1186,7 +1191,7 @@ public function get_spend_proof($txid) $get_spend_proof_parameters = array('txid' => $txid); return $this->_run('get_spend_proof', $get_spend_proof_parameters); } - + /** * * Verify spend proof @@ -1204,12 +1209,12 @@ public function check_spend_proof($txid, $signature) $check_spend_proof_parameters = array('txid' => $txid, 'signature' => $signature); return $this->_run('check_spend_proof', $check_spend_proof_parameters); } - + /** * - * Get proof of reserves + * Create proof of reserves * - * @param string $account_index Comma-separated list of account indices of which to prove reserves. If empty, proves reserve of all accounts (optional) + * @param string $account_index Comma-separated list of account indices of which to prove reserves (proves reserve of all accounts if empty) (optional) * * @return Example: { * "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE111111111111AjsVgKzau88VxXVGACbYgPVrDGC84vBU61Gmm2eiYxdZULAE4yzBxT1D9epWgCT7qiHFvFMbdChf3CpR2YsZj8CEhp8qDbitsfdy7iBdK6d5pPUiMEwCNsCGDp8AiAc6sLRiuTsLEJcfPYEKe" @@ -1226,7 +1231,7 @@ public function get_reserve_proof($account_index = 'all') return $this->_run('get_reserve_proof'); } - + /** * * Verify a reserve proof @@ -1246,7 +1251,7 @@ public function check_reserve_proof($address, $signature) $check_reserve_proof_parameters = array('address' => $address, 'signature' => $signature); return $this->_run('check_reserve_proof', $check_reserve_proof_parameters); } - + /** * * Look up transfers @@ -1314,10 +1319,10 @@ public function get_transfers($input_types = ['all'], $account_index = 0, $subad return $this->_run('get_transfers', $get_transfers_parameters); } - + /** * - * Show information about a transfer with a given transaction ID + * Look up transaction by transaction ID * * @param string $txid Transaction ID to look up * @param string $account_index Index of account to query (optional) @@ -1341,7 +1346,7 @@ public function get_transfer_by_txid($txid, $account_index = 0) $get_transfer_by_txid_parameters = array('txid' => $txid, 'account_index' => $account_index); return $this->_run('get_transfer_by_txid', $get_transfer_by_txid_parameters); } - + /** * * Sign a string @@ -1358,27 +1363,27 @@ public function sign($data) $sign_parameters = array('string' => $data); return $this->_run('sign', $sign_parameters); } - + /** * - * Verify a signature on a string + * Verify a signature * * @param string $data Signed data * @param string $address Address that signed data * @param string $signature Signature to verify * * @return boolean $good Verification status - * + * */ public function verify($data, $address, $signature) { $notes_parameters = array('data' => $data, 'address' => $address, 'signature' => $signature); return $this->_run('verify', $notes_parameters); } - + /** * - * Export an array of signed key images + * Export an array of signed key images * * @param none * @@ -1391,7 +1396,7 @@ public function export_key_images() { return $this->_run('export_key_images'); } - + /** * * Import a signed set of key images @@ -1402,9 +1407,9 @@ public function export_key_images() * // TODO example * height: , * spent: , - * unspent: + * unspent: * } - * + * */ public function import_key_images($signed_key_images) { @@ -1414,13 +1419,13 @@ public function import_key_images($signed_key_images) /** * - * Create a payment URI using the official URI spec + * Create a payment URI using the official URI specification * - * @param string $address Recipient address - * @param string $amount Amount to request - * @param string $payment_id Payment ID (optional) - * @param string $recipient_name Name of recipient (optional) - * @param string $tx_description Payment description (optional) + * @param string $address Address to receive fuids + * @param string $amount Amount of monero to request + * @param string $payment_id Payment ID (optional) + * @param string $recipient_name Name of recipient (optional) + * @param string $tx_description Payment description (optional) * * @return object Example: { * // TODO example @@ -1435,7 +1440,7 @@ public function make_uri($address, $amount, $payment_id = null, $recipient_name /** * - * Parse a payment URI to get payment information + * Parse a payment URI * * @param string $uri Payment URI * @@ -1455,41 +1460,41 @@ public function parse_uri($uri) $uri_parameters = array('uri' => $uri); return $this->_run('parse_uri', $uri_parameters); } - + /** * - * Retrieve entries from the address book + * Look up address book entries * - * @param array $entries Array of indices to return from the address book + * @param array $entries Array of address book entry indices to look up * * @return boject Example: { * // TODO example * } - * + * */ public function get_address_book($entries) { $entries_parameters = array('entries' => $entries); return $this->_run('get_address_book', $entries_parameters); } - + /** * - * Retrieve entries from the address book + * Add entry to the address book * * @param string $address Address to add to address book * @param string $payment_id Payment ID to use with address in address book (optional) * @param string $description Description of address (optional) * * @return number $index Index of address in address book - * + * */ public function add_address_book($address, $payment_id, $description) { $address_parameters = array('address' => $address, 'payment_id' => $payment_id, 'description' => $description); return $this->_run('add_address_book', $address_parameters); } - + /** * * Delete an entry from the address book @@ -1497,41 +1502,41 @@ public function add_address_book($address, $payment_id, $description) * @param array $index Index of the address book entry to remove * * @return none - * + * */ public function delete_address_book($index) { $delete_parameters = array('index' => $index); return $this->_run('delete_address_book', $delete_parameters); } - + /** * * Rescan the blockchain for spent outputs - * + * */ public function rescan_spent() { return $this->_run('rescan_spent'); } - + /** * - * Start mining in the Monero daemon + * Start mining * * @param number $threads_count Number of threads with which to mine * @param boolean $do_background_mining Mine in backgound? - * @param boolean $ignore_battery Ignore battery? + * @param boolean $ignore_battery Ignore battery? * * @return none - * + * */ public function start_mining($threads_count, $do_background_mining, $ignore_battery) { $mining_parameters = array('threads_count' => $threads_count, 'do_background_mining' => $do_background_mining, 'ignore_battery' => $ignore_battery); return $this->_run('start_mining', $mining_parameters); } - + /** * * Stop mining @@ -1539,19 +1544,19 @@ public function start_mining($threads_count, $do_background_mining, $ignore_batt * @param none * * @return none - * + * */ public function stop_mining() { return $this->_run('stop_mining'); } - + /** * - * Get a list of available languages for your wallet's seed + * Look up a list of available languages for your wallet's seed * * @param none - * + * * @return array List of available languages * */ @@ -1559,14 +1564,14 @@ public function get_languages() { return $this->_run('get_languages'); } - + /** * * Create a new wallet * - * @param string $filename Filename to use for new wallet - * @param string $password Password to use for new wallet - * @param string $language Language to use for new wallet + * @param string $filename Filename of new wallet to create + * @param string $password Password of new wallet to create + * @param string $language Language of new wallet to create * * @return none * @@ -1576,13 +1581,13 @@ public function create_wallet($filename = 'monero_wallet', $password = null, $la $create_wallet_parameters = array('filename' => $filename, 'password' => $password, 'language' => $language); return $this->_run('create_wallet', $create_wallet_parameters); } - + /** * * Open a wallet * - * @param string $filename Filename to use for new wallet - * @param string $password Password to use for new wallet + * @param string $filename Filename of wallet to open + * @param string $password Password of wallet to open * * @return none * @@ -1592,7 +1597,7 @@ public function open_wallet($filename = 'monero_wallet', $password = null) $open_wallet_parameters = array('filename' => $filename, 'password' => $password); return $this->_run('open_wallet', $open_wallet_parameters); } - + /** * * Check if wallet is multisig @@ -1611,10 +1616,10 @@ public function is_multisig() { return $this->_run('is_multisig'); } - + /** * - * Get information needed to create a multisignature wallet + * Create information needed to create a multisignature wallet * * @param none * @@ -1627,14 +1632,14 @@ public function prepare_multisig() { return $this->_run('prepare_multisig'); } - + /** * - * Make a multisig account + * Create a multisignature wallet * - * @param string $multisig_info Multisignature information (from eg. prepare_multisig) - * @param string $threshold Threshold required to spend from multisig - * @param string $password Passphrase to apply to multisig address + * @param string $multisig_info Multisignature information (from eg. prepare_multisig) + * @param string $threshold Threshold required to spend from multisignature wallet + * @param string $password Passphrase to apply to multisignature wallet * * @return object Example: { * // TODO example @@ -1646,7 +1651,7 @@ public function make_multisig($multisig_info, $threshold, $password = '') $make_multisig_parameters = array('multisig_info' => $multisig_info, 'threshold' => $threshold, 'password' => $password); return $this->_run('make_multisig', $make_multisig_parameters); } - + /** * * Export multisignature information @@ -1662,12 +1667,12 @@ public function export_multisig_info() { return $this->_run('export_multisig_info'); } - + /** * * Import mutlisignature information * - * @param string $info Multisig info (from eg. prepare_multisig) + * @param string $info Multisignature info (from eg. prepare_multisig) * * @return Example: { * // TODO example @@ -1679,13 +1684,13 @@ public function import_multisig_info($info) $import_multisig_info_parameters = array('info' => $info); return $this->_run('import_multisig_info', $import_multisig_info_parameters); } - + /** * * Finalize a multisignature wallet * - * @param string $multisig_info Multisig info (from eg. prepare_multisig) - * @param string $password Multisig info (from eg. prepare_multisig) + * @param string $multisig_info Multisignature info (from eg. prepare_multisig) + * @param string $password Multisignature info (from eg. prepare_multisig) * * @return Example: { * // TODO example @@ -1697,12 +1702,12 @@ public function finalize_multisig($multisig_info, $password = '') $finalize_multisig_parameters = array('multisig_info' => $multisig_info, 'password' => $password); return $this->_run('finalize_multisig', $finalize_multisig_parameters); } - + /** * * Sign a multisignature transaction * - * @param string $tx_data_hex Transaction as hex blob + * @param string $tx_data_hex Blob of transaction to sign * * @return object Example: { * // TODO example @@ -1714,12 +1719,12 @@ public function sign_multisig($tx_data_hex) $sign_multisig_parameters = array('tx_data_hex' => $tx_data_hex); return $this->_run('sign_multisig', $sign_multisig_parameters); } - + /** * * Submit (relay) a multisignature transaction * - * @param string $tx_data_hex Transaction as hex blob + * @param string $tx_data_hex Blob of transaction to submit * * @return Example: { * // TODO example From a7646b670fd60a68d54c275193efe01a90904467 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 31 Mar 2018 17:58:21 -0700 Subject: [PATCH 03/10] $..._parameters -> $params change all $this_method's_parameters variables to, simply, $params --- src/walletRPC.php | 238 +++++++++++++++++++++++----------------------- 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/src/walletRPC.php b/src/walletRPC.php index 6d1f790..1da76a4 100644 --- a/src/walletRPC.php +++ b/src/walletRPC.php @@ -124,8 +124,8 @@ public function _transform($amount = 0) */ public function get_balance($account_index = 0) { - $get_balance_parameters = array('account_index' => $account_index); - return $this->_run('get_balance', $get_balance_parameters); + $params = array('account_index' => $account_index); + return $this->_run('get_balance', $params); } /** @@ -142,8 +142,8 @@ public function get_balance($account_index = 0) */ public function getbalance($account_index = 0) { - $getbalance_parameters = array('account_index' => $account_index); - return $this->_run('getbalance', $getbalance_parameters); + $params = array('account_index' => $account_index); + return $this->_run('getbalance', $params); } /** @@ -173,8 +173,8 @@ public function getbalance($account_index = 0) */ public function get_address($account_index = 0, $address_index = 0) { - $get_address_parameters = array('account_index' => $account_index, 'address_index' => $address_index); - return $this->_run('get_address', $get_address_parameters); + $params = array('account_index' => $account_index, 'address_index' => $address_index); + return $this->_run('get_address', $params); } /** @@ -191,8 +191,8 @@ public function get_address($account_index = 0, $address_index = 0) */ public function getaddress($account_index = 0, $address_index = 0) { - $getaddress_parameters = array('account_index' => $account_index, 'address_index' => $address_index); - return $this->_run('getaddress', $getaddress_parameters); + $params = array('account_index' => $account_index, 'address_index' => $address_index); + return $this->_run('getaddress', $params); } /** @@ -210,8 +210,8 @@ public function getaddress($account_index = 0, $address_index = 0) */ public function create_address($account_index = 0, $label = '') { - $create_address_parameters = array('account_index' => $account_index, 'label' => $label); - $create_address_method = $this->_run('create_address', $create_address_parameters); + $params = array('account_index' => $account_index, 'label' => $label); + $create_address_method = $this->_run('create_address', $params); $save = $this->store(); // Save wallet state after subaddress creation @@ -230,8 +230,8 @@ public function create_address($account_index = 0, $label = '') */ public function label_address($index, $label) { - $label_address_parameters = array('index' => $index ,'label' => $label); - return $this->_run('label_address', $label_address_parameters); + $params = array('index' => $index ,'label' => $label); + return $this->_run('label_address', $params); } /** @@ -279,8 +279,8 @@ public function get_accounts() */ public function create_account($label = '') { - $create_account_parameters = array('label' => $label); - $create_account_method = $this->_run('create_account', $create_account_parameters); + $params = array('label' => $label); + $create_account_method = $this->_run('create_account', $params); $save = $this->store(); // Save wallet state after account creation @@ -299,8 +299,8 @@ public function create_account($label = '') */ public function label_account($account_index, $label) { - $label_account_parameters = array('account_index' => $account_index, 'label' => $label); - $label_account_method = $this->_run('label_account', $label_account_parameters); + $params = array('account_index' => $account_index, 'label' => $label); + $label_account_method = $this->_run('label_account', $params); $save = $this->store(); // Save wallet state after account label @@ -344,8 +344,8 @@ public function get_account_tags() */ public function tag_accounts($accounts, $tag) { - $tag_accounts_parameters = array('accounts' => $accounts, 'tag' => $tag); - $tag_accounts_method = $this->_run('tag_accounts', $tag_accounts_parameters); + $params = array('accounts' => $accounts, 'tag' => $tag); + $tag_accounts_method = $this->_run('tag_accounts', $params); $save = $this->store(); // Save wallet state after account tagginng @@ -363,8 +363,8 @@ public function tag_accounts($accounts, $tag) */ public function untag_accounts($accounts) { - $untag_accounts_parameters = array('accounts' => $accounts); - $untag_accounts_method = $this->_run('untag_accounts', $untag_accounts_parameters); + $params = array('accounts' => $accounts); + $untag_accounts_method = $this->_run('untag_accounts', $params); $save = $this->store(); // Save wallet state after untagging accounts @@ -385,8 +385,8 @@ public function untag_accounts($accounts) */ public function set_account_tag_description($tag, $description) { - $set_account_tag_description_parameters = array('tag' => $tag, 'description' => $description); - $set_account_tag_description_method = $this->_run('set_account_tag_description', $set_account_tag_description_parameters); + $params = array('tag' => $tag, 'description' => $description); + $set_account_tag_description_method = $this->_run('set_account_tag_description', $params); $save = $this->store(); // Save wallet state after describing tag @@ -513,8 +513,8 @@ public function transfer($amount, $address = '', $payment_id = '', $mixin = 6, $ $destinations = array(array('amount' => $this->_transform($amount), 'address' => $address)); } - $transfer_parameters = array('destinations' => $destinations, 'mixin' => $mixin, 'get_tx_key' => true, 'payment_id' => $payment_id, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'priority' => $priority, 'do_not_relay' => $do_not_relay); - $transfer_method = $this->_run('transfer', $transfer_parameters); + $params = array('destinations' => $destinations, 'mixin' => $mixin, 'get_tx_key' => true, 'payment_id' => $payment_id, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'priority' => $priority, 'do_not_relay' => $do_not_relay); + $transfer_method = $this->_run('transfer', $params); $save = $this->store(); // Save wallet state after transfer @@ -589,8 +589,8 @@ public function transfer_split($amount, $address = '', $payment_id = '', $mixin $destinations = array(array('amount' => $this->_transform($amount), 'address' => $address)); } - $transfer_split_parameters = array('destinations' => $destinations, 'mixin' => $mixin, 'get_tx_key' => true, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'payment_id' => $payment_id, 'priority' => $priority, 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); - $transfer_method = $this->_run('transfer_split', $transfer_split_parameters); + $params = array('destinations' => $destinations, 'mixin' => $mixin, 'get_tx_key' => true, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'payment_id' => $payment_id, 'priority' => $priority, 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); + $transfer_method = $this->_run('transfer_split', $params); $save = $this->store(); // Save wallet state after transfer @@ -691,8 +691,8 @@ public function sweep_all($address, $subaddr_indices = '', $account_index = 0, $ } } - $sweep_all_parameters = array('address' => $address, 'mixin' => $mixin, 'get_tx_key' => true, 'subaddr_indices' => $subaddr_indices, 'account_index' => $account_index, 'payment_id' => $payment_id, 'priority' => $priority, 'below_amount' => $this->_transform($below_amount), 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); - $sweep_all_method = $this->_run('sweep_all', $sweep_all_parameters); + $params = array('address' => $address, 'mixin' => $mixin, 'get_tx_key' => true, 'subaddr_indices' => $subaddr_indices, 'account_index' => $account_index, 'payment_id' => $payment_id, 'priority' => $priority, 'below_amount' => $this->_transform($below_amount), 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); + $sweep_all_method = $this->_run('sweep_all', $params); $save = $this->store(); // Save wallet state after transfer @@ -766,8 +766,8 @@ public function sweep_single($key_image, $address, $payment_id = '', $mixin = 6, } } - $sweep_single_parameters = array('address' => $address, 'mixin' => $mixin, 'get_tx_key' => true, 'account_index' => $account_index, 'payment_id' => $payment_id, 'priority' => $priority, 'below_amount' => $this->_transform($below_amount), 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); - $sweep_single_method = $this->_run('sweep_single', $sweep_single_parameters); + $params = array('address' => $address, 'mixin' => $mixin, 'get_tx_key' => true, 'account_index' => $account_index, 'payment_id' => $payment_id, 'priority' => $priority, 'below_amount' => $this->_transform($below_amount), 'unlock_time' => $unlock_time, 'do_not_relay' => $do_not_relay); + $sweep_single_method = $this->_run('sweep_single', $params); $save = $this->store(); // Save wallet state after transfer @@ -785,8 +785,8 @@ public function sweep_single($key_image, $address, $payment_id = '', $mixin = 6, */ public function relay_tx($hex) { - $relay_tx_parameters = array('hex' => $hex); - $relay_tx_method = $this->_run('relay_tx_method', $relay_tx_parameters); + $params = array('hex' => $hex); + $relay_tx_method = $this->_run('relay_tx_method', $params); $save = $this->store(); // Save wallet state after transaction relay @@ -822,10 +822,10 @@ public function store() */ public function get_payments($payment_id) { - // $get_payments_parameters = array('payment_id' => $payment_id); // does not work - $get_payments_parameters = []; - $get_payments_parameters['payment_id'] = $payment_id; - return $this->_run('get_payments', $get_payments_parameters); + // $params = array('payment_id' => $payment_id); // does not work + $params = []; + $params['payment_id'] = $payment_id; + return $this->_run('get_payments', $params); } /** @@ -848,19 +848,19 @@ public function get_payments($payment_id) */ public function get_bulk_payments($payment_ids, $min_block_height) { - // $get_bulk_payments_parameters = array('payment_ids' => $payment_ids, 'min_block_height' => $min_block_height); // does not work - $get_bulk_payments_parameters = array('min_block_height' => $min_block_height); // does not work - $get_bulk_payments_parameters = []; + // $params = array('payment_ids' => $payment_ids, 'min_block_height' => $min_block_height); // does not work + $params = array('min_block_height' => $min_block_height); // does not work + $params = []; if (!is_array($payment_ids)) { throw new Exception('Error: Payment IDs must be array.'); } if ($payment_ids) { - $get_bulk_payments_parameters['payment_ids'] = []; + $params['payment_ids'] = []; foreach ($payment_ids as $payment_id) { - array_push($get_bulk_payments_parameters['payment_ids'], $payment_id); + array_push($params['payment_ids'], $payment_id); } } - return $this->_run('get_bulk_payments', $get_bulk_payments_parameters); + return $this->_run('get_bulk_payments', $params); } /** @@ -895,8 +895,8 @@ public function get_bulk_payments($payment_ids, $min_block_height) */ public function incoming_transfers($type = 'all', $account_index = 0, $subaddr_indices = '') { - $incoming_parameters = array('transfer_type' => $type, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices); - return $this->_run('incoming_transfers', $incoming_parameters); + $params = array('transfer_type' => $type, 'account_index' => $account_index, 'subaddr_indices' => $subaddr_indices); + return $this->_run('incoming_transfers', $params); } /** @@ -912,8 +912,8 @@ public function incoming_transfers($type = 'all', $account_index = 0, $subaddr_i */ public function query_key($key_type) { - $query_key_parameters = array('key_type' => $key_type); - return $this->_run('query_key', $query_key_parameters); + $params = array('key_type' => $key_type); + return $this->_run('query_key', $params); } /** @@ -929,8 +929,8 @@ public function query_key($key_type) */ public function view_key() { - $view_key_parameters = array('key_type' => 'view_key'); - return $this->_run('query_key', $view_key_parameters); + $params = array('key_type' => 'view_key'); + return $this->_run('query_key', $params); } /** @@ -946,8 +946,8 @@ public function view_key() */ public function spend_key() { - $spend_key_parameters = array('key_type' => 'spend_key'); - return $this->_run('query_key', $spend_key_parameters); + $params = array('key_type' => 'spend_key'); + return $this->_run('query_key', $params); } /** @@ -963,8 +963,8 @@ public function spend_key() */ public function mnemonic() { - $mnemonic_parameters = array('key_type' => 'mnemonic'); - return $this->_run('query_key', $mnemonic_parameters); + $params = array('key_type' => 'mnemonic'); + return $this->_run('query_key', $params); } /** @@ -980,8 +980,8 @@ public function mnemonic() */ public function make_integrated_address($payment_id = null) { - $integrate_address_parameters = array('payment_id' => $payment_id); - return $this->_run('make_integrated_address', $integrate_address_parameters); + $params = array('payment_id' => $payment_id); + return $this->_run('make_integrated_address', $params); } /** @@ -998,8 +998,8 @@ public function make_integrated_address($payment_id = null) */ public function split_integrated_address($integrated_address) { - $split_parameters = array('integrated_address' => $integrated_address); - return $this->_run('split_integrated_address', $split_parameters); + $params = array('integrated_address' => $integrated_address); + return $this->_run('split_integrated_address', $params); } /** @@ -1043,8 +1043,8 @@ public function rescan_blockchain() */ public function set_tx_notes($txids, $notes) { - $notes_parameters = array('txids' => $txids, 'notes' => $notes); - return $this->_run('set_tx_notes', $notes_parameters); + $params = array('txids' => $txids, 'notes' => $notes); + return $this->_run('set_tx_notes', $params); } /** @@ -1060,8 +1060,8 @@ public function set_tx_notes($txids, $notes) */ public function get_tx_notes($txids) { - $notes_parameters = array('txids' => $txids); - return $this->_run('get_tx_notes', $notes_parameters); + $params = array('txids' => $txids); + return $this->_run('get_tx_notes', $params); } /** @@ -1076,8 +1076,8 @@ public function get_tx_notes($txids) */ public function set_attribute($key, $value) { - $set_attribute_parameters = array('key' => $key, 'value' => $value); - return $this->_run('set_attribute', $set_attribute_parameters); + $params = array('key' => $key, 'value' => $value); + return $this->_run('set_attribute', $params); } /** @@ -1093,8 +1093,8 @@ public function set_attribute($key, $value) */ public function get_attribute($key) { - $get_attribute_parameters = array('key' => $key); - return $this->_run('get_attribute', $get_attribute_parameters); + $params = array('key' => $key); + return $this->_run('get_attribute', $params); } /** @@ -1110,8 +1110,8 @@ public function get_attribute($key) */ public function get_tx_key($txid) { - $get_tx_key_parameters = array('txid' => $txid); - return $this->_run('get_tx_key', $get_tx_key_parameters); + $params = array('txid' => $txid); + return $this->_run('get_tx_key', $params); } /** @@ -1131,8 +1131,8 @@ public function get_tx_key($txid) */ public function check_tx_key($address, $txid, $tx_key) { - $check_tx_key_parameters = array('address' => $address, 'txid' => $txid, 'tx_key' => $tx_key); - return $this->_run('check_tx_key', $check_tx_key_parameters); + $params = array('address' => $address, 'txid' => $txid, 'tx_key' => $tx_key); + return $this->_run('check_tx_key', $params); } /** @@ -1149,8 +1149,8 @@ public function check_tx_key($address, $txid, $tx_key) */ public function get_tx_proof($address, $txid) { - $get_tx_proof_parameters = array('address' => $address, 'txid' => $txid); - return $this->_run('get_tx_proof', $get_tx_proof_parameters); + $params = array('address' => $address, 'txid' => $txid); + return $this->_run('get_tx_proof', $params); } /** @@ -1171,8 +1171,8 @@ public function get_tx_proof($address, $txid) */ public function check_tx_proof($address, $txid, $signature) { - $check_tx_proof_parameters = array('address' => $address, 'txid' => $txid, 'signature' => $signature); - return $this->_run('check_tx_proof', $check_tx_proof_parameters); + $params = array('address' => $address, 'txid' => $txid, 'signature' => $signature); + return $this->_run('check_tx_proof', $params); } /** @@ -1188,8 +1188,8 @@ public function check_tx_proof($address, $txid, $signature) */ public function get_spend_proof($txid) { - $get_spend_proof_parameters = array('txid' => $txid); - return $this->_run('get_spend_proof', $get_spend_proof_parameters); + $params = array('txid' => $txid); + return $this->_run('get_spend_proof', $params); } /** @@ -1206,8 +1206,8 @@ public function get_spend_proof($txid) */ public function check_spend_proof($txid, $signature) { - $check_spend_proof_parameters = array('txid' => $txid, 'signature' => $signature); - return $this->_run('check_spend_proof', $check_spend_proof_parameters); + $params = array('txid' => $txid, 'signature' => $signature); + return $this->_run('check_spend_proof', $params); } /** @@ -1224,9 +1224,9 @@ public function check_spend_proof($txid, $signature) public function get_reserve_proof($account_index = 'all') { if ($account_index == 'all') { - $check_spend_proof_parameters = array('all' => true); + $params = array('all' => true); } else { - $check_spend_proof_parameters = array('account_index' => $account_index); + $params = array('account_index' => $account_index); } return $this->_run('get_reserve_proof'); @@ -1248,8 +1248,8 @@ public function get_reserve_proof($account_index = 'all') */ public function check_reserve_proof($address, $signature) { - $check_reserve_proof_parameters = array('address' => $address, 'signature' => $signature); - return $this->_run('check_reserve_proof', $check_reserve_proof_parameters); + $params = array('address' => $address, 'signature' => $signature); + return $this->_run('check_reserve_proof', $params); } /** @@ -1283,7 +1283,7 @@ public function check_reserve_proof($address, $signature) public function get_transfers($input_types = ['all'], $account_index = 0, $subaddr_indices = '', $min_height = 0, $max_height = 4206931337) { if (is_string($input_types)) { // If user is using old method - $get_transfers_parameters = array($input_type => $account_index); // $get_transfers_parameters = array($input_type => $input_value); + $params = array($input_type => $account_index); // $params = array($input_type => $input_value); } else { if (is_object($input_types)) { // Parameters passed in as object/dictionary $params = $input_types; @@ -1307,17 +1307,17 @@ public function get_transfers($input_types = ['all'], $account_index = 0, $subad } } - $get_transfers_parameters = array('account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'min_height' => $min_height, 'max_height' => $max_height); + $params = array('account_index' => $account_index, 'subaddr_indices' => $subaddr_indices, 'min_height' => $min_height, 'max_height' => $max_height); for ($i = 0; $i < count($input_types); $i++) { - $get_transfers_parameters[$input_types[$i]] = true; + $params[$input_types[$i]] = true; } } if (($min_height || $max_height) && $max_height != 4206931337) { - $get_transfers_parameters['filter_by_height'] = true; + $params['filter_by_height'] = true; } - return $this->_run('get_transfers', $get_transfers_parameters); + return $this->_run('get_transfers', $params); } /** @@ -1343,8 +1343,8 @@ public function get_transfers($input_types = ['all'], $account_index = 0, $subad */ public function get_transfer_by_txid($txid, $account_index = 0) { - $get_transfer_by_txid_parameters = array('txid' => $txid, 'account_index' => $account_index); - return $this->_run('get_transfer_by_txid', $get_transfer_by_txid_parameters); + $params = array('txid' => $txid, 'account_index' => $account_index); + return $this->_run('get_transfer_by_txid', $params); } /** @@ -1360,8 +1360,8 @@ public function get_transfer_by_txid($txid, $account_index = 0) */ public function sign($data) { - $sign_parameters = array('string' => $data); - return $this->_run('sign', $sign_parameters); + $params = array('string' => $data); + return $this->_run('sign', $params); } /** @@ -1377,8 +1377,8 @@ public function sign($data) */ public function verify($data, $address, $signature) { - $notes_parameters = array('data' => $data, 'address' => $address, 'signature' => $signature); - return $this->_run('verify', $notes_parameters); + $params = array('data' => $data, 'address' => $address, 'signature' => $signature); + return $this->_run('verify', $params); } /** @@ -1413,8 +1413,8 @@ public function export_key_images() */ public function import_key_images($signed_key_images) { - $import_parameters = array('signed_key_images' => $signed_key_images); - return $this->_run('import_key_images', $import_parameters); + $params = array('signed_key_images' => $signed_key_images); + return $this->_run('import_key_images', $params); } /** @@ -1434,8 +1434,8 @@ public function import_key_images($signed_key_images) */ public function make_uri($address, $amount, $payment_id = null, $recipient_name = null, $tx_description = null) { - $uri_parameters = array('address' => $address, 'amount' => $this->_transform($amount), 'payment_id' => $payment_id, 'recipient_name' => $recipient_name, 'tx_description' => $tx_description); - return $this->_run('make_uri', $uri_parameters); + $params = array('address' => $address, 'amount' => $this->_transform($amount), 'payment_id' => $payment_id, 'recipient_name' => $recipient_name, 'tx_description' => $tx_description); + return $this->_run('make_uri', $params); } /** @@ -1457,8 +1457,8 @@ public function make_uri($address, $amount, $payment_id = null, $recipient_name */ public function parse_uri($uri) { - $uri_parameters = array('uri' => $uri); - return $this->_run('parse_uri', $uri_parameters); + $params = array('uri' => $uri); + return $this->_run('parse_uri', $params); } /** @@ -1474,8 +1474,8 @@ public function parse_uri($uri) */ public function get_address_book($entries) { - $entries_parameters = array('entries' => $entries); - return $this->_run('get_address_book', $entries_parameters); + $params = array('entries' => $entries); + return $this->_run('get_address_book', $params); } /** @@ -1491,8 +1491,8 @@ public function get_address_book($entries) */ public function add_address_book($address, $payment_id, $description) { - $address_parameters = array('address' => $address, 'payment_id' => $payment_id, 'description' => $description); - return $this->_run('add_address_book', $address_parameters); + $params = array('address' => $address, 'payment_id' => $payment_id, 'description' => $description); + return $this->_run('add_address_book', $params); } /** @@ -1506,8 +1506,8 @@ public function add_address_book($address, $payment_id, $description) */ public function delete_address_book($index) { - $delete_parameters = array('index' => $index); - return $this->_run('delete_address_book', $delete_parameters); + $params = array('index' => $index); + return $this->_run('delete_address_book', $params); } /** @@ -1533,8 +1533,8 @@ public function rescan_spent() */ public function start_mining($threads_count, $do_background_mining, $ignore_battery) { - $mining_parameters = array('threads_count' => $threads_count, 'do_background_mining' => $do_background_mining, 'ignore_battery' => $ignore_battery); - return $this->_run('start_mining', $mining_parameters); + $params = array('threads_count' => $threads_count, 'do_background_mining' => $do_background_mining, 'ignore_battery' => $ignore_battery); + return $this->_run('start_mining', $params); } /** @@ -1578,8 +1578,8 @@ public function get_languages() */ public function create_wallet($filename = 'monero_wallet', $password = null, $language = 'English') { - $create_wallet_parameters = array('filename' => $filename, 'password' => $password, 'language' => $language); - return $this->_run('create_wallet', $create_wallet_parameters); + $params = array('filename' => $filename, 'password' => $password, 'language' => $language); + return $this->_run('create_wallet', $params); } /** @@ -1594,8 +1594,8 @@ public function create_wallet($filename = 'monero_wallet', $password = null, $la */ public function open_wallet($filename = 'monero_wallet', $password = null) { - $open_wallet_parameters = array('filename' => $filename, 'password' => $password); - return $this->_run('open_wallet', $open_wallet_parameters); + $params = array('filename' => $filename, 'password' => $password); + return $this->_run('open_wallet', $params); } /** @@ -1648,8 +1648,8 @@ public function prepare_multisig() */ public function make_multisig($multisig_info, $threshold, $password = '') { - $make_multisig_parameters = array('multisig_info' => $multisig_info, 'threshold' => $threshold, 'password' => $password); - return $this->_run('make_multisig', $make_multisig_parameters); + $params = array('multisig_info' => $multisig_info, 'threshold' => $threshold, 'password' => $password); + return $this->_run('make_multisig', $params); } /** @@ -1681,8 +1681,8 @@ public function export_multisig_info() */ public function import_multisig_info($info) { - $import_multisig_info_parameters = array('info' => $info); - return $this->_run('import_multisig_info', $import_multisig_info_parameters); + $params = array('info' => $info); + return $this->_run('import_multisig_info', $params); } /** @@ -1699,8 +1699,8 @@ public function import_multisig_info($info) */ public function finalize_multisig($multisig_info, $password = '') { - $finalize_multisig_parameters = array('multisig_info' => $multisig_info, 'password' => $password); - return $this->_run('finalize_multisig', $finalize_multisig_parameters); + $params = array('multisig_info' => $multisig_info, 'password' => $password); + return $this->_run('finalize_multisig', $params); } /** @@ -1716,8 +1716,8 @@ public function finalize_multisig($multisig_info, $password = '') */ public function sign_multisig($tx_data_hex) { - $sign_multisig_parameters = array('tx_data_hex' => $tx_data_hex); - return $this->_run('sign_multisig', $sign_multisig_parameters); + $params = array('tx_data_hex' => $tx_data_hex); + return $this->_run('sign_multisig', $params); } /** @@ -1733,8 +1733,8 @@ public function sign_multisig($tx_data_hex) */ public function submit_multisig($tx_data_hex) { - $submit_multisig_parameters = array('tx_data_hex' => $tx_data_hex); - return $this->_run('submit_multisig', $submit_multisig_parameters); + $params = array('tx_data_hex' => $tx_data_hex); + return $this->_run('submit_multisig', $params); } } From 0662b6481e533b6984271c0a00b80307408d689b Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sat, 31 Mar 2018 23:45:43 -0700 Subject: [PATCH 04/10] documentation overhaul --- README.md | 16 +- docs/README.md | 162 ++++ docs/base58.md | 42 + docs/cryptonote.md | 246 ++++++ docs/daemonRPC.md | 385 +++++++++ docs/walletRPC.html | 1966 +++++++++++++++++++++++++++++++++++++++++++ docs/walletRPC.md | 1125 +++++++++++++++++++++++++ example.php | 13 +- src/base58.php | 87 +- src/daemonRPC.php | 12 +- src/walletRPC.php | 56 +- 11 files changed, 4049 insertions(+), 61 deletions(-) create mode 100644 docs/README.md create mode 100644 docs/base58.md create mode 100644 docs/cryptonote.md create mode 100644 docs/daemonRPC.md create mode 100644 docs/walletRPC.html create mode 100644 docs/walletRPC.md diff --git a/README.md b/README.md index 4690b94..7434d6a 100644 --- a/README.md +++ b/README.md @@ -13,27 +13,31 @@ In addition to these features, there are other lower-level libraries included fo ## Preview ![Preview](https://user-images.githubusercontent.com/4107993/38056594-b6cd6e14-3291-11e8-96e2-a771b0e9cee3.png) +## Documention + +Documentation can be found in the [`/docs`](https://github.com/sneurlax/monerophp/tree/master/docs) folder. + ## Configuration ### Requirements - - Monero daemon + - Monero daemon (`monerod`) - Webserver with PHP, for example XMPP, Apache, or NGINX - cURL PHP extension for JSON RPC API(s) - GMP PHP extension for about 100x faster calculations (as opposed to BCMath) Debian (or Ubuntu) are recommended. ---- +## Getting Started -1. Start the Monero daemon (`monerod`) on testnet +1. Start the Monero daemon (`monerod`) on testnet. ```bash monerod --testnet --detach ``` -2. Start the Monero wallet RPC interface (`monero-wallet-rpc`) on testnet +2. Start the Monero wallet RPC interface (`monero-wallet-rpc`) on testnet. ```bash monero-wallet-rpc --testnet --rpc-bind-port 28083 --disable-rpc-login --wallet-dir /path/to/wallet/directory ``` -3. Edit `example.php` with your the IP address of `monerod` and `monero-wallet-rpc` (use `127.0.0.1:28081` and `127.0.0.1:28083`, respectively, for testnet) +3. Edit `example.php` with your the IP address of `monerod` and `monero-wallet-rpc` (use `127.0.0.1:28081` and `127.0.0.1:28083`, respectively, for testnet.) -4. Open your browser with your IP address of local webserver (*eg.* XMPP, Apache/Apache2, NGINX, *etc.*) and execute example.php. If everything has been set up correctly, information from your Monero daemon and wallet will be displayed. +4. Serve `example.php` with your webserver (*eg.* XMPP, Apache/Apache2, NGINX, *etc.*) and navigate to it. If everything has been set up correctly, information from your Monero daemon and wallet will be displayed. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..4f4a4f5 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,162 @@ +# MoneroPHP documentation + +This document lists the MoneroPHP classes and their methods. More detailed documentation (including parameters and their types and return formats and examples) can be found on each class' page. + +### Classes + + - [`cryptonote`](#cryptonote-class) ([`src/cryptonote.php`](https://github.com/monero-integrations/monerophp/tree/master/src/cryptonote.php)) + - [`ed25519`](#ed25519-class) ([`src/ed25519.php`](https://github.com/monero-integrations/monerophp/tree/master/src/ed25519.php)) + - [`SHA3`](#SHA3-class) ([`src/SHA3.php`](https://github.com/monero-integrations/monerophp/tree/master/src/SHA3.php)) + - [`base58`](#base58-class) ([`src/base58.php`](https://github.com/monero-integrations/monerophp/tree/master/src/base58.php)) + +JSON RPC wrappers: + + - [`daemonRPC`](#daemonRPC-class) ([`src/daemonRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/daemonRPC.php)) + - [`walletRPC`](#walletRPC-class) ([`src/walletRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/walletRPC.php)) + +## [`cryptonote` class](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md) + + - [`keccak_256`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#keccak_256) + - [`gen_new_hex_seed`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_new_hex_seed) + - [`sc_reduce`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#sc_reduce) + - [`hash_to_scalar`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#hash_to_scalar) + - [`derive_viewKey`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derive_viewKey) + - [`gen_private_keys`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_private_keys) + - [`pk_from_sk`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#pk_from_sk) + - [`gen_key_derivation`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_key_derivation) + - [`encode_varint`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#encode_varint) + - [`derivation_to_scalar`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derivation_to_scalar) + - [`stealth_payment_id`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#stealth_payment_id) + - [`txpub_from_extra`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#txpub_from_extra) + - [`derive_public_key`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derive_public_key) + - [`is_output_mine`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#is_output_mine) + - [`encode_address`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#encode_address) + - [`verify_checksum`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#verify_checksum) + - [`decode_address`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#decode_address) + - [`integrated_addr_from_keys`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#integrated_addr_from_keys) + - [`address_from_seed`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#address_from_seed) + +## [`ed25519` class](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md) + + - [`H`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#H) + - [`pymod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#pymod) + - [`expmod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#expmod) + - [`inv`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#inv) + - [`xrecover`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#xrecover) + - [`edwards`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#edwards) + - [`scalarmult`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarmult) + - [`scalarloop`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarloop) + - [`bitsToString`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#bitsToString) + - [`dec2bin_i`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#dec2bin_i) + - [`encodeint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#encodeint) + - [`encodepoint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#encodepoint) + - [`bit`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#bit) + - [`publickey`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#publickey) + - [`Hint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#Hint) + - [`signature`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#signature) + - [`isoncurve`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#isoncurve) + - [`decodeint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#decodeint) + - [`decodepoint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#decodepoint) + - [`checkvalid`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#checkvalid) + - [`scalarmult_base`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarmult_base) + +## [`SHA3` class](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md) + + - [`init`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#init) + - [`absorb`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#absorb) + - [`absorb`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#absorb) + - [`squeeze`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#squeeze) + +## [`base58` class](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md) + + - [`encode`](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md##encode) + - [`decode`](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md##decode) + +## [`daemonRPC` class](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md) + + - [`getblockcount`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockcount) + - [`on_getblockhash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#on_getblockhash) + - [`getblocktemplate`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblocktemplate) + - [`submitblock`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#submitblock) + - [`getlastblockheader`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getlastblockheader) + - [`getblockheaderbyhash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyhash) + - [`getblockheaderbyheight`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyheight) + - [`getblock_by_hash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblock_by_hash) + - [`getblock_by_height`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblock_by_height) + - [`get_connections`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#get_connections) + - [`get_info`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#get_info) + - [`hardfork_info`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#hardfork_info) + - [`setbans`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#setbans) + - [`getbans`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getbans) + +## [`walletRPC` class](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md) + + - [`_transform`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#_transform) + - [`get_balance`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_balance) + - [`get_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_address) + - [`create_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_address) + - [`label_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#label_address) + - [`get_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_accounts) + - [`create_account`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_account) + - [`label_account`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#label_account) + - [`get_account_tags`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_account_tags) + - [`tag_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#tag_accounts) + - [`untag_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#untag_accounts) + - [`set_account_tag_description`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_account_tag_description) + - [`get_height`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_height) + - [`transfer`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#transfer) + - [`transfer_split`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#transfer_split) + - [`sweep_dust`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_dust) + - [`sweep_unmixable`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_unmixable) + - [`sweep_all`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_all) + - [`sweep_single`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_single) + - [`relay_tx`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#relay_tx) + - [`store`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#store) + - [`get_payments`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_payments) + - [`get_bulk_payments`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_bulk_payments) + - [`incoming_transfers`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#incoming_transfers) + - [`query_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#query_key) + - [`view_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#view_key) + - [`spend_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#spend_key) + - [`mnemonic`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#mnemonic) + - [`make_integrated_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_integrated_address) + - [`split_integrated_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#split_integrated_address) + - [`stop_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#stop_wallet) + - [`rescan_blockchain`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#rescan_blockchain) + - [`set_tx_notes`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_tx_notes) + - [`get_tx_notes`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_notes) + - [`set_attribute`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_attribute) + - [`get_attribute`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_attribute) + - [`get_tx_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_key) + - [`check_tx_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_tx_key) + - [`get_tx_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_proof) + - [`check_tx_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_tx_proof) + - [`get_spend_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_spend_proof) + - [`check_spend_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_spend_proof) + - [`get_reserve_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_reserve_proof) + - [`check_reserve_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_reserve_proof) + - [`get_transfers`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_transfers) + - [`get_transfer_by_txid`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_transfer_by_txid) + - [`sign`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sign) + - [`verify`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#verify) + - [`export_key_images`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#export_key_images) + - [`import_key_images`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#import_key_images) + - [`make_uri`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_uri) + - [`parse_uri`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#parse_uri) + - [`get_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_address_book) + - [`add_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#add_address_book) + - [`delete_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#delete_address_book) + - [`rescan_spent`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#rescan_spent) + - [`start_mining`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#start_mining) + - [`stop_mining`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#stop_mining) + - [`get_languages`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_languages) + - [`create_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_wallet) + - [`open_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#open_wallet) + - [`is_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#is_multisig) + - [`prepare_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#prepare_multisig) + - [`make_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_multisig) + - [`export_multisig_info`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#export_multisig_info) + - [`import_multisig_info`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#import_multisig_info) + - [`finalize_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#finalize_multisig) + - [`sign_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sign_multisig) + - [`submit_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#submit_multisig) diff --git a/docs/base58.md b/docs/base58.md new file mode 100644 index 0000000..a462f44 --- /dev/null +++ b/docs/base58.md @@ -0,0 +1,42 @@ +# `base58` class + +[`src/base58.php`](https://github.com/monero-integrations/monerophp/tree/master/src/base58.php) + +A PHP Base58 codec + +### Methods + + - [`encode`](#encode) + - [`decode`](#decode) + +#### `encode` + +Encode a hexadecimal (Base16) string to Base58 + +Parameters: + + - `$hex ` A hexadecimal (Base16) string to convert to Base58 + +Return: `` + +`"479cG5opa54beQWSyqNoWw5tna9sHUNmMTtiFqLPaUhDevpJ2YLwXAggSx5ePdeFrYF8cdbmVRSmp1Kn3t4Y9kFu7rZ7pFw"` + +#### `decode` + +Decode a Base58 string to hexadecimal (Base16) + +Parameters: + + - `$hex ` A Base58 string to convert to hexadecimal (Base16) + +Return: `` + +`"0137F8F06C971B168745F562AA107B4D172F336271BC0F9D3B510C14D3460DFB27D8CEBE561E73AC1E11833D5EA40200EB3C82E9C66ACAF1AB1A6BB53C40537C0B7A22160B0E"` + +### Credits + +Written by the [Monero Integrations team](https://github.com/monero-integrations/monerophp/graphs/contributors) () + +Using work from: + - bigreddmachine [MoneroPy] (https://github.com/bigreddmachine) + - Paul Shapiro [mymonero-core-js] (https://github.com/paulshapiro) diff --git a/docs/cryptonote.md b/docs/cryptonote.md new file mode 100644 index 0000000..297f0c5 --- /dev/null +++ b/docs/cryptonote.md @@ -0,0 +1,246 @@ +# `cryptonote` class + +[`src/cryptonote.php`](https://github.com/monero-integrations/monerophp/tree/master/src/cryptonote.php) + +### Methods + + - [`keccak_256`](#keccak_256) + - [`gen_new_hex_seed`](#gen_new_hex_seed) + - [`sc_reduce`](#sc_reduce) + - [`hash_to_scalar`](#hash_to_scalar) + - [`derive_viewKey`](#derive_viewKey) + - [`gen_private_keys`](#gen_private_keys) + - [`pk_from_sk`](#pk_from_sk) + - [`gen_key_derivation`](#gen_key_derivation) + - [`encode_varint`](#encode_varint) + - [`derivation_to_scalar`](#derivation_to_scalar) + - [`stealth_payment_id`](#stealth_payment_id) + - [`txpub_from_extra`](#txpub_from_extra) + - [`derive_public_key`](#derive_public_key) + - [`is_output_mine`](#is_output_mine) + - [`encode_address`](#encode_address) + - [`verify_checksum`](#verify_checksum) + - [`decode_address`](#decode_address) + - [`integrated_addr_from_keys`](#integrated_addr_from_keys) + - [`address_from_seed`](#address_from_seed) + +#### `keccak_256` + +Derive a Keccak256 hash from a string + +Parameters: + + - `$message ` Hex encoded string of the data to hash + +Return: `` Hex encoded string of the hashed data + +[//]: # (TODO example) + +#### `gen_new_hex_seed` + +Generate a hexadecimal seed + +Return: `` A hex encoded string of 32 random bytes + +[//]: # (TODO example) + +#### `sc_reduce` + +Parameters: + + - `$input ` + +[//]: # (TODO return type and example) + +#### `hash_to_scalar` + +`Hs` in the cryptonote white paper + +Parameters: + + - `$data ` Hex encoded data to hash + +Return: `` A 32 byte encoded integer + +[//]: # (TODO example) + +#### `derive_viewKey` + +Derive a deterministic private view key from a private spend key + +Parameters: + + - `$spendKey ` A deterministic private view key represented as a 32 byte hex string + +Return: `` + +[//]: # (TODO example) + +#### `gen_private_keys` + +Generate a pair of random private keys + +Parameters: + + - `$seed ` A hex string to be used as a seed (this should be random) + +Return: `` An array containing a private spend key and a deterministic view key + +[//]: # (TODO example) + +#### `pk_from_sk` + +Get a public key from a private key on the ed25519 curve + +Parameters: + + - `$privKey ` A 32 byte hex encoded private key + +Return: `` + +[//]: # (TODO example) + +#### `gen_key_derivation` + +Generate key derivation + +Parameters: + + - `$public ` a 32 byte hex encoding of a point on the ed25519 curve used as a public key + - `$private ` a 32 byte hex encoded private key + +Return: `` The hex encoded key derivation + +[//]: # (TODO example) + +#### `encode_varint` + +Parameters: + + - `$der <>` + - `$index <>` + +[//]: # (TODO return type and example) + +#### `derivation_to_scalar` + +Parameters: + + - `$ <>` + +[//]: # (TODO return type and example) + +#### `stealth_payment_id` + +A one way function used for both encrypting and decrypting 8 byte payment IDs + +Parameters: + + - `$payment_id ` + - `$tx_pub_key ` + - `$viewkey ` + +Return: `` + +[//]: # (TODO example) + +#### `txpub_from_extra` + +Takes transaction extra field as hex string and returns transaction public key 'R' as hex string + +Parameters: + + - `$extra ` + +Return: `` + +[//]: # (TODO example) + +#### `derive_public_key` + +Parameters: + + - `$der <>` + - `$index <>` + - `$pub <>` + +Return: `` + +[//]: # (TODO example) + +#### `is_output_mine` + +Perform the calculation P = P' as described in the cryptonote whitepaper + +Parameters: + + - `$txPublic ` 32 byte transaction public key R + - `$privViewkey ` 32 byte reciever private view key a + - `$publicSpendkey ` 32 byte reciever public spend key B + - `$index ` Otput index + - `$P ` Output you want to check against P + +Return: `` + +[//]: # (TODO example) + +#### `encode_address` + +Create a valid base58 encoded Monero address from public keys + +Parameters: + + - `$pSpendKey ` Public spend key + - `$pViewKey ` Public view key + +Return: `` Base58 encoded Monero address + +[//]: # (TODO example) + +#### `verify_checksum` + +Parameters: + + - `$address <>` + +Return: `` + +[//]: # (TODO example) + +#### `decode_address` + +Decode a base58 encoded Monero address + +Parameters: + + - `$address ` A base58 encoded Monero address + +Return: `` An array containing the Address network byte, public spend key, and public view key +[//]: # (TODO example) + + +#### `integrated_addr_from_keys` + +Create an integrated address from public keys and a payment ID + +Parameters: + + - `$public_spendkey ` A 32 byte hex encoded public spend key + - `$public_viewkey ` A 32 byte hex encoded public view key + - `$payment_id ` An 8 byte hex string to use as a payment id + +Return: `` Integrated address + +[//]: # (TODO example) + +#### `address_from_seed` + +Derive Monero address from seed + +Parameters: + + - `$hex_seed ` Hex string to use as seed + +Return: `` A base58 encoded Monero address + +[//]: # (TODO example) diff --git a/docs/daemonRPC.md b/docs/daemonRPC.md new file mode 100644 index 0000000..c7ce6cb --- /dev/null +++ b/docs/daemonRPC.md @@ -0,0 +1,385 @@ +# `daemonRPC` class + +[`src/daemonRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/daemonRPC.php) + +A class for making calls to a Monero daemon's RPC API using PHP + +Parameters: + + - `$protocol ` Monero daemon IP hostname *(optional)* + - `$host ` Monero daemon port *(optional)* + - `$port ` Monero daemon protocol (*eg.* 'http') *(optional)* + - `$url ` Monero daemon RPC username *(optional)* + - `$user ` Monero daemon RPC passphrase *(optional)* + - `$password ` Monero daemon RPC passphrase *(optional)* + +### Methods + + - [`getblockcount`](#getblockcount) + - [`on_getblockhash`](#on_getblockhash) + - [`getblocktemplate`](#getblocktemplate) + - [`submitblock`](#submitblock) + - [`getlastblockheader`](#getlastblockheader) + - [`getblockheaderbyhash`](#getblockheaderbyhash) + - [`getblockheaderbyheight`](#getblockheaderbyheight) + - [`getblock_by_hash`](#getblock_by_hash) + - [`getblock_by_height`](#getblock_by_height) + - [`get_connections`](#get_connections) + - [`get_info`](#get_info) + - [`hardfork_info`](#hardfork_info) + - [`setbans`](#setbans) + - [`getbans`](#getbans) + +#### `getblockcount` + +Look up how many blocks are in the longest chain known to the node + +*No parameters* + +Return: `` + +```json +{ + "count": 993163, + "status": "OK" +} +``` + +#### `on_getblockhash` + +Look up a block's hash by its height + +Parameters: + + - `$height ` Height of block to look up + +Return: `` + +```json +"e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6" +``` + +#### `getblocktemplate` + +Construct a block template that can be mined upon + +Parameters: + + - `$wallet_address ` Address of wallet to receive coinbase transactions if block is successfully mined + - `$reserve_size ` Reserve size + +Return: `` + +```json +{ + "blocktemplate_blob": "01029af88cb70568b84a11dc9406ace9e635918ca03b008f7728b9726b327c1b482a98d81ed83000000000018bd03c01ffcfcf3c0493d7cec7020278dfc296544f139394e5e045fcda1ba2cca5b69b39c9ddc90b7e0de859fdebdc80e8eda1ba01029c5d518ce3cc4de26364059eadc8220a3f52edabdaf025a9bff4eec8b6b50e3d8080dd9da417021e642d07a8c33fbe497054cfea9c760ab4068d31532ff0fbb543a7856a9b78ee80c0f9decfae01023ef3a7182cb0c260732e7828606052a0645d3686d7a03ce3da091dbb2b75e5955f01ad2af83bce0d823bf3dbbed01ab219250eb36098c62cbb6aa2976936848bae53023c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f12d7c87346d6b84e17680082d9b4a1d84e36dd01bd2c7f3b3893478a8d88fb3", + "difficulty": 982540729, + "height": 993231, + "prev_hash": "68b84a11dc9406ace9e635918ca03b008f7728b9726b327c1b482a98d81ed830", + "reserved_offset": 246, + "status": "OK" +} +``` + +#### `submitblock` + +Submit a mined block to the network + +Parameters: + + - `$block ` Block blob + +Return: `` + +[//]: # (TODO example) + +#### `getlastblockheader` + +Look up the block header of the latest block in the longest chain known to the node + +*No parameters* + +Return: `` + +```json +{ + "block_header": { + "depth": 0, + "difficulty": 746963928, + "hash": "ac0f1e226268d45c99a16202fdcb730d8f7b36ea5e5b4a565b1ba1a8fc252eb0", + "height": 990793, + "major_version": 1, + "minor_version": 1, + "nonce": 1550, + "orphan_status": false, + "prev_hash": "386575e3b0b004ed8d458dbd31bff0fe37b280339937f971e06df33f8589b75c", + "reward": 6856609225169, + "timestamp": 1457589942 + }, + "status": "OK" +} +``` + +#### `getblockheaderbyhash` + +Look up a block header by height + +Parameters: + + - `$height ` Height of block + +Return: `` + +```json +{ + "block_header": { + "depth": 78376, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "status": "OK" +} +``` + +#### `getblockheaderbyheight` + +Look up block information by height + +Parameters: + + - `$height ` Height of block + +Return: `` + +```json +{ + "block_header": { + "depth": 78376, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "status": "OK" +} +``` + +#### `getblock_by_hash` + +Look up block information by SHA256 hash + +Parameters: + + - `$hash ` SHA256 hash of block + +Return: `` + +```json +{ + "block_header": { + "depth": 78376, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "status": "OK" +} +``` + +#### `getblock_by_height` + +Look up block information by height + +Parameters: + + - `$height ` Height of block + +Return: `` + +```json +{ + "blob": "...", + "block_header": { + "depth": 80694, + "difficulty": 815625611, + "hash": "e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6", + "height": 912345, + "major_version": 1, + "minor_version": 2, + "nonce": 1646, + "orphan_status": false, + "prev_hash": "b61c58b2e0be53fad5ef9d9731a55e8a81d972b8d90ed07c04fd37ca6403ff78", + "reward": 7388968946286, + "timestamp": 1452793716 + }, + "json": "...", + "status": "OK" +} +``` + +#### `get_connections` + +Look up incoming and outgoing connections to your node + +*No parameters* + +Return: `` + +```json +{ + "connections": [{ + "avg_download": 0, + "avg_upload": 0, + "current_download": 0, + "current_upload": 0, + "incoming": false, + "ip": "76.173.170.133", + "live_time": 1865, + "local_ip": false, + "localhost": false, + "peer_id": "3bfe29d6b1aa7c4c", + "port": "18080", + "recv_count": 116396, + "recv_idle_time": 23, + "send_count": 176893, + "send_idle_time": 1457726610, + "state": "state_normal" + },{ + .. + }], + "status": "OK" +} +``` + +#### `get_info` + +Look up general information about the state of your node and the network + +*No parameters* + +Return: `` + +```json +{ + "alt_blocks_count": 5, + "difficulty": 972165250, + "grey_peerlist_size": 2280, + "height": 993145, + "incoming_connections_count": 0, + "outgoing_connections_count": 8, + "status": "OK", + "target": 60, + "target_height": 993137, + "testnet": false, + "top_block_hash": "", + "tx_count": 564287, + "tx_pool_size": 45, + "white_peerlist_size": 529 +} +``` + +#### `hardfork_info` + +Look up information regarding hard fork voting and readiness + +*No parameters* + +Return: `` + +```json +{ + "alt_blocks_count": 0, + "block_size_limit": 600000, + "block_size_median": 85, + "bootstrap_daemon_address": ?, + "cumulative_difficulty": 40859323048, + "difficulty": 57406, + "free_space": 888592449536, + "grey_peerlist_size": 526, + "height": 1066107, + "height_without_bootstrap": 1066107, + "incoming_connections_count": 1, + "offline": ?, + "outgoing_connections_count": 1, + "rpc_connections_count": 1, + "start_time": 1519963719, + "status": OK, + "target": 120, + "target_height": 1066073, + "testnet": 1, + "top_block_hash": e438aae56de8e5e5c8e0d230167fcb58bc8dde09e369ff7689a4af146040a20e, + "tx_count": 52632, + "tx_pool_size": 0, + "untrusted": ?, + "was_bootstrap_ever_used: ?, + "white_peerlist_size": 5 +} +``` + +#### `setbans` + +Ban another node by IP + +Parameters: + + - `$ip ` IP address of node to ban + +Return: `` + +```json +{ + "status": "OK" +} +``` + +#### `getbans` + +Get list of banned IPs + +*No parameters* + + - `$ <>` + +Return: `` + +```json +{ + "bans": [{ + "ip": 838969536, + "seconds": 1457748792 + }], + "status": "OK" +} +``` + +### Credits + +Written by the [Monero Integrations team](https://github.com/monero-integrations/monerophp/graphs/contributors) () + +Using work from: + - CryptoChangements [Monero_RPC] () (https://github.com/cryptochangements34) + - Serhack [Monero Integrations] () (https://serhack.me) + - TheKoziTwo [xmr-integration] () + - Andrew LeCody [EasyBitcoin-PHP] + - Kacper Rowinski [jsonRPCClient] () diff --git a/docs/walletRPC.html b/docs/walletRPC.html new file mode 100644 index 0000000..70e8f10 --- /dev/null +++ b/docs/walletRPC.html @@ -0,0 +1,1966 @@ +walletRPC

walletRPC class

+

src/walletRPC.php

+

A class for making calls to monero-wallet-rpc using PHP

+

Parameters:

+
    +
  • $host <string> monero-wallet-rpc hostname (optional)
  • +
  • $port <int> monero-wallet-rpc port (optional)
  • +
  • $protocol <string> monero-wallet-rpc protocol (eg. ‘http’) (optional)
  • +
  • $user <string> monero-wallet-rpc RPC username (optional)
  • +
  • $password <string> monero-wallet-rpc RPC passphrase (optional)
  • +
+

Methods

+

_transform

+

Convert from moneroj to tacoshi (piconero)

+

Parameters:

+
    +
  • $method <number> Amount (in monero) to transform to tacoshi (piconero) (optional)
  • +
+

Return: <Number>

+

get_balance

+

Look up an account’s balance

+

Parameters:

+
    +
  • $account_index <number> Index of account to look up (
    + optional)
  • +
+

Return: <Object>

+
{
+ "balance": 140000000000,
+ "unlocked_balance": 50000000000
+}
+
+ +

Alias: `

+

getbalance

+

Alias of get_balance()

+

Parameters:

+
    +
  • $account_index <number> Index of account to look up (optional)
  • +
+

Return: <Object>

+
{
+ "balance": 140000000000,
+ "unlocked_balance": 50000000000
+}
+
+ +

``

+

Look up wallet address(es)

+

Parameters:

+
    +
  • $account_index <number> Index of account to look up (optional)
  • +
  • $address_index <number> Index of subaddress to look up (optional)
  • +
+

Return: <Object>

+
{
+ address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATS
+ addresses: [
+   {
+     address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH
+     address_index: 0,
+     label: 'Primary account',
+     used: true
+   }, {
+     address: 'Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7w
+     address_index: 1,
+     label: '',
+     used: true
+   }
+ ]
+}
+
+ +

``

+

Alias of get_address()

+

Parameters:

+
    +
  • $account_index <number> Index of account to look up (optional)
  • +
  • $address_index <number> Index of subaddress to look up (optional)
  • +
+

Return: <Object>

+
{
+ "address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhh
+}
+
+ +

``

+

Create a new subaddress

+

Parameters:

+
    +
  • $account_index <number> The subaddress account index
  • +
  • $label <string> A label to the new subaddress
  • +
+

Return: <Object>

+
{
+ "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSC
+ "address_index": 1
+}
+
+ +

``

+

Label a subaddress

+

Parameters:

+
    +
  • $index <number> The index of the subaddress to label
  • +
  • $label <string> The label to apply
  • +
+

No return

+

``

+

Look up wallet accounts

+

No parameters

+

Return: <Object>

+
{
+ "subaddress_accounts": {
+   "0": {
+     "account_index": 0,
+     "balance": 2808597352948771,
+     "base_address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnR
+     "label": "Primary account",
+     "tag": "",
+     "unlocked_balance": 2717153096298162
+   },
+   "1": {
+     "account_index": 1,
+     "balance": 0,
+     "base_address": "BcXKsfrvffKYVoNGN4HUFfaruAMRdk5DrLZDmJBnYgXrTFrXyudn81xMj7rsmU5P9dX56
+     "label": "Secondary account",
+     "tag": "",
+     "unlocked_balance": 0 )
+  },
+  "total_balance": 2808597352948771,
+  "total_unlocked_balance": 2717153096298162
+}
+
+ +

``

+

Create a new account

+

Parameters:

+
    +
  • $label <String> Label to apply
  • +
+

No return

+

``

+

Label an account

+

Parameters:

+
    +
  • $account_index <number> Index of account to label
  • +
  • $label <string> Label to apply
  • +
+

No return

+

``

+

Look up account tags

+

No parameters

+

Return: <Object>

+
{
+ "account_tags": {
+   "0": {
+     "accounts": {
+       "0": 0,
+       "1": 1
+     },
+     "label": "",
+     "tag": "Example tag"
+   }
+ }
+}
+
+ +

``

+

Tag accounts

+

Parameters:

+
    +
  • $accounts <array> The indeices of the accounts to tag
  • +
  • $tag <string> Tag to apply
  • +
+

No return

+

``

+

Untag accounts

+

Parameters:

+
    +
  • $accounts <array> The indices of the accounts to untag
  • +
+

No return

+

``

+

Describe a tag

+

Parameters:

+
    +
  • $tag <string> Tag to describe
  • +
  • $description <string> Description to apply to tag
    +Return: <Object>
  • +
+
{
+ // TODO example
+}
+
+ +

``

+

Look up how many blocks are in the longest chain known to the wallet

+

No parameters

+

Return: <Object>

+
{
+ "height": 994310
+}
+
+ +

``

+

Alias of get_height()

+

No parameters

+

Return: <Object>

+
{
+ "height": 994310
+}
+
+ +

``

+

Send monero

+

Parameters:

+

Parameters can be passed in individually (as listed below) or as an object/dictionary (as
+To send to multiple recipients, use the object/dictionary (bottom) format and pass an array
+ - $amount <string> Amount of monero to send
+ - $address <string> Address to receive funds
+ - $payment_id <string> Payment
+ - $mixin <number> Mixin number (ringsize -
+ - $account_index <number> Account to send
+ - $subaddr_indices <string> Comma-separeted list of subaddress indices to spend
+ - $priority <number> Transaction
+ - $unlock_time <number> UNIX time or block height to unlock
+ - $do_not_relay <boolean> Do not relay
+ OR
+ - $params <object> Array containing any of the options listed above, where
+Return: <Object>

+
{
+ "amount": "1000000000000",
+ "fee": "1000020000",
+ "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
+ "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
+}
+
+ +

``

+

Same as transfer, but splits transfer into more than one transaction if necessary

+

Parameters:

+

Send all dust outputs back to the wallet

+

No parameters

+

Return: <Object>

+
{
+ "multisig_txset": []
+}
+
+ +

``

+

Send all unmixable outputs back to the wallet

+

No parameters

+

Return: <Object>

+
{
+ "multisig_txset": []
+}
+
+ +

``

+

Send all unlocked outputs from an account to an address

+

Parameters:

+
    +
  • $address <string> Address to receive funds
  • +
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to sweep (
  • +
  • $account_index <number> Index of the account to sweep (
  • +
  • $payment_id <string> Payment ID (
  • +
  • $mixin <number> Mixin number (ringsize - 1) (
  • +
  • $priority <number> Payment ID (
  • +
  • $below_amount <number> Only send outputs below this amount (
  • +
  • $unlock_time <number> UNIX time or block height to unlock output (
  • +
  • $do_not_relay <boolean> Do not relay transaction (
    + OR
  • +
  • $params <object> Array containing any of the options listed above, where
    +Return: <Object>
  • +
+
{
+ "amount": "1000000000000",
+ "fee": "1000020000",
+ "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
+ "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
+}
+
+ +

``

+

Sweep a single key image to an address

+

Parameters:

+
    +
  • $key_image <string> Key image to sweep
  • +
  • $address <string> Address to receive funds
  • +
  • $payment_id <string> Payment ID (optional)
  • +
  • $below_amount <number> Only send outputs below this amount (optional)
  • +
  • $mixin <number> Mixin number (ringsize - 1) (optional)
  • +
  • $priority <number> Payment ID (optional)
  • +
  • $unlock_time <number> UNIX time or block height to unlock output (optional)
  • +
  • $do_not_relay <boolean> Do not relay transaction (optional)
    + OR
  • +
  • $params <object> Array containing any of the options listed above, where
    +Return: <Object>
  • +
+
{
+ "amount": "1000000000000",
+ "fee": "1000020000",
+ "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
+ "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
+}
+
+ +

``

+

Relay a transaction

+

Parameters:

+
    +
  • $hex <string> Blob of transaction to relay
    +Return: <Object>
  • +
+
ODO example
+
+Save wallet
+
+Look up incoming payments by payment ID
+ - `$payment_id <string>` Payment ID to look up
+Return: `<Object>`
+
+```json
+{
+ "payments": [{
+   "amount": 10350000000000,
+   "block_height": 994327,
+   "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030",
+   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
+   "unlock_time": 0
+ }]
+}
+
+ +

``

+

Look up incoming payments by payment ID (or a list of payments IDs) from a given height

+

Parameters:

+
    +
  • $payment_ids <array> Array of payment IDs to look up
  • +
  • $min_block_height <string> Height to begin search
    +Return: <Object>
  • +
+
{
+ "payments": [{
+   "amount": 10350000000000,
+   "block_height": 994327,
+   "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030",
+   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
+   "unlock_time": 0
+ }]
+}
+
+ +

``

+

Look up incoming transfers

+

Parameters:

+
    +
  • $type <string> Type of transfer to look up; must be ‘all’, ‘available’,
  • +
  • $account_index <number> Index of account to look up
  • +
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to look
    +Return: <Object>
  • +
+
{
+ "transfers": [{
+   "amount": 10000000000000,
+   "global_index": 711506,
+   "spent": false,
+   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
+   "tx_size": 5870
+ },{
+   "amount": 300000000000,
+   "global_index": 794232,
+   "spent": false,
+   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
+   "tx_size": 5870
+ },{
+   "amount": 50000000000,
+   "global_index": 213659,
+   "spent": false,
+   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
+   "tx_size": 5870
+ }]
+}
+
+ +

``

+

Look up a wallet key

+

Parameters:

+
    +
  • $key_type <string> Type of key to look up; must be ‘view_key’, ‘spend_key’, or
    +Return: <Object>
  • +
+
{
+ "key": "7e341d..."
+}
+
+ +

``

+

Look up wallet view key

+

No parameters

+

Return: <Object>

+
{
+ "key": "7e341d..."
+}
+
+ +

``

+

Look up wallet spend key

+

No parameters

+

Return: <Object>

+
{
+ "key": "2ab810..."
+}
+
+ +

``

+

Look up wallet mnemonic seed

+

No parameters

+

Return: <Object>

+
{
+ "key": "2ab810..."
+}
+
+ +

``

+

Create an integrated address from a given payment ID

+

Parameters:

+
    +
  • $payment_id <string> Payment ID (optional)
  • +
+

Return: <Object>

+
{
+ "integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CG
+}
+
+ +

``

+

Look up the wallet address and payment ID corresponding to an integrated address

+

Parameters:

+
    +
  • $integrated_address <string> Integrated address to split
    +Return: <Object>
  • +
+
{
+ "payment_id": "420fa29b2d9a49f5",
+ "standard_address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJ
+}
+
+ +

``

+

Stop the wallet, saving the state

+

No parameters

+

No return

+

``

+

Rescan the blockchain from scratch

+

No parameters

+

No return

+

``

+

Add notes to transactions
+ - $txids <array> Array of transaction IDs to note

+

Parameters:

+
    +
  • $notes <array> Array of notes (strings) to add
  • +
+

No return

+

``

+

Look up transaction note

+

Parameters:

+
    +
  • $txids <array> Array of transaction IDs (strings) to look up
  • +
+

Return:

+
Example: {
+ // TODO example
+}
+
+ +

``

+

Set a wallet option

+

Parameters:

+
    +
  • $key <string> Option to set
  • +
  • $value <string> Value to set
  • +
+

No return

+

``

+

Look up a wallet option

+

Parameters:

+
    +
  • $key <string> Wallet option to query
    +Return: <Object>
  • +
+
{
+ // TODO example
+}
+
+ +

``

+

Look up a transaction key

+

Parameters:

+
    +
  • `$txid <string> Transaction ID to look up
  • +
+

Return:

+
Example: {
+ "tx_key": "e8e97866b1606bd87178eada8f995bf96d2af3fec5db0bc570a451ab1d589b0f"
+}
+
+ +

``

+

Check a transaction key

+

Parameters:

+
    +
  • `$address <string> Address that sent transaction
  • +
  • `$txid <string> Transaction ID
  • +
  • `$tx_key <string> Transaction key
  • +
+

Return:

+
Example: {
+ "confirmations": 1,
+ "in_pool": ,
+ "received": 0
+}
+
+ +

``

+

Create proof (signature) of transaction

+

Parameters:

+
    +
  • $address <string> Address that spent funds
  • +
  • $txid <string> Transaction ID
    +Return: <Object>
  • +
+
{
+ "signature": "InProofV1Lq4nejMXxMnAdnLeZhHe3FGCmFdnSvzVM1AiGcXjngTRi4hfHPcDL9D4th7KUuvF9ZH
+}
+
+ +

``

+

Verify transaction proof

+

Parameters:

+
    +
  • $address <string> Address that spent funds
  • +
  • $txid <string> Transaction ID
  • +
  • $signature <string> Signature (tx_proof)
  • +
+

Return:

+
{
+ "confirmations": 2,
+ "good": 1,
+ "in_pool": ,
+ "received": 15752471409492,
+}
+
+ +

``

+

Create proof of a spend

+

Parameters:

+
    +
  • $txid <string> Transaction ID
    +Return: <Object>
  • +
+
{
+ "signature": "SpendProofV1RnP6ywcDQHuQTBzXEMiHKbe5ErzRAjpUB1h4RUMfGPNv4bbR6V7EFyiYkCrURwbb
+}
+
+ +

``

+

Verify spend proof

+

Parameters:

+
    +
  • $txid <string> Transaction ID
  • +
  • $signature <string> Spend proof to verify
    +Return: <Object>
  • +
+
{
+ "good": 1
+}
+
+ +

``

+

Create proof of reserves

+

Parameters:

+
    +
  • $account_index <string> Comma-separated list of account indices of which to prove
  • +
+

Return:

+
{
+ "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE111111111111AjsVgKzau88VxXVGA
+}
+
+ +

``

+

Verify a reserve proof

+

Parameters:

+
    +
  • $address <string> Wallet address
  • +
  • $signature <string> Reserve proof
    +Return: <Object>
  • +
+
{
+ "good": 1,
+ "spent": 0,
+ "total": 0
+}
+
+ +

``

+

Look up transfers

+

Parameters:

+
    +
  • $input_types <array> Array of transfer type strings; possible values include
  • +
  • $account_index <number> Index of account to look
  • +
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to look
  • +
  • $min_height <number> Minimum block height to use when looking up
  • +
  • $max_height <number> Maximum block height to use when looking up
    + OR
  • +
  • $inputs_types <object> Array containing any of the options listed above, where
    +Return: <Object>
  • +
+
{
+ "pool": [{
+   "amount": 500000000000,
+   "fee": 0,
+   "height": 0,
+   "note": "",
+   "payment_id": "758d9b225fda7b7f",
+   "timestamp": 1488312467,
+   "txid": "da7301d5423efa09fabacb720002e978d114ff2db6a1546f8b820644a1b96208",
+   "type": "pool"
+ }]
+}
+
+ +

``

+

Look up transaction by transaction ID

+

Parameters:

+
    +
  • $txid <string> Transaction ID to look up
  • +
  • $account_index <string> Index of account to query (optional)
  • +
+

Return: <Object>

+
{
+ "transfer": {
+   "amount": 10000000000000,
+   "fee": 0,
+   "height": 1316388,
+   "note": "",
+   "payment_id": "0000000000000000",
+   "timestamp": 1495539310,
+   "txid": "f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf",
+   "type": "in"
+ }
+}
+
+ +

``

+

Sign a string

+

Parameters:

+
    +
  • $data <string> Data to sign
    +Return: <Object>
  • +
+
{
+ "signature": "SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxv
+}
+
+ +

``

+

Verify a signature

+

Parameters:

+
    +
  • $data <string> Signed data
  • +
  • $address <string> Address that signed data
  • +
  • $signature <string> Signature to verify
  • +
+

Return:

+
$good       Verification status
+
+Export an array of signed key images
+
+*No parameters*
+
+
+Return:
+
+```json
+Example: {
+ // TODO example
+}
+
+ +

``

+

Import a signed set of key images

+

Parameters:

+
    +
  • $signed_key_images <array> Array of signed key images
    +Return: <Object>
  • +
+
{
+ // TODO example
+ height: ,
+ spent: ,
+ unspent:
+}
+
+ +

``

+

Create a payment URI using the official URI specification

+

Parameters:

+
    +
  • $address <string> Address to receive fuids
  • +
  • $amount <string> Amount of monero to request
  • +
  • $payment_id <string> Payment ID (optional)
  • +
  • $recipient_name <string> Name of recipient (optional)
  • +
  • $tx_description <string> Payment description (optional)
  • +
+

Return: <Object>

+
{
+ // TODO example
+}
+
+ +

``

+

Parse a payment URI

+

Parameters:

+
    +
  • $uri <string> Payment URI
    +Return: <Object>
  • +
+
{
+ "uri": {
+   "address": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VB
+   "amount": 10,
+   "payment_id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
+   "recipient_name": "Monero Project donation address",
+   "tx_description": "Testing out the make_uri function"
+ }
+}
+
+ +

``

+

Look up address book entries

+

Parameters:

+
    +
  • $entries <array> Array of address book entry indices to look up
  • +
+

Return:

+
Example: {
+ // TODO example
+}
+
+ +

``

+

Add entry to the address book

+

Parameters:

+
    +
  • $address <string> Address to add to address book
  • +
  • $payment_id <string> Payment ID to use with address in address book (optional)
  • +
  • $description <string> Description of address (optional)
  • +
+

Return:

+
$index        Index of address in address book
+
+Delete an entry from the address book
+ - `$index <array>` Index of the address book entry to remove
+
+*No return*
+
+#### ``
+
+Rescan the blockchain for spent outputs
+
+Parameters:
+
+
+Start mining
+ - `$threads_count <number>` Number of threads with which to mine
+ - `$do_background_mining <boolean>` Mine in backgound?
+ - `$ignore_battery <boolean>` Ignore battery?
+
+*No return*
+
+#### ``
+
+Stop mining
+
+*No parameters*
+
+
+*No return*
+
+#### ``
+
+Look up a list of available languages for your wallet's seed
+
+*No parameters*
+
+
+Return:
+
+```json
+List of available languages
+
+Create a new wallet
+ - `$filename <string>` Filename of new wallet to create
+ - `$password <string>` Password of new wallet to create
+ - `$language <string>` Language of new wallet to create
+
+*No return*
+
+#### ``
+
+Open a wallet
+
+Parameters:
+
+ - `$filename <string>` Filename of wallet to open
+ - `$password <string>` Password of wallet to open
+
+*No return*
+
+#### ``
+
+Check if wallet is multisig
+
+*No parameters*
+
+Return: `<Object>`
+
+```json
+(non-multisignature wallet) {
+ "multisig": ,
+ "ready": ,
+ "threshold": 0,
+ "total": 0
+} // TODO multisig wallet example
+
+Create information needed to create a multisignature wallet
+
+*No parameters*
+
+Return: `<Object>`
+
+```json
+{
+ "multisig_info": "MultisigV1WBnkPKszceUBriuPZ6zoDsU6RYJuzQTiwUqE5gYSAD1yGTz85vqZGetawVvioa
+}
+
+ +

``

+

Create a multisignature wallet

+

Parameters:

+
    +
  • $multisig_info <string> Multisignature information (from eg. prepare_multisig)
  • +
  • $threshold <string> Threshold required to spend from multisignature wallet
  • +
  • $password <string> Passphrase to apply to multisignature wallet
    +Return: <Object>
  • +
+
{
+ // TODO example
+}
+
+ +

``

+

Export multisignature information

+

No parameters

+

Return: <Object>

+
{
+ // TODO example
+}
+
+ +

``

+

Import mutlisignature information

+

Parameters:

+
    +
  • $info <string> Multisignature info (from eg. prepare_multisig)
  • +
+

Return:

+
{
+ // TODO example
+}
+
+ +

``

+

Finalize a multisignature wallet

+

Parameters:

+
    +
  • $multisig_info <string> Multisignature info (from eg. prepare_multisig)
  • +
  • $password <string> Multisignature info (from eg. prepare_multisig)
  • +
+

Return:

+
{
+ // TODO example
+}
+
+ +

``

+

Sign a multisignature transaction

+

Parameters:

+
    +
  • $tx_data_hex <string> Blob of transaction to sign
    +Return: <Object>
  • +
+
{
+ // TODO example
+}
+
+ +

``

+

Submit (relay) a multisignature transaction

+

Parameters:

+
    +
  • $tx_data_hex <string> Blob of transaction to submit
  • +
+

Return:

+
{
+ // TODO example
+}
+
+ +

``

+

Parameters:

+

getbans

+

Get list of banned IPs

+

No parameters

+
    +
  • $ <>
  • +
+

Return: <Object>

+
{
+  "bans": [{
+    "ip": 838969536,
+    "seconds": 1457748792
+  }],
+  "status": "OK"
+}
+
+ +

``

+

Credits

+

Parameters:

+

Written by the Monero Integrations team support@monerointegrations.com

+

Using work from:
+ - CryptoChangements [Monero_RPC] bW9uZXJv@gmail.com (https://github.com/cryptochangements34)
+ - Serhack [Monero Integrations] nico@serhack.me (https://serhack.me)
+ - TheKoziTwo [xmr-integration] thekozitwo@gmail.com
+ - Kacper Rowinski [jsonRPCClient] krowinski@implix.com

\ No newline at end of file diff --git a/docs/walletRPC.md b/docs/walletRPC.md new file mode 100644 index 0000000..76cf08e --- /dev/null +++ b/docs/walletRPC.md @@ -0,0 +1,1125 @@ +# `walletRPC` class + +[`src/walletRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/walletRPC.php) + +A class for making calls to monero-wallet-rpc using PHP + +Parameters: + + - `$host ` monero-wallet-rpc hostname *(optional)* + - `$port ` monero-wallet-rpc port *(optional)* + - `$protocol ` monero-wallet-rpc protocol (eg. 'http') *(optional)* + - `$user ` monero-wallet-rpc RPC username *(optional)* + - `$password ` monero-wallet-rpc RPC passphrase *(optional)* + +### Methods + + - [`_transform`](#_transform) + - [`get_balance`](#get_balance) + - [`get_address`](#get_address) + - [`create_address`](#create_address) + - [`label_address`](#label_address) + - [`get_accounts`](#get_accounts) + - [`create_account`](#create_account) + - [`label_account`](#label_account) + - [`get_account_tags`](#get_account_tags) + - [`tag_accounts`](#tag_accounts) + - [`untag_accounts`](#untag_accounts) + - [`set_account_tag_description`](#set_account_tag_description) + - [`get_height`](#get_height) + - [`transfer`](#transfer) + - [`transfer_split`](#transfer_split) + - [`sweep_dust`](#sweep_dust) + - [`sweep_unmixable`](#sweep_unmixable) + - [`sweep_all`](#sweep_all) + - [`sweep_single`](#sweep_single) + - [`relay_tx`](#relay_tx) + - [`store`](#store) + - [`get_payments`](#get_payments) + - [`get_bulk_payments`](#get_bulk_payments) + - [`incoming_transfers`](#incoming_transfers) + - [`query_key`](#query_key) + - [`view_key`](#view_key) + - [`spend_key`](#spend_key) + - [`mnemonic`](#mnemonic) + - [`make_integrated_address`](#make_integrated_address) + - [`split_integrated_address`](#split_integrated_address) + - [`stop_wallet`](#stop_wallet) + - [`rescan_blockchain`](#rescan_blockchain) + - [`set_tx_notes`](#set_tx_notes) + - [`get_tx_notes`](#get_tx_notes) + - [`set_attribute`](#set_attribute) + - [`get_attribute`](#get_attribute) + - [`get_tx_key`](#get_tx_key) + - [`check_tx_key`](#check_tx_key) + - [`get_tx_proof`](#get_tx_proof) + - [`check_tx_proof`](#check_tx_proof) + - [`get_spend_proof`](#get_spend_proof) + - [`check_spend_proof`](#check_spend_proof) + - [`get_reserve_proof`](#get_reserve_proof) + - [`check_reserve_proof`](#check_reserve_proof) + - [`get_transfers`](#get_transfers) + - [`get_transfer_by_txid`](#get_transfer_by_txid) + - [`sign`](#sign) + - [`verify`](#verify) + - [`export_key_images`](#export_key_images) + - [`import_key_images`](#import_key_images) + - [`make_uri`](#make_uri) + - [`parse_uri`](#parse_uri) + - [`get_address_book`](#get_address_book) + - [`add_address_book`](#add_address_book) + - [`delete_address_book`](#delete_address_book) + - [`rescan_spent`](#rescan_spent) + - [`start_mining`](#start_mining) + - [`stop_mining`](#stop_mining) + - [`get_languages`](#get_languages) + - [`create_wallet`](#create_wallet) + - [`open_wallet`](#open_wallet) + - [`is_multisig`](#is_multisig) + - [`prepare_multisig`](#prepare_multisig) + - [`make_multisig`](#make_multisig) + - [`export_multisig_info`](#export_multisig_info) + - [`import_multisig_info`](#import_multisig_info) + - [`finalize_multisig`](#finalize_multisig) + - [`sign_multisig`](#sign_multisig) + - [`submit_multisig`](#submit_multisig) + +#### `_transform` + +Convert from moneroj to tacoshi (piconero) + +Parameters: + + - `$method ` Amount (in monero) to transform to tacoshi (piconero) *(optional)* + +Return: `` + +#### `get_balance` + +Look up an account's balance + +Parameters: + + - `$account_index ` Index of account to look up *( + optional)* + +Return: `` + +```json +{ + "balance": 140000000000, + "unlocked_balance": 50000000000 +} +``` + +Alias: `getbalance` + +#### `get_address` + +Look up wallet address(es) + +Parameters: + + - `$account_index ` Index of account to look up *(optional)* + - `$address_index ` Index of subaddress to look up *(optional)* + +Return: `` + +```json +{ + "address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATS", + "addresses": [ + { + "address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH", + "address_index": 0, + "label": "Primary account", + "used": true + }, { + "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7w", + "address_index": 1, + "label": "", + "used": true + } + ] +} +``` + +Alias: `getaddress` + +#### `create_address` + +Create a new subaddress + +Parameters: + + - `$account_index ` The subaddress account index + - `$label ` A label to the new subaddress + +Return: `` + +```json +{ + "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSC", + "address_index": 1 +} +``` + +#### `label_address` + +Label a subaddress + +Parameters: + + - `$index ` The index of the subaddress to label + - `$label ` The label to apply + +#### `get_accounts` + +Look up wallet accounts + +Return: `` + +```json +{ + "subaddress_accounts": { + "0": { + "account_index": 0, + "balance": 2808597352948771, + "base_address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnR", + "label": "Primary account", + "tag": "", + "unlocked_balance": 2717153096298162 + }, + "1": { + "account_index": 1, + "balance": 0, + "base_address": "BcXKsfrvffKYVoNGN4HUFfaruAMRdk5DrLZDmJBnYgXrTFrXyudn81xMj7rsmU5P9dX56", + "label": "Secondary account", + "tag": "", + "unlocked_balance": 0 + }, + "total_balance": 2808597352948771, + "total_unlocked_balance": 2717153096298162 +} +``` + +#### `create_account` + +Create a new account + +Parameters: + + - `$label ` Label to apply to new account + +#### `label_account` + +Label an account + +Parameters: + + - `$account_index ` Index of account to label + - `$label ` Label to apply + +#### `get_account_tags` + +Look up account tags + +Return: `` + +```json +{ + "account_tags": { + "0": { + "accounts": { + "0": 0, + "1": 1 + }, + "label": "", + "tag": "Example tag" + } + } +} +``` + +#### `tag_accounts` + +Tag accounts + +Parameters: + + - `$accounts ` The indices of the accounts to tag + - `$tag ` Tag to apply + +#### `untag_accounts` + +Untag accounts + +Parameters: + + - `$accounts ` The indices of the accounts to untag + +#### `set_account_tag_description` + +Describe a tag + +Parameters: + + - `$tag ` Tag to describe + - `$description ` Description to apply to tag + +Return: `` + +[//]: # (TODO example) + +#### `get_height` + +Look up how many blocks are in the longest chain known to the wallet + +Return: `` + +```json +{ + "height": 994310 +} +``` + +Alias: `getheight` + +#### `transfer` + +Send monero + +Parameters can be passed in individually (as listed below) or as an object/dictionary (as as listed below) or as an object/dictionary (as listed at bottom) + +To send to multiple recipients, use the object/dictionary (bottom) format and pass an array of recipient addresses and amount arrays in the destinations field (as in "destinations = [['amount' => 1, 'address' => ...], ['amount' => 2, 'address' => ...]]") + +Parameters: + + - `$amount ` Amount of monero to send + - `$address ` Address to receive funds + - `$payment_id ` Payment + - `$mixin ` Mixin number (ringsize - 1) + - `$account_index ` Account to send + - `$subaddr_indices ` Comma-separeted list of subaddress indices to spend + - `$priority ` Transaction + - `$unlock_time ` UNIX time or block height to unlock + - `$do_not_relay ` Do not relay + + *or* + + - `$params ` Array containing any of the options listed above, where only amount and address or a destionarions array are required + +Return: `` + +```json +{ + "amount": "1000000000000", + "fee": "1000020000", + "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db", + "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04" +} +``` + +#### `transfer_split` + +Same as transfer, but splits transfer into more than one transaction if necessary + +Return: `` + +[//]: # (TODO example) + +#### `sweep_dust` + +Send all dust outputs back to the wallet + +Return: `` + +[//]: # (TODO example) + +#### `sweep_unmixable` + +Send all unmixable outputs back to the wallet + +Return: `` + +[//]: # (TODO example) + +#### `sweep_all` + +Send all unlocked outputs from an account to an address + +Parameters: + + - `$address ` Address to receive funds + - `$subaddr_indices ` Comma-seperated list of subaddress indices to sweep *(optional)* + - `$account_index ` Index of the account to sweep *(optional)* + - `$payment_id ` Payment ID *(optional)* + - `$mixin ` Mixin number (ringsize - 1) *(optional)* + - `$priority ` Payment ID *(optional)* + - `$below_amount ` Only send outputs below this amount *(optional)* + - `$unlock_time ` UNIX time or block height to unlock output *(optional)* + - `$do_not_relay ` Do not relay transaction *(optional)* + + *or* + + - `$params ` Array containing any of the options listed above, where only address is required + +Return: `` + +```json +{ + "amount": "1000000000000", + "fee": "1000020000", + "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db", + "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04" +} +``` + +#### `sweep_single` + +Sweep a single key image to an address + +Parameters: + + - `$key_image ` Key image to sweep + - `$address ` Address to receive funds + - `$payment_id ` Payment ID *(optional)* + - `$below_amount ` Only send outputs below this amount *(optional)* + - `$mixin ` Mixin number (ringsize - 1) *(optional)* + - `$priority ` Payment ID *(optional)* + - `$unlock_time ` UNIX time or block height to unlock output *(optional)* + - `$do_not_relay ` Do not relay transaction *(optional)* + + *or* + + - `$params ` Array containing any of the options listed above, where +Return: `` + +```json +{ + "amount": "1000000000000", + "fee": "1000020000", + "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db", + "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04" +} +``` + +#### `relay_tx` + +Relay a transaction + +Parameters: + + - `$hex ` Blob of transaction to relay + +Return: `` + +[//]: # (TODO example) + +#### `store` + +Save wallet + +[//]: # (TODO example) + +#### `get_payments` + +Look up incoming payments by payment ID + +Parameters: + + - `$payment_id ` Payment ID to look up + +Return: `` + +```json +{ + "payments": [{ + "amount": 10350000000000, + "block_height": 994327, + "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030", + "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", + "unlock_time": 0 + }] +} +``` + +#### `get_bulk_payments` + +Look up incoming payments by payment ID (or a list of payments IDs) from a given height + +Parameters: + + - `$payment_ids ` Array of payment IDs to look up + - `$min_block_height ` Height to begin search + +Return: `` + +```json +{ + "payments": [{ + "amount": 10350000000000, + "block_height": 994327, + "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030", + "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", + "unlock_time": 0 + }] +} +``` + +#### `incoming_transfers` + +Look up incoming transfers + +Parameters: + + - `$type ` Type of transfer to look up; must be 'all', 'available', or 'unavailable' (incoming transfers which have already been spent) + - `$account_index ` Index of account to look up *(optional)* + - `$subaddr_indices ` Comma-seperated list of subaddress indices to look up *(optional)* + +Return: `` + +```json +{ + "transfers": [{ + "amount": 10000000000000, + "global_index": 711506, + "spent": false, + "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", + "tx_size": 5870 + },{ + "amount": 300000000000, + "global_index": 794232, + "spent": false, + "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", + "tx_size": 5870 + },{ + "amount": 50000000000, + "global_index": 213659, + "spent": false, + "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1", + "tx_size": 5870 + }] +} +``` + +#### `query_key` + +Look up a wallet key + +Parameters: + + - `$key_type ` Type of key to look up; must be 'view_key', 'spend_key', or 'mnemonic' + +Return: `` + +```json +{ + "key": "7e341d..." +} +``` + +#### `view_key` + +Look up wallet view key + +Return: `` + +```json +{ + "key": "7e341d..." +} +``` + +#### `spend_key` + +Look up wallet spend key + +Return: `` + +```json +{ + "key": "2ab810..." +} +``` + +#### `mnemonic` + +Look up wallet mnemonic seed + +Return: `` + +```json +{ + "key": "2ab810..." +} +``` + +#### `make_integrated_address` + +Create an integrated address from a given payment ID + +Parameters: + + - `$payment_id ` Payment ID *(optional)* + +Return: `` + +```json +{ + "integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CG +} +``` + +#### `split_integrated_address` + +Look up the wallet address and payment ID corresponding to an integrated address + +Parameters: + + - `$integrated_address ` Integrated address to split + +Return: `` + +```json +{ + "payment_id": "420fa29b2d9a49f5", + "standard_address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJ +} +``` + +#### `stop_wallet` + +Stop the wallet, saving the state + +#### `rescan_blockchain` + +Rescan the blockchain from scratch + +#### `set_tx_notes` + +Add notes to transactions + + - `$txids ` Array of transaction IDs to note + +Parameters: + + - `$notes ` Array of notes (strings) to add + +#### `get_tx_notes` + +Look up transaction note + +Parameters: + + - `$txids ` Array of transaction IDs (strings) to look up + +Return: `` + +[//]: # (TODO example) + +#### `set_attribute` + +Set a wallet option + +Parameters: + + - `$key ` Option to set + - `$value ` Value to set + +#### `get_attribute` + +Look up a wallet option + +Parameters: + + - `$key ` Wallet option to query +Return: `` + +[//]: # (TODO example) + +#### `get_tx_key` + +Look up a transaction key + +Parameters: + + - `$txid ` Transaction ID to look up + +Return: + +```json +Example: { + "tx_key": "e8e97866b1606bd87178eada8f995bf96d2af3fec5db0bc570a451ab1d589b0f" +} +``` + +#### `check_tx_key` + +Check a transaction key + +Parameters: + + - `$address ` Address that sent transaction + - `$txid ` Transaction ID + - `$tx_key ` Transaction key + +Return: + +```json +Example: { + "confirmations": 1, + "in_pool": , + "received": 0 +} +``` + +#### `get_tx_proof` + +Create proof (signature) of transaction + +Parameters: + + - `$address ` Address that spent funds + - `$txid ` Transaction ID +Return: `` + +```json +{ + "signature": "InProofV1Lq4nejMXxMnAdnLeZhHe3FGCmFdnSvzVM1AiGcXjngTRi4hfHPcDL9D4th7KUuvF9ZH +} +``` + +#### `check_tx_proof` + +Verify transaction proof + +Parameters: + + - `$address ` Address that spent funds + - `$txid ` Transaction ID + - `$signature ` Signature (tx_proof) + +Return: + +```json +{ + "confirmations": 2, + "good": 1, + "in_pool": , + "received": 15752471409492, +} +``` + +#### `get_spend_proof` + +Create proof of a spend + +Parameters: + + - `$txid ` Transaction ID + +Return: `` + +```json +{ + "signature": "SpendProofV1RnP6ywcDQHuQTBzXEMiHKbe5ErzRAjpUB1h4RUMfGPNv4bbR6V7EFyiYkCrURwbb +} +``` + +#### `check_spend_proof` + +Verify spend proof + +Parameters: + + - `$txid ` Transaction ID + - `$signature ` Spend proof to verify + +Return: `` + +```json +{ + "good": 1 +} +``` + +#### `get_reserve_proof` + +Create proof of reserves + +Parameters: + + - `$account_index ` Comma-separated list of account indices of which to prove + +Return: + +```json +{ + "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE111111111111AjsVgKzau88VxXVGA +} +``` + +#### `check_reserve_proof` + +Verify a reserve proof + +Parameters: + + - `$address ` Wallet address + - `$signature ` Reserve proof + +Return: `` + +```json +{ + "good": 1, + "spent": 0, + "total": 0 +} +``` + +#### `get_transfers` + +Look up transfers + +Parameters: + + - `$input_types ` Array of transfer type strings; possible values include 'all', in', 'out', 'pending', 'failed', and 'pool' *(optional)* + - `$account_index ` Index of account to look *(optional)* + - `$subaddr_indices ` Comma-seperated list of subaddress indices to look up *(optional)* + - `$min_height ` Minimum block height to use when looking up *(optional)* + - `$max_height ` Maximum block height to use when looking up *(optional)* + + *or* + + - `$inputs_types ` Array containing any of the options listed above, where only an input types array is required + +Return: `` + +```json +{ + "pool": [{ + "amount": 500000000000, + "fee": 0, + "height": 0, + "note": "", + "payment_id": "758d9b225fda7b7f", + "timestamp": 1488312467, + "txid": "da7301d5423efa09fabacb720002e978d114ff2db6a1546f8b820644a1b96208", + "type": "pool" + }] +} +``` + +#### `get_transfer_by_txid` + +Look up transaction by transaction ID + +Parameters: + + - `$txid ` Transaction ID to look up + - `$account_index ` Index of account to query *(optional)* + +Return: `` + +```json +{ + "transfer": { + "amount": 10000000000000, + "fee": 0, + "height": 1316388, + "note": "", + "payment_id": "0000000000000000", + "timestamp": 1495539310, + "txid": "f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf", + "type": "in" + } +} +``` + +#### `sign` + +Sign a string + +Parameters: + + - `$data ` Data to sign + +Return: `` + +```json +{ + "signature": "SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxv +} +``` + +#### `verify` + +Verify a signature + +Parameters: + + - `$data ` Signed data + - `$address ` Address that signed data + - `$signature ` Signature to verify + +Return: + +```json +{ + "good": true +} +``` + +#### `export_key_images` + +Export an array of signed key images + +Return: `` + +[//]: # (TODO example) + +#### `import_key_images` + +Import a signed set of key images + +Parameters: + + - `$signed_key_images ` Array of signed key images + +Return: + +```json +{ + // TODO example + height: , + spent: , + unspent: +} +``` + +#### `make_uri` + +Create a payment URI using the official URI specification + +Parameters: + + - `$address ` Address to receive fuids + - `$amount ` Amount of monero to request + - `$payment_id ` Payment ID *(optional)* + - `$recipient_name ` Name of recipient *(optional)* + - `$tx_description ` Payment description *(optional)* + +Return: `` + +[//]: # (TODO example) + +#### `parse_uri` + +Parse a payment URI + +Parameters: + + - `$uri ` Payment URI + +Return: `` + +```json +{ + "uri": { + "address": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VB + "amount": 10, + "payment_id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", + "recipient_name": "Monero Project donation address", + "tx_description": "Testing out the make_uri function" + } +} +``` + +#### `get_address_book` + +Look up address book entries + +Parameters: + + - `$entries ` Array of address book entry indices to look up + +Return: `` + +[//]: # (TODO example) + +#### `add_address_book` + +Add entry to the address book + +Parameters: + + - `$address ` Address to add to address book + - `$payment_id ` Payment ID to use with address in address book *(optional)* + - `$description ` Description of address *(optional)* + +Return: `` + +[//]: # (TODO example) + +#### `delete_address_book` + +Delete an entry from the address book + +Parameters: + + - `$index ` Index of the address book entry to remove + +#### `rescan_spent` + +Rescan the blockchain for spent outputs + +#### `start_mining` + +Start mining + + - `$threads_count ` Number of threads with which to mine + - `$do_background_mining ` Mine in backgound? + - `$ignore_battery ` Ignore battery? + +#### `stop_mining` + +Stop mining + +#### `get_languages` + +Look up a list of available languages for your wallet's seed + +Return: `` + +[//]: # (TODO example) + +#### `create_wallet` + +Create a new wallet + + - `$filename ` Filename of new wallet to create + - `$password ` Password of new wallet to create + - `$language ` Language of new wallet to create + +#### `open_wallet` + +Open a wallet + +Parameters: + + - `$filename ` Filename of wallet to open + - `$password ` Password of wallet to open + +#### `is_multisig` + +Check if wallet is multisig + +Return: `` + +[//]: # (TODO multisig wallet example) + +Non-multisignature wallet return: + +```json +{ + "multisig": , + "ready": , + "threshold": 0, + "total": 0 +} +``` + +#### `prepare_multisig` + +Create information needed to create a multisignature wallet + +Return: `` + +```json +{ + "multisig_info": "MultisigV1WBnkPKszceUBriuPZ6zoDsU6RYJuzQTiwUqE5gYSAD1yGTz85vqZGetawVvioa +} +``` + +#### `make_multisig` + +Create a multisignature wallet + +Parameters: + + - `$multisig_info ` Multisignature information (from eg. prepare_multisig) + - `$threshold ` Threshold required to spend from multisignature wallet + - `$password ` Passphrase to apply to multisignature wallet + +Return: `` + +[//]: # (TODO example) + +#### `export_multisig_info` + +Export multisignature information + +Return: `` + +[//]: # (TODO example) + +#### `import_multisig_info` + +Import mutlisignature information + +Parameters: + + - `$info ` Multisignature info (from eg. prepare_multisig) + +Return: `` + +[//]: # (TODO example) + +#### `finalize_multisig` + +Finalize a multisignature wallet + +Parameters: + + - `$multisig_info ` Multisignature info (from eg. prepare_multisig) + - `$password ` Multisignature info (from eg. prepare_multisig) + +Return: `` + +[//]: # (TODO example) + +#### `sign_multisig` + +Sign a multisignature transaction + +Parameters: + + - `$tx_data_hex ` Blob of transaction to sign + +Return: `` + +[//]: # (TODO example) + +#### `submit_multisig` + +Submit (relay) a multisignature transaction + +Parameters: + + - `$tx_data_hex ` Blob of transaction to submit + +Return: `` + +[//]: # (TODO example) + +### Credits + +Written by the [Monero Integrations team](https://github.com/monero-integrations/monerophp/graphs/contributors) () + +Using work from: + - CryptoChangements [Monero_RPC] () (https://github.com/cryptochangements34) + - Serhack [Monero Integrations] () (https://serhack.me) + - TheKoziTwo [xmr-integration] () + - Kacper Rowinski [jsonRPCClient] () diff --git a/example.php b/example.php index 566b1cf..bdf8f63 100644 --- a/example.php +++ b/example.php @@ -27,8 +27,8 @@ require_once('src/walletRPC.php'); $walletRPC = new walletRPC('127.0.0.1', 28083); // Change to match your wallet (monero-wallet-rpc) IP address and port; 18083 is the customary port for mainnet, 28083 for testnet, 38083 for stagenet -$create_wallet = $walletRPC->create_wallet('monero_wallet', ''); // Creates a new wallet named monero_wallet with no passphrase. Comment this line and edit the next line to use your own wallet -$open_wallet = $walletRPC->open_wallet('monero_wallet', ''); +// $create_wallet = $walletRPC->create_wallet('multisig_wallet5', ''); // Creates a new wallet named monero_wallet with no passphrase. Comment this line and edit the next line to use your own wallet +$open_wallet = $walletRPC->open_wallet('multisig_wallet4', ''); $get_address = $walletRPC->get_address(); $get_accounts = $walletRPC->get_accounts(); $get_balance = $walletRPC->get_balance(); @@ -44,6 +44,15 @@ // $incoming_transfers = $walletRPC->incoming_transfers('all'); // $mnemonic = $walletRPC->mnemonic(); +// $test = $walletRPC->prepare_multisig(); +// print_r($test); + +// 1 +// 2 +// 3 +// 4 MultisigV1faCYKpgh2E74sjJXy1Cpfb4cctTkxGNTSPyLaA8veYBxQJ2VFWyVRZZdXDwVHR1K37a5Y5i5Z7nrXNrzq1k7Sy3yBrtioSW7NbqAZm1aD7zZwNGD6eboNiC8MebnBw7UmB8sRrDanBdSz9HWfq8R6KoVf9hxjXYokUP2dhkXc8yBK7aA +// 5 MultisigV1ZVegfjMqnm2GuUH8p2jcK5N2KYJCV7758W1ddwPcxYjed2agdpwquKuX9BWxpvB54YCkGtwzzgxZ77bT7hf4yX9PJQknc94ZGiZXRGRGXBZ1UmUGwd8QfTWUm9QWgnKaFPjtBkhGRh2GT6SMW5nb7WnnHqVfXeFsnD6VxQ5nwq9sm6df + ?> diff --git a/src/base58.php b/src/base58.php index e0c1604..291dd7d 100644 --- a/src/base58.php +++ b/src/base58.php @@ -1,17 +1,34 @@ (https://github.com/monero-integrations) + * @copyright 2018 + * @license MIT + * + * ============================================================================ + * + * // Initialize class + * $base58 = new base58(); + * + * // Encode a hexadecimal (base16) string as base58 + * $encoded = $base58->encode('0137F8F06C971B168745F562AA107B4D172F336271BC0F9D3B510C14D3460DFB27D8CEBE561E73AC1E11833D5EA40200EB3C82E9C66ACAF1AB1A6BB53C40537C0B7A22160B0E'); + * + * // Decode + * $decoded = $base58->decode('479cG5opa54beQWSyqNoWw5tna9sHUNmMTtiFqLPaUhDevpJ2YLwXAggSx5ePdeFrYF8cdbmVRSmp1Kn3t4Y9kFu7rZ7pFw'); * */ -class base58 { - /** - * @var string - */ +class base58 +{ static $alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; static $encoded_block_sizes = [0, 2, 3, 5, 6, 7, 9, 10, 11]; static $full_block_size = 8; @@ -22,10 +39,12 @@ class base58 { * Convert a hexadecimal string to a binary array * * @param string $hex A hexadecimal string to convert to a binary array + * * @return array * */ - private function hex_to_bin($hex) { + private function hex_to_bin($hex) + { if (gettype($hex) != 'string') { throw new Exception('base58->hex_to_bin(): Invalid input type (must be a string)'); } @@ -45,10 +64,12 @@ private function hex_to_bin($hex) { * Convert a binary array to a hexadecimal string * * @param array $bin A binary array to convert to a hexadecimal string + * * @return string * */ - private function bin_to_hex($bin) { + private function bin_to_hex($bin) + { if (gettype($bin) != 'array') { throw new Exception('base58->bin_to_hex(): Invalid input type (must be an array)'); } @@ -65,10 +86,12 @@ private function bin_to_hex($bin) { * Convert a string to a binary array * * @param string $str A string to convert to a binary array + * * @return array * */ - private function str_to_bin($str) { + private function str_to_bin($str) + { if (gettype($str) != 'string') { throw new Exception('base58->str_to_bin(): Invalid input type (must be a string)'); } @@ -85,10 +108,12 @@ private function str_to_bin($str) { * Convert a binary array to a string * * @param array $bin A binary array to convert to a string + * * @return string * */ - private function bin_to_str($bin) { + private function bin_to_str($bin) + { if (gettype($bin) != 'array') { throw new Exception('base58->bin_to_str(): Invalid input type (must be an array)'); } @@ -105,10 +130,12 @@ private function bin_to_str($bin) { * Convert a UInt8BE (one unsigned big endian byte) array to UInt64 * * @param array $data A UInt8BE array to convert to UInt64 + * * @return number * */ - private function uint8_be_to_64($data) { + private function uint8_be_to_64($data) + { if (gettype($data) != 'array') { throw new Exception ('base58->uint8_be_to_64(): Invalid input type (must be an array)'); } @@ -116,7 +143,7 @@ private function uint8_be_to_64($data) { $res = 0; $i = 0; switch (9 - count($data)) { - case 1: + case 1: $res = bcadd(bcmul($res, bcpow(2, 8)), $data[$i++]); case 2: $res = bcadd(bcmul($res, bcpow(2, 8)), $data[$i++]); @@ -145,10 +172,12 @@ private function uint8_be_to_64($data) { * * @param number $num A UInt64 number to convert to a UInt8BE array * @param integer $size Size of array to return + * * @return array * */ - private function uint64_to_8_be($num, $size) { + private function uint64_to_8_be($num, $size) + { if (gettype($num) != ('integer' || 'double')) { throw new Exception ('base58->uint64_to_8_be(): Invalid input type ($num must be a number)'); } @@ -166,18 +195,20 @@ private function uint64_to_8_be($num, $size) { } return $res; } - + /** * * Convert a hexadecimal (Base16) array to a Base58 string * * @param array $data * @param array $buf - * @param number $index + * @param number $index + * * @return array * */ - private function encode_block($data, $buf, $index) { + private function encode_block($data, $buf, $index) + { if (gettype($data) != 'array') { throw new Exception('base58->encode_block(): Invalid input type ($data must be an array)'); } @@ -207,10 +238,12 @@ private function encode_block($data, $buf, $index) { * Encode a hexadecimal (Base16) string to Base58 * * @param string $hex A hexadecimal (Base16) string to convert to Base58 + * * @return string * */ - public function encode($hex) { + public function encode($hex) + { if (gettype($hex) != 'string') { throw new Exception ('base58->encode(): Invalid input type (must be a string)'); } @@ -239,7 +272,7 @@ public function encode($hex) { return self::bin_to_str($res); } - + /** * * Convert a Base58 input to hexadecimal (Base16) @@ -247,10 +280,12 @@ public function encode($hex) { * @param array $data * @param array $buf * @param integer $index + * * @return array * */ - private function decode_block($data, $buf, $index) { + private function decode_block($data, $buf, $index) + { if (gettype($data) != 'array') { throw new Exception('base58->decode_block(): Invalid input type ($data must be an array)'); } @@ -285,7 +320,7 @@ private function decode_block($data, $buf, $index) { if ($res_size < self::$full_block_size && bcpow(2, 8 * $res_size) <= 0) { throw new Exception('base58->decode_block(): Integer overflow (bcpow(2, 8 * $res_size) exceeds the maximum 64bit integer)'); } - + $tmp_buf = self::uint64_to_8_be($res_num, $res_size); for ($i = 0; $i < count($tmp_buf); $i++) { $buf[$i + $index] = $tmp_buf[$i]; @@ -298,10 +333,12 @@ private function decode_block($data, $buf, $index) { * Decode a Base58 string to hexadecimal (Base16) * * @param string $hex A Base58 string to convert to hexadecimal (Base16) + * * @return string * */ - public function decode($enc) { + public function decode($enc) + { if (gettype($enc) != 'string') { throw new Exception ('base58->decode(): Invalid input type (must be a string)'); } @@ -335,10 +372,12 @@ public function decode($enc) { * * @param array $haystack An array to search * @param string $needle A string to search for + *) * @return number The index of the element found (or -1 for no match) * */ - private function index_of($haystack, $needle) { + private function index_of($haystack, $needle) + { if (gettype($haystack) != 'array') { throw new Exception ('base58->decode(): Invalid input type ($haystack must be an array)'); } diff --git a/src/daemonRPC.php b/src/daemonRPC.php index 06957fc..ffdb03f 100644 --- a/src/daemonRPC.php +++ b/src/daemonRPC.php @@ -21,7 +21,7 @@ * * // See example.php for more examples * - * // Initialize Monero connection/object + * // Initialize class * $daemonRPC = new daemonRPC(); * * // Examples: @@ -50,7 +50,7 @@ class daemonRPC * @param string $host Monero daemon IP hostname (optional) * @param int $port Monero daemon port (optional) * @param string $protocol Monero daemon protocol (eg. 'http') (optional) - * @param string $user Moenro daemon RPC username (optional) + * @param string $user Monero daemon RPC username (optional) * @param string $password Monero daemon RPC passphrase (optional) * */ @@ -102,7 +102,7 @@ public function getblockcount() * * Look up a block's hash by its height * - * @param array $height Height of block to look up + * @param number $height Height of block to look up * * @return string Example: 'e22cf75f39ae720e8b71b3d120a5ac03f0db50bba6379e2850975b4859190bc6' * @@ -154,7 +154,7 @@ public function submitblock($block) /** * - * Look up a block header for the latest block in the longest chain known to the node + * Look up the block header of the latest block in the longest chain known to the node * * @param none * @@ -245,7 +245,7 @@ public function getblockheaderbyheight($height) * * Look up block information by SHA256 hash * - * @param string SHA256 hash of block + * @param string $hash SHA256 hash of block * * @return object Example: { * "blob": "...", @@ -413,7 +413,7 @@ public function hardfork_info() * * Ban another node by IP * - * @param none + * @param string $ip IP address of node to ban * * @return object Example: { * "status": "OK" diff --git a/src/walletRPC.php b/src/walletRPC.php index 1da76a4..71c3f9b 100644 --- a/src/walletRPC.php +++ b/src/walletRPC.php @@ -20,7 +20,7 @@ * * // See example.php for more examples * - * // Initialize Monero connection/object + * // Initialize class * $walletRPC = new walletRPC(); * * // Examples: @@ -49,8 +49,8 @@ class walletRPC * @param string $host monero-wallet-rpc hostname (optional) * @param int $port monero-wallet-rpc port (optional) * @param string $protocol monero-wallet-rpc protocol (eg. 'http') (optional) - * @param string $user monero-wallet-rpc RPC username (optional) - * @param string $password monero-wallet-rpc RPC passphrase (optional) + * @param string $user monero-wallet-rpc username (optional) + * @param string $password monero-wallet-rpc passphrase (optional) * */ function __construct ($host = '127.0.0.1', $port = 18083, $protocol = 'http', $user = null, $password = null) @@ -154,18 +154,18 @@ public function getbalance($account_index = 0) * @param number $address_index Index of subaddress to look up (optional) * * @return object Example: { - * address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATSiHHrDzcSFqHpARF', - * addresses: [ + * "address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATSiHHrDzcSFqHpARF", + * "addresses": [ * { - * address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATSiHHrDzcSFqHpARF', - * address_index: 0, - * label: 'Primary account', - * used: true + * "address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATSiHHrDzcSFqHpARF", + * "address_index": 0, + * "label": "Primary account", + * "used": true * }, { - * address: 'Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSCo9eLoGgbAFJQaAaDS', - * address_index: 1, - * label: '', - * used: true + * "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSCo9eLoGgbAFJQaAaDS", + * "address_index": 1, + * "label": "", + * "used": true * } * ] * } @@ -200,7 +200,7 @@ public function getaddress($account_index = 0, $address_index = 0) * Create a new subaddress * * @param number $account_index The subaddress account index - * @param string $label The label to use + * @param string $label A label to apply to the new subaddress * * @return object Example: { * "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSCo9eLoGgbAFJQaAaDS" @@ -256,7 +256,7 @@ public function label_address($index, $label) * "base_address": "BcXKsfrvffKYVoNGN4HUFfaruAMRdk5DrLZDmJBnYgXrTFrXyudn81xMj7rsmU5P9dX56kRZGqSaigUxUYoaFETo9gfDKx5", * "label": "Secondary account", * "tag": "", - * "unlocked_balance": 0 ) + * "unlocked_balance": 0 * }, * "total_balance": 2808597352948771, * "total_unlocked_balance": 2717153096298162 @@ -272,7 +272,7 @@ public function get_accounts() * * Create a new account * - * @param string The label to use apply + * @param string $label Label to apply to new account * * @return none * @@ -336,7 +336,7 @@ public function get_account_tags() * * Tag accounts * - * @param array $accounts The indeices of the accounts to tag + * @param array $accounts The indices of the accounts to tag * @param string $tag Tag to apply * * @return none @@ -604,7 +604,7 @@ public function transfer_split($amount, $address = '', $payment_id = '', $mixin * @param none * * @return object Example: { - * "multisig_txset": [] + * // TODO example * } * */ @@ -620,7 +620,7 @@ public function sweep_dust() * @param none * * @return object Example: { - * "multisig_txset": [] + * // TODO example * } * */ @@ -797,6 +797,10 @@ public function relay_tx($hex) * * Save wallet * + * @param none + * + * @return object Example: + * */ public function store() { @@ -1372,7 +1376,9 @@ public function sign($data) * @param string $address Address that signed data * @param string $signature Signature to verify * - * @return boolean $good Verification status + * @return object Example: { + * "good": true + * } * */ public function verify($data, $address, $signature) @@ -1467,7 +1473,7 @@ public function parse_uri($uri) * * @param array $entries Array of address book entry indices to look up * - * @return boject Example: { + * @return object Example: { * // TODO example * } * @@ -1486,7 +1492,9 @@ public function get_address_book($entries) * @param string $payment_id Payment ID to use with address in address book (optional) * @param string $description Description of address (optional) * - * @return number $index Index of address in address book + * @return object Example: { + * // TODO example + * } * */ public function add_address_book($address, $payment_id, $description) @@ -1557,7 +1565,9 @@ public function stop_mining() * * @param none * - * @return array List of available languages + * @return object Example: { + * // TODO example + * } * */ public function get_languages() From 5a11444d7ae9264034e6c715d1ed93ad173b7916 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 22:48:08 -0700 Subject: [PATCH 05/10] stub ed25519 docs --- docs/ed25519.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/ed25519.md diff --git a/docs/ed25519.md b/docs/ed25519.md new file mode 100644 index 0000000..3e23212 --- /dev/null +++ b/docs/ed25519.md @@ -0,0 +1,29 @@ +# `` class + +[`src/.php`](https://github.com/monero-integrations/monerophp/tree/master/src/.php) + +*Documentation under development* + +### Methods + + - `H` + - `pymod` + - `expmod` + - `inv` + - `xrecover` + - `edwards` + - `scalarmult` + - `scalarloop` + - `bitsToString` + - `dec2bin_i` + - `encodeint` + - `encodepoint` + - `bit` + - `publickey` + - `Hint` + - `signature` + - `isoncurve` + - `decodeint` + - `decodepoint` + - `checkvalid` + - `scalarmult_base` \ No newline at end of file From 63919a435e1acc5c405054a33395c69f1f8c3892 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 22:48:23 -0700 Subject: [PATCH 06/10] note docs that are under development --- docs/README.md | 4 + docs/walletRPC.html | 1966 ------------------------------------------- 2 files changed, 4 insertions(+), 1966 deletions(-) delete mode 100644 docs/walletRPC.html diff --git a/docs/README.md b/docs/README.md index 4f4a4f5..fe55e05 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,6 +16,8 @@ JSON RPC wrappers: ## [`cryptonote` class](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md) +*Documentation under development* + - [`keccak_256`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#keccak_256) - [`gen_new_hex_seed`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_new_hex_seed) - [`sc_reduce`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#sc_reduce) @@ -38,6 +40,8 @@ JSON RPC wrappers: ## [`ed25519` class](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md) +*Documentation under development* + - [`H`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#H) - [`pymod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#pymod) - [`expmod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#expmod) diff --git a/docs/walletRPC.html b/docs/walletRPC.html deleted file mode 100644 index 70e8f10..0000000 --- a/docs/walletRPC.html +++ /dev/null @@ -1,1966 +0,0 @@ -walletRPC

walletRPC class

-

src/walletRPC.php

-

A class for making calls to monero-wallet-rpc using PHP

-

Parameters:

-
    -
  • $host <string> monero-wallet-rpc hostname (optional)
  • -
  • $port <int> monero-wallet-rpc port (optional)
  • -
  • $protocol <string> monero-wallet-rpc protocol (eg. ‘http’) (optional)
  • -
  • $user <string> monero-wallet-rpc RPC username (optional)
  • -
  • $password <string> monero-wallet-rpc RPC passphrase (optional)
  • -
-

Methods

-

_transform

-

Convert from moneroj to tacoshi (piconero)

-

Parameters:

-
    -
  • $method <number> Amount (in monero) to transform to tacoshi (piconero) (optional)
  • -
-

Return: <Number>

-

get_balance

-

Look up an account’s balance

-

Parameters:

-
    -
  • $account_index <number> Index of account to look up (
    - optional)
  • -
-

Return: <Object>

-
{
- "balance": 140000000000,
- "unlocked_balance": 50000000000
-}
-
- -

Alias: `

-

getbalance

-

Alias of get_balance()

-

Parameters:

-
    -
  • $account_index <number> Index of account to look up (optional)
  • -
-

Return: <Object>

-
{
- "balance": 140000000000,
- "unlocked_balance": 50000000000
-}
-
- -

``

-

Look up wallet address(es)

-

Parameters:

-
    -
  • $account_index <number> Index of account to look up (optional)
  • -
  • $address_index <number> Index of subaddress to look up (optional)
  • -
-

Return: <Object>

-
{
- address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH4ATS
- addresses: [
-   {
-     address: 'A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnRv53zLQH
-     address_index: 0,
-     label: 'Primary account',
-     used: true
-   }, {
-     address: 'Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7w
-     address_index: 1,
-     label: '',
-     used: true
-   }
- ]
-}
-
- -

``

-

Alias of get_address()

-

Parameters:

-
    -
  • $account_index <number> Index of account to look up (optional)
  • -
  • $address_index <number> Index of subaddress to look up (optional)
  • -
-

Return: <Object>

-
{
- "address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJiWFQjhnhh
-}
-
- -

``

-

Create a new subaddress

-

Parameters:

-
    -
  • $account_index <number> The subaddress account index
  • -
  • $label <string> A label to the new subaddress
  • -
-

Return: <Object>

-
{
- "address": "Bh3ttLbjGFnVGCeGJF1HgVh4DfCaBNpDt7PQAgsC2GFug7WKskgfbTmB6e7UupyiijiHDQPmDC7wSC
- "address_index": 1
-}
-
- -

``

-

Label a subaddress

-

Parameters:

-
    -
  • $index <number> The index of the subaddress to label
  • -
  • $label <string> The label to apply
  • -
-

No return

-

``

-

Look up wallet accounts

-

No parameters

-

Return: <Object>

-
{
- "subaddress_accounts": {
-   "0": {
-     "account_index": 0,
-     "balance": 2808597352948771,
-     "base_address": "A2XE6ArhRkVZqepY2DQ5QpW8p8P2dhDQLhPJ9scSkW6q9aYUHhrhXVvE8sjg7vHRx2HnR
-     "label": "Primary account",
-     "tag": "",
-     "unlocked_balance": 2717153096298162
-   },
-   "1": {
-     "account_index": 1,
-     "balance": 0,
-     "base_address": "BcXKsfrvffKYVoNGN4HUFfaruAMRdk5DrLZDmJBnYgXrTFrXyudn81xMj7rsmU5P9dX56
-     "label": "Secondary account",
-     "tag": "",
-     "unlocked_balance": 0 )
-  },
-  "total_balance": 2808597352948771,
-  "total_unlocked_balance": 2717153096298162
-}
-
- -

``

-

Create a new account

-

Parameters:

-
    -
  • $label <String> Label to apply
  • -
-

No return

-

``

-

Label an account

-

Parameters:

-
    -
  • $account_index <number> Index of account to label
  • -
  • $label <string> Label to apply
  • -
-

No return

-

``

-

Look up account tags

-

No parameters

-

Return: <Object>

-
{
- "account_tags": {
-   "0": {
-     "accounts": {
-       "0": 0,
-       "1": 1
-     },
-     "label": "",
-     "tag": "Example tag"
-   }
- }
-}
-
- -

``

-

Tag accounts

-

Parameters:

-
    -
  • $accounts <array> The indeices of the accounts to tag
  • -
  • $tag <string> Tag to apply
  • -
-

No return

-

``

-

Untag accounts

-

Parameters:

-
    -
  • $accounts <array> The indices of the accounts to untag
  • -
-

No return

-

``

-

Describe a tag

-

Parameters:

-
    -
  • $tag <string> Tag to describe
  • -
  • $description <string> Description to apply to tag
    -Return: <Object>
  • -
-
{
- // TODO example
-}
-
- -

``

-

Look up how many blocks are in the longest chain known to the wallet

-

No parameters

-

Return: <Object>

-
{
- "height": 994310
-}
-
- -

``

-

Alias of get_height()

-

No parameters

-

Return: <Object>

-
{
- "height": 994310
-}
-
- -

``

-

Send monero

-

Parameters:

-

Parameters can be passed in individually (as listed below) or as an object/dictionary (as
-To send to multiple recipients, use the object/dictionary (bottom) format and pass an array
- - $amount <string> Amount of monero to send
- - $address <string> Address to receive funds
- - $payment_id <string> Payment
- - $mixin <number> Mixin number (ringsize -
- - $account_index <number> Account to send
- - $subaddr_indices <string> Comma-separeted list of subaddress indices to spend
- - $priority <number> Transaction
- - $unlock_time <number> UNIX time or block height to unlock
- - $do_not_relay <boolean> Do not relay
- OR
- - $params <object> Array containing any of the options listed above, where
-Return: <Object>

-
{
- "amount": "1000000000000",
- "fee": "1000020000",
- "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
- "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
-}
-
- -

``

-

Same as transfer, but splits transfer into more than one transaction if necessary

-

Parameters:

-

Send all dust outputs back to the wallet

-

No parameters

-

Return: <Object>

-
{
- "multisig_txset": []
-}
-
- -

``

-

Send all unmixable outputs back to the wallet

-

No parameters

-

Return: <Object>

-
{
- "multisig_txset": []
-}
-
- -

``

-

Send all unlocked outputs from an account to an address

-

Parameters:

-
    -
  • $address <string> Address to receive funds
  • -
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to sweep (
  • -
  • $account_index <number> Index of the account to sweep (
  • -
  • $payment_id <string> Payment ID (
  • -
  • $mixin <number> Mixin number (ringsize - 1) (
  • -
  • $priority <number> Payment ID (
  • -
  • $below_amount <number> Only send outputs below this amount (
  • -
  • $unlock_time <number> UNIX time or block height to unlock output (
  • -
  • $do_not_relay <boolean> Do not relay transaction (
    - OR
  • -
  • $params <object> Array containing any of the options listed above, where
    -Return: <Object>
  • -
-
{
- "amount": "1000000000000",
- "fee": "1000020000",
- "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
- "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
-}
-
- -

``

-

Sweep a single key image to an address

-

Parameters:

-
    -
  • $key_image <string> Key image to sweep
  • -
  • $address <string> Address to receive funds
  • -
  • $payment_id <string> Payment ID (optional)
  • -
  • $below_amount <number> Only send outputs below this amount (optional)
  • -
  • $mixin <number> Mixin number (ringsize - 1) (optional)
  • -
  • $priority <number> Payment ID (optional)
  • -
  • $unlock_time <number> UNIX time or block height to unlock output (optional)
  • -
  • $do_not_relay <boolean> Do not relay transaction (optional)
    - OR
  • -
  • $params <object> Array containing any of the options listed above, where
    -Return: <Object>
  • -
-
{
- "amount": "1000000000000",
- "fee": "1000020000",
- "tx_hash": "c60a64ddae46154a75af65544f73a7064911289a7760be8fb5390cb57c06f2db",
- "tx_key": "805abdb3882d9440b6c80490c2d6b95a79dbc6d1b05e514131a91768e8040b04"
-}
-
- -

``

-

Relay a transaction

-

Parameters:

-
    -
  • $hex <string> Blob of transaction to relay
    -Return: <Object>
  • -
-
ODO example
-
-Save wallet
-
-Look up incoming payments by payment ID
- - `$payment_id <string>` Payment ID to look up
-Return: `<Object>`
-
-```json
-{
- "payments": [{
-   "amount": 10350000000000,
-   "block_height": 994327,
-   "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030",
-   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
-   "unlock_time": 0
- }]
-}
-
- -

``

-

Look up incoming payments by payment ID (or a list of payments IDs) from a given height

-

Parameters:

-
    -
  • $payment_ids <array> Array of payment IDs to look up
  • -
  • $min_block_height <string> Height to begin search
    -Return: <Object>
  • -
-
{
- "payments": [{
-   "amount": 10350000000000,
-   "block_height": 994327,
-   "payment_id": "4279257e0a20608e25dba8744949c9e1caff4fcdafc7d5362ecf14225f3d9030",
-   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
-   "unlock_time": 0
- }]
-}
-
- -

``

-

Look up incoming transfers

-

Parameters:

-
    -
  • $type <string> Type of transfer to look up; must be ‘all’, ‘available’,
  • -
  • $account_index <number> Index of account to look up
  • -
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to look
    -Return: <Object>
  • -
-
{
- "transfers": [{
-   "amount": 10000000000000,
-   "global_index": 711506,
-   "spent": false,
-   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
-   "tx_size": 5870
- },{
-   "amount": 300000000000,
-   "global_index": 794232,
-   "spent": false,
-   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
-   "tx_size": 5870
- },{
-   "amount": 50000000000,
-   "global_index": 213659,
-   "spent": false,
-   "tx_hash": "c391089f5b1b02067acc15294e3629a463412af1f1ed0f354113dd4467e4f6c1",
-   "tx_size": 5870
- }]
-}
-
- -

``

-

Look up a wallet key

-

Parameters:

-
    -
  • $key_type <string> Type of key to look up; must be ‘view_key’, ‘spend_key’, or
    -Return: <Object>
  • -
-
{
- "key": "7e341d..."
-}
-
- -

``

-

Look up wallet view key

-

No parameters

-

Return: <Object>

-
{
- "key": "7e341d..."
-}
-
- -

``

-

Look up wallet spend key

-

No parameters

-

Return: <Object>

-
{
- "key": "2ab810..."
-}
-
- -

``

-

Look up wallet mnemonic seed

-

No parameters

-

Return: <Object>

-
{
- "key": "2ab810..."
-}
-
- -

``

-

Create an integrated address from a given payment ID

-

Parameters:

-
    -
  • $payment_id <string> Payment ID (optional)
  • -
-

Return: <Object>

-
{
- "integrated_address": "4BpEv3WrufwXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CG
-}
-
- -

``

-

Look up the wallet address and payment ID corresponding to an integrated address

-

Parameters:

-
    -
  • $integrated_address <string> Integrated address to split
    -Return: <Object>
  • -
-
{
- "payment_id": "420fa29b2d9a49f5",
- "standard_address": "427ZuEhNJQRXoyJAeEoBaNW56ScQaLXyyQWgxeRL9KgAUhVzkvfiELZV7fCPBuuB2CGuJ
-}
-
- -

``

-

Stop the wallet, saving the state

-

No parameters

-

No return

-

``

-

Rescan the blockchain from scratch

-

No parameters

-

No return

-

``

-

Add notes to transactions
- - $txids <array> Array of transaction IDs to note

-

Parameters:

-
    -
  • $notes <array> Array of notes (strings) to add
  • -
-

No return

-

``

-

Look up transaction note

-

Parameters:

-
    -
  • $txids <array> Array of transaction IDs (strings) to look up
  • -
-

Return:

-
Example: {
- // TODO example
-}
-
- -

``

-

Set a wallet option

-

Parameters:

-
    -
  • $key <string> Option to set
  • -
  • $value <string> Value to set
  • -
-

No return

-

``

-

Look up a wallet option

-

Parameters:

-
    -
  • $key <string> Wallet option to query
    -Return: <Object>
  • -
-
{
- // TODO example
-}
-
- -

``

-

Look up a transaction key

-

Parameters:

-
    -
  • `$txid <string> Transaction ID to look up
  • -
-

Return:

-
Example: {
- "tx_key": "e8e97866b1606bd87178eada8f995bf96d2af3fec5db0bc570a451ab1d589b0f"
-}
-
- -

``

-

Check a transaction key

-

Parameters:

-
    -
  • `$address <string> Address that sent transaction
  • -
  • `$txid <string> Transaction ID
  • -
  • `$tx_key <string> Transaction key
  • -
-

Return:

-
Example: {
- "confirmations": 1,
- "in_pool": ,
- "received": 0
-}
-
- -

``

-

Create proof (signature) of transaction

-

Parameters:

-
    -
  • $address <string> Address that spent funds
  • -
  • $txid <string> Transaction ID
    -Return: <Object>
  • -
-
{
- "signature": "InProofV1Lq4nejMXxMnAdnLeZhHe3FGCmFdnSvzVM1AiGcXjngTRi4hfHPcDL9D4th7KUuvF9ZH
-}
-
- -

``

-

Verify transaction proof

-

Parameters:

-
    -
  • $address <string> Address that spent funds
  • -
  • $txid <string> Transaction ID
  • -
  • $signature <string> Signature (tx_proof)
  • -
-

Return:

-
{
- "confirmations": 2,
- "good": 1,
- "in_pool": ,
- "received": 15752471409492,
-}
-
- -

``

-

Create proof of a spend

-

Parameters:

-
    -
  • $txid <string> Transaction ID
    -Return: <Object>
  • -
-
{
- "signature": "SpendProofV1RnP6ywcDQHuQTBzXEMiHKbe5ErzRAjpUB1h4RUMfGPNv4bbR6V7EFyiYkCrURwbb
-}
-
- -

``

-

Verify spend proof

-

Parameters:

-
    -
  • $txid <string> Transaction ID
  • -
  • $signature <string> Spend proof to verify
    -Return: <Object>
  • -
-
{
- "good": 1
-}
-
- -

``

-

Create proof of reserves

-

Parameters:

-
    -
  • $account_index <string> Comma-separated list of account indices of which to prove
  • -
-

Return:

-
{
- "signature": "ReserveProofV11BZ23sBt9sZJeGccf84mzyAmNCP3KzYbE111111111111AjsVgKzau88VxXVGA
-}
-
- -

``

-

Verify a reserve proof

-

Parameters:

-
    -
  • $address <string> Wallet address
  • -
  • $signature <string> Reserve proof
    -Return: <Object>
  • -
-
{
- "good": 1,
- "spent": 0,
- "total": 0
-}
-
- -

``

-

Look up transfers

-

Parameters:

-
    -
  • $input_types <array> Array of transfer type strings; possible values include
  • -
  • $account_index <number> Index of account to look
  • -
  • $subaddr_indices <string> Comma-seperated list of subaddress indices to look
  • -
  • $min_height <number> Minimum block height to use when looking up
  • -
  • $max_height <number> Maximum block height to use when looking up
    - OR
  • -
  • $inputs_types <object> Array containing any of the options listed above, where
    -Return: <Object>
  • -
-
{
- "pool": [{
-   "amount": 500000000000,
-   "fee": 0,
-   "height": 0,
-   "note": "",
-   "payment_id": "758d9b225fda7b7f",
-   "timestamp": 1488312467,
-   "txid": "da7301d5423efa09fabacb720002e978d114ff2db6a1546f8b820644a1b96208",
-   "type": "pool"
- }]
-}
-
- -

``

-

Look up transaction by transaction ID

-

Parameters:

-
    -
  • $txid <string> Transaction ID to look up
  • -
  • $account_index <string> Index of account to query (optional)
  • -
-

Return: <Object>

-
{
- "transfer": {
-   "amount": 10000000000000,
-   "fee": 0,
-   "height": 1316388,
-   "note": "",
-   "payment_id": "0000000000000000",
-   "timestamp": 1495539310,
-   "txid": "f2d33ba969a09941c6671e6dfe7e9456e5f686eca72c1a94a3e63ac6d7f27baf",
-   "type": "in"
- }
-}
-
- -

``

-

Sign a string

-

Parameters:

-
    -
  • $data <string> Data to sign
    -Return: <Object>
  • -
-
{
- "signature": "SigV1Xp61ZkGguxSCHpkYEVw9eaWfRfSoAf36PCsSCApx4DUrKWHEqM9CdNwjeuhJii6LHDVDFxv
-}
-
- -

``

-

Verify a signature

-

Parameters:

-
    -
  • $data <string> Signed data
  • -
  • $address <string> Address that signed data
  • -
  • $signature <string> Signature to verify
  • -
-

Return:

-
$good       Verification status
-
-Export an array of signed key images
-
-*No parameters*
-
-
-Return:
-
-```json
-Example: {
- // TODO example
-}
-
- -

``

-

Import a signed set of key images

-

Parameters:

-
    -
  • $signed_key_images <array> Array of signed key images
    -Return: <Object>
  • -
-
{
- // TODO example
- height: ,
- spent: ,
- unspent:
-}
-
- -

``

-

Create a payment URI using the official URI specification

-

Parameters:

-
    -
  • $address <string> Address to receive fuids
  • -
  • $amount <string> Amount of monero to request
  • -
  • $payment_id <string> Payment ID (optional)
  • -
  • $recipient_name <string> Name of recipient (optional)
  • -
  • $tx_description <string> Payment description (optional)
  • -
-

Return: <Object>

-
{
- // TODO example
-}
-
- -

``

-

Parse a payment URI

-

Parameters:

-
    -
  • $uri <string> Payment URI
    -Return: <Object>
  • -
-
{
- "uri": {
-   "address": "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VB
-   "amount": 10,
-   "payment_id": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
-   "recipient_name": "Monero Project donation address",
-   "tx_description": "Testing out the make_uri function"
- }
-}
-
- -

``

-

Look up address book entries

-

Parameters:

-
    -
  • $entries <array> Array of address book entry indices to look up
  • -
-

Return:

-
Example: {
- // TODO example
-}
-
- -

``

-

Add entry to the address book

-

Parameters:

-
    -
  • $address <string> Address to add to address book
  • -
  • $payment_id <string> Payment ID to use with address in address book (optional)
  • -
  • $description <string> Description of address (optional)
  • -
-

Return:

-
$index        Index of address in address book
-
-Delete an entry from the address book
- - `$index <array>` Index of the address book entry to remove
-
-*No return*
-
-#### ``
-
-Rescan the blockchain for spent outputs
-
-Parameters:
-
-
-Start mining
- - `$threads_count <number>` Number of threads with which to mine
- - `$do_background_mining <boolean>` Mine in backgound?
- - `$ignore_battery <boolean>` Ignore battery?
-
-*No return*
-
-#### ``
-
-Stop mining
-
-*No parameters*
-
-
-*No return*
-
-#### ``
-
-Look up a list of available languages for your wallet's seed
-
-*No parameters*
-
-
-Return:
-
-```json
-List of available languages
-
-Create a new wallet
- - `$filename <string>` Filename of new wallet to create
- - `$password <string>` Password of new wallet to create
- - `$language <string>` Language of new wallet to create
-
-*No return*
-
-#### ``
-
-Open a wallet
-
-Parameters:
-
- - `$filename <string>` Filename of wallet to open
- - `$password <string>` Password of wallet to open
-
-*No return*
-
-#### ``
-
-Check if wallet is multisig
-
-*No parameters*
-
-Return: `<Object>`
-
-```json
-(non-multisignature wallet) {
- "multisig": ,
- "ready": ,
- "threshold": 0,
- "total": 0
-} // TODO multisig wallet example
-
-Create information needed to create a multisignature wallet
-
-*No parameters*
-
-Return: `<Object>`
-
-```json
-{
- "multisig_info": "MultisigV1WBnkPKszceUBriuPZ6zoDsU6RYJuzQTiwUqE5gYSAD1yGTz85vqZGetawVvioa
-}
-
- -

``

-

Create a multisignature wallet

-

Parameters:

-
    -
  • $multisig_info <string> Multisignature information (from eg. prepare_multisig)
  • -
  • $threshold <string> Threshold required to spend from multisignature wallet
  • -
  • $password <string> Passphrase to apply to multisignature wallet
    -Return: <Object>
  • -
-
{
- // TODO example
-}
-
- -

``

-

Export multisignature information

-

No parameters

-

Return: <Object>

-
{
- // TODO example
-}
-
- -

``

-

Import mutlisignature information

-

Parameters:

-
    -
  • $info <string> Multisignature info (from eg. prepare_multisig)
  • -
-

Return:

-
{
- // TODO example
-}
-
- -

``

-

Finalize a multisignature wallet

-

Parameters:

-
    -
  • $multisig_info <string> Multisignature info (from eg. prepare_multisig)
  • -
  • $password <string> Multisignature info (from eg. prepare_multisig)
  • -
-

Return:

-
{
- // TODO example
-}
-
- -

``

-

Sign a multisignature transaction

-

Parameters:

-
    -
  • $tx_data_hex <string> Blob of transaction to sign
    -Return: <Object>
  • -
-
{
- // TODO example
-}
-
- -

``

-

Submit (relay) a multisignature transaction

-

Parameters:

-
    -
  • $tx_data_hex <string> Blob of transaction to submit
  • -
-

Return:

-
{
- // TODO example
-}
-
- -

``

-

Parameters:

-

getbans

-

Get list of banned IPs

-

No parameters

-
    -
  • $ <>
  • -
-

Return: <Object>

-
{
-  "bans": [{
-    "ip": 838969536,
-    "seconds": 1457748792
-  }],
-  "status": "OK"
-}
-
- -

``

-

Credits

-

Parameters:

-

Written by the Monero Integrations team support@monerointegrations.com

-

Using work from:
- - CryptoChangements [Monero_RPC] bW9uZXJv@gmail.com (https://github.com/cryptochangements34)
- - Serhack [Monero Integrations] nico@serhack.me (https://serhack.me)
- - TheKoziTwo [xmr-integration] thekozitwo@gmail.com
- - Kacper Rowinski [jsonRPCClient] krowinski@implix.com

\ No newline at end of file From 45bb4c6e5bba4a107375cefe856fef5ac8e65a43 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 23:05:07 -0700 Subject: [PATCH 07/10] alias methods --- src/daemonRPC.php | 43 ++++++++++++++++++++++++++++++++++++------- src/walletRPC.php | 21 +++------------------ 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/daemonRPC.php b/src/daemonRPC.php index ffdb03f..ef39071 100644 --- a/src/daemonRPC.php +++ b/src/daemonRPC.php @@ -269,7 +269,9 @@ public function getblockheaderbyheight($height) */ public function getblock_by_hash($hash) { - return $this->_run('getblock', $hash); + $params = array('hash' => $hash); + + return $this->_run('getblock', $params); } /** @@ -300,8 +302,9 @@ public function getblock_by_hash($hash) */ public function getblock_by_height($height) { - $heightString = (string) $height; // Cast input to string - return $this->_run('getblock', $heightString); + $params = array('height' => $height); + + return $this->_run('getblock', $params); } /** @@ -413,16 +416,32 @@ public function hardfork_info() * * Ban another node by IP * - * @param string $ip IP address of node to ban + * @param array $bans Array of IP addresses to ban * * @return object Example: { * "status": "OK" * } * */ - public function setbans($ip) + public function set_bans($bans) { - return $this->_run('setbans', $ip); + if (is_string($bans)) { + $bans = array($bans); + } + $params = array('bans' => $bans); + + return $this->_run('set_bans', $params); + } + + /** + * + * Alias of set_bans + * } + * + */ + public function setbans($bans) + { + return $this->set_bans($params); } /** @@ -440,9 +459,19 @@ public function setbans($ip) * } * */ + public function get_bans() + { + return $this->_run('get_bans'); + } + + /** + * + * Alias of get_bans + * + */ public function getbans() { - return $this->_run('getbans'); + return $this->get_bans(); } } diff --git a/src/walletRPC.php b/src/walletRPC.php index 71c3f9b..c47cd85 100644 --- a/src/walletRPC.php +++ b/src/walletRPC.php @@ -132,18 +132,10 @@ public function get_balance($account_index = 0) * * Alias of get_balance() * - * @param number $account_index Index of account to look up (optional) - * - * @return object Example: { - * "balance": 140000000000, - * "unlocked_balance": 50000000000 - * } - * */ public function getbalance($account_index = 0) { - $params = array('account_index' => $account_index); - return $this->_run('getbalance', $params); + return $this->get_balance($account_index); } /** @@ -191,8 +183,7 @@ public function get_address($account_index = 0, $address_index = 0) */ public function getaddress($account_index = 0, $address_index = 0) { - $params = array('account_index' => $account_index, 'address_index' => $address_index); - return $this->_run('getaddress', $params); + return $this->get_address($account_index = 0, $address_index = 0); } /** @@ -413,16 +404,10 @@ public function get_height() * * Alias of get_height() * - * @param none - * - * @return object Example: { - * "height": 994310 - * } - * */ public function getheight() { - return $this->_run('getheight'); + return $this->get_height()); } /** From f8e9c1b3c641d0985da6d210ce09a391b963b978 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 23:10:39 -0700 Subject: [PATCH 08/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7434d6a..f37b638 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Documentation can be found in the [`/docs`](https://github.com/sneurlax/moneroph Debian (or Ubuntu) are recommended. -## Getting Started +### Getting Started 1. Start the Monero daemon (`monerod`) on testnet. ```bash From 805280b9756f505b51ab90fdaf8566eba2ee322e Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 23:16:37 -0700 Subject: [PATCH 09/10] refer to monero-integrations repo --- docs/README.md | 288 +++++++++++++++++++++++----------------------- src/walletRPC.php | 2 +- 2 files changed, 145 insertions(+), 145 deletions(-) diff --git a/docs/README.md b/docs/README.md index fe55e05..a5558d3 100644 --- a/docs/README.md +++ b/docs/README.md @@ -14,153 +14,153 @@ JSON RPC wrappers: - [`daemonRPC`](#daemonRPC-class) ([`src/daemonRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/daemonRPC.php)) - [`walletRPC`](#walletRPC-class) ([`src/walletRPC.php`](https://github.com/monero-integrations/monerophp/tree/master/src/walletRPC.php)) -## [`cryptonote` class](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md) +## [`cryptonote` class](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md) *Documentation under development* - - [`keccak_256`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#keccak_256) - - [`gen_new_hex_seed`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_new_hex_seed) - - [`sc_reduce`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#sc_reduce) - - [`hash_to_scalar`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#hash_to_scalar) - - [`derive_viewKey`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derive_viewKey) - - [`gen_private_keys`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_private_keys) - - [`pk_from_sk`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#pk_from_sk) - - [`gen_key_derivation`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#gen_key_derivation) - - [`encode_varint`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#encode_varint) - - [`derivation_to_scalar`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derivation_to_scalar) - - [`stealth_payment_id`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#stealth_payment_id) - - [`txpub_from_extra`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#txpub_from_extra) - - [`derive_public_key`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#derive_public_key) - - [`is_output_mine`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#is_output_mine) - - [`encode_address`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#encode_address) - - [`verify_checksum`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#verify_checksum) - - [`decode_address`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#decode_address) - - [`integrated_addr_from_keys`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#integrated_addr_from_keys) - - [`address_from_seed`](https://github.com/sneurlax/monerophp/tree/master/docs/cryptonote.md#address_from_seed) - -## [`ed25519` class](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md) + - [`keccak_256`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#keccak_256) + - [`gen_new_hex_seed`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#gen_new_hex_seed) + - [`sc_reduce`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#sc_reduce) + - [`hash_to_scalar`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#hash_to_scalar) + - [`derive_viewKey`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#derive_viewKey) + - [`gen_private_keys`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#gen_private_keys) + - [`pk_from_sk`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#pk_from_sk) + - [`gen_key_derivation`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#gen_key_derivation) + - [`encode_varint`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#encode_varint) + - [`derivation_to_scalar`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#derivation_to_scalar) + - [`stealth_payment_id`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#stealth_payment_id) + - [`txpub_from_extra`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#txpub_from_extra) + - [`derive_public_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#derive_public_key) + - [`is_output_mine`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#is_output_mine) + - [`encode_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#encode_address) + - [`verify_checksum`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#verify_checksum) + - [`decode_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#decode_address) + - [`integrated_addr_from_keys`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#integrated_addr_from_keys) + - [`address_from_seed`](https://github.com/monero-integrations/monerophp/tree/master/docs/cryptonote.md#address_from_seed) + +## [`ed25519` class](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md) *Documentation under development* - - [`H`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#H) - - [`pymod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#pymod) - - [`expmod`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#expmod) - - [`inv`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#inv) - - [`xrecover`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#xrecover) - - [`edwards`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#edwards) - - [`scalarmult`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarmult) - - [`scalarloop`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarloop) - - [`bitsToString`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#bitsToString) - - [`dec2bin_i`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#dec2bin_i) - - [`encodeint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#encodeint) - - [`encodepoint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#encodepoint) - - [`bit`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#bit) - - [`publickey`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#publickey) - - [`Hint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#Hint) - - [`signature`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#signature) - - [`isoncurve`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#isoncurve) - - [`decodeint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#decodeint) - - [`decodepoint`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#decodepoint) - - [`checkvalid`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#checkvalid) - - [`scalarmult_base`](https://github.com/sneurlax/monerophp/tree/master/docs/ed25519.md#scalarmult_base) - -## [`SHA3` class](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md) - - - [`init`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#init) - - [`absorb`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#absorb) - - [`absorb`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#absorb) - - [`squeeze`](https://github.com/sneurlax/monerophp/tree/master/docs/SHA3.md#squeeze) - -## [`base58` class](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md) - - - [`encode`](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md##encode) - - [`decode`](https://github.com/sneurlax/monerophp/tree/master/docs/base58.md##decode) - -## [`daemonRPC` class](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md) - - - [`getblockcount`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockcount) - - [`on_getblockhash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#on_getblockhash) - - [`getblocktemplate`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblocktemplate) - - [`submitblock`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#submitblock) - - [`getlastblockheader`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getlastblockheader) - - [`getblockheaderbyhash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyhash) - - [`getblockheaderbyheight`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyheight) - - [`getblock_by_hash`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblock_by_hash) - - [`getblock_by_height`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getblock_by_height) - - [`get_connections`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#get_connections) - - [`get_info`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#get_info) - - [`hardfork_info`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#hardfork_info) - - [`setbans`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#setbans) - - [`getbans`](https://github.com/sneurlax/monerophp/tree/master/docs/daemonRPC.md#getbans) - -## [`walletRPC` class](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md) - - - [`_transform`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#_transform) - - [`get_balance`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_balance) - - [`get_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_address) - - [`create_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_address) - - [`label_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#label_address) - - [`get_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_accounts) - - [`create_account`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_account) - - [`label_account`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#label_account) - - [`get_account_tags`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_account_tags) - - [`tag_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#tag_accounts) - - [`untag_accounts`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#untag_accounts) - - [`set_account_tag_description`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_account_tag_description) - - [`get_height`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_height) - - [`transfer`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#transfer) - - [`transfer_split`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#transfer_split) - - [`sweep_dust`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_dust) - - [`sweep_unmixable`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_unmixable) - - [`sweep_all`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_all) - - [`sweep_single`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sweep_single) - - [`relay_tx`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#relay_tx) - - [`store`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#store) - - [`get_payments`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_payments) - - [`get_bulk_payments`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_bulk_payments) - - [`incoming_transfers`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#incoming_transfers) - - [`query_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#query_key) - - [`view_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#view_key) - - [`spend_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#spend_key) - - [`mnemonic`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#mnemonic) - - [`make_integrated_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_integrated_address) - - [`split_integrated_address`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#split_integrated_address) - - [`stop_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#stop_wallet) - - [`rescan_blockchain`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#rescan_blockchain) - - [`set_tx_notes`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_tx_notes) - - [`get_tx_notes`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_notes) - - [`set_attribute`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#set_attribute) - - [`get_attribute`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_attribute) - - [`get_tx_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_key) - - [`check_tx_key`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_tx_key) - - [`get_tx_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_tx_proof) - - [`check_tx_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_tx_proof) - - [`get_spend_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_spend_proof) - - [`check_spend_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_spend_proof) - - [`get_reserve_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_reserve_proof) - - [`check_reserve_proof`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#check_reserve_proof) - - [`get_transfers`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_transfers) - - [`get_transfer_by_txid`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_transfer_by_txid) - - [`sign`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sign) - - [`verify`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#verify) - - [`export_key_images`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#export_key_images) - - [`import_key_images`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#import_key_images) - - [`make_uri`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_uri) - - [`parse_uri`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#parse_uri) - - [`get_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_address_book) - - [`add_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#add_address_book) - - [`delete_address_book`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#delete_address_book) - - [`rescan_spent`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#rescan_spent) - - [`start_mining`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#start_mining) - - [`stop_mining`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#stop_mining) - - [`get_languages`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#get_languages) - - [`create_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#create_wallet) - - [`open_wallet`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#open_wallet) - - [`is_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#is_multisig) - - [`prepare_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#prepare_multisig) - - [`make_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#make_multisig) - - [`export_multisig_info`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#export_multisig_info) - - [`import_multisig_info`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#import_multisig_info) - - [`finalize_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#finalize_multisig) - - [`sign_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#sign_multisig) - - [`submit_multisig`](https://github.com/sneurlax/monerophp/tree/master/docs/walletRPC.md#submit_multisig) + - [`H`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#H) + - [`pymod`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#pymod) + - [`expmod`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#expmod) + - [`inv`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#inv) + - [`xrecover`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#xrecover) + - [`edwards`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#edwards) + - [`scalarmult`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#scalarmult) + - [`scalarloop`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#scalarloop) + - [`bitsToString`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#bitsToString) + - [`dec2bin_i`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#dec2bin_i) + - [`encodeint`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#encodeint) + - [`encodepoint`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#encodepoint) + - [`bit`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#bit) + - [`publickey`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#publickey) + - [`Hint`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#Hint) + - [`signature`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#signature) + - [`isoncurve`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#isoncurve) + - [`decodeint`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#decodeint) + - [`decodepoint`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#decodepoint) + - [`checkvalid`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#checkvalid) + - [`scalarmult_base`](https://github.com/monero-integrations/monerophp/tree/master/docs/ed25519.md#scalarmult_base) + +## [`SHA3` class](https://github.com/monero-integrations/monerophp/tree/master/docs/SHA3.md) + + - [`init`](https://github.com/monero-integrations/monerophp/tree/master/docs/SHA3.md#init) + - [`absorb`](https://github.com/monero-integrations/monerophp/tree/master/docs/SHA3.md#absorb) + - [`absorb`](https://github.com/monero-integrations/monerophp/tree/master/docs/SHA3.md#absorb) + - [`squeeze`](https://github.com/monero-integrations/monerophp/tree/master/docs/SHA3.md#squeeze) + +## [`base58` class](https://github.com/monero-integrations/monerophp/tree/master/docs/base58.md) + + - [`encode`](https://github.com/monero-integrations/monerophp/tree/master/docs/base58.md##encode) + - [`decode`](https://github.com/monero-integrations/monerophp/tree/master/docs/base58.md##decode) + +## [`daemonRPC` class](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md) + + - [`getblockcount`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblockcount) + - [`on_getblockhash`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#on_getblockhash) + - [`getblocktemplate`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblocktemplate) + - [`submitblock`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#submitblock) + - [`getlastblockheader`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getlastblockheader) + - [`getblockheaderbyhash`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyhash) + - [`getblockheaderbyheight`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblockheaderbyheight) + - [`getblock_by_hash`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblock_by_hash) + - [`getblock_by_height`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getblock_by_height) + - [`get_connections`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#get_connections) + - [`get_info`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#get_info) + - [`hardfork_info`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#hardfork_info) + - [`setbans`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#setbans) + - [`getbans`](https://github.com/monero-integrations/monerophp/tree/master/docs/daemonRPC.md#getbans) + +## [`walletRPC` class](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md) + + - [`_transform`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#_transform) + - [`get_balance`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_balance) + - [`get_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_address) + - [`create_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#create_address) + - [`label_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#label_address) + - [`get_accounts`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_accounts) + - [`create_account`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#create_account) + - [`label_account`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#label_account) + - [`get_account_tags`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_account_tags) + - [`tag_accounts`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#tag_accounts) + - [`untag_accounts`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#untag_accounts) + - [`set_account_tag_description`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#set_account_tag_description) + - [`get_height`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_height) + - [`transfer`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#transfer) + - [`transfer_split`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#transfer_split) + - [`sweep_dust`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sweep_dust) + - [`sweep_unmixable`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sweep_unmixable) + - [`sweep_all`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sweep_all) + - [`sweep_single`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sweep_single) + - [`relay_tx`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#relay_tx) + - [`store`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#store) + - [`get_payments`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_payments) + - [`get_bulk_payments`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_bulk_payments) + - [`incoming_transfers`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#incoming_transfers) + - [`query_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#query_key) + - [`view_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#view_key) + - [`spend_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#spend_key) + - [`mnemonic`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#mnemonic) + - [`make_integrated_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#make_integrated_address) + - [`split_integrated_address`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#split_integrated_address) + - [`stop_wallet`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#stop_wallet) + - [`rescan_blockchain`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#rescan_blockchain) + - [`set_tx_notes`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#set_tx_notes) + - [`get_tx_notes`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_tx_notes) + - [`set_attribute`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#set_attribute) + - [`get_attribute`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_attribute) + - [`get_tx_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_tx_key) + - [`check_tx_key`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#check_tx_key) + - [`get_tx_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_tx_proof) + - [`check_tx_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#check_tx_proof) + - [`get_spend_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_spend_proof) + - [`check_spend_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#check_spend_proof) + - [`get_reserve_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_reserve_proof) + - [`check_reserve_proof`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#check_reserve_proof) + - [`get_transfers`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_transfers) + - [`get_transfer_by_txid`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_transfer_by_txid) + - [`sign`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sign) + - [`verify`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#verify) + - [`export_key_images`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#export_key_images) + - [`import_key_images`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#import_key_images) + - [`make_uri`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#make_uri) + - [`parse_uri`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#parse_uri) + - [`get_address_book`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_address_book) + - [`add_address_book`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#add_address_book) + - [`delete_address_book`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#delete_address_book) + - [`rescan_spent`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#rescan_spent) + - [`start_mining`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#start_mining) + - [`stop_mining`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#stop_mining) + - [`get_languages`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#get_languages) + - [`create_wallet`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#create_wallet) + - [`open_wallet`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#open_wallet) + - [`is_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#is_multisig) + - [`prepare_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#prepare_multisig) + - [`make_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#make_multisig) + - [`export_multisig_info`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#export_multisig_info) + - [`import_multisig_info`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#import_multisig_info) + - [`finalize_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#finalize_multisig) + - [`sign_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#sign_multisig) + - [`submit_multisig`](https://github.com/monero-integrations/monerophp/tree/master/docs/walletRPC.md#submit_multisig) diff --git a/src/walletRPC.php b/src/walletRPC.php index c47cd85..54e3b55 100644 --- a/src/walletRPC.php +++ b/src/walletRPC.php @@ -407,7 +407,7 @@ public function get_height() */ public function getheight() { - return $this->get_height()); + return $this->get_height(); } /** From 4e45eb4ffe6da27384aac51c119dfa546aeb09b7 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Sun, 1 Apr 2018 23:20:07 -0700 Subject: [PATCH 10/10] revert example.php to presentable state --- example.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/example.php b/example.php index bdf8f63..566b1cf 100644 --- a/example.php +++ b/example.php @@ -27,8 +27,8 @@ require_once('src/walletRPC.php'); $walletRPC = new walletRPC('127.0.0.1', 28083); // Change to match your wallet (monero-wallet-rpc) IP address and port; 18083 is the customary port for mainnet, 28083 for testnet, 38083 for stagenet -// $create_wallet = $walletRPC->create_wallet('multisig_wallet5', ''); // Creates a new wallet named monero_wallet with no passphrase. Comment this line and edit the next line to use your own wallet -$open_wallet = $walletRPC->open_wallet('multisig_wallet4', ''); +$create_wallet = $walletRPC->create_wallet('monero_wallet', ''); // Creates a new wallet named monero_wallet with no passphrase. Comment this line and edit the next line to use your own wallet +$open_wallet = $walletRPC->open_wallet('monero_wallet', ''); $get_address = $walletRPC->get_address(); $get_accounts = $walletRPC->get_accounts(); $get_balance = $walletRPC->get_balance(); @@ -44,15 +44,6 @@ // $incoming_transfers = $walletRPC->incoming_transfers('all'); // $mnemonic = $walletRPC->mnemonic(); -// $test = $walletRPC->prepare_multisig(); -// print_r($test); - -// 1 -// 2 -// 3 -// 4 MultisigV1faCYKpgh2E74sjJXy1Cpfb4cctTkxGNTSPyLaA8veYBxQJ2VFWyVRZZdXDwVHR1K37a5Y5i5Z7nrXNrzq1k7Sy3yBrtioSW7NbqAZm1aD7zZwNGD6eboNiC8MebnBw7UmB8sRrDanBdSz9HWfq8R6KoVf9hxjXYokUP2dhkXc8yBK7aA -// 5 MultisigV1ZVegfjMqnm2GuUH8p2jcK5N2KYJCV7758W1ddwPcxYjed2agdpwquKuX9BWxpvB54YCkGtwzzgxZ77bT7hf4yX9PJQknc94ZGiZXRGRGXBZ1UmUGwd8QfTWUm9QWgnKaFPjtBkhGRh2GT6SMW5nb7WnnHqVfXeFsnD6VxQ5nwq9sm6df - ?>