{"id":15146901,"url":"https://github.com/psychiccat/monero-nodejs","last_synced_at":"2025-05-07T17:51:37.426Z","repository":{"id":57301432,"uuid":"47928935","full_name":"PsychicCat/monero-nodejs","owner":"PsychicCat","description":"Monero wallet management via JSON-RPC","archived":false,"fork":false,"pushed_at":"2018-11-28T11:11:37.000Z","size":56,"stargazers_count":118,"open_issues_count":9,"forks_count":62,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-07T17:51:33.194Z","etag":null,"topics":["monero"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PsychicCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-13T17:25:01.000Z","updated_at":"2025-04-10T15:16:54.000Z","dependencies_parsed_at":"2022-09-13T06:23:13.449Z","dependency_job_id":null,"html_url":"https://github.com/PsychicCat/monero-nodejs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PsychicCat%2Fmonero-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PsychicCat%2Fmonero-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PsychicCat%2Fmonero-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PsychicCat%2Fmonero-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PsychicCat","download_url":"https://codeload.github.com/PsychicCat/monero-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931391,"owners_count":21827104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["monero"],"created_at":"2024-09-26T12:20:29.646Z","updated_at":"2025-05-07T17:51:37.404Z","avatar_url":"https://github.com/PsychicCat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# monero-nodejs\n\nA Node.js wallet manager for interacting with `monero-wallet-rpc`.\n\nFor more information about Monero, visit: https://getmonero.org\n\nIf you found this useful, please consider [contributing](https://getmonero.org/get-started/contributing/) to the Monero Project!\n\n## Install the package\n\n### via NPM\n\n```\nnpm install monero-nodejs\n```\n\n### Or clone the Github repository\n\n```\ngit clone https://github.com/PsychicCat/monero-nodejs.git\n```\n\n## Initializing a wallet\n\nRequire the module:\n\n```\nvar moneroWallet = require('monero-nodejs');\n```\n\nCreate a new instance of the wallet:\n\n```\nvar Wallet = new moneroWallet();\n```\n\nThis creates a wallet using the following simplewallet default RPC settings:\n\n* `hostname` - '127.0.0.1'\n* `port` - 18082\n\nTo connect to a wallet with different settings, pass in the values:\n\n```\nvar Wallet = new moneroWallet($HOSTNAME, $PORT);\n```\n\n**Note: versions of monero-nodejs prior to 3.0 require `hostname` with the 'http://' prefix, 3.0 and greater only require the IP address.**\n\n## Testing\n\nSome basic tests can now be run locally to verify the library and your simplewallet instance are communicating. The tests assume simplewallet will be listening at the default config settings. Tests are run via mocha.\nTo run the tests, clone the repository and then:\n\nnpm install\nnpm test\n\n## Example Usage\n\n    Wallet.balance().then(function(balance) {\n        console.log(balance);\n    });\n\n## Wallet Methods\n\n### create_wallet\n\nUsage:\n\n```\nWallet.create_wallet('monero_wallet', '', 'English');\n```\n\nCreates a new wallet.\n\nParameters:\n\n* `filename` - filename of wallet to create (_string_)\n* `password` - wallet password (_string_)\n* `language` - language to use for mnemonic phrase (_string_)\n\nExample response:\n\n```\n{}\n```\n\nReturns an object with `error` field if unsuccessful.\n\n### open_walllet\n\nUsage:\n\n```\nWallet.open_wallet('monero_wallet', '');\n```\n\nOpens a wallet.\n\nParameters:\n\n* `filename` - filename of wallet to open (_string_)\n* `password` -wallet password (_string_)\n\nExample response:\n\n```\n{}\n```\n\nReturns an object with `error` field if unsuccessful.\n\n### balance\n\nUsage:\n\n```\nWallet.balance();\n```\n\nResponds with the current balance and unlocked (spendable) balance of the wallet in atomic units. Divide by 1e12 to convert.\n\nExample response:\n\n```\n{ balance: 3611980142579999, unlocked_balance: 3611980142579999 }\n```\n\n### address\n\nUsage:\n\n```\nWallet.address();\n```\n\nResponds with the Monero address of the wallet.\n\nExample response:\n\n```\n{ address: '44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A' }\n```\n\n### transfer\n\nUsage:\n\n```\nWallet.transfer(destinations, options);\n```\n\nTransfers Monero to a single recipient OR a group of recipients in a single transaction. Responds with the transaction hash of the payment.\n\nParameters:\n\n* `destinations` - an object OR an array of objects in the following format: `{amount: (*number*), address: (*string*)}`\n* `options` - an object with the following properties (_optional_)\n  {\n  mixin: (_number_), // amount of existing transaction outputs to mix yours with (default is 4)\n  unlockTime: (_number_), // number of blocks before tx is spendable (default is 0)\n  pid: (_string_) // optional payment ID (a 64 character hexadecimal string used for identifying the sender of a payment)\n  payment*id: (\\_string*) // optional payment ID (a 64 character hexadecimal string used for identifying the sender of a payment)\n  do*not_relay: (\\_boolean*) // optional boolean used to indicate whether a transaction should be relayed or not\n  priority: (_integer_) // optional transaction priority\n  get*tx_hex: (\\_boolean*) // optional boolean used to indicate that the transaction should be returned as hex string after sending\n  get*tx_key: (\\_boolean*) // optional boolean used to indicate that the transaction key should be returned after sending\n  }\n\nExample response:\n\n```\n{ tx_hash: '\u003cb9272a68b0f242769baa1ac2f723b826a7efdc5ba0c71a2feff4f292967936d8\u003e', tx_key: '' }\n```\n\n### transferSplit\n\nUsage:\n\n```\nWallet.transferSplit(destinations, options);\n```\n\nSame as `transfer`, but can split into more than one transaction if necessary. Responds with a list of transaction hashes.\n\nAdditional property available for the `options` parameter:\n\n* `new_algorithm` - `true` to use the new transaction construction algorithm. defaults to `false`. (_boolean_)\n\nExample response:\n\n```\n{ tx_hash_list: [ '\u003cf17fb226ebfdf784a0f5814e1c5bb78c19ea26930a0d706c9dc1085a250ceb37\u003e' ] }\n```\n\n### sweep_dust\n\nUsage:\n\n```\nWallet.sweep_dust();\n```\n\nSends all dust outputs back to the wallet, to make funds easier to spend and mix. Responds with a list of the corresponding transaction hashes.\n\nExample response:\n\n```\n{ tx_hash_list: [ '\u003c75c666fc96120a643321a5e76c0376b40761582ee40cc4917e8d1379a2c8ad9f\u003e' ] }\n```\n\n### sweep_all\n\nUsage:\n\n```\nWallet.sweep_all('44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A');\n```\n\nSends all spendable outputs to the specified address. Responds with a list of the corresponding transaction hashes.\n\nExample response:\n\n```\n{ tx_hash_list: [ '\u003c75c666fc96120a643321a5e76c0376b40761582ee40cc4917e8d1379a2c8ad9f\u003e' ] }\n```\n\n### getPayments\n\nUsage:\n\n```\nWallet.getPayments(paymentID);\n```\n\nReturns a list of incoming payments using a given payment ID.\n\nParameters:\n\n* `paymentID` - the payment ID to scan wallet for included transactions (_string_)\n\n### getBulkPayments\n\nUsage:\n\n```\nWallet.getBulkPayments(paymentIDs, minHeight);\n```\n\nReturns a list of incoming payments using a single payment ID or a list of payment IDs from a given height.\n\nParameters:\n\n* `paymentIDs` - the payment ID or list of IDs to scan wallet for (_array_)\n* `minHeight` - the minimum block height to begin scanning from (example: 800000) (_number_)\n\n### incomingTransfers\n\nUsage:\n\n```\nWallet.incomingTransfers(type);\n```\n\nReturns a list of incoming transfers to the wallet.\n\nParameters:\n\n* `type` - accepts `\"all\"`: all the transfers, `\"available\"`: only transfers that are not yet spent, or `\"unavailable\"`: only transfers which have been spent (_string_)\n\n### queryKey\n\nUsage:\n\n```\nWallet.queryKey(type);\n```\n\nReturns the wallet's spend key (mnemonic seed) or view private key.\n\nParameters:\n\n* `type` - accepts `\"mnemonic\"`: the mnemonic seed for restoring the wallet, or `\"view_key\"`: the wallet's view key (_string_)\n\n### integratedAddress\n\nUsage:\n\n```\nWallet.integratedAddress(paymentID);\n```\n\nOR:\n\n```\nWallet.integratedAddress();\n```\n\nMake and return a new integrated address from your wallet address and a payment ID.\n\nParameters:\n\n* `paymentID` - a 64 character hex string. if not provided, a random payment ID is generated. (_string_, optional)\n\nExample response:\n\n```\n{ integrated_address: '4HCSju123guax69cVdqVP5APVLkcxxjjXdcP9fJWZdNc5mEpn3fXQY1CFmJDvyUXzj2Fy9XafvUgMbW91ZoqwqmQ96NYBVqEd6JAu9j3gk' }\n```\n\n### splitIntegrated\n\nUsage:\n\n```\nWallet.splitIntegrated(address);\n```\n\nReturns the standard address and payment ID corresponding to a given integrated address.\n\nParameters:\n\n* `address` - an integrated Monero address (_string_)\n\nExample response:\n\n```\n{ payment_id: '\u003c61eec5ffd3b9cb57\u003e',\n  standard_address: '44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A' }\n```\n\n### height\n\nUsage:\n\n```\nWallet.height();\n```\n\nReturns the current block height of the daemon.\n\nParameters:\n\n* `callback` - a callback function that responds with an error or the response data in the following order: (_error, data_)\n\nExample response:\n\n```\n{ height: 874458 }\n```\n\n### stopWallet\n\nUsage:\n\n```\nWallet.stopWallet();\n```\n\nCleanly shuts down the current simplewallet process.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsychiccat%2Fmonero-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsychiccat%2Fmonero-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsychiccat%2Fmonero-nodejs/lists"}