mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 16:01:04 +00:00
distinguish between native and web in signer
This commit is contained in:
+4
-3
@@ -15,7 +15,7 @@ description = "Sign extrinsics to be submitted by Subxt"
|
|||||||
keywords = ["parity", "subxt", "extrinsic", "signer"]
|
keywords = ["parity", "subxt", "extrinsic", "signer"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["sr25519", "ecdsa", "subxt"]
|
default = ["sr25519", "ecdsa", "subxt", "native"]
|
||||||
|
|
||||||
# Pick the signer implementation(s) you need by enabling the
|
# Pick the signer implementation(s) you need by enabling the
|
||||||
# corresponding features. Note: I had more difficulties getting
|
# corresponding features. Note: I had more difficulties getting
|
||||||
@@ -30,11 +30,12 @@ subxt = ["dep:subxt"]
|
|||||||
|
|
||||||
# The getrandom package is used via schnorrkel. We need to enable the JS
|
# The getrandom package is used via schnorrkel. We need to enable the JS
|
||||||
# feature on it if compiling for the web.
|
# feature on it if compiling for the web.
|
||||||
web = ["getrandom/js"]
|
web = ["getrandom/js", "subxt?/web"]
|
||||||
|
native = ["subxt?/native"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
subxt = { workspace = true, optional = true, default-features = false }
|
||||||
regex = { workspace = true }
|
regex = { workspace = true }
|
||||||
subxt = { workspace = true, optional = true }
|
|
||||||
hex = { workspace = true }
|
hex = { workspace = true }
|
||||||
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
|
codec = { package = "parity-scale-codec", workspace = true, features = ["derive"] }
|
||||||
sp-core-hashing = { workspace = true }
|
sp-core-hashing = { workspace = true }
|
||||||
|
|||||||
@@ -38,3 +38,8 @@ pub use secrecy::{ExposeSecret, SecretString};
|
|||||||
// SecretUri's can be parsed from strings and used to generate key pairs.
|
// SecretUri's can be parsed from strings and used to generate key pairs.
|
||||||
// DeriveJunctions are the "path" part of these SecretUris.
|
// DeriveJunctions are the "path" part of these SecretUris.
|
||||||
pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE};
|
pub use crypto::{DeriveJunction, SecretUri, SecretUriError, DEV_PHRASE};
|
||||||
|
|
||||||
|
#[cfg(all(
|
||||||
|
feature = "subxt", not(any(feature = "web", feature = "native"))
|
||||||
|
))]
|
||||||
|
compile_error!("subxt-signer: When using the 'subxt' feature, exactly one of the 'web' and 'native' features should be used.");
|
||||||
Reference in New Issue
Block a user