@hyperlane-xyz/helloworld 1.4.3-beta1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app/app.d.ts +3 -7
- package/dist/src/app/app.d.ts.map +1 -1
- package/dist/src/app/app.js +35 -53
- package/dist/src/app/app.js.map +1 -1
- package/dist/src/app/contracts.d.ts +1 -1
- package/dist/src/app/contracts.d.ts.map +1 -1
- package/dist/src/app/types.d.ts +5 -0
- package/dist/src/app/types.d.ts.map +1 -0
- package/dist/src/app/types.js +3 -0
- package/dist/src/app/types.js.map +1 -0
- package/dist/src/deploy/config.d.ts +2 -56
- package/dist/src/deploy/config.d.ts.map +1 -1
- package/dist/src/deploy/deploy.js +8 -19
- package/dist/src/deploy/deploy.js.map +1 -1
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/multiProtocolApp/evmAdapter.d.ts +13 -0
- package/dist/src/multiProtocolApp/evmAdapter.d.ts.map +1 -0
- package/dist/src/multiProtocolApp/evmAdapter.js +35 -0
- package/dist/src/multiProtocolApp/evmAdapter.js.map +1 -0
- package/dist/src/multiProtocolApp/multiProtocolApp.d.ts +15 -0
- package/dist/src/multiProtocolApp/multiProtocolApp.d.ts.map +1 -0
- package/dist/src/multiProtocolApp/multiProtocolApp.js +34 -0
- package/dist/src/multiProtocolApp/multiProtocolApp.js.map +1 -0
- package/dist/src/multiProtocolApp/sealevelAdapter.d.ts +55 -0
- package/dist/src/multiProtocolApp/sealevelAdapter.d.ts.map +1 -0
- package/dist/src/multiProtocolApp/sealevelAdapter.js +202 -0
- package/dist/src/multiProtocolApp/sealevelAdapter.js.map +1 -0
- package/dist/src/multiProtocolApp/types.d.ts +10 -0
- package/dist/src/multiProtocolApp/types.d.ts.map +1 -0
- package/dist/src/multiProtocolApp/types.js +3 -0
- package/dist/src/multiProtocolApp/types.js.map +1 -0
- package/dist/src/scripts/check.js +12 -23
- package/dist/src/scripts/check.js.map +1 -1
- package/dist/src/scripts/deploy.js +14 -25
- package/dist/src/scripts/deploy.js.map +1 -1
- package/dist/src/test/deploy.test.js +16 -25
- package/dist/src/test/deploy.test.js.map +1 -1
- package/dist/src/test/helloworld.test.js +35 -46
- package/dist/src/test/helloworld.test.js.map +1 -1
- package/dist/src/types/@hyperlane-xyz/core/contracts/HyperlaneConnectionClient.d.ts +10 -10
- package/dist/src/types/@hyperlane-xyz/core/contracts/HyperlaneConnectionClient.d.ts.map +1 -1
- package/dist/src/types/@hyperlane-xyz/core/contracts/Router.d.ts +12 -12
- package/dist/src/types/@hyperlane-xyz/core/contracts/Router.d.ts.map +1 -1
- package/dist/src/types/@hyperlane-xyz/core/contracts/interfaces/IInterchainGasPaymaster.d.ts +2 -2
- package/dist/src/types/@hyperlane-xyz/core/contracts/interfaces/IInterchainGasPaymaster.d.ts.map +1 -1
- package/dist/src/types/@hyperlane-xyz/core/contracts/interfaces/IMailbox.d.ts +8 -8
- package/dist/src/types/@hyperlane-xyz/core/contracts/interfaces/IMailbox.d.ts.map +1 -1
- package/dist/src/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.d.ts +4 -4
- package/dist/src/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.d.ts.map +1 -1
- package/dist/src/types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts +2 -2
- package/dist/src/types/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.d.ts.map +1 -1
- package/dist/src/types/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.d.ts +2 -2
- package/dist/src/types/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.d.ts.map +1 -1
- package/dist/src/types/common.d.ts +4 -4
- package/dist/src/types/common.d.ts.map +1 -1
- package/dist/src/types/contracts/HelloWorld.d.ts +18 -18
- package/dist/src/types/contracts/HelloWorld.d.ts.map +1 -1
- package/dist/src/types/factories/contracts/HelloWorld__factory.d.ts +2 -2
- package/dist/src/types/factories/contracts/HelloWorld__factory.d.ts.map +1 -1
- package/dist/src/types/factories/contracts/HelloWorld__factory.js +1 -1
- package/dist/src/types/factories/contracts/HelloWorld__factory.js.map +1 -1
- package/package.json +7 -8
package/dist/src/app/app.d.ts
CHANGED
|
@@ -2,10 +2,7 @@ import { BigNumber, ethers } from 'ethers';
|
|
|
2
2
|
import { ChainMap, ChainName, HyperlaneContracts, HyperlaneContractsMap, HyperlaneCore, MultiProvider, RouterApp } from '@hyperlane-xyz/sdk';
|
|
3
3
|
import { HelloWorld } from '../types';
|
|
4
4
|
import { HelloWorldFactories } from './contracts';
|
|
5
|
-
|
|
6
|
-
sent: number;
|
|
7
|
-
received: number;
|
|
8
|
-
};
|
|
5
|
+
import { StatCounts } from './types';
|
|
9
6
|
export declare class HelloWorldApp extends RouterApp<HelloWorldFactories> {
|
|
10
7
|
readonly core: HyperlaneCore;
|
|
11
8
|
constructor(core: HyperlaneCore, contractsMap: HyperlaneContractsMap<HelloWorldFactories>, multiProvider: MultiProvider);
|
|
@@ -13,8 +10,7 @@ export declare class HelloWorldApp extends RouterApp<HelloWorldFactories> {
|
|
|
13
10
|
sendHelloWorld(from: ChainName, to: ChainName, message: string, value: BigNumber): Promise<ethers.ContractReceipt>;
|
|
14
11
|
waitForMessageReceipt(receipt: ethers.ContractReceipt): Promise<ethers.ContractReceipt[]>;
|
|
15
12
|
waitForMessageProcessed(receipt: ethers.ContractReceipt): Promise<void>;
|
|
16
|
-
channelStats(from: ChainName, to: ChainName): Promise<
|
|
17
|
-
stats(): Promise<ChainMap<ChainMap<
|
|
13
|
+
channelStats(from: ChainName, to: ChainName): Promise<StatCounts>;
|
|
14
|
+
stats(): Promise<ChainMap<ChainMap<StatCounts>>>;
|
|
18
15
|
}
|
|
19
|
-
export {};
|
|
20
16
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,SAAS,EACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EACL,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,SAAS,EACV,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,qBAAa,aAAc,SAAQ,SAAS,CAAC,mBAAmB,CAAC;aAE7C,IAAI,EAAE,aAAa;gBAAnB,IAAI,EAAE,aAAa,EACnC,YAAY,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,EACxD,aAAa,EAAE,aAAa;IAK9B,MAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,mBAAmB,CAAC,GAAG,UAAU;IAIhE,cAAc,CAClB,IAAI,EAAE,SAAS,EACf,EAAE,EAAE,SAAS,EACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC;IA4B5B,qBAAqB,CACzB,OAAO,EAAE,MAAM,CAAC,eAAe,GAC9B,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;IAI9B,uBAAuB,CAC3B,OAAO,EAAE,MAAM,CAAC,eAAe,GAC9B,OAAO,CAAC,IAAI,CAAC;IAIV,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IAWjE,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;CAcvD"}
|
package/dist/src/app/app.js
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.HelloWorldApp = void 0;
|
|
13
4
|
const sdk_1 = require("@hyperlane-xyz/sdk");
|
|
@@ -20,55 +11,46 @@ class HelloWorldApp extends sdk_1.RouterApp {
|
|
|
20
11
|
router(contracts) {
|
|
21
12
|
return contracts.router;
|
|
22
13
|
}
|
|
23
|
-
sendHelloWorld(from, to, message, value) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
from,
|
|
35
|
-
to,
|
|
36
|
-
message,
|
|
37
|
-
tx,
|
|
38
|
-
});
|
|
39
|
-
return tx.wait((blocks === null || blocks === void 0 ? void 0 : blocks.confirmations) || 1);
|
|
14
|
+
async sendHelloWorld(from, to, message, value) {
|
|
15
|
+
const sender = this.getContracts(from).router;
|
|
16
|
+
const toDomain = this.multiProvider.getDomainId(to);
|
|
17
|
+
const { blocks, transactionOverrides } = this.multiProvider.getChainMetadata(from);
|
|
18
|
+
// apply gas buffer due to https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/634
|
|
19
|
+
const estimated = await sender.estimateGas.sendHelloWorld(toDomain, message, { ...transactionOverrides, value });
|
|
20
|
+
const gasLimit = estimated.mul(12).div(10);
|
|
21
|
+
const tx = await sender.sendHelloWorld(toDomain, message, {
|
|
22
|
+
...transactionOverrides,
|
|
23
|
+
gasLimit,
|
|
24
|
+
value,
|
|
40
25
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
(0, utils_1.debug)('Sending hello message', {
|
|
27
|
+
from,
|
|
28
|
+
to,
|
|
29
|
+
message,
|
|
30
|
+
tx,
|
|
45
31
|
});
|
|
32
|
+
return tx.wait(blocks?.confirmations || 1);
|
|
46
33
|
}
|
|
47
|
-
|
|
48
|
-
return
|
|
49
|
-
return this.core.waitForMessageProcessed(receipt);
|
|
50
|
-
});
|
|
34
|
+
async waitForMessageReceipt(receipt) {
|
|
35
|
+
return this.core.waitForMessageProcessing(receipt);
|
|
51
36
|
}
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
const sent = yield this.getContracts(from).router.sentTo(this.multiProvider.getDomainId(to));
|
|
55
|
-
const received = yield this.getContracts(to).router.receivedFrom(this.multiProvider.getDomainId(from));
|
|
56
|
-
return { sent: sent.toNumber(), received: received.toNumber() };
|
|
57
|
-
});
|
|
37
|
+
async waitForMessageProcessed(receipt) {
|
|
38
|
+
return this.core.waitForMessageProcessed(receipt);
|
|
58
39
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return Object.fromEntries(
|
|
71
|
-
});
|
|
40
|
+
async channelStats(from, to) {
|
|
41
|
+
const sent = await this.getContracts(from).router.sentTo(this.multiProvider.getDomainId(to));
|
|
42
|
+
const received = await this.getContracts(to).router.receivedFrom(this.multiProvider.getDomainId(from));
|
|
43
|
+
return { sent: sent.toNumber(), received: received.toNumber() };
|
|
44
|
+
}
|
|
45
|
+
async stats() {
|
|
46
|
+
const entries = await Promise.all(this.chains().map(async (source) => {
|
|
47
|
+
const destinationEntries = await Promise.all(this.remoteChains(source).map(async (destination) => [
|
|
48
|
+
destination,
|
|
49
|
+
await this.channelStats(source, destination),
|
|
50
|
+
]));
|
|
51
|
+
return [source, Object.fromEntries(destinationEntries)];
|
|
52
|
+
}));
|
|
53
|
+
return Object.fromEntries(entries);
|
|
72
54
|
}
|
|
73
55
|
}
|
|
74
56
|
exports.HelloWorldApp = HelloWorldApp;
|
package/dist/src/app/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":";;;AAEA,4CAQ4B;AAC5B,gDAA6C;AAO7C,MAAa,aAAc,SAAQ,eAA8B;IAC/D,YACkB,IAAmB,EACnC,YAAwD,EACxD,aAA4B;QAE5B,KAAK,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;QAJnB,SAAI,GAAJ,IAAI,CAAe;IAKrC,CAAC;IAED,MAAM,CAAC,SAAkD;QACvD,OAAO,SAAS,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,IAAe,EACf,EAAa,EACb,OAAe,EACf,KAAgB;QAEhB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC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QACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,CAC9D,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,CACrC,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,OAAO,GAA6C,MAAM,OAAO,CAAC,GAAG,CACzE,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjC,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;gBACnD,WAAW;gBACX,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC;aAC7C,CAAC,CACH,CAAC;YACF,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CACH,CAAC;QACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAnFD,sCAmFC"}
|
|
@@ -2,5 +2,5 @@ import { HelloWorld__factory } from '../types';
|
|
|
2
2
|
export declare const helloWorldFactories: {
|
|
3
3
|
router: HelloWorld__factory;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type HelloWorldFactories = typeof helloWorldFactories;
|
|
6
6
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/app/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,mBAAmB;;CAE/B,CAAC;AAEF,
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/app/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,eAAO,MAAM,mBAAmB;;CAE/B,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/app/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/app/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,60 +1,6 @@
|
|
|
1
1
|
import { RouterConfig } from '@hyperlane-xyz/sdk';
|
|
2
|
-
export
|
|
2
|
+
export type HelloWorldConfig = RouterConfig;
|
|
3
3
|
export declare const prodConfigs: {
|
|
4
|
-
alfajores:
|
|
5
|
-
name: string;
|
|
6
|
-
chainId: number;
|
|
7
|
-
protocol: import("@hyperlane-xyz/utils").ProtocolType;
|
|
8
|
-
rpcUrls: [{
|
|
9
|
-
http: string;
|
|
10
|
-
webSocket?: string | undefined;
|
|
11
|
-
pagination?: {
|
|
12
|
-
maxBlockRange?: number | undefined;
|
|
13
|
-
minBlockNumber?: number | undefined;
|
|
14
|
-
maxBlockAge?: number | undefined;
|
|
15
|
-
} | undefined;
|
|
16
|
-
retry?: {
|
|
17
|
-
maxRequests: number;
|
|
18
|
-
baseRetryMs: number;
|
|
19
|
-
} | undefined;
|
|
20
|
-
}, ...{
|
|
21
|
-
http: string;
|
|
22
|
-
webSocket?: string | undefined;
|
|
23
|
-
pagination?: {
|
|
24
|
-
maxBlockRange?: number | undefined;
|
|
25
|
-
minBlockNumber?: number | undefined;
|
|
26
|
-
maxBlockAge?: number | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
retry?: {
|
|
29
|
-
maxRequests: number;
|
|
30
|
-
baseRetryMs: number;
|
|
31
|
-
} | undefined;
|
|
32
|
-
}[]];
|
|
33
|
-
domainId?: number | undefined;
|
|
34
|
-
displayName?: string | undefined;
|
|
35
|
-
displayNameShort?: string | undefined;
|
|
36
|
-
logoURI?: string | undefined;
|
|
37
|
-
nativeToken?: {
|
|
38
|
-
symbol: string;
|
|
39
|
-
name: string;
|
|
40
|
-
decimals: number;
|
|
41
|
-
} | undefined;
|
|
42
|
-
blockExplorers?: {
|
|
43
|
-
url: string;
|
|
44
|
-
name: string;
|
|
45
|
-
apiUrl: string;
|
|
46
|
-
apiKey?: string | undefined;
|
|
47
|
-
family?: import("@hyperlane-xyz/sdk").ExplorerFamily | undefined;
|
|
48
|
-
}[] | undefined;
|
|
49
|
-
blocks?: {
|
|
50
|
-
confirmations: number;
|
|
51
|
-
reorgPeriod?: number | undefined;
|
|
52
|
-
estimateBlockTime?: number | undefined;
|
|
53
|
-
} | undefined;
|
|
54
|
-
transactionOverrides?: {} | undefined;
|
|
55
|
-
gasCurrencyCoinGeckoId?: string | undefined;
|
|
56
|
-
gnosisSafeTransactionServiceUrl?: string | undefined;
|
|
57
|
-
isTestnet?: boolean | undefined;
|
|
58
|
-
};
|
|
4
|
+
alfajores: import("@hyperlane-xyz/sdk").ChainMetadata;
|
|
59
5
|
};
|
|
60
6
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/deploy/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,oBAAoB,CAAC;AAEjE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/deploy/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,oBAAoB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAG5C,eAAO,MAAM,WAAW;;CAEvB,CAAC"}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.HelloWorldDeployer = void 0;
|
|
13
4
|
const sdk_1 = require("@hyperlane-xyz/sdk");
|
|
@@ -22,16 +13,14 @@ class HelloWorldDeployer extends sdk_1.HyperlaneRouterDeployer {
|
|
|
22
13
|
}
|
|
23
14
|
// Custom contract deployment logic can go here
|
|
24
15
|
// If no custom logic is needed, call deployContract for the router
|
|
25
|
-
deployContracts(chain, config) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
});
|
|
16
|
+
async deployContracts(chain, config) {
|
|
17
|
+
const router = await this.deployContract(chain, 'router', [
|
|
18
|
+
config.mailbox,
|
|
19
|
+
config.interchainGasPaymaster,
|
|
20
|
+
]);
|
|
21
|
+
return {
|
|
22
|
+
router,
|
|
23
|
+
};
|
|
35
24
|
}
|
|
36
25
|
}
|
|
37
26
|
exports.HelloWorldDeployer = HelloWorldDeployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/deploy/deploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/deploy/deploy.ts"],"names":[],"mappings":";;;AAAA,4CAM4B;AAE5B,gDAA4E;AAK5E,MAAa,kBAAmB,SAAQ,6BAGvC;IACC,YACE,aAA4B,EACnB,UAAgC;QAEzC,KAAK,CAAC,aAAa,EAAE,+BAAmB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAFjD,eAAU,GAAV,UAAU,CAAsB;IAG3C,CAAC;IAED,MAAM,CAAC,SAAkD;QACvD,OAAO,SAAS,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,+CAA+C;IAC/C,mEAAmE;IACnE,KAAK,CAAC,eAAe,CAAC,KAAgB,EAAE,MAAwB;QAC9D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,QAAQ,EAAE;YACxD,MAAM,CAAC,OAAO;YACd,MAAM,CAAC,sBAAsB;SAC9B,CAAC,CAAC;QACH,OAAO;YACL,MAAM;SACP,CAAC;IACJ,CAAC;CACF;AA1BD,gDA0BC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -3,5 +3,9 @@ export { HelloWorldFactories, helloWorldFactories } from './app/contracts';
|
|
|
3
3
|
export { HelloWorldChecker } from './deploy/check';
|
|
4
4
|
export { HelloWorldConfig } from './deploy/config';
|
|
5
5
|
export { HelloWorldDeployer } from './deploy/deploy';
|
|
6
|
+
export { EvmHelloWorldAdapter } from './multiProtocolApp/evmAdapter';
|
|
7
|
+
export { HelloMultiProtocolApp } from './multiProtocolApp/multiProtocolApp';
|
|
8
|
+
export { SealevelHelloWorldAdapter } from './multiProtocolApp/sealevelAdapter';
|
|
9
|
+
export { IHelloWorldAdapter } from './multiProtocolApp/types';
|
|
6
10
|
export * as types from './types';
|
|
7
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.types = exports.HelloWorldDeployer = exports.HelloWorldChecker = exports.helloWorldFactories = exports.HelloWorldApp = void 0;
|
|
26
|
+
exports.types = exports.SealevelHelloWorldAdapter = exports.HelloMultiProtocolApp = exports.EvmHelloWorldAdapter = exports.HelloWorldDeployer = exports.HelloWorldChecker = exports.helloWorldFactories = exports.HelloWorldApp = void 0;
|
|
27
27
|
var app_1 = require("./app/app");
|
|
28
28
|
Object.defineProperty(exports, "HelloWorldApp", { enumerable: true, get: function () { return app_1.HelloWorldApp; } });
|
|
29
29
|
var contracts_1 = require("./app/contracts");
|
|
@@ -32,5 +32,11 @@ var check_1 = require("./deploy/check");
|
|
|
32
32
|
Object.defineProperty(exports, "HelloWorldChecker", { enumerable: true, get: function () { return check_1.HelloWorldChecker; } });
|
|
33
33
|
var deploy_1 = require("./deploy/deploy");
|
|
34
34
|
Object.defineProperty(exports, "HelloWorldDeployer", { enumerable: true, get: function () { return deploy_1.HelloWorldDeployer; } });
|
|
35
|
+
var evmAdapter_1 = require("./multiProtocolApp/evmAdapter");
|
|
36
|
+
Object.defineProperty(exports, "EvmHelloWorldAdapter", { enumerable: true, get: function () { return evmAdapter_1.EvmHelloWorldAdapter; } });
|
|
37
|
+
var multiProtocolApp_1 = require("./multiProtocolApp/multiProtocolApp");
|
|
38
|
+
Object.defineProperty(exports, "HelloMultiProtocolApp", { enumerable: true, get: function () { return multiProtocolApp_1.HelloMultiProtocolApp; } });
|
|
39
|
+
var sealevelAdapter_1 = require("./multiProtocolApp/sealevelAdapter");
|
|
40
|
+
Object.defineProperty(exports, "SealevelHelloWorldAdapter", { enumerable: true, get: function () { return sealevelAdapter_1.SealevelHelloWorldAdapter; } });
|
|
35
41
|
exports.types = __importStar(require("./types"));
|
|
36
42
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA0C;AAAjC,oGAAA,aAAa,OAAA;AACtB,6CAA2E;AAA7C,gHAAA,mBAAmB,OAAA;AACjD,wCAAmD;AAA1C,0GAAA,iBAAiB,OAAA;AAE1B,0CAAqD;AAA5C,4GAAA,kBAAkB,OAAA;AAC3B,iDAAiC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA0C;AAAjC,oGAAA,aAAa,OAAA;AACtB,6CAA2E;AAA7C,gHAAA,mBAAmB,OAAA;AACjD,wCAAmD;AAA1C,0GAAA,iBAAiB,OAAA;AAE1B,0CAAqD;AAA5C,4GAAA,kBAAkB,OAAA;AAC3B,4DAAqE;AAA5D,kHAAA,oBAAoB,OAAA;AAC7B,wEAA4E;AAAnE,yHAAA,qBAAqB,OAAA;AAC9B,sEAA+E;AAAtE,4HAAA,yBAAyB,OAAA;AAElC,iDAAiC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChainName, EthersV5Transaction, EvmRouterAdapter, RouterAddress } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { Address } from '@hyperlane-xyz/utils';
|
|
3
|
+
import { StatCounts } from '../app/types';
|
|
4
|
+
import { HelloWorld } from '../types';
|
|
5
|
+
import { IHelloWorldAdapter } from './types';
|
|
6
|
+
export declare class EvmHelloWorldAdapter extends EvmRouterAdapter<RouterAddress & {
|
|
7
|
+
mailbox: Address;
|
|
8
|
+
}> implements IHelloWorldAdapter {
|
|
9
|
+
populateSendHelloTx(origin: ChainName, destination: ChainName, message: string, value: string): Promise<EthersV5Transaction>;
|
|
10
|
+
channelStats(origin: ChainName, destination: ChainName): Promise<StatCounts>;
|
|
11
|
+
getConnectedContract(chain: ChainName): HelloWorld;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=evmAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evmAdapter.d.ts","sourceRoot":"","sources":["../../../src/multiProtocolApp/evmAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAEhB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAuB,MAAM,UAAU,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,oBACX,SAAQ,gBAAgB,CAAC,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAC7D,YAAW,kBAAkB;IAEvB,mBAAmB,CACvB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,mBAAmB,CAAC;IA0BzB,YAAY,CAChB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,GACrB,OAAO,CAAC,UAAU,CAAC;IAYb,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU;CAK5D"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EvmHelloWorldAdapter = void 0;
|
|
4
|
+
const sdk_1 = require("@hyperlane-xyz/sdk");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
class EvmHelloWorldAdapter extends sdk_1.EvmRouterAdapter {
|
|
7
|
+
async populateSendHelloTx(origin, destination, message, value) {
|
|
8
|
+
const contract = this.getConnectedContract(origin);
|
|
9
|
+
const toDomain = this.multiProvider.getDomainId(destination);
|
|
10
|
+
const { transactionOverrides } = this.multiProvider.getChainMetadata(origin);
|
|
11
|
+
// apply gas buffer due to https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/634
|
|
12
|
+
const estimated = await contract.estimateGas.sendHelloWorld(toDomain, message, { ...transactionOverrides, value });
|
|
13
|
+
const gasLimit = estimated.mul(12).div(10);
|
|
14
|
+
const tx = await contract.populateTransaction.sendHelloWorld(toDomain, message, {
|
|
15
|
+
...transactionOverrides,
|
|
16
|
+
gasLimit,
|
|
17
|
+
value,
|
|
18
|
+
});
|
|
19
|
+
return { transaction: tx, type: sdk_1.ProviderType.EthersV5 };
|
|
20
|
+
}
|
|
21
|
+
async channelStats(origin, destination) {
|
|
22
|
+
const originDomain = this.multiProvider.getDomainId(origin);
|
|
23
|
+
const destinationDomain = this.multiProvider.getDomainId(destination);
|
|
24
|
+
const sent = await this.getConnectedContract(origin).sentTo(destinationDomain);
|
|
25
|
+
const received = await this.getConnectedContract(destination).sentTo(originDomain);
|
|
26
|
+
return { sent: sent.toNumber(), received: received.toNumber() };
|
|
27
|
+
}
|
|
28
|
+
getConnectedContract(chain) {
|
|
29
|
+
const address = this.multiProvider.getChainMetadata(chain).router;
|
|
30
|
+
const provider = this.multiProvider.getEthersV5Provider(chain);
|
|
31
|
+
return types_1.HelloWorld__factory.connect(address, provider);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.EvmHelloWorldAdapter = EvmHelloWorldAdapter;
|
|
35
|
+
//# sourceMappingURL=evmAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evmAdapter.js","sourceRoot":"","sources":["../../../src/multiProtocolApp/evmAdapter.ts"],"names":[],"mappings":";;;AAAA,4CAM4B;AAI5B,oCAA2D;AAI3D,MAAa,oBACX,SAAQ,sBAAsD;IAG9D,KAAK,CAAC,mBAAmB,CACvB,MAAiB,EACjB,WAAsB,EACtB,OAAe,EACf,KAAa;QAEb,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,CAAC,MA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AClE,CAAC;IAEQ,oBAAoB,CAAC,KAAgB;QAC5C,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC/D,OAAO,2BAAmB,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACxD,CAAC;CACF;AAvDD,oDAuDC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ChainMap, ChainName, MultiProtocolRouterApp, RouterAddress, TypedTransaction } from '@hyperlane-xyz/sdk';
|
|
2
|
+
import { Address, ProtocolType } from '@hyperlane-xyz/utils';
|
|
3
|
+
import { StatCounts } from '../app/types';
|
|
4
|
+
import { EvmHelloWorldAdapter } from './evmAdapter';
|
|
5
|
+
import { SealevelHelloWorldAdapter } from './sealevelAdapter';
|
|
6
|
+
import { IHelloWorldAdapter } from './types';
|
|
7
|
+
export declare class HelloMultiProtocolApp extends MultiProtocolRouterApp<RouterAddress & {
|
|
8
|
+
mailbox: Address;
|
|
9
|
+
}, IHelloWorldAdapter> {
|
|
10
|
+
protocolToAdapter(protocol: ProtocolType): typeof EvmHelloWorldAdapter | typeof SealevelHelloWorldAdapter;
|
|
11
|
+
populateHelloWorldTx(origin: ChainName, destination: ChainName, message: string, value: string, sender: Address): Promise<TypedTransaction>;
|
|
12
|
+
channelStats(origin: ChainName, destination: ChainName): Promise<StatCounts>;
|
|
13
|
+
stats(): Promise<ChainMap<ChainMap<StatCounts>>>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=multiProtocolApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiProtocolApp.d.ts","sourceRoot":"","sources":["../../../src/multiProtocolApp/multiProtocolApp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,qBAAsB,SAAQ,sBAAsB,CAC/D,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,EACpC,kBAAkB,CACnB;IACU,iBAAiB,CAAC,QAAQ,EAAE,YAAY;IAMjD,oBAAoB,CAClB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,gBAAgB,CAAC;IAU5B,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC;IAItE,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;CAcvD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HelloMultiProtocolApp = void 0;
|
|
4
|
+
const sdk_1 = require("@hyperlane-xyz/sdk");
|
|
5
|
+
const utils_1 = require("@hyperlane-xyz/utils");
|
|
6
|
+
const evmAdapter_1 = require("./evmAdapter");
|
|
7
|
+
const sealevelAdapter_1 = require("./sealevelAdapter");
|
|
8
|
+
class HelloMultiProtocolApp extends sdk_1.MultiProtocolRouterApp {
|
|
9
|
+
protocolToAdapter(protocol) {
|
|
10
|
+
if (protocol === utils_1.ProtocolType.Ethereum)
|
|
11
|
+
return evmAdapter_1.EvmHelloWorldAdapter;
|
|
12
|
+
if (protocol === utils_1.ProtocolType.Sealevel)
|
|
13
|
+
return sealevelAdapter_1.SealevelHelloWorldAdapter;
|
|
14
|
+
throw new Error(`No adapter for protocol ${protocol}`);
|
|
15
|
+
}
|
|
16
|
+
populateHelloWorldTx(origin, destination, message, value, sender) {
|
|
17
|
+
return this.adapter(origin).populateSendHelloTx(origin, destination, message, value, sender);
|
|
18
|
+
}
|
|
19
|
+
channelStats(origin, destination) {
|
|
20
|
+
return this.adapter(origin).channelStats(origin, destination);
|
|
21
|
+
}
|
|
22
|
+
async stats() {
|
|
23
|
+
const entries = await Promise.all(this.chains().map(async (source) => {
|
|
24
|
+
const destinationEntries = await Promise.all(this.remoteChains(source).map(async (destination) => [
|
|
25
|
+
destination,
|
|
26
|
+
await this.channelStats(source, destination),
|
|
27
|
+
]));
|
|
28
|
+
return [source, Object.fromEntries(destinationEntries)];
|
|
29
|
+
}));
|
|
30
|
+
return Object.fromEntries(entries);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.HelloMultiProtocolApp = HelloMultiProtocolApp;
|
|
34
|
+
//# sourceMappingURL=multiProtocolApp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiProtocolApp.js","sourceRoot":"","sources":["../../../src/multiProtocolApp/multiProtocolApp.ts"],"names":[],"mappings":";;;AAAA,4CAM4B;AAC5B,gDAA6D;AAI7D,6CAAoD;AACpD,uDAA8D;AAG9D,MAAa,qBAAsB,SAAQ,4BAG1C;IACU,iBAAiB,CAAC,QAAsB;QAC/C,IAAI,QAAQ,KAAK,oBAAY,CAAC,QAAQ;YAAE,OAAO,iCAAoB,CAAC;QACpE,IAAI,QAAQ,KAAK,oBAAY,CAAC,QAAQ;YAAE,OAAO,2CAAyB,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,oBAAoB,CAClB,MAAiB,EACjB,WAAsB,EACtB,OAAe,EACf,KAAa,EACb,MAAe;QAEf,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,mBAAmB,CAC7C,MAAM,EACN,WAAW,EACX,OAAO,EACP,KAAK,EACL,MAAM,CACP,CAAC;IACJ,CAAC;IAED,YAAY,CAAC,MAAiB,EAAE,WAAsB;QACpD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAChE,CAAC;IAED,KAAK,CAAC,KAAK;QACT,MAAM,OAAO,GAA6C,MAAM,OAAO,CAAC,GAAG,CACzE,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YACjC,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,GAAG,CAC1C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;gBACnD,WAAW;gBACX,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,CAAC;aAC7C,CAAC,CACH,CAAC;YACF,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CACH,CAAC;QACF,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AA5CD,sDA4CC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { AccountMeta, PublicKey } from '@solana/web3.js';
|
|
2
|
+
import { ChainName, RouterAddress, SealevelRouterAdapter, SolanaWeb3Transaction } from '@hyperlane-xyz/sdk';
|
|
3
|
+
import { Address, Domain } from '@hyperlane-xyz/utils';
|
|
4
|
+
import { StatCounts } from '../app/types';
|
|
5
|
+
import { IHelloWorldAdapter } from './types';
|
|
6
|
+
export declare class SealevelHelloWorldAdapter extends SealevelRouterAdapter<RouterAddress & {
|
|
7
|
+
mailbox: Address;
|
|
8
|
+
}> implements IHelloWorldAdapter {
|
|
9
|
+
populateSendHelloTx(origin: ChainName, destination: ChainName, message: string, value: string, sender: Address): Promise<SolanaWeb3Transaction>;
|
|
10
|
+
getSendHelloKeyList(programId: PublicKey, mailbox: PublicKey, sender: PublicKey, randomWallet: PublicKey): Array<AccountMeta>;
|
|
11
|
+
deriveProgramStoragePDA(programId: string | PublicKey): PublicKey;
|
|
12
|
+
channelStats(origin: ChainName, _destination: ChainName): Promise<StatCounts>;
|
|
13
|
+
getAccountInfo(chain: ChainName): Promise<HelloWorldData>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Borsh Schema
|
|
17
|
+
*/
|
|
18
|
+
export declare enum HelloWorldInstruction {
|
|
19
|
+
Init = 0,
|
|
20
|
+
SendHelloWorld = 1,
|
|
21
|
+
SetInterchainSecurityModule = 2,
|
|
22
|
+
EnrollRemoteRouters = 3
|
|
23
|
+
}
|
|
24
|
+
export declare class SendHelloWorldInstruction {
|
|
25
|
+
readonly fields: any;
|
|
26
|
+
destination: number;
|
|
27
|
+
message: string;
|
|
28
|
+
constructor(fields: any);
|
|
29
|
+
}
|
|
30
|
+
export declare const SendHelloWorldSchema: Map<any, any>;
|
|
31
|
+
export declare class HelloWorldData {
|
|
32
|
+
readonly fields: any;
|
|
33
|
+
local_domain: Domain;
|
|
34
|
+
mailbox: Uint8Array;
|
|
35
|
+
mailbox_pubkey: PublicKey;
|
|
36
|
+
ism?: Uint8Array;
|
|
37
|
+
ism_pubkey?: PublicKey;
|
|
38
|
+
igp?: {
|
|
39
|
+
program_id: Uint8Array;
|
|
40
|
+
type: number;
|
|
41
|
+
igp_account: Uint8Array;
|
|
42
|
+
};
|
|
43
|
+
igp_pubkey?: PublicKey;
|
|
44
|
+
igp_account_pubkey?: PublicKey;
|
|
45
|
+
owner?: Uint8Array;
|
|
46
|
+
owner_pubkey?: PublicKey;
|
|
47
|
+
sent: bigint;
|
|
48
|
+
received: bigint;
|
|
49
|
+
sent_to: Map<Domain, bigint>;
|
|
50
|
+
received_from: Map<Domain, bigint>;
|
|
51
|
+
routers: Map<Domain, Uint8Array>;
|
|
52
|
+
constructor(fields: any);
|
|
53
|
+
}
|
|
54
|
+
export declare const HelloWorldDataSchema: Map<any, any>;
|
|
55
|
+
//# sourceMappingURL=sealevelAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealevelAdapter.d.ts","sourceRoot":"","sources":["../../../src/multiProtocolApp/sealevelAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAEX,SAAS,EAIV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAEL,SAAS,EAET,aAAa,EAKb,qBAAqB,EACrB,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAE7C,qBAAa,yBACX,SAAQ,qBAAqB,CAAC,aAAa,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAClE,YAAW,kBAAkB;IAEvB,mBAAmB,CACvB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,SAAS,EACtB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,OAAO,GACd,OAAO,CAAC,qBAAqB,CAAC;IAqDjC,mBAAmB,CACjB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,SAAS,EAClB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,SAAS,GACtB,KAAK,CAAC,WAAW,CAAC;IAuDrB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAO3D,YAAY,CAChB,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