1.0.0 • Published 5 years ago

raiden-client-js v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

raiden-client-js

Lightweight, well-documented and clean Javascript client library for Raiden API, written in typescript. For more documentation visit our Github page

Getting Started

Installing

To install library using npm:

npm install raiden-client-js

Example usage in typescript:

import {RaidenClient} from 'raiden-client-js';
...

const client = new RaidenClient({
   host: 'http://localhost:5001',
   apiVersion: 'v1' 
});

const myAddress = await client.addressesClient.get();
client.connectionsClient.joinTokenNetwork('0x2a65Aca4D5fC5B5C859090a6c34d164135398226', {
    funds: 1337,
});

const payment = await paymentsClient.initiatePayment(
            '0x2a65Aca4D5fC5B5C859090a6c34d164135398226',
            '0x61C808D82A3Ac53231750daDc13c777b59310bD9',
            {
                amount: 200,
                identifier: 42
            }
        );

For more information about Raiden API please visit: Raiden API

Development

Testing

Tests are written using jasmine and nock for server mocking. To run unit tests use:

npm run test

Generating documentation

Docs are generated using typedoc in the /docs folder. To generate docs use:

npm run generate:docs