@toruslabs/ethereum-controllers 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3810,10 +3810,11 @@ class PreferencesController extends BasePreferencesController {
3810
3810
  rpcTarget: network.rpcUrls[0],
3811
3811
  ticker: network.nativeCurrency.symbol,
3812
3812
  chainId: network.chainId,
3813
- blockExplorerUrl: network.blockExplorerUrls[0]
3813
+ blockExplorerUrl: network.blockExplorerUrls[0],
3814
+ tickerName: network.nativeCurrency.name,
3815
+ logo: network.nativeCurrency.symbol
3814
3816
  };
3815
3817
  const isSuccess = await this.addCustomNetwork({
3816
- type: "rpc",
3817
3818
  network: newNetwork
3818
3819
  });
3819
3820
  if (!isSuccess) throw new Error("unable to add custom network");
@@ -3831,12 +3832,11 @@ class PreferencesController extends BasePreferencesController {
3831
3832
  // Custom Network methods
3832
3833
  async addCustomNetwork(_ref2) {
3833
3834
  let {
3834
- type,
3835
3835
  network
3836
3836
  } = _ref2;
3837
3837
  try {
3838
3838
  const apiUrl = new URL(this.config.api);
3839
- apiUrl.pathname = `/customnetwork/${type}`;
3839
+ apiUrl.pathname = `/customnetwork`;
3840
3840
  const {
3841
3841
  selectedAddress
3842
3842
  } = this.state;
@@ -3846,7 +3846,9 @@ class PreferencesController extends BasePreferencesController {
3846
3846
  chain_id: network.chainId,
3847
3847
  symbol: network.ticker,
3848
3848
  block_explorer_url: network.blockExplorerUrl || undefined,
3849
- is_test_net: network.isTestnet || false
3849
+ is_testnet: network.isTestnet || false,
3850
+ logo: network.logo,
3851
+ symbol_name: network.tickerName
3850
3852
  };
3851
3853
  const res = await post(apiUrl.href, payload, this.headers(selectedAddress), {
3852
3854
  useAPIKey: true
@@ -3892,7 +3894,7 @@ class PreferencesController extends BasePreferencesController {
3892
3894
  chain_id: network.chainId,
3893
3895
  symbol: network.ticker || undefined,
3894
3896
  block_explorer_url: network.blockExplorerUrl || undefined,
3895
- is_test_net: network.isTestnet || false
3897
+ is_testnet: network.isTestnet || false
3896
3898
  };
3897
3899
  await patch(apiUrl.href, payload, this.headers(selectedAddress), {
3898
3900
  useAPIKey: true