コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MultisigAccountInfo"/> class.
 /// </summary>
 /// <param name="account">The account.</param>
 /// <param name="minApproval">The minimum approval.</param>
 /// <param name="minRemoval">The minimum removal.</param>
 /// <param name="cosignatories">The cosignatories.</param>
 /// <param name="multisigAccounts">The multisig accounts.</param>
 public MultisigAccountInfo(PublicAccount account, int minApproval, int minRemoval, List <PublicAccount> cosignatories, List <PublicAccount> multisigAccounts)
 {
     Account          = account;
     MinApproval      = minApproval;
     MinRemoval       = minRemoval;
     Cosignatories    = cosignatories;
     MultisigAccounts = multisigAccounts;
 }
コード例 #2
0
 /// <summary>
 /// Compares public accounts for equality.
 /// </summary>
 /// <param name="other">The other public account to compare with.</param>
 /// <returns>True if they are they are equal, else false.</returns>
 public bool Equals(PublicAccount other)
 {
     return(Equals(Address, other.Address) && string.Equals(PublicKey, other.PublicKey));
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Account" /> class.
 /// </summary>
 /// <param name="address">The address.</param>
 /// <param name="keyPair">The key pair.</param>
 public Account(Address address, KeyPair keyPair)
 {
     Address       = address;
     KeyPair       = keyPair;
     PublicAccount = new PublicAccount(keyPair.PublicKeyString, address.NetworkByte);
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Account" /> class.
 /// </summary>
 /// <param name="privateKey">The private key.</param>
 /// <param name="networkType">Type of the network.</param>
 public Account(string privateKey, NetworkType.Types networkType)
 {
     KeyPair       = KeyPair.CreateFromPrivateKey(privateKey);
     Address       = Address.CreateFromPublicKey(KeyPair.PublicKeyString, networkType);
     PublicAccount = new PublicAccount(KeyPair.PublicKeyString, networkType);
 }
コード例 #5
0
 /// <summary>
 /// Checks if the multisig account is cosignatory of an account.
 /// </summary>
 /// <param name="account">The account.</param>
 /// <returns><c>true</c> if [is cosigner of multisig account] [the specified account]; otherwise, <c>false</c>.</returns>
 public bool IsCosignerOfMultisigAccount(PublicAccount account) => MultisigAccounts.Contains(account);
コード例 #6
0
 /// <summary>
 /// Checks if an account is cosignatory of the multisig account.
 /// </summary>
 /// <param name="account">The account.</param>
 /// <returns><c>true</c> if the specified account has cosigners; otherwise, <c>false</c>.</returns>
 public bool HasCosigners(PublicAccount account) => Cosignatories.Contains(account);