/// import { TransactionInterface } from '../faces/lib/transaction'; import { TransactionStatusResponseInterface } from '../faces/lib/transactions'; import { JWKInterface } from '../faces/lib/wallet'; import { SignatureOptions } from '../faces/utils/crypto'; import Chunks from './chunks'; import Transaction from './transaction'; import 'arconnect'; import { SerializedUploader } from '../faces/utils/transactionUploader'; import { TransactionUploader } from '../utils/transactionUploader'; import Ardk from '../ardk'; import ArCache from '../utils/arCache'; export default class Transactions { private solid; private chunks; private cache; constructor(solid: Ardk, chunks: Chunks, cache: ArCache); /** * Transactions should use an anchor block to allow submitting of multiple transactions per block. * @return {Promise} An anchor block ID. */ getTransactionAnchor(): Promise; /** * Get the network fee for bytes of data and an optional wallet address. * The optional wallet address is required because the first transaction to a wallet has an extra fee to prevent spamming. * @param {number} byteSize The number of bytes of data. * @param {string} walletAddress The wallet address. * @return {Promise} The network fee in Winston. */ getPrice(byteSize: number, targetAddress?: string): Promise; /** * Get a Transaction by its ID. * @param {string} id The transaction ID. * @return {Promise} The transaction. * @return {Promise} A promise which resolves into the Transaction object. */ get(id: string): Promise; /** * Get a Transaction object, from raw transaction data. * @param {Partial} transaction The transaction data. * @return {Promise} A promise which resolves into the Transaction object. */ fromRaw(attributes?: Partial): Transaction; /** * Do a quick search for a tagname and a tag value. * @deprecated Use https://npmjs.com/@textury/ardb instead. * @returns {Promise} An array (up to 10) of strings containing the transaction IDs matching the search. */ search(tagName: string, tagValue: string): Promise; /** * Get the provided transaction ID current status on the network. * @param {string} id The transaction ID. * @return {Promise} A promise which resolves into the TransactionStatusResponse object. */ getStatus(id: string): Promise; /** * Get the transaction data for a transaction ID. * @param {string} id The transaction ID. * @param {{decode: boolean; string: boolean;}} options Options for the data, optional. * @return {Promise} The transaction data. * @return {Promise} The transaction data as an Uint8Array. */ getData(id: string, options?: { decode?: boolean; string?: boolean; }): Promise; /** * Sign a transaction with your wallet, to be able to post it to Ardk. * @param {Transaction} transaction The transaction to sign. * @param {JWKInterface} jwk A JWK (Wallet address JSON representation) to sign the transaction with. Or 'use_wallet' to use the wallet from an external tool. * @param {SignatureOptions} options Signature options, optional. * @return {Promise} */ sign(transaction: Transaction, jwk?: JWKInterface | 'use_wallet', options?: SignatureOptions): Promise; /** * Post a previously signed transaction to the network. * @param {Transaction|Buffer|string|object} transaction - The transaction to post. * @returns {Promise} Returns a promise which resolves to `{status: number; statusText: string; data: any}`. */ post(transaction: Transaction | Buffer | string | object): Promise<{ status: number; statusText: string; data: any; }>; /** * Gets an uploader than can be used to upload a transaction chunk by chunk, giving progress * @param upload a Transaction object, a previously save progress object, or a transaction id. * @param data the data of the transaction. Required when resuming an upload. */ getUploader(upload: Transaction | SerializedUploader | string, data?: Uint8Array | ArrayBuffer): Promise; /** * Async generator version of uploader * @param {Transaction} upload a Transaction object, a previously save uploader, or a transaction id. * @param {Uint8Array} data the data of the transaction. Required when resuming an upload. */ upload(upload: Transaction, data?: Uint8Array): AsyncGenerator, unknown>; }