Market (Spot)

Documentation on interacting with Bitget's Spot Market Data API functions through the PENDAX Javascript SDK.

Get Single Ticker

Please refer to the official Bitget API Docs for the required parameters.

https://bitgetlimited.github.io/apidoc/en/spot/#get-single-ticker

Function name:

getSingleTicker()

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getSingleTicker(exchange) {
    try {
        let result = await exchange.getSingleTicker();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getSingleTicker(myBitgetAccount, 
    {
        symbol: "BTCUSDT_SPBL"
    })

Get All Tickers

Please refer to the official Bitget API Docs for the required parameters.

https://bitgetlimited.github.io/apidoc/en/spot/#get-all-tickers

Function name:

getAllTickers()

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getAllTickers(exchange) {
    try {
        let result = await exchange.getAllTickers();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getAllTickers(myBitgetAccount)

Get Market Trades

Please refer to the official Bitget API Docs for the required parameters.

https://bitgetlimited.github.io/apidoc/en/spot/#get-market-trades

Function name:

getMarketTrades()

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getMarketTrades(exchange) {
    try {
        let result = await exchange.getMarketTrades();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getMarketTrades(myBitgetAccount, 
    {
        symbol: "BTCUSDT_SPBL"
    })

Get Candle Data

Please refer to the official Bitget API Docs for the required parameters.

https://bitgetlimited.github.io/apidoc/en/spot/#get-candle-data

Function name:

getCandleData()

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getCandleData(exchange) {
    try {
        let result = await exchange.getCandleData();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

const result = await getCandleData(myBitgetAccount, 
    {
        symbol: "BTCUSDT_SPBL",
        period: "1min",
    })

Get Depth

Please refer to the official Bitget API Docs for the required parameters.

https://bitgetlimited.github.io/apidoc/en/spot/#get-depth

Function name:

getServerTime()

Usage:

import { createExchange } from "./exchanges/exchange.js";

  let myBitgetAccount = createExchange({
      exchange: "bitget",
      authenticate: "true",
      key: "myKeys",
      secret: "mySecret",
      passphrase: "myPassphrase",
      label: "bitget",
      marginType: "usdt"
});

async function getDepth(exchange) {
    try {
        let result = await exchange.getDepth();
        console.log(result);
    } catch (error) {
        console.log(error.message);
    }
}

    const result = await getDepth(myBitgetAccount , {
      symbol: "BTCUSDT_SPBL",
      type: "step0",
    });

Last updated