Cargo Features
[dependencies]
subxt-signer = { version = "0.35.3", default-features = false, features = ["std", "sr25519", "ecdsa", "subxt", "web", "native"] }
- default = ecdsa, native, sr25519, std, subxt
-
These default features are set whenever
subxt-signer
is added without
somewhere in the dependency tree.default-features = false - std default
-
Enables std of bip39, hmac, pbkdf2, regex, schnorrkel, secp256k1 ^0.28.2, sha2, sp-core ^31.0.0, and sp-crypto-hashing
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 = 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 = secp256k1
-
Affects
subxt-signer::ecdsa
… - 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
- web
-
The getrandom package is used via schnorrkel. We need to enable the JS feature on it if compiling for the web.
Enables web of optional subxt and js of getrandom
We only pull this in to enable the JS flag for schnorrkel to use.
- native default
-
Enables native of optional subxt
subxt:
Enable this for native (ie non web/wasm builds).
Exactly 1 of "web" and "native" is 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.
- schnorrkel sr25519 std
- secp256k1 ecdsa std
-
Enables secp256k1 ^0.28.2
- getrandom web?