Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@iota/bundle
Advanced tools
Utilities for generating and signing bundles. A bundle in IOTA is an atomic set of transactions.
Install using npm:
npm install @iota/bundle
or using yarn:
yarn add @iota/bundle
Summary: Adds the given transaction entry to a bundle array.
Throws:
errors.ILLEGAL_TRANSACTION_BUFFER_LENGTH
: Make sure that the bundle
argument contains valid transaction tritserrors.ILLEGAL_SIGNATURE_OR_MESSAGE_LENGTH
: Make sure that the entry.signatureOrMessage
argument contains 6,561 tritserrors.ILLEGAL_ADDRESS_LENGTH
: Make sure that the entry.address
argument contains 243 tritserrors.ILLEGAL_VALUE_LENGTH
: Make sure that the entry.value
argument contains 6,561 tritserrors.ILLEGAL_ISSUANCE_TIMESTAMP_LENGTH
: Make sure that the entry.timestamp
argument contains 81 tritsParam | Type | Description |
---|---|---|
entry | object | Transaction entry object |
entry.address | Int8Array | An address in trits |
entry.value | Int8Array | An amount of IOTA tokens in trits |
[entry.signatureOrMessage] | Int8Array | Signature fragments or a message in trits |
[entry.issuanceTimestamp] | Int8Array | Unix epoch in trits |
[entry.tag] | Int8Array | (deprecated) |
bundle | Int8Array | Bundle array to which to add the entry object |
Adds transaction trits in the given entry object to a given bundle array.
See the converter package for methods that convert values to trits.
Returns: Int8Array
- A copy of the original bundle that also includes the added entries.
Example
let bundle = new Int8Array();
bundle = Bundle.addEntry(bundle, {
address: Converter.trytesToTrits(outputAddress),
value: Converter.valueToTrits(value),
issuanceTimestamp: Converter.valueToTrits(Math.floor(Date.now() / 1000));
});
Summary: Generates a bundle hash.
Throws:
errors.ILLEGAL_TRANSACTION_BUFFER_LENGTH
: Make sure that the bundle
argument contains valid transaction tritsParam | Type | Description |
---|---|---|
bundle | Int8Array | Transaction trits |
This method takes an array of transaction trits, generates the bundle hash, and adds it to each transaction.
See the addEntry()
method for creating new bundles.
Returns: Int8Array
- Transaction trits that include a bundle hash
Example
const result = Bundle.finalizeBundle(bundle);
Summary: Adds signature message fragments to transactions in a bundle.
Throws:
errors.ILLEGAL_TRANSACTION_BUFFER_LENGTH
: Make sure that the bundle
argument contains valid transaction tritserrors.ILLEGAL_TRANSACTION_INDEX
: Make sure that the index
argument is a number and that the bundle contains enough transactionserrors.ILLEGAL_SIGNATURE_OR_MESSAGE_LENGTH
: Make sure that the signatureOrMessage
argument contains at least 6,561 tritsParam | Type | Description |
---|---|---|
bundle | Int8Array | Transaction trits |
signatureOrMessage | Int8Array | Signature or message to add to the bundle |
index | number | Transaction index at which to start adding the signature or message |
This method takes an array of transaction trits, and add the given message or signature to the transactions, starting from the given index.
If the signature or message is too long to fit in a single transaction, it is split across the next transaction in the bundle, starting from the given index.
See the addEntry()
method for creating new bundles.
Returns: Int8Array
- Transaction trits that include a bundle hash.
Example
const signature = Converter.trytesToTrits('SIGNATURE...')
bundle.set(Bundle.addSignatureOrMessage(bundle, signature, 1));
Summary: Creates a bundle array from the given transaction entries.
Param | Type | Default | Description |
---|---|---|---|
[entries] | Array.<BundleEntry> | [] | Entries of single or multiple transactions with the same address |
Returns: Array.<Int8Array>
- List of transactions in the bundle
FAQs
Utilities for generating and signing bundles
The npm package @iota/bundle receives a total of 53 weekly downloads. As such, @iota/bundle popularity was classified as not popular.
We found that @iota/bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.