Beispiel #1
0
 internal ShufflingCreationAttachment(JToken jToken)
 {
     Amount             = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(jToken, Parameters.Amount));
     HoldingId          = GetAttachmentValue <ulong>(jToken, Parameters.Holding);
     HoldingType        = (HoldingType)GetAttachmentValue <int>(jToken, Parameters.HoldingType);
     ParticipantCount   = GetAttachmentValue <int>(jToken, Parameters.ParticipantCount);
     RegistrationPeriod = GetAttachmentValue <int>(jToken, Parameters.RegistrationPeriod);
 }
Beispiel #2
0
 internal DigitalGoodsPurchaseAttachment(JToken attachments)
 {
     DeliveryDeadlineTimestamp =
         new DateTimeConverter().GetFromNxtTime(GetAttachmentValue <int>(attachments, Parameters.DeliveryDeadlineTimestamp));
     GoodsId  = GetAttachmentValue <ulong>(attachments, Parameters.Goods);
     Price    = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.PriceNqt));
     Quantity = GetAttachmentValue <int>(attachments, Parameters.Quantity);
 }
Beispiel #3
0
 internal DigitalGoodsListingAttachment(JToken attachments)
 {
     Name        = GetAttachmentValue <string>(attachments, Parameters.Name);
     Description = GetAttachmentValue <string>(attachments, Parameters.Description);
     Tags        = GetAttachmentValue <string>(attachments, Parameters.Tags);
     Quantity    = GetAttachmentValue <int>(attachments, Parameters.Quantity);
     Price       = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.PriceNqt));
 }
Beispiel #4
0
 internal DigitalGoodsDeliveryAttachment(JToken attachments)
 {
     Discount    = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.DiscountNqt));
     GoodsData   = new BinaryHexString(GetAttachmentValue <string>(attachments, Parameters.GoodsData));
     GoodsIsText = GetAttachmentValue <bool>(attachments, Parameters.GoodsIsText);
     GoodsNonce  = new BinaryHexString(GetAttachmentValue <string>(attachments, Parameters.GoodsNonce));
     Purchase    = GetAttachmentValue <ulong>(attachments, Parameters.Purchase);
 }
Beispiel #5
0
 internal MonetarySystemPublishExchangeOfferAttachment(JToken attachments)
 {
     BuyRate           = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.BuyRateNqt));
     CurrencyId        = GetAttachmentValue <ulong>(attachments, Parameters.Currency);
     ExpirationHeight  = GetAttachmentValue <int>(attachments, Parameters.ExpirationHeight);
     InitialBuySupply  = GetAttachmentValue <long>(attachments, Parameters.InitialBuySupply);
     InitialSellSupply = GetAttachmentValue <long>(attachments, Parameters.InitialSellSupply);
     SellRate          = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.SellRateNqt));
     TotalBuyLimit     = GetAttachmentValue <long>(attachments, Parameters.TotalBuyLimit);
     TotalSellLimit    = GetAttachmentValue <long>(attachments, Parameters.TotalSellLimit);
 }
Beispiel #6
0
 internal MonetarySystemCurrencyIssuanceAttachment(JToken attachments)
 {
     Algorithm         = GetAttachmentValue <byte>(attachments, Parameters.Algorithm);
     Code              = GetAttachmentValue <string>(attachments, Parameters.Code);
     Decimals          = GetAttachmentValue <byte>(attachments, Parameters.Decimals);
     Description       = GetAttachmentValue <string>(attachments, Parameters.Description);
     InitialSupply     = GetAttachmentValue <long>(attachments, Parameters.InitialSupply);
     IssuanceHeight    = GetAttachmentValue <int>(attachments, Parameters.IssuanceHeight);
     MaxDifficulty     = GetAttachmentValue <int>(attachments, Parameters.MaxDifficulty);
     MaxSupply         = GetAttachmentValue <long>(attachments, Parameters.MaxSupply);
     MinDifficulty     = GetAttachmentValue <int>(attachments, Parameters.MinDifficulty);
     MinReservePerUnit = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.MinReservePerUnitNqt));
     Name              = GetAttachmentValue <string>(attachments, Parameters.Name);
     ReserveSupply     = GetAttachmentValue <long>(attachments, Parameters.ReserveSupply);
     Ruleset           = GetAttachmentValue <byte>(attachments, Parameters.Ruleset);
     SetTypes(GetAttachmentValue <int>(attachments, Parameters.Type));
 }
