Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
EDalerTransaction.cs
1using System.Threading.Tasks;
6
8{
12 public abstract class EDalerTransaction : Runtime.Transactions.Transaction
13 {
14 private readonly EDalerUri uri;
15
21 : base(Uri.Id)
22 {
23 this.uri = Uri;
24 }
25
29 public EDalerUri Uri => this.uri;
30
37 protected async Task<Wallet> GetWallet(XmppAddress For, EntityType ForType)
38 {
40
41 switch (ForType)
42 {
43 case EntityType.Operator:
44 default:
45 Wallet = null;
46 break;
47
48 case EntityType.NetworkJid:
49 if (this.uri.EDaler.Server.IsServerDomain(For.Domain, true))
50 Wallet = await this.uri.EDaler.GetWallet(For.Account, For.Domain);
51 else
52 Wallet = null;
53 break;
54
55 case EntityType.LegalId:
56 if (this.uri.EDaler.Legal.IsComponentDomain(For.Domain, true))
57 {
58 LegalIdentity LegalId = await LegalComponent.GetLocalLegalIdentity(For.BareJid);
59 if (LegalId is null)
60 Wallet = null;
61 else
62 Wallet = await this.uri.EDaler.GetWallet(LegalId.Account, For.Domain.Substring(this.uri.EDaler.Legal.SubdomainSuffixed.Length));
63 }
64 else
65 Wallet = null;
66 break;
67 }
68
69 return Wallet;
70 }
71
72 }
73}
Contains information about one XMPP address.
Definition: XmppAddress.cs:9
CaseInsensitiveString Domain
Domain
Definition: XmppAddress.cs:97
CaseInsensitiveString BareJid
Bare JID
Definition: XmppAddress.cs:45
CaseInsensitiveString Account
Account
Definition: XmppAddress.cs:124
Abstract base class for eDaler transactions.
EDalerTransaction(EDalerUri Uri)
Abstract base class for eDaler transactions.
async Task< Wallet > GetWallet(XmppAddress For, EntityType ForType)
Gets the wallet of an entity in an eDaler transaction.
Abstract base class for eDaler URIs
Definition: EDalerUri.cs:20
Retains the current balance of an account.
Definition: Wallet.cs:16
EntityType
Type of entity referred to in transaction.
Definition: Transaction.cs:15