import { Context } from '../internal'; import { GenericPolymeshTransaction, ProcedureAuthorizationStatus, ProcedureOpts } from '../types'; import { BaseTransactionSpec, ProcedureAuthorization } from '../types/internal'; /** * @hidden * * Represents an operation performed on the Polymesh blockchain. * A Procedure can be prepared to return a promise that resolves * to a {@link PolymeshTransaction} (or {@link PolymeshTransactionBatch}) that can be run */ export declare class Procedure> { private readonly prepareTransactions; private readonly getAuthorization; private readonly prepareStorage; private _storage; private _context; private _signerMultiSig; /** * @hidden * * @param prepareTransactions - function that prepares the transaction queue * @param getAuthorization - can be a ProcedureAuthorization object or a function that returns a ProcedureAuthorization object */ constructor(prepareTransactions: (this: Procedure, args: Args) => Promise>, getAuthorization?: ProcedureAuthorization | ((this: Procedure, args: Args) => Promise | ProcedureAuthorization), prepareStorage?: (this: Procedure, args: Args) => Promise | Storage); /** * @hidden * Set the context and storage (if not already set), return the Context */ private setup; /** * @hidden * Reset the procedure */ private cleanup; /** * @hidden */ private checkSignerPermissions; /** * @hidden */ private checkRolesAndAgentPermissions; /** * @hidden */ private _checkAuthorization; /** * Check if the current user has sufficient authorization to run the procedure * * @param args - procedure arguments */ checkAuthorization(args: Args, context: Context, opts?: ProcedureOpts): Promise; /** * Build a {@link PolymeshTransaction} or {@link PolymeshTransactionBatch} that can be run * * @param args.args - arguments required to prepare the queue * @param args.transformer - optional function that transforms the Procedure result * @param context - context in which the resulting queue will run * @param opts.signer - address that will be used as a signer for this procedure */ prepare(args: { args: Args; transformer?: undefined | ((value: ReturnValue) => TransformedReturnValue | Promise); }, context: Context, opts?: ProcedureOpts): Promise>; /** * internal data container. Used to store common fetched/processed data that is * used by both `prepareTransactions` and `checkAuthorization` */ get storage(): Storage; /** * contains the data services, signing Account, etc. In short, the *context* in which * the Procedure is being run */ get context(): Context; /** * Get the authorization data (permissions) required to run this procedure * * @param args - procedure arguments * @returns authorization data containing required roles and permissions */ requiredAuthorizations(args: Args): Promise | ProcedureAuthorization; } //# sourceMappingURL=Procedure.d.ts.map