@hyperlane-xyz/registry 6.17.0 → 6.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import type { WarpCoreConfig } from '@hyperlane-xyz/sdk';
2
+ export declare const warpRouteConfig: WarpCoreConfig;
@@ -0,0 +1,34 @@
1
+ export const warpRouteConfig = {
2
+ "tokens": [
3
+ {
4
+ "addressOrDenom": "0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8",
5
+ "chainName": "base",
6
+ "connections": [
7
+ {
8
+ "token": "sealevel|solanamainnet|21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS"
9
+ }
10
+ ],
11
+ "decimals": 18,
12
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
13
+ "name": "OFFICIAL TRUMP",
14
+ "standard": "EvmHypSynthetic",
15
+ "symbol": "TRUMP"
16
+ },
17
+ {
18
+ "addressOrDenom": "21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS",
19
+ "chainName": "solanamainnet",
20
+ "coinGeckoId": "official-trump",
21
+ "collateralAddressOrDenom": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
22
+ "connections": [
23
+ {
24
+ "token": "ethereum|base|0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8"
25
+ }
26
+ ],
27
+ "decimals": 6,
28
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
29
+ "name": "OFFICIAL TRUMP",
30
+ "standard": "SealevelHypCollateral",
31
+ "symbol": "TRUMP"
32
+ }
33
+ ]
34
+ };
@@ -0,0 +1,34 @@
1
+ {
2
+ "tokens": [
3
+ {
4
+ "addressOrDenom": "0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8",
5
+ "chainName": "base",
6
+ "connections": [
7
+ {
8
+ "token": "sealevel|solanamainnet|21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS"
9
+ }
10
+ ],
11
+ "decimals": 18,
12
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
13
+ "name": "OFFICIAL TRUMP",
14
+ "standard": "EvmHypSynthetic",
15
+ "symbol": "TRUMP"
16
+ },
17
+ {
18
+ "addressOrDenom": "21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS",
19
+ "chainName": "solanamainnet",
20
+ "coinGeckoId": "official-trump",
21
+ "collateralAddressOrDenom": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
22
+ "connections": [
23
+ {
24
+ "token": "ethereum|base|0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8"
25
+ }
26
+ ],
27
+ "decimals": 6,
28
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
29
+ "name": "OFFICIAL TRUMP",
30
+ "standard": "SealevelHypCollateral",
31
+ "symbol": "TRUMP"
32
+ }
33
+ ]
34
+ }
@@ -0,0 +1,22 @@
1
+ # yaml-language-server: $schema=../schema.json
2
+ tokens:
3
+ - addressOrDenom: "0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8"
4
+ chainName: base
5
+ connections:
6
+ - token: sealevel|solanamainnet|21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS
7
+ decimals: 18
8
+ logoURI: /deployments/warp_routes/TRUMP/logo.png
9
+ name: OFFICIAL TRUMP
10
+ standard: EvmHypSynthetic
11
+ symbol: TRUMP
12
+ - addressOrDenom: 21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS
13
+ chainName: solanamainnet
14
+ coinGeckoId: official-trump
15
+ collateralAddressOrDenom: 6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN
16
+ connections:
17
+ - token: ethereum|base|0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8
18
+ decimals: 6
19
+ logoURI: /deployments/warp_routes/TRUMP/logo.png
20
+ name: OFFICIAL TRUMP
21
+ standard: SealevelHypCollateral
22
+ symbol: TRUMP
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CHAIN_FILE_REGEX, DEFAULT_GITHUB_REGISTRY, WARP_ROUTE_CONFIG_FILE_REGEX, } from './consts.js';
2
2
  export { BaseRegistry } from './registry/BaseRegistry.js';
3
3
  export { GithubRegistry, GithubRegistryOptions } from './registry/GithubRegistry.js';
4
- export { ChainFiles, IRegistry, RegistryContent, RegistryType } from './registry/IRegistry.js';
4
+ export { AddWarpRouteOptions, ChainFiles, IRegistry, RegistryContent, RegistryType, } from './registry/IRegistry.js';
5
5
  export { MergedRegistry, MergedRegistryOptions } from './registry/MergedRegistry.js';
