# @helixnetwork/transaction-converter

> Converts transaction strings (in hexadecimal representation) to transaction objects and back.

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

## Install

```sh
npm install @helixnetwork/transaction-converter
pnpm add @helixnetwork/transaction-converter
yarn add @helixnetwork/transaction-converter
bun add @helixnetwork/transaction-converter
```

## 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 | 108.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/transaction-converter
- 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/transaction-converter

## 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/hash-module](https://npm.io/package/@helixnetwork/hash-module.md) ^1.0.0-alpha.7
- [@helixnetwork/transaction](https://npm.io/package/@helixnetwork/transaction.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/transaction-converter

Methods for calculating transaction hashes and converting transaction objects to transaction txs and back.

## Installation

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

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

```
yarn add @helixnetwork/transaction-converter
```

## API Reference

    
* [transaction-converter](#module_transaction-converter)

    * [~asTransactionStrings(transactions)](#module_transaction-converter..asTransactionStrings)

    * [~asTransactionObject(txs)](#module_transaction-converter..asTransactionObject)

    * [~asTransactionObjects([hashes])](#module_transaction-converter..asTransactionObjects)

    * [~transactionObjectsMapper(txs)](#module_transaction-converter..transactionObjectsMapper)


<a name="module_transaction-converter..asTransactionStrings"></a>

### *transaction-converter*~asTransactionStrings(transactions)

| Param | Type | Description |
| --- | --- | --- |
| transactions | <code>Transaction</code> | <code>Array.&lt;Transaction&gt;</code> | Transaction object(s) |

Converts a transaction object or a list of those into transaction strings (txs).

**Returns**: <code>TxHex</code> \| <code>Array.&lt;TxHex&gt;</code> - Transaction strings  
<a name="module_transaction-converter..asTransactionObject"></a>

### *transaction-converter*~asTransactionObject(txs)

| Param | Type | Description |
| --- | --- | --- |
| txs | <code>TxHex</code> | Transaction txs |

Converts transaction txs of 1536 txs into a transaction object.

**Returns**: <code>Transaction</code> - Transaction object  
<a name="module_transaction-converter..asTransactionObjects"></a>

### *transaction-converter*~asTransactionObjects([hashes])

| Param | Type | Description |
| --- | --- | --- |
| [hashes] | <code>Array.&lt;Hash&gt;</code> | Optional list of known hashes. Known hashes are directly mapped to transaction objects, otherwise all hashes are being recalculated. |


Converts a list of transaction txs into list of transaction objects.
Accepts a list of hashes and returns a mapper. In cases hashes are given,
the mapper function map them to converted objects.

**Returns**: <code>function</code> - [`transactionObjectsMapper`](#module_transaction.transactionObjectsMapper)  
<a name="module_transaction-converter..transactionObjectsMapper"></a>


### *transaction-converter*~transactionObjectsMapper(txs)

| Param | Type | Description |
| --- | --- | --- |
| txs | <code>Array.&lt;TxHex&gt;</code> | List of transaction txs to convert |

Maps the list of given hashes to a list of converted transaction objects.

**Returns**: <code>Array.&lt;Transaction&gt;</code> - List of transaction objects with hashes

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