Cargo Features
[dependencies]
subxt = { version = "0.37.0", 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 async-client and client-ws-transport-native-tls of optional jsonrpsee ^0.22
Included if the "jsonrpsee" feature is enabled.
and native of optional reconnecting-jsonrpsee-ws-client and optional subxt-lightclient
reconnecting-jsonrpsee-ws-client:
Reconnecting jsonrpc ws client
- 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 ^0.22 and js of getrandom
Included if "web" feature is enabled, to enable its js feature.
and web of subxt-macro, optional reconnecting-jsonrpsee-ws-client, 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
- jsonrpsee default
-
Enable this to use jsonrpsee (allowing for example
OnlineClient::from_url
).Enables jsonrpsee ^0.22
- substrate-compat
-
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 someFrom
impls for types likeAccountId32
. Cannot be used with "web".Enables substrate-compat of subxt-core
- 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.
- subxt-lightclient unstable-light-client?
- getrandom web?
- tokio-util native
-
Enables tokio-util
Included if "native" feature is enabled