@helixnetwork/transaction
Utilities and validators for transactions.
Installation
Install using npm:
npm install @helixnetwork/transaction
or using yarn:
yarn add @helixnetwork/transaction
API Reference
transaction~transactionHash(txByte)
| Param | Type | Description |
|---|---|---|
| txBytes | TxBytes |
TxBytes of 32 transaction bytes |
Calculates the transaction hash out of 768 transaction bytes.
Returns: Hash - Transaction hash
transaction~isTransaction(tx)
| Param | Type |
|---|---|
| tx | object |
Checks if input is valid transaction object.
transaction~isTailTransaction(transaction)
| Param | Type |
|---|---|
| transaction | object |
Checks if given transaction object is tail transaction.
A tail transaction is one with currentIndex=0.
transaction~isTransactionHash(hash, mwm)
| Param | Type |
|---|---|
| hash | string |
| mwm | number |
Checks if input is correct transaction hash (32 txs)
transaction~isTransactionTxHex(txs, minWeightMagnitude)
| Param | Type |
|---|---|
| txs | string |
| minWeightMagnitude | number |
Checks if input is correct transaction txs (1536 txs)
transaction~isAttachedTxHex(txs)
| Param | Type |
|---|---|
| txs | string |
Checks if input is valid attached transaction txs. For attached transactions attached timestamp should not be zero.