pub struct Escrow {
pub asset: Option<String>,
pub currency: Option<String>,
pub amount: String,
pub originator: Party,
pub beneficiary: Party,
pub expiry: String,
pub agreement: Option<String>,
pub agents: Vec<Agent>,
pub metadata: HashMap<String, Value>,
}Expand description
Escrow message for holding assets on behalf of parties
The Escrow message allows one agent to request another agent to hold a specified amount of currency or asset from a party in escrow on behalf of another party.
Fields§
§asset: Option<String>The specific cryptocurrency asset to be held in escrow (CAIP-19 identifier)
Either asset OR currency MUST be present
currency: Option<String>ISO 4217 currency code (e.g. “USD”, “EUR”) for fiat-denominated escrows
Either asset OR currency MUST be present
amount: StringThe amount to be held in escrow (string decimal)
originator: PartyThe party whose assets will be placed in escrow
beneficiary: PartyThe party who will receive the assets when released
expiry: StringTimestamp after which the escrow automatically expires and funds are released back to the originator
agreement: Option<String>URL or URI referencing the terms and conditions of the escrow
agents: Vec<Agent>Array of agents involved in the escrow. Exactly one agent MUST have role “EscrowAgent”
metadata: HashMap<String, Value>Additional metadata
Implementations§
Source§impl Escrow
impl Escrow
Sourcepub fn new_with_asset(
asset: String,
amount: String,
originator: Party,
beneficiary: Party,
expiry: String,
agents: Vec<Agent>,
) -> Self
pub fn new_with_asset( asset: String, amount: String, originator: Party, beneficiary: Party, expiry: String, agents: Vec<Agent>, ) -> Self
Create a new Escrow message for cryptocurrency assets
Sourcepub fn new_with_currency(
currency: String,
amount: String,
originator: Party,
beneficiary: Party,
expiry: String,
agents: Vec<Agent>,
) -> Self
pub fn new_with_currency( currency: String, amount: String, originator: Party, beneficiary: Party, expiry: String, agents: Vec<Agent>, ) -> Self
Create a new Escrow message for fiat currency
Sourcepub fn with_agreement(self, agreement: String) -> Self
pub fn with_agreement(self, agreement: String) -> Self
Set the agreement URL
Sourcepub fn with_metadata(self, key: String, value: Value) -> Self
pub fn with_metadata(self, key: String, value: Value) -> Self
Add metadata
Sourcepub fn escrow_agent(&self) -> Option<&Agent>
pub fn escrow_agent(&self) -> Option<&Agent>
Find the escrow agent in the agents list
Find agents that can authorize release (agents acting for the beneficiary)