Cargo Features

[dependencies]
subxt = { version = "0.35.3", default-features = false, features = ["native", "web", "unstable-reconnecting-rpc-client", "jsonrpsee", "substrate-compat", "unstable-metadata", "unstable-light-client"] }
default = jsonrpsee, native

For dev and documentation reasons we enable more features than are often desired. it's recommended to use --no-default-features and then select what you need.

native default = tokio-util

Enable this for native (ie non web/wasm builds).
Exactly 1 of "web" and "native" is expected.

Enables native of optional subxt-lightclient and async-client and client-ws-transport-native-tls of optional jsonrpsee

Included if the "jsonrpsee" feature is enabled.

web

Enable this for web/wasm builds.
Exactly 1 of "web" and "native" is expected.

Enables wasm-bindgen of instant, async-wasm-client and client-web-transport of optional jsonrpsee and js of getrandom

Included if "web" feature is enabled, to enable its js feature.

and web of subxt-macro and optional subxt-lightclient

subxt-macro:

Other subxt crates we depend on.

unstable-reconnecting-rpc-client

Enable this to use the reconnecting rpc client

Enables reconnecting-jsonrpsee-ws-client ^0.3

Reconnecting jsonrpc ws client

jsonrpsee default

Enable this to use jsonrpsee (allowing for example OnlineClient::from_url).

Enables jsonrpsee

substrate-compat = sp-core, sp-runtime

Enable this to pull in extra Substrate dependencies which make it possible to use the sp_core::crypto::Pair Signer implementation, as well as adding some From impls for types like AccountId32. Cannot be used with "web".

unstable-metadata

Enable this to fetch and utilize the latest unstable metadata from a node.
The unstable metadata is subject to breaking changes and the subxt might fail to decode the metadata properly. Use this to experiment with the latest features exposed by the metadata.

unstable-light-client = subxt-lightclient

Activate this to expose the Light Client functionality.
Note that this feature is experimental and things may break or not work as expected.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

sp-core substrate-compat?

Enables sp-core ^31.0.0

Included if the "substrate-compat" feature is enabled.

sp-runtime substrate-compat?

Enables sp-runtime ^34.0.0

subxt-lightclient unstable-light-client?
getrandom web?
tokio-util native

Enables tokio-util

Included if "native" feature is enabled