2using System.Threading.Tasks;
85 public override async Task
Parse(XmlElement Xml)
87 this.TransactionVariable =
XML.
Attribute(Xml,
"transactionVariable");
89 await base.Parse(Xml);
117 base.OnChildNodesUpdated();
119 this.to = this.GetValueElement<To>();
120 this.amount = this.GetValueElement<Amount>();
121 this.currency = this.GetValueElement<Currency>();
122 this.validDays = this.GetValueElement<ValidDays>();
123 this.reference = this.GetValueElement<Reference>();
124 this.contract = this.GetValueElement<Contract>();
135 throw new Exception(
"ReleaseAmounts must be valid a positive number of days.");
141 throw new Exception(
"ReleaseAmount contract reference must be either the creation contract, or the current ownership contract.");
144 string To = (await this.to.
Evaluate(Arguments))?.ToString();
149 throw new Exception(
"State-Machine releasing of amounts to trust provider not permitted.");
156 Guid TransactionId = Guid.NewGuid();
157 string ReleaseAmountUri =
PaiwiseProcessor.GenerateReleaseAmountUri(TransactionId,
161 if (!
string.IsNullOrEmpty(Msg))
162 throw new Exception(Msg);
165 Arguments.
Variables[
this.TransactionVariable] = TransactionId.ToString();
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Class managing a script expression.
static decimal ToDecimal(object Object)
Converts an object to a double value.
static double ToDouble(object Object)
Converts an object to a double value.
Paiwise processor, processing payment instructions defined in smart contracts.
Abstract base class for State-Machine action nodes.
Defines amount to be sent.
Defines a payment contract.
Defines currency to be sent.
Defines a payment action.
Defines a payment reference.
Releases an amount of an account.
override string LocalName
Local name
Reference Reference
Reference value
override void OnChildNodesUpdated()
Method called whenever ChildNodes is updated.
Contract Contract
Contract value
override async Task Parse(XmlElement Xml)
Parses the State-machine node.
string TransactionVariable
Optional transaction variable name.
ReleaseAmount()
Defines a payment action.
Amount Amount
Amount value
override async Task Execute(EvaluationArguments Arguments)
Evaluates the action node
ValidDays ValidDays
ValidDays value
Currency Currency
Currency value
override IStateMachineNode Create()
Creates a new node of the corresponding type.
Defines to whom a payment (or message) is sent.
Defines number of days payment is valid, before it must be processed.
Contains information required for evaluating script in a state-machine.
StateMachine Machine
Reference to state-machine definition.
EDalerComponent EDaler
eDaler component.
Token Token
Reference to related token.
Variables Variables
Current set of variables.
void ConvertValueAttributesToElements(XmlElement Xml, Type[] ValueTypes, bool[] Required)
Converts value attributes to parsed elements. The XML definition has to be parsed before,...
Task< object > Evaluate(EvaluationArguments Arguments)
Evaluates the value node.
CaseInsensitiveString TrustProviderJid
JID of Trust Provider
CaseInsensitiveString DefinitionContractId
ID of Definition Contract
CaseInsensitiveString TrustProvider
ID of Trust Provider
Interface for State-Machine nodes