Beispiel #7
0
        internal AccountControlSetPhasingOnlyAttachment(JToken attachments)
        {
            ControlMaxFees     = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.ControlMaxFees));
            ControlMinDuration = GetAttachmentValue <int>(attachments, Parameters.ControlMinDuration);
            ControlMaxDuration = GetAttachmentValue <int>(attachments, Parameters.ControlMaxDuration);

            var phasing = attachments.SelectToken(Parameters.PhasingControlParams);

            PhasingHoldingId       = GetAttachmentValue <ulong>(phasing, Parameters.PhasingHolding);
            PhasingQuorum          = GetAttachmentValue <long>(phasing, Parameters.PhasingQuorum);
            PhasingMinBalance      = GetAttachmentValue <long>(phasing, Parameters.PhasingMinBalance);
            PhasingMinBalanceModel = (MinBalanceModel)GetAttachmentValue <int>(phasing, Parameters.PhasingMinBalanceModel);
            PhasingVotingModel     = (VotingModel)GetAttachmentValue <int>(phasing, Parameters.PhasingVotingModel);

            if (phasing.SelectToken(Parameters.PhasingWhitelist) != null)
            {
                var array = (JArray)phasing.SelectToken(Parameters.PhasingWhitelist);
                PhasingWhitelist = array.ToObject <ulong[]>();
            }
        }
Beispiel #8
0
 internal MonetarySystemReserveIncreaseAttachment(JToken attachments)
 {
     AmountPerUnit = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.AmountPerUnitNqt));
     CurrencyId    = GetAttachmentValue <ulong>(attachments, Parameters.Currency);
 }
Beispiel #9
0
 protected MonetarySystemExchange(JToken attachments)
 {
     CurrencyId = GetAttachmentValue <ulong>(attachments, Parameters.Currency);
     Rate       = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.RateNqt));
     Units      = GetAttachmentValue <long>(attachments, Parameters.Units);
 }
Beispiel #10
0
 internal MessagingAliasSellAttachment(JToken attachments)
 {
     Alias = GetAttachmentValue <string>(attachments, Parameters.Alias);
     Price = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.PriceNqt));
 }
Beispiel #11
0
 internal DigitalGoodsRefundAttachment(JToken attachments)
 {
     PurchaseId = GetAttachmentValue <ulong>(attachments, Parameters.Purchase);
     Refund     = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.RefundNqt));
 }
Beispiel #12
0
 internal DigitalGoodsPriceChangeAttachment(JToken attachments)
 {
     GoodsId = GetAttachmentValue <ulong>(attachments, Parameters.Goods);
     Price   = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.PriceNqt));
 }
Beispiel #13
0
 internal ColoredCoinsDividendPaymentAttachment(JToken attachments)
 {
     AmountPerQnt = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.AmountNqtPerQnt));
     AssetId      = GetAttachmentValue <ulong>(attachments, Parameters.Asset);
     Height       = GetAttachmentValue <int>(attachments, Parameters.Height);
 }
Beispiel #14
0
 protected ColoredCoinsOrderPlacementAttachment(JToken attachments)
 {
     AssetId     = GetAttachmentValue <ulong>(attachments, Parameters.Asset);
     QuantityQnt = GetAttachmentValue <long>(attachments, Parameters.QuantityQnt);
     Price       = Amount.CreateAmountFromNqt(GetAttachmentValue <long>(attachments, Parameters.PriceNqt));
 }