import { RpcInterface } from '@polkadot/rpc-core/jsonrpc.types';
import { Hash, RuntimeVersion } from '@polkadot/types/interfaces';
import { InterfaceRegistry } from '@polkadot/types/interfaceRegistry';
import { CallFunction, InterfaceTypes, RegistryTypes, SignerPayloadRawBase } from '@polkadot/types/types';
import { ApiOptions, ApiTypes, DecoratedRpc, DecorateMethod, QueryableStorage, QueryableStorageMulti, SubmittableExtrinsics, Signer } from '../types';
import { Constants } from '@polkadot/api-metadata/consts/types';
import { Metadata } from '@polkadot/types';
import Init from './Init';
interface KeyringSigner {
    sign(message: Uint8Array): Uint8Array;
}
export default abstract class ApiBase<ApiType> extends Init<ApiType> {
    /**
     * @description Create an instance of the class
     *
     * @param options Options object to create API instance or a Provider instance
     *
     * @example
     * <BR>
     *
     * ```javascript
     * import Api from '@polkadot/api/promise';
     *
     * const api = new Api().isReady();
     *
     * api.rpc.subscribeNewHeads((header) => {
     *   console.log(`new block #${header.number.toNumber()}`);
     * });
     * ```
     */
    constructor(options: ApiOptions | undefined, type: ApiTypes, decorateMethod: DecorateMethod<ApiType>);
    /**
     * @description Contains the parameter types (constants) of all modules.
     *
     * The values are instances of the appropriate type and are accessible using `section`.`constantName`,
     *
     * @example
     * <BR>
     *
     * ```javascript
     * console.log(api.consts.democracy.enactmentPeriod.toString())
     * ```
     */
    readonly consts: Constants;
    /**
     * @description Derived results that are injected into the API, allowing for combinations of various query results.
     *
     * @example
     * <BR>
     *
     * ```javascript
     * api.derive.chain.bestNumber((number) => {
     *   console.log('best number', number);
     * });
     * ```
     */
    readonly derive: ReturnType<ApiBase<ApiType>['decorateDerive']>;
    /**
     * @description  Returns the version of extrinsics in-use on this chain
     */
    readonly extrinsicVersion: number;
    /**
     * @description Contains the genesis Hash of the attached chain. Apart from being useful to determine the actual chain, it can also be used to sign immortal transactions.
     */
    readonly genesisHash: Hash;
    /**
     * @description `true` when subscriptions are supported
     */
    readonly hasSubscriptions: boolean;
    /**
     * @description The library information name & version (from package.json)
     */
    readonly libraryInfo: string;
    /**
     * @description Contains all the chain state modules and their subsequent methods in the API. These are attached dynamically from the runtime metadata.
     *
     * All calls inside the namespace, is denoted by `section`.`method` and may take an optional query parameter. As an example, `api.query.timestamp.now()` (current block timestamp) does not take parameters, while `api.query.system.accountNonce(<accountId>)` (retrieving the associated nonce for an account), takes the `AccountId` as a parameter.
     *
     * @example
     * <BR>
     *
     * ```javascript
     * api.query.balances.freeBalance(<accountId>, (balance) => {
     *   console.log('new balance', balance);
     * });
     * ```
     */
    readonly query: QueryableStorage<ApiType>;
    /**
     * @description Allows for the querying of multiple storage entries and the combination thereof into a single result. This is a very optimal way to make multiple queries since it only makes a single connection to the node and retrieves the data over one subscription.
     *
     * @example
     * <BR>
     *
     * ```javascript
     * const unsub = await api.queryMulti(
     *   [
     *     // you can include the storage without any parameters
     *     api.query.balances.totalIssuance,
     *     // or you can pass parameters to the storage query
     *     [api.query.balances.freeBalance, '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY']
     *   ],
     *   ([existential, balance]) => {
     *     console.log(`You have ${balance.sub(existential)} more than the existential deposit`);
     *
     *     unsub();
     *   }
     * );
     * ```
     */
    readonly queryMulti: QueryableStorageMulti<ApiType>;
    /**
     * @description Contains all the raw rpc sections and their subsequent methods in the API as defined by the jsonrpc interface definitions. Unlike the dynamic `api.query` and `api.tx` sections, these methods are fixed (although extensible with node upgrades) and not determined by the runtime.
     *
     * RPC endpoints available here allow for the query of chain, node and system information, in addition to providing interfaces for the raw queries of state (using known keys) and the submission of transactions.
     *
     * @example
     * <BR>
     *
     * ```javascript
     * api.rpc.chain.subscribeNewHeads((header) => {
     *   console.log('new header', header);
     * });
     * ```
     */
    readonly rpc: DecoratedRpc<ApiType, RpcInterface>;
    /**
     * @description Yields the current attached runtime metadata. Generally this is only used to construct extrinsics & storage, but is useful for current runtime inspection.
     */
    readonly runtimeMetadata: Metadata;
    /**
     * @description Contains the version information for the current runtime.
     */
    readonly runtimeVersion: RuntimeVersion;
    /**
     * @description The type of this API instance, either 'rxjs' or 'promise'
     */
    readonly type: ApiTypes;
    /**
     * @description Contains all the extrinsic modules and their subsequent methods in the API. It allows for the construction of transactions and the submission thereof. These are attached dynamically from the runtime metadata.
     *
     * @example
     * <BR>
     *
     * ```javascript
     * api.tx.balances
     *   .transfer(<recipientId>, <balance>)
     *   .signAndSend(<keyPair>, ({status}) => {
     *     console.log('tx status', status.asFinalized.toHex());
     *   });
     * ```
     */
    readonly tx: SubmittableExtrinsics<ApiType>;
    /**
     * @description Creates an instance of a type as registered
     */
    createType<K extends InterfaceTypes>(type: K, ...params: any[]): InterfaceRegistry[K];
    /**
     * @description Disconnect from the underlying provider, halting all network traffic
     */
    disconnect(): void;
    /**
     * @description Finds the definition for a specific [[Call]] based on the index supplied
     */
    findCall(callIndex: Uint8Array | string): CallFunction;
    /**
     * @description Register additional user-defined of chain-specific types in the type registry
     */
    registerTypes(types?: RegistryTypes): void;
    /**
     * @description Set an external signer which will be used to sign extrinsic when account passed in is not KeyringPair
     */
    setSigner(signer: Signer): void;
    /**
     * @description Signs a raw signer payload, string or Uint8Array
     */
    sign(signer: KeyringSigner | string, data: SignerPayloadRawBase): Promise<string>;
}
export {};
