# @helixnetwork/transaction

> Utilities and validators for transactions.

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

## Install

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

## 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 | 2 |
| Unpacked size | 203.7 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
- 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

## Dependencies (2)

- [@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

## 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

Utilities and validators for transactions.

## Installation

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

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

```
yarn add @helixnetwork/transaction
```

## API Reference

    
* [transaction](#module_transaction)

    * [~transactionHash(txBytes)](#module_transaction..transactionHash)

    * [~isTransaction(tx)](#module_transaction..isTransaction)

    * [~isTailTransaction(transaction)](#module_transaction..isTailTransaction)

    * [~isTransactionHash(hash, mwm)](#module_transaction..isTransactionHash)

    * [~isTransactionTxHex(txs, minWeightMagnitude)](#module_transaction..isTransactionTxHex)

    * [~isAttachedTxHex(txs)](#module_transaction..isAttachedTxHex)

<a name="module_transaction..transactionHash"></a>

### *transaction*~transactionHash(txByte)

| Param | Type | Description |
| --- | --- | --- |
| txBytes | <code>TxBytes</code> | TxBytes of 32 transaction bytes |

Calculates the transaction hash out of 768 transaction bytes.

**Returns**: <code>Hash</code> - Transaction hash  
<a name="module_transaction..isTransaction"></a>

### *transaction*~isTransaction(tx)

| Param | Type |
| --- | --- |
| tx | <code>object</code> | 

Checks if input is valid transaction object.

<a name="module_transaction..isTailTransaction"></a>

### *transaction*~isTailTransaction(transaction)

| Param | Type |
| --- | --- |
| transaction | <code>object</code> | 

Checks if given transaction object is tail transaction.
A tail transaction is one with `currentIndex=0`.

<a name="module_transaction..isTransactionHash"></a>

### *transaction*~isTransactionHash(hash, mwm)

| Param | Type |
| --- | --- |
| hash | <code>string</code> | 
| mwm | <code>number</code> | 


Checks if input is correct transaction hash (32 txs)

<a name="module_transaction..isTransactionTxHex"></a>

### *transaction*~isTransactionTxHex(txs, minWeightMagnitude)

| Param | Type |
| --- | --- |
| txs | <code>string</code> | 
| minWeightMagnitude | <code>number</code> | 

Checks if input is correct transaction txs (1536 txs)


<a name="module_transaction..isAttachedTxHex"></a>

### *transaction*~isAttachedTxHex(txs)

| Param | Type |
| --- | --- |
| txs | <code>string</code> | 

Checks if input is valid attached transaction txs.
For attached transactions attached timestamp should not be zero.

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