Convert packages from CJS to ESM (#3531)

### Description

- Reconfigure tsconfig and package.json for the utils, core, sdk, and helloworld packages
- Update imports to use ESM syntax
- Add patch for typechain to address [issue 898](https://github.com/dethcrypto/TypeChain/pull/898)

### Drive-by changes

Improve package Readme content

### Related issues

Fixes https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/1354

### Backward compatibility

No: package consumers using CJS will need to modify their imports or
update to ESM. See [this popular
gist](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#pure-esm-package)
for details.

### Testing

- [x] CI test coverage which invokes a lot of code via the CLI e2e
- [x] Manually test in Warp UI by copying packages
- [x] Publish beta packages and test in a few popular bundlers
noah/node-expwarn-cli
J M Rossy 8 months ago committed by GitHub
parent 040641bf42
commit b63714ede8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      .changeset/kind-panthers-clap.md
  2. 1
      .eslintignore
  3. 1
      .prettierrc
  4. 23
      .yarn/patches/typechain-npm-8.3.2-b02e27439e.patch
  5. 3
      Dockerfile
  6. 15
      package.json
  7. 20
      solidity/README.md
  8. 2
      solidity/hardhat.config.cts
  9. 47
      solidity/package.json
  10. 10
      solidity/test/merkle.test.ts
  11. 14
      solidity/test/message.test.ts
  12. 10
      solidity/test/mockMailbox.test.ts
  13. 12
      solidity/test/signer.ts
  14. 8
      solidity/test/testrecipient.test.ts
  15. 4
      solidity/tsconfig.json
  16. 11
      tsconfig.json
  17. 7
      typescript/ccip-server/package.json
  18. 2
      typescript/cli/ci-test.sh
  19. 14
      typescript/cli/package.json
  20. 2
      typescript/cli/tsconfig.json
  21. 0
      typescript/helloworld/.solcover.cjs
  22. 2
      typescript/helloworld/README.md
  23. 1
      typescript/helloworld/hardhat.config.cts
  24. 46
      typescript/helloworld/package.json
  25. 6
      typescript/helloworld/src/app/app.ts
  26. 2
      typescript/helloworld/src/app/contracts.ts
  27. 6
      typescript/helloworld/src/deploy/check.ts
  28. 6
      typescript/helloworld/src/deploy/deploy.ts
  29. 20
      typescript/helloworld/src/index.ts
  30. 4
      typescript/helloworld/src/multiProtocolApp/evmAdapter.ts
  31. 8
      typescript/helloworld/src/multiProtocolApp/multiProtocolApp.ts
  32. 2
      typescript/helloworld/src/multiProtocolApp/sealevelAdapter.ts
  33. 8
      typescript/helloworld/src/scripts/check.ts
  34. 4
      typescript/helloworld/src/scripts/deploy.ts
  35. 14
      typescript/helloworld/src/test/deploy.test.ts
  36. 12
      typescript/helloworld/src/test/helloworld.test.ts
  37. 16
      typescript/helloworld/tsconfig.json
  38. 6
      typescript/infra/config/environments/agents.ts
  39. 4
      typescript/infra/config/environments/helloworld.ts
  40. 6
      typescript/infra/config/environments/index.ts
  41. 18
      typescript/infra/config/environments/mainnet3/agent.ts
  42. 2
      typescript/infra/config/environments/mainnet3/chains.ts
  43. 6
      typescript/infra/config/environments/mainnet3/core.ts
  44. 8
      typescript/infra/config/environments/mainnet3/funding.ts
  45. 8
      typescript/infra/config/environments/mainnet3/gas-oracle.ts
  46. 10
      typescript/infra/config/environments/mainnet3/helloworld.ts
  47. 6
      typescript/infra/config/environments/mainnet3/igp.ts
  48. 26
      typescript/infra/config/environments/mainnet3/index.ts
  49. 2
      typescript/infra/config/environments/mainnet3/infrastructure.ts
  50. 4
      typescript/infra/config/environments/mainnet3/liquidityLayer.ts
  51. 2
      typescript/infra/config/environments/mainnet3/owners.ts
  52. 8
      typescript/infra/config/environments/mainnet3/validators.ts
  53. 10
      typescript/infra/config/environments/test/agent.ts
  54. 2
      typescript/infra/config/environments/test/aggregationIsm.ts
  55. 2
      typescript/infra/config/environments/test/chains.ts
  56. 10
      typescript/infra/config/environments/test/core.ts
  57. 6
      typescript/infra/config/environments/test/gas-oracle.ts
  58. 6
      typescript/infra/config/environments/test/igp.ts
  59. 14
      typescript/infra/config/environments/test/index.ts
  60. 2
      typescript/infra/config/environments/test/infra.ts
  61. 2
      typescript/infra/config/environments/test/owners.ts
  62. 2
      typescript/infra/config/environments/test/routingIsm.ts
  63. 2
      typescript/infra/config/environments/test/validators.ts
  64. 18
      typescript/infra/config/environments/testnet4/agent.ts
  65. 6
      typescript/infra/config/environments/testnet4/core.ts
  66. 8
      typescript/infra/config/environments/testnet4/funding.ts
  67. 8
      typescript/infra/config/environments/testnet4/gas-oracle.ts
  68. 10
      typescript/infra/config/environments/testnet4/helloworld.ts
  69. 6
      typescript/infra/config/environments/testnet4/igp.ts
  70. 28
      typescript/infra/config/environments/testnet4/index.ts
  71. 2
      typescript/infra/config/environments/testnet4/infrastructure.ts
  72. 4
      typescript/infra/config/environments/testnet4/middleware.ts
  73. 2
      typescript/infra/config/environments/testnet4/owners.ts
  74. 8
      typescript/infra/config/environments/testnet4/validators.ts
  75. 4
      typescript/infra/config/environments/utils.ts
  76. 12
      typescript/infra/config/multisigIsm.ts
  77. 12
      typescript/infra/config/routingIsm.ts
  78. 2
      typescript/infra/fork-all.sh
  79. 10
      typescript/infra/fork.sh
  80. 19
      typescript/infra/hardhat.config.cts
  81. 186
      typescript/infra/hardhat.config.ts
  82. 2
      typescript/infra/helm/helloworld-kathy/templates/_helpers.tpl
  83. 2
      typescript/infra/helm/key-funder/templates/cron-job.yaml
  84. 2
      typescript/infra/helm/liquidity-layer-relayers/templates/circle-relayer-deployment.yaml
  85. 2
      typescript/infra/helm/liquidity-layer-relayers/templates/portal-relayer-deployment.yaml
  86. 2
      typescript/infra/helm/warp-routes/templates/_helpers.tpl
  87. 34
      typescript/infra/package.json
  88. 47
      typescript/infra/scripts/agent-utils.ts
  89. 8
      typescript/infra/scripts/agents/deploy-agents.ts
  90. 4
      typescript/infra/scripts/agents/remove-agent-deploys.ts
  91. 4
      typescript/infra/scripts/agents/update-agents-diff.ts
  92. 13
      typescript/infra/scripts/agents/utils.ts
  93. 12
      typescript/infra/scripts/announce-validators.ts
  94. 22
      typescript/infra/scripts/check-deploy.ts
  95. 6
      typescript/infra/scripts/check-rpc-urls.ts
  96. 8
      typescript/infra/scripts/core-utils.ts
  97. 4
      typescript/infra/scripts/create-keys.ts
  98. 6
      typescript/infra/scripts/debug-message.ts
  99. 4
      typescript/infra/scripts/delete-keys.ts
  100. 8
      typescript/infra/scripts/deploy-infra-external-secrets.ts
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,9 @@
---
'@hyperlane-xyz/helloworld': minor
'@hyperlane-xyz/utils': minor
'@hyperlane-xyz/cli': minor
'@hyperlane-xyz/sdk': minor
'@hyperlane-xyz/core': minor
---
Convert all public hyperlane npm packages from CJS to pure ESM

@ -1,3 +1,4 @@
node_modules node_modules
dist dist
coverage coverage
*.cts

@ -17,5 +17,6 @@
"importOrder": ["^@hyperlane-xyz/(.*)$", "^../(.*)$", "^./(.*)$"], "importOrder": ["^@hyperlane-xyz/(.*)$", "^../(.*)$", "^./(.*)$"],
"importOrderSeparation": true, "importOrderSeparation": true,
"importOrderSortSpecifiers": true, "importOrderSortSpecifiers": true,
"importOrderParserPlugins": ["importAssertions", "typescript", "jsx"],
"plugins": ["prettier-plugin-solidity", "@trivago/prettier-plugin-sort-imports"] "plugins": ["prettier-plugin-solidity", "@trivago/prettier-plugin-sort-imports"]
} }

@ -0,0 +1,23 @@
diff --git a/dist/codegen/createBarrelFiles.js b/dist/codegen/createBarrelFiles.js
index 4bf574d7f6701bc5a8fcb2c281b5c63f31923e79..7f9cbdbd0491d4fa6338a10b23d06c2665c9d968 100644
--- a/dist/codegen/createBarrelFiles.js
+++ b/dist/codegen/createBarrelFiles.js
@@ -38,15 +38,13 @@ function createBarrelFiles(paths, { typeOnly, postfix = '', moduleSuffix = '' })
const namespacesExports = nestedDirs
.map((p) => {
const namespaceIdentifier = (0, normalizeDirName_1.normalizeDirName)(p);
+ const fromFilePath = moduleSuffix ? `'./${p}/index${moduleSuffix}'` : `'./${p}'`
if (typeOnly)
return [
- `import type * as ${namespaceIdentifier} from './${p}';`,
+ `import type * as ${namespaceIdentifier} from ${fromFilePath};`,
`export type { ${namespaceIdentifier} };`,
].join('\n');
- if (moduleSuffix) {
- return `export * as ${namespaceIdentifier} from './${p}/index${moduleSuffix}';`;
- }
- return `export * as ${namespaceIdentifier} from './${p}';`;
+ return `export * as ${namespaceIdentifier} from ${fromFilePath};`;
})
.join('\n');
const contracts = (fileReexports[path] || []).sort();

@ -4,12 +4,13 @@ WORKDIR /hyperlane-monorepo
RUN apk add --update --no-cache git g++ make py3-pip jq RUN apk add --update --no-cache git g++ make py3-pip jq
RUN yarn set version 4.0.1 RUN yarn set version 4.0.2
# Copy package.json and friends # Copy package.json and friends
COPY package.json yarn.lock .yarnrc.yml ./ COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/plugins ./.yarn/plugins COPY .yarn/plugins ./.yarn/plugins
COPY .yarn/releases ./.yarn/releases COPY .yarn/releases ./.yarn/releases
COPY .yarn/patches ./.yarn/patches
COPY typescript/utils/package.json ./typescript/utils/ COPY typescript/utils/package.json ./typescript/utils/
COPY typescript/sdk/package.json ./typescript/sdk/ COPY typescript/sdk/package.json ./typescript/sdk/
COPY typescript/helloworld/package.json ./typescript/helloworld/ COPY typescript/helloworld/package.json ./typescript/helloworld/

@ -4,13 +4,14 @@
"version": "0.0.0", "version": "0.0.0",
"devDependencies": { "devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.2.1", "@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.43.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^9.1.0",
"husky": "^8.0.0", "husky": "^8.0.0",
"lint-staged": "^12.4.3", "lint-staged": "^12.4.3",
"prettier": "^2.8.8" "prettier": "^2.8.8",
"tsx": "^4.7.1"
}, },
"dependencies": { "dependencies": {
"@changesets/cli": "^2.26.2" "@changesets/cli": "^2.26.2"
@ -42,6 +43,8 @@
"recursive-readdir": "^2.2.3", "recursive-readdir": "^2.2.3",
"underscore": "^1.13", "underscore": "^1.13",
"undici": "^5.11", "undici": "^5.11",
"@trivago/prettier-plugin-sort-imports/@babel/parser": "^7.22.7" "@trivago/prettier-plugin-sort-imports/@babel/parser": "^7.22.7",
"@typechain/ethers-v5": "11.1.2",
"typechain@npm:^8.0.0": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch"
} }
} }

