import { SubmittableExtrinsic } from '@polkadot/api/types'; import { ISubmittableResult } from '@polkadot/types/types'; import BigNumber from 'bignumber.js'; import { Context, PolymeshTransaction, PolymeshTransactionBase } from '../internal'; import { MapTxData } from '../types'; import { BatchTransactionSpec, TransactionConstructionData } from '../types/internal'; /** * Wrapper class for a batch of Polymesh Transactions */ export declare class PolymeshTransactionBatch extends PolymeshTransactionBase { /** * @hidden */ static toTransactionSpec(inputTransaction: PolymeshTransactionBatch): BatchTransactionSpec; /** * @hidden * * underlying transactions to be batched, together with their arguments and other relevant data */ private transactionData; /** * @hidden */ constructor(transactionSpec: BatchTransactionSpec & TransactionConstructionData, context: Context); /** * transactions in the batch with their respective arguments */ get transactions(): MapTxData; /** * @hidden */ protected composeTx(): SubmittableExtrinsic<'promise', ISubmittableResult>; protected getBaseTransaction(): SubmittableExtrinsic<'promise', ISubmittableResult>; /** * @hidden */ getProtocolFees(): Promise; /** * @note batch can only be subsidized if - * 1. Number of transactions in the batch are not more than 7 * 2. Every transaction in the batch can be subsidized */ supportsSubsidy(): boolean; /** * @hidden * * @throws error if * 1. Number of transactions in the batch are more than 7 * 2. Batch contains a transaction that cannot be subsidized */ protected assertTransactionSupportsSubsidy(): void; /** * Splits this batch into its individual transactions to be run separately. This is useful if the caller is being subsidized, * since batches cannot be run by subsidized Accounts * * @note the transactions returned by this method must be run in the same order they appear in the array to guarantee the same behavior. If run out of order, * an error will be thrown. The result that would be obtained by running the batch is returned by running the last transaction in the array * * @example * * ```typescript * const createAssetTx = await sdk.assets.createAsset(...); * * let ticker: string; * * if (isPolymeshTransactionBatch(createAssetTx)) { * const transactions = createAssetTx.splitTransactions(); * * for (let i = 0; i < length; i += 1) { * const result = await transactions[i].run(); * * if (isAsset(result)) { * ({ticker} = result) * } * } * } else { * ({ ticker } = await createAssetTx.run()); * } * * console.log(`New Asset created! Ticker: ${ticker}`); * ``` */ splitTransactions(): (PolymeshTransaction | PolymeshTransaction)[]; /** * @hidden */ protected handleExtrinsicSuccess(resolve: (value: ISubmittableResult | PromiseLike) => void, reject: (reason?: unknown) => void, receipt: ISubmittableResult): void; } //# sourceMappingURL=PolymeshTransactionBatch.d.ts.map