1.0.0 • Published 10 years ago

wallet-client v1.0.0

Weekly downloads
34
License
-
Repository
bitbucket
Last release
10 years ago

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.

1.0.0

10 years ago

0.5.0

10 years ago

0.4.0

10 years ago

0.3.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago