augment-api-rpc.ts 28 KB

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