import { AugmentedEvent, AugmentedQuery, AugmentedQueryDoubleMap, ObsInnerType } from '@polkadot/api/types';
import { StorageKey } from '@polkadot/types';
import { BlockHash } from '@polkadot/types/interfaces/chain';
import { AnyFunction, AnyTuple, IEvent, ISubmittableResult } from '@polkadot/types/types';
import BigNumber from 'bignumber.js';
import { ModuleName, TxTag } from "../polkadot/types";
import { Context, Identity, SecurityToken } from "../internal";
import { Scope as MiddlewareScope } from "../middleware/types";
import { CalendarPeriod, Claim, CommonKeyring, NextKey, PaginationOptions, ProcedureMethod, UiKeyring } from "../types";
import { Events, Falsyable, MapMaybePostTransactionValue, MaybePostTransactionValue } from "../types/internal";
import { HumanReadableType, ProcedureFunc, UnionOfProcedureFuncs } from "../types/utils";
export * from "../generated/utils";
/**
 * @hidden
 * Promisified version of a timeout
 *
 * @param amount - time to wait
 */
export declare function delay(amount: number): Promise<void>;
/**
 * @hidden
 * Convert an entity type and its unique Identifiers to a base64 string
 */
export declare function serialize<UniqueIdentifiers>(entityType: string, uniqueIdentifiers: UniqueIdentifiers): string;
/**
 * @hidden
 * Convert a uuid string to an Identifier object
 */
export declare function unserialize<UniqueIdentifiers>(id: string): UniqueIdentifiers;
/**
 * @hidden
 * Extract the DID from an Identity, or return the Current DID if no Identity is passed
 */
export declare function getDid(value: string | Identity | undefined, context: Context): Promise<string>;
/**
 * @hidden
 */
export declare function createClaim(claimType: string, jurisdiction: Falsyable<string>, middlewareScope: Falsyable<MiddlewareScope>, cddId: Falsyable<string>, scopeId: Falsyable<string>): Claim;
/**
 * @hidden
 *
 * Unwrap a Post Transaction Value
 */
export declare function unwrapValue<T extends unknown>(value: MaybePostTransactionValue<T>): T;
/**
 * @hidden
 *
 * Unwrap all Post Transaction Values present in a tuple
 */
export declare function unwrapValues<T extends unknown[]>(values: MapMaybePostTransactionValue<T>): T;
/**
 * @hidden
 */
declare type EventData<Event> = Event extends AugmentedEvent<'promise', infer Data> ? Data : never;
/**
 * @hidden
 * Find every occurrence of a specific event inside a receipt
 *
 * @throws If the event is not found
 */
export declare function filterEventRecords<ModuleName extends keyof Events, EventName extends keyof Events[ModuleName]>(receipt: ISubmittableResult, mod: ModuleName, eventName: EventName): IEvent<EventData<Events[ModuleName][EventName]>>[];
/**
 * @hidden
 */
export declare function padString(value: string, length: number): string;
/**
 * @hidden
 */
export declare function removePadding(value: string): string;
/**
 * @hidden
 *
 * Return whether the string is fully printable ASCII
 */
export declare function isPrintableAscii(value: string): boolean;
/**
 * @hidden
 *
 * Makes an entries request to the chain. If pagination options are supplied,
 * the request will be paginated. Otherwise, all entries will be requested at once
 */
export declare function requestPaginated<F extends AnyFunction, T extends AnyTuple>(query: AugmentedQuery<'promise', F, T> | AugmentedQueryDoubleMap<'promise', F, T>, opts: {
    paginationOpts?: PaginationOptions;
    arg?: Parameters<F>[0];
}): Promise<{
    entries: [StorageKey<T>, ObsInnerType<ReturnType<F>>][];
    lastKey: NextKey;
}>;
/**
 * @hidden
 *
 * Makes a request to the chain. If a block hash is supplied,
 * the request will be made at that block. Otherwise, the most recent block will be queried
 */
