Exemplo n.º 1
0
        public static string GetChainId(this NetworkChainId value)
        {
            DescriptionAttribute[] attributes = (DescriptionAttribute[])value
                                                .GetType()
                                                .GetField(value.ToString())
                                                .GetCustomAttributes(typeof(DescriptionAttribute), false);

            return(attributes.Length > 0 ? attributes[0].Description : string.Empty);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Returns a new Network using provided NetworkChainId enum
 /// </summary>
 /// <param name="networkChainId"></param>
 /// <param name="lcdUrl">Optional: LCD API URL for broadcasting signed transactions and querying blockchain (may be localhost); defaults to network's publicly avilable LCD API</param>
 /// <param name="baseFee">Optional: provide this to override the default fee to use for transactions</param>
 /// <param name="baseGas">Optional: provide this to override the default gas to use for transactions</param>
 public Network(NetworkChainId networkChainId, string lcdUrl = null, string baseFee = null, string baseGas = null) : this(networkChainId.GetChainId(), lcdUrl, baseFee, baseGas)
 {
 }