use r402_core::scheme::SchemeId;
#[cfg(feature = "server")]
pub mod server;
#[cfg(feature = "facilitator")]
pub mod facilitator;
#[cfg(feature = "client")]
pub mod client;
#[cfg(feature = "client")]
pub mod eip712;
pub mod error;
pub use error::*;
pub mod types;
pub use types::*;
pub mod verify;
#[cfg(feature = "client")]
pub use client::{
AuthorizationBuilder, CasperExactClient, CasperSigner, build_payload, domain_for,
};
#[cfg(feature = "client")]
pub use eip712::{Eip712Domain, PRIMARY_TYPE, transfer_with_authorization_digest};
pub use verify::{ValidatedPayment, validate_at, validate_payload_shape, validate_request};
#[derive(Debug, Clone, Copy)]
pub struct CasperExact;
impl SchemeId for CasperExact {
fn namespace(&self) -> &'static str {
"casper"
}
fn scheme(&self) -> &str {
ExactScheme.as_ref()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn scheme_identity_matches_caip2_family() {
assert_eq!(CasperExact.namespace(), "casper");
assert_eq!(CasperExact.scheme(), "exact");
assert_eq!(CasperExact.caip_family(), "casper:*");
assert_eq!(CasperExact.id(), "casper-exact");
}
}