async pollConfig(callback) {
    if (callback !== this.configCallback) return;
    try {
      const {
        loginMethod,
        messageFeed,
        predictionPoll,
        cluster,
        urlTls,
        walletUrl,
        commitment,
      } = await getConfig(this.configUrl);

      this.connection = new Connection(urlTls, commitment);
      this.connectionUrl = urlTls;
      this.walletUrl = walletUrl;
      this.clock.updateConfig(this.connection);
      this.connection.getRecentBlockhash().then(({feeCalculator}) => {
        this.feeCalculator = feeCalculator;
      });
      const accountStorageOverhead = 128;
      this.connection
        .getMinimumBalanceForRentExemption(accountStorageOverhead)
        .then(minimumBalanceForRentExemption => {
          this.minimumBalanceForRentExemption = minimumBalanceForRentExemption;
        });

      const explorerUrlBuilder = this.explorerUrlBuilder(cluster);
      const response = {explorerUrlBuilder, loginMethod, walletUrl};

      try {
        Object.assign(
          response,
          await this.messageFeed.updateConfig(this.connection, messageFeed),
        );
      } catch (err) {
        console.error('failed to update message feed config', err);
      }

      Object.assign(
        response,
        this.predictionPoll.updateConfig(this.connection, predictionPoll),
      );

      if (this.configCallback) {
        this.configCallback(response);
      }
    } catch (err) {
      console.error('config poll error', err);
    }
    setTimeout(() => this.pollConfig(callback), 10 * 1000);
  }
// or new message feed server deployment
or new message feed server deployment
or new message feed server deployment
async pollConfig(callback) {
    if (callback !== this.configCallback) return;
    try {
      const {
        loginMethod,
        messageFeed,
        predictionPoll,
        cluster,
        urlTls,
        walletUrl,
        commitment,
      } = await getConfig(this.configUrl);
      this.connection = new Connection(urlTls, commitment);
      this.connectionUrl = urlTls;
      this.walletUrl = walletUrl;
      this.clock.updateConfig(this.connection);
      this.connection.getRecentBlockhash().then(({feeCalculator}) => {
        this.feeCalculator = feeCalculator;
      });
      const accountStorageOverhead = 128;
      this.connection
        .getMinimumBalanceForRentExemption(accountStorageOverhead)
        .then(minimumBalanceForRentExemption => {
          this.minimumBalanceForRentExemption = minimumBalanceForRentExemption;
        });
      const explorerUrlBuilder = this.explorerUrlBuilder(cluster);
      const response = {explorerUrlBuilder, loginMethod, walletUrl};
      try {
        Object.assign(
          response,
          await this.messageFeed.updateConfig(this.connection, messageFeed),
        );
      } catch (err) {
        console.error('failed to update message feed config', err);
      }
      Object.assign(
        response,
        this.predictionPoll.updateConfig(this.connection, predictionPoll),
      );
      if (this.configCallback) {
        this.configCallback(response);
      }
    } catch (err) {
      console.error('config poll error', err);
    }
    setTimeout(() => this.pollConfig(callback), 10 * 1000);
  }
async pollConfig ( callback ) { if ( callback !== this . configCallback ) return ; try { const { loginMethod , messageFeed , predictionPoll , cluster , urlTls , walletUrl , commitment , } = await getConfig ( this . configUrl ) ; this . connection = new Connection ( urlTls , commitment ) ; this . connectionUrl = urlTls ; this . walletUrl = walletUrl ; this . clock . updateConfig ( this . connection ) ; this . connection . getRecentBlockhash ( ) . then ( ( { feeCalculator } ) => { this . feeCalculator = feeCalculator ; } ) ; const accountStorageOverhead = 128 ; this . connection . getMinimumBalanceForRentExemption ( accountStorageOverhead ) . then ( minimumBalanceForRentExemption => { this . minimumBalanceForRentExemption = minimumBalanceForRentExemption ; } ) ; const explorerUrlBuilder = this . explorerUrlBuilder ( cluster ) ; const response = { explorerUrlBuilder , loginMethod , walletUrl } ; try { Object . assign ( response , await this . messageFeed . updateConfig ( this . connection , messageFeed ) , ) ; } catch ( err ) { console . error ( 'failed to update message feed config' , err ) ; } Object . assign ( response , this . predictionPoll . updateConfig ( this . connection , predictionPoll ) , ) ; if ( this . configCallback ) { this . configCallback ( response ) ; } } catch ( err ) { console . error ( 'config poll error' , err ) ; } setTimeout ( ( ) => this . pollConfig ( callback ) , 10 * 1000 ) ; }
or new message feed server deployment
or new message feed server deployment