# @helixnetwork/bundle

> Utilities for generating and schnorr bundles

Latest version **1.0.0-alpha.7** (published 2019-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @helixnetwork/bundle
pnpm add @helixnetwork/bundle
yarn add @helixnetwork/bundle
bun add @helixnetwork/bundle
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.7 |
| Published | 2019-09-24 |
| First published | 2019-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 82.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Maintainers | ahasikos, ajith_er, dad1x, dnck, dt93, dzlzv, fsbbn, mahi30795, netobjex, ofo42, sachushaji, shahanaspatel17, stefan-precup, tittu, tunghoang, vipindas28 |
| Keywords | helix, tangle, library, browser, javascript, nodejs, API |

## Links

- npm: https://www.npmjs.com/package/@helixnetwork/bundle
- Repository: https://github.com/helixnetwork/helix.api.git/tree/dev/packages/crypto
- Issues: https://github.com/helixnetwork/helix.api/issues
- npm.io page: https://npm.io/package/@helixnetwork/bundle

## Dependencies (4)

- [@helixnetwork/pad](https://npm.io/package/@helixnetwork/pad.md) ^1.0.0-alpha.7
- [@helixnetwork/converter](https://npm.io/package/@helixnetwork/converter.md) ^1.0.0-alpha.7
- [@helixnetwork/winternitz](https://npm.io/package/@helixnetwork/winternitz.md) ^1.0.0-alpha.7
- [@helixnetwork/hash-module](https://npm.io/package/@helixnetwork/hash-module.md) ^1.0.0-alpha.7

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.0.0-alpha.7 (latest) — 2019-09-24
- 1.0.0-alpha.6 — 2019-08-15
- 1.0.0-alpha.5 — 2019-08-06
- 1.0.0-alpha.4 — 2019-07-31
- 1.0.0-alpha.3 — 2019-07-24
- 1.0.0-alpha.2 — 2019-05-09
- 1.0.0-alpha.1 — 2019-03-02
- 1.0.0-alpha.0 — 2019-02-26

## README

# @helixnetwork/bundle

Utilities for generating and sign bundles.
A bundle in Helix is an atomic set of transactions.

## Installation

Install using [npm](https://www.npmjs.org/):
```
npm install @helixnetwork/bundle
```

or using [yarn](https://yarnpkg.com/):

```
yarn add @helixnetwork/bundle
```

## API Reference

    
* [bundle](#module_bundle)

    * [~createBundle(entries)](#module_bundle..createBundle)

    * [~addEntry(transactions, entry)](#module_bundle..addEntry)

    * [~addTxHex(transactions, fragments, [offset])](#module_bundle..addTxHex)

    * [~finalizeBundle(transactions)](#module_bundle..finalizeBundle)


<a name="module_bundle..createBundle"></a>

### *bundle*~createBundle(entries)

| Param | Type | Description |
| --- | --- | --- |
| entries | <code>Array.&lt;BundleEntry&gt;</code> | Entries of signle or multiple transactions with the same address |

Creates a bunlde with given transaction entries.

**Returns**: <code>Array.&lt;Transaction&gt;</code> - List of transactions in the bundle  
<a name="module_bundle..addEntry"></a>

### *bundle*~addEntry(transactions, entry)

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| transactions | <code>Array.&lt;Transaction&gt;</code> |  | List of transactions currently in the bundle |
| entry | <code>object</code> |  | Entry of single or multiple transactions with the same address |
| [entry.length] | <code>number</code> | <code>1</code> | Entry length, which indicates how many transactions in the bundle will occupy |
| [entry.address] | <code>TxHex</code> |  | Address, defaults to all-0s |
| [entry.value] | <code>number</code> | <code>0</code> | Value to transfer in _HLX_ |
| [entry.signatureMessageFragments] | <code>Array.&lt;string&gt;</code> |  | Array of signature message fragments txs, defaults to all-0s |
| [entry.timestamp] | <code>number</code> |  | Transaction timestamp, defaults to `Math.floor(Date.now() / 1000)` |
| [entry.tag] | <code>TxHex</code> |  | Optional Tag, defaults to null tag (all-0s) |

Creates a bunlde with given transaction entries

**Returns**: <code>Array.&lt;Transaction&gt;</code> - Bundle  
<a name="module_bundle..addTxHex"></a>

### *bundle*~addTxHex(transactions, fragments, [offset])

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| transactions | <code>Array.&lt;Transaction&gt;</code> |  | Transactions in the bundle |
| fragments | <code>Array.&lt;TxHex&gt;</code> |  | Message signature fragments to add |
| [offset] | <code>number</code> | <code>0</code> | Optional offset to start appending signature message fragments |


Adds a list of txs in the bundle starting at offset

**Returns**: <code>Array.&lt;Transaction&gt;</code> - Transactions of finalized bundle  
<a name="module_bundle..finalizeBundle"></a>

### *bundle*~finalizeBundle(transactions)

| Param | Type | Description |
| --- | --- | --- |
| transactions | <code>Array.&lt;Transaction&gt;</code> | Transactions in the bundle |

Finalizes the bundle by calculating the bundle hash

**Returns**: <code>Array.&lt;Transaction&gt;</code> - Transactions of finalized bundle

---
_Source: https://npm.io/package/@helixnetwork/bundle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
