configureTerraEnvironment static method

void configureTerraEnvironment(
  1. TerraEnvironment environment
)

Implementation

static void configureTerraEnvironment(TerraEnvironment environment) {
  TerraClientConfiguration.lcdConfig = LCDClientConfig();
  TerraClientConfiguration.lcdConfig!.gasAdjustment =
      LCDDefaultConfigs.GAS_ADJUSTMENT;

  switch (TerraClientConfiguration.terra = environment) {
    case TerraEnvironment.luna2MainNet:
      TerraClientConfiguration.blockchainResourcePath =
          Luna2ResourceUrls.LUNA2_PROD_ROUTE;
      TerraClientConfiguration.lcdConfig!.chainID =
          Luna2ChainKeys.TERRA_MAINNET_CHAINID;
      break;
    case TerraEnvironment.classic:
      TerraClientConfiguration.blockchainResourcePath =
          ClassicHttpResources.CLASSIC_COLUMBUS_MAINNET;
      TerraClientConfiguration.lcdConfig!.chainID =
          ClassicChainKeys.CLASSIC_MAINNET;
      break;
    case TerraEnvironment.classicTestNet:
      TerraClientConfiguration.blockchainResourcePath =
          ClassicHttpResources.TERRA_REBELS_TESTNET;
      TerraClientConfiguration.lcdConfig!.chainID = ClassicChainKeys.TEST_NET;
      break;
    case TerraEnvironment.luna2TestNet:
      TerraClientConfiguration.blockchainResourcePath =
          Luna2ResourceUrls.LUNA2_TESTNET;
      TerraClientConfiguration.lcdConfig!.chainID =
          Luna2ChainKeys.TERRA_PISCO_TESTNET_CHAINID;
      break;
    case TerraEnvironment.localTerra:
      TerraClientConfiguration.blockchainResourcePath =
          Luna2ResourceUrls.TERRA_LOCALTERRA_ROUTE;
      TerraClientConfiguration.lcdConfig!.chainID =
          Luna2ChainKeys.TERRA_LOCAL_CHAINID;
      break;
  }
}