From d7cd1247d70493b56bc6bf6e22f97b1a36ad3906 Mon Sep 17 00:00:00 2001 From: Sam MacPherson Date: Fri, 1 Nov 2024 07:33:43 -0400 Subject: [PATCH] Add base support 2 (#5) * add base support * missed the name to id matching --- src/utils/getChainIdFromSpellName.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/getChainIdFromSpellName.ts b/src/utils/getChainIdFromSpellName.ts index e99efb6..bf7af9d 100644 --- a/src/utils/getChainIdFromSpellName.ts +++ b/src/utils/getChainIdFromSpellName.ts @@ -1,4 +1,4 @@ -import { gnosis, mainnet } from 'viem/chains' +import { base, gnosis, mainnet } from 'viem/chains' export function getChainIdFromSpellName(spellName: string): number { const regex = /^Spark([a-zA-Z]+)_\d+$/ @@ -17,6 +17,8 @@ export function getChainIdFromSpellName(spellName: string): number { return mainnet.id case 'Gnosis': return gnosis.id + case 'Base': + return base.id default: throw new Error(`Unknown chain name: ${name}`) }