Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moneropay/go-monero
A Monero RPC Wallet client implementation written in Golang.
https://github.com/moneropay/go-monero
monero rpc wallet xmr
Last synced: about 2 months ago
JSON representation
A Monero RPC Wallet client implementation written in Golang.
- Host: GitHub
- URL: https://github.com/moneropay/go-monero
- Owner: moneropay
- License: mit
- Created: 2021-06-12T18:29:25.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-10-13T22:44:44.000Z (about 1 year ago)
- Last Synced: 2024-06-20T05:10:57.265Z (7 months ago)
- Topics: monero, rpc, wallet, xmr
- Language: Go
- Homepage: https://gitlab.com/moneropay/go-monero
- Size: 285 KB
- Stars: 14
- Watchers: 0
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# go-monero
[![GoDoc](https://godoc.org/gitlab.com/moneropay/go-monero/walletrpc?status.svg)](https://godoc.org/gitlab.com/moneropay/go-monero/walletrpc)This package provides Golang bindings for monero-wallet-rpc calls.
It also contains functions for XMR/atomic unit conversion.Unlike other wallet RPC bindings, this package is actively maintained and it is complete
with all the RPC methods. While using this package for our other project [MoneroPay](https://gitlab.com/moneropay/moneropay),
we have realized that all the other forks don't handle optional parameters correctly and send them anyway,
therefore causing bugs.### Installation
```sh
go get -u gitlab.com/moneropay/go-monero/walletrpc
```### Example
```sh
monero-wallet-rpc --detach \
--rpc-bind-port 18083 \
--wallet-file /home/moneropay/wallet \
--password s3cure \
--daemon-login kernal:s3cure \
--rpc-login kernal:s3cure
```
```go
package mainimport (
"context"
"fmt"
"log"
"net/http""github.com/gabstv/httpdigest"
"gitlab.com/moneropay/go-monero/walletrpc"
)func main() {
// username: kernal, password: s3cure
client := walletrpc.New(walletrpc.Config{
Address: "http://127.0.0.1:18083/json_rpc",
Client: &http.Client{
Transport: httpdigest.New("kernal", "s3cure"), // Remove if no auth.
},
})
resp, err := client.GetBalance(context.Background(), &walletrpc.GetBalanceRequest{})
if err != nil {
log.Fatal(err)
}
fmt.Println("Total balance:", walletrpc.XMRToDecimal(resp.Balance))
fmt.Println("Unlocked balance:", walletrpc.XMRToDecimal(resp.UnlockedBalance))
}
```### Contributing
Submit issues and merge requests only on [GitLab](https://gitlab.com/moneropay/go-monero/).\
Alternatively, you can send us patch files via email at [[email protected]](mailto:[email protected]).\
For development related discussions and questions join [#moneropay:kernal.eu](https://matrix.to/#/#moneropay:kernal.eu).