@metamask-previews/perps-controller 22.0.0-preview-d0145b59e → 22.0.0-preview-896e0b6

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.
@@ -442,6 +442,7 @@ const MESSENGER_EXPOSED_METHODS = [
442
442
  'fetchHistoricalCandles',
443
443
  'flipPosition',
444
444
  'getAccountState',
445
+ 'getAccountSupport',
445
446
  'getActiveProvider',
446
447
  'getActiveProviderOrNull',
447
448
  'getAttributionContext',
@@ -1979,6 +1980,23 @@ export class PerpsController extends BaseController {
1979
1980
  return this.getActiveProvider();
1980
1981
  }
1981
1982
  }
1983
+ /**
1984
+ * Return whether the selected account can submit actions through the active
1985
+ * provider route. Providers without an account-support check remain
1986
+ * supported for backward compatibility.
1987
+ *
1988
+ * @param params - Optional provider route.
1989
+ * @returns The provider-owned account support result.
1990
+ */
1991
+ async getAccountSupport(params) {
1992
+ const provider = await this.#getActiveProviderWhenReady();
1993
+ if (this.#hasConflictingProviderRoute(params?.providerId, provider)) {
1994
+ throw new Error(PERPS_ERROR_CODES.PROVIDER_NOT_FOUND);
1995
+ }
1996
+ return provider.getAccountSupport
1997
+ ? provider.getAccountSupport(params)
1998
+ : { isSupported: true };
1999
+ }
1982
2000
  /**
1983
2001
  * Identify the account, network and provider an action runs under.
1984
2002
  *