Giter Site home page Giter Site logo

backpack-market-sdk's Introduction

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.

backpack-market-sdk's People

Contributors

canccevik avatar tolgaand avatar

Stargazers

c4nzin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.