6
6
  export { PartialRegistry, PartialRegistryOptions } from './registry/PartialRegistry.js';
7
7
  export { filterWarpRoutesIds, warpConfigToWarpAddresses, warpRouteConfigPathToId, warpRouteConfigToId, createWarpRouteConfigId, } from './registry/warp-utils.js';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CHAIN_FILE_REGEX, DEFAULT_GITHUB_REGISTRY, WARP_ROUTE_CONFIG_FILE_REGEX, } from './consts.js';
2
2
  export { BaseRegistry } from './registry/BaseRegistry.js';
3
3
  export { GithubRegistry } from './registry/GithubRegistry.js';
4
- export { RegistryType } from './registry/IRegistry.js';
4
+ export { RegistryType, } from './registry/IRegistry.js';
5
5
  export { MergedRegistry } from './registry/MergedRegistry.js';
6
6
  export { PartialRegistry } from './registry/PartialRegistry.js';
7
7
  export { filterWarpRoutesIds, warpConfigToWarpAddresses, warpRouteConfigPathToId, warpRouteConfigToId, createWarpRouteConfigId, } from './registry/warp-utils.js';
@@ -2,7 +2,7 @@ import type { Logger } from 'pino';
2
2
  import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
3
3
  import type { ChainAddresses, MaybePromise } from '../types.js';
4
4
  import { WarpRouteConfigMap } from '../types.js';
