Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iota/bundle

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iota/bundle

Utilities for generating and signing bundles

  • 1.0.0-beta.23
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by447.37%
Maintainers
5
Weekly downloads
 
Created
Source

@iota/bundle

Utilities for generating and signing bundles. A bundle in IOTA is an atomic set of transactions.

Installation

Install using npm:

npm install @iota/bundle

or using yarn:

yarn add @iota/bundle

API Reference

bundle~createBundle([entries])

ParamTypeDefaultDescription
[entries]Array.<BundleEntry>[]Entries of single or multiple transactions with the same address

Creates a bundle with given transaction entries.

Returns: Array.<Int8Array> - List of transactions in the bundle

bundle~addEntry(entry, bundle)

ParamTypeDescription
entryobjectEntry of a single or multiple transactions with the same address.
entry.addressInt8ArrayAddress.
entry.valueInt8ArrayValue to transfer in iotas.
[entry.signatureOrMessage]Int8ArraySignature or message fragment(s).
[entry.timestamp]Int8ArrayIssuance timestamp (in seconds).
[entry.tag]Int8ArrayOptional Tag, Deprecated.
bundleInt8ArrayBundle buffer.

Adds given transaction entry to a bundle.

Returns: Int8Array - Bundle copy with new entries.

bundle~finalizeBundle(bundle)

ParamTypeDescription
bundleInt8ArrayBundle transaction trits

Finalizes a bundle by calculating the bundle hash.

Returns: Int8Array - List of transactions in the finalized bundle

bundle~addSignatureOrMessage(bundle, signatureOrMessage, index)

ParamTypeDescription
bundleInt8ArrayBundle buffer.
signatureOrMessageInt8ArraySignature or message to add.
indexnumberTransaction index as entry point for signature or message fragments.

Adds signature message fragments to transactions in a bundle starting at offset.

Returns: Int8Array - List of transactions in the updated bundle

bundle~valueSum(bundle, offset, length)

ParamTypeDescription
bundleInt8ArrayBundle buffer.
offsetnumberOffset from the start of the bundle buffer.
lengthnumberLength of transactions in which values should be summed.

Sums up transaction values in a bundle starting at offset.

Returns: number - Total value of 'length' transactions in the bundle starting at offset.

Keywords

FAQs

Package last updated on 27 Nov 2019

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