stellar-plus
Version:
beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain
46 lines (45 loc) • 2.39 kB
TypeScript
import { AccountHandler } from '../../../../../../stellar-plus/account';
import { SorobanTransactionPipelineInput, SorobanTransactionPipelineOutput, SorobanTransactionPipelineType } from '../../../../../../stellar-plus/core/pipelines/soroban-transaction/types';
import { StellarPlusError } from '../../../../../../stellar-plus/error';
import { BeltMetadata, BeltPluginType } from '../../../../../../stellar-plus/utils/pipeline/conveyor-belts/types';
import { ChannelAccountsPluginConstructorArgs, InputType } from '../../../../../../stellar-plus/utils/pipeline/plugins/soroban-transaction/channel-accounts/types';
export declare class BaseChannelAccountsPlugin<Input extends InputType, Output, Type> implements BeltPluginType<Input, Output, Type> {
readonly type: Type;
readonly name = "ChannelAccountsPlugin";
private freeChannels;
private lockedChannels;
constructor(typeId: Type, channels?: AccountHandler[]);
preProcess(item: Input, meta: BeltMetadata): Promise<Input>;
postProcess(item: Output, meta: BeltMetadata): Promise<Output>;
processError(error: StellarPlusError, meta: BeltMetadata): Promise<StellarPlusError>;
/**
*
* @description - Returns the list of channels registered to the pool.
*
* @returns {AccountHandler[]} The list of channels registered to the pool.
*/
getChannels(): AccountHandler[];
/**
*
* @param {AccountHandler[]} channels - The channel accounts to register.
*
* @description - Registers the provided channel accounts to the pool.
*
* @see ChannelAccountsHandler for a helper class for managing channel accounts.
*/
registerChannels(channels: AccountHandler[]): void;
private allocateChannel;
private releaseChannel;
/**
*
* @description - Waits for a channel to be available and then allocates it. This step will wait for 1 second before trying again.
* This function can be overriden to implement a custom waiting logic.
*
* @returns {Promise<AccountHandler>} The allocated channel account.
*/
private noChannelPipeline;
private injectChannel;
}
export declare class SorobanChannelAccountsPlugin extends BaseChannelAccountsPlugin<SorobanTransactionPipelineInput, SorobanTransactionPipelineOutput, SorobanTransactionPipelineType> {
constructor(args: ChannelAccountsPluginConstructorArgs);
}