npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

onewallet-client-node

v0.2.6

Published

NodeJS client implementation for the One Wallet Service API

Downloads

3

Readme

One Wallet Client (NodeJS)

The One Wallet Client will be used for making requests into the One Wallet Service API.

Getting Started

/* Example usage */
import OneWalletServiceAPI from 'onewallet-client-node';

/* Use the constructor to setup */
let client = new OneWalletServiceAPI( {
    accessId: 'SAMPLE_PROVIDER',
    secretKey: 'X6VYZBFRS8qrqhwg28eQbyEcZmTSrE9G'
} );

The accessId and the secretKey will be provided by the operator.

One Wallet Client API

constructor ( )

The OneWalletServiceAPI constructor accepts an object with the following properties:

| Field | Required | Type | Description | Default | |---|---|---|---|---| | baseUrl | false | String | One wallet service base url | https://api.as2bet.com | | accessId | true | String | Service access id | | | secretKey | true | String | Service secret key | | | backoffInitialDelay | false | Number | Delay for request retry | 50 | | timeout | false | Number | request timeout | 3000 |

Input (Options)

{
    baseUrl: 'https://api.as2bet.com',
    accessId: 'SAMPLE_PROVIDER',
    secretKey: 'X6VYZBFRS8qrqhwg28eQbyEcZmTSrE9G',
    backoffInitialDelay: 50,
    timeout: 3000
}

authenticateUser ( )

This method will check the user's credentials and returns the user's information.

Input

{
    username: 'test_user1',
    password: 'pass'
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | username | true | String | User's username | | | password | true | String | User's password | |

Return Value

{
    userId: '56',
    balance: 250000.0000,
    nickname: 'zenoan',
    birthday: '1991-01-21',
    currency: 'USD',
    firstName: 'Elon',
    lastName: 'Musk',
    email: '[email protected]'
}

createGameSession ( )

This method creates a player game session. This method accepts a userId as input and returns a sessionId.

Input

{
    userId: '56'
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | userId | true | String | User's id | |

Return Value

{
    sessionId: '0ee89b10-e987-11e5-8b12-e5f8552670cc'
}

getUserInfo ( )

This API retrieves the player's information give it's id and the fields you want to retrieve.

Input

{
    userId: '56',
    fields: [ 'balance', 'currency', 'username', 'nickname', 'firstName', 'lastName', 'birthday', 'email' ]
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | userId | true | String | User's id | | | fields | true | Array | Fields to be retrieved | [ 'balance', 'currency', 'username', 'nickname', 'firstName', 'lastName', 'birthday', 'email' ] |

Return Value

{
    balance: 250000.0000,
    nickname: 'zenoan',
    birthday: '1991-01-21',
    currency: 'USD',
    firstName: 'Elon',
    lastName: 'Musk',
    email: '[email protected]'
}

Transfer Transactions

debit ( )

This method creates a DEBIT transaction for a specified game type.

Input

{
    userId: '56',
    sessionId: '0ee89b10-e987-11e5-8b12-e5f8552670cc',
    roundId: '43524335',
    amount: 58,
    gameType: 'Six Card Chinese',
    ...
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | userId | true | String | User's id | | | sessionId | true | String | Game session ID. Generate using the createGameSession ( ) API | | | roundId | true | String | Round Id | | | amount | true | Number | Debit transaction amount | | | gameType | true | String | Game type | | | ... | false | | Provider specific key-value inputs (you can add it here). | |

Return Value

{
    balance: 249942.0000
    currency: 'USD'
}

credit ( )

This method creates a CREDIT transaction for a specified game type.

Input

{
    userId: '56',
    sessionId: '0ee89b10-e987-11e5-8b12-e5f8552670cc',
    roundId: '43524335',
    amount: 58,
    gameType: 'Six Card Chinese',
    ...
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | userId | true | String | User's id | | | sessionId | true | String | Game session ID. Generate using the createGameSession ( ) API | | | roundId | true | String | Round Id | | | amount | true | Number | Debit transaction amount | | | gameType | true | String | Game type | | | ... | false | | Provider specific key-value inputs (you can add it here). | |

Return Value

{
    balance: 249942
    currency: 'USD'
}

cancelDebit ( )

This method will cancel a DEBIT transaction with the specified transactionId.

Input

{
    userId: '56',
    sessionId: '0ee89b10-e987-11e5-8b12-e5f8552670cc',
    debitTransactionId: 'c5c6ae90-e986-11e5-8b12-e5f8552670cc',
    gameType: 'Six Card Chinese',
    ...
}

| Field | Required | Type | Description | Default | |---|---|---|---|---| | userId | true | String | User's id | | | sessionId | true | String | Game session ID. Generate using the createGameSession ( ) API | | | debitTransactionId | true | String | Debit transaction ID UUID. | | | gameType | true | String | Game type | | | ... | false | | Provider specific key-value inputs (you can add it here). | |

Result Value

{
    balance: 249942
    currency: 'USD'
}