Skip to content

A JavaScript library to communicate with the Monero Wallet RPC

License

Notifications You must be signed in to change notification settings

Veeeetzzzz/monero-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monero-js - A JavaScript library for the Monero RPC.

Built from scratch, Monero-JS is a lightweight library to communicate with the Monero Wallet RPC. Minimal dependencies and focuses on security and scalability.

Download the CLI binaries from the official Monero Site

Most anti-virus/anti-malware will flag the monerod and other binaries as a virus, because they have been spotted in the wild as "XMR miners" and subject to abuse. Add the folder you downloaded to your exclusions to avoid problems during development. There is no risk to you or your machine when running monerod.exe and mining does not run by default when it monerod.exe is run.

You'll need to make sure:

  • monerod is running

Start monerod.exe & wait for it to finish syncing.

image

  • monero-wallet-rpc is running

Start the RPC with this command - replace args with your configs and make sure it's bound to your front end.

--wallet-file wallet --daemon-address="127.0.0.1:18081" --rpc-bind-ip 127.0.0.1 --rpc-bind-port 18083 --prompt-for-password --confirm-external-bind --rpc-access-control-origins="http://localhost:1234" --disable-rpc-login

Install locally

Clone repository/download the package.

Install the npm package/library locally with npm install /path/to/monero-rpc.

Note: this is the same as using npm install {package name} but I do not intend to publish this to the npm registery at this stage.

Usage

You can use any JavaScript framework of your choice.

First, import the library and create a new instance:

import MoneroWalletRPC from 'monero-rpc';

const wallet = new MoneroWalletRPC('http://127.0.0.1:18083/json_rpc');

Then add your methods as needed - use the methods documentation for full list of methods avalible.

To ensure all your methods can be called from a front end, you can launch unit tests with the files in /unit-tests-front-end

image

I recommend using Parcel for testing which is a very fast compared to the 30-40 seconds it takes to build in React/Next.js

image

Building your application

Use the index.html and index.js file as template. You want to reduce the amount of extra JavaScript needed, so pick the quickest way to deploy your application to keep the the dependencies low.

Even create-react-app is excessive for most applications so think about your technical stack.

Contributing

You can report issues or suggest feedback via the standard Github channels. Open an issue or suggestion and fill out the template.

About

A JavaScript library to communicate with the Monero Wallet RPC

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published