/** @module transaction-converter */ import '../../typed-array'; import { Transaction, Trytes } from '../../types'; export { Transaction }; export declare function asTransactionTrytes(transactions: Transaction): Trytes; export declare function asTransactionTrytes(transactions: ReadonlyArray): ReadonlyArray; /** * This method takes 2,673 transaction trytes and converts them into a transaction object. * * ## Related methods * * To convert more than one transaction into an object at once, use the [`asTransactionObjects()`]{@link #module_transaction-converter.asTransactionObjects} method. * * To get a transaction's trytes from the Tangle, use the [`getTrytes()`]{@link #module_core.getTrytes} method. * * @method asTransactionObject * * @summary Converts transaction trytes into a transaction object. * * @memberof module:transaction-converter * * @param {Trytes} transaction - Transaction trytes * * @example * ```js * let transactionObject = TransactionConverter.asTransactionObject(transactionTrytes); * ``` * * @return {Transaction} transactionObject - A transaction object * * @throws {errors.INVALID_TRYTES}: Make sure that the object fields in the `transaction` argument contains valid trytes (A-Z or 9). */ export declare const asTransactionObject: (trytes: string, hash?: string | undefined) => Transaction; /** * 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. * * ## Related methods * * To get a transaction's trytes from the Tangle, use the [`getTrytes()`]{@link #module_core.getTrytes} method. * * @method asTransactionObjects * * @summary Converts one or more transaction trytes into transaction objects. * * @memberof module:transaction-converter * * @param {Hash[]} [hashes] - Transaction hashes * * @example * ```js * let transactionObjectsMapper = TransactionConverter.asTransactionObjects([hashes]); * ``` * * @return {Function} [`transactionObjectsMapper()`]{@link #module_transaction.transactionObjectsMapper} * * @throws {errors.INVALID_TRYTES}: Make sure that transcactions contains valid trytes (A-Z or 9). */ export declare const asTransactionObjects: (hashes?: readonly string[] | undefined) => (trytes: readonly string[]) => Transaction[]; export declare const asFinalTransactionTrytes: (transactions: readonly Transaction[]) => string[]; export declare const transactionObject: (trytes: string) => Transaction; export declare const transactionTrytes: (transaction: Transaction) => string;