PsychicCat / monero-nodejs

Monero wallet management via JSON-RPC
MIT License
116 stars 61 forks source link

Using `fetch` for RPC requests #8

Closed amiuhle closed 6 years ago

amiuhle commented 7 years ago

This replaces #6

I tried rebasing my code onto dev-v10, but had difficulties with webpack and request being a node-only library. So I thought why not completely switch to fetch for making RPC calls, and this is what I came up with. Works in both node.js and the browser using webpack.

PsychicCat commented 7 years ago

This looks cool, thanks! I never thought about using this in the browser. I should have some time to test this out in the next couple days and I'll merge it soon.

amiuhle commented 7 years ago

Awesome, thanks!

Yeah, about testing... I think we need more tests, especially now that I've introduced browser vs node.js. I'll submit another PR if I ever get to it, but I'm building my own stuff around Monero right now and I stumble over so much stuff but just don't have enough time :(

Also, I think some JS code linting is necessary. I personally prefer js-standard, but eslint or something else with good editor and tooling support would be fine.