ethers-rs/ethers-signers
dependabot[bot] 72b80eef55
chore(deps): bump yubihsm from 0.41.0-pre to 0.41.0 (#1556)
Bumps [yubihsm](https://github.com/iqlusioninc/yubihsm.rs) from 0.41.0-pre to 0.41.0.
- [Release notes](https://github.com/iqlusioninc/yubihsm.rs/releases)
- [Changelog](https://github.com/iqlusioninc/yubihsm.rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/iqlusioninc/yubihsm.rs/compare/v0.41.0-pre...v0.41.0)

---
updated-dependencies:
- dependency-name: yubihsm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-03 10:52:25 -07:00
..
src ci: rm pinned nightly (#1541) 2022-07-31 19:00:31 -07:00
Cargo.toml chore(deps): bump yubihsm from 0.41.0-pre to 0.41.0 (#1556) 2022-08-03 10:52:25 -07:00
README.md update README links (#754) 2022-01-01 10:18:49 +02:00

README.md

You can implement the Signer trait to extend functionality to other signers such as Hardware Security Modules, KMS etc.

The exposed interfaces return a recoverable signature. In order to convert the signature and the TransactionRequest to a Transaction, look at the signing middleware.

Supported signers:

# use ethers_signers::{LocalWallet, Signer};
# use ethers_core::{k256::ecdsa::SigningKey, types::TransactionRequest};

# async fn foo() -> Result<(), Box<dyn std::error::Error>> {
// instantiate the wallet
let wallet = "dcf2cbdd171a21c480aa7f53d77f31bb102282b3ff099c78e3118b37348c72f7"
    .parse::<LocalWallet>()?;

// create a transaction
let tx = TransactionRequest::new()
    .to("vitalik.eth") // this will use ENS
    .value(10000).into();

// sign it
let signature = wallet.sign_transaction(&tx).await?;

// can also sign a message
let signature = wallet.sign_message("hello world").await?;
signature.verify("hello world", wallet.address()).unwrap();
# Ok(())
# }