5
- import type { IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
5
+ import type { AddWarpRouteOptions, IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
6
6
  export declare abstract class BaseRegistry implements IRegistry {
7
7
  abstract type: RegistryType;
8
8
  readonly uri: string;
@@ -19,7 +19,7 @@ export declare abstract class BaseRegistry implements IRegistry {
19
19
  getUri(itemPath?: string): string;
20
20
  protected getChainsPath(): string;
21
21
  protected getWarpRoutesPath(): string;
22
- protected getWarpRoutesArtifactPaths({ tokens }: WarpCoreConfig): {
22
+ protected getWarpRoutesArtifactPaths({ tokens }: WarpCoreConfig, options?: AddWarpRouteOptions): {
23
23
  configPath: string;
24
24
  addressesPath: string;
25
25
  };
@@ -27,13 +27,13 @@ export class BaseRegistry {
27
27
  getWarpRoutesPath() {
28
28
  return 'deployments/warp_routes';
29
29
  }
30
- getWarpRoutesArtifactPaths({ tokens }) {
30
+ getWarpRoutesArtifactPaths({ tokens }, options) {
31
31
  if (!tokens.length)
32
32
  throw new Error('No tokens provided in config');
33
33
  const symbols = new Set(tokens.map((token) => token.symbol.toUpperCase()));
34
- if (symbols.size !== 1)
35
- throw new Error('Only one token symbol per warp config is supported for now');
36
- const symbol = symbols.values().next().value;
34
+ if (!options?.symbol && symbols.size !== 1)
35
+ throw new Error('Only one token symbol per warp config is supported for now. Consider passing a symbol as a parameter');
36
+ const symbol = options?.symbol || symbols.values().next().value;
37
37
  const chains = tokens
38
38
  .map((token) => token.chainName)
39
39
  .sort()
@@ -1,7 +1,7 @@
1
1
  import type { Logger } from 'pino';
2
2
  import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
3
3
  import { ChainAddresses, WarpRouteId } from '../types.js';
4
- import { RegistryType, UpdateChainParams, type ChainFiles, type IRegistry, type RegistryContent } from './IRegistry.js';
4
+ import { RegistryType, UpdateChainParams, type AddWarpRouteOptions, type ChainFiles, type IRegistry, type RegistryContent } from './IRegistry.js';
5
5
  import { SynchronousRegistry } from './SynchronousRegistry.js';
6
6
  export interface FileSystemRegistryOptions {
7
7
  uri: string;
@@ -19,7 +19,7 @@ export declare class FileSystemRegistry extends SynchronousRegistry implements I
19
19
  getMetadata(): ChainMap<ChainMetadata>;
20
20
  getAddresses(): ChainMap<ChainAddresses>;
21
21
  removeChain(chainName: ChainName): void;
22
- addWarpRoute(config: WarpCoreConfig): void;
22
+ addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void;
23
23
  protected listFiles(dirPath: string): string[];
24
24
  protected createOrUpdateChain(chain: UpdateChainParams): void;
25
25
  protected createChainFile(chainName: ChainName, fileName: keyof ChainFiles, data: any, cache: ChainMap<any>, prefix?: string): void;
@@ -76,8 +76,8 @@ export class FileSystemRegistry extends SynchronousRegistry {
76
76
  super.removeChain(chainName);
77
77
  this.removeFiles(Object.values(chainFiles));
78
78
  }
79
- addWarpRoute(config) {
80
- let { configPath, addressesPath } = this.getWarpRoutesArtifactPaths(config);
79
+ addWarpRoute(config, options) {
80
+ let { configPath, addressesPath } = this.getWarpRoutesArtifactPaths(config, options);
81
81
  configPath = path.join(this.uri, configPath);
82
82
  this.createFile({ filePath: configPath, data: toYamlString(config, SCHEMA_REF) });
83
83
  addressesPath = path.join(this.uri, addressesPath);
@@ -136,10 +136,10 @@ export class GithubRegistry extends BaseRegistry {
136
136
  async getApiRateLimit() {
137
137
  const response = await fetch(`${GITHUB_API_URL}/rate_limit`, {
138
138
  headers: {
139
- 'X-GitHub-Api-Version': '2022-11-28'
140
- }
139
+ 'X-GitHub-Api-Version': '2022-11-28',
140
+ },
141
141
  });
142
- const { resources } = await response.json();
142
+ const { resources } = (await response.json());
143
143
  return resources.core;
144
144
  }
145
145
  getRawContentUrl(path) {
@@ -26,6 +26,9 @@ export declare enum RegistryType {
26
26
  Merged = "merged",
27
27
  Partial = "partial"
28
28
  }
29
+ export interface AddWarpRouteOptions {
30
+ symbol?: string;
31
+ }
29
32
  export interface IRegistry {
30
33
  type: RegistryType;
31
34
  uri: string;
@@ -42,6 +45,6 @@ export interface IRegistry {
42
45
  removeChain(chain: ChainName): MaybePromise<void>;
43
46
  getWarpRoute(routeId: string): MaybePromise<WarpCoreConfig | null>;
44
47
  getWarpRoutes(filter?: WarpRouteFilterParams): MaybePromise<WarpRouteConfigMap>;
45
- addWarpRoute(config: WarpCoreConfig): MaybePromise<void>;
48
+ addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): MaybePromise<void>;
46
49
  merge(otherRegistry: IRegistry): IRegistry;
47
50
  }
@@ -1,7 +1,7 @@
1
1
  import type { Logger } from 'pino';
2
2
  import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
3
3
  import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
4
- import { IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
4
+ import { AddWarpRouteOptions, IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
5
5
  export interface MergedRegistryOptions {
6
6
  registries: Array<IRegistry>;
7
7
  logger?: Logger;
@@ -31,7 +31,7 @@ export declare class MergedRegistry implements IRegistry {
31
31
  removeChain(chain: ChainName): Promise<void>;
32
32
  getWarpRoute(id: WarpRouteId): Promise<WarpCoreConfig | null>;
33
33
  getWarpRoutes(filter?: WarpRouteFilterParams): Promise<WarpRouteConfigMap>;
34
- addWarpRoute(config: WarpCoreConfig): Promise<void>;
34
+ addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): Promise<void>;
35
35
  protected multiRegistryRead<R>(readFn: (registry: IRegistry) => Promise<R> | R): Promise<(Awaited<R> | Awaited<R>)[]>;
36
36
  protected multiRegistryWrite(writeFn: (registry: IRegistry) => Promise<void>, logMsg: string): Promise<void>;
37
37
  merge(otherRegistry: IRegistry): IRegistry;
@@ -68,8 +68,8 @@ export class MergedRegistry {
68
68
  const results = await this.multiRegistryRead((r) => r.getWarpRoutes(filter));
69
69
  return results.reduce((acc, content) => objMerge(acc, content), {});
70
70
  }
71
- async addWarpRoute(config) {
72
- return this.multiRegistryWrite(async (registry) => await registry.addWarpRoute(config), 'adding warp route');
71
+ async addWarpRoute(config, options) {
72
+ return this.multiRegistryWrite(async (registry) => await registry.addWarpRoute(config, options), 'adding warp route');
73
73
  }
74
74
  multiRegistryRead(readFn) {
75
75
  return Promise.all(this.registries.map(readFn));
@@ -1,7 +1,7 @@
1
1
  import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
2
2
  import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
3
3
  import { BaseRegistry } from './BaseRegistry.js';
4
- import { IRegistry, RegistryContent, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
4
+ import { AddWarpRouteOptions, IRegistry, RegistryContent, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
5
5
  /**
6
6
  * Shared code for sync registries like the FileSystem and Partial registries.
7
7
  * This is required because of the inconsistent sync/async methods across registries.
@@ -19,7 +19,7 @@ export declare abstract class SynchronousRegistry extends BaseRegistry implement
19
19
  removeChain(chainName: ChainName): void;
20
20
  getWarpRoute(routeId: string): WarpCoreConfig | null;
21
21
  getWarpRoutes(filter?: WarpRouteFilterParams): WarpRouteConfigMap;
22
- abstract addWarpRoute(config: WarpCoreConfig): void;
22
+ abstract addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void;
23
23
  protected abstract createOrUpdateChain(chain: UpdateChainParams): void;
24
24
  protected abstract getWarpRoutesForIds(ids: WarpRouteId[]): WarpCoreConfig[];
25
25
  }
@@ -3743,6 +3743,40 @@ export const warpRouteConfigs = {
3743
3743
  }
3744
3744
  ]
3745
3745
  },
3746
+ "TRUMP/base-solanamainnet": {
3747
+ "tokens": [
3748
+ {
3749
+ "addressOrDenom": "0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8",
3750
+ "chainName": "base",
3751
+ "connections": [
3752
+ {
3753
+ "token": "sealevel|solanamainnet|21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS"
3754
+ }
3755
+ ],
3756
+ "decimals": 18,
3757
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
3758
+ "name": "OFFICIAL TRUMP",
3759
+ "standard": "EvmHypSynthetic",
3760
+ "symbol": "TRUMP"
3761
+ },
3762
+ {
3763
+ "addressOrDenom": "21tAY4poz2VXvghqdSQpn9j7gYravQmGpuQi8pHPx9DS",
3764
+ "chainName": "solanamainnet",
3765
+ "coinGeckoId": "official-trump",
3766
+ "collateralAddressOrDenom": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN",
3767
+ "connections": [
3768
+ {
3769
+ "token": "ethereum|base|0x53c0499e7E4aBD3e7994ca161523FD50A12Bb8C8"
3770
+ }
3771
+ ],
3772
+ "decimals": 6,
3773
+ "logoURI": "/deployments/warp_routes/TRUMP/logo.png",
3774
+ "name": "OFFICIAL TRUMP",
3775
+ "standard": "SealevelHypCollateral",
3776
+ "symbol": "TRUMP"
3777
+ }
3778
+ ]
3779
+ },
3746
3780
  "uBTC/boba-bsquared-swell": {
3747
3781
  "tokens": [
3748
3782
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hyperlane-xyz/registry",
3
3
  "description": "A collection of configs, artifacts, and schemas for Hyperlane",
4
- "version": "6.17.0",
4
+ "version": "6.18.0",
5
5
  "dependencies": {
6
6
  "yaml": "2.4.5",
7
7
  "zod": "^3.21.2"