system_runtime_api/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![allow(clippy::too_many_arguments)]
3#![allow(clippy::unnecessary_mut_passed)]
4#![allow(rustdoc::bare_urls)]
5// Strong Documentation Lints
6#![deny(
7 rustdoc::broken_intra_doc_links,
8 rustdoc::missing_crate_level_docs,
9 rustdoc::invalid_codeblock_attributes,
10 missing_docs
11)]
12
13//! Runtime API definition for additional Frequency RPCs
14//! This api must be implemented by the n//!ode runtime.
15//! Runtime APIs Provide:
16//! - An interface between the runtime and Custom RPCs.
17//! - Runtime interfaces for end users beyond just State Queries
18
19use common_primitives::rpc::RpcEvent;
20extern crate alloc;
21use alloc::vec::Vec;
22
23// Here we declare the runtime API. It is implemented it the `impl` block in
24// runtime files (the `runtime` folder)
25sp_api::decl_runtime_apis! {
26
27 /// Runtime Version for Additional Frequency Runtime Apis
28 /// - MUST be incremented if anything changes
29 /// - See: https://paritytech.github.io/polkadot/doc/polkadot_primitives/runtime_api/index.html
30 #[api_version(1)]
31
32 /// Runtime API definition for Frequency
33 pub trait AdditionalRuntimeApi {
34 /// Fetch the events of a block
35 /// An easy to work with structure with minimal SCALE needs
36 fn get_events() -> Vec<RpcEvent>;
37 }
38}