Skip to content

Commit

Permalink
Add base support 2 (#5)
Browse files Browse the repository at this point in the history
* add base support

* missed the name to id matching
  • Loading branch information
hexonaut authored Nov 1, 2024
1 parent 86f9bca commit d7cd124
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/getChainIdFromSpellName.ts
Original file line number Diff line number Diff line change
@@ -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+$/
Expand All @@ -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}`)
}
Expand Down

0 comments on commit d7cd124

Please sign in to comment.