Socket
Socket
Sign inDemoInstall

@iota/bundle-validator

Package Overview
Dependencies
Maintainers
6
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iota/bundle-validator

Syntactically validates bundle structure and signatures.


Version published
Weekly downloads
109
increased by105.66%
Maintainers
6
Weekly downloads
 
Created
Source

@iota/bundle-validator

Syntactically validates bundle structure and signatures.

Installation

Install using npm:

npm install @iota/bundle-validator

or using yarn:

yarn add @iota/bundle-validator

API Reference

bundle-validator.validateBundleSignatures(bundle)

Summary: Validates the signatures in a given bundle

ParamTypeDescription
bundleArray.<Transaction>Transaction trytes

This method takes an array of transaction trytes and checks if the signatures are valid.

To get a bundle's transaction trytes from the Tangle, use the getBundle() method.

Returns: boolean - Whether the signatures are valid
Example

let valid = Validator.validateBundleSignatures(bundle);

bundle-validator.isBundle(bundle)

Summary: Validates the structure and contents of a given bundle.

ParamTypeDescription
bundleArray.<Transaction>Transaction trytes

This method takes an array of transaction trytes and validates whether they form a valid bundle by checking the following:

  • Addresses in value transactions have a 0 trit at the end, which means they were generated using the Kerl hashing function
  • Transactions in the bundle array are in the same order as their currentIndex field
  • The total value of all transactions in the bundle sums to 0
  • The bundle hash is valid

To get a bundle's transaction trytes from the Tangle, use the getBundle() method.

Returns: boolean - bundle - Whether the bundle is valid
Example

let bundle = Validator.isBundle(bundle);

Keywords

FAQs

Package last updated on 18 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc