Esempio n. 1
0
        public static FundingsJson ToFundingsJson(this Fundings fundings)
        {
            FundingsJson json = new FundingsJson();

            json.Address    = fundings.Address;
            json.Asset      = fundings.Asset.GetEnumDescription();
            json.Name       = fundings.Name;
            json.Tag        = fundings.Tag;
            json.Type       = fundings.Type.GetEnumDescription();
            json.Validation = fundings.Validation.GetEnumDescription();
            return(json);
        }
Esempio n. 2
0
        public static Fundings ToFundings(this FundingsJson json)
        {
            Fundings.Kind           kind       = Enums.ToEnumByDescription <Fundings.Kind>(json.Name);
            Kraken.Asset            asset      = Enums.ToEnumByDescription <Kraken.Asset>(json.Asset);
            Fundings.AccountType    type       = Enums.ToEnumByDescription <Fundings.AccountType>(json.Type);
            Fundings.ValidationType validation = Enums.ToEnumByDescription <Fundings.ValidationType>(json.Validation);

            Fundings fundings = new Fundings(kind, asset, type, validation);

            fundings.Address = json.Address;
            fundings.Tag     = json.Tag;

            return(fundings);
        }