@helixnetwork/bundle
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.7 • Public • Published

@helixnetwork/bundle

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

Installation

Install using npm:

npm install @helixnetwork/bundle

or using yarn:

yarn add @helixnetwork/bundle

API Reference

bundle~createBundle(entries)

Param Type Description
entries Array.<BundleEntry> Entries of signle or multiple transactions with the same address

Creates a bunlde with given transaction entries.

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

bundle~addEntry(transactions, entry)

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

Creates a bunlde with given transaction entries

Returns: Array.<Transaction> - Bundle

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

Param Type Default Description
transactions Array.<Transaction> Transactions in the bundle
fragments Array.<TxHex> Message signature fragments to add
[offset] number 0 Optional offset to start appending signature message fragments

Adds a list of txs in the bundle starting at offset

Returns: Array.<Transaction> - Transactions of finalized bundle

bundle~finalizeBundle(transactions)

Param Type Description
transactions Array.<Transaction> Transactions in the bundle

Finalizes the bundle by calculating the bundle hash

Returns: Array.<Transaction> - Transactions of finalized bundle

Package Sidebar

Install

npm i @helixnetwork/bundle

Weekly Downloads

1

Version

1.0.0-alpha.7

License

MIT

Unpacked Size

84.6 kB

Total Files

26

Last publish

Collaborators

  • dzlzv
  • dad1x
  • fsbbn
  • dnck
  • dt93
  • ofo42