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

backpack-market-sdk

v0.1.3

Published

A TypeScript SDK for interacting with the Backpack Exchange API.

Downloads

6

Readme

backpack-market SDK

This SDK provides TypeScript developers with a simplified interface to interact with the Backpack Exchange API, abstracting away the complexities of authentication and request signing.

Documentation: Backpack Exchange API Docs

This is a third-party SDK and not officially provided by Backpack Exchange.

Authentication

The SDK handles authenticated requests using ED25519 keypair signing, necessary for operations that mutate state.

Installation

# Install with npm
npm install backpack-market-sdk

# Install with yarn
yarn add backpack-market-sdk

Usage

Market API

import { MarketAPI } from "backpack-market-sdk";

const marketApi = new MarketAPI();

async function main() {
  const assets = await marketApi.getAssets();
  console.log(assets);
}

main();

Authenticated API

import { AuthenticatedAPI } from "backpack-market-sdk";

const apiKey = "your_api_key";
const secretKey = "your_secret_key";
const authenticatedApi = new AuthenticatedAPI({
  apiKey,
  secretKey,
});

async function main() {
  const balances = await authenticatedApi.getBalances();
  console.log(balances);
}

main();

Features

  • Market Data Access: Fetch prices, market statistics, and historical trades.
  • Account Management: Retrieve balances, deposit addresses, and withdrawal history.
  • Trading Operations: Execute orders, manage trades, and access order history.

Market APIs

These are public endpoints that provide market data such as asset prices, market statistics, and historical trade data.

| Function | Description | | ----------------------- | -------------------------------------- | | getAssets() | Retrieves all available assets. | | getMarkets() | Fetches supported market pairs. | | getTicker() | Gets ticker information for a symbol. | | getTickers() | Obtains tickers for all markets. | | getDepth() | Retrieves the depth of the order book. | | getKlines() | Fetches K-line data for charting. | | getStatus() | Checks the exchange's system status. | | getPing() | Tests the API's connectivity. | | getSystemTime() | Gets the current system time. | | getRecentTrades() | Retrieves recent trades for a symbol. | | getHistoricalTrades() | Fetches historical trades data. |

Authenticated APIs

These endpoints require authentication and are used for account-specific operations like trading, deposits, withdrawals, and account management.

| Function | Description | | --------------------- | ---------------------------------------- | | getBalances() | Retrieves account balances. | | getDeposits() | Fetches deposit history. | | getDepositAddress() | Gets a deposit address for a blockchain. | | getWithdrawals() | Retrieves withdrawal history. | | requestWithdrawal() | Initiates a withdrawal. | | getOrderHistory() | Fetches the history of orders. | | getFillHistory() | Retrieves historical fills. | | getOpenOrder() | Gets an open order. | | cancelOrder() | Cancels an order. | | executeOrder() | Executes a new order. | | getOpenOrders() | Retrieves all open orders. | | cancelOpenOrders() | Cancels all open orders for a symbol. |