pub struct SettlementAttestation {
pub issuer_did: String,
pub settlement_id: String,
pub unit: UnitRef,
pub destination_did: String,
pub amount_minor: u128,
pub grant_cid: Option<Vec<u8>>,
pub settled_at: u64,
pub signature: Vec<u8>,
}Expand description
A settlement attestation: the signed, self-contained claim that a specific settlement committed, and therefore that a specific issuance is owed.
Fields§
§issuer_did: StringDID of the party that signed this attestation (the settlement authority). Verification resolves key material from this, so it is part of the signed body rather than supplied alongside it.
settlement_id: StringThe settlement row this attests to. Bound into the signed body so an attestation cannot be presented under a different id.
unit: UnitRefThe credit unit to be issued.
destination_did: StringThe pseudonymous destination identity for the issued credits.
amount_minor: u128Amount in minor units.
grant_cid: Option<Vec<u8>>The allocation grant this settlement backs, if any.
settled_at: u64When the settlement committed (unix seconds).
signature: Vec<u8>COSE composite signature (EdDSA + ML-DSA-65) over Self::signing_input.
Implementations§
Source§impl SettlementAttestation
impl SettlementAttestation
Sourcepub fn signing_input(&self) -> Result<Vec<u8>, PayError>
pub fn signing_input(&self) -> Result<Vec<u8>, PayError>
The exact bytes a signature must cover: the canonical body without the signature element.
Sourcepub fn encode(&self) -> Result<Vec<u8>, PayError>
pub fn encode(&self) -> Result<Vec<u8>, PayError>
The canonical wire bytes, signature included. This is what travels in
the capnp attestation :Data field and what a future exchange record
embeds verbatim.
Trait Implementations§
Source§impl Clone for SettlementAttestation
impl Clone for SettlementAttestation
Source§fn clone(&self) -> SettlementAttestation
fn clone(&self) -> SettlementAttestation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SettlementAttestation
impl Debug for SettlementAttestation
Source§impl<'de> Deserialize<'de> for SettlementAttestation
impl<'de> Deserialize<'de> for SettlementAttestation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SettlementAttestation
impl PartialEq for SettlementAttestation
Source§fn eq(&self, other: &SettlementAttestation) -> bool
fn eq(&self, other: &SettlementAttestation) -> bool
self and other values to be equal, and is used by ==.