Esempio n. 1
0
        /// <summary>
        ///     Generates Price XDR object.
        /// </summary>
        public sdkxdr.Price ToXdr()
        {
            var xdr = new sdkxdr.Price();
            var n   = new sdkxdr.Int32();
            var d   = new sdkxdr.Int32();

            n.InnerValue = Numerator;
            d.InnerValue = Denominator;
            xdr.N        = n;
            xdr.D        = d;
            return(xdr);
        }
Esempio n. 2
0
 /// <summary>
 ///     Create Price from XDR.
 /// </summary>
 /// <param name="price">Price XDR object.</param>
 /// <returns></returns>
 public static Price FromXdr(sdkxdr.Price price)
 {
     return(new Price(price.N.InnerValue, price.D.InnerValue));
 }