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

@dipcoinlab/perp-ts-library

v0.0.22

Published

Perpetual exchange library housing helper methods, classes to interact with Dipcoin protocol deployed on Sui

Downloads

488

Readme

perp-ts-library

perp-ts-library is a TypeScript library for interacting with DipCoin perpetual contract smart contracts on-chain, providing complete functionality for interacting with the Dipcoin protocol.

🚀 Features

  • Complete Protocol Integration: Full support for all DipCoin perpetual trading operations
  • Type Safety: Built with TypeScript for enhanced developer experience
  • Modular Design: Clean separation of concerns with dedicated modules
  • Comprehensive Documentation: Detailed guides and examples for all use cases
  • Auto Split Coin: Automatic coin splitting functionality for seamless deposits

🛠 Core Components

TransactionBuilder

Class to transactions with the DipCoin protocol.

New Auto Split Features:

  • bank_depositWithAutoSplitTx() - Automatic coin splitting for deposits
  • bank_batchDepositWithAutoSplitTx() - Batch deposits with auto splitting
  • No need for external signer or manual splitCoin operations

OrderSigner

Handles order signing and verification for secure trading operations.

Market Operations

  • Order placement and management
  • Position tracking and management
  • Liquidation handling
  • Funding rate operations

💡 Auto Split Coin Feature

The library now includes automatic coin splitting functionality that eliminates the need for manual splitCoin operations:

Traditional Method (Before)

// 1. Manual split coin operation
const splitTx = await splitCoin(client, signer, coinType, amount);
const coinId = TransactionParse.getCreatedObjectIDs(splitTx)[0];

// 2. Deposit with split coin
const depositTx = await txBuilder.bank_depositTx({
    coinID: coinId,
    amount: amount,
    accountAddress: userAddress
});

Auto Split Method (Now)

// Single step - automatic coin splitting and deposit
const depositTx = await txBuilder.bank_depositWithAutoSplitTx({
    amount: amount,
    accountAddress: userAddress
});

Benefits

  • Simplified API: No need for external signer in deposit operations
  • Reduced Complexity: Single transaction instead of multiple steps
  • Better UX: Streamlined deposit process for end users
  • Batch Support: Automatic splitting for batch deposits

🧪 Development and Examples

Prerequisites

  • Node.js (v16 or higher)
  • Yarn package manager
  • Access to DipCoin protocol contracts

Installation

yarn install

Building the Project

yarn build

Documentation and Examples

Frontend and backend users can refer to the following documentation and examples:

📖 Generating API Reference

This project uses JSDoc format for comments and automatically generates documentation using TypeDoc.

npx typedoc src/

The generated documentation will be saved in the docs/api/ directory.