예제 #1
0
        public ConstellationInfo Info()
        {
            ConstellationInfo info;

            if (((int)Global.AppState.State) < (int)ApplicationState.Running)
            {
                info = new ConstellationInfo
                {
                    State = Global.AppState.State
                }
            }
            ;
            else
            {
                var network = new ConstellationInfo.Network(
                    Global.StellarNetwork.Network.NetworkPassphrase,
                    Global.StellarNetwork.Horizon
                    );
                var assets = Global.Constellation.Assets.Select(a => ConstellationInfo.Asset.FromAssetSettings(a)).ToArray();
                info = new ConstellationInfo
                {
                    State             = Global.AppState.State,
                    Vault             = ((KeyPair)Global.Constellation.Vault).AccountId,
                    Auditors          = Global.Constellation.Auditors.Select(a => ((KeyPair)a).AccountId).ToArray(),
                    MinAccountBalance = Global.Constellation.MinAccountBalance,
                    MinAllowedLotSize = Global.Constellation.MinAllowedLotSize,
                    StellarNetwork    = network,
                    Assets            = assets,
                    RequestRateLimits = Global.Constellation.RequestRateLimits
                };
            }

            return(info);
        }
        public ConstellationInfo Info()
        {
            ConstellationInfo info;

            var state = (int)(Context.AppState?.State ?? 0);

            if (state < (int)ApplicationState.Running)
            {
                info = new ConstellationInfo
                {
                    State = (ApplicationState)state
                }
            }
            ;
            else
            {
                var network = new ConstellationInfo.Network(
                    Context.StellarDataProvider.NetworkPassphrase,
                    Context.StellarDataProvider.Horizon
                    );
                var assets = Context.Constellation.Assets.Select(a => ConstellationInfo.Asset.FromAssetSettings(a)).ToArray();
                info = new ConstellationInfo
                {
                    State             = Context.AppState.State,
                    Vault             = ((KeyPair)Context.Constellation.Vault).AccountId,
                    Auditors          = Context.Constellation.Auditors.Select(a => ((KeyPair)a).AccountId).ToArray(),
                    MinAccountBalance = Context.Constellation.MinAccountBalance,
                    MinAllowedLotSize = Context.Constellation.MinAllowedLotSize,
                    StellarNetwork    = network,
                    Assets            = assets,
                    RequestRateLimits = Context.Constellation.RequestRateLimits
                };
            }

            return(info);
        }