@hyperlane-xyz/sdk 0.5.0-beta0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +5 -0
  2. package/dist/HyperlaneApp.d.ts +13 -0
  3. package/dist/HyperlaneApp.d.ts.map +1 -0
  4. package/dist/HyperlaneApp.js +25 -0
  5. package/dist/HyperlaneApp.js.map +1 -0
  6. package/dist/consts/chainConnectionConfigs.d.ts +28 -0
  7. package/dist/consts/chainConnectionConfigs.d.ts.map +1 -0
  8. package/dist/consts/chainConnectionConfigs.js +130 -0
  9. package/dist/consts/chainConnectionConfigs.js.map +1 -0
  10. package/dist/consts/chainMetadata.d.ts +43 -0
  11. package/dist/consts/chainMetadata.d.ts.map +1 -0
  12. package/dist/consts/chainMetadata.js +139 -0
  13. package/dist/consts/chainMetadata.js.map +1 -0
  14. package/dist/consts/chains.d.ts +28 -0
  15. package/dist/consts/chains.d.ts.map +1 -0
  16. package/dist/consts/chains.js +40 -0
  17. package/dist/consts/chains.js.map +1 -0
  18. package/dist/consts/environments/index.d.ts +1450 -0
  19. package/dist/consts/environments/index.d.ts.map +1 -0
  20. package/dist/consts/environments/index.js +15 -0
  21. package/dist/consts/environments/index.js.map +1 -0
  22. package/dist/consts/environments/mainnet.json +513 -0
  23. package/dist/consts/environments/test.json +113 -0
  24. package/dist/consts/environments/testnet2.json +821 -0
  25. package/dist/consts/metamask.d.ts +17 -0
  26. package/dist/consts/metamask.d.ts.map +1 -0
  27. package/dist/consts/metamask.js +50 -0
  28. package/dist/consts/metamask.js.map +1 -0
  29. package/dist/contracts.d.ts +17 -0
  30. package/dist/contracts.d.ts.map +1 -0
  31. package/dist/contracts.js +61 -0
  32. package/dist/contracts.js.map +1 -0
  33. package/dist/core/HyperlaneCore.d.ts +1491 -0
  34. package/dist/core/HyperlaneCore.d.ts.map +1 -0
  35. package/dist/core/HyperlaneCore.js +103 -0
  36. package/dist/core/HyperlaneCore.js.map +1 -0
  37. package/dist/core/TestCoreApp.d.ts +27 -0
  38. package/dist/core/TestCoreApp.d.ts.map +1 -0
  39. package/dist/core/TestCoreApp.js +63 -0
  40. package/dist/core/TestCoreApp.js.map +1 -0
  41. package/dist/core/TestCoreDeployer.d.ts +13 -0
  42. package/dist/core/TestCoreDeployer.d.ts.map +1 -0
  43. package/dist/core/TestCoreDeployer.js +85 -0
  44. package/dist/core/TestCoreDeployer.js.map +1 -0
  45. package/dist/core/contracts.d.ts +30 -0
  46. package/dist/core/contracts.d.ts.map +1 -0
  47. package/dist/core/contracts.js +14 -0
  48. package/dist/core/contracts.js.map +1 -0
  49. package/dist/core/events.d.ts +9 -0
  50. package/dist/core/events.d.ts.map +1 -0
  51. package/dist/core/events.js +3 -0
  52. package/dist/core/events.js.map +1 -0
  53. package/dist/core/message.d.ts +162 -0
  54. package/dist/core/message.d.ts.map +1 -0
  55. package/dist/core/message.js +311 -0
  56. package/dist/core/message.js.map +1 -0
  57. package/dist/core/testHyperlaneDeploy.hardhat-test.d.ts +3 -0
  58. package/dist/core/testHyperlaneDeploy.hardhat-test.d.ts.map +1 -0
  59. package/dist/core/testHyperlaneDeploy.hardhat-test.js +66 -0
  60. package/dist/core/testHyperlaneDeploy.hardhat-test.js.map +1 -0
  61. package/dist/deploy/HyperlaneAppChecker.d.ts +22 -0
  62. package/dist/deploy/HyperlaneAppChecker.d.ts.map +1 -0
  63. package/dist/deploy/HyperlaneAppChecker.js +76 -0
  64. package/dist/deploy/HyperlaneAppChecker.js.map +1 -0
  65. package/dist/deploy/HyperlaneDeployer.d.ts +40 -0
  66. package/dist/deploy/HyperlaneDeployer.d.ts.map +1 -0
  67. package/dist/deploy/HyperlaneDeployer.js +153 -0
  68. package/dist/deploy/HyperlaneDeployer.js.map +1 -0
  69. package/dist/deploy/core/HyperlaneCoreChecker.d.ts +17 -0
  70. package/dist/deploy/core/HyperlaneCoreChecker.d.ts.map +1 -0
  71. package/dist/deploy/core/HyperlaneCoreChecker.js +210 -0
  72. package/dist/deploy/core/HyperlaneCoreChecker.js.map +1 -0
  73. package/dist/deploy/core/HyperlaneCoreDeployer.d.ts +30 -0
  74. package/dist/deploy/core/HyperlaneCoreDeployer.d.ts.map +1 -0
  75. package/dist/deploy/core/HyperlaneCoreDeployer.js +134 -0
  76. package/dist/deploy/core/HyperlaneCoreDeployer.js.map +1 -0
  77. package/dist/deploy/core/types.d.ts +64 -0
  78. package/dist/deploy/core/types.d.ts.map +1 -0
  79. package/dist/deploy/core/types.js +23 -0
  80. package/dist/deploy/core/types.js.map +1 -0
  81. package/dist/deploy/proxy.d.ts +17 -0
  82. package/dist/deploy/proxy.d.ts.map +1 -0
  83. package/dist/deploy/proxy.js +35 -0
  84. package/dist/deploy/proxy.js.map +1 -0
  85. package/dist/deploy/router/HyperlaneRouterChecker.d.ts +13 -0
  86. package/dist/deploy/router/HyperlaneRouterChecker.d.ts.map +1 -0
  87. package/dist/deploy/router/HyperlaneRouterChecker.js +44 -0
  88. package/dist/deploy/router/HyperlaneRouterChecker.js.map +1 -0
  89. package/dist/deploy/router/HyperlaneRouterDeployer.d.ts +13 -0
  90. package/dist/deploy/router/HyperlaneRouterDeployer.d.ts.map +1 -0
  91. package/dist/deploy/router/HyperlaneRouterDeployer.js +103 -0
  92. package/dist/deploy/router/HyperlaneRouterDeployer.js.map +1 -0
  93. package/dist/deploy/router/types.d.ts +7 -0
  94. package/dist/deploy/router/types.d.ts.map +1 -0
  95. package/dist/deploy/router/types.js +3 -0
  96. package/dist/deploy/router/types.js.map +1 -0
  97. package/dist/deploy/types.d.ts +19 -0
  98. package/dist/deploy/types.d.ts.map +1 -0
  99. package/dist/deploy/types.js +8 -0
  100. package/dist/deploy/types.js.map +1 -0
  101. package/dist/deploy/utils.d.ts +10 -0
  102. package/dist/deploy/utils.d.ts.map +1 -0
  103. package/dist/deploy/utils.js +38 -0
  104. package/dist/deploy/utils.js.map +1 -0
  105. package/dist/deploy/verify/ContractVerifier.d.ts +19 -0
  106. package/dist/deploy/verify/ContractVerifier.d.ts.map +1 -0
  107. package/dist/deploy/verify/ContractVerifier.js +129 -0
  108. package/dist/deploy/verify/ContractVerifier.js.map +1 -0
  109. package/dist/deploy/verify/types.d.ts +14 -0
  110. package/dist/deploy/verify/types.d.ts.map +1 -0
  111. package/dist/deploy/verify/types.js +3 -0
  112. package/dist/deploy/verify/types.js.map +1 -0
  113. package/dist/deploy/verify/utils.d.ts +6 -0
  114. package/dist/deploy/verify/utils.d.ts.map +1 -0
  115. package/dist/deploy/verify/utils.js +25 -0
  116. package/dist/deploy/verify/utils.js.map +1 -0
  117. package/dist/domains.d.ts +4 -0
  118. package/dist/domains.d.ts.map +1 -0
  119. package/dist/domains.js +8 -0
  120. package/dist/domains.js.map +1 -0
  121. package/dist/events.d.ts +25 -0
  122. package/dist/events.d.ts.map +1 -0
  123. package/dist/events.js +161 -0
  124. package/dist/events.js.map +1 -0
  125. package/dist/gas/calculator.d.ts +134 -0
  126. package/dist/gas/calculator.d.ts.map +1 -0
  127. package/dist/gas/calculator.js +235 -0
  128. package/dist/gas/calculator.js.map +1 -0
  129. package/dist/gas/calculator.test.d.ts +2 -0
  130. package/dist/gas/calculator.test.d.ts.map +1 -0
  131. package/dist/gas/calculator.test.js +211 -0
  132. package/dist/gas/calculator.test.js.map +1 -0
  133. package/dist/gas/token-prices.d.ts +18 -0
  134. package/dist/gas/token-prices.d.ts.map +1 -0
  135. package/dist/gas/token-prices.js +63 -0
  136. package/dist/gas/token-prices.js.map +1 -0
  137. package/dist/gas/token-prices.test.d.ts +2 -0
  138. package/dist/gas/token-prices.test.d.ts.map +1 -0
  139. package/dist/gas/token-prices.test.js +40 -0
  140. package/dist/gas/token-prices.test.js.map +1 -0
  141. package/dist/index.d.ts +42 -0
  142. package/dist/index.d.ts.map +1 -0
  143. package/dist/index.js +119 -0
  144. package/dist/index.js.map +1 -0
  145. package/dist/providers/ChainConnection.d.ts +22 -0
  146. package/dist/providers/ChainConnection.d.ts.map +1 -0
  147. package/dist/providers/ChainConnection.js +67 -0
  148. package/dist/providers/ChainConnection.js.map +1 -0
  149. package/dist/providers/MultiProvider.d.ts +55 -0
  150. package/dist/providers/MultiProvider.d.ts.map +1 -0
  151. package/dist/providers/MultiProvider.js +106 -0
  152. package/dist/providers/MultiProvider.js.map +1 -0
  153. package/dist/providers/RetryProvider.d.ts +18 -0
  154. package/dist/providers/RetryProvider.d.ts.map +1 -0
  155. package/dist/providers/RetryProvider.js +49 -0
  156. package/dist/providers/RetryProvider.js.map +1 -0
  157. package/dist/proxy.d.ts +23 -0
  158. package/dist/proxy.d.ts.map +1 -0
  159. package/dist/proxy.js +30 -0
  160. package/dist/proxy.js.map +1 -0
  161. package/dist/router.d.ts +19 -0
  162. package/dist/router.d.ts.map +1 -0
  163. package/dist/router.js +3 -0
  164. package/dist/router.js.map +1 -0
  165. package/dist/test/envSubsetDeployer/app.d.ts +36 -0
  166. package/dist/test/envSubsetDeployer/app.d.ts.map +1 -0
  167. package/dist/test/envSubsetDeployer/app.js +77 -0
  168. package/dist/test/envSubsetDeployer/app.js.map +1 -0
  169. package/dist/test/envSubsetDeployer/check-single-chain.d.ts +2 -0
  170. package/dist/test/envSubsetDeployer/check-single-chain.d.ts.map +1 -0
  171. package/dist/test/envSubsetDeployer/check-single-chain.js +49 -0
  172. package/dist/test/envSubsetDeployer/check-single-chain.js.map +1 -0
  173. package/dist/test/envSubsetDeployer/deploy-single-chain.d.ts +2 -0
  174. package/dist/test/envSubsetDeployer/deploy-single-chain.d.ts.map +1 -0
  175. package/dist/test/envSubsetDeployer/deploy-single-chain.js +42 -0
  176. package/dist/test/envSubsetDeployer/deploy-single-chain.js.map +1 -0
  177. package/dist/test/envSubsetDeployer/deploy.hardhat-test.d.ts +2 -0
  178. package/dist/test/envSubsetDeployer/deploy.hardhat-test.d.ts.map +1 -0
  179. package/dist/test/envSubsetDeployer/deploy.hardhat-test.js +80 -0
  180. package/dist/test/envSubsetDeployer/deploy.hardhat-test.js.map +1 -0
  181. package/dist/test/envSubsetDeployer/utils.d.ts +7 -0
  182. package/dist/test/envSubsetDeployer/utils.d.ts.map +1 -0
  183. package/dist/test/envSubsetDeployer/utils.js +25 -0
  184. package/dist/test/envSubsetDeployer/utils.js.map +1 -0
  185. package/dist/test/testUtils.d.ts +29 -0
  186. package/dist/test/testUtils.d.ts.map +1 -0
  187. package/dist/test/testUtils.js +98 -0
  188. package/dist/test/testUtils.js.map +1 -0
  189. package/dist/types.d.ts +20 -0
  190. package/dist/types.d.ts.map +1 -0
  191. package/dist/types.js +3 -0
  192. package/dist/types.js.map +1 -0
  193. package/dist/utils/MultiGeneric.d.ts +27 -0
  194. package/dist/utils/MultiGeneric.d.ts.map +1 -0
  195. package/dist/utils/MultiGeneric.js +70 -0
  196. package/dist/utils/MultiGeneric.js.map +1 -0
  197. package/dist/utils/ids.d.ts +20 -0
  198. package/dist/utils/ids.d.ts.map +1 -0
  199. package/dist/utils/ids.js +47 -0
  200. package/dist/utils/ids.js.map +1 -0
  201. package/dist/utils/number.d.ts +32 -0
  202. package/dist/utils/number.d.ts.map +1 -0
  203. package/dist/utils/number.js +59 -0
  204. package/dist/utils/number.js.map +1 -0
  205. package/dist/utils/objects.d.ts +7 -0
  206. package/dist/utils/objects.d.ts.map +1 -0
  207. package/dist/utils/objects.js +29 -0
  208. package/dist/utils/objects.js.map +1 -0
  209. package/dist/utils/time.d.ts +8 -0
  210. package/dist/utils/time.d.ts.map +1 -0
  211. package/dist/utils/time.js +15 -0
  212. package/dist/utils/time.js.map +1 -0
  213. package/dist/utils/utils.test.d.ts +2 -0
  214. package/dist/utils/utils.test.d.ts.map +1 -0
  215. package/dist/utils/utils.test.js +41 -0
  216. package/dist/utils/utils.test.js.map +1 -0
  217. package/package.json +55 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HyperlaneCore.d.ts","sourceRoot":"","sources":["../../src/core/HyperlaneCore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAA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EAC7B,WAAW,EAAE,KAAK,GACjB;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,KAAK,CAAA;KAAE;IAOpD,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,iBAAiB,GAAG;QACpD,KAAK,EAAE,KAAK,CAAC;QACb,eAAe,EAAE,eAAe,CAAC;KAClC;IAcD,SAAS,CAAC,qBAAqB,CAC7B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IAelC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,CAAC,eAAe,GAAG,iBAAiB,EAAE;IAsB5E,wBAAwB,CACtB,QAAQ,EAAE,MAAM,CAAC,eAAe,GAC/B,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;CAKrC"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HyperlaneCore = void 0;
