wallet-client

1.0.0 • Public • Published

Wallet Client

Node wallet client.

Installation

$ npm install wallet-client --save

Usage

var wallet = require('wallet-client');

wallet()
  .origin('http://your.web.site.com')
  .path('/wallet')
  .user(45)
  .transactions()
    .type(1)
    .order('asc')
    .get(function (err, results) {
      // ...
    });

Client methods

origin(url) – Set the url of the wallet server. Blank by default.

path(path) – Set the url path to the wallet. Blank by default.

user(id, [external]) – Returns a user object. Requires a user id. Set external to true if you are using use an external user id.

User methods

balance() – Returns a Balance object.

bonuses() – Returns a Bonuses object.

transactions() – Returns a Transactions object.

Balance methods

bonus(bool) – If set to true, returns bonuse balance.

get(callback) – Returns a user's balance.

Bonuses methods

endDate(date) – Omit bonuses after the specified date.

order(order) – Order the bonuses in asc or desc order. You may also pass an order id.

startDate(date) – Omit bonuses before the specified date.

Transactions methods

bonus(bool) – If set to true, returns bonus transactions.

endDate(date) – Omit transactions after the specified date.

get(callback) – Returns a user's transaction history.

order(order) – Order the transactions in asc or desc order. You may also pass an order id.

startDate(date) – Omit transactions before the specified date.

state(stateId) – Filter transactions by state.

type(typeId) – Filter transactions by type.

Readme

Keywords

Package Sidebar

Install

npm i wallet-client

Weekly Downloads

8

Version

1.0.0

License

none

Last publish

Collaborators

  • psirenny