{"id":15146964,"url":"https://github.com/omani/go-xmrto-client","last_synced_at":"2025-10-24T01:31:16.161Z","repository":{"id":56446601,"uuid":"214264468","full_name":"omani/go-xmrto-client","owner":"omani","description":"A xmr.to client written in Go","archived":true,"fork":false,"pushed_at":"2025-02-08T02:36:36.000Z","size":97,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-08T03:23:38.409Z","etag":null,"topics":["client","golang","monero","xmrto"],"latest_commit_sha":null,"homepage":null,"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/omani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-10T19:07:52.000Z","updated_at":"2025-02-08T02:37:43.000Z","dependencies_parsed_at":"2022-08-15T18:50:57.643Z","dependency_job_id":null,"html_url":"https://github.com/omani/go-xmrto-client","commit_stats":null,"previous_names":["omani/go-xmrto-client","monero-ecosystem/go-xmrto-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omani%2Fgo-xmrto-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omani%2Fgo-xmrto-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omani%2Fgo-xmrto-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omani%2Fgo-xmrto-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omani","download_url":"https://codeload.github.com/omani/go-xmrto-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237901378,"owners_count":19384384,"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":["client","golang","monero","xmrto"],"created_at":"2024-09-26T12:21:11.612Z","updated_at":"2025-10-24T01:31:14.851Z","avatar_url":"https://github.com/omani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GO XMR.TO Client\n================\n\n[![GoDoc](https://godoc.org/github.com/monero-ecosystem/go-xmrto-client?status.svg)](https://godoc.org/github.com/monero-ecosystem/go-xmrto-client)\n\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/monero-ecosystem/go-xmrto-client/raw/master/media/img/icon.png\" alt=\"Logo\" width=\"300\" /\u003e\n\u003c/p\u003e\n\nA client implementation for the [xmr.to](https://xmr.to) service written in go.\n\n# NOTICE\nThe xmr.to service shut down long time ago. This repo has been archived.\n\n### Installation\n\n```sh\ngo get -u github.com/monero-ecosystem/go-xmrto-client\n```\n\n#### Example code:\n\n```Go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/monero-ecosystem/go-xmrto-client\"\n)\n\nfunc main() {\n\t// initiate a new client for the testnet\n\tclient := xmrto.New(\u0026xmrto.Config{Testnet: true})\n\n\t// here we check if we run the programm with a check parameter.\n\t// in case we already got a secret-key from xmr.to we can track the order.\n\tif len(os.Args) \u003e 2 {\n\t\tif os.Args[1] == \"check\" {\n\t\t\tcheckorder, err := client.GetOrderStatus(\u0026xmrto.RequestGetOrderStatus{UUID: os.Args[2]})\n\t\t\tcheckerr(err)\n\n\t\t\tlog.Println(string(prettyPrintJSON(checkorder)))\n\t\t\tfmt.Printf(\"Your order has state: %s\\n\", checkorder.State)\n\n\t\t\treturn\n\t\t}\n\t}\n\t// otherwise\n\n\t// get order parameters:\n\t// - how much bitcoin can we send?\n\t// - what is the upper limit? lower limit?\n\t// - the current exchange rate (price) of the btc amount we want to send\n\t// - etc.\n\tgetorder, err := client.GetOrderParameters()\n\tcheckerr(err)\n\n\t// pretty print.\n\tlog.Println(string(prettyPrintJSON(getorder)))\n\n\t// let's create an order with 0.001 btc.\n\tcreateorder, err := client.CreateOrder(\u0026xmrto.RequestCreateOrder{\n\t\tBTCAmount:      .001,\n\t\tBTCDestAddress: \"2N5AYGnYKM7zgTe1n8P7mjUE3DavD1ub7Zs\", // this is the testnet btc address of xmr.to itself.\n\t})\n\tcheckerr(err)\n\n\tlog.Println(string(prettyPrintJSON(createorder)))\n\n\t// we got a secret-key from xmr.to (for later).\n\tfmt.Printf(\"UUID (secret key) is: %s\\n\", createorder.UUID)\n\n\t// important: give it time to let \"CreateOrder\" to settle down\n\t// before we query our order.\n\ttime.Sleep(time.Second * 1)\n\n\t// now check the order state with the secret-key\n\t// we received from xmr.to for this particular order.\n\torderstatus, err := client.GetOrderStatus(\u0026xmrto.RequestGetOrderStatus{UUID: createorder.UUID})\n\tcheckerr(err)\n\n\tlog.Println(string(prettyPrintJSON(orderstatus)))\n\n\t// print a nice message to the user\n\t// how much xmr to deposit to which xmr address.\n\tfmt.Printf(\"Please deposit %f to Monero address: %s\\n\", orderstatus.XMRAmountTotal, orderstatus.XMRReceivingSubAddress)\n\n\treturn\n}\n\n/* helper functions */\nfunc prettyPrintJSON(data interface{}) (pretty []byte) {\n\tpretty, _ = json.MarshalIndent(data, \"\", \"    \")\n\treturn\n}\n\nfunc checkerr(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n# Run the code\n```Go\ngo run main.go\n```\nto create an order, or:\n```Go\ngo run main.go check \u003cyour secret-key\u003e\n```\nto check an order about its state\n\n# Contribution\n* You can fork this, extend it and contribute back.\n* You can contribute with pull requests.\n\n# Donations\nYou can make me happy by donating Bitcoin to the following address:\n```\nbc1qgezvfp4s0xme8pdv6aaqu9ayfgnv4mejdlv3tx\n```\n\n# LICENSE\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomani%2Fgo-xmrto-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomani%2Fgo-xmrto-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomani%2Fgo-xmrto-client/lists"}