///
import type { ApiTypes, DeriveCustom, QueryableStorageMulti } from '@polkadot/api-base/types';
import type { ApiInterfaceRx as ApiInterfaceBase } from '@polkadot/api-base/types/api';
import type { QueryableCalls } from '@polkadot/api-base/types/calls';
import type { QueryableConsts } from '@polkadot/api-base/types/consts';
import type { DecoratedErrors } from '@polkadot/api-base/types/errors';
import type { DecoratedEvents } from '@polkadot/api-base/types/events';
import type { QueryableStorage } from '@polkadot/api-base/types/storage';
import type { ProviderInterface, ProviderInterfaceEmitted } from '@polkadot/rpc-provider/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { Call, Extrinsic, Hash, RuntimeVersionPartial } from '@polkadot/types/interfaces';
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, DefinitionsCall, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@polkadot/types/types';
import type { BN } from '@polkadot/util';
import type { HexString } from '@polkadot/util/types';
import type { ApiBase } from '../base/index.js';
import type { SubmittableExtrinsic } from '../types/submittable.js';
import type { AllDerives } from '../util/decorate.js';
export type { Signer, SignerResult } from '@polkadot/types/types';
export { ApiBase } from '../base/index.js';
export * from '@polkadot/api/types/calls';
export * from '@polkadot/api/types/consts';
export * from '@polkadot/api/types/errors';
export * from '@polkadot/api/types/events';
export * from '@polkadot/api/types/storage';
export * from '@polkadot/api/types/submittable';
export * from '@polkadot/api-base/types';
export interface ApiInterfaceRx extends ApiInterfaceBase {
derive: AllDerives<'rxjs'>;
}
export interface ApiOptions extends RegisteredTypes {
/**
* @description Add custom derives to be injected
*/
derives?: DeriveCustom;
/**
* @description Control the initialization of the wasm libraries. When not specified, it defaults to `true`, initializing the wasm libraries, set to `false` to not initialize wasm. (No sr25519 support)
*/
initWasm?: boolean;
/**
* @description Controls the checking of storage values once they have been contructed. When not specified this defaults to `true`. Set to `false` to forgo any checking on storage results.
*/
isPedantic?: boolean;
/**
* @description pre-bundles is a map of 'genesis hash and runtime spec version' as key to a metadata hex string
* if genesis hash and runtime spec version matches, then use metadata, else fetch it from chain
*/
metadata?: Record;
/**
* @description Don't display any warnings on initialization (missing RPC methods & runtime calls)
*/
noInitWarn?: boolean;
/**
* @description Transport Provider from rpc-provider. If not specified, it will default to
* connecting to a WsProvider connecting localhost with the default port, i.e. `ws://127.0.0.1:9944`
*/
provider?: ProviderInterface;
/**
* @description A type registry to use along with this instance
*/
registry?: Registry;
/**
* @description User-defined RPC methods
*/
rpc?: Record>;
/**
* @description Overrides for state_call usage (this will be removed in some future version)
*/
runtime?: DefinitionsCall;
/**
* @description Any chain-specific signed extensions that are now well-known
*/
signedExtensions?: ExtDef;
/**
* @description An external signer which will be used to sign extrinsic when account passed in is not KeyringPair
*/
signer?: Signer;
/**
* @description The source object to use for runtime information (only used when cloning)
*/
source?: ApiBase;
/**
* @description Throws an error when the initial connection fails (same as isReadyOrError)
*/
throwOnConnect?: boolean;
/**
* @description Throws an error when some types are unknown (useful with throwOnConnect)
*/
throwOnUnknown?: boolean;
}
export type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready' | 'decorated';
export interface SignerOptions extends SignatureOptions {
blockNumber: BN;
genesisHash: Hash;
}
export interface ApiDecoration {
call: QueryableCalls;
consts: QueryableConsts;
errors: DecoratedErrors;
events: DecoratedEvents;
query: QueryableStorage;
registry: Registry;
runtimeVersion: RuntimeVersionPartial;
rx: {
call: QueryableCalls<'rxjs'>;
query: QueryableStorage<'rxjs'>;
};
tx: (extrinsic: Call | Extrinsic | Uint8Array | string) => SubmittableExtrinsic;
findCall(callIndex: Uint8Array | string): CallFunction;
findError(errorIndex: Uint8Array | string): RegistryError;
queryMulti: QueryableStorageMulti;
}