@ -1,15 +1,19 @@
# Hyperlane Solidity # Hyperlane Core
On-chain implementations of Hyperlane in Solidity. Hyperlane Core contains the contracts and typechain artifacts for the Hyperlane implementation for EVM.
## Setup ## Install
- `yarn install` ```bash
# Install with NPM
npm install @hyperlane-xyz/utils
## Build # Or with Yarn
yarn add @hyperlane-xyz/utils
```
- `yarn build` Note, this package uses [ESM Modules](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#pure-esm-package)
## Test ## License
- `yarn test` Apache 2.0

@ -24,8 +24,10 @@ module.exports = {
outDir: './types', outDir: './types',
target: 'ethers-v5', target: 'ethers-v5',
alwaysGenerateOverloads: true, alwaysGenerateOverloads: true,
node16Modules: true,
}, },
mocha: { mocha: {
bail: true, bail: true,
import: 'tsx',
}, },
}; };

@ -11,14 +11,14 @@
}, },
"devDependencies": { "devDependencies": {
"@layerzerolabs/solidity-examples": "^1.1.0", "@layerzerolabs/solidity-examples": "^1.1.0",
"@nomiclabs/hardhat-ethers": "^2.2.1", "@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6", "@nomiclabs/hardhat-waffle": "^2.0.6",
"@typechain/ethers-v5": "^10.0.0", "@typechain/ethers-v5": "^11.1.2",
"@typechain/hardhat": "^6.0.0", "@typechain/hardhat": "^9.1.0",
"chai": "^4.3.6", "chai": "^4.3.6",
"ethereum-waffle": "^4.0.10", "ethereum-waffle": "^4.0.10",
"ethers": "^5.7.2", "ethers": "^5.7.2",
"hardhat": "^2.19.0", "hardhat": "^2.22.2",
"hardhat-gas-reporter": "^1.0.9", "hardhat-gas-reporter": "^1.0.9",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3", "prettier-plugin-solidity": "^1.1.3",
@ -26,42 +26,53 @@
"solhint-plugin-prettier": "^0.0.5", "solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.8.3", "solidity-coverage": "^0.8.3",
"ts-generator": "^0.1.1", "ts-generator": "^0.1.1",
"typechain": "^8.3.2", "ts-node": "^10.8.0",
"typescript": "5.1.6" "typechain": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch",
"typescript": "5.3.3"
}, },
"directories": { "directories": {
"test": "test" "test": "test"
}, },
"type": "module",
"exports": {
".": "./dist/index.js",
"./mailbox": "./dist/contracts/Mailbox.js",
"./buildArtifact.json": "./buildArtifact.json",
"./contracts": "./contracts"
},
"types": "./dist/index.d.ts",
"files": [ "files": [
"/buildArtifact.json", "/buildArtifact.json",
"/dist", "/dist",
"/contracts", "/contracts"
"/interfaces",
"/docs"
], ],
"engines": {
"node": ">=16"
},
"homepage": "https://www.hyperlane.xyz", "homepage": "https://www.hyperlane.xyz",
"repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo",
"keywords": [ "keywords": [
"Hyperlane", "Hyperlane",
"Solidity" "Solidity"
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "dist/index.js",
"repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo",
"scripts": { "scripts": {
"build": "hardhat compile && ./exportBuildArtifact.sh && tsc", "build": "yarn hardhat-esm compile && ./exportBuildArtifact.sh && tsc",
"lint": "solhint contracts/**/*.sol", "lint": "solhint contracts/**/*.sol",
"clean": "hardhat clean && rm -rf ./dist ./cache ./types ./coverage", "clean": "yarn hardhat-esm clean && rm -rf ./dist ./cache ./types ./coverage ./out ./forge-cache",
"coverage": "./coverage.sh", "coverage": "./coverage.sh",
"docs": "forge doc", "docs": "forge doc",
"storage": "./storage.sh", "hardhat-esm": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config hardhat.config.cts",
"prettier": "prettier --write ./contracts ./test", "prettier": "prettier --write ./contracts ./test",
"test": "hardhat test && forge test -vvv", "test": "yarn hardhat-esm test && yarn test:forge",
"test:ci": "hardhat test && forge test --no-match-test testFork -vvv", "test:hardhat": "yarn hardhat-esm test",
"test:forge": "forge test -vvv",
"test:ci": "yarn test:hardhat && yarn test:forge --no-match-test testFork",
"gas": "forge snapshot", "gas": "forge snapshot",
"gas-ci": "yarn gas --check --tolerance 2 || (echo 'Manually update gas snapshot' && exit 1)", "gas-ci": "yarn gas --check --tolerance 2 || (echo 'Manually update gas snapshot' && exit 1)",
"slither": "slither ." "slither": "slither .",
"storage": "./storage.sh"
}, },
"types": "dist/index.d.ts",
"peerDependencies": { "peerDependencies": {
"@ethersproject/abi": "*", "@ethersproject/abi": "*",
"@ethersproject/providers": "*", "@ethersproject/providers": "*",

@ -1,9 +1,11 @@
import { expect } from 'chai'; import { expect } from 'chai';
import { ethers } from 'hardhat'; import { utils } from 'ethers';
import merkleTestCases from '../../vectors/merkle.json'; import merkleTestCases from '../../vectors/merkle.json' assert { type: 'json' };
import { TestMerkle, TestMerkle__factory } from '../types'; import { TestMerkle, TestMerkle__factory } from '../types';
import { getSigner } from './signer';
describe('Merkle', async () => { describe('Merkle', async () => {
for (const testCase of merkleTestCases) { for (const testCase of merkleTestCases) {
const { testName, leaves, expectedRoot, proofs } = testCase; const { testName, leaves, expectedRoot, proofs } = testCase;
@ -12,14 +14,14 @@ describe('Merkle', async () => {
let merkle: TestMerkle; let merkle: TestMerkle;
before(async () => { before(async () => {
const [signer] = await ethers.getSigners(); const signer = await getSigner();
const merkleFactory = new TestMerkle__factory(signer); const merkleFactory = new TestMerkle__factory(signer);
merkle = await merkleFactory.deploy(); merkle = await merkleFactory.deploy();
//insert the leaves //insert the leaves
for (const leaf of leaves) { for (const leaf of leaves) {
const leafHash = ethers.utils.hashMessage(leaf); const leafHash = utils.hashMessage(leaf);
await merkle.insert(leafHash); await merkle.insert(leafHash);
} }
}); });

@ -1,5 +1,5 @@
import { expect } from 'chai'; import { expect } from 'chai';
import { ethers } from 'hardhat'; import { utils } from 'ethers';
import { import {
addressToBytes32, addressToBytes32,
@ -7,9 +7,11 @@ import {
messageId, messageId,
} from '@hyperlane-xyz/utils'; } from '@hyperlane-xyz/utils';
import testCases from '../../vectors/message.json'; import testCases from '../../vectors/message.json' assert { type: 'json' };
import { Mailbox__factory, TestMessage, TestMessage__factory } from '../types'; import { Mailbox__factory, TestMessage, TestMessage__factory } from '../types';
import { getSigner, getSigners } from './signer';
const remoteDomain = 1000; const remoteDomain = 1000;
const localDomain = 2000; const localDomain = 2000;
const nonce = 11; const nonce = 11;
@ -19,7 +21,7 @@ describe('Message', async () => {
let version: number; let version: number;
before(async () => { before(async () => {
const [signer] = await ethers.getSigners(); const signer = await getSigner();
const Message = new TestMessage__factory(signer); const Message = new TestMessage__factory(signer);
messageLib = await Message.deploy(); messageLib = await Message.deploy();
@ -31,8 +33,8 @@ describe('Message', async () => {
}); });
it('Returns fields from a message', async () => { it('Returns fields from a message', async () => {
const [sender, recipient] = await ethers.getSigners(); const [sender, recipient] = await getSigners();
const body = ethers.utils.formatBytes32String('message'); const body = utils.formatBytes32String('message');
const message = formatMessage( const message = formatMessage(
version, version,
@ -64,7 +66,7 @@ describe('Message', async () => {
for (const test of testCases) { for (const test of testCases) {
const { origin, sender, destination, recipient, body, nonce, id } = test; const { origin, sender, destination, recipient, body, nonce, id } = test;
const hexBody = ethers.utils.hexlify(body); const hexBody = utils.hexlify(body);
const hyperlaneMessage = formatMessage( const hyperlaneMessage = formatMessage(
version, version,

@ -1,16 +1,18 @@
import { expect } from 'chai'; import { expect } from 'chai';
import { ethers } from 'hardhat'; import { utils } from 'ethers';
import { addressToBytes32 } from '@hyperlane-xyz/utils'; import { addressToBytes32 } from '@hyperlane-xyz/utils';
import { MockMailbox__factory, TestRecipient__factory } from '../types'; import { MockMailbox__factory, TestRecipient__factory } from '../types';
import { getSigner } from './signer';
const ORIGIN_DOMAIN = 1000; const ORIGIN_DOMAIN = 1000;
const DESTINATION_DOMAIN = 2000; const DESTINATION_DOMAIN = 2000;
describe('MockMailbox', function () { describe('MockMailbox', function () {
it('should be able to mock sending and receiving a message', async function () { it('should be able to mock sending and receiving a message', async function () {
const [signer] = await ethers.getSigners(); const signer = await getSigner();
const mailboxFactory = new MockMailbox__factory(signer); const mailboxFactory = new MockMailbox__factory(signer);
const testRecipientFactory = new TestRecipient__factory(signer); const testRecipientFactory = new TestRecipient__factory(signer);
const originMailbox = await mailboxFactory.deploy(ORIGIN_DOMAIN); const originMailbox = await mailboxFactory.deploy(ORIGIN_DOMAIN);
@ -21,7 +23,7 @@ describe('MockMailbox', function () {
); );
const recipient = await testRecipientFactory.deploy(); const recipient = await testRecipientFactory.deploy();
const body = ethers.utils.toUtf8Bytes('This is a test message'); const body = utils.toUtf8Bytes('This is a test message');
await originMailbox['dispatch(uint32,bytes32,bytes)']( await originMailbox['dispatch(uint32,bytes32,bytes)'](
DESTINATION_DOMAIN, DESTINATION_DOMAIN,
@ -31,6 +33,6 @@ describe('MockMailbox', function () {
await destinationMailbox.processNextInboundMessage(); await destinationMailbox.processNextInboundMessage();
const dataReceived = await recipient.lastData(); const dataReceived = await recipient.lastData();
expect(dataReceived).to.eql(ethers.utils.hexlify(body)); expect(dataReceived).to.eql(utils.hexlify(body));
}); });
}); });

@ -0,0 +1,12 @@
import type { Wallet } from 'ethers';
import hre from 'hardhat';
export async function getSigners(): Promise<Wallet[]> {
// @ts-ignore Hardhat type overrides from @nomiclabs/hardhat-ethers don't work
return hre.ethers.getSigners();
}
export async function getSigner(): Promise<Wallet> {
const [signer] = await getSigners();
return signer;
}

@ -1,17 +1,19 @@
import { expect } from 'chai'; import { expect } from 'chai';
import { ethers } from 'hardhat'; import { utils } from 'ethers';
import { addressToBytes32 } from '@hyperlane-xyz/utils'; import { addressToBytes32 } from '@hyperlane-xyz/utils';
import { TestRecipient, TestRecipient__factory } from '../types'; import { TestRecipient, TestRecipient__factory } from '../types';
const testData = ethers.utils.hexlify(ethers.utils.toUtf8Bytes('test')); import { getSigner } from './signer';
const testData = utils.hexlify(utils.toUtf8Bytes('test'));
describe('TestRecipient', () => { describe('TestRecipient', () => {
let recipient: TestRecipient; let recipient: TestRecipient;
let signerAddress: string; let signerAddress: string;
before(async () => { before(async () => {
const [signer] = await ethers.getSigners(); const signer = await getSigner();
signerAddress = await signer.getAddress(); signerAddress = await signer.getAddress();
const recipientFactory = new TestRecipient__factory(signer); const recipientFactory = new TestRecipient__factory(signer);
recipient = await recipientFactory.deploy(); recipient = await recipientFactory.deploy();

@ -1,8 +1,8 @@
{ {
"extends": "../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"outDir": "./dist", "outDir": "./dist",
"rootDir": "./types" "rootDir": "./types"
}, },
"exclude": ["./test", "hardhat.config.ts", "./dist"], "exclude": ["./test", "hardhat.config.cts", "./dist"]
"extends": "../tsconfig.json"
} }

@ -9,8 +9,8 @@
"ES2015", "ES2016", "ES2017", "ES2018", "ES2015", "ES2016", "ES2017", "ES2018",
"ES2019", "ES2020","ES2021", "DOM" "ES2019", "ES2020","ES2021", "DOM"
], ],
"module": "commonjs", "module": "nodenext",
"moduleResolution": "node", "moduleResolution": "nodenext",
"noEmitOnError": true, "noEmitOnError": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noImplicitAny": true, "noImplicitAny": true,
@ -23,6 +23,11 @@
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"strict": true, "strict": true,
"target": "ES2020", "target": "es2022",
},
"ts-node": {
"experimentalSpecifierResolution": "node",
"experimentalResolver": true,
"files": true
} }
} }

@ -9,10 +9,10 @@
"src" "src"
], ],
"engines": { "engines": {
"node": ">=14" "node": ">=16"
}, },
"scripts": { "scripts": {
"start": "ts-node src/server.ts", "start": "tsx src/server.ts",
"dev": "nodemon src/server.ts", "dev": "nodemon src/server.ts",
"test": "jest", "test": "jest",
"prettier": "prettier --write ./src/* ./tests/" "prettier": "prettier --write ./src/* ./tests/"
@ -27,7 +27,8 @@
"prettier": "^2.8.8", "prettier": "^2.8.8",
"ts-jest": "^29.1.2", "ts-jest": "^29.1.2",
"ts-node": "^10.8.0", "ts-node": "^10.8.0",
"typescript": "5.1.6" "tsx": "^4.7.1",
"typescript": "5.3.3"
}, },
"dependencies": { "dependencies": {
"@chainlink/ccip-read-server": "^0.2.1", "@chainlink/ccip-read-server": "^0.2.1",

@ -69,7 +69,7 @@ sleep 1
if [ "$TEST_TYPE" == $TEST_TYPE_PI_CORE ]; then if [ "$TEST_TYPE" == $TEST_TYPE_PI_CORE ]; then
# Fetch the RPC of chain to fork # Fetch the RPC of chain to fork
cd typescript/infra cd typescript/infra
RPC_URL=$(yarn ts-node scripts/print-chain-metadatas.ts -e mainnet3 | jq -r ".${CHAIN2}.rpcUrls[0].http") RPC_URL=$(yarn tsx scripts/print-chain-metadatas.ts -e mainnet3 | jq -r ".${CHAIN2}.rpcUrls[0].http")
cd ../../ cd ../../
# run the fork chain # run the fork chain

@ -20,11 +20,11 @@
"@types/mocha": "^10.0.1", "@types/mocha": "^10.0.1",
"@types/node": "^18.14.5", "@types/node": "^18.14.5",
"@types/yargs": "^17.0.24", "@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^7.4.0",
"chai": "^4.3.6", "chai": "^4.3.6",
"eslint": "^8.43.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^9.1.0",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"typescript": "^5.1.6" "typescript": "^5.1.6"
@ -48,6 +48,9 @@
"main": "./dist/index.js", "main": "./dist/index.js",
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"type": "module", "type": "module",
"engines": {
"node": ">=16"
},
"bin": { "bin": {
"hyperlane": "./dist/cli.js" "hyperlane": "./dist/cli.js"
}, },
@ -63,6 +66,5 @@
"Permissionless", "Permissionless",
"Deployment", "Deployment",
"Typescript" "Typescript"
], ]
"packageManager": "yarn@4.0.1"
} }

@ -1,8 +1,6 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "./dist/", "outDir": "./dist/",
"rootDir": "." "rootDir": "."
}, },

@ -24,4 +24,4 @@ yarn lint
## Learn more ## Learn more
For more information, see the [Hyperlane documentation](https://docs.hyperlane.xyz/hyperlane-docs/developers/getting-started). For more information, see the [Hyperlane documentation](https://docs.hyperlane.xyz/docs/intro).

@ -18,5 +18,6 @@ module.exports = {
outDir: './src/types', outDir: './src/types',
target: 'ethers-v5', target: 'ethers-v5',
alwaysGenerateOverloads: true, alwaysGenerateOverloads: true,
node16Modules: true,
}, },
}; };

@ -9,18 +9,18 @@
"ethers": "^5.7.2" "ethers": "^5.7.2"
}, },
"devDependencies": { "devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.1", "@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6", "@nomiclabs/hardhat-waffle": "^2.0.6",
"@trivago/prettier-plugin-sort-imports": "^4.2.1", "@trivago/prettier-plugin-sort-imports": "^4.2.1",
"@typechain/ethers-v5": "^10.0.0", "@typechain/ethers-v5": "^11.1.2",
"@typechain/hardhat": "^6.0.0", "@typechain/hardhat": "^9.1.0",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^5.62.0", "@typescript-eslint/parser": "^7.4.0",
"chai": "^4.3.6", "chai": "^4.3.6",
"eslint": "^8.43.0", "eslint": "^8.57.0",
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^9.1.0",
"ethereum-waffle": "^4.0.10", "ethereum-waffle": "^4.0.10",
"hardhat": "^2.19.0", "hardhat": "^2.22.2",
"hardhat-gas-reporter": "^1.0.9", "hardhat-gas-reporter": "^1.0.9",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3", "prettier-plugin-solidity": "^1.1.3",
@ -28,13 +28,9 @@
"solhint-plugin-prettier": "^0.0.5", "solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "^0.8.3", "solidity-coverage": "^0.8.3",
"ts-node": "^10.8.0", "ts-node": "^10.8.0",
"typechain": "^8.0.0", "typechain": "patch:typechain@npm%3A8.3.2#~/.yarn/patches/typechain-npm-8.3.2-b02e27439e.patch",
"typescript": "5.1.6" "typescript": "5.3.3"
}, },
"files": [
"/dist",
"/contracts"
],
"homepage": "https://www.hyperlane.xyz", "homepage": "https://www.hyperlane.xyz",
"keywords": [ "keywords": [
"Hyperlane", "Hyperlane",
@ -43,23 +39,27 @@
"Typescript" "Typescript"
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "dist/src/index.js", "type": "module",
"packageManager": "yarn@4.0.1", "exports": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"/dist",
"/contracts"
],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/hyperlane-xyz/hyperlane-monorepo" "url": "https://github.com/hyperlane-xyz/hyperlane-monorepo"
}, },
"scripts": { "scripts": {
"build": "hardhat compile && tsc", "build": "yarn hardhat-esm compile && tsc",
"clean": "hardhat clean && rm -rf dist cache src/types", "clean": "yarn hardhat-esm clean && rm -rf dist cache src/types",
"coverage": "hardhat coverage", "coverage": "yarn hardhat-esm coverage",
"lint": "solhint contracts/**/*.sol && eslint . --ext .ts", "lint": "solhint contracts/**/*.sol && eslint . --ext .ts",
"hardhat-esm": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config hardhat.config.cts",
"prettier": "prettier --write ./contracts ./src", "prettier": "prettier --write ./contracts ./src",
"test": "hardhat test ./src/test/**/*.test.ts", "test": "yarn hardhat-esm test ./src/test/**/*.test.ts",
"test:ci": "yarn test", "test:ci": "yarn test"
"sync": "ts-node scripts/sync-with-template-repo.ts"
}, },
"types": "dist/src/index.d.ts",
"peerDependencies": { "peerDependencies": {
"@ethersproject/abi": "*", "@ethersproject/abi": "*",
"@ethersproject/providers": "*", "@ethersproject/providers": "*",

@ -11,10 +11,10 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, rootLogger } from '@hyperlane-xyz/utils'; import { Address, rootLogger } from '@hyperlane-xyz/utils';
import { HelloWorld } from '../types'; import { HelloWorld } from '../types/index.js';
import { HelloWorldFactories } from './contracts'; import { HelloWorldFactories } from './contracts.js';
import { StatCounts } from './types'; import { StatCounts } from './types.js';
export class HelloWorldApp extends RouterApp<HelloWorldFactories> { export class HelloWorldApp extends RouterApp<HelloWorldFactories> {
constructor( constructor(

@ -1,4 +1,4 @@
import { HelloWorld__factory } from '../types'; import { HelloWorld__factory } from '../types/index.js';
export const helloWorldFactories = { export const helloWorldFactories = {
router: new HelloWorld__factory(), router: new HelloWorld__factory(),

@ -1,9 +1,9 @@
import { HyperlaneRouterChecker } from '@hyperlane-xyz/sdk'; import { HyperlaneRouterChecker } from '@hyperlane-xyz/sdk';
import { HelloWorldApp } from '../app/app'; import { HelloWorldApp } from '../app/app.js';
import { HelloWorldFactories } from '../app/contracts'; import { HelloWorldFactories } from '../app/contracts.js';
import { HelloWorldConfig } from './config'; import { HelloWorldConfig } from './config.js';
export class HelloWorldChecker extends HyperlaneRouterChecker< export class HelloWorldChecker extends HyperlaneRouterChecker<
HelloWorldFactories, HelloWorldFactories,

@ -9,10 +9,10 @@ import {
MultiProvider, MultiProvider,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { HelloWorldFactories, helloWorldFactories } from '../app/contracts'; import { HelloWorldFactories, helloWorldFactories } from '../app/contracts.js';
import { HelloWorld } from '../types'; import { HelloWorld } from '../types/index.js';
import { HelloWorldConfig } from './config'; import { HelloWorldConfig } from './config.js';
export class HelloWorldDeployer extends HyperlaneRouterDeployer< export class HelloWorldDeployer extends HyperlaneRouterDeployer<
HelloWorldConfig, HelloWorldConfig,

@ -1,10 +1,10 @@
export { HelloWorldApp } from './app/app'; export { HelloWorldApp } from './app/app.js';
export { HelloWorldFactories, helloWorldFactories } from './app/contracts'; export { HelloWorldFactories, helloWorldFactories } from './app/contracts.js';
export { HelloWorldChecker } from './deploy/check'; export { HelloWorldChecker } from './deploy/check.js';
export { HelloWorldConfig } from './deploy/config'; export { HelloWorldConfig } from './deploy/config.js';
export { HelloWorldDeployer } from './deploy/deploy'; export { HelloWorldDeployer } from './deploy/deploy.js';
export { EvmHelloWorldAdapter } from './multiProtocolApp/evmAdapter'; export { EvmHelloWorldAdapter } from './multiProtocolApp/evmAdapter.js';
export { HelloMultiProtocolApp } from './multiProtocolApp/multiProtocolApp'; export { HelloMultiProtocolApp } from './multiProtocolApp/multiProtocolApp.js';
export { SealevelHelloWorldAdapter } from './multiProtocolApp/sealevelAdapter'; export { SealevelHelloWorldAdapter } from './multiProtocolApp/sealevelAdapter.js';
export { IHelloWorldAdapter } from './multiProtocolApp/types'; export { IHelloWorldAdapter } from './multiProtocolApp/types.js';
export * as types from './types'; export * as types from './types/index.js';

@ -9,9 +9,9 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address } from '@hyperlane-xyz/utils'; import { Address } from '@hyperlane-xyz/utils';
import { HelloWorld, HelloWorld__factory } from '../types'; import { HelloWorld, HelloWorld__factory } from '../types/index.js';
import { IHelloWorldAdapter } from './types'; import { IHelloWorldAdapter } from './types.js';
export class EvmHelloWorldAdapter export class EvmHelloWorldAdapter
extends EvmRouterAdapter extends EvmRouterAdapter

@ -7,11 +7,11 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, ProtocolType } from '@hyperlane-xyz/utils'; import { Address, ProtocolType } from '@hyperlane-xyz/utils';
import { StatCounts } from '../app/types'; import { StatCounts } from '../app/types.js';
import { EvmHelloWorldAdapter } from './evmAdapter'; import { EvmHelloWorldAdapter } from './evmAdapter.js';
import { SealevelHelloWorldAdapter } from './sealevelAdapter'; import { SealevelHelloWorldAdapter } from './sealevelAdapter.js';
import { IHelloWorldAdapter } from './types'; import { IHelloWorldAdapter } from './types.js';
export class HelloMultiProtocolApp extends MultiProtocolRouterApp< export class HelloMultiProtocolApp extends MultiProtocolRouterApp<
IHelloWorldAdapter, IHelloWorldAdapter,

@ -24,7 +24,7 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, Domain } from '@hyperlane-xyz/utils'; import { Address, Domain } from '@hyperlane-xyz/utils';
import { IHelloWorldAdapter } from './types'; import { IHelloWorldAdapter } from './types.js';
export class SealevelHelloWorldAdapter export class SealevelHelloWorldAdapter
extends SealevelRouterAdapter extends SealevelRouterAdapter

@ -4,10 +4,10 @@ import {
attachContractsMap, attachContractsMap,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { HelloWorldApp } from '../app/app'; import { HelloWorldApp } from '../app/app.js';
import { helloWorldFactories } from '../app/contracts'; import { helloWorldFactories } from '../app/contracts.js';
import { HelloWorldChecker } from '../deploy/check'; import { HelloWorldChecker } from '../deploy/check.js';
import { prodConfigs } from '../deploy/config'; import { prodConfigs } from '../deploy/config.js';
// COPY FROM OUTPUT OF DEPLOYMENT SCRIPT OR IMPORT FROM ELSEWHERE // COPY FROM OUTPUT OF DEPLOYMENT SCRIPT OR IMPORT FROM ELSEWHERE
const deploymentAddresses = {}; const deploymentAddresses = {};

@ -6,8 +6,8 @@ import {
serializeContractsMap, serializeContractsMap,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { prodConfigs } from '../deploy/config'; import { prodConfigs } from '../deploy/config.js';
import { HelloWorldDeployer } from '../deploy/deploy'; import { HelloWorldDeployer } from '../deploy/deploy.js';
async function main() { async function main() {
console.info('Getting signer'); console.info('Getting signer');

@ -1,5 +1,5 @@
import '@nomiclabs/hardhat-waffle'; import '@nomiclabs/hardhat-waffle';
import { ethers } from 'hardhat'; import hre from 'hardhat';
import { import {
ChainMap, ChainMap,
@ -11,11 +11,11 @@ import {
TestCoreDeployer, TestCoreDeployer,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { HelloWorldApp } from '../app/app'; import { HelloWorldApp } from '../app/app.js';
import { HelloWorldFactories } from '../app/contracts'; import { HelloWorldFactories } from '../app/contracts.js';
import { HelloWorldChecker } from '../deploy/check'; import { HelloWorldChecker } from '../deploy/check.js';
import { HelloWorldConfig } from '../deploy/config'; import { HelloWorldConfig } from '../deploy/config.js';
import { HelloWorldDeployer } from '../deploy/deploy'; import { HelloWorldDeployer } from '../deploy/deploy.js';
describe('deploy', async () => { describe('deploy', async () => {
let multiProvider: MultiProvider; let multiProvider: MultiProvider;
@ -26,7 +26,7 @@ describe('deploy', async () => {
let app: HelloWorldApp; let app: HelloWorldApp;
before(async () => { before(async () => {
const [signer] = await ethers.getSigners(); const [signer] = await hre.ethers.getSigners();
multiProvider = MultiProvider.createTestMultiProvider({ signer }); multiProvider = MultiProvider.createTestMultiProvider({ signer });
const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider);
const ismFactory = new HyperlaneIsmFactory( const ismFactory = new HyperlaneIsmFactory(

@ -1,6 +1,6 @@
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers.js';
import { expect } from 'chai'; import { expect } from 'chai';
import { ethers } from 'hardhat'; import hre from 'hardhat';
import { import {
ChainMap, ChainMap,
@ -12,9 +12,9 @@ import {
TestCoreDeployer, TestCoreDeployer,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { HelloWorldConfig } from '../deploy/config'; import { HelloWorldConfig } from '../deploy/config.js';
import { HelloWorldDeployer } from '../deploy/deploy'; import { HelloWorldDeployer } from '../deploy/deploy.js';
import { HelloWorld } from '../types'; import { HelloWorld } from '../types/index.js';
describe('HelloWorld', async () => { describe('HelloWorld', async () => {
const localChain = Chains.test1; const localChain = Chains.test1;
@ -30,7 +30,7 @@ describe('HelloWorld', async () => {
let config: ChainMap<HelloWorldConfig>; let config: ChainMap<HelloWorldConfig>;
before(async () => { before(async () => {
[signer] = await ethers.getSigners(); [signer] = await hre.ethers.getSigners();
multiProvider = MultiProvider.createTestMultiProvider({ signer }); multiProvider = MultiProvider.createTestMultiProvider({ signer });
const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider); const ismFactoryDeployer = new HyperlaneProxyFactoryDeployer(multiProvider);
const ismFactory = new HyperlaneIsmFactory( const ismFactory = new HyperlaneIsmFactory(

@ -9,11 +9,11 @@
"ES2015", "ES2016", "ES2017", "ES2018", "ES2015", "ES2016", "ES2017", "ES2018",
"ES2019", "ES2020","ES2021", "DOM" "ES2019", "ES2020","ES2021", "DOM"
], ],
"module": "commonjs", "module": "nodenext",
"moduleResolution": "node", "moduleResolution": "nodenext",
"noEmitOnError": true, "noEmitOnError": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noImplicitAny": false, "noImplicitAny": true,
"noImplicitReturns": true, "noImplicitReturns": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"outDir": "./dist", "outDir": "./dist",
@ -21,13 +21,17 @@
"preserveWatchOutput": true, "preserveWatchOutput": true,
"pretty": false, "pretty": false,
"resolveJsonModule": true, "resolveJsonModule": true,
"rootDir": "./", "rootDir": "./src",
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"strict": true, "strict": true,
"target": "ES2020", "target": "es2022",
}, },
"exclude": ["./node_modules/", "./dist/", "./src/types/hardhat.d.ts"], "exclude": ["./node_modules/", "./dist/", "./src/types/hardhat.d.ts"],
"include": ["./src/"], "include": ["./src/"],
"files": ["hardhat.config.ts"] "ts-node": {
"experimentalSpecifierResolution": "node",
"experimentalResolver": true,
"files": true
}
} }

@ -1,6 +1,6 @@
import { agents as mainnet3Agents } from './mainnet3/agent'; import { agents as mainnet3Agents } from './mainnet3/agent.js';
import { agents as testAgents } from './test/agent'; import { agents as testAgents } from './test/agent.js';
import { agents as testnet4Agents } from './testnet4/agent'; import { agents as testnet4Agents } from './testnet4/agent.js';
export const agents = { export const agents = {
mainnet3: mainnet3Agents, mainnet3: mainnet3Agents,

@ -1,5 +1,5 @@
import { helloWorld as mainnet3HelloWorld } from './mainnet3/helloworld'; import { helloWorld as mainnet3HelloWorld } from './mainnet3/helloworld.js';
import { helloWorld as testnet4HelloWorld } from './testnet4/helloworld'; import { helloWorld as testnet4HelloWorld } from './testnet4/helloworld.js';
export const helloworld = { export const helloworld = {
mainnet3: mainnet3HelloWorld, mainnet3: mainnet3HelloWorld,

@ -1,6 +1,6 @@
import { environment as mainnet3 } from './mainnet3'; import { environment as mainnet3 } from './mainnet3/index.js';
import { environment as test } from './test'; import { environment as test } from './test/index.js';
import { environment as testnet4 } from './testnet4'; import { environment as testnet4 } from './testnet4/index.js';
export const environments = { export const environments = {
test, test,

@ -1,5 +1,6 @@
import { import {
Chains, Chains,
GasPaymentEnforcement,
GasPaymentEnforcementPolicyType, GasPaymentEnforcementPolicyType,
RpcConsensusType, RpcConsensusType,
chainMetadata, chainMetadata,
@ -10,18 +11,17 @@ import {
AgentChainConfig, AgentChainConfig,
RootAgentConfig, RootAgentConfig,
getAgentChainNamesFromConfig, getAgentChainNamesFromConfig,
} from '../../../src/config'; } from '../../../src/config/agent/agent.js';
import { import {
GasPaymentEnforcementConfig,
matchingList, matchingList,
routerMatchingList, routerMatchingList,
} from '../../../src/config/agent/relayer'; } from '../../../src/config/agent/relayer.js';
import { ALL_KEY_ROLES, Role } from '../../../src/roles'; import { ALL_KEY_ROLES, Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { environment, supportedChainNames } from './chains'; import { environment, supportedChainNames } from './chains.js';
import { helloWorld } from './helloworld'; import { helloWorld } from './helloworld.js';
import { validatorChainConfig } from './validators'; import { validatorChainConfig } from './validators.js';
import ancient8EthereumUsdcAddresses from './warp/ancient8-USDC-addresses.json'; import ancient8EthereumUsdcAddresses from './warp/ancient8-USDC-addresses.json';
import arbitrumTIAAddresses from './warp/arbitrum-TIA-addresses.json'; import arbitrumTIAAddresses from './warp/arbitrum-TIA-addresses.json';
import inevmEthereumUsdcAddresses from './warp/inevm-USDC-addresses.json'; import inevmEthereumUsdcAddresses from './warp/inevm-USDC-addresses.json';
@ -125,7 +125,7 @@ const contextBase = {
}, },
} as const; } as const;
const gasPaymentEnforcement: GasPaymentEnforcementConfig[] = [ const gasPaymentEnforcement: GasPaymentEnforcement[] = [
{ {
type: GasPaymentEnforcementPolicyType.OnChainFeeQuoting, type: GasPaymentEnforcementPolicyType.OnChainFeeQuoting,
}, },

@ -5,7 +5,7 @@ import {
chainMetadata, chainMetadata,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { getChainMetadatas } from '../../../src/config/chain'; import { getChainMetadatas } from '../../../src/config/chain.js';
// The `Mainnets` from the SDK are all supported chains for the mainnet3 environment. // The `Mainnets` from the SDK are all supported chains for the mainnet3 environment.
// These chains may be any protocol type. // These chains may be any protocol type.

@ -20,9 +20,9 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, objMap } from '@hyperlane-xyz/utils'; import { Address, objMap } from '@hyperlane-xyz/utils';
import { supportedChainNames } from './chains'; import { supportedChainNames } from './chains.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { DEPLOYER, owners } from './owners'; import { DEPLOYER, owners } from './owners.js';
export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => { export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => {
const originMultisigs: ChainMap<MultisigConfig> = Object.fromEntries( const originMultisigs: ChainMap<MultisigConfig> = Object.fromEntries(

@ -1,10 +1,10 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk'; import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { KeyFunderConfig } from '../../../src/config/funding'; import { KeyFunderConfig } from '../../../src/config/funding.js';
import { Role } from '../../../src/roles'; import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { environment } from './chains'; import { environment } from './chains.js';
export const keyFunderConfig: KeyFunderConfig = { export const keyFunderConfig: KeyFunderConfig = {
docker: { docker: {

@ -5,14 +5,12 @@ import { objMap } from '@hyperlane-xyz/utils';
import { import {
AllStorageGasOracleConfigs, AllStorageGasOracleConfigs,
getAllStorageGasOracleConfigs,
} from '../../../src/config';
import {
TOKEN_EXCHANGE_RATE_DECIMALS, TOKEN_EXCHANGE_RATE_DECIMALS,
getAllStorageGasOracleConfigs,
getTokenExchangeRateFromValues, getTokenExchangeRateFromValues,
} from '../../../src/config/gas-oracle'; } from '../../../src/config/gas-oracle.js';
import { supportedChainNames } from './chains'; import { supportedChainNames } from './chains.js';
import rawGasPrices from './gasPrices.json'; import rawGasPrices from './gasPrices.json';
import rawTokenPrices from './tokenPrices.json'; import rawTokenPrices from './tokenPrices.json';

@ -1,10 +1,12 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk'; import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { HelloWorldConfig } from '../../../src/config'; import {
import { HelloWorldKathyRunMode } from '../../../src/config/helloworld/types'; HelloWorldConfig,
import { Contexts } from '../../contexts'; HelloWorldKathyRunMode,
} from '../../../src/config/helloworld/types.js';
import { Contexts } from '../../contexts.js';
import { environment } from './chains'; import { environment } from './chains.js';
import hyperlaneAddresses from './helloworld/hyperlane/addresses.json'; import hyperlaneAddresses from './helloworld/hyperlane/addresses.json';
import rcAddresses from './helloworld/rc/addresses.json'; import rcAddresses from './helloworld/rc/addresses.json';

@ -10,9 +10,9 @@ import {
MainnetChains, MainnetChains,
ethereumChainNames, ethereumChainNames,
supportedChainNames, supportedChainNames,
} from './chains'; } from './chains.js';
import { storageGasOracleConfig } from './gas-oracle'; import { storageGasOracleConfig } from './gas-oracle.js';
import { DEPLOYER, owners } from './owners'; import { DEPLOYER, owners } from './owners.js';
const FOREIGN_DEFAULT_OVERHEAD = 600_000; // cosmwasm warp route somewhat arbitrarily chosen const FOREIGN_DEFAULT_OVERHEAD = 600_000; // cosmwasm warp route somewhat arbitrarily chosen

@ -4,20 +4,20 @@ import { ProtocolType, objFilter } from '@hyperlane-xyz/utils';
import { import {
getKeysForRole, getKeysForRole,
getMultiProviderForRole, getMultiProviderForRole,
} from '../../../scripts/agent-utils'; } from '../../../scripts/agent-utils.js';
import { EnvironmentConfig } from '../../../src/config'; import { EnvironmentConfig } from '../../../src/config/environment.js';
import { Role } from '../../../src/roles'; import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { agents } from './agent'; import { agents } from './agent.js';
import { environment as environmentName, mainnetConfigs } from './chains'; import { environment as environmentName, mainnetConfigs } from './chains.js';
import { core } from './core'; import { core } from './core.js';
import { keyFunderConfig } from './funding'; import { keyFunderConfig } from './funding.js';
import { helloWorld } from './helloworld'; import { helloWorld } from './helloworld.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { infrastructure } from './infrastructure'; import { infrastructure } from './infrastructure.js';
import { bridgeAdapterConfigs, relayerConfig } from './liquidityLayer'; import { bridgeAdapterConfigs, relayerConfig } from './liquidityLayer.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const environment: EnvironmentConfig = { export const environment: EnvironmentConfig = {
environment: environmentName, environment: environmentName,

@ -1,4 +1,4 @@
import { InfrastructureConfig } from '../../../src/config'; import { InfrastructureConfig } from '../../../src/config/infrastructure.js';
export const infrastructure: InfrastructureConfig = { export const infrastructure: InfrastructureConfig = {
kubernetes: { kubernetes: {

@ -8,9 +8,9 @@ import {
getDomainId, getDomainId,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware'; import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware.js';
import { environment } from './chains'; import { environment } from './chains.js';
const circleDomainMapping = [ const circleDomainMapping = [
{ {

@ -6,7 +6,7 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, objFilter, objMap } from '@hyperlane-xyz/utils'; import { Address, objFilter, objMap } from '@hyperlane-xyz/utils';
import { ethereumChainNames } from './chains'; import { ethereumChainNames } from './chains.js';
export const timelocks: ChainMap<Address | undefined> = { export const timelocks: ChainMap<Address | undefined> = {
arbitrum: '0xAC98b0cD1B64EA4fe133C6D2EDaf842cE5cF4b01', arbitrum: '0xAC98b0cD1B64EA4fe133C6D2EDaf842cE5cF4b01',

@ -1,10 +1,10 @@
import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk'; import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk';
import { ValidatorBaseChainConfigMap } from '../../../src/config/agent'; import { ValidatorBaseChainConfigMap } from '../../../src/config/agent/validator.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { validatorBaseConfigsFn } from '../utils'; import { validatorBaseConfigsFn } from '../utils.js';
import { environment } from './chains'; import { environment } from './chains.js';
export const validatorChainConfig = ( export const validatorChainConfig = (
context: Contexts, context: Contexts,

@ -3,12 +3,12 @@ import {
RpcConsensusType, RpcConsensusType,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { RootAgentConfig } from '../../../src/config'; import { RootAgentConfig } from '../../../src/config/agent/agent.js';
import { ALL_KEY_ROLES } from '../../../src/roles'; import { ALL_KEY_ROLES } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { agentChainNames, chainNames } from './chains'; import { agentChainNames, chainNames } from './chains.js';
import { validators } from './validators'; import { validators } from './validators.js';
const roleBase = { const roleBase = {
docker: { docker: {

@ -1,6 +1,6 @@
import { AggregationIsmConfig, IsmType } from '@hyperlane-xyz/sdk'; import { AggregationIsmConfig, IsmType } from '@hyperlane-xyz/sdk';
import { merkleRootMultisig, messageIdMultisig } from './multisigIsm'; import { merkleRootMultisig, messageIdMultisig } from './multisigIsm.js';
export const aggregationIsm = (validatorKey: string): AggregationIsmConfig => { export const aggregationIsm = (validatorKey: string): AggregationIsmConfig => {
return { return {

@ -1,6 +1,6 @@
import { ChainMap, ChainMetadata, chainMetadata } from '@hyperlane-xyz/sdk'; import { ChainMap, ChainMetadata, chainMetadata } from '@hyperlane-xyz/sdk';
import { AgentChainNames, Role } from '../../../src/roles'; import { AgentChainNames, Role } from '../../../src/roles.js';
export const testConfigs: ChainMap<ChainMetadata> = { export const testConfigs: ChainMap<ChainMetadata> = {
test1: chainMetadata.test1, test1: chainMetadata.test1,

@ -9,15 +9,15 @@ import {
IgpHookConfig, IgpHookConfig,
IsmType, IsmType,
MerkleTreeHookConfig, MerkleTreeHookConfig,
ProtocolFeeHookConfig,
RoutingIsmConfig, RoutingIsmConfig,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { ProtocolFeeHookConfig } from '@hyperlane-xyz/sdk/src/hook/types';
import { objMap } from '@hyperlane-xyz/utils'; import { objMap } from '@hyperlane-xyz/utils';
import { aggregationIsm } from './aggregationIsm'; import { aggregationIsm } from './aggregationIsm.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { chainToValidator } from './multisigIsm'; import { chainToValidator } from './multisigIsm.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => { export const core: ChainMap<CoreConfig> = objMap(owners, (local, owner) => {
const defaultIsm: RoutingIsmConfig = { const defaultIsm: RoutingIsmConfig = {

@ -2,13 +2,13 @@ import { BigNumber, ethers } from 'ethers';
import { ChainMap, ChainName } from '@hyperlane-xyz/sdk'; import { ChainMap, ChainName } from '@hyperlane-xyz/sdk';
import { AllStorageGasOracleConfigs } from '../../../src/config';
import { import {
AllStorageGasOracleConfigs,
TOKEN_EXCHANGE_RATE_DECIMALS, TOKEN_EXCHANGE_RATE_DECIMALS,
getAllStorageGasOracleConfigs, getAllStorageGasOracleConfigs,
} from '../../../src/config/gas-oracle'; } from '../../../src/config/gas-oracle.js';
import { chainNames } from './chains'; import { chainNames } from './chains.js';
const TEST_TOKEN_EXCHANGE_RATE = ethers.utils.parseUnits( const TEST_TOKEN_EXCHANGE_RATE = ethers.utils.parseUnits(
'1', '1',

@ -6,9 +6,9 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, exclude, objMap } from '@hyperlane-xyz/utils'; import { Address, exclude, objMap } from '@hyperlane-xyz/utils';
import { TestChains, chainNames } from './chains'; import { TestChains, chainNames } from './chains.js';
import { multisigIsm } from './multisigIsm'; import { multisigIsm } from './multisigIsm.js';
import { owners } from './owners'; import { owners } from './owners.js';
function getGasOracles(local: TestChains) { function getGasOracles(local: TestChains) {
return Object.fromEntries( return Object.fromEntries(

@ -2,14 +2,14 @@ import { JsonRpcProvider } from '@ethersproject/providers';
import { MultiProvider } from '@hyperlane-xyz/sdk'; import { MultiProvider } from '@hyperlane-xyz/sdk';
import { EnvironmentConfig } from '../../../src/config'; import { EnvironmentConfig } from '../../../src/config/environment.js';
import { agents } from './agent'; import { agents } from './agent.js';
import { testConfigs } from './chains'; import { testConfigs } from './chains.js';
import { core } from './core'; import { core } from './core.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { infra } from './infra'; import { infra } from './infra.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const environment: EnvironmentConfig = { export const environment: EnvironmentConfig = {
environment: 'test', environment: 'test',

@ -1,4 +1,4 @@
import { InfrastructureConfig } from '../../../src/config'; import { InfrastructureConfig } from '../../../src/config/infrastructure.js';
export const infra: InfrastructureConfig = { export const infra: InfrastructureConfig = {
kubernetes: { clusterName: '' }, kubernetes: { clusterName: '' },

@ -1,6 +1,6 @@
import { ChainMap, OwnableConfig } from '@hyperlane-xyz/sdk'; import { ChainMap, OwnableConfig } from '@hyperlane-xyz/sdk';
import { chainNames } from './chains'; import { chainNames } from './chains.js';
// Owner is hardhat account 0 // Owner is hardhat account 0
const OWNER_ADDRESS = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'; const OWNER_ADDRESS = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266';

@ -1,6 +1,6 @@
import { IsmType, RoutingIsmConfig } from '@hyperlane-xyz/sdk'; import { IsmType, RoutingIsmConfig } from '@hyperlane-xyz/sdk';
import { multisigIsm } from './multisigIsm'; import { multisigIsm } from './multisigIsm.js';
export const routingIsm = ( export const routingIsm = (
local_chain: string, local_chain: string,

@ -3,7 +3,7 @@ import { ChainName } from '@hyperlane-xyz/sdk';
import { import {
CheckpointSyncerType, CheckpointSyncerType,
ValidatorBaseChainConfigMap, ValidatorBaseChainConfigMap,
} from '../../../src/config'; } from '../../../src/config/agent/validator.js';
const localStoragePath = (chainName: ChainName) => const localStoragePath = (chainName: ChainName) =>
`/tmp/hyperlane-test-${chainName}-validator`; `/tmp/hyperlane-test-${chainName}-validator`;

@ -1,5 +1,6 @@
import { import {
Chains, Chains,
GasPaymentEnforcement,
GasPaymentEnforcementPolicyType, GasPaymentEnforcementPolicyType,
RpcConsensusType, RpcConsensusType,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
@ -8,15 +9,14 @@ import {
AgentChainConfig, AgentChainConfig,
RootAgentConfig, RootAgentConfig,
getAgentChainNamesFromConfig, getAgentChainNamesFromConfig,
routerMatchingList, } from '../../../src/config/agent/agent.js';
} from '../../../src/config'; import { routerMatchingList } from '../../../src/config/agent/relayer.js';
import { GasPaymentEnforcementConfig } from '../../../src/config/agent/relayer'; import { ALL_KEY_ROLES, Role } from '../../../src/roles.js';
import { ALL_KEY_ROLES, Role } from '../../../src/roles'; import { Contexts } from '../../contexts.js';
import { Contexts } from '../../contexts';
import { environment, supportedChainNames } from './chains'; import { environment, supportedChainNames } from './chains.js';
import { helloWorld } from './helloworld'; import { helloWorld } from './helloworld.js';
import { validatorChainConfig } from './validators'; import { validatorChainConfig } from './validators.js';
import plumetestnetSepoliaAddresses from './warp/plumetestnet-sepolia-addresses.json'; import plumetestnetSepoliaAddresses from './warp/plumetestnet-sepolia-addresses.json';
const releaseCandidateHelloworldMatchingList = routerMatchingList( const releaseCandidateHelloworldMatchingList = routerMatchingList(
@ -79,7 +79,7 @@ const contextBase = {
}, },
} as const; } as const;
const gasPaymentEnforcement: GasPaymentEnforcementConfig[] = [ const gasPaymentEnforcement: GasPaymentEnforcement[] = [
// Default policy is OnChainFeeQuoting // Default policy is OnChainFeeQuoting
{ {
type: GasPaymentEnforcementPolicyType.OnChainFeeQuoting, type: GasPaymentEnforcementPolicyType.OnChainFeeQuoting,

@ -20,9 +20,9 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, objMap } from '@hyperlane-xyz/utils'; import { Address, objMap } from '@hyperlane-xyz/utils';
import { supportedChainNames } from './chains'; import { supportedChainNames } from './chains.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const core: ChainMap<CoreConfig> = objMap( export const core: ChainMap<CoreConfig> = objMap(
owners, owners,

@ -1,10 +1,10 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk'; import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { KeyFunderConfig } from '../../../src/config/funding'; import { KeyFunderConfig } from '../../../src/config/funding.js';
import { Role } from '../../../src/roles'; import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { environment } from './chains'; import { environment } from './chains.js';
export const keyFunderConfig: KeyFunderConfig = { export const keyFunderConfig: KeyFunderConfig = {
docker: { docker: {

@ -4,14 +4,12 @@ import { ChainMap, ChainName } from '@hyperlane-xyz/sdk';
import { import {
AllStorageGasOracleConfigs, AllStorageGasOracleConfigs,
getAllStorageGasOracleConfigs,
} from '../../../src/config';
import {
TOKEN_EXCHANGE_RATE_DECIMALS, TOKEN_EXCHANGE_RATE_DECIMALS,
getAllStorageGasOracleConfigs,
getTokenExchangeRateFromValues, getTokenExchangeRateFromValues,
} from '../../../src/config/gas-oracle'; } from '../../../src/config/gas-oracle.js';
import { supportedChainNames } from './chains'; import { supportedChainNames } from './chains.js';
// Taken by looking at each testnet and overestimating gas prices // Taken by looking at each testnet and overestimating gas prices
const gasPrices: ChainMap<BigNumber> = { const gasPrices: ChainMap<BigNumber> = {

@ -1,10 +1,12 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk'; import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { HelloWorldConfig } from '../../../src/config'; import {
import { HelloWorldKathyRunMode } from '../../../src/config/helloworld/types'; HelloWorldConfig,
import { Contexts } from '../../contexts'; HelloWorldKathyRunMode,
} from '../../../src/config/helloworld/types.js';
import { Contexts } from '../../contexts.js';
import { environment } from './chains'; import { environment } from './chains.js';
import hyperlaneAddresses from './helloworld/hyperlane/addresses.json'; import hyperlaneAddresses from './helloworld/hyperlane/addresses.json';
import rcAddresses from './helloworld/rc/addresses.json'; import rcAddresses from './helloworld/rc/addresses.json';

@ -6,9 +6,9 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Address, exclude, objMap } from '@hyperlane-xyz/utils'; import { Address, exclude, objMap } from '@hyperlane-xyz/utils';
import { supportedChainNames } from './chains'; import { supportedChainNames } from './chains.js';
import { storageGasOracleConfig } from './gas-oracle'; import { storageGasOracleConfig } from './gas-oracle.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const igp: ChainMap<IgpConfig> = objMap(owners, (chain, ownerConfig) => { export const igp: ChainMap<IgpConfig> = objMap(owners, (chain, ownerConfig) => {
return { return {

@ -3,21 +3,21 @@ import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { import {
getKeysForRole, getKeysForRole,
getMultiProviderForRole, getMultiProviderForRole,
} from '../../../scripts/agent-utils'; } from '../../../scripts/agent-utils.js';
import { EnvironmentConfig } from '../../../src/config'; import { EnvironmentConfig } from '../../../src/config/environment.js';
import { Role } from '../../../src/roles'; import { Role } from '../../../src/roles.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { agents } from './agent'; import { agents } from './agent.js';
import { environment as environmentName, testnetConfigs } from './chains'; import { environment as environmentName, testnetConfigs } from './chains.js';
import { core } from './core'; import { core } from './core.js';
import { keyFunderConfig } from './funding'; import { keyFunderConfig } from './funding.js';
import { helloWorld } from './helloworld'; import { helloWorld } from './helloworld.js';
import { igp } from './igp'; import { igp } from './igp.js';
import { infrastructure } from './infrastructure'; import { infrastructure } from './infrastructure.js';
import { bridgeAdapterConfigs } from './liquidityLayer'; import { bridgeAdapterConfigs } from './liquidityLayer.js';
import { liquidityLayerRelayerConfig } from './middleware'; import { liquidityLayerRelayerConfig } from './middleware.js';
import { owners } from './owners'; import { owners } from './owners.js';
export const environment: EnvironmentConfig = { export const environment: EnvironmentConfig = {
environment: environmentName, environment: environmentName,

@ -1,4 +1,4 @@
import { InfrastructureConfig } from '../../../src/config'; import { InfrastructureConfig } from '../../../src/config/infrastructure.js';
export const infrastructure: InfrastructureConfig = { export const infrastructure: InfrastructureConfig = {
kubernetes: { kubernetes: {

@ -1,8 +1,8 @@
import { RpcConsensusType } from '@hyperlane-xyz/sdk'; import { RpcConsensusType } from '@hyperlane-xyz/sdk';
import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware'; import { LiquidityLayerRelayerConfig } from '../../../src/config/middleware.js';
import { environment } from './chains'; import { environment } from './chains.js';
export const liquidityLayerRelayerConfig: LiquidityLayerRelayerConfig = { export const liquidityLayerRelayerConfig: LiquidityLayerRelayerConfig = {
docker: { docker: {

@ -1,6 +1,6 @@
import { ChainMap, OwnableConfig } from '@hyperlane-xyz/sdk'; import { ChainMap, OwnableConfig } from '@hyperlane-xyz/sdk';
import { supportedChainNames } from '../testnet4/chains'; import { supportedChainNames } from '../testnet4/chains.js';
const ETHEREUM_DEPLOYER_ADDRESS = '0xfaD1C94469700833717Fa8a3017278BC1cA8031C'; const ETHEREUM_DEPLOYER_ADDRESS = '0xfaD1C94469700833717Fa8a3017278BC1cA8031C';
// const SEALEVEL_DEPLOYER_ADDRESS = '6DjHX6Ezjpq3zZMZ8KsqyoFYo1zPSDoiZmLLkxD4xKXS'; // const SEALEVEL_DEPLOYER_ADDRESS = '6DjHX6Ezjpq3zZMZ8KsqyoFYo1zPSDoiZmLLkxD4xKXS';

@ -1,10 +1,10 @@
import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk'; import { chainMetadata, getReorgPeriod } from '@hyperlane-xyz/sdk';
import { ValidatorBaseChainConfigMap } from '../../../src/config/agent'; import { ValidatorBaseChainConfigMap } from '../../../src/config/agent/validator.js';
import { Contexts } from '../../contexts'; import { Contexts } from '../../contexts.js';
import { validatorBaseConfigsFn } from '../utils'; import { validatorBaseConfigsFn } from '../utils.js';
import { environment } from './chains'; import { environment } from './chains.js';
export const validatorChainConfig = ( export const validatorChainConfig = (
context: Contexts, context: Contexts,

@ -3,8 +3,8 @@ import { CoreChainName } from '@hyperlane-xyz/sdk';
import { import {
CheckpointSyncerType, CheckpointSyncerType,
ValidatorBaseConfig, ValidatorBaseConfig,
} from '../../src/config/agent/validator'; } from '../../src/config/agent/validator.js';
import { Contexts } from '../contexts'; import { Contexts } from '../contexts.js';
export type ValidatorKey = { export type ValidatorKey = {
identifier: string; identifier: string;

@ -6,13 +6,13 @@ import {
defaultMultisigConfigs, defaultMultisigConfigs,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { DeployEnvironment } from '../src/config'; import { DeployEnvironment } from '../src/config/environment.js';
import { Contexts } from './contexts'; import { Contexts } from './contexts.js';
import { supportedChainNames as mainnet3Chains } from './environments/mainnet3/chains'; import { supportedChainNames as mainnet3Chains } from './environments/mainnet3/chains.js';
import { chainNames as testChains } from './environments/test/chains'; import { chainNames as testChains } from './environments/test/chains.js';
import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains'; import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains.js';
import { rcMultisigIsmConfigs } from './rcMultisigIsmConfigs'; import { rcMultisigIsmConfigs } from './rcMultisigIsmConfigs.js';
const chains = { const chains = {
mainnet3: mainnet3Chains, mainnet3: mainnet3Chains,

@ -9,13 +9,13 @@ import {
TestChains, TestChains,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { DeployEnvironment } from '../src/config'; import { DeployEnvironment } from '../src/config/environment.js';
import { Contexts } from './contexts'; import { Contexts } from './contexts.js';
import { environments } from './environments'; import { environments } from './environments/index.js';
import { ethereumChainNames as mainnet3Chains } from './environments/mainnet3/chains'; import { ethereumChainNames as mainnet3Chains } from './environments/mainnet3/chains.js';
import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains'; import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains.js';
import { multisigIsm } from './multisigIsm'; import { multisigIsm } from './multisigIsm.js';
const chains = { const chains = {
test: TestChains, test: TestChains,

@ -6,7 +6,7 @@ if [ -z "$ENVIRONMENT" ] || [ -z "$MODULE" ]; then
exit 1 exit 1
fi fi
CHAINS=`yarn ts-node ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | \ CHAINS=`yarn tsx ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | \
jq -r 'to_entries | map(select(.value.protocol=="ethereum")) | map(.key) ' | \ jq -r 'to_entries | map(select(.value.protocol=="ethereum")) | map(.key) ' | \
tr -d '\"[],'` tr -d '\"[],'`

@ -13,7 +13,7 @@ trap 'jobs -p | xargs -r kill' EXIT
# exit 1 on any subsequent failures # exit 1 on any subsequent failures
set -e set -e
RPC_URL=`yarn ts-node ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | jq -r ".$CHAIN.rpcUrls[0].http"` RPC_URL=`yarn tsx ./scripts/print-chain-metadatas.ts -e $ENVIRONMENT | jq -r ".$CHAIN.rpcUrls[0].http"`
anvil --fork-url $RPC_URL --fork-retry-backoff 3 --compute-units-per-second 200 --gas-price 1 --silent & anvil --fork-url $RPC_URL --fork-retry-backoff 3 --compute-units-per-second 200 --gas-price 1 --silent &
ANVIL_PID=$! ANVIL_PID=$!
@ -25,21 +25,21 @@ done
# echo all subsequent commands # echo all subsequent commands
set -x set -x
yarn ts-node ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE yarn tsx ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE
# get balance # get balance
DEPLOYER="0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba" DEPLOYER="0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba"
BEFORE=$(cast balance $DEPLOYER --rpc-url http://localhost:8545) BEFORE=$(cast balance $DEPLOYER --rpc-url http://localhost:8545)
yarn ts-node ./scripts/deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE yarn tsx ./scripts/deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE
AFTER=$(cast balance $DEPLOYER --rpc-url http://localhost:8545) AFTER=$(cast balance $DEPLOYER --rpc-url http://localhost:8545)
DEPLOY_DELTA="$((BEFORE-AFTER))" DEPLOY_DELTA="$((BEFORE-AFTER))"
BEFORE=$(cast balance $DEPLOYER --rpc-url http://localhost:8545) BEFORE=$(cast balance $DEPLOYER --rpc-url http://localhost:8545)
yarn ts-node ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN --govern -m $MODULE yarn tsx ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN --govern -m $MODULE
AFTER=$(cast balance $DEPLOYER --rpc-url http://localhost:8545) AFTER=$(cast balance $DEPLOYER --rpc-url http://localhost:8545)
GOVERN_DELTA="$((BEFORE-AFTER))" GOVERN_DELTA="$((BEFORE-AFTER))"
yarn ts-node ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE yarn tsx ./scripts/check-deploy.ts -e $ENVIRONMENT -f $CHAIN -m $MODULE

@ -0,0 +1,19 @@
import '@nomiclabs/hardhat-ethers';
import '@nomiclabs/hardhat-waffle';
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: '0.7.6',
},
networks: {
hardhat: {
mining: {
auto: true,
interval: 2000,
},
},
},
};

@ -1,186 +0,0 @@
import '@nomiclabs/hardhat-etherscan';
import '@nomiclabs/hardhat-waffle';
import { task } from 'hardhat/config';
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { Mailbox, TestSendReceiver__factory } from '@hyperlane-xyz/core';
import {
ChainName,
HookType,
HyperlaneCore,
MultiProvider,
} from '@hyperlane-xyz/sdk';
import { addressToBytes32 } from '@hyperlane-xyz/utils';
import { Modules, getAddresses } from './scripts/agent-utils';
import { sleep } from './src/utils/utils';
enum MailboxHookType {
REQUIRED = 'requiredHook',
DEFAULT = 'defaultHook',
}
/**
* If a hookArg is provided, set the mailbox hook to the defaultHookArg.
* The hook is set either as the default hook or the required hook,
* depending on the mailboxHookType argument.
*/
async function setMailboxHook(
mailbox: Mailbox,
coreAddresses: any,
local: ChainName,
mailboxHookType: MailboxHookType,
hookArg: HookType,
) {
const hook = coreAddresses[local][hookArg];
switch (mailboxHookType) {
case MailboxHookType.REQUIRED: {
await mailbox.setRequiredHook(hook);
break;
}
case MailboxHookType.DEFAULT: {
await mailbox.setDefaultHook(hook);
break;
}
}
console.log(`set the ${mailboxHookType} hook on ${local} to ${hook}`);
}
const chainSummary = async (core: HyperlaneCore, chain: ChainName) => {
const coreContracts = core.getContracts(chain);
const mailbox = coreContracts.mailbox;
const dispatched = await mailbox.nonce();
// TODO: Allow processed messages to be filtered by
// origin, possibly sender and recipient.
const processFilter = mailbox.filters.Process();
const processes = await mailbox.queryFilter(processFilter);
const processed = processes.length;
const summary = {
chain,
dispatched,
processed,
};
return summary;
};
task('kathy', 'Dispatches random hyperlane messages')
.addParam(
'messages',
'Number of messages to send; defaults to having no limit',
'0',
)
.addParam('timeout', 'Time to wait between messages in ms.', '5000')
.addFlag('mineforever', 'Mine forever after sending messages')
.addParam(
MailboxHookType.DEFAULT,
'Default hook to call in postDispatch',
HookType.AGGREGATION,
)
.addParam(
MailboxHookType.REQUIRED,
'Required hook to call in postDispatch',
HookType.PROTOCOL_FEE,
)
.setAction(
async (
taskArgs: {
messages: string;
timeout: string;
mineforever: boolean;
defaultHook: HookType;
requiredHook: HookType;
},
hre: HardhatRuntimeEnvironment,
) => {
const timeout = Number.parseInt(taskArgs.timeout);
const environment = 'test';
const [signer] = await hre.ethers.getSigners();
const multiProvider = MultiProvider.createTestMultiProvider({ signer });
const addresses = getAddresses(environment, Modules.CORE);
const core = HyperlaneCore.fromAddressesMap(addresses, multiProvider);
const randomElement = <T>(list: T[]) =>
list[Math.floor(Math.random() * list.length)];
// Deploy a recipient
const recipientF = new TestSendReceiver__factory(signer);
const recipient = await recipientF.deploy();
await recipient.deployTransaction.wait();
const isAutomine: boolean = await hre.network.provider.send(
'hardhat_getAutomine',
);
// Generate artificial traffic
let messages = Number.parseInt(taskArgs.messages) || 0;
const run_forever = messages === 0;
while (run_forever || messages-- > 0) {
// Round robin origin chain
const local = core.chains()[messages % core.chains().length];
// Random remote chain
const remote: ChainName = randomElement(await core.remoteChains(local));
const remoteId = multiProvider.getDomainId(remote);
const contracts = core.getContracts(local);
const mailbox = contracts.mailbox;
await setMailboxHook(
mailbox,
addresses,
local,
MailboxHookType.DEFAULT,
taskArgs.defaultHook,
);
await setMailboxHook(
mailbox,
addresses,
local,
MailboxHookType.REQUIRED,
taskArgs.requiredHook,
);
const quote = await mailbox['quoteDispatch(uint32,bytes32,bytes)'](
remoteId,
addressToBytes32(recipient.address),
'0x1234',
);
await recipient['dispatchToSelf(address,uint32,bytes)'](
mailbox.address,
remoteId,
'0x1234',
{
value: quote,
},
);
console.log(
`send to ${recipient.address} on ${remote} via mailbox ${
mailbox.address
} on ${local} with nonce ${(await mailbox.nonce()) - 1}`,
);
console.log(await chainSummary(core, local));
console.log(await chainSummary(core, remote));
await sleep(timeout);
}
while (taskArgs.mineforever && isAutomine) {
await hre.network.provider.send('hardhat_mine', ['0x01']);
await sleep(timeout);
}
},
);
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: '0.7.6',
},
networks: {
hardhat: {
mining: {
auto: true,
interval: 2000,
},
},
},
};

@ -66,7 +66,7 @@ The helloworld-kathy container
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- ./node_modules/.bin/ts-node - ./node_modules/.bin/tsx
- ./typescript/infra/scripts/helloworld/kathy.ts - ./typescript/infra/scripts/helloworld/kathy.ts
- -e - -e
- {{ .Values.hyperlane.runEnv }} - {{ .Values.hyperlane.runEnv }}

@ -19,7 +19,7 @@ spec:
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- ./node_modules/.bin/ts-node - ./node_modules/.bin/tsx
- ./typescript/infra/scripts/funding/fund-keys-from-deployer.ts - ./typescript/infra/scripts/funding/fund-keys-from-deployer.ts
- -e - -e
- {{ .Values.hyperlane.runEnv }} - {{ .Values.hyperlane.runEnv }}

@ -17,7 +17,7 @@ spec:
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- ./node_modules/.bin/ts-node - ./node_modules/.bin/tsx
- ./typescript/infra/scripts/middleware/circle-relayer.ts - ./typescript/infra/scripts/middleware/circle-relayer.ts
- -e - -e
- {{ .Values.hyperlane.runEnv }} - {{ .Values.hyperlane.runEnv }}

@ -17,7 +17,7 @@ spec:
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- ./node_modules/.bin/ts-node - ./node_modules/.bin/tsx
- ./typescript/infra/scripts/middleware/portal-relayer.ts - ./typescript/infra/scripts/middleware/portal-relayer.ts
- -e - -e
- {{ .Values.hyperlane.runEnv }} - {{ .Values.hyperlane.runEnv }}

@ -59,7 +59,7 @@ The warp-routes container
image: {{ .Values.image.repository }}:{{ .Values.image.tag }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
imagePullPolicy: IfNotPresent imagePullPolicy: IfNotPresent
command: command:
- ./node_modules/.bin/ts-node - ./node_modules/.bin/tsx
- ./typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts - ./typescript/infra/scripts/warp-routes/monitor-warp-routes-balances.ts
- -v - -v
- "10000" - "10000"

@ -28,7 +28,7 @@
"yargs": "^17.7.2" "yargs": "^17.7.2"
}, },
"devDependencies": { "devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.2.1", "@nomiclabs/hardhat-ethers": "^2.2.3",
"@nomiclabs/hardhat-waffle": "^2.0.6", "@nomiclabs/hardhat-waffle": "^2.0.6",
"@types/chai": "^4.2.21", "@types/chai": "^4.2.21",
"@types/json-stable-stringify": "^1.0.36", "@types/json-stable-stringify": "^1.0.36",
@ -40,11 +40,11 @@
"chai": "^4.3.6", "chai": "^4.3.6",
"ethereum-waffle": "^4.0.10", "ethereum-waffle": "^4.0.10",
"ethers": "^5.7.2", "ethers": "^5.7.2",
"hardhat": "^2.19.0", "hardhat": "^2.22.2",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"ts-node": "^10.8.0", "tsx": "^4.7.1",
"typescript": "5.1.6" "typescript": "5.3.3"
}, },
"private": true, "private": true,
"homepage": "https://www.hyperlane.xyz", "homepage": "https://www.hyperlane.xyz",
@ -54,24 +54,24 @@
"Infrastructure" "Infrastructure"
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "dist/index.js", "type": "module",
"prepublish": "yarn build", "prepublish": "yarn build",
"repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo", "repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo",
"scripts": { "scripts": {
"deploy-core": "ts-node scripts/deploy.ts -e test -m core",
"deploy-igp": "ts-node scripts/deploy.ts -e test -m igp",
"deploy-ism": "ts-node scripts/deploy.ts -e test -m ism",
"deploy-helloworld": "ts-node scripts/deploy.ts -e test -m helloworld",
"deploy-hook": "ts-node scripts/deploy.ts -e test -m hook",
"build": "tsc", "build": "tsc",
"clean": "rm -rf ./dist ./cache",
"check": "tsc --noEmit", "check": "tsc --noEmit",
"kathy": "hardhat kathy --network localhost", "clean": "rm -rf ./dist ./cache",
"announce": "hardhat announce --network localhost", "deploy-core": "tsx scripts/deploy.ts -e test -m core",
"node": "hardhat node", "deploy-igp": "tsx scripts/deploy.ts -e test -m igp",
"prettier": "prettier --write *.ts ./src ./config ./scripts ./test", "deploy-ism": "tsx scripts/deploy.ts -e test -m ism",
"test": "mocha --config ../sdk/.mocharc.json test/**/*.test.ts && yarn test:hardhat", "deploy-helloworld": "tsx scripts/deploy.ts -e test -m helloworld",
"test:hardhat": "hardhat test test/govern.hardhat-test.ts", "deploy-hook": "tsx scripts/deploy.ts -e test -m hook",
"hardhat-esm": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat --config hardhat.config.cts",
"kathy": "yarn tsx ./scripts/send-test-messages.ts",
"prettier": "prettier --write ./src ./config ./scripts ./test",
"test": "yarn test:unit && yarn test:hardhat",
"test:unit": "mocha --config ../sdk/.mocharc.json test/**/*.test.ts",
"test:hardhat": "yarn hardhat-esm test test/govern.hardhat-test.ts",
"test:ci": "yarn test" "test:ci": "yarn test"
}, },
"peerDependencies": { "peerDependencies": {

@ -1,6 +1,5 @@
import debug from 'debug';
import path from 'path'; import path from 'path';
import yargs from 'yargs'; import yargs, { Argv } from 'yargs';
import { import {
AllChains, AllChains,
@ -18,26 +17,28 @@ import {
ProtocolType, ProtocolType,
objMap, objMap,
promiseObjAll, promiseObjAll,
rootLogger,
symmetricDifference, symmetricDifference,
} from '@hyperlane-xyz/utils'; } from '@hyperlane-xyz/utils';
import { Contexts } from '../config/contexts'; import { Contexts } from '../config/contexts.js';
import { agents } from '../config/environments/agents'; import { agents } from '../config/environments/agents.js';
import { validatorBaseConfigsFn } from '../config/environments/utils'; import { validatorBaseConfigsFn } from '../config/environments/utils.js';
import { getCurrentKubernetesContext } from '../src/agents'; import { getCurrentKubernetesContext } from '../src/agents/index.js';
import { getCloudAgentKey } from '../src/agents/key-utils'; import { getCloudAgentKey } from '../src/agents/key-utils.js';
import { CloudAgentKey } from '../src/agents/keys'; import { CloudAgentKey } from '../src/agents/keys.js';
import { RootAgentConfig } from '../src/config/agent/agent.js';
import { fetchProvider } from '../src/config/chain.js';
import { import {
DeployEnvironment, DeployEnvironment,
EnvironmentConfig, EnvironmentConfig,
RootAgentConfig, EnvironmentNames,
} from '../src/config'; deployEnvToSdkEnv,
import { fetchProvider } from '../src/config/chain'; } from '../src/config/environment.js';
import { EnvironmentNames, deployEnvToSdkEnv } from '../src/config/environment'; import { Role } from '../src/roles.js';
import { Role } from '../src/roles'; import { assertContext, assertRole, readJSON } from '../src/utils/utils.js';
import { assertContext, assertRole, readJSON } from '../src/utils/utils';
const debugLog = debug('infra:scripts:utils'); const debugLog = rootLogger.child({ module: 'infra:scripts:utils' }).debug;
export enum Modules { export enum Modules {
// TODO: change // TODO: change
@ -72,7 +73,7 @@ export function getArgs() {
.alias('e', 'environment'); .alias('e', 'environment');
} }
export function withModuleAndFork<T>(args: yargs.Argv<T>) { export function withModuleAndFork<T>(args: Argv<T>) {
return args return args
.choices('module', Object.values(Modules)) .choices('module', Object.values(Modules))
.demandOption('module', 'hyperlane module to deploy') .demandOption('module', 'hyperlane module to deploy')
@ -82,14 +83,14 @@ export function withModuleAndFork<T>(args: yargs.Argv<T>) {
.alias('f', 'fork'); .alias('f', 'fork');
} }
export function withNetwork<T>(args: yargs.Argv<T>) { export function withNetwork<T>(args: Argv<T>) {
return args return args
.describe('network', 'network to target') .describe('network', 'network to target')
.choices('network', Object.values(Chains)) .choices('network', Object.values(Chains))
.alias('n', 'network'); .alias('n', 'network');
} }
export function withContext<T>(args: yargs.Argv<T>) { export function withContext<T>(args: Argv<T>) {
return args return args
.describe('context', 'deploy context') .describe('context', 'deploy context')
.default('context', Contexts.Hyperlane) .default('context', Contexts.Hyperlane)
@ -98,7 +99,7 @@ export function withContext<T>(args: yargs.Argv<T>) {
.demandOption('context'); .demandOption('context');
} }
export function withProtocol<T>(args: yargs.Argv<T>) { export function withProtocol<T>(args: Argv<T>) {
return args return args
.describe('protocol', 'protocol type') .describe('protocol', 'protocol type')
.default('protocol', ProtocolType.Ethereum) .default('protocol', ProtocolType.Ethereum)
@ -106,7 +107,7 @@ export function withProtocol<T>(args: yargs.Argv<T>) {
.demandOption('protocol'); .demandOption('protocol');
} }
export function withAgentRole<T>(args: yargs.Argv<T>) { export function withAgentRole<T>(args: Argv<T>) {
return args return args
.describe('role', 'agent roles') .describe('role', 'agent roles')
.array('role') .array('role')
@ -115,7 +116,7 @@ export function withAgentRole<T>(args: yargs.Argv<T>) {
.alias('r', 'role'); .alias('r', 'role');
} }
export function withKeyRoleAndChain<T>(args: yargs.Argv<T>) { export function withKeyRoleAndChain<T>(args: Argv<T>) {
return args return args
.describe('role', 'key role') .describe('role', 'key role')
.choices('role', Object.values(Role)) .choices('role', Object.values(Role))
@ -133,7 +134,7 @@ export function withKeyRoleAndChain<T>(args: yargs.Argv<T>) {
} }
// missing chains are chains needed which are not as part of defaultMultisigConfigs in sdk/src/consts/ but are in chainMetadata // missing chains are chains needed which are not as part of defaultMultisigConfigs in sdk/src/consts/ but are in chainMetadata
export function withNewChainValidators<T>(args: yargs.Argv<T>) { export function withNewChainValidators<T>(args: Argv<T>) {
return args return args
.describe( .describe(
'newChainValidators', 'newChainValidators',
@ -143,7 +144,7 @@ export function withNewChainValidators<T>(args: yargs.Argv<T>) {
.alias('n', 'newChainValidators'); .alias('n', 'newChainValidators');
} }
export function withBuildArtifactPath<T>(args: yargs.Argv<T>) { export function withBuildArtifactPath<T>(args: Argv<T>) {
return args return args
.describe('buildArtifactPath', 'path to hardhat build artifact') .describe('buildArtifactPath', 'path to hardhat build artifact')
.string('buildArtifactPath') .string('buildArtifactPath')

@ -1,8 +1,8 @@
import { createAgentKeysIfNotExists } from '../../src/agents/key-utils'; import { createAgentKeysIfNotExists } from '../../src/agents/key-utils.js';
import { HelmCommand } from '../../src/utils/helm'; import { HelmCommand } from '../../src/utils/helm.js';
import { getConfigsBasedOnArgs } from '../core-utils'; import { getConfigsBasedOnArgs } from '../core-utils.js';
import { AgentCli } from './utils'; import { AgentCli } from './utils.js';
async function main() { async function main() {
// Note the create-keys script should be ran prior to running this script. // Note the create-keys script should be ran prior to running this script.

@ -1,6 +1,6 @@
import { HelmCommand } from '../../src/utils/helm'; import { HelmCommand } from '../../src/utils/helm.js';
import { AgentCli } from './utils'; import { AgentCli } from './utils.js';
async function main() { async function main() {
await new AgentCli().runHelmCommand(HelmCommand.Remove); await new AgentCli().runHelmCommand(HelmCommand.Remove);

@ -1,6 +1,6 @@
import { HelmCommand } from '../../src/utils/helm'; import { HelmCommand } from '../../src/utils/helm.js';
import { AgentCli } from './utils'; import { AgentCli } from './utils.js';
async function main() { async function main() {
await new AgentCli().runHelmCommand(HelmCommand.UpgradeDiff); await new AgentCli().runHelmCommand(HelmCommand.UpgradeDiff);

@ -3,17 +3,18 @@ import {
RelayerHelmManager, RelayerHelmManager,
ScraperHelmManager, ScraperHelmManager,
ValidatorHelmManager, ValidatorHelmManager,
} from '../../src/agents'; } from '../../src/agents/index.js';
import { EnvironmentConfig, RootAgentConfig } from '../../src/config'; import { RootAgentConfig } from '../../src/config/agent/agent.js';
import { Role } from '../../src/roles'; import { EnvironmentConfig } from '../../src/config/environment.js';
import { HelmCommand } from '../../src/utils/helm'; import { Role } from '../../src/roles.js';
import { HelmCommand } from '../../src/utils/helm.js';
import { import {
assertCorrectKubeContext, assertCorrectKubeContext,
getArgs, getArgs,
withAgentRole, withAgentRole,
withContext, withContext,
} from '../agent-utils'; } from '../agent-utils.js';
import { getConfigsBasedOnArgs } from '../core-utils'; import { getConfigsBasedOnArgs } from '../core-utils.js';
export class AgentCli { export class AgentCli {
roles!: Role[]; roles!: Role[];

@ -5,17 +5,17 @@ import * as path from 'path';
import { AllChains, ChainName, HyperlaneCore } from '@hyperlane-xyz/sdk'; import { AllChains, ChainName, HyperlaneCore } from '@hyperlane-xyz/sdk';
import { S3Validator } from '../src/agents/aws/validator'; import { S3Validator } from '../src/agents/aws/validator.js';
import { CheckpointSyncerType } from '../src/config'; import { CheckpointSyncerType } from '../src/config/agent/validator.js';
import { deployEnvToSdkEnv } from '../src/config/environment'; import { deployEnvToSdkEnv } from '../src/config/environment.js';
import { isEthereumProtocolChain } from '../src/utils/utils'; import { isEthereumProtocolChain } from '../src/utils/utils.js';
import { import {
getAgentConfig, getAgentConfig,
getArgs as getRootArgs, getArgs as getRootArgs,
withContext, withContext,
} from './agent-utils'; } from './agent-utils.js';
import { getEnvironmentConfig } from './core-utils'; import { getEnvironmentConfig } from './core-utils.js';
function getArgs() { function getArgs() {
return withContext(getRootArgs()) return withContext(getRootArgs())

@ -15,14 +15,14 @@ import {
resolveOrDeployAccountOwner, resolveOrDeployAccountOwner,
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { Contexts } from '../config/contexts'; import { Contexts } from '../config/contexts.js';
import { deployEnvToSdkEnv } from '../src/config/environment'; import { deployEnvToSdkEnv } from '../src/config/environment.js';
import { HyperlaneAppGovernor } from '../src/govern/HyperlaneAppGovernor'; import { HyperlaneAppGovernor } from '../src/govern/HyperlaneAppGovernor.js';
import { HyperlaneCoreGovernor } from '../src/govern/HyperlaneCoreGovernor'; import { HyperlaneCoreGovernor } from '../src/govern/HyperlaneCoreGovernor.js';
import { HyperlaneIgpGovernor } from '../src/govern/HyperlaneIgpGovernor'; import { HyperlaneIgpGovernor } from '../src/govern/HyperlaneIgpGovernor.js';
import { ProxiedRouterGovernor } from '../src/govern/ProxiedRouterGovernor'; import { ProxiedRouterGovernor } from '../src/govern/ProxiedRouterGovernor.js';
import { Role } from '../src/roles'; import { Role } from '../src/roles.js';
import { impersonateAccount, useLocalProvider } from '../src/utils/fork'; import { impersonateAccount, useLocalProvider } from '../src/utils/fork.js';
import { import {
Modules, Modules,
@ -30,9 +30,9 @@ import {
getArgs as getRootArgs, getArgs as getRootArgs,
withContext, withContext,
withModuleAndFork, withModuleAndFork,
} from './agent-utils'; } from './agent-utils.js';
import { getEnvironmentConfig } from './core-utils'; import { getEnvironmentConfig } from './core-utils.js';
import { getHelloWorldApp } from './helloworld/utils'; import { getHelloWorldApp } from './helloworld/utils.js';
function getArgs() { function getArgs() {
return withModuleAndFork(withContext(getRootArgs())) return withModuleAndFork(withContext(getRootArgs()))

@ -2,10 +2,10 @@ import { ethers } from 'ethers';
import { rootLogger } from '@hyperlane-xyz/utils'; import { rootLogger } from '@hyperlane-xyz/utils';
import { getSecretRpcEndpoint } from '../src/agents'; import { getSecretRpcEndpoint } from '../src/agents/index.js';
import { getArgs } from './agent-utils'; import { getArgs } from './agent-utils.js';
import { getEnvironmentConfig } from './core-utils'; import { getEnvironmentConfig } from './core-utils.js';
// TODO remove this script as part of migration to CLI // TODO remove this script as part of migration to CLI
// It's redundant with metadata-check.ts in the SDK // It's redundant with metadata-check.ts in the SDK

@ -1,8 +1,8 @@
import { Contexts } from '../config/contexts'; import { Contexts } from '../config/contexts.js';
import { environments } from '../config/environments'; import { environments } from '../config/environments/index.js';
import { DeployEnvironment } from '../src/config'; import { DeployEnvironment } from '../src/config/environment.js';
import { getAgentConfig, getArgs, withContext } from './agent-utils'; import { getAgentConfig, getArgs, withContext } from './agent-utils.js';
// utils which use both environment configs // utils which use both environment configs

@ -1,6 +1,6 @@
import { createAgentKeysIfNotExists } from '../src/agents/key-utils'; import { createAgentKeysIfNotExists } from '../src/agents/key-utils.js';
import { getAgentConfigsBasedOnArgs } from './agent-utils'; import { getAgentConfigsBasedOnArgs } from './agent-utils.js';
async function main() { async function main() {
const { agentConfig } = await getAgentConfigsBasedOnArgs(); const { agentConfig } = await getAgentConfigsBasedOnArgs();

@ -7,10 +7,10 @@ import {
} from '@hyperlane-xyz/sdk'; } from '@hyperlane-xyz/sdk';
import { bytes32ToAddress, ensure0x, messageId } from '@hyperlane-xyz/utils'; import { bytes32ToAddress, ensure0x, messageId } from '@hyperlane-xyz/utils';
import { deployEnvToSdkEnv } from '../src/config/environment'; import { deployEnvToSdkEnv } from '../src/config/environment.js';
import { assertChain } from '../src/utils/utils'; import { assertChain } from '../src/utils/utils.js';
import { getArgs } from './agent-utils'; import { getArgs } from './agent-utils.js';
async function main() { async function main() {
const argv = await getArgs() const argv = await getArgs()

@ -1,6 +1,6 @@
import { deleteAgentKeys } from '../src/agents/key-utils'; import { deleteAgentKeys } from '../src/agents/key-utils.js';
import { getAgentConfigsBasedOnArgs } from './agent-utils'; import { getAgentConfigsBasedOnArgs } from './agent-utils.js';
async function main() { async function main() {
const { agentConfig } = await getAgentConfigsBasedOnArgs(); const { agentConfig } = await getAgentConfigsBasedOnArgs();

@ -1,8 +1,8 @@
import { runExternalSecretsHelmCommand } from '../src/infrastructure/external-secrets/external-secrets'; import { runExternalSecretsHelmCommand } from '../src/infrastructure/external-secrets/external-secrets.js';
import { HelmCommand } from '../src/utils/helm'; import { HelmCommand } from '../src/utils/helm.js';
import { assertCorrectKubeContext, getArgs } from './agent-utils'; import { assertCorrectKubeContext, getArgs } from './agent-utils.js';
import { getEnvironmentConfig } from './core-utils'; import { getEnvironmentConfig } from './core-utils.js';
async function main() { async function main() {
const { environment } = await getArgs().argv; const { environment } = await getArgs().argv;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save