示例#1
0
 public Amount(AmountValue value,
               Currency currency = null,
               AccountId issuer  = null)
 {
     Currency = currency ?? Currency.Xrp;
     Issuer   = issuer ?? (Currency.IsNative ?
                           AccountId.Zero :
                           AccountId.Neutral);
     Value = value;
 }
示例#2
0
 public Amount(AmountValue value,
               Currency currency=null,
               AccountId issuer=null)
 {
     Currency = currency ?? Currency.Xrp;
     Issuer = issuer ?? (Currency.IsNative ?
                             AccountId.Zero :
                             AccountId.Neutral);
     Value = value;
 }
示例#3
0
        public static Amount FromParser(BinaryParser parser, int?hint = null)
        {
            var value = AmountValue.FromParser(parser);

            if (!value.IsIou)
            {
                return(new Amount(value));
            }
            var curr   = Currency.FromParser(parser);
            var issuer = AccountId.FromParser(parser);

            return(new Amount(value, curr, issuer));
        }
示例#4
0
 public Amount(string v = "0", Currency c = null, AccountId i = null) :
     this(AmountValue.FromString(v, c == null || c.IsNative), c, i)
 {
 }