import { Transaction } from '../../lib/sdkCore'; import { TransactionTrackingConfigType } from '../../methods/initApp/initApp.types'; import { SignedTransactionType } from '../../types/transactions.types'; import { TransactionManagerTrackOptionsType } from './TransactionManager.types'; export declare class TransactionManager { private static instance; static getInstance(): TransactionManager; /** * Set callbacks to be executed when the transaction session is successful or fails. * It is analogous to the `onSuccess` and `onFail` callbacks set in the `initApp` method, * as a way to override the global callbacks * @param onSuccess - The callback to run when the transaction session is successful. * @param onFail - The callback to run when the transaction session fails. * @example * ```ts * TransactionManager.setCallbacks({ * onSuccess: (sessionId) => { * console.log('Transaction session successful', sessionId); * }, * }); */ setCallbacks: ({ onSuccess, onFail }: TransactionTrackingConfigType) => void; send: (signedTransactions: Transaction[] | Transaction[][]) => Promise; /** * Track the status of a transaction session. * @param sentTransactions - The transactions to track. * @param options - The options for the transaction session. * @returns The session id. * @example * ```ts * const sessionId = await txManager.track(sentTransactions, { * transactionsDisplayInfo: { * errorMessage: 'Failed adding stake', * successMessage: 'Stake successfully added', * processingMessage: 'Staking in progress' * }, * onSuccess: async(sessionId) => { * console.log('Session successful', sessionId); * }, * onFail: async(sessionId) => { * console.log('Session failed', sessionId); * } * sessionInformation: { * stakeAmount: '1000000000000000000000000' * } * }); * ``` */ track: (sentTransactions: SignedTransactionType[] | SignedTransactionType[][], options?: TransactionManagerTrackOptionsType) => Promise; private readonly sendSignedTransactions; private readonly sendSignedBatchTransactions; private readonly buildBatchId; private readonly sequentialToFlatArray; private readonly getIsSequential; }