@hyperlane-xyz/registry 7.0.0 → 7.2.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.
- package/dist/chainAddresses.d.ts +111 -0
- package/dist/chainAddresses.js +111 -0
- package/dist/chainMetadata.js +184 -1
- package/dist/chains/abstract/addresses.d.ts +20 -0
- package/dist/chains/abstract/addresses.js +20 -0
- package/dist/chains/abstract/addresses.json +20 -0
- package/dist/chains/abstract/addresses.yaml +18 -0
- package/dist/chains/abstract/index.d.ts +2 -0
- package/dist/chains/abstract/index.js +2 -0
- package/dist/chains/abstract/logo.svg +1 -0
- package/dist/chains/abstract/metadata.d.ts +2 -0
- package/dist/chains/abstract/metadata.js +39 -0
- package/dist/chains/abstract/metadata.json +39 -0
- package/dist/chains/abstract/metadata.yaml +28 -0
- package/dist/chains/artela/metadata.js +1 -1
- package/dist/chains/artela/metadata.json +1 -1
- package/dist/chains/artela/metadata.yaml +1 -1
- package/dist/chains/glue/addresses.d.ts +27 -0
- package/dist/chains/glue/addresses.js +27 -0
- package/dist/chains/glue/addresses.json +27 -0
- package/dist/chains/glue/addresses.yaml +25 -0
- package/dist/chains/glue/index.d.ts +2 -0
- package/dist/chains/glue/index.js +2 -0
- package/dist/chains/glue/logo.svg +1 -0
- package/dist/chains/glue/metadata.d.ts +2 -0
- package/dist/chains/glue/metadata.js +36 -0
- package/dist/chains/glue/metadata.json +36 -0
- package/dist/chains/glue/metadata.yaml +26 -0
- package/dist/chains/matchain/addresses.d.ts +27 -0
- package/dist/chains/matchain/addresses.js +27 -0
- package/dist/chains/matchain/addresses.json +27 -0
- package/dist/chains/matchain/addresses.yaml +25 -0
- package/dist/chains/matchain/index.d.ts +2 -0
- package/dist/chains/matchain/index.js +2 -0
- package/dist/chains/matchain/logo.svg +1 -0
- package/dist/chains/matchain/metadata.d.ts +2 -0
- package/dist/chains/matchain/metadata.js +36 -0
- package/dist/chains/matchain/metadata.json +36 -0
- package/dist/chains/matchain/metadata.yaml +26 -0
- package/dist/chains/sonicsvm/addresses.d.ts +7 -0
- package/dist/chains/sonicsvm/addresses.js +7 -0
- package/dist/chains/sonicsvm/addresses.json +7 -0
- package/dist/chains/sonicsvm/addresses.yaml +5 -0
- package/dist/chains/sonicsvm/index.d.ts +2 -0
- package/dist/chains/sonicsvm/index.js +2 -0
- package/dist/chains/sonicsvm/logo.svg +1 -0
- package/dist/chains/sonicsvm/metadata.d.ts +2 -0
- package/dist/chains/sonicsvm/metadata.js +36 -0
- package/dist/chains/sonicsvm/metadata.json +36 -0
- package/dist/chains/sonicsvm/metadata.yaml +26 -0
- package/dist/chains/trumpchain/addresses.d.ts +3 -0
- package/dist/chains/trumpchain/addresses.js +3 -0
- package/dist/chains/trumpchain/addresses.json +3 -0
- package/dist/chains/trumpchain/addresses.yaml +3 -0
- package/dist/chains/unitzero/addresses.d.ts +27 -0
- package/dist/chains/unitzero/addresses.js +27 -0
- package/dist/chains/unitzero/addresses.json +27 -0
- package/dist/chains/unitzero/addresses.yaml +25 -0
- package/dist/chains/unitzero/index.d.ts +2 -0
- package/dist/chains/unitzero/index.js +2 -0
- package/dist/chains/unitzero/logo.svg +1 -0
- package/dist/chains/unitzero/metadata.d.ts +2 -0
- package/dist/chains/unitzero/metadata.js +36 -0
- package/dist/chains/unitzero/metadata.json +36 -0
- package/dist/chains/unitzero/metadata.yaml +26 -0
- package/dist/consts.d.ts +1 -0
- package/dist/consts.js +1 -0
- package/dist/deployments/warp_routes/LOGX/arbitrum-solanamainnet-config.d.ts +2 -0
- package/dist/deployments/warp_routes/LOGX/arbitrum-solanamainnet-config.js +35 -0
- package/dist/deployments/warp_routes/LOGX/arbitrum-solanamainnet-config.json +35 -0
- package/dist/deployments/warp_routes/LOGX/arbitrum-solanamainnet-config.yaml +23 -0
- package/dist/deployments/warp_routes/SOL/solanamainnet-sonicsvm-config.d.ts +2 -0
- package/dist/deployments/warp_routes/SOL/solanamainnet-sonicsvm-config.js +33 -0
- package/dist/deployments/warp_routes/SOL/solanamainnet-sonicsvm-config.json +33 -0
- package/dist/deployments/warp_routes/SOL/solanamainnet-sonicsvm-config.yaml +21 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +10 -0
- package/dist/registry/BaseRegistry.d.ts +4 -2
- package/dist/registry/FileSystemRegistry.d.ts +13 -1
- package/dist/registry/FileSystemRegistry.js +33 -5
- package/dist/registry/GithubRegistry.d.ts +5 -2
- package/dist/registry/GithubRegistry.js +24 -4
- package/dist/registry/IRegistry.d.ts +5 -2
- package/dist/registry/MergedRegistry.d.ts +4 -2
- package/dist/registry/MergedRegistry.js +9 -0
- package/dist/registry/PartialRegistry.d.ts +5 -2
- package/dist/registry/PartialRegistry.js +10 -1
- package/dist/registry/SynchronousRegistry.d.ts +11 -2
- package/dist/registry/SynchronousRegistry.js +16 -0
- package/dist/registry/warp-utils.d.ts +6 -0
- package/dist/registry/warp-utils.js +19 -2
- package/dist/types.d.ts +2 -1
- package/dist/warpRouteConfigs.js +68 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { ChainAddresses, ChainAddressesSchema } from './types.js';
|
|
|
9
9
|
export { isAbacusWorksChain } from './utils.js';
|
|
10
10
|
export { chainMetadata } from './chainMetadata.js';
|
|
11
11
|
export { chainAddresses } from './chainAddresses.js';
|
|
12
|
+
export { metadata as abstract } from './chains/abstract/metadata.js';
|
|
13
|
+
export { addresses as abstractAddresses } from './chains/abstract/addresses.js';
|
|
12
14
|
export { metadata as abstracttestnet } from './chains/abstracttestnet/metadata.js';
|
|
13
15
|
export { addresses as abstracttestnetAddresses } from './chains/abstracttestnet/addresses.js';
|
|
14
16
|
export { metadata as acala } from './chains/acala/metadata.js';
|
|
@@ -177,6 +179,8 @@ export { metadata as fusemainnet } from './chains/fusemainnet/metadata.js';
|
|
|
177
179
|
export { addresses as fusemainnetAddresses } from './chains/fusemainnet/addresses.js';
|
|
178
180
|
export { metadata as galadrieldevnet } from './chains/galadrieldevnet/metadata.js';
|
|
179
181
|
export { addresses as galadrieldevnetAddresses } from './chains/galadrieldevnet/addresses.js';
|
|
182
|
+
export { metadata as glue } from './chains/glue/metadata.js';
|
|
183
|
+
export { addresses as glueAddresses } from './chains/glue/addresses.js';
|
|
180
184
|
export { metadata as gnosis } from './chains/gnosis/metadata.js';
|
|
181
185
|
export { addresses as gnosisAddresses } from './chains/gnosis/addresses.js';
|
|
182
186
|
export { metadata as gnosischiadotestnet } from './chains/gnosischiadotestnet/metadata.js';
|
|
@@ -244,6 +248,8 @@ export { metadata as mantle } from './chains/mantle/metadata.js';
|
|
|
244
248
|
export { addresses as mantleAddresses } from './chains/mantle/addresses.js';
|
|
245
249
|
export { metadata as mantlesepolia } from './chains/mantlesepolia/metadata.js';
|
|
246
250
|
export { addresses as mantlesepoliaAddresses } from './chains/mantlesepolia/addresses.js';
|
|
251
|
+
export { metadata as matchain } from './chains/matchain/metadata.js';
|
|
252
|
+
export { addresses as matchainAddresses } from './chains/matchain/addresses.js';
|
|
247
253
|
export { metadata as merlin } from './chains/merlin/metadata.js';
|
|
248
254
|
export { addresses as merlinAddresses } from './chains/merlin/addresses.js';
|
|
249
255
|
export { metadata as metal } from './chains/metal/metadata.js';
|
|
@@ -366,6 +372,8 @@ export { metadata as sonic } from './chains/sonic/metadata.js';
|
|
|
366
372
|
export { addresses as sonicAddresses } from './chains/sonic/addresses.js';
|
|
367
373
|
export { metadata as sonicblaze } from './chains/sonicblaze/metadata.js';
|
|
368
374
|
export { addresses as sonicblazeAddresses } from './chains/sonicblaze/addresses.js';
|
|
375
|
+
export { metadata as sonicsvm } from './chains/sonicsvm/metadata.js';
|
|
376
|
+
export { addresses as sonicsvmAddresses } from './chains/sonicsvm/addresses.js';
|
|
369
377
|
export { metadata as sonicsvmtestnet } from './chains/sonicsvmtestnet/metadata.js';
|
|
370
378
|
export { addresses as sonicsvmtestnetAddresses } from './chains/sonicsvmtestnet/addresses.js';
|
|
371
379
|
export { metadata as sonictestnet } from './chains/sonictestnet/metadata.js';
|
|
@@ -419,6 +427,8 @@ export { metadata as unichain } from './chains/unichain/metadata.js';
|
|
|
419
427
|
export { addresses as unichainAddresses } from './chains/unichain/addresses.js';
|
|
420
428
|
export { metadata as unichaintestnet } from './chains/unichaintestnet/metadata.js';
|
|
421
429
|
export { addresses as unichaintestnetAddresses } from './chains/unichaintestnet/addresses.js';
|
|
430
|
+
export { metadata as unitzero } from './chains/unitzero/metadata.js';
|
|
431
|
+
export { addresses as unitzeroAddresses } from './chains/unitzero/addresses.js';
|
|
422
432
|
export { metadata as vana } from './chains/vana/metadata.js';
|
|
423
433
|
export { addresses as vanaAddresses } from './chains/vana/addresses.js';
|
|
424
434
|
export { metadata as viction } from './chains/viction/metadata.js';
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export { ChainAddressesSchema } from './types.js';
|
|
|
9
9
|
export { isAbacusWorksChain } from './utils.js';
|
|
10
10
|
export { chainMetadata } from './chainMetadata.js';
|
|
11
11
|
export { chainAddresses } from './chainAddresses.js';
|
|
12
|
+
export { metadata as abstract } from './chains/abstract/metadata.js';
|
|
13
|
+
export { addresses as abstractAddresses } from './chains/abstract/addresses.js';
|
|
12
14
|
export { metadata as abstracttestnet } from './chains/abstracttestnet/metadata.js';
|
|
13
15
|
export { addresses as abstracttestnetAddresses } from './chains/abstracttestnet/addresses.js';
|
|
14
16
|
export { metadata as acala } from './chains/acala/metadata.js';
|
|
@@ -177,6 +179,8 @@ export { metadata as fusemainnet } from './chains/fusemainnet/metadata.js';
|
|
|
177
179
|
export { addresses as fusemainnetAddresses } from './chains/fusemainnet/addresses.js';
|
|
178
180
|
export { metadata as galadrieldevnet } from './chains/galadrieldevnet/metadata.js';
|
|
179
181
|
export { addresses as galadrieldevnetAddresses } from './chains/galadrieldevnet/addresses.js';
|
|
182
|
+
export { metadata as glue } from './chains/glue/metadata.js';
|
|
183
|
+
export { addresses as glueAddresses } from './chains/glue/addresses.js';
|
|
180
184
|
export { metadata as gnosis } from './chains/gnosis/metadata.js';
|
|
181
185
|
export { addresses as gnosisAddresses } from './chains/gnosis/addresses.js';
|
|
182
186
|
export { metadata as gnosischiadotestnet } from './chains/gnosischiadotestnet/metadata.js';
|
|
@@ -244,6 +248,8 @@ export { metadata as mantle } from './chains/mantle/metadata.js';
|
|
|
244
248
|
export { addresses as mantleAddresses } from './chains/mantle/addresses.js';
|
|
245
249
|
export { metadata as mantlesepolia } from './chains/mantlesepolia/metadata.js';
|
|
246
250
|
export { addresses as mantlesepoliaAddresses } from './chains/mantlesepolia/addresses.js';
|
|
251
|
+
export { metadata as matchain } from './chains/matchain/metadata.js';
|
|
252
|
+
export { addresses as matchainAddresses } from './chains/matchain/addresses.js';
|
|
247
253
|
export { metadata as merlin } from './chains/merlin/metadata.js';
|
|
248
254
|
export { addresses as merlinAddresses } from './chains/merlin/addresses.js';
|
|
249
255
|
export { metadata as metal } from './chains/metal/metadata.js';
|
|
@@ -366,6 +372,8 @@ export { metadata as sonic } from './chains/sonic/metadata.js';
|
|
|
366
372
|
export { addresses as sonicAddresses } from './chains/sonic/addresses.js';
|
|
367
373
|
export { metadata as sonicblaze } from './chains/sonicblaze/metadata.js';
|
|
368
374
|
export { addresses as sonicblazeAddresses } from './chains/sonicblaze/addresses.js';
|
|
375
|
+
export { metadata as sonicsvm } from './chains/sonicsvm/metadata.js';
|
|
376
|
+
export { addresses as sonicsvmAddresses } from './chains/sonicsvm/addresses.js';
|
|
369
377
|
export { metadata as sonicsvmtestnet } from './chains/sonicsvmtestnet/metadata.js';
|
|
370
378
|
export { addresses as sonicsvmtestnetAddresses } from './chains/sonicsvmtestnet/addresses.js';
|
|
371
379
|
export { metadata as sonictestnet } from './chains/sonictestnet/metadata.js';
|
|
@@ -419,6 +427,8 @@ export { metadata as unichain } from './chains/unichain/metadata.js';
|
|
|
419
427
|
export { addresses as unichainAddresses } from './chains/unichain/addresses.js';
|
|
420
428
|
export { metadata as unichaintestnet } from './chains/unichaintestnet/metadata.js';
|
|
421
429
|
export { addresses as unichaintestnetAddresses } from './chains/unichaintestnet/addresses.js';
|
|
430
|
+
export { metadata as unitzero } from './chains/unitzero/metadata.js';
|
|
431
|
+
export { addresses as unitzeroAddresses } from './chains/unitzero/addresses.js';
|
|
422
432
|
export { metadata as vana } from './chains/vana/metadata.js';
|
|
423
433
|
export { addresses as vanaAddresses } from './chains/vana/addresses.js';
|
|
424
434
|
export { metadata as viction } from './chains/viction/metadata.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from 'pino';
|
|
2
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
-
import type { ChainAddresses, MaybePromise } from '../types.js';
|
|
2
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
+
import type { ChainAddresses, MaybePromise, WarpDeployConfigMap } from '../types.js';
|
|
4
4
|
import { WarpRouteConfigMap } from '../types.js';
|
|
5
5
|
import type { AddWarpRouteOptions, IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
|
|
6
6
|
export declare abstract class BaseRegistry implements IRegistry {
|
|
@@ -36,5 +36,7 @@ export declare abstract class BaseRegistry implements IRegistry {
|
|
|
36
36
|
abstract getWarpRoute(routeId: string): MaybePromise<WarpCoreConfig | null>;
|
|
37
37
|
abstract getWarpRoutes(filter?: WarpRouteFilterParams): MaybePromise<WarpRouteConfigMap>;
|
|
38
38
|
abstract addWarpRoute(config: WarpCoreConfig): MaybePromise<void>;
|
|
39
|
+
abstract getWarpDeployConfig(routeId: string): MaybePromise<WarpRouteDeployConfig | null>;
|
|
40
|
+
abstract getWarpDeployConfigs(filter?: WarpRouteFilterParams): MaybePromise<WarpDeployConfigMap>;
|
|
39
41
|
merge(otherRegistry: IRegistry): IRegistry;
|
|
40
42
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger } from 'pino';
|
|
2
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
3
3
|
import { ChainAddresses, WarpRouteId } from '../types.js';
|
|
4
4
|
import { RegistryType, UpdateChainParams, type AddWarpRouteOptions, type ChainFiles, type IRegistry, type RegistryContent } from './IRegistry.js';
|
|
5
5
|
import { SynchronousRegistry } from './SynchronousRegistry.js';
|
|
@@ -15,11 +15,15 @@ export declare class FileSystemRegistry extends SynchronousRegistry implements I
|
|
|
15
15
|
readonly type = RegistryType.FileSystem;
|
|
16
16
|
constructor(options: FileSystemRegistryOptions);
|
|
17
17
|
getUri(itemPath?: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves filepaths for chains, warp core, and warp deploy configs
|
|
20
|
+
*/
|
|
18
21
|
listRegistryContent(): RegistryContent;
|
|
19
22
|
getMetadata(): ChainMap<ChainMetadata>;
|
|
20
23
|
getAddresses(): ChainMap<ChainAddresses>;
|
|
21
24
|
removeChain(chainName: ChainName): void;
|
|
22
25
|
addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void;
|
|
26
|
+
addWarpRouteConfig(warpConfig: WarpRouteDeployConfig, fileName: string): void;
|
|
23
27
|
protected listFiles(dirPath: string): string[];
|
|
24
28
|
protected createOrUpdateChain(chain: UpdateChainParams): void;
|
|
25
29
|
protected createChainFile(chainName: ChainName, fileName: keyof ChainFiles, data: any, cache: ChainMap<any>, prefix?: string): void;
|
|
@@ -29,4 +33,12 @@ export declare class FileSystemRegistry extends SynchronousRegistry implements I
|
|
|
29
33
|
}): void;
|
|
30
34
|
protected removeFiles(filePaths: string[]): void;
|
|
31
35
|
protected getWarpRoutesForIds(ids: WarpRouteId[]): WarpCoreConfig[];
|
|
36
|
+
protected getWarpDeployConfigForIds(ids: WarpRouteId[]): WarpRouteDeployConfig[];
|
|
37
|
+
/**
|
|
38
|
+
* Reads config files for the given WarpRouteIds.
|
|
39
|
+
* @param ids - The WarpRouteIds to read configs for.
|
|
40
|
+
* @param configURIs - A mapping of WarpRouteIds to file paths where the configs are stored.
|
|
41
|
+
* @returns An array of config objects.
|
|
42
|
+
*/
|
|
43
|
+
protected readConfigsForIds<Config>(ids: WarpRouteId[], configURIs: Record<WarpRouteId, string>): Config[];
|
|
32
44
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { parse as yamlParse } from 'yaml';
|
|
4
|
-
import { CHAIN_FILE_REGEX, SCHEMA_REF, WARP_ROUTE_CONFIG_FILE_REGEX } from '../consts.js';
|
|
4
|
+
import { CHAIN_FILE_REGEX, SCHEMA_REF, WARP_ROUTE_CONFIG_FILE_REGEX, WARP_ROUTE_DEPLOY_FILE_REGEX, } from '../consts.js';
|
|
5
5
|
import { ChainAddressesSchema } from '../types.js';
|
|
6
6
|
import { toYamlString } from '../utils.js';
|
|
7
7
|
import { RegistryType, } from './IRegistry.js';
|
|
8
8
|
import { SynchronousRegistry } from './SynchronousRegistry.js';
|
|
9
|
-
import { warpConfigToWarpAddresses, warpRouteConfigPathToId } from './warp-utils.js';
|
|
9
|
+
import { warpConfigToWarpAddresses, warpRouteConfigPathToId, warpRouteDeployConfigPathToId } from './warp-utils.js';
|
|
10
10
|
/**
|
|
11
11
|
* A registry that uses a local file system path as its data source.
|
|
12
12
|
* Requires file system access so it cannot be used in the browser.
|
|
@@ -21,6 +21,9 @@ export class FileSystemRegistry extends SynchronousRegistry {
|
|
|
21
21
|
return super.getUri();
|
|
22
22
|
return path.join(this.uri, itemPath);
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves filepaths for chains, warp core, and warp deploy configs
|
|
26
|
+
*/
|
|
24
27
|
listRegistryContent() {
|
|
25
28
|
if (this.listContentCache)
|
|
26
29
|
return this.listContentCache;
|
|
@@ -43,7 +46,15 @@ export class FileSystemRegistry extends SynchronousRegistry {
|
|
|
43
46
|
const routeId = warpRouteConfigPathToId(filePath);
|
|
44
47
|
warpRoutes[routeId] = filePath;
|
|
45
48
|
}
|
|
46
|
-
|
|
49
|
+
const warpDeployConfig = {};
|
|
50
|
+
const warpDeployFiles = this.listFiles(path.join(this.uri, this.getWarpRoutesPath()));
|
|
51
|
+
for (const filePath of warpDeployFiles) {
|
|
52
|
+
if (!WARP_ROUTE_DEPLOY_FILE_REGEX.test(filePath))
|
|
53
|
+
continue;
|
|
54
|
+
const routeId = warpRouteDeployConfigPathToId(filePath);
|
|
55
|
+
warpDeployConfig[routeId] = filePath;
|
|
56
|
+
}
|
|
57
|
+
return (this.listContentCache = { chains, deployments: { warpRoutes, warpDeployConfig } });
|
|
47
58
|
}
|
|
48
59
|
getMetadata() {
|
|
49
60
|
if (this.metadataCache)
|
|
@@ -84,6 +95,10 @@ export class FileSystemRegistry extends SynchronousRegistry {
|
|
|
84
95
|
const addresses = warpConfigToWarpAddresses(config);
|
|
85
96
|
this.createFile({ filePath: addressesPath, data: toYamlString(addresses) });
|
|
86
97
|
}
|
|
98
|
+
addWarpRouteConfig(warpConfig, fileName) {
|
|
99
|
+
const filePath = path.join(this.uri, this.getWarpRoutesPath(), fileName);
|
|
100
|
+
this.createFile({ filePath, data: toYamlString(warpConfig) });
|
|
101
|
+
}
|
|
87
102
|
listFiles(dirPath) {
|
|
88
103
|
if (!fs.existsSync(dirPath))
|
|
89
104
|
return [];
|
|
@@ -134,9 +149,22 @@ export class FileSystemRegistry extends SynchronousRegistry {
|
|
|
134
149
|
}
|
|
135
150
|
}
|
|
136
151
|
getWarpRoutesForIds(ids) {
|
|
137
|
-
const configs = [];
|
|
138
152
|
const warpRoutes = this.listRegistryContent().deployments.warpRoutes;
|
|
139
|
-
|
|
153
|
+
return this.readConfigsForIds(ids, warpRoutes);
|
|
154
|
+
}
|
|
155
|
+
getWarpDeployConfigForIds(ids) {
|
|
156
|
+
const warpDeployConfig = this.listRegistryContent().deployments.warpDeployConfig;
|
|
157
|
+
return this.readConfigsForIds(ids, warpDeployConfig);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Reads config files for the given WarpRouteIds.
|
|
161
|
+
* @param ids - The WarpRouteIds to read configs for.
|
|
162
|
+
* @param configURIs - A mapping of WarpRouteIds to file paths where the configs are stored.
|
|
163
|
+
* @returns An array of config objects.
|
|
164
|
+
*/
|
|
165
|
+
readConfigsForIds(ids, configURIs) {
|
|
166
|
+
const configs = [];
|
|
167
|
+
for (const [id, filePath] of Object.entries(configURIs)) {
|
|
140
168
|
if (!ids.includes(id))
|
|
141
169
|
continue;
|
|
142
170
|
const data = fs.readFileSync(filePath, 'utf8');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from 'pino';
|
|
2
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
-
import { ChainAddresses, WarpRouteConfigMap } from '../types.js';
|
|
2
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
+
import { ChainAddresses, WarpDeployConfigMap, WarpRouteConfigMap } from '../types.js';
|
|
4
4
|
import { BaseRegistry } from './BaseRegistry.js';
|
|
5
5
|
import { ChainFiles, IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
|
|
6
6
|
export interface GithubRegistryOptions {
|
|
@@ -45,7 +45,10 @@ export declare class GithubRegistry extends BaseRegistry implements IRegistry {
|
|
|
45
45
|
updateChain(_chains: UpdateChainParams): Promise<void>;
|
|
46
46
|
removeChain(_chains: ChainName): Promise<void>;
|
|
47
47
|
getWarpRoute(routeId: string): Promise<WarpCoreConfig | null>;
|
|
48
|
+
getWarpDeployConfig(routeId: string): Promise<WarpRouteDeployConfig | null>;
|
|
48
49
|
getWarpRoutes(filter?: WarpRouteFilterParams): Promise<WarpRouteConfigMap>;
|
|
50
|
+
getWarpDeployConfigs(filter?: WarpRouteFilterParams): Promise<WarpDeployConfigMap>;
|
|
51
|
+
protected readConfigs<ConfigMap>(routeIds: string[], routeConfigUrls: string[]): Promise<Record<string, ConfigMap>>;
|
|
49
52
|
addWarpRoute(_config: WarpCoreConfig): Promise<void>;
|
|
50
53
|
getApiUrl(): Promise<string>;
|
|
51
54
|
getApiRateLimit(): Promise<GithubRateResponse['resources']['core']>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parse as yamlParse } from 'yaml';
|
|
2
|
-
import { CHAIN_FILE_REGEX, DEFAULT_GITHUB_REGISTRY, GITHUB_FETCH_CONCURRENCY_LIMIT, WARP_ROUTE_CONFIG_FILE_REGEX, } from '../consts.js';
|
|
2
|
+
import { CHAIN_FILE_REGEX, DEFAULT_GITHUB_REGISTRY, GITHUB_FETCH_CONCURRENCY_LIMIT, WARP_ROUTE_CONFIG_FILE_REGEX, WARP_ROUTE_DEPLOY_FILE_REGEX, } from '../consts.js';
|
|
3
3
|
import { concurrentMap, stripLeadingSlash } from '../utils.js';
|
|
4
4
|
import { BaseRegistry } from './BaseRegistry.js';
|
|
5
5
|
import { RegistryType, } from './IRegistry.js';
|
|
6
|
-
import { filterWarpRoutesIds, warpRouteConfigPathToId } from './warp-utils.js';
|
|
6
|
+
import { filterWarpRoutesIds, warpRouteConfigPathToId, warpRouteDeployConfigPathToId } from './warp-utils.js';
|
|
7
7
|
export const GITHUB_API_URL = 'https://api.github.com';
|
|
8
8
|
/**
|
|
9
9
|
* A registry that uses a github repository as its data source.
|
|
@@ -45,6 +45,7 @@ export class GithubRegistry extends BaseRegistry {
|
|
|
45
45
|
const chainPath = this.getChainsPath();
|
|
46
46
|
const chains = {};
|
|
47
47
|
const warpRoutes = {};
|
|
48
|
+
const warpDeployConfig = {};
|
|
48
49
|
for (const node of tree) {
|
|
49
50
|
if (CHAIN_FILE_REGEX.test(node.path)) {
|
|
50
51
|
const [_, chainName, fileName, extension] = node.path.match(CHAIN_FILE_REGEX);
|
|
@@ -56,8 +57,12 @@ export class GithubRegistry extends BaseRegistry {
|
|
|
56
57
|
const routeId = warpRouteConfigPathToId(node.path);
|
|
57
58
|
warpRoutes[routeId] = this.getRawContentUrl(node.path);
|
|
58
59
|
}
|
|
60
|
+
if (WARP_ROUTE_DEPLOY_FILE_REGEX.test(node.path)) {
|
|
61
|
+
const routeId = warpRouteDeployConfigPathToId(node.path);
|
|
62
|
+
warpDeployConfig[routeId] = this.getRawContentUrl(node.path);
|
|
63
|
+
}
|
|
59
64
|
}
|
|
60
|
-
return (this.listContentCache = { chains, deployments: { warpRoutes } });
|
|
65
|
+
return (this.listContentCache = { chains, deployments: { warpRoutes, warpDeployConfig } });
|
|
61
66
|
}
|
|
62
67
|
async getChains() {
|
|
63
68
|
const repoContents = await this.listRegistryContent();
|
|
@@ -113,9 +118,24 @@ export class GithubRegistry extends BaseRegistry {
|
|
|
113
118
|
return null;
|
|
114
119
|
return this.fetchYamlFile(routeConfigUrl);
|
|
115
120
|
}
|
|
121
|
+
async getWarpDeployConfig(routeId) {
|
|
122
|
+
const repoContents = await this.listRegistryContent();
|
|
123
|
+
const routeConfigUrl = repoContents.deployments.warpDeployConfig[routeId];
|
|
124
|
+
if (!routeConfigUrl)
|
|
125
|
+
return null;
|
|
126
|
+
return this.fetchYamlFile(routeConfigUrl);
|
|
127
|
+
}
|
|
116
128
|
async getWarpRoutes(filter) {
|
|
117
|
-
const warpRoutes = (await this.listRegistryContent()).deployments
|
|
129
|
+
const { warpRoutes } = (await this.listRegistryContent()).deployments;
|
|
118
130
|
const { ids: routeIds, values: routeConfigUrls } = filterWarpRoutesIds(warpRoutes, filter);
|
|
131
|
+
return this.readConfigs(routeIds, routeConfigUrls);
|
|
132
|
+
}
|
|
133
|
+
async getWarpDeployConfigs(filter) {
|
|
134
|
+
const { warpDeployConfig } = (await this.listRegistryContent()).deployments;
|
|
135
|
+
const { ids: routeIds, values: routeConfigUrls } = filterWarpRoutesIds(warpDeployConfig, filter);
|
|
136
|
+
return this.readConfigs(routeIds, routeConfigUrls);
|
|
137
|
+
}
|
|
138
|
+
async readConfigs(routeIds, routeConfigUrls) {
|
|
119
139
|
const configs = await this.fetchYamlFiles(routeConfigUrls);
|
|
120
140
|
const idsWithConfigs = routeIds.map((id, i) => [id, configs[i]]);
|
|
121
141
|
return Object.fromEntries(idsWithConfigs);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
-
import { ChainAddresses, MaybePromise, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
1
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { ChainAddresses, MaybePromise, WarpDeployConfigMap, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
3
3
|
export interface ChainFiles {
|
|
4
4
|
metadata?: string;
|
|
5
5
|
addresses?: string;
|
|
@@ -9,6 +9,7 @@ export interface RegistryContent {
|
|
|
9
9
|
chains: ChainMap<ChainFiles>;
|
|
10
10
|
deployments: {
|
|
11
11
|
warpRoutes: Record<WarpRouteId, string>;
|
|
12
|
+
warpDeployConfig: Record<WarpRouteId, string>;
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
export interface UpdateChainParams {
|
|
@@ -46,5 +47,7 @@ export interface IRegistry {
|
|
|
46
47
|
getWarpRoute(routeId: string): MaybePromise<WarpCoreConfig | null>;
|
|
47
48
|
getWarpRoutes(filter?: WarpRouteFilterParams): MaybePromise<WarpRouteConfigMap>;
|
|
48
49
|
addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): MaybePromise<void>;
|
|
50
|
+
getWarpDeployConfig(routeId: string): MaybePromise<WarpRouteDeployConfig | null>;
|
|
51
|
+
getWarpDeployConfigs(filter?: WarpRouteFilterParams): MaybePromise<WarpDeployConfigMap>;
|
|
49
52
|
merge(otherRegistry: IRegistry): IRegistry;
|
|
50
53
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Logger } from 'pino';
|
|
2
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
-
import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
2
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
3
|
+
import { ChainAddresses, WarpDeployConfigMap, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
4
4
|
import { AddWarpRouteOptions, IRegistry, RegistryContent, RegistryType, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
|
|
5
5
|
export interface MergedRegistryOptions {
|
|
6
6
|
registries: Array<IRegistry>;
|
|
@@ -30,7 +30,9 @@ export declare class MergedRegistry implements IRegistry {
|
|
|
30
30
|
updateChain(chain: UpdateChainParams): Promise<void>;
|
|
31
31
|
removeChain(chain: ChainName): Promise<void>;
|
|
32
32
|
getWarpRoute(id: WarpRouteId): Promise<WarpCoreConfig | null>;
|
|
33
|
+
getWarpDeployConfig(id: WarpRouteId): Promise<WarpRouteDeployConfig | null>;
|
|
33
34
|
getWarpRoutes(filter?: WarpRouteFilterParams): Promise<WarpRouteConfigMap>;
|
|
35
|
+
getWarpDeployConfigs(filter?: WarpRouteFilterParams): Promise<WarpDeployConfigMap>;
|
|
34
36
|
addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): Promise<void>;
|
|
35
37
|
protected multiRegistryRead<R>(readFn: (registry: IRegistry) => Promise<R> | R): Promise<(Awaited<R> | Awaited<R>)[]>;
|
|
36
38
|
protected multiRegistryWrite(writeFn: (registry: IRegistry) => Promise<void>, logMsg: string): Promise<void>;
|
|
@@ -27,6 +27,7 @@ export class MergedRegistry {
|
|
|
27
27
|
chains: {},
|
|
28
28
|
deployments: {
|
|
29
29
|
warpRoutes: {},
|
|
30
|
+
warpDeployConfig: {}
|
|
30
31
|
},
|
|
31
32
|
});
|
|
32
33
|
}
|
|
@@ -64,10 +65,18 @@ export class MergedRegistry {
|
|
|
64
65
|
const results = await this.multiRegistryRead((r) => r.getWarpRoute(id));
|
|
65
66
|
return results.find((r) => !!r) || null;
|
|
66
67
|
}
|
|
68
|
+
async getWarpDeployConfig(id) {
|
|
69
|
+
const results = await this.multiRegistryRead((r) => r.getWarpDeployConfig(id));
|
|
70
|
+
return results.find((r) => !!r) || null;
|
|
71
|
+
}
|
|
67
72
|
async getWarpRoutes(filter) {
|
|
68
73
|
const results = await this.multiRegistryRead((r) => r.getWarpRoutes(filter));
|
|
69
74
|
return results.reduce((acc, content) => objMerge(acc, content), {});
|
|
70
75
|
}
|
|
76
|
+
async getWarpDeployConfigs(filter) {
|
|
77
|
+
const results = await this.multiRegistryRead((r) => r.getWarpDeployConfigs(filter));
|
|
78
|
+
return results.reduce((acc, content) => objMerge(acc, content), {});
|
|
79
|
+
}
|
|
71
80
|
async addWarpRoute(config, options) {
|
|
72
81
|
return this.multiRegistryWrite(async (registry) => await registry.addWarpRoute(config, options), 'adding warp route');
|
|
73
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Logger } from 'pino';
|
|
2
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
3
3
|
import { ChainAddresses, DeepPartial, WarpRouteId } from '../types.js';
|
|
4
4
|
import { IRegistry, RegistryContent, RegistryType } from './IRegistry.js';
|
|
5
5
|
import { SynchronousRegistry } from './SynchronousRegistry.js';
|
|
@@ -11,6 +11,7 @@ export interface PartialRegistryOptions {
|
|
|
11
11
|
chainMetadata?: ChainMap<DeepPartial<ChainMetadata>>;
|
|
12
12
|
chainAddresses?: ChainMap<DeepPartial<ChainAddresses>>;
|
|
13
13
|
warpRoutes?: Array<DeepPartial<WarpCoreConfig>>;
|
|
14
|
+
warpDeployConfigs?: Array<DeepPartial<WarpRouteDeployConfig>>;
|
|
14
15
|
logger?: Logger;
|
|
15
16
|
}
|
|
16
17
|
export declare class PartialRegistry extends SynchronousRegistry implements IRegistry {
|
|
@@ -18,13 +19,15 @@ export declare class PartialRegistry extends SynchronousRegistry implements IReg
|
|
|
18
19
|
chainMetadata: ChainMap<DeepPartial<ChainMetadata>>;
|
|
19
20
|
chainAddresses: ChainMap<DeepPartial<ChainAddresses>>;
|
|
20
21
|
warpRoutes: Array<DeepPartial<WarpCoreConfig>>;
|
|
21
|
-
|
|
22
|
+
warpDeployConfigs: Array<DeepPartial<WarpRouteDeployConfig>>;
|
|
23
|
+
constructor({ chainMetadata, chainAddresses, warpRoutes, warpDeployConfigs, logger }: PartialRegistryOptions);
|
|
22
24
|
listRegistryContent(): RegistryContent;
|
|
23
25
|
getMetadata(): ChainMap<ChainMetadata>;
|
|
24
26
|
getAddresses(): ChainMap<ChainAddresses>;
|
|
25
27
|
removeChain(chainName: ChainName): void;
|
|
26
28
|
addWarpRoute(_config: WarpCoreConfig): void;
|
|
27
29
|
protected getWarpRoutesForIds(ids: WarpRouteId[]): WarpCoreConfig[];
|
|
30
|
+
protected getWarpDeployConfigForIds(_ids: WarpRouteId[]): WarpRouteDeployConfig[];
|
|
28
31
|
protected createOrUpdateChain(chain: {
|
|
29
32
|
chainName: ChainName;
|
|
30
33
|
metadata?: ChainMetadata;
|
|
@@ -7,11 +7,13 @@ export class PartialRegistry extends SynchronousRegistry {
|
|
|
7
7
|
chainMetadata;
|
|
8
8
|
chainAddresses;
|
|
9
9
|
warpRoutes;
|
|
10
|
-
|
|
10
|
+
warpDeployConfigs;
|
|
11
|
+
constructor({ chainMetadata, chainAddresses, warpRoutes, warpDeployConfigs, logger }) {
|
|
11
12
|
super({ uri: PARTIAL_URI_PLACEHOLDER, logger });
|
|
12
13
|
this.chainMetadata = chainMetadata || {};
|
|
13
14
|
this.chainAddresses = chainAddresses || {};
|
|
14
15
|
this.warpRoutes = warpRoutes || [];
|
|
16
|
+
this.warpDeployConfigs = warpDeployConfigs || [];
|
|
15
17
|
}
|
|
16
18
|
listRegistryContent() {
|
|
17
19
|
const chains = {};
|
|
@@ -33,6 +35,7 @@ export class PartialRegistry extends SynchronousRegistry {
|
|
|
33
35
|
chains,
|
|
34
36
|
deployments: {
|
|
35
37
|
warpRoutes,
|
|
38
|
+
warpDeployConfig: {} // TODO: This cannot be implemented without deriving the token symbol from config.token
|
|
36
39
|
},
|
|
37
40
|
};
|
|
38
41
|
}
|
|
@@ -58,6 +61,12 @@ export class PartialRegistry extends SynchronousRegistry {
|
|
|
58
61
|
return ids.includes(id);
|
|
59
62
|
});
|
|
60
63
|
}
|
|
64
|
+
getWarpDeployConfigForIds(_ids) {
|
|
65
|
+
// TODO: Right now this returns an empty array
|
|
66
|
+
// This cannot be implemented without deriving the token symbol from config.token
|
|
67
|
+
// We will revisit once we merge the configs
|
|
68
|
+
return this.warpDeployConfigs;
|
|
69
|
+
}
|
|
61
70
|
createOrUpdateChain(chain) {
|
|
62
71
|
if (chain.metadata)
|
|
63
72
|
this.chainMetadata[chain.chainName] = chain.metadata;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
-
import { ChainAddresses, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
1
|
+
import type { ChainMap, ChainMetadata, ChainName, WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { ChainAddresses, WarpDeployConfigMap, WarpRouteConfigMap, WarpRouteId } from '../types.js';
|
|
3
3
|
import { BaseRegistry } from './BaseRegistry.js';
|
|
4
4
|
import { AddWarpRouteOptions, IRegistry, RegistryContent, UpdateChainParams, WarpRouteFilterParams } from './IRegistry.js';
|
|
5
5
|
/**
|
|
@@ -18,8 +18,17 @@ export declare abstract class SynchronousRegistry extends BaseRegistry implement
|
|
|
18
18
|
updateChain(chain: UpdateChainParams): void;
|
|
19
19
|
removeChain(chainName: ChainName): void;
|
|
20
20
|
getWarpRoute(routeId: string): WarpCoreConfig | null;
|
|
21
|
+
getWarpDeployConfig(routeId: string): WarpRouteDeployConfig | null;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves a filtered map of the warp routes configs
|
|
24
|
+
*/
|
|
21
25
|
getWarpRoutes(filter?: WarpRouteFilterParams): WarpRouteConfigMap;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a map of all the warp routes deployment configs
|
|
28
|
+
*/
|
|
29
|
+
getWarpDeployConfigs(filter?: WarpRouteFilterParams): WarpDeployConfigMap;
|
|
22
30
|
abstract addWarpRoute(config: WarpCoreConfig, options?: AddWarpRouteOptions): void;
|
|
23
31
|
protected abstract createOrUpdateChain(chain: UpdateChainParams): void;
|
|
24
32
|
protected abstract getWarpRoutesForIds(ids: WarpRouteId[]): WarpCoreConfig[];
|
|
33
|
+
protected abstract getWarpDeployConfigForIds(ids: WarpRouteId[]): WarpRouteDeployConfig[];
|
|
25
34
|
}
|
|
@@ -42,6 +42,12 @@ export class SynchronousRegistry extends BaseRegistry {
|
|
|
42
42
|
getWarpRoute(routeId) {
|
|
43
43
|
return this.getWarpRoutesForIds([routeId])[0] || null;
|
|
44
44
|
}
|
|
45
|
+
getWarpDeployConfig(routeId) {
|
|
46
|
+
return this.getWarpDeployConfigForIds([routeId])[0] || null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves a filtered map of the warp routes configs
|
|
50
|
+
*/
|
|
45
51
|
getWarpRoutes(filter) {
|
|
46
52
|
const warpRoutes = this.listRegistryContent().deployments.warpRoutes;
|
|
47
53
|
const { ids: routeIds } = filterWarpRoutesIds(warpRoutes, filter);
|
|
@@ -49,4 +55,14 @@ export class SynchronousRegistry extends BaseRegistry {
|
|
|
49
55
|
const idsWithConfigs = routeIds.map((id, i) => [id, configs[i]]);
|
|
50
56
|
return Object.fromEntries(idsWithConfigs);
|
|
51
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieves a map of all the warp routes deployment configs
|
|
60
|
+
*/
|
|
61
|
+
getWarpDeployConfigs(filter) {
|
|
62
|
+
const warpDeployConfig = this.listRegistryContent().deployments.warpDeployConfig;
|
|
63
|
+
const { ids: routeIds } = filterWarpRoutesIds(warpDeployConfig, filter);
|
|
64
|
+
const configs = this.getWarpDeployConfigForIds(routeIds);
|
|
65
|
+
const idsWithConfigs = routeIds.map((id, i) => [id, configs[i]]);
|
|
66
|
+
return Object.fromEntries(idsWithConfigs);
|
|
67
|
+
}
|
|
52
68
|
}
|
|
@@ -11,6 +11,12 @@ export declare function warpConfigToWarpAddresses(config: WarpCoreConfig): Chain
|
|
|
11
11
|
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
|
|
12
12
|
*/
|
|
13
13
|
export declare function warpRouteConfigPathToId(configRelativePath: string): WarpRouteId;
|
|
14
|
+
/**
|
|
15
|
+
* Gets a warp route ID from a warp deploy config path.
|
|
16
|
+
* @param configRelativePath A relative path in the deployments dir
|
|
17
|
+
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
|
|
18
|
+
*/
|
|
19
|
+
export declare function warpRouteDeployConfigPathToId(configRelativePath: string): WarpRouteId;
|
|
14
20
|
/**
|
|
15
21
|
* Gets a warp route ID from a warp route config.
|
|
16
22
|
* This uses the first symbol in the lift. Situations where a config contains multiple
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WARP_ROUTE_CONFIG_FILE_REGEX } from '../consts.js';
|
|
1
|
+
import { WARP_ROUTE_CONFIG_FILE_REGEX, WARP_ROUTE_DEPLOY_FILE_REGEX } from '../consts.js';
|
|
2
2
|
/**
|
|
3
3
|
* Converts from a full warp config to a map of chain addresses.
|
|
4
4
|
*/
|
|
@@ -34,7 +34,24 @@ function getWarpAddressKey(standard) {
|
|
|
34
34
|
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
|
|
35
35
|
*/
|
|
36
36
|
export function warpRouteConfigPathToId(configRelativePath) {
|
|
37
|
-
|
|
37
|
+
return parseWarpRouteConfigPath(configRelativePath, WARP_ROUTE_CONFIG_FILE_REGEX);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Gets a warp route ID from a warp deploy config path.
|
|
41
|
+
* @param configRelativePath A relative path in the deployments dir
|
|
42
|
+
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
|
|
43
|
+
*/
|
|
44
|
+
export function warpRouteDeployConfigPathToId(configRelativePath) {
|
|
45
|
+
return parseWarpRouteConfigPath(configRelativePath, WARP_ROUTE_DEPLOY_FILE_REGEX);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Gets a warp route ID from a warp route config path.
|
|
49
|
+
* @param configRelativePath A relative path in the deployments dir
|
|
50
|
+
* (e.g. `warp_routes/USDC/ethereum-arbitrum-config.yaml`)
|
|
51
|
+
* @param regex regex of the config filename
|
|
52
|
+
*/
|
|
53
|
+
function parseWarpRouteConfigPath(configRelativePath, regex) {
|
|
54
|
+
const matches = configRelativePath.match(regex);
|
|
38
55
|
if (!matches || matches.length < 3)
|
|
39
56
|
throw new Error(`Invalid warp route config path: ${configRelativePath}`);
|
|
40
57
|
const [_, tokenSymbol, chains] = matches;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { WarpCoreConfig } from '@hyperlane-xyz/sdk';
|
|
1
|
+
import type { WarpCoreConfig, WarpRouteDeployConfig } from '@hyperlane-xyz/sdk';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
export type MaybePromise<T> = T | Promise<T> | PromiseLike<T>;
|
|
4
4
|
export declare const ChainAddressesSchema: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
5
|
export type ChainAddresses = z.infer<typeof ChainAddressesSchema>;
|
|
6
6
|
export type WarpRouteId = string;
|
|
7
7
|
export type WarpRouteConfigMap = Record<WarpRouteId, WarpCoreConfig>;
|
|
8
|
+
export type WarpDeployConfigMap = Record<WarpRouteId, WarpRouteDeployConfig>;
|
|
8
9
|
export type DeepPartial<T> = T extends object ? {
|
|
9
10
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
10
11
|
} : T;
|
package/dist/warpRouteConfigs.js
CHANGED
|
@@ -2666,6 +2666,41 @@ export const warpRouteConfigs = {
|
|
|
2666
2666
|
}
|
|
2667
2667
|
]
|
|
2668
2668
|
},
|
|
2669
|
+
"LOGX/arbitrum-solanamainnet": {
|
|
2670
|
+
"tokens": [
|
|
2671
|
+
{
|
|
2672
|
+
"addressOrDenom": "0x79EdA6DAfB2B9531930CbD9240A73B5eF0e8c9E2",
|
|
2673
|
+
"chainName": "arbitrum",
|
|
2674
|
+
"coinGeckoId": "logx",
|
|
2675
|
+
"collateralAddressOrDenom": "0x59062301Fb510F4ea2417B67404CB16D31E604BA",
|
|
2676
|
+
"connections": [
|
|
2677
|
+
{
|
|
2678
|
+
"token": "sealevel|solanamainnet|975wpF9KmWTVnh398Qs6VcnDtYZsXVWtKiSkXfWH22GP"
|
|
2679
|
+
}
|
|
2680
|
+
],
|
|
2681
|
+
"decimals": 18,
|
|
2682
|
+
"logoURI": "/deployments/warp_routes/LOGX/logo.png",
|
|
2683
|
+
"name": "LogX Network",
|
|
2684
|
+
"standard": "EvmHypCollateral",
|
|
2685
|
+
"symbol": "LOGX"
|
|
2686
|
+
},
|
|
2687
|
+
{
|
|
2688
|
+
"addressOrDenom": "975wpF9KmWTVnh398Qs6VcnDtYZsXVWtKiSkXfWH22GP",
|
|
2689
|
+
"chainName": "solanamainnet",
|
|
2690
|
+
"collateralAddressOrDenom": "7cHJTPkhnCKesVFijmMXVFVY4HjpkLd9qYjg6neb74yD",
|
|
2691
|
+
"connections": [
|
|
2692
|
+
{
|
|
2693
|
+
"token": "ethereum|arbitrum|0x79EdA6DAfB2B9531930CbD9240A73B5eF0e8c9E2"
|
|
2694
|
+
}
|
|
2695
|
+
],
|
|
2696
|
+
"decimals": 9,
|
|
2697
|
+
"logoURI": "/deployments/warp_routes/LOGX/logo.png",
|
|
2698
|
+
"name": "LogX Network",
|
|
2699
|
+
"standard": "SealevelHypSynthetic",
|
|
2700
|
+
"symbol": "LOGX"
|
|
2701
|
+
}
|
|
2702
|
+
]
|
|
2703
|
+
},
|
|
2669
2704
|
"LUMIA/bsc-ethereum-lumia": {
|
|
2670
2705
|
"tokens": [
|
|
2671
2706
|
{
|
|
@@ -3303,6 +3338,39 @@ export const warpRouteConfigs = {
|
|
|
3303
3338
|
}
|
|
3304
3339
|
]
|
|
3305
3340
|
},
|
|
3341
|
+
"SOL/solanamainnet-sonicsvm": {
|
|
3342
|
+
"tokens": [
|
|
3343
|
+
{
|
|
3344
|
+
"addressOrDenom": "7KD647mgysBeEt6PSrv2XYktkSNLzear124oaMENp8SY",
|
|
3345
|
+
"chainName": "sonicsvm",
|
|
3346
|
+
"connections": [
|
|
3347
|
+
{
|
|
3348
|
+
"token": "sealevel|solanamainnet|BXKDfnNkgUNVT5uCfk36sv2GDtK6RwAt9SLbGiKzZkih"
|
|
3349
|
+
}
|
|
3350
|
+
],
|
|
3351
|
+
"decimals": 9,
|
|
3352
|
+
"logoURI": "/deployments/warp_routes/SOL/logo.svg",
|
|
3353
|
+
"name": "Solana",
|
|
3354
|
+
"standard": "SealevelHypNative",
|
|
3355
|
+
"symbol": "SOL"
|
|
3356
|
+
},
|
|
3357
|
+
{
|
|
3358
|
+
"addressOrDenom": "BXKDfnNkgUNVT5uCfk36sv2GDtK6RwAt9SLbGiKzZkih",
|
|
3359
|
+
"chainName": "solanamainnet",
|
|
3360
|
+
"coinGeckoId": "solana",
|
|
3361
|
+
"connections": [
|
|
3362
|
+
{
|
|
3363
|
+
"token": "sealevel|sonicsvm|7KD647mgysBeEt6PSrv2XYktkSNLzear124oaMENp8SY"
|
|
3364
|
+
}
|
|
3365
|
+
],
|
|
3366
|
+
"decimals": 9,
|
|
3367
|
+
"logoURI": "/deployments/warp_routes/SOL/logo.svg",
|
|
3368
|
+
"name": "Solana",
|
|
3369
|
+
"standard": "SealevelHypNative",
|
|
3370
|
+
"symbol": "SOL"
|
|
3371
|
+
}
|
|
3372
|
+
]
|
|
3373
|
+
},
|
|
3306
3374
|
"SOL/solanamainnet-soon": {
|
|
3307
3375
|
"tokens": [
|
|
3308
3376
|
{
|