Cargo Features
[dependencies]
subxt-signer = { version = "0.50.0", default-features = false, features = ["std", "sr25519", "ecdsa", "unstable-eth", "polkadot-js-compat", "subxt", "web", "native"] }
- default = ecdsa, native, sr25519, std, subxt
-
These default features are set whenever
subxt-signeris added withoutsomewhere in the dependency tree.default-features = false - std default polkadot-js-compat?
-
Enables std of sha2 ^0.10.8, optional serde, and optional serde_json
serde:
These are used if the polkadot-js-compat feature is enabled
and std of bip39, hmac ^0.12.1, pbkdf2, regex, optional base64, optional crypto_secretbox, optional schnorrkel, optional scrypt, and optional secp256k1 ^0.30.0
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-utils-accountid32
-
Enable support for loading key pairs from polkadot-js json.
Affects
subxt-signer::polkadot_js_compat… - subxt default
-
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
Pulled in if the subxt features is enabled.
- web
-
The getrandom package is used via schnorrkel. We need to enable the JS feature on it if compiling for the web. If subxt is used then this also ebales the same feature there.
Enables web of optional subxt and js of getrandom ^0.2
We only pull this in to enable the JS flag for schnorrkel to use.
- native default
-
This isn't stricly needed, and can be omitted, but allows us to test the "subxt" feature flag which needs either native or web to be set.
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?
-
Enables secp256k1 ^0.30.0
- keccak-hash unstable-eth?
-
Enables keccak-hash ^0.11.0
- serde polkadot-js-compat?
- serde_json polkadot-js-compat?
- base64 polkadot-js-compat?
- scrypt polkadot-js-compat?
- crypto_secretbox polkadot-js-compat?
- subxt-utils-accountid32 polkadot-js-compat?
- getrandom web?
-
Enables getrandom ^0.2