0.13.40-beta • Published 3 months ago

@trac-network/tap-reader v0.13.40-beta

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Trac Core Reader for TAP Protocol

Trac Core Reader for TAP Protocol is a NodeJS-based application that provides decentralized access to indexed TAP Protocol data.

The reader basically represents a decentralized API to build upon Bitcoin Ordinal's TAP Protocol.

It sits on top of Holepunch (https://github.com/holepunchto), a set of libraries that enables decentralized data-storage and distribution.

You may run this reader within various restricted networks. Through holepunching, it will try to connect with its peers on the network through any means necessary, helping to maintain steady availability.

As a project/developer, you may use this reader in 3 different ways:

  • Utilizing the TracManager's native methods (see below)
  • Enabling REST Endpoints
  • Using websocket-based streaming
  • ... or all of the above combined.

If you do not intend to develop with this package but want to support the project, you may just run it in the background to help strengthen the network.

Trac Core Reader for TAP Protocol is open-source (MIT license) and in beta state, use it on your own risk as stated in the license.

How it works

The reader connects to the Trac network by subscribing to a channel to request indexing data. Currently the indexers behind this channel are not part of the entire Trac Core release yet but will be released at a later point (the actual writers).

Once a channel has been picked (in the config or upon start), the reader will try to look for peers and starts to share data, similar to how it works with for example with Bittorrent.

This data can then be used through the different APIs that this package provides for further processing within your apps.

Channel Hopping

Should indexer upgrades require a new channel to hop on, the new channel will be broadcasted through different means by the Trac project.

Ultimately, Trac will carefully roll out an entire system that allows for automated channel hopping as well as decentralized upgrade broadcasts.

The most recent channel is always pre-defined in the reader's config of this repo.

Requirements

  • Linux, Windows, MacOS
  • NodeJS 20+
  • 2-4 CPU Cores, 8GB RAM
  • 500GB SSD drive (make sure it's a good one)

Should work perfectly on Pi 3-5 and low Watts.

Installation

Either download this package using git clone or install it through npmjs (if you use npmjs, you'll need to specify your entry point yourself):

git clone https://github.com/Trac-Systems/tap-reader.git
npm i

Then CD into the package folder's root and start it using:

npm start

API Usage

Either use the reader diretly like so from within your application (please note that your app process will have exclusive access to the reader's db):

import TracManager from "./TracManager.mjs";

// Create an instance of TracManager
let tracCore = new TracManager();

// Initialize the reader for the TAP Protocol
await tracCore.initReader();

// Example: Retrieve transfer amount by inscription
let amount = await tracCore.tapProtocol.getTransferAmountByInscription('1b8e21761557bbf66c06ae3d8109764d0d8ec5d431b8291160b59ef28ffaab7ai0');

If rest is enabled, you can instead use the exposed endpoints. You may test these endpoints like this if REST is enabled in the config:

http://localhost:5099/docs

In case websockets are enabled, you can access their endpoints according to this documentation:

https://github.com/BennyTheDev/trac-tap-public-endpoint

Just swap out the given domain in that endpoint example above with your websocket url and port.

Configuration File

Defaults to ./config/default.json file, enabling websocket server if needed.

{
  "enableRest": true,
  "restPort": 5099,
  "enableWebsockets": false,
  "websocketPort": 5095,
  "websocketCORS": "*",
  "channel": "53d2e64fa7a09e9dc74fc52ee9e9feb9d59b3e2cff4a25dfb543ec3b0bf4b281",
  "channelProduction": "53d2e64fa7a09e9dc74fc52ee9e9feb9d59b3e2cff4a25dfb543ec3b0bf4b281"
}

Distributed Data Channel "53d2e64fa7a09e9dc74fc52ee9e9feb9d59b3e2cff4a25dfb543ec3b0bf4b281" is the currently active one for TAP Protocol.

Important note

Installing with npm i triggers the postinstall script, which patches hypercore library. This is yet necessary before the stable release of the reader.

"scripts": {
    "postinstall": "patch-package"
},

Trac Core Manager API

initReader(server, client, rangeStart, rangeEnd) ⇒ Promise.<void>

Initializes the reader for the TAP Protocol, setting up corestore and hyperswarm. Also configures the Hyperbee database and, optionally, a websocket server.

Kind: global function
Returns: Promise.<void> - A promise that resolves when initialization is complete.

ParamTypeDefaultDescription
serverbooleantrueWhether to start as a server in the Hyperswarm network.
clientbooleantrueWhether to start as a client in the Hyperswarm network.
rangeStartnumber-1The starting index for range-based data download.
rangeEndnumber-1The ending index for range-based data download.

initHyperswarm(server, client) ⇒ Promise.<void>

Initializes a Hyperswarm network connection for data synchronization.

Kind: global function
Returns: Promise.<void> - A promise that resolves when the network is initialized.

ParamTypeDescription
serverbooleanIndicates if this instance should act as a server.
clientbooleanIndicates if this instance should act as a client.

Tap Protocol API

getTransferAmountByInscription(inscription_id) ⇒ Promise.<(number|null)>

Retrieves the transfer amount for a given inscription ID.

Kind: global function
Returns: Promise.<(number|null)> - The transfer amount or null if not found.

ParamTypeDescription
inscription_idstringThe ID of the inscription to query.

getDeploymentsLength() ⇒ Promise.<number>

Gets the total number of deployments.

Kind: global function
Returns: Promise.<number> - The total number of deployments.

getDeployments(offset, max) ⇒ Promise.<Array>

Retrieves a list of deployments.

Kind: global function
Returns: Promise.<Array> - An array of deployment records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving deployments.
maxnumber500The maximum number of deployments to retrieve.

getDeployment(ticker) ⇒ Promise.<(Object|null)>

Retrieves details of a specific deployment based on its ticker.

Kind: global function
Returns: Promise.<(Object|null)> - Deployment details or null if not found.

ParamTypeDescription
tickerstringThe ticker of the deployment to retrieve.

getMintTokensLeft(ticker) ⇒ Promise.<(number|null)>

Gets the remaining number of tokens that can be minted for a given ticker.

Kind: global function
Returns: Promise.<(number|null)> - The number of tokens left to mint or null if not available.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the remaining mintable tokens.

getBalance(address, ticker) ⇒ Promise.<(number|null)>

Retrieves the balance of a specific address for a given ticker.

Kind: global function
Returns: Promise.<(number|null)> - The balance of the address or null if not found.

ParamTypeDescription
addressstringThe address for which to retrieve the balance.
tickerstringThe ticker of the token.

getTransferable(address, ticker) ⇒ Promise.<(number|null)>

Retrieves the transferable amount for a specific address and ticker.

Kind: global function
Returns: Promise.<(number|null)> - The transferable amount or null if not found.

ParamTypeDescription
addressstringThe address for which to retrieve the transferable amount.
tickerstringThe ticker of the token.

getHoldersLength(ticker) ⇒ Promise.<number>

Gets the total number of holders for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of holders for the specified ticker.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the number of holders.

getHolders(ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of holders for a specific ticker.

Kind: global function
Returns: Promise.<Array> - An array of holder records.

ParamTypeDefaultDescription
tickerstringThe ticker for which to retrieve holders.
offsetnumber0The starting index for retrieving holders.
maxnumber500The maximum number of holders to retrieve.

getAccountTokensLength(address) ⇒ Promise.<number>

Gets the total number of tokens held by a specific address.

Kind: global function
Returns: Promise.<number> - The number of tokens held by the specified address.

ParamTypeDescription
addressstringThe address for which to retrieve the token count.

getAccountTokens(address, offset, max) ⇒ Promise.<Array>

Retrieves a list of tokens held by a specific address.

Kind: global function
Returns: Promise.<Array> - An array of token tickers.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve tokens.
offsetnumber0The starting index for retrieving tokens.
maxnumber500The maximum number of tokens to retrieve.

getDmtElementsListLength() ⇒ Promise.<number>

Gets the total number of DMT elements.

Kind: global function
Returns: Promise.<number> - The total number of DMT elements.

getDmtElementsList(offset, max) ⇒ Promise.<Array>

Retrieves a list of DMT elements.

Kind: global function
Returns: Promise.<Array> - An array of DMT element records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving DMT elements.
maxnumber500The maximum number of DMT elements to retrieve.

getAccountMintListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of mints performed by a specific address for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of mints performed by the address for the specified ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the mint count.
tickerstringThe ticker of the token.

getAccountMintList(address, ticker) ⇒ Promise.<number>

Gets the total number of mints performed by a specific address for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of mints performed by the address for the specified ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the mint count.
tickerstringThe ticker of the token.

getTickerMintListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of mints performed by a specific address for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of mints performed by the address for the specified ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the mint count.
tickerstringThe ticker of the token.

getTickerMintList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of mint records for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of mint records.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve mint records.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving mint records.
maxnumber500The maximum number of mint records to retrieve.

getMintListLength(ticker) ⇒ Promise.<number>

Gets the total number of mints for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of mints for the specified ticker.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the mint count.

getMintList(offset, max) ⇒ Promise.<Array>

Retrieves a list of all mint records across all tickers.

Kind: global function
Returns: Promise.<Array> - An array of mint records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving mint records.
maxnumber500The maximum number of mint records to retrieve.

getTrade(inscription_id) ⇒ Promise.<(Object|null)>

Retrieves details of a specific trade based on its inscription ID.

Kind: global function
Returns: Promise.<(Object|null)> - Trade details or null if not found.

ParamTypeDescription
inscription_idstringThe ID of the trade inscription to query.

getAccountTradesListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of trades for a specific address and ticker.

Kind: global function
Returns: Promise.<number> - The number of trades for the specified address and ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the trade count.
tickerstringThe ticker of the token.

getAccountTradesList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of trades for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of trade records.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve trades.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving trades.
maxnumber500The maximum number of trades to retrieve.

getAuthCancelled(inscription_id) ⇒ Promise.<boolean>

Checks if a given token-auth inscription has been cancelled.

Kind: global function
Returns: Promise.<boolean> - True if the inscription is cancelled, false otherwise.

ParamTypeDescription
inscription_idstringThe ID of the token-auth inscription to check.

getAuthHashExists(hash) ⇒ Promise.<boolean>

Checks if a given hash exists in the token-auth system.

Kind: global function
Returns: Promise.<boolean> - True if the hash exists, false otherwise.

ParamTypeDescription
hashstringThe hash to check for existence.

getRedeemListLength() ⇒ Promise.<number>

Gets the total number of redeems across all tokens.

Kind: global function
Returns: Promise.<number> - The total number of redeems.

getRedeemList(offset, max) ⇒ Promise.<Array>

Retrieves a list of all redeem records across all tokens.

Kind: global function
Returns: Promise.<Array> - An array of redeem records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving redeem records.
maxnumber500The maximum number of redeem records to retrieve.

getAccountRedeemListLength(address) ⇒ Promise.<number>

Gets the total number of redeems performed by a specific address.

Kind: global function
Returns: Promise.<number> - The number of redeems performed by the specified address.

ParamTypeDescription
addressstringThe address for which to retrieve the redeem count.

getAccountRedeemList(address, offset, max) ⇒ Promise.<Array>

Retrieves a list of redeem records for a specific address.

Kind: global function
Returns: Promise.<Array> - An array of redeem records for the specified address.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve redeem records.
offsetnumber0The starting index for retrieving redeem records.
maxnumber500The maximum number of redeem records to retrieve.

getAccountAuthListLength(address) ⇒ Promise.<number>

Gets the total number of auth records for a specific address.

Kind: global function
Returns: Promise.<number> - The number of auth records for the specified address.

ParamTypeDescription
addressstringThe address for which to retrieve the auth count.

getAccountAuthList(address, offset, max) ⇒ Promise.<Array>

Retrieves a list of auth records for a specific address.

Kind: global function
Returns: Promise.<Array> - An array of auth records for the specified address.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve auth records.
offsetnumber0The starting index for retrieving auth records.
maxnumber500The maximum number of auth records to retrieve.

getAuthListLength() ⇒ Promise.<number>

Gets the total number of auth records across all addresses.

Kind: global function
Returns: Promise.<number> - The total number of auth records.

getAuthList(offset, max) ⇒ Promise.<Array>

Retrieves a list of all auth records across all addresses.

Kind: global function
Returns: Promise.<Array> - An array of auth records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving auth records.
maxnumber500The maximum number of auth records to retrieve.

getTickerTradesListLength(ticker) ⇒ Promise.<number>

Gets the total number of trades for a specific ticker.

Kind: global function
Returns: Promise.<number> - The number of trades for the specified ticker.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the trade count.

getTickerTradesList(ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of trades for a specific ticker.

Kind: global function
Returns: Promise.<Array> - An array of trade records for the specified ticker.

ParamTypeDefaultDescription
tickerstringThe ticker for which to retrieve trades.
offsetnumber0The starting index for retrieving trades.
maxnumber500The maximum number of trades to retrieve.

getTradesListLength() ⇒ Promise.<number>

Gets the total number of trades across all tickers.

Kind: global function
Returns: Promise.<number> - The total number of trades.

getTradesList(offset, max) ⇒ Promise.<Array>

Retrieves a list of all trade records across all tickers.

Kind: global function
Returns: Promise.<Array> - An array of all trade records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving trade records.
maxnumber500The maximum number of trade records to retrieve.

getAccountTransferListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of transfers for a specific address and ticker.

Kind: global function
Returns: Promise.<number> - The number of transfers for the specified address and ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the transfer count.
tickerstringThe ticker of the token.

getAccountTransferList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of transfer records for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of transfer records for the specified address and ticker.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve transfer records.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving transfer records.
maxnumber500The maximum number of transfer records to retrieve.

getTickerTransferListLength(ticker) ⇒ Promise.<number>

Gets the total number of transfers for a given ticker.

Kind: global function
Returns: Promise.<number> - The number of transfers for the specified ticker.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the transfer count.

getTickerTransferList(ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of transfer records for a specific ticker.

Kind: global function
Returns: Promise.<Array> - An array of transfer records for the specified ticker.

ParamTypeDefaultDescription
tickerstringThe ticker for which to retrieve transfer records.
offsetnumber0The starting index for retrieving transfer records.
maxnumber500The maximum number of transfer records to retrieve.

getTransferListLength() ⇒ Promise.<number>

Gets the total number of transfers across all tickers.

Kind: global function
Returns: Promise.<number> - The total number of transfers.

getTransferList(offset, max) ⇒ Promise.<Array>

Retrieves a list of all transfer records across all tickers.

Kind: global function
Returns: Promise.<Array> - An array of all transfer records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving transfer records.
maxnumber500The maximum number of transfer records to retrieve.

getAccountSentListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of sent transactions for a specific address and ticker.

Kind: global function
Returns: Promise.<number> - The number of sent transactions for the specified address and ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the sent count.
tickerstringThe ticker of the token.

getAccountSentList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of sent transaction records for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of sent transaction records for the specified address and ticker.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve sent transaction records.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving sent transaction records.
maxnumber500The maximum number of sent transaction records to retrieve.

getAccountReceiveTradesFilledListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of received trades filled for a specific address and ticker.

Kind: global function
Returns: Promise.<number> - The number of received trades filled for the specified address and ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the count.
tickerstringThe ticker of the token.

getAccountReceiveTradesFilledList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of received trades filled for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of received trades filled records for the specified address and ticker.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve records.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getAccountTradesFilledListLength(address, ticker) ⇒ Promise.<number>

Gets the total number of trades filled for a specific address and ticker.

Kind: global function
Returns: Promise.<number> - The number of trades filled for the specified address and ticker.

ParamTypeDescription
addressstringThe address for which to retrieve the trade count.
tickerstringThe ticker of the token.

getAccountTradesFilledList(address, ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of trades filled for a specific address and ticker.

Kind: global function
Returns: Promise.<Array> - An array of filled trade records for the specified address and ticker.

ParamTypeDefaultDescription
addressstringThe address for which to retrieve filled trades.
tickerstringThe ticker of the token.
offsetnumber0The starting index for retrieving filled trades.
maxnumber500The maximum number of filled trades to retrieve.

getTickerTradesFilledListLength(ticker) ⇒ Promise.<number>

Gets the total number of trades filled for a specific ticker.

Kind: global function
Returns: Promise.<number> - The number of filled trades for the specified ticker.

ParamTypeDescription
tickerstringThe ticker for which to retrieve the filled trade count.

getTickerTradesFilledList(ticker, offset, max) ⇒ Promise.<Array>

Retrieves a list of filled trade records for a specific ticker.

Kind: global function
Returns: Promise.<Array> - An array of filled trade records for the specified ticker.

ParamTypeDefaultDescription
tickerstringThe ticker for which to retrieve filled trades.
offsetnumber0The starting index for retrieving filled trade records.
maxnumber500The maximum number of filled trade records to retrieve.

getTradesFilledListLength() ⇒ Promise.<number>

Gets the total number of filled trades across all tickers.

Kind: global function
Returns: Promise.<number> - The total number of filled trades.

getTradesFilledList(offset, max) ⇒ Promise.<(Array|Object)>

Asynchronously retrieves a list of trades that have been filled.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of trade records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getAccountReceiveListLength(address, ticker) ⇒ Promise.<number>

Gets the length of the account receive list for a given address and ticker.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the length of the receive list.

ParamTypeDescription
addressstringThe Bitcoin address to query.
tickerstringThe ticker symbol for the token.

getAccountReceiveList(address, ticker, offset, max) ⇒ Promise.<(Array|Object)>

Retrieves a list of received transactions for a specific account and ticker.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of receive transaction records.

ParamTypeDefaultDescription
addressstringThe Bitcoin address to query.
tickerstringThe ticker symbol for the token.
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getTickerSentListLength(ticker) ⇒ Promise.<number>

Gets the length of the sent list for a specific ticker.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the length of the sent list.

ParamTypeDescription
tickerstringThe ticker symbol for the token.

getTickerSentList(ticker, offset, max) ⇒ Promise.<(Array|Object)>

Retrieves a list of sent transactions for a specific ticker.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of sent transaction records.

ParamTypeDefaultDescription
tickerstringThe ticker symbol for the token.
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getSentListLength() ⇒ Promise.<number>

Gets the total length of the sent transactions list.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the total length of the sent list.

getSentList(offset, max) ⇒ Promise.<(Array|Object)>

Retrieves the list of all sent transactions.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of all sent transaction records.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getAccumulator(inscription) ⇒ Promise.<(Object|null)>

Retrieves the accumulator object for a given inscription.

Kind: global function
Returns: Promise.<(Object|null)> - A promise that resolves to the accumulator object, or null if not found.

ParamTypeDescription
inscriptionstringThe inscription identifier.

getAccountAccumulatorListLength(address) ⇒ Promise.<number>

Gets the total number of accumulator entries for a specific Bitcoin address.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the number of accumulator entries.

ParamTypeDescription
addressstringThe Bitcoin address to query.

getAccountAccumulatorList(address, offset, max) ⇒ Promise.<(Array|Object)>

Retrieves a list of accumulator records for a specified address.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of accumulator records. If an error occurs, returns the error object.

ParamTypeDefaultDescription
addressstringThe Bitcoin address to query.
offsetnumber0The starting index for retrieving records.
maxnumber500The maximum number of records to retrieve.

getAccumulatorListLength() ⇒ Promise.<number>

Retrieves the total length of the accumulator list.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the total length of the accumulator list.

getAccumulatorList(offset, max) ⇒ Promise.<(Array|Object)>

Retrieves a list of accumulators.

Kind: global function
Returns: Promise.<(Array|Object)> - A promise that resolves to an array of accumulator records. If an error occurs, returns the error object.

ParamTypeDefaultDescription
offsetnumber0The starting index for retrieving accumulator records.
maxnumber500The maximum number of accumulators to retrieve.

getListRecords(length_key, iterator_key, offset, max, return_json) ⇒ Promise.<(Array|Object|string)>

Asynchronously retrieves a batch of list records based on specified keys and limits.

Kind: global function
Returns: Promise.<(Array|Object|string)> - A promise that resolves to an array of records, an error object, or a string message in case of invalid parameters.

ParamTypeDescription
length_keystringThe key to determine the length of the list.
iterator_keystringThe key used for iterating over the list.
offsetnumberThe starting index for retrieving records.
maxnumberThe maximum number of records to retrieve.
return_jsonbooleanWhether to return the records as JSON objects.

getLength(length_key) ⇒ Promise.<number>

Gets the length of a list based on a specified key.

Kind: global function
Returns: Promise.<number> - A promise that resolves to the length of the list.

ParamTypeDescription
length_keystringThe key to determine the length of the list.