///
import '@5ire/api/augment';
import type { Observable } from 'rxjs';
import type { DeriveCustom, ExactDerive } from '@5ire/api-derive';
import type { RpcInterface } from '@5ire/rpc-core/types';
import type { ProviderInterface, ProviderInterfaceEmitted } from '@5ire/rpc-provider/types';
import type { ExtDef } from '@5ire/types/extrinsic/signedExtensions/types';
import type { Hash, RuntimeVersion } from '@5ire/types/interfaces';
import type { Metadata } from '@5ire/types/metadata';
import type { CallFunction, DefinitionRpc, DefinitionRpcSub, RegisteredTypes, Registry, RegistryError, SignatureOptions, Signer } from '@5ire/types/types';
import type { BN } from '@5ire/util';
import type { ApiBase } from '../base';
import type { DeriveAllSections } from '../util/decorate';
import type { ApiTypes } from './base';
import type { QueryableConsts } from './consts';
import type { DecoratedErrors } from './errors';
import type { DecoratedEvents } from './events';
import type { DecoratedRpc } from './rpc';
import type { QueryableStorage, QueryableStorageMulti } from './storage';
import type { SubmittableExtrinsics } from './submittable';
export { Signer, SignerResult } from '@5ire/types/types';
export { ApiBase } from '../base';
export * from '../submittable/types';
export * from './base';
export * from './consts';
export * from './errors';
export * from './events';
export * from './rpc';
export * from './storage';
export * from './submittable';
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 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 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 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 interface ApiInterfaceRx {
consts: QueryableConsts<'rxjs'>;
derive: DeriveAllSections<'rxjs', ExactDerive>;
extrinsicType: number;
genesisHash?: Hash;
hasSubscriptions: boolean;
registry: Registry;
runtimeMetadata: Metadata;
runtimeVersion: RuntimeVersion;
query: QueryableStorage<'rxjs'>;
queryAt: (blockHash: Uint8Array | string) => Observable>;
queryMulti: QueryableStorageMulti<'rxjs'>;
rpc: DecoratedRpc<'rxjs', RpcInterface>;
tx: SubmittableExtrinsics<'rxjs'>;
signer?: Signer;
}
export declare type ApiInterfaceEvents = ProviderInterfaceEmitted | 'ready';
export interface SignerOptions extends SignatureOptions {
blockNumber: BN;
genesisHash: Hash;
}
export interface ApiDecoration {
consts: QueryableConsts;
errors: DecoratedErrors;
events: DecoratedEvents;
query: QueryableStorage;
registry: Registry;
rx: {
query: QueryableStorage<'rxjs'>;
};
findCall(callIndex: Uint8Array | string): CallFunction;
findError(errorIndex: Uint8Array | string): RegistryError;
queryMulti: QueryableStorageMulti;
}