Please login or register.

RCP WALLET NODE.JS PACKAGE

Good afternoon folks, I coded a little bit on a node.js package for managing wallet in rpc mode.

You can find code on github : https://github.com/netmonk/moneronjs

You can find the very basic stuff i succeeded to implement : - getaddress - getbalance - get_payment (with a Payment_id) - get_bulk_payment

So far so good, the test.js demonstrates that it works.

I will implement transfer very soon, and also mechanism to get payment and validate it.

Have fun forking, welcome committing, and happy coding :)

PS: for all the Javascript Nazi, i'm just a beginner in this, so any comments and advice are very welcome.

Replies: 3
netmonk edited 9 years ago Weight: -584 | Link [ - ]

A nodejs Monero rpc wallet management package.

Under heavy developpment.

Currently for using it insert : var wallet = require('./moneronjs.js');

And create a wallet object like this : var wal = new wallet.Wallet("127.0.0.1","8082");

Without any arguments it will try to connect to localhost port 8082 (default rpc daemon port for simplewallet).

test.js

provide basic examples of the current methods available with the wallet object. Beware to replace payment_id with valid value of your wallet.

wallet available method

Currently available :

getaddress(callback): give back the address of the wallet

getbalance(callback): give the current unlocked balance of wallet

getpaymentfromid(payment-id, callback): return the whole transactions associated to the provided payment_id

incoming_transfers(status): provide the list of tx available(unSpend) Unavailable(spent) and All

getcypheredpaymentid(Uid,amount, password): return a valid payment_id (64char hex string) which is the encrypted using AES-256-CTR of the string "unix_timestampuidamount" (uid is a 10 digit number and amount is a 9 digit number)

getrandompaymentid: return a random hexstring of 64 chars length (valid payment_id)

davidlatapie edited 9 years ago Replies: 1 | Weight: -603 | Link [ - ]

How does RPC mode differs from CLI mode?

Reply to: davidlatapie
netmonk edited 9 years ago Weight: -601 | Link [ - ]

In rcp mode, you can only interact with wallet through JSON RPC Request. You can perform is manually with the curl command, the main purpose is to be used by another program in "slave" mode.