Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@iota/transaction-converter
Advanced tools
Converts transaction trytes to transaction objects and back.
Methods for calculating transaction hashes and converting transaction objects to transaction trytes and back.
Install using npm:
npm install @iota/transaction-converter
or using yarn:
yarn add @iota/transaction-converter
Summary: Converts one or more transaction objects into transaction trytes.
Throws:
errors.INVALID_TRYTES
: Make sure that the object fields in the transactions
argument contains valid trytes (A-Z or 9).Param | Type | Description |
---|---|---|
transactions | Transaction | Array.<Transaction> | Transaction objects |
This method takes one or more transaction objects and converts them into trytes.
To get JSON data from the signatureMessageFragment
field of the transaction trytes, use the extractJSON()
method.
Returns: Trytes
| Array.<Trytes>
- Transaction trytes
Example
let trytes = TransactionConverter.asTransactionTrytes(transactionObject);
Summary: Converts transaction trytes into a transaction object.
Throws:
errors.INVALID_TRYTES
: Make sure that the object fields in the transaction
argument contains valid trytes (A-Z or 9).Param | Type | Description |
---|---|---|
transaction | Trytes | Transaction trytes |
This method takes 2,673 transaction trytes and converts them into a transaction object.
To convert more than one transaction into an object at once, use the asTransactionObjects()
method.
To get a transaction's trytes from the Tangle, use the getTrytes()
method.
Returns: Transaction
- transactionObject - A transaction object
Example
let transactionObject = TransactionConverter.asTransactionObject(transactionTrytes);
Summary: Converts one or more transaction trytes into transaction objects.
Throws:
errors.INVALID_TRYTES
: Make sure that transcactions contains valid trytes (A-Z or 9).Param | Type | Description |
---|---|---|
[hashes] | Array.<Hash> | Transaction hashes |
This method takes an array of transaction hashes and returns a mapper.
If any hashes are given, the mapper function maps them to their converted objects. Otherwise, all hashes are recalculated.
To get a transaction's trytes from the Tangle, use the getTrytes()
method.
Returns: function
- transactionObjectsMapper()
Example
let transactionObjectsMapper = TransactionConverter.asTransactionObjects([hashes]);
Param | Type | Description |
---|---|---|
trytes | Array.<Trytes> | List of transaction trytes to convert |
Maps the list of given hashes to a list of converted transaction objects.
Returns: Array.<Transaction>
- List of transaction objects with hashes
FAQs
Converts transaction trytes to transaction objects and back.
The npm package @iota/transaction-converter receives a total of 1,235 weekly downloads. As such, @iota/transaction-converter popularity was classified as popular.
We found that @iota/transaction-converter 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.