Files
pezkuwi-subxt/signer/src/lib.rs
T
Tadeo Hepperle f0b72b9104 Add subxt feature in subxt-signer crate to default features (#1193)
* add subxt to subxt-signer default features

* distinguish between native and web in signer

* fix formatting and clippy

* rustfmt
2023-10-06 15:54:14 +02:00

44 lines
1.6 KiB
Rust

// Copyright 2019-2023 Parity Technologies (UK) Ltd.
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
// see LICENSE for license details.
//! # Subxt-signer
//!
//! The main output from this crate is the [`sr25519::Keypair`], which can
//! be constructed from a bip39 phrase, secret URI or raw seed, and used to
//! sign and verify arbitrary messages. This crate is aligned with how Substrate's
//! `sp_core` crate constructs and signs keypairs, but is lighter on dependencies
//! and can support compilation to WASM with the `web` feature.
//!
//! Enable the `subxt` feature to enable use of this [`sr25519::Keypair`] in signing
//! subxt transactions for chains supporting sr25519 signatures.
#![deny(missing_docs)]
#[macro_use]
mod utils;
mod crypto;
// An sr25519 key pair implementation.
#[cfg(feature = "sr25519")]
pub mod sr25519;
// An ecdsa key pair implementation.
#[cfg(feature = "ecdsa")]
pub mod ecdsa;
// Re-export useful bits and pieces for generating a Pair from a phrase,
// namely the Mnemonic struct.
pub use bip39;
// Used to hold strings in a more secure manner in memory for a little extra
// protection.
pub use secrecy::{ExposeSecret, SecretString};
// SecretUri's can be parsed from strings and used to generate key pairs.
// DeriveJunctions are the "path" part of these SecretUris.
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.");