Cargo Features

[dependencies]
subxt-signer = { version = "0.38.0", default-features = false, features = ["std", "sr25519", "ecdsa", "unstable-eth", "polkadot-js-compat", "subxt", "web"] }
default = ecdsa, sr25519, std, subxt

These default features are set whenever subxt-signer is added without default-features = false somewhere in the dependency tree.

std default polkadot-js-compat?

Enables std of sha2, optional serde, and optional serde_json

serde:

These are used if the polkadot-js-compat feature is enabled

and std of bip39, hmac, pbkdf2, regex, optional base64, optional crypto_secretbox, optional schnorrkel, optional scrypt, and optional secp256k1

regex:

ECOSYSTEM FEATURES

The 'std' feature permits the regex crate to use the standard library. This is intended to support future use cases where the regex crate may be able to compile without std, and instead just rely on 'core' and 'alloc' (for example). Currently, this isn't supported, and removing the 'std' feature will prevent regex from compiling.

sr25519 default polkadot-js-compat? = schnorrkel

Pick the signer implementation(s) you need by enabling the corresponding features. Note: I had more difficulties getting ecdsa compiling to WASM on my mac; following this comment helped: https://github.com/rust-bitcoin/rust-bitcoin/issues/930#issuecomment-1215538699

Affects subxt-signer::sr25519

ecdsa default unstable-eth? = secp256k1

Affects subxt-signer::ecdsa

unstable-eth = bip32, ecdsa, keccak-hash, secp256k1

Affects subxt-signer::eth

polkadot-js-compat = base64, crypto_secretbox, scrypt, serde, serde_json, sr25519, std, subxt

Enable support for loading key pairs from polkadot-js json.

Affects subxt-signer::polkadot_js_compat

subxt default polkadot-js-compat?

Make the keypair algorithms here compatible with Subxt's Signer trait,
so that they can be used to sign transactions for compatible chains.

Enables subxt-core

web

The getrandom package is used via schnorrkel. We need to enable the JS feature on it if compiling for the web.

Enables js of getrandom

We only pull this in to enable the JS flag for schnorrkel to use.

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.

bip32 unstable-eth?
schnorrkel sr25519
secp256k1 ecdsa unstable-eth?
keccak-hash unstable-eth?
serde polkadot-js-compat?
serde_json polkadot-js-compat?
base64 polkadot-js-compat?
scrypt polkadot-js-compat?
crypto_secretbox polkadot-js-compat?
getrandom web?