Skip to content

Commit 532664a

Browse files
authored
Remove SDK code imports (#1039)
1 parent dd21180 commit 532664a

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

.changeset/warm-actors-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@hyperlane-xyz/registry": patch
3+
---
4+
5+
Remove SDK code imports

src/registry/BaseRegistry.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
import type { Logger } from 'pino';
22

33
import {
4-
HypTokenRouterConfig,
54
ChainMap,
65
ChainMetadata,
76
ChainName,
7+
HypTokenRouterConfig,
88
WarpCoreConfig,
99
WarpRouteDeployConfig,
10-
isSyntheticTokenConfig,
11-
isSyntheticRebaseTokenConfig,
1210
} from '@hyperlane-xyz/sdk';
1311
import { assert, objFilter, objLength } from '@hyperlane-xyz/utils';
12+
import { WARP_ROUTE_ID_REGEX } from '../consts.js';
1413
import type {
1514
ChainAddresses,
1615
MaybePromise,
16+
UpdateChainParams,
1717
WarpDeployConfigMap,
1818
WarpRouteFilterParams,
1919
WarpRouteId,
20-
UpdateChainParams,
2120
} from '../types.js';
2221
import { WarpRouteConfigMap } from '../types.js';
2322
import { stripLeadingSlash } from '../utils.js';
@@ -28,8 +27,7 @@ import type {
2827
RegistryType,
2928
} from './IRegistry.js';
3029
import { MergedRegistry } from './MergedRegistry.js';
31-
import { createWarpRouteConfigId, syntheticTokenStandards } from './warp-utils.js';
32-
import { WARP_ROUTE_ID_REGEX } from '../consts.js';
30+
import { createWarpRouteConfigId } from './warp-utils.js';
3331

3432
export abstract class BaseRegistry implements IRegistry {
3533
public abstract type: RegistryType;
@@ -80,9 +78,7 @@ export abstract class BaseRegistry implements IRegistry {
8078
): WarpRouteId {
8179
assert(config?.tokens?.length > 0, 'Cannot generate ID for empty warp config');
8280

83-
const syntheticTokens = config.tokens.filter((token) =>
84-
syntheticTokenStandards.includes(token.standard),
85-
);
81+
const syntheticTokens = config.tokens.filter((token) => token.standard?.includes('Synthetic'));
8682

8783
let warpRouteId;
8884
if (options && 'warpRouteId' in options) {
@@ -138,10 +134,8 @@ export abstract class BaseRegistry implements IRegistry {
138134
static warpDeployConfigToId(config: WarpRouteDeployConfig, options: AddWarpRouteConfigOptions) {
139135
assert(objLength(config) > 0, 'Cannot generate ID for empty warp deploy config');
140136

141-
const syntheticChains = objFilter(
142-
config,
143-
(_, c): c is HypTokenRouterConfig =>
144-
isSyntheticTokenConfig(c) || isSyntheticRebaseTokenConfig(c),
137+
const syntheticChains = objFilter(config, (_, c): c is HypTokenRouterConfig =>
138+
c.type?.includes('synthetic'),
145139
);
146140
let warpRouteId;
147141
if ('warpRouteId' in options) {

0 commit comments

Comments
 (0)