From eb0e89ae7f19ba0fcbeefd6a37679e896205aa49 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Thu, 6 Oct 2022 16:50:07 -0400 Subject: [PATCH] Export developer-relevant addresses as hyperlaneCoreAddresses (#1142) --- typescript/sdk/src/consts/environments/index.ts | 17 +++++++++++++++++ typescript/sdk/src/index.ts | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/typescript/sdk/src/consts/environments/index.ts b/typescript/sdk/src/consts/environments/index.ts index 636403696..bea1b1eb8 100644 --- a/typescript/sdk/src/consts/environments/index.ts +++ b/typescript/sdk/src/consts/environments/index.ts @@ -1,3 +1,5 @@ +import { objMap } from '../../utils/objects'; + import mainnet from './mainnet.json'; import test from './test.json'; import testnet2 from './testnet2.json'; @@ -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, + ), + }), +); diff --git a/typescript/sdk/src/index.ts b/typescript/sdk/src/index.ts index 7425f4111..ea0dce66e 100644 --- a/typescript/sdk/src/index.ts +++ b/typescript/sdk/src/index.ts @@ -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,