4
+ const core_1 = require("@hyperlane-xyz/core");
5
+ const utils_1 = require("@hyperlane-xyz/utils");
6
+ const HyperlaneApp_1 = require("../HyperlaneApp");
7
+ const environments_1 = require("../consts/environments");
8
+ const contracts_1 = require("../contracts");
9
+ const domains_1 = require("../domains");
10
+ const objects_1 = require("../utils/objects");
11
+ const contracts_2 = require("./contracts");
12
+ class HyperlaneCore extends HyperlaneApp_1.HyperlaneApp {
13
+ constructor(contractsMap, multiProvider) {
14
+ super(contractsMap, multiProvider);
15
+ }
16
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
17
+ static fromEnvironment(env, multiProvider) {
18
+ const envConfig = environments_1.environments[env];
19
+ if (!envConfig) {
20
+ throw new Error(`No default env config found for ${env}`);
21
+ }
22
+ const envChains = Object.keys(envConfig);
23
+ const { intersection, multiProvider: intersectionProvider } = multiProvider.intersect(envChains);
24
+ const intersectionConfig = (0, objects_1.pick)(envConfig, intersection);
25
+ const contractsMap = (0, contracts_1.buildContracts)(intersectionConfig, contracts_2.coreFactories);
26
+ return new HyperlaneCore(contractsMap, intersectionProvider);
27
+ }
28
+ // override type to be derived from chain key
29
+ getContracts(chain) {
30
+ return super.getContracts(chain);
31
+ }
32
+ getConnectionClientConfig(chain) {
33
+ const contracts = this.getContracts(chain);
34
+ return {
35
+ connectionManager: contracts.connectionManager.address,
36
+ interchainGasPaymaster: contracts.interchainGasPaymaster.address,
37
+ };
38
+ }
39
+ getConnectionClientConfigMap() {
40
+ return (0, objects_1.objMap)(this.contractsMap, (chain) => this.getConnectionClientConfig(chain));
41
+ }
42
+ extendWithConnectionClientConfig(configMap) {
43
+ const connectionClientConfigMap = this.getConnectionClientConfigMap();
44
+ return (0, objects_1.objMap)(configMap, (chain, config) => {
45
+ return Object.assign(Object.assign({}, config), connectionClientConfigMap[chain]);
46
+ });
47
+ }
48
+ // TODO: deprecate
49
+ extendWithConnectionManagers(config) {
50
+ return (0, objects_1.objMap)(config, (chain, config) => (Object.assign(Object.assign({}, config), { connectionManager: this.getContracts(chain).connectionManager.address })));
51
+ }
52
+ getMailboxPair(origin, destination) {
53
+ const originOutbox = this.getContracts(origin).outbox.contract;
54
+ const destinationInbox = this.getContracts(destination).inboxes[origin].inbox.contract;
55
+ return { originOutbox, destinationInbox };
56
+ }
57
+ getDestination(message) {
58
+ const sourceChain = domains_1.DomainIdToChainName[message.parsed.origin];
59
+ const destinationChain = domains_1.DomainIdToChainName[message.parsed.destination];
60
+ const { destinationInbox } = this.getMailboxPair(sourceChain, destinationChain);
61
+ const chainConnection = this.multiProvider.getChainConnection(destinationChain);
62
+ return { inbox: destinationInbox, chainConnection };
63
+ }
64
+ waitForProcessReceipt(message) {
65
+ const hash = utils_1.utils.messageHash(message.message, message.leafIndex);
66
+ const { inbox, chainConnection } = this.getDestination(message);
67
+ const filter = inbox.filters.Process(hash);
68
+ return new Promise((resolve, reject) => {
69
+ inbox.once(filter, (emittedHash, event) => {
70
+ if (hash !== emittedHash) {
71
+ reject(`Expected message hash ${hash} but got ${emittedHash}`);
72
+ }
73
+ resolve(chainConnection.handleTx(event.getTransaction()));
74
+ });
75
+ });
76
+ }
77
+ getDispatchedMessages(sourceTx) {
78
+ const outbox = core_1.Outbox__factory.createInterface();
79
+ const describedLogs = sourceTx.logs.map((log) => {
80
+ try {
81
+ return outbox.parseLog(log);
82
+ }
83
+ catch (e) {
84
+ return undefined;
85
+ }
86
+ });
87
+ const dispatchLogs = describedLogs.filter((log) => log && log.name === 'Dispatch');
88
+ if (dispatchLogs.length === 0) {
89
+ throw new Error('Dispatch logs not found');
90
+ }
91
+ return dispatchLogs.map((log) => {
92
+ const message = log.args['message'];
93
+ const parsed = utils_1.utils.parseMessage(message);
94
+ return { leafIndex: log.args['leafIndex'], message, parsed };
95
+ });
96
+ }
97
+ waitForMessageProcessing(sourceTx) {
98
+ const messages = this.getDispatchedMessages(sourceTx);
99
+ return Promise.all(messages.map((msg) => this.waitForProcessReceipt(msg)));
100
+ }
101
+ }
102
+ exports.HyperlaneCore = HyperlaneCore;
103
+ //# sourceMappingURL=HyperlaneCore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HyperlaneCore.js","sourceRoot":"","sources":["../../src/core/HyperlaneCore.ts"],"names":[],"mappings":";;;AAEA,8CAAqE;AACrE,gDAAoD;AAEpD,kDAA+C;AAC/C,yDAAsD;AACtD,4CAA8C;AAC9C,wCAAiD;AAKjD,8CAAgD;AAEhD,2CAA2D;AAkB3D,MAAa,aAEX,SAAQ,2BAAgD;IACxD,YACE,YAAqC,EACrC,aAAmC;QAEnC,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACrC,CAAC;IAED,6EAA6E;IAC7E,MAAM,CAAC,eAAe,CAGpB,GAAQ,EAAE,aAAmC;QAC7C,MAAM,SAAS,GAAG,2BAAY,CAAC,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;SAC3D;QAID,MAAM,SAA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AE,MAAM,EAAE,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,wBAAwB,CACtB,QAAgC;QAEhC,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAEtD,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;CACF;AAzJD,sCAyJC"}
@@ -0,0 +1,27 @@
1
+ import { ethers } from 'ethers';
2
+ import { TestInbox, TestOutbox } from '@hyperlane-xyz/core';
3
+ import { ProxiedContract } from '../proxy';
4
+ import { ChainMap, ChainName, Remotes, TestChainNames } from '../types';
5
+ import { HyperlaneCore } from './HyperlaneCore';
6
+ import { CoreContracts, InboxContracts, OutboxContracts } from './contracts';
7
+ declare type MockProxyAddresses = {
8
+ kind: 'MOCK';
9
+ proxy: string;
10
+ implementation: string;
11
+ };
12
+ export declare type TestOutboxContracts = OutboxContracts & {
13
+ outbox: ProxiedContract<TestOutbox, MockProxyAddresses>;
14
+ };
15
+ export declare type TestInboxContracts = InboxContracts & {
16
+ inbox: ProxiedContract<TestInbox, MockProxyAddresses>;
17
+ };
18
+ export declare type TestCoreContracts<Local extends TestChainNames> = CoreContracts<TestChainNames, Local> & TestOutboxContracts & {
19
+ inboxes: ChainMap<Remotes<TestChainNames, Local>, TestInboxContracts>;
20
+ };
21
+ export declare class TestCoreApp<TestChain extends TestChainNames = TestChainNames> extends HyperlaneCore<TestChain> {
22
+ getContracts<Local extends TestChain>(chain: Local): TestCoreContracts<Local>;
23
+ processMessages(): Promise<Map<TestChain, Map<TestChain, ethers.providers.TransactionResponse[]>>>;
24
+ processOutboundMessages<Local extends TestChain>(origin: Local): Promise<Map<ChainName, any>>;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=TestCoreApp.d.ts.map
@@ -0,0 +1 @@
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AC9B,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC,CAAC,CACvE;IAaK,uBAAuB,CAAC,KAAK,SAAS,SAAS,EACnD,MAAM,EAAE,KAAK,GACZ,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;CAmChC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TestCoreApp = void 0;
13
+ const utils_1 = require("@hyperlane-xyz/utils");
14
+ const chainMetadata_1 = require("../consts/chainMetadata");
15
+ const domains_1 = require("../domains");
16
+ const HyperlaneCore_1 = require("./HyperlaneCore");
17
+ class TestCoreApp extends HyperlaneCore_1.HyperlaneCore {
18
+ getContracts(chain) {
19
+ return super.getContracts(chain);
20
+ }
21
+ processMessages() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const responses = new Map();
24
+ for (const origin of this.chains()) {
25
+ const outbound = yield this.processOutboundMessages(origin);
26
+ const originResponses = new Map();
27
+ this.remoteChains(origin).forEach((destination) => originResponses.set(destination, outbound.get(destination)));
28
+ responses.set(origin, originResponses);
29
+ }
30
+ return responses;
31
+ });
32
+ }
33
+ processOutboundMessages(origin) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const responses = new Map();
36
+ const contracts = this.getContracts(origin);
37
+ const outbox = contracts.outbox.contract;
38
+ const dispatchFilter = outbox.filters.Dispatch();
39
+ const dispatches = yield outbox.queryFilter(dispatchFilter);
40
+ for (const dispatch of dispatches) {
41
+ const message = utils_1.utils.parseMessage(dispatch.args.message);
42
+ const destination = message.destination;
43
+ if (destination === chainMetadata_1.chainMetadata[origin].id) {
44
+ throw new Error('Dispatched message to local domain');
45
+ }
46
+ const destinationChain = domains_1.DomainIdToChainName[destination];
47
+ const inbox =
48
+ // @ts-ignore
49
+ this.getContracts(destinationChain).inboxes[origin].inbox.contract;
50
+ const status = yield inbox.messages(utils_1.utils.messageHash(dispatch.args.message, dispatch.args.leafIndex.toNumber()));
51
+ if (status !== utils_1.types.MessageStatus.PROCESSED) {
52
+ const response = yield inbox.testProcess(dispatch.args.message, dispatch.args.leafIndex.toNumber());
53
+ const destinationResponses = responses.get(destinationChain) || [];
54
+ destinationResponses.push(response);
55
+ responses.set(destinationChain, destinationResponses);
56
+ }
57
+ }
58
+ return responses;
59
+ });
60
+ }
61
+ }
62
+ exports.TestCoreApp = TestCoreApp;
63
+ //# sourceMappingURL=TestCoreApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestCoreApp.js","sourceRoot":"","sources":["../../src/core/TestCoreApp.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,gDAAoD;AAEpD,2DAAwD;AACxD,wCAAiD;AAIjD,mDAAgD;AAwBhD,MAAa,WAEX,SAAQ,6BAAwB;IAChC,YAAY,CACV,KAAY;QAEZ,OAAO,KAAK,CAAC,YAAY,CAAC,KAAK,CAA6B,CAAC;IAC/D,CAAC;IAEK,eAAe;;YAGnB,MAAM,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;YAC5B,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;gBAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;gBAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC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,QAAQ,CAAC,IAAI,CAAC,OAAO,EACrB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CACnC,CACF,CAAC;gBACF,IAAI,MAAM,KAAK,aAAK,CAAC,aAAa,CAAC,SAAS,EAAE;oBAC5C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,CACtC,QAAQ,CAAC,IAAI,CAAC,OAAO,EACrB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CACnC,CAAC;oBACF,MAAM,oBAAoB,GAAG,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;oBACnE,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;oBACpC,SAAS,CAAC,GAAG,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;iBACvD;aACF;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;KAAA;CACF;AA7DD,kCA6DC"}
@@ -0,0 +1,13 @@
1
+ import { HyperlaneCoreDeployer } from '../deploy/core/HyperlaneCoreDeployer';
2
+ import { CoreConfig, ValidatorManagerConfig } from '../deploy/core/types';
3
+ import { MultiProvider } from '../providers/MultiProvider';
4
+ import { ChainMap, Remotes, TestChainNames } from '../types';
5
+ import { TestCoreApp, TestInboxContracts, TestOutboxContracts } from './TestCoreApp';
6
+ export declare class TestCoreDeployer<TestChain extends TestChainNames = TestChainNames> extends HyperlaneCoreDeployer<TestChain> {
7
+ readonly multiProvider: MultiProvider<TestChain>;
8
+ constructor(multiProvider: MultiProvider<TestChain>, configMap?: ChainMap<TestChain, CoreConfig>);
9
+ deployOutbox<LocalChain extends TestChain>(chain: LocalChain, config: ValidatorManagerConfig): Promise<TestOutboxContracts>;
10
+ deployInbox<LocalChain extends TestChain>(local: LocalChain, remote: Remotes<TestChain, LocalChain>, config: ValidatorManagerConfig): Promise<TestInboxContracts>;
11
+ deployApp(): Promise<TestCoreApp<TestChain>>;
12
+ }
13
+ //# sourceMappingURL=TestCoreDeployer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestCoreDeployer.d.ts","sourceRoot":"","sources":["../../src/core/TestCoreDeployer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7D,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,eAAe,CAAC;AA2BvB,qBAAa,gBAAgB,CAC3B,SAAS,SAAS,cAAc,GAAG,cAAc,CACjD,SAAQ,qBAAqB,CAAC,SAAS,CAAC;aAEtB,aAAa,EAAE,aAAa,CAAC,SAAS,CAAC;gBAAvC,aAAa,EAAE,aAAa,CAAC,SAAS,CAAC,EACvD,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAcvC,YAAY,CAAC,UAAU,SAAS,SAAS,EAC7C,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,mBAAmB,CAAC;IAmBzB,WAAW,CAAC,UAAU,SAAS,SAAS,EAC5C,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,EACtC,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,kBAAkB,CAAC;IAkBxB,SAAS,IAAI,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;CAGnD"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TestCoreDeployer = void 0;
13
+ const ethers_1 = require("ethers");
14
+ const core_1 = require("@hyperlane-xyz/core");
15
+ const chainMetadata_1 = require("../consts/chainMetadata");
16
+ const HyperlaneCoreDeployer_1 = require("../deploy/core/HyperlaneCoreDeployer");
17
+ const proxy_1 = require("../proxy");
18
+ const TestCoreApp_1 = require("./TestCoreApp");
19
+ const contracts_1 = require("./contracts");
20
+ const nonZeroAddress = ethers_1.ethers.constants.AddressZero.replace('00', '01');
21
+ // dummy config as TestInbox and TestOutbox do not use deployed ValidatorManager
22
+ const testValidatorManagerConfig = {
23
+ validatorManager: {
24
+ validators: [nonZeroAddress],
25
+ threshold: 1,
26
+ },
27
+ };
28
+ const testCoreFactories = Object.assign(Object.assign({}, contracts_1.coreFactories), { inbox: new core_1.TestInbox__factory(), outbox: new core_1.TestOutbox__factory() });
29
+ function mockProxy(contract) {
30
+ return new proxy_1.ProxiedContract(contract, {
31
+ kind: 'MOCK',
32
+ proxy: contract.address,
33
+ implementation: contract.address,
34
+ });
35
+ }
36
+ class TestCoreDeployer extends HyperlaneCoreDeployer_1.HyperlaneCoreDeployer {
37
+ constructor(multiProvider, configMap) {
38
+ const configs = configMap !== null && configMap !== void 0 ? configMap : {
39
+ test1: testValidatorManagerConfig,
40
+ test2: testValidatorManagerConfig,
41
+ test3: testValidatorManagerConfig,
42
+ }; // cast so param can be optional
43
+ super(multiProvider, configs, testCoreFactories);
44
+ this.multiProvider = multiProvider;
45
+ }
46
+ // skip proxying
47
+ deployOutbox(chain, config) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ const localDomain = chainMetadata_1.chainMetadata[chain].id;
50
+ const outboxContract = yield this.deployContract(chain, 'outbox', [
51
+ localDomain,
52
+ ]);
53
+ const outboxValidatorManager = yield this.deployContract(chain, 'outboxValidatorManager', [localDomain, config.validators, config.threshold]);
54
+ // validator manager must be contract
55
+ yield outboxContract.initialize(outboxValidatorManager.address);
56
+ return {
57
+ outbox: mockProxy(outboxContract),
58
+ outboxValidatorManager,
59
+ };
60
+ });
61
+ }
62
+ // skip proxying
63
+ deployInbox(local, remote, config) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const localDomain = chainMetadata_1.chainMetadata[local].id;
66
+ const remoteDomain = chainMetadata_1.chainMetadata[remote].id;
67
+ const inboxContract = yield this.deployContract(local, 'inbox', [
68
+ localDomain,
69
+ ]);
70
+ const inboxValidatorManager = yield this.deployContract(local, 'inboxValidatorManager', [remoteDomain, config.validators, config.threshold]);
71
+ yield inboxContract.initialize(remoteDomain, inboxValidatorManager.address);
72
+ return {
73
+ inbox: mockProxy(inboxContract),
74
+ inboxValidatorManager,
75
+ };
76
+ });
77
+ }
78
+ deployApp() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ return new TestCoreApp_1.TestCoreApp(yield this.deploy(), this.multiProvider);
81
+ });
82
+ }
83
+ }
84
+ exports.TestCoreDeployer = TestCoreDeployer;
85
+ //# sourceMappingURL=TestCoreDeployer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestCoreDeployer.js","sourceRoot":"","sources":["../../src/core/TestCoreDeployer.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAgC;AAEhC,8CAA8E;AAE9E,2DAAwD;AACxD,gFAA6E;AAG7E,oCAA2C;AAG3C,+CAIuB;AACvB,2CAA4C;AAE5C,MAAM,cAAc,GAAG,eAAM,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAExE,gFAAgF;AAChF,MAAM,0BAA0B,G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,CAAC,CAAC;YAChE,OAAO;gBACL,MAAM,EAAE,SAAS,CAAC,cAAc,CAAC;gBACjC,sBAAsB;aACA,CAAC;QAC3B,CAAC;KAAA;IAED,gBAAgB;IACV,WAAW,CACf,KAAiB,EACjB,MAAsC,EACtC,MAA8B;;YAE9B,MAAM,WAAW,GAAG,6BAAa,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,YAAY,GAAG,6BAAa,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YAC9C,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE;gBAC9D,WAAW;aACZ,CAAC,CAAC;YACH,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAC,cAAc,CACrD,KAAK,EACL,uBAAuB,EACvB,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC,CACpD,CAAC;YACF,MAAM,aAAa,CAAC,UAAU,CAAC,YAAY,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;YAC5E,OAAO;gBACL,KAAK,EAAE,SAAS,CAAC,aAAa,CAAC;gBAC/B,qBAAqB;aACA,CAAC;QAC1B,CAAC;KAAA;IAEK,SAAS;;YACb,OAAO,IAAI,yBAAW,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAClE,CAAC;KAAA;CACF;AAlED,4CAkEC"}
@@ -0,0 +1,30 @@
1
+ import { AbacusConnectionManager, AbacusConnectionManager__factory, Inbox, InboxValidatorManager, InboxValidatorManager__factory, Inbox__factory, InterchainGasPaymaster, InterchainGasPaymaster__factory, Outbox, OutboxValidatorManager, OutboxValidatorManager__factory, Outbox__factory, UpgradeBeaconController, UpgradeBeaconController__factory } from '@hyperlane-xyz/core';
2
+ import { BeaconProxyAddresses, ProxiedContract } from '../proxy';
3
+ import { ChainName, RemoteChainMap } from '../types';
4
+ export declare type InboxContracts = {
5
+ inbox: ProxiedContract<Inbox, BeaconProxyAddresses>;
6
+ inboxValidatorManager: InboxValidatorManager;
7
+ };
8
+ export declare type OutboxContracts = {
9
+ outbox: ProxiedContract<Outbox, BeaconProxyAddresses>;
10
+ outboxValidatorManager: OutboxValidatorManager;
11
+ };
12
+ declare type ConnectionClientContracts = {
13
+ interchainGasPaymaster: ProxiedContract<InterchainGasPaymaster, BeaconProxyAddresses>;
14
+ connectionManager: AbacusConnectionManager;
15
+ };
16
+ export declare type CoreContracts<Networks extends ChainName, Local extends Networks> = OutboxContracts & ConnectionClientContracts & {
17
+ inboxes: RemoteChainMap<Networks, Local, InboxContracts>;
18
+ upgradeBeaconController: UpgradeBeaconController;
19
+ };
20
+ export declare const coreFactories: {
21
+ outbox: Outbox__factory;
22
+ outboxValidatorManager: OutboxValidatorManager__factory;
23
+ inbox: Inbox__factory;
24
+ inboxValidatorManager: InboxValidatorManager__factory;
25
+ connectionManager: AbacusConnectionManager__factory;
26
+ upgradeBeaconController: UpgradeBeaconController__factory;
27
+ interchainGasPaymaster: InterchainGasPaymaster__factory;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/core/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EAChC,KAAK,EACL,qBAAqB,EACrB,8BAA8B,EAC9B,cAAc,EACd,sBAAsB,EACtB,+BAA+B,EAC/B,MAAM,EACN,sBAAsB,EACtB,+BAA+B,EAC/B,eAAe,EACf,uBAAuB,EACvB,gCAAgC,EACjC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAErD,oBAAY,cAAc,GAAG;IAC3B,KAAK,EAAE,eAAe,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAC;IACpD,qBAAqB,EAAE,qBAAqB,CAAC;CAC9C,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,MAAM,EAAE,eAAe,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACtD,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AAEF,aAAK,yBAAyB,GAAG;IAC/B,sBAAsB,EAAE,eAAe,CACrC,sBAAsB,EACtB,oBAAoB,CACrB,CAAC;IACF,iBAAiB,EAAE,uBAAuB,CAAC;CAC5C,CAAC;AAEF,oBAAY,aAAa,CACvB,QAAQ,SAAS,SAAS,EAC1B,KAAK,SAAS,QAAQ,IACpB,eAAe,GACjB,yBAAyB,GAAG;IAC1B,OAAO,EAAE,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACzD,uBAAuB,EAAE,uBAAuB,CAAC;CAClD,CAAC;AAYJ,eAAO,MAAM,aAAa;;;;;;;;CAMzB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coreFactories = void 0;
4
+ const core_1 = require("@hyperlane-xyz/core");
5
+ const inboxFactories = {
6
+ inbox: new core_1.Inbox__factory(),
7
+ inboxValidatorManager: new core_1.InboxValidatorManager__factory(),
8
+ };
9
+ const outboxFactories = {
10
+ outbox: new core_1.Outbox__factory(),
11
+ outboxValidatorManager: new core_1.OutboxValidatorManager__factory(),
12
+ };
13
+ exports.coreFactories = Object.assign(Object.assign({ connectionManager: new core_1.AbacusConnectionManager__factory(), upgradeBeaconController: new core_1.UpgradeBeaconController__factory(), interchainGasPaymaster: new core_1.InterchainGasPaymaster__factory() }, inboxFactories), outboxFactories);
14
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/core/contracts.ts"],"names":[],"mappings":";;;AAAA,8CAe6B;AAgC7B,MAAM,cAAc,GAAG;IACrB,KAAK,EAAE,IAAI,qBAAc,EAAE;IAC3B,qBAAqB,EAAE,IAAI,qCAA8B,EAAE;CAC5D,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,IAAI,sBAAe,EAAE;IAC7B,sBAAsB,EAAE,IAAI,sCAA+B,EAAE;CAC9D,CAAC;AAEW,QAAA,aAAa,iCACxB,iBAAiB,EAAE,IAAI,uCAAgC,EAAE,EACzD,uBAAuB,EAAE,IAAI,uCAAgC,EAAE,EAC/D,sBAAsB,EAAE,IAAI,sCAA+B,EAAE,IAC1D,cAAc,GACd,eAAe,EAClB"}
@@ -0,0 +1,9 @@
1
+ import type { ProcessEvent } from '@hyperlane-xyz/core/dist/contracts/Inbox';
2
+ import type { DispatchEvent } from '@hyperlane-xyz/core/dist/contracts/Outbox';
3
+ import { Annotated } from '../events';
4
+ export { DispatchEvent, ProcessEvent };
5
+ export declare type HyperlaneLifecyleEvent = ProcessEvent | DispatchEvent;
6
+ export declare type AnnotatedDispatch = Annotated<DispatchEvent>;
7
+ export declare type AnnotatedProcess = Annotated<ProcessEvent>;
8
+ export declare type AnnotatedLifecycleEvent = AnnotatedDispatch | AnnotatedProcess;
9
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/core/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAEvC,oBAAY,sBAAsB,GAAG,YAAY,GAAG,aAAa,CAAC;AAElE,oBAAY,iBAAiB,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;AACzD,oBAAY,gBAAgB,GAAG,SAAS,CAAC,YAAY,CAAC,CAAC;AAEvD,oBAAY,uBAAuB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/core/events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,162 @@
1
+ import { BigNumber, providers } from 'ethers';
2
+ import { Inbox, Outbox } from '@hyperlane-xyz/core';
3
+ import { types } from '@hyperlane-xyz/utils';
4
+ import { MultiProvider } from '../providers/MultiProvider';
5
+ import { ChainName, NameOrDomain } from '../types';
6
+ import { HyperlaneCore } from './HyperlaneCore';
7
+ import { AnnotatedDispatch, AnnotatedLifecycleEvent, AnnotatedProcess } from './events';
8
+ export declare const resolveDomain: (nameOrDomain: NameOrDomain) => ChainName;
9
+ export declare const resolveId: (nameOrDomain: NameOrDomain) => number;
10
+ export declare const resolveNetworks: (message: types.ParsedMessage) => {
11
+ origin: ChainName;
12
+ destination: ChainName;
13
+ };
14
+ export declare type HyperlaneStatus = {
15
+ status: MessageStatus;
16
+ events: AnnotatedLifecycleEvent[];
17
+ };
18
+ export declare enum MessageStatus {
19
+ Dispatched = 0,
20
+ Included = 1,
21
+ Relayed = 2,
22
+ Processed = 3
23
+ }
24
+ export declare enum InboxMessageStatus {
25
+ None = 0,
26
+ Proven = 1,
27
+ Processed = 2
28
+ }
29
+ export declare type EventCache = {
30
+ process?: AnnotatedProcess;
31
+ };
32
+ /**
33
+ * A deserialized Hyperlane message.
34
+ */
35
+ export declare class HyperlaneMessage {
36
+ readonly dispatch: AnnotatedDispatch;
37
+ readonly message: types.ParsedMessage;
38
+ readonly outbox: Outbox;
39
+ readonly inbox: Inbox;
40
+ readonly multiProvider: MultiProvider;
41
+ readonly core: HyperlaneCore;
42
+ protected cache: EventCache;
43
+ constructor(multiProvider: MultiProvider, core: HyperlaneCore, dispatch: AnnotatedDispatch);
44
+ /**
45
+ * The receipt of the TX that dispatched this message
46
+ */
47
+ get receipt(): providers.TransactionReceipt;
48
+ /**
49
+ * Instantiate one or more messages from a receipt.
50
+ *
51
+ * @param core the {@link HyperlaneCore} object to use
52
+ * @param nameOrDomain the domain on which the receipt was logged
53
+ * @param receipt the receipt
54
+ * @returns an array of {@link HyperlaneMessage} objects
55
+ */
56
+ static fromReceipt(multiProvider: MultiProvider, core: HyperlaneCore, nameOrDomain: NameOrDomain, receipt: providers.TransactionReceipt): HyperlaneMessage[];
57
+ /**
58
+ * Instantiate EXACTLY one message from a receipt.
59
+ *
60
+ * @param core the {@link HyperlaneCore} object to use
61
+ * @param nameOrDomain the domain on which the receipt was logged
62
+ * @param receipt the receipt
63
+ * @returns an array of {@link HyperlaneMessage} objects
64
+ * @throws if there is not EXACTLY 1 dispatch in the receipt
65
+ */
66
+ static singleFromReceipt(multiProvider: MultiProvider, core: HyperlaneCore, nameOrDomain: NameOrDomain, receipt: providers.TransactionReceipt): HyperlaneMessage;
67
+ /**
68
+ * Instantiate one or more messages from a tx hash.
69
+ *
70
+ * @param core the {@link HyperlaneCore} object to use
71
+ * @param nameOrDomain the domain on which the receipt was logged
72
+ * @param receipt the receipt
73
+ * @returns an array of {@link HyperlaneMessage} objects
74
+ * @throws if there is no receipt for the TX
75
+ */
76
+ static fromTransactionHash(multiProvider: MultiProvider, core: HyperlaneCore, nameOrDomain: NameOrDomain, transactionHash: string): Promise<HyperlaneMessage[]>;
77
+ /**
78
+ * Instantiate EXACTLY one message from a transaction has.
79
+ *
80
+ * @param core the {@link HyperlaneCore} object to use
81
+ * @param nameOrDomain the domain on which the receipt was logged
82
+ * @param receipt the receipt
83
+ * @returns an array of {@link HyperlaneMessage} objects
84
+ * @throws if there is no receipt for the TX, or if not EXACTLY 1 dispatch in
85
+ * the receipt
86
+ */
87
+ static singleFromTransactionHash(multiProvider: MultiProvider, core: HyperlaneCore, nameOrDomain: NameOrDomain, transactionHash: string): Promise<HyperlaneMessage>;
88
+ /**
89
+ * Get the Inbox `Process` event associated with this message (if any)
90
+ *
91
+ * @returns An {@link AnnotatedProcess} (if any)
92
+ */
93
+ getProcess(): Promise<AnnotatedProcess | undefined>;
94
+ /**
95
+ * Get all lifecycle events associated with this message
96
+ *
97
+ * @returns An array of {@link AnnotatedLifecycleEvent} objects
98
+ */
99
+ events(): Promise<HyperlaneStatus>;
100
+ /**
101
+ * Retrieve the inbox status of this message.
102
+ *
103
+ * @returns The {@link InboxMessageStatus} corresponding to the solidity
104
+ * status of the message.
105
+ */
106
+ inboxStatus(): Promise<InboxMessageStatus>;
107
+ /**
108
+ * Checks whether the message has been delivered.
109
+ *
110
+ * @returns true if processed, else false.
111
+ */
112
+ delivered(): Promise<boolean>;
113
+ /**
114
+ * Returns a promise that resolves when the message has been delivered.
115
+ *
116
+ * WARNING: May never resolve. Oftern takes hours to resolve.
117
+ *
118
+ * @param opts Polling options.
119
+ */
120
+ wait(opts?: {
121
+ pollTime?: number;
122
+ }): Promise<void>;
123
+ /**
124
+ * The domain from which the message was sent.
125
+ */
126
+ get origin(): number;
127
+ get originName(): ChainName;
128
+ /**
129
+ * The identifier for the sender of this message
130
+ */
131
+ get sender(): string;
132
+ /**
133
+ * The destination domain for this message
134
+ */
135
+ get destination(): number;
136
+ get destinationName(): ChainName;
137
+ /**
138
+ * The identifer for the recipient for this message
139
+ */
140
+ get recipient(): string;
141
+ /**
142
+ * The message body
143
+ */
144
+ get body(): string;
145
+ /**
146
+ * The keccak256 hash of the message body
147
+ */
148
+ get bodyHash(): string;
149
+ /**
150
+ * The hash of the transaction that dispatched this message
151
+ */
152
+ get transactionHash(): string;
153
+ /**
154
+ * The messageHash committed to the tree in the Outbox contract.
155
+ */
156
+ get leaf(): string;
157
+ /**
158
+ * The index of the leaf in the contract.
159
+ */
160
+ get leafIndex(): BigNumber;
161
+ }
162
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceR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