Cargo Features

[dependencies]
substrate-api-client = { version = "1.16.0", default-features = false, features = ["disable_target_static_assertions", "sync-api", "jsonrpsee-client", "tungstenite-client", "ws-client", "staking-xt", "contracts-xt", "disable-metadata-hash-check", "std"] }
default = jsonrpsee-client, std

These default features are set whenever substrate-api-client is added without default-features = false somewhere in the dependency tree.

disable_target_static_assertions

To support no_std builds in non-32 bit environments.

Enables disable_target_static_assertions of sp-runtime-interface

sync-api tungstenite-client? ws-client?

If this is active all the code compiles in synchronous mode. If not selected, code will compile to async mode.

Enables is_sync of maybe-async and sync-api of ac-compose-macros

local deps

jsonrpsee-client default = jsonrpsee, std

Use the jsonrpsee crate for websocket communication. Does only provide async support and needs a tokio runtime. Provides convenience functions such as subscription callbacks. Most examples use the jsonrpsee feature and can be used for reference.

Affects rpc::jsonrpsee_client

tungstenite-client = std, sync-api, tungstenite

Use the tungstenite crate for websocket communication. No async support but has some reconnection capabilities. See the example transfer_with_tungstenite_client on how to use it.

Affects rpc::tungstenite_client

ws-client = std, sync-api, ws

Use the ws crate for websocket communication. No async support. Establishes a new connection for each request and therefore is limited in terms of performance. See the example transfer_with_ws_client on how to use it.

Affects rpc::ws_client

staking-xt = std

Enables functionality that helps to create extrinsics for pallet-staking. See the StakingExtrinsics trait and the staking_batch_payout example to get an understanding of the functionality this feature provides

Enables staking-xt of ac-primitives

Affects extrinsic::staking

contracts-xt = std

Enables functionality that helps to create extrinsics for pallet-contracts. See the ContractsExtrinsics trait and the contract_instantiate_with_code example to get an understanding of the functionality this feature provides.

Enables contracts-xt of ac-primitives

Affects extrinsic::contracts

disable-metadata-hash-check

Provides compatibility to RFC-0078: "Merkelized Metadata" but disables the check of the metadata hash

Enables disable-metadata-hash-check of ac-primitives

std default contracts-xt? jsonrpsee-client staking-xt? tungstenite-client? ws-client? = frame-support, url

Enables all std features of dependencies in case of std build.

Enables std of ac-compose-macros, ac-node-api, ac-primitives, parity-scale-codec, frame-metadata ^16.0, futures-util, hex, log, serde, serde_json, sp-core, sp-runtime, sp-runtime-interface, sp-storage, and sp-version

sp-core:

Substrate no_std dependencies

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.

url std

Enables url

crates.io std only

jsonrpsee jsonrpsee-client

Enables jsonrpsee

websocket dependent features

tungstenite tungstenite-client?

Enables tungstenite ^0.23

ws ws-client?
frame-support std

Enables frame-support

substrate std / wasm only