export declare function requestAtBlock<F extends AnyFunction>(query: AugmentedQuery<'promise', F> | AugmentedQueryDoubleMap<'promise', F>, opts: {
    blockHash?: string | BlockHash;
    args: Parameters<F>;
}, context: Context): Promise<ObsInnerType<ReturnType<F>>>;
/**
 * @hidden
 *
 * Separates an array into smaller batches
 *
 * @param args - elements to separate
 * @param tag - transaction for which the elements are arguments. This serves to determine the size of the batches. A null value
 *   means that the minimum batch size will be used
 * @param groupByFn - optional function that takes an element and returns a value by which to group the elements.
 *   If supplied, all elements of the same group will be contained in the same batch
 */
export declare function batchArguments<Args>(args: Args[], tag: TxTag | null, groupByFn?: (obj: Args) => string): Args[][];
/**
 * @hidden
 *
 * Calculates next page number for paginated GraphQL ResultSet.
 * Returns null if there is no next page.
 *
 * @param size - page size requested
 * @param start - start index requestd
 * @param totalCount - total amount of elements returned by query
 *
 * @hidden
 *
 */
export declare function calculateNextKey(totalCount: number, size?: number, start?: number): NextKey;
/**
 * Create a method that prepares a procedure
 */
export declare function createProcedureMethod<MethodArgs, ProcedureArgs extends unknown, ProcedureReturnValue, Storage = Record<string, unknown>>(args: {
    getProcedureAndArgs: (methodArgs: MethodArgs) => [
        (UnionOfProcedureFuncs<ProcedureArgs, ProcedureReturnValue, Storage> | ProcedureFunc<ProcedureArgs, ProcedureReturnValue, Storage>),
        ProcedureArgs
    ];
}, context: Context): ProcedureMethod<MethodArgs, ProcedureReturnValue, ProcedureReturnValue>;
export declare function createProcedureMethod<MethodArgs, ProcedureArgs extends unknown, ProcedureReturnValue, ReturnValue, Storage = Record<string, unknown>>(args: {
    getProcedureAndArgs: (methodArgs: MethodArgs) => [
        (UnionOfProcedureFuncs<ProcedureArgs, ProcedureReturnValue, Storage> | ProcedureFunc<ProcedureArgs, ProcedureReturnValue, Storage>),
        ProcedureArgs
    ];
    transformer: (value: ProcedureReturnValue) => ReturnValue | Promise<ReturnValue>;
}, context: Context): ProcedureMethod<MethodArgs, ProcedureReturnValue, ReturnValue>;
/**
 * @hidden
 */
export declare function assertIsInteger(value: number | BigNumber): void;
/**
 * @hidden
 */
export declare function assertIsPositive(value: number | BigNumber): void;
/**
 * @hidden
 */
export declare function getCommonKeyring(keyring: CommonKeyring | UiKeyring): CommonKeyring;
/**
 * @hidden
 */
export declare function assertFormatValid(address: string, ss58Format: number): void;
/**
 * @hidden
 */
export declare function assertKeyringFormatValid(keyring: CommonKeyring, ss58Format: number): void;
/**
 * @hidden
 */
export declare function getTicker(token: string | SecurityToken): string;
/**
 * @hidden
 */
export declare function getToken(token: string | SecurityToken, context: Context): SecurityToken;
/**
 * @hidden
 */
export declare function xor(a: boolean, b: boolean): boolean;
/**
 * @hidden
 * Transform a conversion util into a version that returns null if the input is falsy
 */
export declare function periodComplexity(period: CalendarPeriod): number;
/**
 * @hidden
 * Transform a conversion util into a version that returns null if the input is falsy
 */
export declare function optionize<InputType, OutputType, RestType extends unknown[]>(converter: (input: InputType, ...rest: RestType) => OutputType): (val: InputType | null | undefined, ...rest: RestType) => OutputType | null;
/**
 * @hidden
 * Compare two tags/modules and return true if they are equal, or if one is the other one's module
 */
export declare function isModuleOrTagMatch(a: TxTag | ModuleName, b: TxTag | ModuleName): boolean;
/**
 * Recursively convert a value into a human readable (JSON compliant) version:
 *   - Entities are converted via their `.toJson` method
 *   - Dates are converted to ISO strings
 *   - BigNumbers are converted to numerical strings
 */
export declare function toHumanReadable<T>(obj: T): HumanReadableType<T>;
//# sourceMappingURL=internal.d.ts.map