/// <summary> /// Initializes a new instance of the <see cref="AccountInfo"/> class. /// </summary> /// <param name="publicKey">The public key.</param> /// <param name="address">The address.</param> /// <param name="balance">The vbalance.</param> /// <param name="vestedBalance">The vested balance.</param> /// <param name="importance">The importance.</param> /// <param name="harvestedBlocks">The harvested blocks.</param> /// <param name="status">The status.</param> /// <param name="remoteStatus">The remoteStatus.</param> /// <param name="minCosigners">The minimum number of Cosigners (less or eqaul than cosigners.Count).</param> /// <param name="cosigners">The cosigners of this multisig account .</param> /// <param name="cosignatoryOf">The account is cosignatoryOf these multisig Accounts.</param> public AccountInfo(string publicKey, Address address, ulong balance, ulong vestedBalance, double importance, ulong harvestedBlocks, string status = "", string remoteStatus = "", int minCosigners = 0, List <AccountInfo> cosigners = null, List <AccountInfo> cosignatoryOf = null) { _PublicAccount = new PublicAccount(publicKey, address.GetNetworktype()); Balance = balance; VestedBalance = vestedBalance; Importance = importance; HarvestedBlocks = harvestedBlocks; Status = status; RemoteStatus = remoteStatus; MinCosigners = minCosigners; Cosigners = cosigners; CosignatoryOf = cosignatoryOf; }
/// <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, List <AccountInfo> cosignatories, List <AccountInfo> cosginatoryOf) { Account = account; Cosignatories = cosignatories; CosginatoryOf = cosginatoryOf; }
/// <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); }
/// <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); }
/// <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)); }
/// <summary> /// Initializes a new instance of the <see cref="PrivateAccount" /> class. /// </summary> /// <param name="address">The address.</param> /// <param name="keyPair">The key pair.</param> public PrivateAccount(Address address, KeyPair keyPair) { KeyPair = keyPair; _PublicAccount = new PublicAccount(keyPair.PublicKeyString, address.GetNetworktype()); }
/// <summary> /// Initializes a new instance of the <see cref="PrivateAccount" /> class. /// </summary> /// <param name="privateKey">The private key.</param> /// <param name="networkType">Type of the network.</param> public PrivateAccount(string privateKey, NetworkType.Types networkType) { KeyPair = new KeyPair(privateKey); _PublicAccount = new PublicAccount(KeyPair.PublicKeyString, networkType); }