@hyperlane-xyz/registry 10.15.0 → 11.0.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.
@@ -86,6 +86,7 @@
86
86
  "etherscan",
87
87
  "blockscout",
88
88
  "routescan",
89
+ "voyager",
89
90
  "other"
90
91
  ],
91
92
  "description": "The type of the block explorer. See ExplorerFamily for valid values."
@@ -315,7 +316,8 @@
315
316
  "enum": [
316
317
  "ethereum",
317
318
  "sealevel",
318
- "cosmos"
319
+ "cosmos",
320
+ "starknet"
319
321
  ],
320
322
  "description": "The type of protocol used by this chain. See ProtocolType for valid values."
321
323
  },
@@ -45,6 +45,7 @@ export const warpRouteConfig = {
45
45
  {
46
46
  "addressOrDenom": "0xbBa1938ff861c77eA1687225B9C33554379Ef327",
47
47
  "chainName": "celo",
48
+ "coinGeckoId": "openusdt",
48
49
  "collateralAddressOrDenom": "0x5e5F4d6B03db16E7f00dE7C9AFAA53b92C8d1D42",
49
50
  "connections": [
50
51
  {
@@ -45,6 +45,7 @@
45
45
  {
46
46
  "addressOrDenom": "0xbBa1938ff861c77eA1687225B9C33554379Ef327",
47
47
  "chainName": "celo",
48
+ "coinGeckoId": "openusdt",
48
49
  "collateralAddressOrDenom": "0x5e5F4d6B03db16E7f00dE7C9AFAA53b92C8d1D42",
49
50
  "connections": [
50
51
  {
@@ -21,6 +21,7 @@ tokens:
21
21
  symbol: oUSDT
22
22
  - addressOrDenom: "0xbBa1938ff861c77eA1687225B9C33554379Ef327"
23
23
  chainName: celo
24
+ coinGeckoId: openusdt
24
25
  collateralAddressOrDenom: "0x5e5F4d6B03db16E7f00dE7C9AFAA53b92C8d1D42"
25
26
  connections:
26
27
  - token: ethereum|base|0x4F0654395d621De4d1101c0F98C1Dba73ca0a61f
@@ -21,6 +21,7 @@ type GithubRateResponse = {
21
21
  };
22
22
  };
23
23
  export declare const GITHUB_API_URL = "https://api.github.com";
24
+ export declare const GITHUB_API_VERSION = "2022-11-28";
24
25
  /**
25
26
  * A registry that uses a github repository as its data source.
26
27
  * Reads are performed via the github API and github's raw content URLs.
@@ -33,6 +34,8 @@ export declare class GithubRegistry extends BaseRegistry implements IRegistry {
33
34
  readonly repoOwner: string;
34
35
  readonly repoName: string;
35
36
  readonly proxyUrl: string | undefined;
37
+ private readonly authToken;
38
+ private readonly baseApiHeaders;
36
39
  constructor(options?: GithubRegistryOptions);
37
40
  getUri(itemPath?: string): string;
38
41
  listRegistryContent(): Promise<RegistryContent>;
@@ -5,6 +5,7 @@ import { BaseRegistry } from './BaseRegistry.js';
5
5
  import { RegistryType, } from './IRegistry.js';
6
6
  import { filterWarpRoutesIds, warpRouteConfigPathToId, warpRouteDeployConfigPathToId, } from './warp-utils.js';
7
7
  export const GITHUB_API_URL = 'https://api.github.com';
8
+ export const GITHUB_API_VERSION = '2022-11-28';
8
9
  /**
9
10
  * A registry that uses a github repository as its data source.
10
11
  * Reads are performed via the github API and github's raw content URLs.
@@ -17,6 +18,10 @@ export class GithubRegistry extends BaseRegistry {
17
18
  repoOwner;
18
19
  repoName;
19
20
  proxyUrl;
21
+ authToken;
22
+ baseApiHeaders = {
23
+ 'X-GitHub-Api-Version': GITHUB_API_VERSION,
24
+ };
20
25
  constructor(options = {}) {
21
26
  super({ uri: options.uri ?? DEFAULT_GITHUB_REGISTRY, logger: options.logger });
22
27
  this.url = new URL(this.uri);
@@ -27,6 +32,7 @@ export class GithubRegistry extends BaseRegistry {
27
32
  throw new Error('Branch is set in both options and url.');
28
33
  this.branch = options.branch ?? repoBranch ?? 'main';
29
34
  this.proxyUrl = options.proxyUrl;
35
+ this.authToken = options.authToken;
30
36
  }
31
37
  getUri(itemPath) {
32
38
  if (!itemPath)
@@ -154,11 +160,7 @@ export class GithubRegistry extends BaseRegistry {
154
160
  return `${apiHost}/repos/${this.repoOwner}/${this.repoName}/git/trees/${this.branch}?recursive=true`;
155
161
  }
156
162
  async getApiRateLimit() {
157
- const response = await fetch(`${GITHUB_API_URL}/rate_limit`, {
158
- headers: {
159
- 'X-GitHub-Api-Version': '2022-11-28',
160
- },
161
- });
163
+ const response = await this.fetch(`${GITHUB_API_URL}/rate_limit`);
162
164
  const { resources } = (await response.json());
163
165
  return resources.core;
164
166
  }
@@ -183,7 +185,13 @@ export class GithubRegistry extends BaseRegistry {
183
185
  }
184
186
  async fetch(url) {
185
187
  this.logger.debug(`Fetching from github: ${url}`);
186
- const response = await fetch(url);
188
+ const isProxiedRequest = this.proxyUrl && url.startsWith(this.proxyUrl);
189
+ const headers = !isProxiedRequest && !!this.authToken
190
+ ? { ...this.baseApiHeaders, Authorization: `Bearer ${this.authToken}` }
191
+ : this.baseApiHeaders;
192
+ const response = await fetch(url, {
193
+ headers,
194
+ });
187
195
  if (!response.ok)
188
196
  throw new Error(`Failed to fetch from github: ${response.status} ${response.statusText}`);
189
197
  return response;
@@ -12,9 +12,10 @@ import { IRegistry } from './IRegistry.js';
12
12
  * @param logger - An optional logger instance to use for logging.
13
13
  * @returns An `IRegistry` instance that combines the specified registries.
14
14
  */
15
- export declare function getRegistry({ registryUris, enableProxy, branch, logger, }: {
15
+ export declare function getRegistry({ registryUris, enableProxy, branch, logger, authToken, }: {
16
16
  registryUris: string[];
17
17
  enableProxy: boolean;
18
18
  branch?: string;
19
19
  logger?: Logger;
20
+ authToken?: string;
20
21
  }): IRegistry;
@@ -50,7 +50,7 @@ const isValidFilePath = (path) => {
50
50
  * @param logger - An optional logger instance to use for logging.
51
51
  * @returns An `IRegistry` instance that combines the specified registries.
52
52
  */
53
- export function getRegistry({ registryUris, enableProxy, branch, logger, }) {
53
+ export function getRegistry({ registryUris, enableProxy, branch, logger, authToken, }) {
54
54
  const registryLogger = logger?.child({ module: 'MergedRegistry' });
55
55
  const registries = registryUris
56
56
  .map((uri) => uri.trim())
@@ -63,6 +63,7 @@ export function getRegistry({ registryUris, enableProxy, branch, logger, }) {
63
63
  branch,
64
64
  logger: childLogger,
65
65
  proxyUrl: enableProxy ? PROXY_DEPLOYED_URL : undefined,
66
+ authToken,
66
67
  });
67
68
  }
68
69
  else {
@@ -7152,6 +7152,7 @@ export const warpRouteConfigs = {
7152
7152
  {
7153
7153
  "addressOrDenom": "0xbBa1938ff861c77eA1687225B9C33554379Ef327",
7154
7154
  "chainName": "celo",
7155
+ "coinGeckoId": "openusdt",
7155
7156
  "collateralAddressOrDenom": "0x5e5F4d6B03db16E7f00dE7C9AFAA53b92C8d1D42",
7156
7157
  "connections": [
7157
7158
  {
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": "10.15.0",
4
+ "version": "11.0.0",
5
5
  "dependencies": {
6
6
  "yaml": "2.4.5",
7
7
  "zod": "^3.21.2"
@@ -10,11 +10,14 @@
10
10
  "@changesets/cli": "^2.26.2",
11
11
  "@eslint/js": "^9.1.1",
12
12
  "@faker-js/faker": "^9.6.0",
13
- "@hyperlane-xyz/sdk": "8.9.0",
13
+ "@hyperlane-xyz/sdk": "9.0.0",
14
+ "@types/chai-as-promised": "^8",
14
15
  "@types/mocha": "^10.0.1",
15
16
  "@types/node": "^16.9.1",
16
17
  "@typescript-eslint/parser": "^7.7.0",
17
- "chai": "^4.3.6",
18
+ "chai": "^5.1.2",
19
+ "chai-as-promised": "^8.0.1",
20
+ "dotenv": "^16.4.7",
18
21
  "eslint": "^9.0.0",
19
22
  "eslint-config-prettier": "^9.1.0",
20
23
  "eslint-plugin-yml": "^1.14.0",
@@ -68,7 +71,7 @@
68
71
  "prettier": "prettier --write ./chains ./deployments",
69
72
  "prepare": "husky",
70
73
  "release": "yarn build && yarn changeset publish",
71
- "test:unit": "yarn build && mocha --config .mocharc.json './test/unit/*.test.ts' --exit",
74
+ "test:unit": "yarn build && mocha --require dotenv/config --config .mocharc.json './test/unit/*.test.ts' --exit",
72
75
  "test:health": "yarn build && mocha --config .mocharc.json './test/health/*.test.ts' --exit --parallel",
73
76
  "version:prepare": "yarn changeset version && yarn install --no-immutable",
74
77
  "version:check": "yarn changeset status"