@toruslabs/ethereum-controllers 5.0.1 → 5.0.3
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.
- package/dist/ethereumControllers.cjs.js +8 -7
- package/dist/ethereumControllers.cjs.js.map +1 -1
- package/dist/ethereumControllers.esm.js +8 -7
- package/dist/ethereumControllers.esm.js.map +1 -1
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/ethereumControllers.umd.min.js.map +1 -1
- package/dist/types/Preferences/PreferencesController.d.ts +2 -4
- package/dist/types/utils/interfaces.d.ts +4 -3
- package/package.json +3 -3
- package/src/Preferences/PreferencesController.ts +12 -9
- package/src/utils/interfaces.ts +4 -3
|
@@ -4232,7 +4232,6 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4232
4232
|
}
|
|
4233
4233
|
async fetchEtherscanTx(parameters) {
|
|
4234
4234
|
try {
|
|
4235
|
-
// TODO: rewrite this api to use chainId
|
|
4236
4235
|
const url = new URL(`${this.config.api}/etherscan`);
|
|
4237
4236
|
Object.keys(parameters).forEach(key => url.searchParams.append(key, parameters[key]));
|
|
4238
4237
|
const response = await (0,http_helpers_namespaceObject.get)(url.href, this.headers(parameters.selectedAddress));
|
|
@@ -4284,10 +4283,11 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4284
4283
|
rpcTarget: network.rpcUrls[0],
|
|
4285
4284
|
ticker: network.nativeCurrency.symbol,
|
|
4286
4285
|
chainId: network.chainId,
|
|
4287
|
-
blockExplorerUrl: network.blockExplorerUrls[0]
|
|
4286
|
+
blockExplorerUrl: network.blockExplorerUrls[0],
|
|
4287
|
+
tickerName: network.nativeCurrency.name,
|
|
4288
|
+
logo: network.nativeCurrency.symbol
|
|
4288
4289
|
};
|
|
4289
4290
|
const isSuccess = await this.addCustomNetwork({
|
|
4290
|
-
type: "rpc",
|
|
4291
4291
|
network: newNetwork
|
|
4292
4292
|
});
|
|
4293
4293
|
if (!isSuccess) throw new Error("unable to add custom network");
|
|
@@ -4305,12 +4305,11 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4305
4305
|
// Custom Network methods
|
|
4306
4306
|
async addCustomNetwork(_ref2) {
|
|
4307
4307
|
let {
|
|
4308
|
-
type,
|
|
4309
4308
|
network
|
|
4310
4309
|
} = _ref2;
|
|
4311
4310
|
try {
|
|
4312
4311
|
const apiUrl = new URL(this.config.api);
|
|
4313
|
-
apiUrl.pathname = `/customnetwork
|
|
4312
|
+
apiUrl.pathname = `/customnetwork`;
|
|
4314
4313
|
const {
|
|
4315
4314
|
selectedAddress
|
|
4316
4315
|
} = this.state;
|
|
@@ -4320,7 +4319,9 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4320
4319
|
chain_id: network.chainId,
|
|
4321
4320
|
symbol: network.ticker,
|
|
4322
4321
|
block_explorer_url: network.blockExplorerUrl || undefined,
|
|
4323
|
-
|
|
4322
|
+
is_testnet: network.isTestnet || false,
|
|
4323
|
+
logo: network.logo,
|
|
4324
|
+
symbol_name: network.tickerName
|
|
4324
4325
|
};
|
|
4325
4326
|
const res = await (0,http_helpers_namespaceObject.post)(apiUrl.href, payload, this.headers(selectedAddress), {
|
|
4326
4327
|
useAPIKey: true
|
|
@@ -4366,7 +4367,7 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
|
|
|
4366
4367
|
chain_id: network.chainId,
|
|
4367
4368
|
symbol: network.ticker || undefined,
|
|
4368
4369
|
block_explorer_url: network.blockExplorerUrl || undefined,
|
|
4369
|
-
|
|
4370
|
+
is_testnet: network.isTestnet || false
|
|
4370
4371
|
};
|
|
4371
4372
|
await (0,http_helpers_namespaceObject.patch)(apiUrl.href, payload, this.headers(selectedAddress), {
|
|
4372
4373
|
useAPIKey: true
|