@toruslabs/ethereum-controllers 6.1.4 → 6.2.0

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.
@@ -4493,6 +4493,15 @@ class PreferencesController extends base_controllers_namespaceObject.BasePrefere
4493
4493
  return [];
4494
4494
  }
4495
4495
  }
4496
+ async fetchQuote(parameters) {
4497
+ try {
4498
+ const response = await this.wsApiClient.authPost("quote", parameters, this.authCredentials());
4499
+ return response.success ? response.data : [];
4500
+ } catch (error) {
4501
+ external_loglevel_default().error("unable to get swap quote", error);
4502
+ return [];
4503
+ }
4504
+ }
4496
4505
  async getEtherScanTokens(address, chainId) {
4497
4506
  const selectedAddress = address;
4498
4507
  const result = await this.wsApiClient.authGet(`tokens?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());
@@ -4119,6 +4119,15 @@ class PreferencesController extends BasePreferencesController {
4119
4119
  return [];
4120
4120
  }
4121
4121
  }
4122
+ async fetchQuote(parameters) {
4123
+ try {
4124
+ const response = await this.wsApiClient.authPost("quote", parameters, this.authCredentials());
4125
+ return response.success ? response.data : [];
4126
+ } catch (error) {
4127
+ log.error("unable to get swap quote", error);
4128
+ return [];
4129
+ }
4130
+ }
4122
4131
  async getEtherScanTokens(address, chainId) {
4123
4132
  const selectedAddress = address;
4124
4133
  const result = await this.wsApiClient.authGet(`tokens?chainId=${chainId}&address=${selectedAddress}`, this.authCredentials());