tx_bakery/wallet.rs
1//! Wallet trait
2
3use plutus_ledger_api::{
4 csl::lib as csl,
5 v3::{address::Address, crypto::Ed25519PubKeyHash},
6};
7use thiserror::Error;
8
9/// Cardano wallet that has access to a private key (directly or indirectly)
10/// and able to sign a transaction
11pub trait Wallet {
12 /// Signs a fully built transaction
13 fn sign_transaction(&self, tx: &csl::FixedTransaction) -> csl::FixedTransaction;
14
15 /// Query the public key hash used by this wallet
16 fn get_change_pkh(&self) -> Ed25519PubKeyHash;
17
18 /// Query the wallet address
19 fn get_change_addr(&self) -> Address;
20}
21
22#[derive(Error, Debug)]
23#[error(transparent)]
24pub struct WalletError(pub anyhow::Error);