pub trait Transaction: TapMessage {
// Required methods
fn settle(
&self,
creator_did: &str,
settlement_id: &str,
amount: Option<&str>,
) -> PlainMessage<Settle>;
fn revert(
&self,
creator_did: &str,
settlement_address: &str,
reason: &str,
) -> PlainMessage<Revert>;
fn add_agents(
&self,
creator_did: &str,
agents: Vec<Agent>,
) -> PlainMessage<AddAgents>;
fn replace_agent(
&self,
creator_did: &str,
original_agent: &str,
replacement: Agent,
) -> PlainMessage<ReplaceAgent>;
fn remove_agent(
&self,
creator_did: &str,
agent: &str,
) -> PlainMessage<RemoveAgent>;
fn update_party(
&self,
creator_did: &str,
party_type: &str,
party: Party,
) -> PlainMessage<UpdateParty>;
fn update_policies(
&self,
creator_did: &str,
policies: Vec<Policy>,
) -> PlainMessage<UpdatePolicies>;
fn confirm_relationship(
&self,
creator_did: &str,
agent_did: &str,
for_entity: &str,
) -> PlainMessage<ConfirmRelationship>;
}Expand description
Transaction trait for managing transaction lifecycle operations.
This trait provides methods for transaction processing operations as defined in TAIPs 5-9, including agent management, party updates, policy management, and settlement.
Required Methods§
Sourcefn settle(
&self,
creator_did: &str,
settlement_id: &str,
amount: Option<&str>,
) -> PlainMessage<Settle>
fn settle( &self, creator_did: &str, settlement_id: &str, amount: Option<&str>, ) -> PlainMessage<Settle>
Create a Settle message for this object (TAIP-4).
§Arguments
creator_did- The DID of the agent creating this settlementsettlement_id- CAIP-220 identifier of the underlying settlement transactionamount- Optional amount settled (must be <= original amount)
Sourcefn revert(
&self,
creator_did: &str,
settlement_address: &str,
reason: &str,
) -> PlainMessage<Revert>
fn revert( &self, creator_did: &str, settlement_address: &str, reason: &str, ) -> PlainMessage<Revert>
Create a Revert message for this object (TAIP-4).
§Arguments
creator_did- The DID of the agent creating this reversal requestsettlement_address- CAIP-10 format address to return funds toreason- Reason for reversal request
Sourcefn add_agents(
&self,
creator_did: &str,
agents: Vec<Agent>,
) -> PlainMessage<AddAgents>
fn add_agents( &self, creator_did: &str, agents: Vec<Agent>, ) -> PlainMessage<AddAgents>
Create an AddAgents message for this object (TAIP-5).
§Arguments
creator_did- The DID of the agent creating this additionagents- List of agents to add
Sourcefn replace_agent(
&self,
creator_did: &str,
original_agent: &str,
replacement: Agent,
) -> PlainMessage<ReplaceAgent>
fn replace_agent( &self, creator_did: &str, original_agent: &str, replacement: Agent, ) -> PlainMessage<ReplaceAgent>
Create a ReplaceAgent message for this object (TAIP-5).
§Arguments
creator_did- The DID of the agent creating this replacementoriginal_agent- The agent DID to replacereplacement- The replacement agent
Sourcefn remove_agent(
&self,
creator_did: &str,
agent: &str,
) -> PlainMessage<RemoveAgent>
fn remove_agent( &self, creator_did: &str, agent: &str, ) -> PlainMessage<RemoveAgent>
Create a RemoveAgent message for this object (TAIP-5).
§Arguments
creator_did- The DID of the agent creating this removalagent- The agent DID to remove
Sourcefn update_party(
&self,
creator_did: &str,
party_type: &str,
party: Party,
) -> PlainMessage<UpdateParty>
fn update_party( &self, creator_did: &str, party_type: &str, party: Party, ) -> PlainMessage<UpdateParty>
Create an UpdateParty message for this object (TAIP-6).
§Arguments
creator_did- The DID of the agent creating this updateparty_type- The type of party (“originator”, “beneficiary”, etc.)party- The party information to update
Sourcefn update_policies(
&self,
creator_did: &str,
policies: Vec<Policy>,
) -> PlainMessage<UpdatePolicies>
fn update_policies( &self, creator_did: &str, policies: Vec<Policy>, ) -> PlainMessage<UpdatePolicies>
Create an UpdatePolicies message for this object (TAIP-7).
§Arguments
creator_did- The DID of the agent creating this updatepolicies- New policies to apply
Sourcefn confirm_relationship(
&self,
creator_did: &str,
agent_did: &str,
for_entity: &str,
) -> PlainMessage<ConfirmRelationship>
fn confirm_relationship( &self, creator_did: &str, agent_did: &str, for_entity: &str, ) -> PlainMessage<ConfirmRelationship>
Create a ConfirmRelationship message for this object (TAIP-9).
§Arguments
creator_did- The DID of the agent creating this confirmationagent_did- The agent DID confirming their relationshipfor_entity- The entity this agent is acting for
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".