pub fn generate_runtime_api_from_url(
    item_mod: ItemMod,
    url: &Uri,
    derives: DerivesRegistry,
    type_substitutes: TypeSubstitutes,
    crate_path: CratePath,
    should_gen_docs: bool,
    runtime_types_only: bool
) -> Result<TokenStream2, CodegenError>
Expand description

Generates the API for interacting with a substrate runtime, using metadata that can be downloaded from a node at the provided URL. This function blocks while retrieving the metadata.

Arguments

  • item_mod - The module declaration for which the API is implemented.
  • url - HTTP/WS URL to the substrate node you’d like to pull metadata from.
  • derives - Provide custom derives for the generated types.
  • type_substitutes - Provide custom type substitutes.
  • crate_path - Path to the subxt crate.
  • should_gen_docs - True if the generated API contains the documentation from the metadata.
  • runtime_types_only - Whether to limit code generation to only runtime types.

Note: This is a wrapper over RuntimeGenerator for static metadata use-cases.