diff --git a/src/index.ts b/src/index.ts index d07da8d..cf10f06 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,7 @@ export class AccountCreationPluginMetamask readonly config: AccountCreationPluginConfig = { requiresChainSelect: true, + supportedChains: [Chains.EOS], } readonly metadata: AccountCreationPluginMetadata = AccountCreationPluginMetadata.from({ @@ -44,8 +45,16 @@ export class AccountCreationPluginMetamask } async create(context: CreateAccountContext) { - if (context.chain?.id !== Chains.EOS.id) { - throw new Error('Only EOS is currently supported by this plugin.') + if (!context.chain) { + throw new Error('Chain not provided') + } + const currenChain = this.config.supportedChains?.find((chain) => + chain.equals(context.chain!) + ) + if (!currenChain) { + throw new Error( + `Chain not supported. This plugin only supports ${this.config.supportedChains}` + ) } const qs = new URLSearchParams() qs.set('supported_chains', String(context.chain))