substrate-api-client 1.21.0

Json-rpc client with helper functions compatible with any Substrate node
Documentation
[package]
name = "substrate-api-client"
version = "1.21.0"
authors = ["Supercomputing Systems AG <info@scs.ch>"]
license = "Apache-2.0"
edition = "2021"
repository = "https://github.com/scs/substrate-api-client"
description = "Json-rpc client with helper functions compatible with any Substrate node"
readme = "../README.md"
keywords = ["json", "rpc", "polkadot", "api", "blockchain"]
categories = ["no-std", "wasm"]


[dependencies]
# crates.io no_std
async-trait = { workspace = true }
codec = { workspace = true }
derive_more = { workspace = true }
frame-metadata = { workspace = true }
futures-util = { workspace = true }
hex = { workspace = true }
log = { workspace = true }
maybe-async = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }


# crates.io std only
url = { workspace = true, optional = true }

# websocket dependent features
jsonrpsee = { workspace = true, optional = true, features = ["async-client", "client-ws-transport-tls", "jsonrpsee-types"] }
tungstenite = { workspace = true, optional = true, features = ["native-tls", "url"] }

# Substrate no_std dependencies
sp-core = { workspace = true, features = ["full_crypto", "serde"] }
sp-crypto-hashing = { workspace = true }
sp-inherents = { workspace = true }
sp-runtime = { workspace = true, features = ["serde"] }
sp-runtime-interface = { workspace = true }
sp-storage = { workspace = true, features = ["serde"] }
sp-version = { workspace = true, features = ["serde"] }

# substrate std / wasm only
frame-support = { workspace = true, optional = true }

# local deps
ac-compose-macros = { workspace = true }
ac-node-api = { workspace = true }
ac-primitives = { workspace = true }


[dev-dependencies]
ac-node-api = { workspace = true, features = ["mocks"] }
rococo-runtime = { workspace = true }
scale-info = { workspace = true, features = ["derive"] }
test-case = { workspace = true }

[features]
default = ["std", "jsonrpsee-client"]
# To support `no_std` builds in non-32 bit environments.
disable_target_static_assertions = [
    "sp-runtime-interface/disable_target_static_assertions",
]

# If this is active all the code compiles in synchronous mode. If not selected, code will compile to async mode.
sync-api = ["ac-compose-macros/sync-api", "maybe-async/is_sync"]

# 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.
jsonrpsee-client = ["std", "dep:jsonrpsee"]

# 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.
tungstenite-client = ["std", "tungstenite", "sync-api"]

# 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
staking-xt = ["std", "ac-primitives/staking-xt"]

# 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.
contracts-xt = ["std", "ac-primitives/contracts-xt"]

# Enables all std features of dependencies in case of std build.
std = [
    # crates.io no_std
    "codec/std",
    "frame-metadata/std",
    "hex/std",
    "log/std",
    "serde/std",
    "serde_json/std",
    "futures-util/std",
    # crates.io std only
    "url",
    # substrate no_std
    "sp-core/std",
    "sp-runtime/std",
    "sp-runtime-interface/std",
    "sp-storage/std",
    "sp-version/std",
    # substrate std
    "frame-support",
    # local deps
    "ac-compose-macros/std",
    "ac-node-api/std",
    "ac-primitives/std",
]