@hyperlane-xyz/deploy-sdk 1.4.0 → 2.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.
Files changed (44) hide show
  1. package/dist/AltVMCoreModule.d.ts.map +1 -1
  2. package/dist/AltVMCoreModule.js +1 -2
  3. package/dist/AltVMCoreModule.js.map +1 -1
  4. package/dist/index.d.ts +2 -5
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -5
  7. package/dist/index.js.map +1 -1
  8. package/dist/warp/warp-reader.d.ts +51 -0
  9. package/dist/warp/warp-reader.d.ts.map +1 -0
  10. package/dist/warp/warp-reader.js +106 -0
  11. package/dist/warp/warp-reader.js.map +1 -0
  12. package/dist/warp/warp-writer.d.ts +66 -0
  13. package/dist/warp/warp-writer.d.ts.map +1 -0
  14. package/dist/warp/warp-writer.js +231 -0
  15. package/dist/warp/warp-writer.js.map +1 -0
  16. package/dist/warp/warp-writer.test.d.ts +2 -0
  17. package/dist/warp/warp-writer.test.d.ts.map +1 -0
  18. package/dist/warp/warp-writer.test.js +903 -0
  19. package/dist/warp/warp-writer.test.js.map +1 -0
  20. package/package.json +9 -9
  21. package/dist/AltVMWarpDeployer.d.ts +0 -14
  22. package/dist/AltVMWarpDeployer.d.ts.map +0 -1
  23. package/dist/AltVMWarpDeployer.js +0 -69
  24. package/dist/AltVMWarpDeployer.js.map +0 -1
  25. package/dist/AltVMWarpModule.d.ts +0 -96
  26. package/dist/AltVMWarpModule.d.ts.map +0 -1
  27. package/dist/AltVMWarpModule.js +0 -416
  28. package/dist/AltVMWarpModule.js.map +0 -1
  29. package/dist/AltVMWarpModule.test.d.ts +0 -2
  30. package/dist/AltVMWarpModule.test.d.ts.map +0 -1
  31. package/dist/AltVMWarpModule.test.js +0 -508
  32. package/dist/AltVMWarpModule.test.js.map +0 -1
  33. package/dist/AltVMWarpRouteReader.d.ts +0 -53
  34. package/dist/AltVMWarpRouteReader.d.ts.map +0 -1
  35. package/dist/AltVMWarpRouteReader.js +0 -168
  36. package/dist/AltVMWarpRouteReader.js.map +0 -1
  37. package/dist/ism/ism-config-utils.d.ts +0 -37
  38. package/dist/ism/ism-config-utils.d.ts.map +0 -1
  39. package/dist/ism/ism-config-utils.js +0 -72
  40. package/dist/ism/ism-config-utils.js.map +0 -1
  41. package/dist/warp-module.d.ts +0 -5
  42. package/dist/warp-module.d.ts.map +0 -1
  43. package/dist/warp-module.js +0 -28
  44. package/dist/warp-module.js.map +0 -1
