smart_account_auth/messages.rs
1#[cfg(feature = "session")]
2pub(crate) mod impls;
3#[cfg(feature = "session")]
4pub mod actions;
5#[cfg(feature = "session")]
6pub mod sessions;
7#[cfg(feature = "replay")]
8pub mod replay;
9
10
11
12
13/// Payload message used for telling which credential to use
14/// or how to modify it
15#[saa_schema::saa_type]
16pub struct AuthPayload {
17 /// Human readable prefix to use to derive an address
18 pub hrp : Option<String>,
19 /// Other fields reserved for future use
20 pub extension : Option<saa_common::Binary>,
21 /// Which credential to use if multiple are available
22 pub credential_id : Option<saa_common::CredentialId>,
23}
24
25
26
27/// A wrapper for signed data used for constructing credentials and verifying them
28/// `data` is base64 encoded JSON string that contains the data to be verified.
29/// When `replay` feature tag is enabled, must be a JSON object corresponding to `MsgDataToSign` struct.
30#[saa_schema::saa_type]
31pub struct SignedDataMsg {
32 /// Base64 encoded JSON string of replay envelope, serialized actions messages, both of them or none of them
33 pub data : saa_common::Binary,
34 /// Signature to verify the data
35 pub signature : saa_common::Binary,
36 /// Optional payload to use customize the verification flow if possible
37 pub payload : Option<AuthPayload>,
38}
39