Registry / other / sp-api

sp-api

JSON →
library42.0.0rscratesunverified

Substrate runtime API primitives.

# Cargo.toml [dependencies] sp-api = "42.0.0"
INSTALL
IMPORT
SIG · SP-API
S
sp-api
otherrustv42.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

decl_runtime_apis
use sp_api::decl_runtime_apis;

Declares a simple runtime API trait using the sp_api macro.

use sp_api::decl_runtime_apis; decl_runtime_apis! { pub trait MyApi { fn my_function() -> u32; } } fn main() { println!("Runtime API declared"); }
Debug
Known issues
gotchaThis crate is part of the Substrate/Polkadot SDK and requires specific dependencies and build setup.
fix
Ensure you have the full Substrate environment and dependencies like sp_core, sp_runtime, etc.
affects: >=2.0.0
Upgrade
Version history
42.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
3 hits · last 30 days
node
2
Amazon
1
Resources
sp-api — cargo add sp-api · libregistry