{"id":15023816,"url":"https://github.com/marinx/monerorpc","last_synced_at":"2025-04-12T06:52:39.886Z","repository":{"id":49215999,"uuid":"336244823","full_name":"MarinX/monerorpc","owner":"MarinX","description":"Full Monero RPC client(Wallet AND Daemon) written in go","archived":false,"fork":false,"pushed_at":"2024-01-25T13:42:51.000Z","size":76,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T06:52:32.923Z","etag":null,"topics":["hacktoberfest","monero","monero-api","monero-daemon","monero-integrations","monero-library","monero-wallet-rpc"],"latest_commit_sha":null,"homepage":"","language":"Go","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/MarinX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-05T10:55:53.000Z","updated_at":"2025-04-03T15:16:15.000Z","dependencies_parsed_at":"2024-06-19T16:22:20.198Z","dependency_job_id":"39e5c312-a0b7-4325-a853-44e46c5092e6","html_url":"https://github.com/MarinX/monerorpc","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fmonerorpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fmonerorpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fmonerorpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarinX%2Fmonerorpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarinX","download_url":"https://codeload.github.com/MarinX/monerorpc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530604,"owners_count":21119595,"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":["hacktoberfest","monero","monero-api","monero-daemon","monero-integrations","monero-library","monero-wallet-rpc"],"created_at":"2024-09-24T19:59:28.480Z","updated_at":"2025-04-12T06:52:39.858Z","avatar_url":"https://github.com/MarinX.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monero RPC Client in Go\n\n[![Audit](https://github.com/MarinX/monerorpc/actions/workflows/audit.yml/badge.svg)](https://github.com/MarinX/monerorpc/actions/workflows/audit.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/MarinX/monerorpc)](https://goreportcard.com/report/github.com/MarinX/monerorpc)\n[![GoDoc](https://godoc.org/github.com/MarinX/monerorpc?status.svg)](https://godoc.org/github.com/MarinX/monerorpc)\n[![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE)\n\nFull Monero RPC client(Wallet AND Daemon) written in go\n\n## Version\n\nClient was written per docs on getmonero.org.\n\n## Preposition\n\nRunning monerod with RPC enabled\n\n## Installation\n\n```sh\ngo get github.com/MarinX/monerorpc\n```\n\n## Usage\n\n```go\nimport \"github.com/MarinX/monerorpc\"\n```\n\n## Wallet example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/MarinX/monerorpc\"\n)\n\nfunc main() {\n\t// create a new client for Testnet\n\tclient := monerorpc.New(monerorpc.TestnetURI, nil)\n\n\t// if your monerod is protected, set username/password\n\tclient.SetAuth(\"username\", \"password\")\n\n\t// call RPC endpoint\n\tver, err := client.Wallet.GetVersion()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Wallet version %d\\n\", ver.Version)\n}\n\n\n```\n\n## Wallet methods\n\n```go\ntype Wallet interface {\n\t// SetDaemon connects the RPC server to a Monero daemon.\n\tSetDaemon(req *SetDaemonRequest) error\n\t// GetBalance Return the wallet's balance.\n\tGetBalance(req *GetBalanceRequest) (*GetBalanceResponse, error)\n\t// GetAddress Return the wallet's addresses for an account. Optionally filter for specific set of subaddresses.\n\tGetAddress(req *GetAddressRequest) (*GetAddressResponse, error)\n\t// GetAddressIndex Get account and address indexes from a specific (sub)address\n\tGetAddressIndex(req *GetAddressIndexRequest) (*GetAddressIndexResponse, error)\n\t// CreateAddress Create a new address for an account. Optionally, label the new address.\n\tCreateAddress(req *CreateAddressRequest) (*CreateAddressResponse, error)\n\t// LabelAddress Label an address.\n\tLabelAddress(req *LabelAddressRequest) error\n\t// ValidateAddress Analyzes a string to determine whether it is a valid monero wallet address and returns the result and the address specifications.\n\tValidateAddress(req *ValidateAddressRequest) (*ValidateAddressResponse, error)\n\t// GetAccount Get all accounts for a wallet. Optionally filter accounts by tag.\n\tGetAccounts(req *GetAccountsRequest) (*GetAccountsResponse, error)\n\t// CreateAccount Create a new account with an optional label.\n\tCreateAccount(req *CreateAccountRequest) (*CreateAccountResponse, error)\n\t// LabelAccount Label an account.\n\tLabelAccount(req *LabelAccountRequest) error\n\t// GetAccountTags Get a list of user-defined account tags.\n\tGetAccountTags() (*GetAccountTagsResponse, error)\n\t// TagAccounts Apply a filtering tag to a list of accounts.\n\tTagAccounts(req *TagAccountsRequest) error\n\t// UntagAccount Remove filtering tag from a list of accounts.\n\tUntagAccounts(req *UntagAccountsRequest) error\n\t// SetAccountTagDescription Set description for an account tag.\n\tSetAccountTagDescription(req *SetAccountTagDescriptionRequest) error\n\t// GetHeight Returns the wallet's current block height.\n\tGetHeight() (*GetHeightResponse, error)\n\t// Transfer Send monero to a number of recipients.\n\tTransfer(req *TransferRequest) (*TransferResponse, error)\n\t// TransferSplit Same as transfer, but can split into more than one tx if necessary.\n\tTransferSplit(req *TransferSplitRequest) (*TransferSplitResponse, error)\n\t// SignTransfer Sign a transaction created on a read-only wallet (in cold-signing process)\n\tSignTransfer(req *SignTransferRequest) (*SignTransferResponse, error)\n\t// SubmitTransfer Submit a previously signed transaction on a read-only wallet (in cold-signing process)\n\tSubmitTransfer(req *SubmitTransferRequest) (*SubmitTransferResponse, error)\n\t// SweepDust Send all dust outputs back to the wallet's, to make them easier to spend (and mix).\n\tSweepDust(req *SweepDustRequest) (*SweepDustResponse, error)\n\t// SweepAll Send all unlocked balance to an address.\n\tSweepAll(req *SweepAllRequest) (*SweepAllResponse, error)\n\t// SweepSingle Send all of a specific unlocked output to an address.\n\tSweepSingle(req *SweepSingleRequest) (*SweepSingleResponse, error)\n\t// RelaxTx Relay a transaction previously created with \"do_not_relay\":true.\n\tRelayTx(req *RelayTxRequest) (*RelayTxResponse, error)\n\t// Store Save the wallet file.\n\tStore() error\n\t// GetPayments Get a list of incoming payments using a given payment id.\n\tGetPayments(req *GetPaymentsRequest) (*GetPaymentsResponse, error)\n\t// GetBulkPayments Get a list of incoming payments using a given payment id, or a list of payments ids, from a given height.\n\t// This method is the preferred method over get_payments because it has the same functionality but is more extendable.\n\t// Either is fine for looking up transactions by a single payment ID.\n\tGetBulkPayments(req *GetBulkPaymentsRequest) (*GetBulkPaymentsResponse, error)\n\t// IncomingTransfers Return a list of incoming transfers to the wallet.\n\tIncomingTransfers(req *IncomingTransfersRequest) (*IncomingTransfersResponse, error)\n\t// QueryKey Return the spend or view private key.\n\tQueryKey(req *QueryKeyRequest) (*QueryKeyResponse, error)\n\t// MakeIntegratedAddress Make an integrated address from the wallet address and a payment id.\n\tMakeIntegratedAddress(req *MakeIntegratedAddressRequest) (*MakeIntegratedAddressResponse, error)\n\t// SplitIntegratedAddress Retrieve the standard address and payment id corresponding to an integrated address.\n\tSplitIntegratedAddress(req *SplitIntegratedAddressRequest) (*SplitIntegratedAddressResponse, error)\n\t// StopWallet Stops the wallet, storing the current state.\n\tStopWallet() error\n\t// RescanBlockchain Rescan the blockchain from scratch, losing any information which can not be recovered from the blockchain itself.\n\t// This includes destination addresses, tx secret keys, tx notes, etc.\n\tRescanBlockchain() error\n\t// SetTxNotes Set arbitrary string notes for transactions.\n\tSetTxNotes(req *SetTxNotesRequest) error\n\t// GetTxNotes Get string notes for transactions.\n\tGetTxNotes(req *GetTxNotesRequest) (*GetTxNotesResponse, error)\n\t// SetAttribute Set arbitrary attribute.\n\tSetAttribute(req *SetAttributeRequest) error\n\t// GetAttribute Get attribute value by name.\n\tGetAttribute(req *GetAttributeRequest) (*GetAttributeResponse, error)\n\t// GetTxKey Get transaction secret key from transaction id.\n\tGetTxKey(req *GetTxKeyRequest) (*GetTxKeyResponse, error)\n\t// CheckTxKey Check a transaction in the blockchain with its secret key.\n\tCheckTxKey(req *CheckTxKeyRequest) (*CheckTxKeyResponse, error)\n\t// GetTxProof Get transaction signature to prove it.\n\tGetTxProof(req *GetTxProofRequest) (*GetTxProofResponse, error)\n\t// CheckTxProof Prove a transaction by checking its signature.\n\tCheckTxProof(req *CheckTxProofRequest) (*CheckTxProofResponse, error)\n\t// GetSpendProof Generate a signature to prove a spend. Unlike proving a transaction, it does not requires the destination public address.\n\tGetSpendProof(req *GetSpendProofRequest) (*GetSpendProofResponse, error)\n\t// CheckSpendProof Prove a spend using a signature. Unlike proving a transaction, it does not requires the destination public address.\n\tCheckSpendProof(req *CheckSpendProofRequest) (*CheckSpendProofResponse, error)\n\t// GetReserveProof Generate a signature to prove of an available amount in a wallet.\n\tGetReserveProof(req *GetReserveProofRequest) (*GetReserveProofResponse, error)\n\t// CheckReserveProof Proves a wallet has a disposable reserve using a signature.\n\tCheckReserveProof(req *CheckReserveProofRequest) (*CheckReserveProofResponse, error)\n\t// GetTransfers Returns a list of transfers.\n\tGetTransfers(req *GetTransfersRequest) (*GetTransfersResponse, error)\n\t// GetTransferByTxid Show information about a transfer to/from this address.\n\tGetTransferByTxid(req *GetTransferByTxidRequest) (*GetTransferByTxidResponse, error)\n\t// DescribeTransfer Returns details for each transaction in an unsigned or multisig transaction set.\n\tDescribeTransfer(req *DescribeTransferRequest) (*DescribeTransferResponse, error)\n\t// Sign a string.\n\tSign(req *SignRequest) (*SignResponse, error)\n\t// Verify a signature on a string.\n\tVerify(req *VerifyRequest) (*VerifyResponse, error)\n\t// ExportOutputs Export all outputs in hex format.\n\tExportOutputs(req *ExportOutputsRequest) (*ExportOutputsResponse, error)\n\t// ImportOutputs Import outputs in hex format.\n\tImportOutputs(req *ImportOutputsRequest) (*ImportOutputsResponse, error)\n\t// ExportKeyImages Export a signed set of key images.\n\tExportKeyImages(req *ExportKeyImagesRequest) (*ExportKeyImagesResponse, error)\n\t// ImportKeyImages Import signed key images list and verify their spent status.\n\tImportKeyImages(req *ImportKeyImagesRequest) (*ImportKeyImagesResponse, error)\n\t// MakeURI Create a payment URI using the official URI spec.\n\tMakeURI(req *MakeURIRequest) (*MakeURIResponse, error)\n\t// ParseURI Parse a payment URI to get payment information.\n\tParseURI(req *ParseURIRequest) (*ParseURIResponse, error)\n\t// GetAddressBook Retrieves entries from the address book.\n\tGetAddressBook(req *GetAddressBookRequest) (*GetAddressBookResponse, error)\n\t// AddAddressBook Add an entry to the address book.\n\tAddAddressBook(req *AddAddressBookRequest) (*AddAddressBookResponse, error)\n\t// EditAddressBook Edit an existing address book entry.\n\tEditAddressBook(req *EditAddressBookRequest) error\n\t// DeleteAddressBook Delete an entry from the address book\n\tDeleteAddressBook(req *DeleteAddressBookRequest) error\n\t// Refresh a wallet after openning.\n\tRefresh(req *RefreshRequest) (*RefreshResponse, error)\n\t// AutoRefresh Set whether and how often to automatically refresh the current wallet.\n\tAutoRefresh(req *AutoRefreshRequest) error\n\t// RescanSpent Rescan the blockchain for spent outputs.\n\tRescanSpent() error\n\t// StartMining Start mining in the Monero daemon.\n\tStartMining(req *StartMiningRequest) error\n\t// StopMining Stop mining in the Monero daemon.\n\tStopMining() error\n\t// GetLanguages Get a list of available languages for your wallet's seed.\n\tGetLanguages() (*GetLanguagesResponse, error)\n\t// CreateWallet Create a new wallet. You need to have set the argument \"–wallet-dir\" when launching monero-wallet-rpc to make this work.\n\tCreateWallet(req *CreateWalletRequest) error\n\t// GenerateFromKeys Restores a wallet from a given wallet address, view key, and optional spend key.\n\tGenerateFromKeys(req *GenerateFromKeysRequest) (*GenerateFromKeysResponse, error)\n\t// OpenWallet Open a wallet. You need to have set the argument \"–wallet-dir\" when launching monero-wallet-rpc to make this work.\n\tOpenWallet(req *OpenWalletRequest) error\n\t// RestoreDeterministicWallet Create and open a wallet on the RPC server from an existing mnemonic phrase and close the currently open wallet.\n\tRestoreDeterministicWallet(req *RestoreDeterministicWalletRequest) (*RestoreDeterministicWalletResponse, error)\n\t// CloseWallet Close the currently opened wallet, after trying to save it.\n\tCloseWallet() error\n\t// ChangeWalletPassword Change a wallet password.\n\tChangeWalletPassword(req *ChangeWalletPasswordRequest) error\n\t// IsMultisig Check if a wallet is a multisig one.\n\tIsMultisig() (*IsMultisigResponse, error)\n\t// PrepareMultisig Prepare a wallet for multisig by generating a multisig string to share with peers.\n\tPrepareMultisig() (*PrepareMultisigResponse, error)\n\t// MakeMultisig Make a wallet multisig by importing peers multisig string.\n\tMakeMultisig(req *MakeMultisigRequest) (*MakeMultisigResponse, error)\n\t// ExportMultisigInfo Export multisig info for other participants.\n\tExportMultisigInfo() (*ExportMultisigInfoResponse, error)\n\t// ImportMultisigInfo Import multisig info from other participants.\n\tImportMultisigInfo(req *ImportMultisigInfoRequest) (*ImportMultisigInfoResponse, error)\n\t// FinalizeMultisig Turn this wallet into a multisig wallet, extra step for N-1/N wallets.\n\tFinalizeMultisig(req *FinalizeMultisigRequest) (*FinalizeMultisigResponse, error)\n\t// SignMultisig Sign a transaction in multisig.\n\tSignMultisig(req *SignMultisigRequest) (*SignMultisigResponse, error)\n\t// SubmitMultisig Submit a signed multisig transaction.\n\tSubmitMultisig(req *SubmitMultisigRequest) (*SubmitMultisigResponse, error)\n\t// GetVersion Get RPC version Major \u0026 Minor integer-format, where Major is the first 16 bits and Minor the last 16 bits.\n\tGetVersion() (*GetVersionResponse, error)\n}\n```\n\n## Daemon example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/MarinX/monerorpc\"\n)\n\nfunc main() {\n\t// create a new client for Testnet\n\tclient := monerorpc.New(monerorpc.TestnetURI, nil)\n\n\t// if your monerod is protected, set username/password\n\tclient.SetAuth(\"username\", \"password\")\n\n\t// call RPC endpoint\n\tblock, err := client.Daemon.GetBlockCount()\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\tfmt.Printf(\"Block count %d\\n\", block.Count)\n}\n\n```\n\n## Daemon methods\n\n```go\ntype Daemon interface {\n\tGenerateBlocks(req *GenerateBlocksRequest) (*GenerateBlocksResponse, error)\n\t// GetBlockCount Look up how many blocks are in the longest chain known to the node.\n\tGetBlockCount() (*GetBlockCountResponse, error)\n\t// OnGetBlockHash Look up a block's hash by its height.\n\tOnGetBlockHash(req []uint64) (string, error)\n\t// GetBlockTemplate Get a block template on which mining a new block.\n\tGetBlockTemplate(req *GetBlockTemplateRequest) (*GetBlockTemplateResponse, error)\n\t// SubmitBlock Submit a mined block to the network.\n\tSubmitBlock(req []string) (*SubmitBlockResponse, error)\n\t// GetLastBlockHeader Block header information for the most recent block is easily retrieved with this method. No inputs are needed.\n\tGetLastBlockHeader() (*GetLastBlockHeaderResponse, error)\n\t// GetBlockHeaderByHash Block header information can be retrieved using either a block's hash or height.\n\t// This method includes a block's hash as an input parameter to retrieve basic information about the block.\n\tGetBlockHeaderByHash(req *GetBlockHeaderByHashRequest) (*GetBlockHeaderByHashResponse, error)\n\t// GetBlockHeaderByHeight Similar to get_block_header_by_hash above.\n\t// This method includes a block's height as an input parameter to retrieve basic information about the block.\n\tGetBlockHeaderByHeight(req *GetBlockHeaderByHeightRequest) (*GetBlockHeaderByHeightResponse, error)\n\t// GetBlockHeadersRange Similar to get_block_header_by_height above, but for a range of blocks.\n\t// This method includes a starting block height and an ending block height as parameters to retrieve basic information about the range of blocks.\n\tGetBlockHeadersRange(req *GetBlockHeadersRangeRequest) (*GetBlockHeadersRangeResponse, error)\n\t// GetBlock Full block information can be retrieved by either block height or hash, like with the above block header calls.\n\t// For full block information, both lookups use the same method, but with different input parameters.\n\tGetBlock(req *GetBlockRequest) (*GetBlockResponse, error)\n\t// GetConnections Retrieve information about incoming and outgoing connections to your node.\n\tGetConnections() (*GetConnectionsResponse, error)\n\t// GetInfo Retrieve general information about the state of your node and the network.\n\tGetInfo() (*GetInfoResponse, error)\n\t// HardForkInfo Look up information regarding hard fork voting and readiness.\n\tHardForkInfo() (*HardForkInfoResponse, error)\n\t// SetBans Ban another node by IP.\n\tSetBans(req *SetBansRequest) (*SetBansResponse, error)\n\t// GetBans Get list of banned IPs.\n\tGetBans() (*GetBansResponse, error)\n\t// FlushTxpool Flush tx ids from transaction pool\n\tFlushTxpool(req *FlushTxpoolRequest) (*FlushTxpoolResponse, error)\n\t// GetOutputHistogram Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount.\n\t// RingCT outputs counts as 0 amount.\n\tGetOutputHistogram(req *GetOutputHistogramRequest) (*GetOutputHistogramResponse, error)\n\t// GetVersion Give the node current version\n\tGetVersion() (*GetVersionResponse, error)\n\t// GetCoinbaseTxSum Get the coinbase amount and the fees amount for n last blocks starting at particular height\n\tGetCoinbaseTxSum(req *GetCoinbaseTxSumRequest) (*GetCoinbaseTxSumResponse, error)\n\t// GetFeeEstimate Gives an estimation on fees per byte.\n\tGetFeeEstimate(req *GetFeeEstimateRequest) (*GetFeeEstimateResponse, error)\n\t// GetAlternateChains Display alternative chains seen by the node.\n\tGetAlternateChains() (*GetAlternateChainsResponse, error)\n\t// RelayTx Relay a list of transaction IDs.\n\tRelayTx(req *RelayTxRequest) (*RelayTxResponse, error)\n\t// SyncInfo Get synchronisation informations\n\tSyncInfo() (*SyncInfoResponse, error)\n\t// GetTxpoolBacklog Get all transaction pool backlog\n\tGetTxpoolBacklog() (*GetTxpoolBacklogResponse, error)\n\t// GetOutputDistribution Alias: None.\n\tGetOutputDistribution(req *GetOutputDistributionRequest) (*GetOutputDistributionResponse, error)\n}\n```\n\n## Contributing\n\nPR's are welcome. Please read [CONTRIBUTING.md](https://github.com/MarinX/monerorpc/blob/master/CONTRIBUTING.md) for more info\n\n## FAQ\n\n### There is a method missing, can I use this library?\n\nYes, client has a `Do` method which accepts any struct. Example:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/MarinX/monerorpc\"\n)\n\nfunc main() {\n\t// create a new client for Testnet\n\tclient := monerorpc.New(monerorpc.TestnetURI, nil)\n\n\t// if your monerod is protected, set username/password\n\tclient.SetAuth(\"username\", \"password\")\n\n\t// define request / response model\n\tvar req struct{}\n\tvar res struct{}\n\n\t// call RPC endpoint that is not documented\n\terr := client.Do(\"rpc_method_name\", \u0026req, \u0026req)\n\tif err != nil {\n\t\tfmt.Println(\"error from RPC endpoint\", err)\n\t}\n\n}\n\n```\n\n### I found a bug/issue\n\nPlease submit an issue on github or if you know how to fix it, PR's are welcome.\n\n### Version of the docs has changed, what now?\n\nI will try to update the client as per docs changes. You are free to create an issue to notify me. I dont monitor monero docs 24/7 :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinx%2Fmonerorpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarinx%2Fmonerorpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarinx%2Fmonerorpc/lists"}