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

dnse-client

v1.0.0

Published

JS library for DNSE exchange

Downloads

3

Readme

DNSEClient TypeScript Library

DNSEClient is a TypeScript library for interacting with the DNSE services API. It provides methods for user authentication, fetching account information, and performing trading operations. This library aims to simplify the integration process for developers looking to leverage DNSE services.

Features

  1. User Authentication
  2. Email OTP Handling
  3. Fetch Trading Token
  4. Retrieve Sub-Accounts
  5. Get Account Balance
  6. Get Loan Packages
  7. Place Orders
  8. List Orders
  9. Cancel Orders
  10. List Positions

Installation

To use DNSEClient in your project, install it via npm:

npm install dnse-client

Initialize DNSEClient

const client = new DNSEClient();

User Authentication Login with username and password to get an authentication token:

const token = await client.login("yourUsername", "yourPassword");

Request Email OTP Request an email OTP using the authentication token:

await client.getEmailOtp(token);

Get Trading Token Fetch a trading token using the OTP:

const tradingToken = await client.getTradingToken("yourOtp", "otpType", token);

Retrieve Sub-Accounts Get a list of sub-account IDs:

const subAccounts = await client.subAccounts(token);

Get Account Balance Fetch the account balance for a specific sub-account:

const accountBalance = await client.accountBalance("subAccountId", token);

Get Loan Packages Retrieve loan packages for a specific sub-account and asset type:

const loanPackages = await client.getLoanPackages("subAccountId", "spot", token);

Place Order Place an order for a specific sub-account:

const order = await client.placeOrder(
"subAccountId",
"symbol",
"buy",
100,
10.5,
"orderType",
12345,
"spot",
token,
tradingToken
);

List Orders List all orders for a specific sub-account and asset type:

const orders = await client.orderList("subAccountId", "spot", token);

Cancel Order Cancel a specific order:

await client.cancelOrder("orderId", "subAccountId", "spot", token, tradingToken);

List Positions List all positions for a specific sub-account and asset type:

const positions = await client.positionList("subAccountId", "spot", token);

Contributing We welcome contributions to improve DNSEClient. Please follow these steps to contribute:

Fork the repository. Create a new branch with a descriptive name. Make your changes and commit them. Push your changes to your fork. Submit a pull request with a detailed description of your changes. License This project is licensed under the MIT License. See the LICENSE file for details.

Support If you encounter any issues or have questions, feel free to open an issue on GitHub.

Acknowledgements We thank the DNSE team for providing the API and documentation that made this library possible.

Feel free to use this template as a starting point for your project's README. Customize it as needed to fit your project's specific details and requirements.