import { AnyNumber, Codec, IExtrinsic } from "../../../types/types"; import { Option, Vec } from "../../../types/codec"; import { Bytes, H256, StorageData, StorageKey, Text, u32, u64 } from "../../../types/primitive"; import { Metadata } from "../../../types"; import { AccountId, BlockNumber, Extrinsic, Hash, Header, Index, SignedBlock } from "../../../types/interfaces/runtime"; import { ContractCallRequest, ContractExecResult } from "../../../types/interfaces/contracts"; import { BlockHash, ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, NetworkState, PeerInfo, RpcMethods, RuntimeDispatchInfo, RuntimeVersion, StorageChangeSet } from "../../../types/interfaces/rpc"; import { Observable } from 'rxjs'; declare module "../../../rpc-core/types.jsonrpc" { interface RpcInterface { account: { /** * Retrieves the next accountIndex as available on the node **/ nextIndex(accountId: AccountId | string | Uint8Array): Observable; }; author: { /** * Insert a key into the keystore. **/ insertKey(keyType: Text | string, suri: Text | string, publicKey: Bytes | string | Uint8Array): Observable; /** * Returns all pending extrinsics, potentially grouped by sender **/ pendingExtrinsics(): Observable>; /** * Remove given extrinsic from the pool and temporarily ban it to prevent reimporting **/ removeExtrinsic(bytesOrHash: Vec | (ExtrinsicOrHash | { hash: any; } | { extrinsic: any; } | string | Uint8Array)[]): Observable>; /** * Generate new session keys and returns the corresponding public keys **/ rotateKeys(): Observable; /** * Submit and subscribe to watch an extrinsic until unsubscribed **/ submitAndWatchExtrinsic(extrinsic: IExtrinsic): Observable; /** * Submit a fully formatted extrinsic for block inclusion **/ submitExtrinsic(extrinsic: IExtrinsic): Observable; }; chain: { /** * Get header and body of a relay chain block **/ getBlock(hash?: BlockHash | string | Uint8Array): Observable; /** * Get the block hash for a specific block **/ getBlockHash(blockNumber?: BlockNumber | AnyNumber | Uint8Array): Observable; /** * Get hash of the last finalized block in the canon chain **/ getFinalizedHead(): Observable; /** * Retrieves the header for a specific block **/ getHeader(hash?: BlockHash | string | Uint8Array): Observable
; /** * Retrieves the best finalized header via subscription **/ subscribeFinalizedHeads(): Observable
; /** * Retrieves the best header via subscription **/ subscribeNewHeads(): Observable
; }; contracts: { /** * Executes a call to a contract **/ call(callRequest: ContractCallRequest | { origin?: any; dest?: any; value?: any; gasLimit?: any; inputData?: any; } | string | Uint8Array, at?: BlockHash | string | Uint8Array): Observable; /** * Returns the value under a specified storage key in a contract **/ getStorage(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array): Observable>; }; payment: { /** * Retrieves the fee information for an encoded extrinsic **/ queryInfo(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array): Observable; }; rpc: { /** * Retrieves the list of RPC methods that are exposed by the node **/ methods(): Observable; }; state: { /** * Perform a call to a builtin on the chain **/ call(method: Text | string, data: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array): Observable; /** * Retrieves the keys with prefix of a specific child storage **/ getChildKeys(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable>; /** * Retrieves the child storage for a key **/ getChildStorage(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable; /** * Retrieves the child storage hash **/ getChildStorageHash(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable; /** * Retrieves the child storage size **/ getChildStorageSize(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable; /** * Retrieves the keys with a certain prefix **/ getKeys(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable>; /** * Returns the runtime metadata **/ getMetadata(at?: BlockHash | string | Uint8Array): Observable; /** * Get the runtime version **/ getRuntimeVersion(at?: BlockHash | string | Uint8Array): Observable; getStorage(key: any, block?: Hash | Uint8Array | string): Observable; /** * Retrieves the storage hash **/ getStorageHash(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable; /** * Retrieves the storage size **/ getStorageSize(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array): Observable; /** * Query historical storage entries (by key) starting from a start block **/ queryStorage(keys: Vec | (StorageKey | string | Uint8Array | any)[], startBlock: Hash | string | Uint8Array, at?: BlockHash | string | Uint8Array): Observable>; /** * Retrieves the runtime version via subscription **/ subscribeRuntimeVersion(): Observable; subscribeStorage(keys: any[]): Observable; }; system: { /** * Retrieves the chain **/ chain(): Observable; /** * Return health status of the node **/ health(): Observable; /** * Retrieves the node name **/ name(): Observable; /** * Returns current state of the network **/ networkState(): Observable; /** * Returns the currently connected peers **/ peers(): Observable>; /** * Get a custom set of properties as a JSON object, defined in the chain spec **/ properties(): Observable; /** * Retrieves the version of the node **/ version(): Observable; }; } }