New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@stakewise/v3-deposit-data-parser

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stakewise/v3-deposit-data-parser

v3-deposit-data-parser

latest
Source
npmnpm
Version
1.10.2
Version published
Maintainers
4
Created
Source

StakeWise Logo

StakeWise Deposit Data Parser

StakeWise Deposit Data Parser is a comprehensive TypeScript package designed to facilitate the processing and validation of deposit data files within blockchain applications. Tailored for developers working on staking platforms, blockchain validators, or any applications requiring meticulous deposit data verification and processing, particularly in the context of the StakeWise ecosystem.

Version Size

Features

  • Json Validation: Ensures the input data meets specified criteria, effectively preventing the processing of invalid or corrupted json.
  • Deposit Data Extraction: Parses deposit data from files, preparing it for further processing or verification.
  • Public Key Verification: Validates the uniqueness and format of public keys within the deposit data to ensure data integrity.
  • Signature Verification: Leverages BLS (Boneh-Lynn-Shacham) signatures to authenticate deposit data against given public keys.
  • Progress Callbacks: Provides real-time feedback on processing progress, suitable for applications processing large datasets.
  • Error Handling: Implements comprehensive error handling, with custom error types and callback functions for robust error management.

Installation and Setup

npm i @stakewise/v3-deposit-data-parser

Usage example

To ensure optimal performance and responsiveness, StakeWise Deposit Data Parser is optimized for execution within a Web Worker. This allows your application to process data without blocking the main thread, keeping the UI smooth and responsive, even during intensive computations.

import { depositDataParser } from '@stakewise/v3-deposit-data-parser'

self.addEventListener('message', async (event) => {
  const { vaultAddress, network, file } = event.data

  try {
    const onProgress = (progress: Progress) => {
      postMessage({ progress })
    }

    const result = await depositDataParser({
      data,
      vaultAddress,
      network,
      onProgress,
    })

    postMessage({ result })
  }
  catch (error) {
    if (error instanceof ParserError) {
      const parserError: ParserError = { ...error }
      
      postMessage({ error: parserError })
    }
    else {
      postMessage({ error })
    }
  }
  finally {
    close()
  }
})

Deposit data parser Arguments:

NameTypeRequiredDescription
networkNetworkYesNetwork to which the deposit data belongs.
vaultAddressstringYesThe address of the vault for which the deposit data is being parsed.
dataDepositDataFileYesData that contains basic information about the file to be downloaded.
onProgressFunctionOptionalCallback function that is called with progress information as the file is being parsed. The function is expected to accept an object with total and value properties, where total is the total number of items to process, and value is the current number of items processed.

Parser Errors:

TypeMessage
EMPTY_FILEDeposit data file is empty
INVALID_JSON_FORMATDeposit data file must be in JSON format
MERKLE_TREE_GENERATION_ERRORFailed to generate the Merkle tree
INVALID_PUBLIC_KEY_FORMATFailed to parse deposit data public key
DUPLICATE_DEPOSIT_DATAThe deposit data file has already been uploaded.
MISSING_FIELDSFailed to verify the deposit data public keys. Missing fields: {fields}
DUPLICATE_PUBLIC_KEYSFailed to verify the deposit data public keys. All the entries must be unique.
INVALID_SIGNATUREFailed to verify the deposit data signatures. Please make sure the file is generated for the {network} network.

FAQs

Package last updated on 08 May 2026

Related posts