@@ -1,168 +0,0 @@
1
- import { AltVM, ProtocolType } from '@hyperlane-xyz/provider-sdk';
2
- import { TokenType, } from '@hyperlane-xyz/provider-sdk/warp';
3
- import { ensure0x, isZeroishAddress, rootLogger, } from '@hyperlane-xyz/utils';
4
- import { createHookReader } from './hook/hook-reader.js';
5
- import { createIsmReader } from './ism/generic-ism.js';
6
- export class AltVMWarpRouteReader {
7
- chainMetadata;
8
- chainLookup;
9
- provider;
10
- logger;
11
- hookReader;
12
- ismReader;
13
- constructor(chainMetadata, chainLookup, provider) {
14
- this.chainMetadata = chainMetadata;
15
- this.chainLookup = chainLookup;
16
- this.provider = provider;
17
- this.hookReader = createHookReader(this.chainMetadata, this.chainLookup);
18
- this.logger = rootLogger.child({
19
- module: AltVMWarpRouteReader.name,
20
- });
21
- this.ismReader = createIsmReader(this.chainMetadata, this.chainLookup);
22
- }
23
- /**
24
- * Reads the configuration for a Warp Route at the given address.
25
- * Implements the HypReader interface.
26
- *
27
- * @param address - The address of the Warp Route contract.
28
- * @returns The derived Warp Route configuration.
29
- */
30
- async read(address) {
31
- return this.deriveWarpRouteConfig(address);
32
- }
33
- /**
34
- * Derives the configuration for a Hyperlane ERC20 router contract at the given address.
35
- *
36
- * @param warpRouteAddress - The address of the Hyperlane ERC20 router contract.
37
- * @returns The configuration for the Hyperlane ERC20 router.
38
- *
39
- */
40
- async deriveWarpRouteConfig(warpRouteAddress) {
41
- // Fetch token info once - this gives us type, metadata, owner, mailbox, ISM, etc.
42
- const token = await this.provider.getToken({
43
- tokenAddress: warpRouteAddress,
44
- });
45
- const remoteRouters = await this.fetchRemoteRouters(warpRouteAddress);
46
- const destinationGas = await this.fetchDestinationGas(warpRouteAddress);
47
- // Derive ISM config if present, otherwise use zero address
48
- const interchainSecurityModule = token.ismAddress && !isZeroishAddress(token.ismAddress)
49
- ? await this.ismReader.deriveIsmConfig(token.ismAddress)
50
- : // TODO: replace with protocol-specific zero address
51
- '0x0000000000000000000000000000000000000000';
52
- // Hook address is not exposed by providers yet, use zero address as placeholder
53
- // TODO: replace with protocol-specific zero address
54
- let hook;
55
- if (this.chainMetadata.protocol !== ProtocolType.Aleo) {
56
- hook = '0x0000000000000000000000000000000000000000';
57
- }
58
- else {
59
- hook =
60
- // Not using isNullish because some protocol impl might return an empty string
61
- token.hookAddress && !isZeroishAddress(token.hookAddress)
62
- ? await this.hookReader.deriveHookConfig(token.hookAddress)
63
- : '0x0000000000000000000000000000000000000000';
64
- }
65
- const baseConfig = {
66
- owner: token.owner,
67
- mailbox: token.mailboxAddress,
68
- interchainSecurityModule,
69
- hook,
70
- remoteRouters,
71
- destinationGas,
72
- name: token.name ?? undefined,
73
- symbol: token.symbol ?? undefined,
74
- decimals: token.decimals ?? undefined,
75
- };
76
- // Return discriminated union based on type
77
- switch (token.tokenType) {
78
- case AltVM.TokenType.native: {
79
- const nativeConfig = {
80
- ...baseConfig,
81
- type: TokenType.native,
82
- };
83
- return nativeConfig;
84
- }
85
- case AltVM.TokenType.collateral: {
86
- const collateralConfig = {
87
- ...baseConfig,
88
- type: TokenType.collateral,
89
- token: token.denom, // The underlying collateral denom
90
- };
91
- return collateralConfig;
92
- }
93
- case AltVM.TokenType.synthetic: {
94
- const syntheticConfig = {
95
- ...baseConfig,
96
- type: TokenType.synthetic,
97
- };
98
- return syntheticConfig;
99
- }
100
- default:
101
- throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
102
- }
103
- }
104
- /**
105
- * Derives the token type for a given Warp Route address using specific methods
106
- *
107
- * @param warpRouteAddress - The Warp Route address to derive the token type for.
108
- * @returns The derived TokenType, which can be either 'collateral' or 'synthetic'.
109
- * @throws Error if the token type is not supported (i.e., not collateral or synthetic).
110
- */
111
- async deriveTokenType(warpRouteAddress) {
112
- const token = await this.provider.getToken({
113
- tokenAddress: warpRouteAddress,
114
- });
115
- switch (token.tokenType) {
116
- case AltVM.TokenType.native:
117
- return TokenType.native;
118
- case AltVM.TokenType.collateral:
119
- return TokenType.collateral;
120
- case AltVM.TokenType.synthetic:
121
- return TokenType.synthetic;
122
- default:
123
- throw new Error(`Failed to determine token type for address ${warpRouteAddress}`);
124
- }
125
- }
126
- /**
127
- * Fetches the base metadata for a Warp Route contract.
128
- *
129
- * @param routerAddress - The address of the Warp Route contract.
130
- * @returns The base metadata for the Warp Route contract, including the mailbox, owner, hook, and ism.
131
- */
132
- async fetchMailboxClientConfig(routerAddress) {
133
- const token = await this.provider.getToken({
134
- tokenAddress: routerAddress,
135
- });
136
- const config = {
137
- mailbox: token.mailboxAddress,
138
- owner: token.owner,
139
- };
140
- if (token.ismAddress) {
141
- const derivedIsm = await this.ismReader.deriveIsmConfig(token.ismAddress);
142
- config.interchainSecurityModule = derivedIsm;
143
- }
144
- return config;
145
- }
146
- async fetchRemoteRouters(warpRouteAddress) {
147
- const { remoteRouters } = await this.provider.getRemoteRouters({
148
- tokenAddress: warpRouteAddress,
149
- });
150
- const routers = {};
151
- for (const router of remoteRouters) {
152
- routers[router.receiverDomainId] = {
153
- address: ensure0x(router.receiverAddress),
154
- };
155
- }
156
- return routers;
157
- }
158
- async fetchDestinationGas(warpRouteAddress) {
159
- const { remoteRouters } = await this.provider.getRemoteRouters({
160
- tokenAddress: warpRouteAddress,
161
- });
162
- return Object.fromEntries(remoteRouters.map((routerConfig) => [
163
- routerConfig.receiverDomainId,
164
- routerConfig.gas,
165
- ]));
166
- }
167
- }
168
- //# sourceMappingURL=AltVMWarpRouteReader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"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7B,YAAY,CAAC,GAAG;SACjB,CAAC,CACH,CAAC;IACJ,CAAC;CACF"}
@@ -1,37 +0,0 @@
1
- import { ArtifactNew } from '@hyperlane-xyz/provider-sdk/artifact';
2
- import { ChainLookup } from '@hyperlane-xyz/provider-sdk/chain';
3
- import { IsmArtifactConfig, IsmConfig } from '@hyperlane-xyz/provider-sdk/ism';
4
- export { shouldDeployNewIsm } from '@hyperlane-xyz/provider-sdk/ism';
5
- /**
6
- * Converts IsmConfig (Config API) to IsmArtifactConfig (Artifact API).
7
- *
8
- * Key transformations:
9
- * - String chain names → numeric domain IDs (for routing ISM domains)
10
- * - Address string references → ArtifactUnderived objects
11
- * - Recursively handles nested routing ISM configurations
12
- * - Other ISM types (multisig, testIsm) pass through unchanged
13
- *
14
- * @param config The ISM configuration using Config API format
15
- * @param chainLookup Chain lookup interface for resolving chain names to domain IDs
16
- * @returns Artifact wrapper around IsmArtifactConfig suitable for artifact writers
17
- *
18
- * @example
19
- * ```typescript
20
- * // Config API format
21
- * const ismConfig: IsmConfig = {
22
- * type: 'domainRoutingIsm',
23
- * owner: '0x123...',
24
- * domains: {
25
- * ethereum: { type: 'merkleRootMultisigIsm', validators: [...], threshold: 2 },
26
- * polygon: '0xabc...' // address reference
27
- * }
28
- * };
29
- *
30
- * // Convert to Artifact API format
31
- * const artifact = ismConfigToArtifact(ismConfig, chainLookup);
32
- * // artifact.config.domains is now Record<number, Artifact<IsmArtifactConfig>>
33
- * // with numeric domain IDs and properly wrapped nested configs
34
- * ```
35
- */
36
- export declare function ismConfigToArtifact(config: IsmConfig, chainLookup: ChainLookup): ArtifactNew<IsmArtifactConfig>;
37
- //# sourceMappingURL=ism-config-utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ism-config-utils.d.ts","sourceRoot":"","sources":["../../src/ism/ism-config-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAEZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAEL,iBAAiB,EACjB,SAAS,EACV,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,WAAW,GACvB,WAAW,CAAC,iBAAiB,CAAC,CA0ChC"}
@@ -1,72 +0,0 @@
1
- import { ArtifactState, } from '@hyperlane-xyz/provider-sdk/artifact';
2
- // Re-export ISM utility functions from provider-sdk for convenience
3
- export { shouldDeployNewIsm } from '@hyperlane-xyz/provider-sdk/ism';
4
- /**
5
- * Converts IsmConfig (Config API) to IsmArtifactConfig (Artifact API).
6
- *
7
- * Key transformations:
8
- * - String chain names → numeric domain IDs (for routing ISM domains)
9
- * - Address string references → ArtifactUnderived objects
10
- * - Recursively handles nested routing ISM configurations
11
- * - Other ISM types (multisig, testIsm) pass through unchanged
12
- *
13
- * @param config The ISM configuration using Config API format
14
- * @param chainLookup Chain lookup interface for resolving chain names to domain IDs
15
- * @returns Artifact wrapper around IsmArtifactConfig suitable for artifact writers
16
- *
17
- * @example
18
- * ```typescript
19
- * // Config API format
20
- * const ismConfig: IsmConfig = {
21
- * type: 'domainRoutingIsm',
22
- * owner: '0x123...',
23
- * domains: {
24
- * ethereum: { type: 'merkleRootMultisigIsm', validators: [...], threshold: 2 },
25
- * polygon: '0xabc...' // address reference
26
- * }
27
- * };
28
- *
29
- * // Convert to Artifact API format
30
- * const artifact = ismConfigToArtifact(ismConfig, chainLookup);
31
- * // artifact.config.domains is now Record<number, Artifact<IsmArtifactConfig>>
32
- * // with numeric domain IDs and properly wrapped nested configs
33
- * ```
34
- */
35
- export function ismConfigToArtifact(config, chainLookup) {
36
- // Handle routing ISMs - need to convert chain names to domain IDs
37
- if (config.type === 'domainRoutingIsm') {
38
- const domains = {};
39
- for (const [chainName, nestedConfig] of Object.entries(config.domains)) {
40
- const domainId = chainLookup.getDomainId(chainName);
41
- if (!domainId) {
42
- // Skip unknown chains - they'll be warned about during deployment
43
- continue;
44
- }
45
- if (typeof nestedConfig === 'string') {
46
- // Address reference - create an UNDERIVED artifact
47
- // This represents a predeployed ISM with unspecified type
48
- // The routing ISM writer will pass it through without reading
49
- // Only readers will fetch its config from chain if needed
50
- domains[domainId] = {
51
- artifactState: ArtifactState.UNDERIVED,
52
- deployed: { address: nestedConfig },
53
- };
54
- }
55
- else {
56
- // Nested ISM config - recursively convert
57
- domains[domainId] = ismConfigToArtifact(nestedConfig, chainLookup);
58
- }
59
- }
60
- return {
61
- config: {
62
- type: 'domainRoutingIsm',
63
- owner: config.owner,
64
- domains,
65
- },
66
- };
67
- }
68
- // Other ISM types (multisig, testIsm) have identical config structure
69
- // between Config API and Artifact API - just wrap in artifact object
70
- return { artifactState: ArtifactState.NEW, config };
71
- }
72
- //# sourceMappingURL=ism-config-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ism-config-utils.js","sourceRoot":"","sources":["../../src/ism/ism-config-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,GACd,MAAM,sCAAsC,CAAC;AAQ9C,oEAAoE;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,WAAwB;IAExB,kEAAkE;IAClE,IAAI,MAAM,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QACvC,MAAM,OAAO,GAGT,EAAE,CAAC;QAEP,KAAK,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YACvE,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;YACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,kEAAkE;gBAClE,SAAS;YACX,CAAC;YAED,IAAI,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;gBACrC,mDAAmD;gBACnD,0DAA0D;gBAC1D,8DAA8D;gBAC9D,0DAA0D;gBAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG;oBAClB,aAAa,EAAE,aAAa,CAAC,SAAS;oBACtC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE;iBACpC,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,0CAA0C;gBAC1C,OAAO,CAAC,QAAQ,CAAC,GAAG,mBAAmB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,OAAO;YACL,MAAM,EAAE;gBACN,IAAI,EAAE,kBAAkB;gBACxB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,OAAO;aACR;SACF,CAAC;IACJ,CAAC;IAED,sEAAsE;IACtE,qEAAqE;IACrE,OAAO,EAAE,aAAa,EAAE,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;AACtD,CAAC"}
@@ -1,5 +0,0 @@
1
- import { ChainLookup, ChainMetadataForAltVM } from '@hyperlane-xyz/provider-sdk/chain';
2
- import { ModuleProvider } from '@hyperlane-xyz/provider-sdk/module';
3
- import { TokenRouterModuleType } from '@hyperlane-xyz/provider-sdk/warp';
4
- export declare function warpModuleProvider(chainLookup: ChainLookup, chainMetadata: ChainMetadataForAltVM): ModuleProvider<TokenRouterModuleType>;
5
- //# sourceMappingURL=warp-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warp-module.d.ts","sourceRoot":"","sources":["../src/warp-module.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAKL,cAAc,EAEf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,qBAAqB,EAEtB,MAAM,kCAAkC,CAAC;AAuC1C,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,qBAAqB,GACnC,cAAc,CAAC,qBAAqB,CAAC,CAEvC"}
@@ -1,28 +0,0 @@
1
- import { AltVMWarpModule } from './AltVMWarpModule.js';
2
- import { AltVMWarpRouteReader } from './AltVMWarpRouteReader.js';
3
- class WarpModuleProvider {
4
- chainLookup;
5
- chainMetadata;
6
- constructor(chainLookup, chainMetadata) {
7
- this.chainLookup = chainLookup;
8
- this.chainMetadata = chainMetadata;
9
- }
10
- async createModule(signer, config) {
11
- return await AltVMWarpModule.create({
12
- chainLookup: this.chainLookup,
13
- chain: this.chainMetadata.name,
14
- signer,
15
- config,
16
- });
17
- }
18
- connectModule(signer, args) {
19
- return new AltVMWarpModule(this.chainLookup, signer, args);
20
- }
21
- connectReader(provider) {
22
- return new AltVMWarpRouteReader(this.chainMetadata, this.chainLookup, provider);
23
- }
24
- }
25
- export function warpModuleProvider(chainLookup, chainMetadata) {
26
- return new WarpModuleProvider(chainLookup, chainMetadata);
27
- }
28
- //# sourceMappingURL=warp-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"warp-module.js","sourceRoot":"","sources":["../src/warp-module.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,kBAAkB;IAEZ;IACA;IAFV,YACU,WAAwB,EACxB,aAAoC;QADpC,gBAAW,GAAX,WAAW,CAAa;QACxB,kBAAa,GAAb,aAAa,CAAuB;IAC3C,CAAC;IAEJ,KAAK,CAAC,YAAY,CAChB,MAAuC,EACvC,MAAkB;QAElB,OAAO,MAAM,eAAe,CAAC,MAAM,CAAC;YAClC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI;YAC9B,MAAM;YACN,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,aAAa,CACX,MAAuC,EACvC,IAA0C;QAE1C,OAAO,IAAI,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,aAAa,CAAC,QAAwB;QACpC,OAAO,IAAI,oBAAoB,CAC7B,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,WAAW,EAChB,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,kBAAkB,CAChC,WAAwB,EACxB,aAAoC;IAEpC,OAAO,IAAI,kBAAkB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC"}