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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dv.net/js-client

v0.1.1

Published

TypeScript SDK for DV Net API

Readme

DV Net TypeScript Client

TypeScript SDK for DV Net API - a comprehensive solution for merchant integration with blockchain payment processing.

Extended Documentation

See https://docs.dv.net/ for full API reference and integration guides.

Installation

npm install @dv.net/js-client
yarn add @dv.net/js-client

Usage

Basic Setup

import { MerchantClient } from "@dv.net/js-client";

const client = new MerchantClient({
  xApiKey: 'your-api-key',
  host: 'https://api.example.com'
});

API Methods

Get Exchange Balances

const balances = await client.getExchangeBalances();

Get External Wallet

const wallet = await client.getExternalWallet({
  storeExternalId: 'store-123', // required
  email: '[email protected]',
  ip: '192.168.1.1',
  amount: '100',
  currency: 'Trx.Tron'
});

Get Processing Wallets Balances

const balances = await client.getProcessingWalletsBalances();

Get Store Currencies

const currencies = await client.getStoreCurrencies();

Get Store Currency Rate

const rate = await client.getStoreCurrencyRate({
  currencyId: 'BTC.Bitcoin'
});

Initialize Transfer

const withdrawal = await client.initializeTransfer({
  addressTo: '0x9260004698F0Ba0c8968aF9b2971154A883E7c75',
  currencyId: 'BTC.Bitcoin',
  amount: '50',
  requestId: '1'
});

Get Withdrawal Processing Status

const status = await client.getWithdrawalProcessingStatus({
  withdrawalId: '8a6f472c-9b59-419f-a101-07638cedc3fa'
});

Delete Withdrawal from Processing

await client.deleteWithdrawalFromProcessing({
  id: '8a6f472c-9b59-419f-a101-07638cedc3fa'
});

Get Hot Wallet Balances

const accounts = await client.getHotWalletBalances();

Using with Custom HTTP Client

import { MerchantClient, HttpClient } from '@dv.net/js-client';

class CustomHttpClient implements HttpClient {
  async request<T = any>(config: {
    method: string;
    url: string;
    data?: any;
    headers?: Record<string, string>;
  }): Promise<{
    data: T;
    status: number;
    statusText: string;
  }> {
    // Your custom HTTP implementation
    // ...
  }
}

const client = new MerchantClient({
  httpClient: new CustomHttpClient(),
  host: 'https://api.example.com',
  xApiKey: 'your-api-key'
});

Error Handling

The client now surfaces backend errors verbatim. When the API responds with an error, you receive the same shape:

{
  "errors": [
    { "message": "email must be a valid email address", "field": "email" }
  ],
  "code": 422
}

For non-backend issues (network, configuration), the client throws a normalized error with the same structure and code set to 500:

{
  "errors": [ { "message": "Network error" } ],
  "code": 500
}

Example usage:

try {
  const wallet = await client.getExternalWallet({
    storeExternalId: 'store-123',
    email: '[email protected]'
  });
} catch (error: any) {
  // error has shape: { errors: { message, field? }[], code: number }
  console.error(error);
}

License

MIT