diff --git a/package.json b/package.json index 13d0acb4..6129d114 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "@emotion/react": "^11.13.0", "@emotion/styled": "^11.13.0", "@headlessui/react": "^1.7.14", - "@hyperlane-xyz/registry": "https://github.com/hyperlane-xyz/hyperlane-registry.git", + "@hyperlane-xyz/registry": "4.1.0", "@hyperlane-xyz/sdk": "5.1.0", "@hyperlane-xyz/utils": "5.1.0", "@hyperlane-xyz/widgets": "5.1.0", diff --git a/src/consts/chains.ts b/src/consts/chains.ts index 9083e108..fbeea3d1 100644 --- a/src/consts/chains.ts +++ b/src/consts/chains.ts @@ -1,3 +1,9 @@ +import { + eclipsemainnet, + eclipsemainnetAddresses, + solanamainnet, + solanamainnetAddresses, +} from '@hyperlane-xyz/registry'; import { ChainMap, ChainMetadata } from '@hyperlane-xyz/sdk'; // A map of chain names to ChainMetadata @@ -5,6 +11,14 @@ import { ChainMap, ChainMetadata } from '@hyperlane-xyz/sdk'; // Chains already in the SDK need not be included here unless you want to override some fields // Schema here: https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts export const chains: ChainMap = { + solanamainnet: { + ...solanamainnet, + mailbox: solanamainnetAddresses.mailbox, + }, + eclipsemainnet: { + ...eclipsemainnet, + mailbox: eclipsemainnetAddresses.mailbox, + }, // mycustomchain: { // protocol: ProtocolType.Ethereum, // chainId: 123123, diff --git a/src/context/chains.ts b/src/context/chains.ts index 3c404a6b..95ee5115 100644 --- a/src/context/chains.ts +++ b/src/context/chains.ts @@ -1,7 +1,7 @@ import { z } from 'zod'; import { GithubRegistry, chainMetadata } from '@hyperlane-xyz/registry'; -import { ChainMap, ChainMetadata, ChainMetadataSchema } from '@hyperlane-xyz/sdk'; +import { ChainMap, ChainMetadata, ChainMetadataSchemaObject } from '@hyperlane-xyz/sdk'; import { chains as ChainsTS } from '../consts/chains.ts'; import ChainsYaml from '../consts/chains.yaml'; @@ -11,7 +11,7 @@ import { logger } from '../utils/logger'; export async function assembleChainMetadata() { // Chains must include a cosmos chain or CosmosKit throws errors - const result = z.record(ChainMetadataSchema).safeParse({ + const result = z.record(ChainMetadataSchemaObject.passthrough()).safeParse({ cosmoshub: cosmosDefaultChain, ...ChainsYaml, ...ChainsTS, diff --git a/src/features/chains/utils.ts b/src/features/chains/utils.ts index 645bff85..9598f654 100644 --- a/src/features/chains/utils.ts +++ b/src/features/chains/utils.ts @@ -1,4 +1,3 @@ -import { CoreChain, CoreChains } from '@hyperlane-xyz/registry'; import { ChainNameOrId } from '@hyperlane-xyz/sdk'; import { ProtocolType, toTitleCase } from '@hyperlane-xyz/utils'; @@ -14,10 +13,7 @@ export function getChainDisplayName(chain: ChainName, shortName = false) { export function isPermissionlessChain(chain: ChainName) { if (!chain) return true; - return ( - getChainMetadata(chain).protocol !== ProtocolType.Ethereum || - !CoreChains.includes(chain as CoreChain) - ); + return getChainMetadata(chain).protocol !== ProtocolType.Ethereum; } export function hasPermissionlessChain(ids: ChainName[]) { diff --git a/yarn.lock b/yarn.lock index 4621f385..65ec20f4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3938,16 +3938,6 @@ __metadata: languageName: node linkType: hard -"@hyperlane-xyz/registry@https://github.com/hyperlane-xyz/hyperlane-registry.git": - version: 4.0.0 - resolution: "@hyperlane-xyz/registry@https://github.com/hyperlane-xyz/hyperlane-registry.git#commit=9b1bb59da273ce9912178f15cb759297f6a9d1cb" - dependencies: - yaml: "npm:2.4.5" - zod: "npm:^3.21.2" - checksum: caf3cf191fe5066a2ca8733b52b281fce89512caabbc244a0ee36b0ab60d46efd245ff83331257f3b9c7df1ccac1ce691a368c4308d9e4f09af8ec13e765b445 - languageName: node - linkType: hard - "@hyperlane-xyz/registry@npm:2.5.0": version: 2.5.0 resolution: "@hyperlane-xyz/registry@npm:2.5.0" @@ -3958,6 +3948,16 @@ __metadata: languageName: node linkType: hard +"@hyperlane-xyz/registry@npm:4.1.0": + version: 4.1.0 + resolution: "@hyperlane-xyz/registry@npm:4.1.0" + dependencies: + yaml: "npm:2.4.5" + zod: "npm:^3.21.2" + checksum: 5de3ef5539abfaadbfefb82e6e69fdb2413f404d8321456c91810fb50a5a70e9f93b38789495efce6ab5963682536e95a2abe636c7d0ad91ee158cc0ce6b063a + languageName: node + linkType: hard + "@hyperlane-xyz/sdk@npm:5.1.0": version: 5.1.0 resolution: "@hyperlane-xyz/sdk@npm:5.1.0" @@ -4020,7 +4020,7 @@ __metadata: "@emotion/react": "npm:^11.13.0" "@emotion/styled": "npm:^11.13.0" "@headlessui/react": "npm:^1.7.14" - "@hyperlane-xyz/registry": "https://github.com/hyperlane-xyz/hyperlane-registry.git" + "@hyperlane-xyz/registry": "npm:4.1.0" "@hyperlane-xyz/sdk": "npm:5.1.0" "@hyperlane-xyz/utils": "npm:5.1.0" "@hyperlane-xyz/widgets": "npm:5.1.0"