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 🙏

© 2026 – Pkg Stats / Ryan Hefner

entradex-cli

v0.0.3

Published

CLI for DNSE API - A Vietnamese securities trading platform.

Readme

entradex-cli

CLI for DNSE API - A Vietnamese securities trading platform.

Installation

bun install

Configuration

The CLI requires API credentials to authenticate with the DNSE API. You can provide credentials in three ways (in order of priority):

1. Config File (Recommended)

Store credentials locally in ~/.entradex-cli/config.json:

bun run index.ts config set --key "your-api-key" --secret "your-api-secret"
# Or run interactively:
bun run index.ts config set

View current configuration:

bun run index.ts config get

Clear stored credentials:

bun run index.ts config clear

2. Environment Variables

export DNSE_API_KEY="your-api-key"
export DNSE_API_SECRET="your-api-secret"

3. Command Line Options

bun run index.ts --api-key "your-api-key" --api-secret "your-api-secret" <command>

Usage

bun run index.ts [global-options] [command]

Global Options

| Option | Description | |--------|-------------| | --api-key <key> | DNSE API key | | --api-secret <secret> | DNSE API secret | | --base-url <url> | DNSE API base URL (default: https://openapi.dnse.com.vn) | | --debug | Enable debug mode to see request details | | -V, --version | Output the version number | | -h, --help | Display help for command |

Commands

Config

Manage API credentials configuration.

bun run index.ts config set [--key <key>] [--secret <secret>] [--url <url>]
bun run index.ts config get
bun run index.ts config clear

Account

Account management commands.

# List all accounts
bun run index.ts account list

# Get account balances
bun run index.ts account balances <accountNo>

# Query loan packages
bun run index.ts account loan-packages <accountNo> <marketType> [--symbol <symbol>]

Trade

Trading operations.

# Place a new order
bun run index.ts trade order <marketType> <symbol> <side> <orderType> <price> <quantity> <tradingToken> [--price-stop <price>]

# Modify an existing order
bun run index.ts trade modify <accountNo> <orderId> <marketType> <symbol> <side> <orderType> <price> <quantity> <tradingToken> [--price-stop <price>]

# Cancel an order
bun run index.ts trade cancel <accountNo> <orderId> <marketType> <tradingToken>

Parameters:

  • marketType: Market type (e.g., HOSE, HNX, UPCOM)
  • symbol: Stock symbol (e.g., VIC, VCB)
  • side: Order side (buy or sell)
  • orderType: Order type (e.g., lo, lo_to, mp, mok)
  • price: Order price
  • quantity: Order quantity
  • tradingToken: Trading token (obtained via dnse auth create-token)

Order

Order management commands.

# List current orders
bun run index.ts order list <accountNo> <marketType>

# Get order details
bun run index.ts order detail <accountNo> <orderId> <marketType>

# Get order history
bun run index.ts order history <accountNo> <marketType> [--from <date>] [--to <date>] [--page-size <size>] [--page-index <index>]

# Get executed deals
bun run index.ts order deals <accountNo> <marketType>

Market

Market data commands.

# Get security definition
bun run index.ts market secdef <symbol> [--board-id <id>]

# Get PPSE (Price Priority Stream Event) data
bun run index.ts market ppse <accountNo> <marketType> <symbol> <price> <loanPackageId>

Auth

Authentication and token management.

# Send OTP via email
bun run index.ts auth send-otp <email> [--otp-type <type>]

# Create trading token
bun run index.ts auth create-token <otpType> <passcode>

Dry Run

Test commands without making actual API calls.

bun run index.ts dry-run accounts
bun run index.ts dry-run balances <accountNo>
bun run index.ts dry-run order <marketType> <symbol> <side> <orderType> <price> <quantity> [--price-stop <price>]

Examples

Setting up credentials

bun run index.ts config set

Check account balances

bun run index.ts account balances 123456

Place a buy order

# First, create a trading token
bun run index.ts auth send-otp [email protected]
# Enter OTP when received
bun run index.ts auth create-token smart_otp YOUR_PASSCODE

# Place the order
bun run index.ts trade order HOSE VIC buy lo 15000 100 YOUR_TRADING_TOKEN

View order history

bun run index.ts order history 123456 HOSE --from 2025-01-01 --to 2025-01-31 --page-size 50

Debug mode

# Enable debug to see request details
bun run index.ts --debug account list

Development

This project was created using bun init in bun v1.2.22. Bun is a fast all-in-one JavaScript runtime.

Project Structure

entradex-cli/
├── index.ts           # CLI entry point
├── config.ts          # Configuration management
├── commands/          # CLI command modules
│   ├── account.ts
│   ├── auth.ts
│   ├── config.ts
│   ├── dry-run.ts
│   ├── market.ts
│   ├── order.ts
│   ├── trade.ts
│   └── utils.ts
└── sdk/               # DNSE API client
    ├── client.ts
    └── common.ts