augment-api-rpc.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. // Auto-generated via `yarn polkadot-types-from-chain`, do not edit
  2. /* eslint-disable */
  3. import type { Metadata } from '@polkadot/metadata';
  4. import type { Bytes, HashMap, Json, Null, Option, StorageKey, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types';
  5. import type { AnyNumber, Codec, IExtrinsic, Observable } from '@polkadot/types/types';
  6. import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author';
  7. import type { EpochAuthorship } from '@polkadot/types/interfaces/babe';
  8. import type { BlockHash } from '@polkadot/types/interfaces/chain';
  9. import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate';
  10. import type { AuthorityId } from '@polkadot/types/interfaces/consensus';
  11. import type { ContractCallRequest, ContractExecResult } from '@polkadot/types/interfaces/contracts';
  12. import type { CreatedBlock } from '@polkadot/types/interfaces/engine';
  13. import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth';
  14. import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
  15. import type { EncodedFinalityProofs, JustificationNotification, ReportedRoundStates } from '@polkadot/types/interfaces/grandpa';
  16. import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr';
  17. import type { StorageKind } from '@polkadot/types/interfaces/offchain';
  18. import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment';
  19. import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
  20. import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime';
  21. import type { ReadProof, RuntimeVersion } from '@polkadot/types/interfaces/state';
  22. import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system';
  23. declare module '@polkadot/rpc-core/types.jsonrpc' {
  24. export interface RpcInterface {
  25. author: {
  26. /**
  27. * Returns true if the keystore has private keys for the given public key and key type.
  28. **/
  29. hasKey: AugmentedRpc<(publicKey: Bytes | string | Uint8Array, keyType: Text | string) => Observable<bool>>;
  30. /**
  31. * Returns true if the keystore has private keys for the given session public keys.
  32. **/
  33. hasSessionKeys: AugmentedRpc<(sessionKeys: Bytes | string | Uint8Array) => Observable<bool>>;
  34. /**
  35. * Insert a key into the keystore.
  36. **/
  37. insertKey: AugmentedRpc<(keyType: Text | string, suri: Text | string, publicKey: Bytes | string | Uint8Array) => Observable<Bytes>>;
  38. /**
  39. * Returns all pending extrinsics, potentially grouped by sender
  40. **/
  41. pendingExtrinsics: AugmentedRpc<() => Observable<Vec<Extrinsic>>>;
  42. /**
  43. * Remove given extrinsic from the pool and temporarily ban it to prevent reimporting
  44. **/
  45. removeExtrinsic: AugmentedRpc<(bytesOrHash: Vec<ExtrinsicOrHash> | (ExtrinsicOrHash | { Hash: any } | { Extrinsic: any } | string | Uint8Array)[]) => Observable<Vec<Hash>>>;
  46. /**
  47. * Generate new session keys and returns the corresponding public keys
  48. **/
  49. rotateKeys: AugmentedRpc<() => Observable<Bytes>>;
  50. /**
  51. * Submit and subscribe to watch an extrinsic until unsubscribed
  52. **/
  53. submitAndWatchExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<ExtrinsicStatus>>;
  54. /**
  55. * Submit a fully formatted extrinsic for block inclusion
  56. **/
  57. submitExtrinsic: AugmentedRpc<(extrinsic: IExtrinsic) => Observable<Hash>>;
  58. };
  59. babe: {
  60. /**
  61. * Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore
  62. **/
  63. epochAuthorship: AugmentedRpc<() => Observable<HashMap<AuthorityId, EpochAuthorship>>>;
  64. };
  65. chain: {
  66. /**
  67. * Get header and body of a relay chain block
  68. **/
  69. getBlock: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<SignedBlock>>;
  70. /**
  71. * Get the block hash for a specific block
  72. **/
  73. getBlockHash: AugmentedRpc<(blockNumber?: BlockNumber | AnyNumber | Uint8Array) => Observable<BlockHash>>;
  74. /**
  75. * Get hash of the last finalized block in the canon chain
  76. **/
  77. getFinalizedHead: AugmentedRpc<() => Observable<BlockHash>>;
  78. /**
  79. * Retrieves the header for a specific block
  80. **/
  81. getHeader: AugmentedRpc<(hash?: BlockHash | string | Uint8Array) => Observable<Header>>;
  82. /**
  83. * Retrieves the newest header via subscription
  84. **/
  85. subscribeAllHeads: AugmentedRpc<() => Observable<Header>>;
  86. /**
  87. * Retrieves the best finalized header via subscription
  88. **/
  89. subscribeFinalizedHeads: AugmentedRpc<() => Observable<Header>>;
  90. /**
  91. * Retrieves the best header via subscription
  92. **/
  93. subscribeNewHeads: AugmentedRpc<() => Observable<Header>>;
  94. };
  95. childstate: {
  96. /**
  97. * Returns the keys with prefix from a child storage, leave empty to get all the keys
  98. **/
  99. getKeys: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, prefix: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
  100. /**
  101. * Returns a child storage entry at a specific block state
  102. **/
  103. getStorage: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<StorageData>>>;
  104. /**
  105. * Returns the hash of a child storage entry at a block state
  106. **/
  107. getStorageHash: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<Hash>>>;
  108. /**
  109. * Returns the size of a child storage entry at a block state
  110. **/
  111. getStorageSize: AugmentedRpc<(childKey: PrefixedStorageKey | string | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: Hash | string | Uint8Array) => Observable<Option<u64>>>;
  112. };
  113. contracts: {
  114. /**
  115. * Executes a call to a contract
  116. **/
  117. call: AugmentedRpc<(callRequest: ContractCallRequest | { origin?: any; dest?: any; value?: any; gasLimit?: any; inputData?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ContractExecResult>>;
  118. /**
  119. * Returns the value under a specified storage key in a contract
  120. **/
  121. getStorage: AugmentedRpc<(address: AccountId | string | Uint8Array, key: H256 | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<Bytes>>>;
  122. /**
  123. * Returns the projected time a given contract will be able to sustain paying its rent
  124. **/
  125. rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Option<BlockNumber>>>;
  126. };
  127. engine: {
  128. /**
  129. * Instructs the manual-seal authorship task to create a new block
  130. **/
  131. createBlock: AugmentedRpc<(createEmpty: bool | boolean | Uint8Array, finalize: bool | boolean | Uint8Array, parentHash?: BlockHash | string | Uint8Array) => Observable<CreatedBlock>>;
  132. /**
  133. * Instructs the manual-seal authorship task to finalize a block
  134. **/
  135. finalizeBlock: AugmentedRpc<(hash: BlockHash | string | Uint8Array, justification?: Justification) => Observable<bool>>;
  136. };
  137. eth: {
  138. /**
  139. * Returns accounts list.
  140. **/
  141. accounts: AugmentedRpc<() => Observable<Vec<H160>>>;
  142. /**
  143. * Returns balance of the given account.
  144. **/
  145. blockNumber: AugmentedRpc<() => Observable<U256>>;
  146. /**
  147. * Call contract, returning the output data.
  148. **/
  149. call: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;
  150. /**
  151. * Returns the chain ID used for transaction signing at the current best block. None is returned if not available.
  152. **/
  153. chainId: AugmentedRpc<() => Observable<U64>>;
  154. /**
  155. * Returns block author.
  156. **/
  157. coinbase: AugmentedRpc<() => Observable<H160>>;
  158. /**
  159. * Estimate gas needed for execution of given contract.
  160. **/
  161. estimateGas: AugmentedRpc<(request: EthCallRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
  162. /**
  163. * Returns current gas price.
  164. **/
  165. gasPrice: AugmentedRpc<() => Observable<U256>>;
  166. /**
  167. * Returns balance of the given account.
  168. **/
  169. getBalance: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
  170. /**
  171. * Returns block with given hash.
  172. **/
  173. getBlockByHash: AugmentedRpc<(hash: H256 | string | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;
  174. /**
  175. * Returns block with given number.
  176. **/
  177. getBlockByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array, full: bool | boolean | Uint8Array) => Observable<Option<EthRichBlock>>>;
  178. /**
  179. * Returns the number of transactions in a block with given hash.
  180. **/
  181. getBlockTransactionCountByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;
  182. /**
  183. * Returns the number of transactions in a block with given block number.
  184. **/
  185. getBlockTransactionCountByNumber: AugmentedRpc<(block: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
  186. /**
  187. * Returns the code at given address at given time (block number).
  188. **/
  189. getCode: AugmentedRpc<(address: H160 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<Bytes>>;
  190. /**
  191. * Returns filter changes since last poll.
  192. **/
  193. getFilterChanges: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<EthFilterChanges>>;
  194. /**
  195. * Returns all logs matching given filter (in a range 'from' - 'to').
  196. **/
  197. getFilterLogs: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<Vec<EthLog>>>;
  198. /**
  199. * Returns logs matching given filter object.
  200. **/
  201. getLogs: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<Vec<EthLog>>>;
  202. /**
  203. * Returns proof for account and storage.
  204. **/
  205. getProof: AugmentedRpc<(address: H160 | string | Uint8Array, storageKeys: Vec<H256> | (H256 | string | Uint8Array)[], number: BlockNumber | AnyNumber | Uint8Array) => Observable<EthAccount>>;
  206. /**
  207. * Returns content of the storage at given address.
  208. **/
  209. getStorageAt: AugmentedRpc<(address: H160 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<H256>>;
  210. /**
  211. * Returns transaction at given block hash and index.
  212. **/
  213. getTransactionByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;
  214. /**
  215. * Returns transaction by given block number and index.
  216. **/
  217. getTransactionByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthTransaction>>;
  218. /**
  219. * Get transaction by its hash.
  220. **/
  221. getTransactionByHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthTransaction>>;
  222. /**
  223. * Returns the number of transactions sent from given address at given time (block number).
  224. **/
  225. getTransactionCount: AugmentedRpc<(hash: H256 | string | Uint8Array, number?: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
  226. /**
  227. * Returns transaction receipt by transaction hash.
  228. **/
  229. getTransactionReceipt: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<EthReceipt>>;
  230. /**
  231. * Returns an uncles at given block and index.
  232. **/
  233. getUncleByBlockHashAndIndex: AugmentedRpc<(hash: H256 | string | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;
  234. /**
  235. * Returns an uncles at given block and index.
  236. **/
  237. getUncleByBlockNumberAndIndex: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array, index: U256 | AnyNumber | Uint8Array) => Observable<EthRichBlock>>;
  238. /**
  239. * Returns the number of uncles in a block with given hash.
  240. **/
  241. getUncleCountByBlockHash: AugmentedRpc<(hash: H256 | string | Uint8Array) => Observable<U256>>;
  242. /**
  243. * Returns the number of uncles in a block with given block number.
  244. **/
  245. getUncleCountByBlockNumber: AugmentedRpc<(number: BlockNumber | AnyNumber | Uint8Array) => Observable<U256>>;
  246. /**
  247. * Returns the hash of the current block, the seedHash, and the boundary condition to be met.
  248. **/
  249. getWork: AugmentedRpc<() => Observable<EthWork>>;
  250. /**
  251. * Returns the number of hashes per second that the node is mining with.
  252. **/
  253. hashrate: AugmentedRpc<() => Observable<U256>>;
  254. /**
  255. * Returns true if client is actively mining new blocks.
  256. **/
  257. mining: AugmentedRpc<() => Observable<bool>>;
  258. /**
  259. * Returns id of new block filter.
  260. **/
  261. newBlockFilter: AugmentedRpc<() => Observable<U256>>;
  262. /**
  263. * Returns id of new filter.
  264. **/
  265. newFilter: AugmentedRpc<(filter: EthFilter | { fromBlock?: any; toBlock?: any; blockHash?: any; address?: any; topics?: any } | string | Uint8Array) => Observable<U256>>;
  266. /**
  267. * Returns id of new block filter.
  268. **/
  269. newPendingTransactionFilter: AugmentedRpc<() => Observable<U256>>;
  270. /**
  271. * Returns protocol version encoded as a string (quotes are necessary).
  272. **/
  273. protocolVersion: AugmentedRpc<() => Observable<u64>>;
  274. /**
  275. * Sends signed transaction, returning its hash.
  276. **/
  277. sendRawTransaction: AugmentedRpc<(bytes: Bytes | string | Uint8Array) => Observable<H256>>;
  278. /**
  279. * Sends transaction; will block waiting for signer to return the transaction hash
  280. **/
  281. sendTransaction: AugmentedRpc<(tx: EthTransactionRequest | { from?: any; to?: any; gasPrice?: any; gas?: any; value?: any; data?: any; nonce?: any } | string | Uint8Array) => Observable<H256>>;
  282. /**
  283. * Used for submitting mining hashrate.
  284. **/
  285. submitHashrate: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array, hash: H256 | string | Uint8Array) => Observable<bool>>;
  286. /**
  287. * Used for submitting a proof-of-work solution.
  288. **/
  289. submitWork: AugmentedRpc<(nonce: H64 | string | Uint8Array, headerHash: H256 | string | Uint8Array, mixDigest: H256 | string | Uint8Array) => Observable<bool>>;
  290. /**
  291. * Subscribe to Eth subscription.
  292. **/
  293. subscribe: AugmentedRpc<(kind: EthSubKind | 'newHeads' | 'logs' | 'newPendingTransactions' | 'syncing' | number | Uint8Array, params?: EthSubParams | { None: any } | { Logs: any } | string | Uint8Array) => Observable<Null>>;
  294. /**
  295. * Returns an object with data about the sync status or false.
  296. **/
  297. syncing: AugmentedRpc<() => Observable<EthSyncStatus>>;
  298. /**
  299. * Uninstalls filter.
  300. **/
  301. uninstallFilter: AugmentedRpc<(index: U256 | AnyNumber | Uint8Array) => Observable<bool>>;
  302. };
  303. grandpa: {
  304. /**
  305. * Prove finality for the range (begin; end] hash.
  306. **/
  307. proveFinality: AugmentedRpc<(begin: BlockHash | string | Uint8Array, end: BlockHash | string | Uint8Array, authoritiesSetId?: u64 | AnyNumber | Uint8Array) => Observable<Option<EncodedFinalityProofs>>>;
  308. /**
  309. * Returns the state of the current best round state as well as the ongoing background rounds
  310. **/
  311. roundState: AugmentedRpc<() => Observable<ReportedRoundStates>>;
  312. /**
  313. * Subscribes to grandpa justifications
  314. **/
  315. subscribeJustifications: AugmentedRpc<() => Observable<JustificationNotification>>;
  316. };
  317. mmr: {
  318. /**
  319. * Generate MMR proof for given leaf index.
  320. **/
  321. generateProof: AugmentedRpc<(leafIndex: u64 | AnyNumber | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<MmrLeafProof>>;
  322. };
  323. net: {
  324. /**
  325. * Returns true if client is actively listening for network connections. Otherwise false.
  326. **/
  327. listening: AugmentedRpc<() => Observable<bool>>;
  328. /**
  329. * Returns number of peers connected to node.
  330. **/
  331. peerCount: AugmentedRpc<() => Observable<Text>>;
  332. /**
  333. * Returns protocol version.
  334. **/
  335. version: AugmentedRpc<() => Observable<Text>>;
  336. };
  337. offchain: {
  338. /**
  339. * Get offchain local storage under given key and prefix
  340. **/
  341. localStorageGet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array) => Observable<Option<Bytes>>>;
  342. /**
  343. * Set offchain local storage under given key and prefix
  344. **/
  345. localStorageSet: AugmentedRpc<(kind: StorageKind | 'PERSISTENT' | 'LOCAL' | number | Uint8Array, key: Bytes | string | Uint8Array, value: Bytes | string | Uint8Array) => Observable<Null>>;
  346. };
  347. payment: {
  348. /**
  349. * Query the detailed fee of a given encoded extrinsic
  350. **/
  351. queryFeeDetails: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<FeeDetails>>;
  352. /**
  353. * Retrieves the fee information for an encoded extrinsic
  354. **/
  355. queryInfo: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<RuntimeDispatchInfo>>;
  356. };
  357. rpc: {
  358. /**
  359. * Retrieves the list of RPC methods that are exposed by the node
  360. **/
  361. methods: AugmentedRpc<() => Observable<RpcMethods>>;
  362. };
  363. state: {
  364. /**
  365. * Perform a call to a builtin on the chain
  366. **/
  367. call: AugmentedRpc<(method: Text | string, data: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<Bytes>>;
  368. /**
  369. * Retrieves the keys with prefix of a specific child storage
  370. **/
  371. getChildKeys: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
  372. /**
  373. * Retrieves the child storage for a key
  374. **/
  375. getChildStorage: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<StorageData>>;
  376. /**
  377. * Retrieves the child storage hash
  378. **/
  379. getChildStorageHash: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;
  380. /**
  381. * Retrieves the child storage size
  382. **/
  383. getChildStorageSize: AugmentedRpc<(childStorageKey: StorageKey | string | Uint8Array | any, childDefinition: StorageKey | string | Uint8Array | any, childType: u32 | AnyNumber | Uint8Array, key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;
  384. /**
  385. * Retrieves the keys with a certain prefix
  386. **/
  387. getKeys: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
  388. /**
  389. * Returns the keys with prefix with pagination support.
  390. **/
  391. getKeysPaged: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, count: u32 | AnyNumber | Uint8Array, startKey?: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<StorageKey>>>;
  392. /**
  393. * Returns the runtime metadata
  394. **/
  395. getMetadata: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<Metadata>>;
  396. /**
  397. * Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)
  398. **/
  399. getPairs: AugmentedRpc<(prefix: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Vec<KeyValue>>>;
  400. /**
  401. * Returns proof of storage entries at a specific block state
  402. **/
  403. getReadProof: AugmentedRpc<(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: BlockHash | string | Uint8Array) => Observable<ReadProof>>;
  404. /**
  405. * Get the runtime version
  406. **/
  407. getRuntimeVersion: AugmentedRpc<(at?: BlockHash | string | Uint8Array) => Observable<RuntimeVersion>>;
  408. /**
  409. * Retrieves the storage for a key
  410. **/
  411. getStorage: AugmentedRpc<<T = Codec>(key: StorageKey | string | Uint8Array | any, block?: Hash | Uint8Array | string) => Observable<T>>;
  412. /**
  413. * Retrieves the storage hash
  414. **/
  415. getStorageHash: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<Hash>>;
  416. /**
  417. * Retrieves the storage size
  418. **/
  419. getStorageSize: AugmentedRpc<(key: StorageKey | string | Uint8Array | any, at?: BlockHash | string | Uint8Array) => Observable<u64>>;
  420. /**
  421. * Query historical storage entries (by key) starting from a start block
  422. **/
  423. queryStorage: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], fromBlock?: Hash | Uint8Array | string, toBlock?: Hash | Uint8Array | string) => Observable<[Hash, T][]>>;
  424. /**
  425. * Query storage entries (by key) starting at block hash given as the second parameter
  426. **/
  427. queryStorageAt: AugmentedRpc<<T = Codec[]>(keys: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[], at?: Hash | Uint8Array | string) => Observable<T>>;
  428. /**
  429. * Retrieves the runtime version via subscription
  430. **/
  431. subscribeRuntimeVersion: AugmentedRpc<() => Observable<RuntimeVersion>>;
  432. /**
  433. * Subscribes to storage changes for the provided keys
  434. **/
  435. subscribeStorage: AugmentedRpc<<T = Codec[]>(keys?: Vec<StorageKey> | (StorageKey | string | Uint8Array | any)[]) => Observable<T>>;
  436. };
  437. syncstate: {
  438. /**
  439. * Returns the json-serialized chainspec running the node, with a sync state.
  440. **/
  441. genSyncSpec: AugmentedRpc<(raw: bool | boolean | Uint8Array) => Observable<Json>>;
  442. };
  443. system: {
  444. /**
  445. * Retrieves the next accountIndex as available on the node
  446. **/
  447. accountNextIndex: AugmentedRpc<(accountId: AccountId | string | Uint8Array) => Observable<Index>>;
  448. /**
  449. * Adds the supplied directives to the current log filter
  450. **/
  451. addLogFilter: AugmentedRpc<(directives: Text | string) => Observable<Null>>;
  452. /**
  453. * Adds a reserved peer
  454. **/
  455. addReservedPeer: AugmentedRpc<(peer: Text | string) => Observable<Text>>;
  456. /**
  457. * Retrieves the chain
  458. **/
  459. chain: AugmentedRpc<() => Observable<Text>>;
  460. /**
  461. * Retrieves the chain type
  462. **/
  463. chainType: AugmentedRpc<() => Observable<ChainType>>;
  464. /**
  465. * Dry run an extrinsic at a given block
  466. **/
  467. dryRun: AugmentedRpc<(extrinsic: Bytes | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable<ApplyExtrinsicResult>>;
  468. /**
  469. * Return health status of the node
  470. **/
  471. health: AugmentedRpc<() => Observable<Health>>;
  472. /**
  473. * The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example
  474. **/
  475. localListenAddresses: AugmentedRpc<() => Observable<Vec<Text>>>;
  476. /**
  477. * Returns the base58-encoded PeerId of the node
  478. **/
  479. localPeerId: AugmentedRpc<() => Observable<Text>>;
  480. /**
  481. * Retrieves the node name
  482. **/
  483. name: AugmentedRpc<() => Observable<Text>>;
  484. /**
  485. * Returns current state of the network
  486. **/
  487. networkState: AugmentedRpc<() => Observable<NetworkState>>;
  488. /**
  489. * Returns the roles the node is running as
  490. **/
  491. nodeRoles: AugmentedRpc<() => Observable<Vec<NodeRole>>>;
  492. /**
  493. * Returns the currently connected peers
  494. **/
  495. peers: AugmentedRpc<() => Observable<Vec<PeerInfo>>>;
  496. /**
  497. * Get a custom set of properties as a JSON object, defined in the chain spec
  498. **/
  499. properties: AugmentedRpc<() => Observable<ChainProperties>>;
  500. /**
  501. * Remove a reserved peer
  502. **/
  503. removeReservedPeer: AugmentedRpc<(peerId: Text | string) => Observable<Text>>;
  504. /**
  505. * Resets the log filter to Substrate defaults
  506. **/
  507. resetLogFilter: AugmentedRpc<() => Observable<Null>>;
  508. /**
  509. * Returns the state of the syncing of the node
  510. **/
  511. syncState: AugmentedRpc<() => Observable<SyncState>>;
  512. /**
  513. * Retrieves the version of the node
  514. **/
  515. version: AugmentedRpc<() => Observable<Text>>;
  516. };
  517. web3: {
  518. /**
  519. * Returns current client version.
  520. **/
  521. clientVersion: AugmentedRpc<() => Observable<Text>>;
  522. /**
  523. * Returns sha3 of the given data
  524. **/
  525. sha3: AugmentedRpc<(data: Bytes | string | Uint8Array) => Observable<H256>>;
  526. };
  527. }
  528. }