{"id":13714251,"url":"https://github.com/gabstv/go-monero","last_synced_at":"2025-10-06T11:31:03.312Z","repository":{"id":50321399,"uuid":"119194097","full_name":"gabstv/go-monero","owner":"gabstv","description":"A Monero RPC Wallet client implementation written in Go (Golang)","archived":true,"fork":false,"pushed_at":"2023-09-19T14:27:45.000Z","size":80,"stargazers_count":60,"open_issues_count":5,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-13T11:53:15.035Z","etag":null,"topics":["go","golang","monero","monero-wallet-rpc","rpc-client"],"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/gabstv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-27T19:10:38.000Z","updated_at":"2024-11-13T09:34:25.000Z","dependencies_parsed_at":"2024-06-18T22:36:22.470Z","dependency_job_id":"f1500910-1310-4bc6-a798-06db22828f03","html_url":"https://github.com/gabstv/go-monero","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gabstv/go-monero","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabstv%2Fgo-monero","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabstv%2Fgo-monero/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabstv%2Fgo-monero/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabstv%2Fgo-monero/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabstv","download_url":"https://codeload.github.com/gabstv/go-monero/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabstv%2Fgo-monero/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278601955,"owners_count":26013989,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","monero","monero-wallet-rpc","rpc-client"],"created_at":"2024-08-02T23:01:55.667Z","updated_at":"2025-10-06T11:31:02.951Z","avatar_url":"https://github.com/gabstv.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# go-monero\n\nThis package is a hub of monero related tools for Go. At this time, only the Wallet RPC Client is available.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/gabstv/go-monero)](https://goreportcard.com/report/github.com/gabstv/go-monero)\n[![Build Status](https://travis-ci.org/gabstv/go-monero.svg?branch=master)](https://travis-ci.org/gabstv/go-monero)\n\n## Wallet RPC Client\n\n[![GoDoc](https://godoc.org/github.com/gabstv/go-monero/walletrpc?status.svg)](https://godoc.org/github.com/gabstv/go-monero/walletrpc)\n\nThe ```go-monero/walletrpc``` package is a RPC client with all the methods of the v0.11.0.0 release.\nIt does support digest authentication, [however I don't recommend using it alone (without https).](https://en.wikipedia.org/wiki/Digest_access_authentication#Disadvantages) If there is a need to split the RPC client and server into separate instances, you could put a proxy on the instance that contains the RPC server and check the authenticity of the requests using https + X-API-KEY headers between the proxy and this RPC client (there is an example about this implementation below)\n\n### Installation\n\n```sh\ngo get -u github.com/gabstv/go-monero/walletrpc\n```\n\n### Usage\n\nThe simplest way to use walletrpc is if you have both the server (monero-wallet-rpc) and the client on the same machine.\n\n#### Running monero-wallet-rpc:\n\n```sh\nmonero-wallet-rpc --testnet --wallet-file ~/testnet/mywallet.bin --rpc-bind-port 18082 --disable-rpc-login\n```\n\nGo:\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/gabstv/go-monero/walletrpc\"\n)\n\nfunc main() {\n\t// Start a wallet client instance\n\tclient := walletrpc.New(walletrpc.Config{\n\t\tAddress: \"http://127.0.0.1:18082/json_rpc\",\n\t})\n\n\t// check wallet balance\n\tbalance, unlocked, err := client.GetBalance()\n\n\t// there are two types of error that can happen:\n\t//   connection errors\n\t//   monero wallet errors\n\t// connection errors are pretty much unicorns if everything is on the\n\t// same instance (unless your OS hit an open files limit or something)\n\tif err != nil {\n\t\tif iswerr, werr := walletrpc.GetWalletError(err); iswerr {\n\t\t\t// it is a monero wallet error\n\t\t\tfmt.Printf(\"Wallet error (id:%v) %v\\n\", werr.Code, werr.Message)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tfmt.Println(\"Error:\", err.Error())\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Println(\"Balance:\", walletrpc.XMRToDecimal(balance))\n\tfmt.Println(\"Unlocked balance:\", walletrpc.XMRToDecimal(unlocked))\n\n\t// Make a transfer\n\tres, err := client.Transfer(walletrpc.TransferRequest{\n\t\tDestinations: []walletrpc.Destination{\n\t\t\t{\n\t\t\t\tAddress: \"45eoXYNHC4LcL2Hh42T9FMPTmZHyDEwDbgfBEuNj3RZUek8A4og4KiCfVL6ZmvHBfCALnggWtHH7QHF8426yRayLQq7MLf5\",\n\t\t\t\tAmount:  10000000000, // 0.01 XMR\n\t\t\t},\n\t\t},\n\t\tPriority: walletrpc.PriorityUnimportant,\n\t\tMixin:    1,\n\t})\n\tif err != nil {\n\t\tif iswerr, werr := walletrpc.GetWalletError(err); iswerr {\n\t\t\t// insufficient funds return a monero wallet error\n\t\t\t// walletrpc.ErrGenericTransferError\n\t\t\tfmt.Printf(\"Wallet error (id:%v) %v\\n\", werr.Code, werr.Message)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tfmt.Println(\"Error:\", err.Error())\n\t\tos.Exit(1)\n\t}\n\tfmt.Println(\"Transfer success! Fee:\", walletrpc.XMRToDecimal(res.Fee), \"Hash:\", res.TxHash)\n}\n```\n\n### Using Digest Authentication\n\n```sh\nmonero-wallet-rpc --testnet --rpc-bind-ip 127.0.0.1 --rpc-bind-port 29567 --rpc-login john:doe --wallet-file ~/testnet/wallet_03.bin\n```\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/gabstv/go-monero/walletrpc\"\n\t\"github.com/gabstv/httpdigest\"\n)\n\nfunc main() {\n\t// username: john\n\t// password: doe\n\tt := httpdigest.New(\"john\", \"doe\")\n\n\tclient := walletrpc.New(walletrpc.Config{\n\t\tAddress:   \"http://127.0.0.1:29567/json_rpc\",\n\t\tTransport: t,\n\t})\n\n\tbalance, unlocked, err := client.GetBalance()\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(\"balance\", walletrpc.XMRToDecimal(balance))\n\tfmt.Println(\"unlocked balance\", walletrpc.XMRToDecimal(unlocked))\n}\n```\n\n### Using a proxy\n\nYou can use a proxy to be in between this client and the monero RPC server. This way you can use a safe encryption tunnel around the network.\n\n#### Starting the RPC server\n\n```sh\nmonero-wallet-rpc --testnet --wallet-file ~/testnet/mywallet.bin --rpc-bind-port 18082 --disable-rpc-login\n```\n\n#### Starting a proxy server\n\nThis example uses sandpiper (```github.com/gabstv/sandpiper/sandpiper```) but you could also use nginx or apache\n\nsandpiper config.yml:\n```yaml\ndebug: true\n#listen_addr:     :8084\nlisten_addr_tls: :23456\nfallback_domain: moneroproxy\nroutes:\n  - \n    domain:        moneroproxy\n    out_conn_type: HTTP\n    out_addr:      localhost:18082\n    auth_mode:  apikey\n    auth_key:   X-API-KEY\n    auth_value: 55c12fca1b994455d3ec1795bdc82cca\n    tls_cert_file: moneroproxy.cert.pem\n    tls_key_file:  moneroproxy.key.pem\n```\n\nThe Go program is similar, but it uses an API-KEY:\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n    \"os\"\n    \"net/http\"\n    \"crypto/tls\"\n\n\t\"github.com/gabstv/go-monero/walletrpc\"\n)\n\nfunc main() {\n\t// Start a wallet client instance\n\tclient := walletrpc.New(walletrpc.Config{\n        Address: \"http://127.0.0.1:23456/json_rpc\",\n        CustomHeaders: map[string]string{\n\t\t\t\"X-API-KEY\": \"55c12fca1b994455d3ec1795bdc82cca\", // we use the same key defined above\n        },\n\t\tTransport: \u0026http.Transport{\n\t\t\tTLSClientConfig: \u0026tls.Config{\n\t\t\t\tInsecureSkipVerify: true, // WARNING: instead of this, you can\n\t\t\t\t// provide (or install) a certificate to make it\n\t\t\t\t// really secure with Certificates: []tls.Certificate{},\n\t\t\t},\n\t\t},\n\t})\n\n\t// check wallet balance\n\tbalance, unlocked, err := client.GetBalance()\n\n\t// there are two types of error that can happen:\n\t//   connection errors\n\t//   monero wallet errors\n\t// connection errors are pretty much unicorns if everything is on the\n\t// same instance (unless your OS hit an open files limit or something)\n\tif err != nil {\n\t\tif iswerr, werr := walletrpc.GetWalletError(err); iswerr {\n\t\t\t// it is a monero wallet error\n\t\t\tfmt.Printf(\"Wallet error (id:%v) %v\\n\", werr.Code, werr.Message)\n\t\t\tos.Exit(1)\n\t\t}\n\t\tfmt.Println(\"Error:\", err.Error())\n\t\tos.Exit(1)\n\t}\n\n\tfmt.Println(\"Balance:\", walletrpc.XMRToDecimal(balance))\n    fmt.Println(\"Unlocked balance:\", walletrpc.XMRToDecimal(unlocked))\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabstv%2Fgo-monero","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabstv%2Fgo-monero","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabstv%2Fgo-monero/lists"}