Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export developer-relevant addresses as hyperlaneCoreAddresses #1142

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions typescript/sdk/src/consts/environments/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { objMap } from '../../utils/objects';

import mainnet from './mainnet.json';
import test from './test.json';
import testnet2 from './testnet2.json';
Expand All @@ -7,3 +9,18 @@ export const environments = {
testnet2,
mainnet,
};

// Export developer-relevant addresses
export const hyperlaneCoreAddresses = objMap(
{ ...testnet2, ...mainnet },
(_chain, addresses) => ({
outbox: addresses.outbox.proxy,
connectionManager: addresses.connectionManager,
interchainGasPaymaster: addresses.interchainGasPaymaster.proxy,
inboxes: objMap(
// @ts-ignore
addresses.inboxes,
(_remoteChain, inboxAddresses) => inboxAddresses.inbox.proxy,
),
}),
);
5 changes: 4 additions & 1 deletion typescript/sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export {
chainConnectionConfigs,
testChainConnectionConfigs,
} from './consts/chainConnectionConfigs';
export { environments as coreEnvironments } from './consts/environments';
export {
environments as coreEnvironments,
hyperlaneCoreAddresses,
} from './consts/environments';

export {
ChainMap,
Expand Down