Exemplo n.º 1
0
        public async Task On3CommasLinkClicked()
        {
            var settingsPersisted = !string.IsNullOrWhiteSpace(Properties.Settings.Default.ApiKey3Commas);
            var settings          = new Settings.Settings(settingsPersisted, "3Commas API Credentials", "Permissions Needed: BotsRead, BotsWrite, AccountsRead", _keys.ApiKey3Commas, _keys.Secret3Commas);
            var dr = settings.ShowDialog();

            if (dr == DialogResult.OK)
            {
                _keys.ApiKey3Commas = settings.ApiKey;
                _keys.Secret3Commas = settings.Secret;

                Properties.Settings.Default.ApiKey3Commas = settings.PersistKeys ? settings.ApiKey : "";
                Properties.Settings.Default.Secret3Commas = settings.PersistKeys ? settings.Secret : "";
                Properties.Settings.Default.Save();

                await RefreshBots();
            }
        }
Exemplo n.º 2
0
        public async void OnManageApiKeys()
        {
            var settingsPersisted = !string.IsNullOrWhiteSpace(Properties.Settings.Default.ApiKey3Commas);
            var settings          = new Settings.Settings(settingsPersisted, "3Commas Accounts", _keys);
            var dr = settings.ShowDialog();

            if (dr == DialogResult.OK)
            {
                _keys = new XCommasAccounts {
                    Accounts = settings.Accounts.ToList()
                };

                await LoadAccounts();

                _eventBroker.Publish(new KeysChangedEventArgs()
                {
                    Keys = _keys
                });
            }
        }