@hyperlane-xyz/provider-sdk 3.0.1 → 4.0.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/artifact.d.ts +9 -0
- package/dist/artifact.d.ts.map +1 -1
- package/dist/artifact.js +11 -0
- package/dist/artifact.js.map +1 -1
- package/dist/core.d.ts +27 -3
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +127 -1
- package/dist/core.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mailbox.d.ts +90 -0
- package/dist/mailbox.d.ts.map +1 -0
- package/dist/mailbox.js +29 -0
- package/dist/mailbox.js.map +1 -0
- package/dist/protocol.d.ts +22 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/validator-announce.d.ts +67 -0
- package/dist/validator-announce.d.ts.map +1 -0
- package/dist/validator-announce.js +2 -0
- package/dist/validator-announce.js.map +1 -0
- package/package.json +6 -4
package/dist/artifact.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ZERO_ADDRESS_HEX_32 } from '@hyperlane-xyz/utils';
|
|
1
2
|
import { ISigner } from './altvm.js';
|
|
2
3
|
import { AnnotatedTx, TxReceipt } from './module.js';
|
|
3
4
|
export declare const ArtifactState: {
|
|
@@ -151,5 +152,13 @@ export interface IArtifactManager<TypeKey extends string, ConfigMap extends Reco
|
|
|
151
152
|
createReader<T extends TypeKey>(type: T): ArtifactReader<ConfigMap[T], D>;
|
|
152
153
|
createWriter<T extends TypeKey>(type: T, signer: ISigner<AnnotatedTx, TxReceipt>): ArtifactWriter<ConfigMap[T], D>;
|
|
153
154
|
}
|
|
155
|
+
export type UnsetArtifactAddress = typeof ZERO_ADDRESS_HEX_32;
|
|
156
|
+
/**
|
|
157
|
+
* Returns the artifact if DEPLOYED, undefined if UNDERIVED with zero address.
|
|
158
|
+
* Throws if UNDERIVED with non-zero address.
|
|
159
|
+
*/
|
|
160
|
+
export declare function toDeployedOrUndefined<C, D extends {
|
|
161
|
+
address: string;
|
|
162
|
+
}>(artifact: ArtifactOnChain<C, D>, name: string): ArtifactDeployed<C, D> | undefined;
|
|
154
163
|
export {};
|
|
155
164
|
//# sourceMappingURL=artifact.d.ts.map
|
package/dist/artifact.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../src/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAErD,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E;;;GAGG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,aAAa,CAAC,EAAE,OAAO,aAAa,CAAC,GAAG,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC;CACX,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI;IACnC,aAAa,EAAE,OAAO,aAAa,CAAC,QAAQ,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,aAAa,EAAE,OAAO,aAAa,CAAC,SAAS,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,IAC5B,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GACtB,iBAAiB,CAAC,CAAC,CAAC,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;CAC5B,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAC/B,OAAO,SAAS,MAAM,EACtB,SAAS,SAAS,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,EACtC,CAAC;IAED,YAAY,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1E,YAAY,CAAC,CAAC,SAAS,OAAO,EAC5B,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,GACtC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACpC;AAED,MAAM,MAAM,oBAAoB,GAAG,OAAO,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,EACpE,QAAQ,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAC/B,IAAI,EAAE,MAAM,GACX,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CAOpC"}
|
package/dist/artifact.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert, isEmptyAddress, } from '@hyperlane-xyz/utils';
|
|
1
2
|
export const ArtifactState = {
|
|
2
3
|
NEW: 'new',
|
|
3
4
|
DEPLOYED: 'deployed',
|
|
@@ -23,4 +24,14 @@ export function isArtifactDeployed(artifact) {
|
|
|
23
24
|
export function isArtifactUnderived(artifact) {
|
|
24
25
|
return artifact.artifactState === ArtifactState.UNDERIVED;
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns the artifact if DEPLOYED, undefined if UNDERIVED with zero address.
|
|
29
|
+
* Throws if UNDERIVED with non-zero address.
|
|
30
|
+
*/
|
|
31
|
+
export function toDeployedOrUndefined(artifact, name) {
|
|
32
|
+
if (isArtifactDeployed(artifact))
|
|
33
|
+
return artifact;
|
|
34
|
+
assert(isEmptyAddress(artifact.deployed.address), `Expected ${name} to be DEPLOYED or UNDERIVED with zero address, got UNDERIVED with non-zero address ${artifact.deployed.address}`);
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
26
37
|
//# sourceMappingURL=artifact.js.map
|
package/dist/artifact.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../src/artifact.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../src/artifact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAI9B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;CACd,CAAC;AAiDX;;;GAGG;AACH,MAAM,UAAU,aAAa,CAC3B,QAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,aAAa,KAAK,SAAS;QACpC,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,GAAG,CAC7C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAAwB;IAExB,OAAO,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,QAAQ,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,QAAwB;IAExB,OAAO,QAAQ,CAAC,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC;AAC5D,CAAC;AAkID;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,QAA+B,EAC/B,IAAY;IAEZ,IAAI,kBAAkB,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAClD,MAAM,CACJ,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EACzC,YAAY,IAAI,uFAAuF,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,CACnI,CAAC;IACF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { ArtifactNew, UnsetArtifactAddress } from './artifact.js';
|
|
2
|
+
import { ChainLookup } from './chain.js';
|
|
1
3
|
import type { DerivedHookConfig, HookConfig } from './hook.js';
|
|
2
4
|
import type { DerivedIsmConfig, IsmConfig } from './ism.js';
|
|
5
|
+
import { DeployedMailboxArtifact, MailboxArtifactConfig } from './mailbox.js';
|
|
6
|
+
import { DeployedValidatorAnnounceArtifact } from './validator-announce.js';
|
|
3
7
|
export type CoreModuleType = {
|
|
4
8
|
config: CoreConfig;
|
|
5
9
|
derived: DerivedCoreConfig;
|
|
@@ -12,9 +16,9 @@ export interface CoreConfig {
|
|
|
12
16
|
requiredHook: HookConfig | string;
|
|
13
17
|
}
|
|
14
18
|
export interface DerivedCoreConfig extends CoreConfig {
|
|
15
|
-
defaultIsm: DerivedIsmConfig;
|
|
16
|
-
defaultHook: DerivedHookConfig;
|
|
17
|
-
requiredHook: DerivedHookConfig;
|
|
19
|
+
defaultIsm: DerivedIsmConfig | UnsetArtifactAddress;
|
|
20
|
+
defaultHook: DerivedHookConfig | UnsetArtifactAddress;
|
|
21
|
+
requiredHook: DerivedHookConfig | UnsetArtifactAddress;
|
|
18
22
|
}
|
|
19
23
|
export type DeployedCoreAddresses = {
|
|
20
24
|
staticMerkleRootMultisigIsmFactory: string;
|
|
@@ -34,4 +38,24 @@ export type DeployedCoreAddresses = {
|
|
|
34
38
|
merkleTreeHook?: string;
|
|
35
39
|
interchainGasPaymaster?: string;
|
|
36
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Converts CoreConfig to MailboxOnChain artifact format.
|
|
43
|
+
* Converts nested ISM and hook configs to artifact format.
|
|
44
|
+
*
|
|
45
|
+
* @param config CoreConfig with ISM/hook configs or addresses
|
|
46
|
+
* @param chainLookup Chain lookup for domain resolution
|
|
47
|
+
* @returns Mailbox artifact ready for deployment
|
|
48
|
+
*/
|
|
49
|
+
export declare function coreConfigToArtifact(config: CoreConfig, chainLookup: ChainLookup): ArtifactNew<MailboxArtifactConfig>;
|
|
50
|
+
/**
|
|
51
|
+
* Converts CoreWriter result to DeployedCoreAddresses format.
|
|
52
|
+
* Maps deployed ISM and hook types to factory address fields.
|
|
53
|
+
*
|
|
54
|
+
* @param result CoreWriter create() result with mailbox and validator announce artifacts
|
|
55
|
+
* @returns DeployedCoreAddresses with factory addresses mapped
|
|
56
|
+
*/
|
|
57
|
+
export declare function coreResultToDeployedAddresses(result: {
|
|
58
|
+
mailbox: DeployedMailboxArtifact;
|
|
59
|
+
validatorAnnounce: DeployedValidatorAnnounceArtifact | null;
|
|
60
|
+
}): DeployedCoreAddresses;
|
|
37
61
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAGX,oBAAoB,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAM/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAM5D,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM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AAgB,6BAA6B,CAAC,MAAM,EAAE;IACpD,OAAO,EAAE,uBAAuB,CAAC;IACjC,iBAAiB,EAAE,iCAAiC,GAAG,IAAI,CAAC;CAC7D,GAAG,qBAAqB,CAqExB"}
|
package/dist/core.js
CHANGED
|
@@ -1,2 +1,128 @@
|
|
|
1
|
-
|
|
1
|
+
import { ArtifactState, isArtifactDeployed, } from './artifact.js';
|
|
2
|
+
import { hookConfigToArtifact, } from './hook.js';
|
|
3
|
+
import { ismConfigToArtifact, } from './ism.js';
|
|
4
|
+
/**
|
|
5
|
+
* Converts CoreConfig to MailboxOnChain artifact format.
|
|
6
|
+
* Converts nested ISM and hook configs to artifact format.
|
|
7
|
+
*
|
|
8
|
+
* @param config CoreConfig with ISM/hook configs or addresses
|
|
9
|
+
* @param chainLookup Chain lookup for domain resolution
|
|
10
|
+
* @returns Mailbox artifact ready for deployment
|
|
11
|
+
*/
|
|
12
|
+
export function coreConfigToArtifact(config, chainLookup) {
|
|
13
|
+
// Convert ISM config to artifact (handles both string addresses and config objects)
|
|
14
|
+
let defaultIsmArtifact;
|
|
15
|
+
if (typeof config.defaultIsm === 'string') {
|
|
16
|
+
defaultIsmArtifact = {
|
|
17
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
18
|
+
deployed: { address: config.defaultIsm },
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
defaultIsmArtifact = ismConfigToArtifact(config.defaultIsm, chainLookup);
|
|
23
|
+
}
|
|
24
|
+
// Convert hook configs to artifacts
|
|
25
|
+
let defaultHookArtifact;
|
|
26
|
+
if (typeof config.defaultHook === 'string') {
|
|
27
|
+
defaultHookArtifact = {
|
|
28
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
29
|
+
deployed: { address: config.defaultHook },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
defaultHookArtifact = hookConfigToArtifact(config.defaultHook, chainLookup);
|
|
34
|
+
}
|
|
35
|
+
let requiredHookArtifact;
|
|
36
|
+
if (typeof config.requiredHook === 'string') {
|
|
37
|
+
requiredHookArtifact = {
|
|
38
|
+
artifactState: ArtifactState.UNDERIVED,
|
|
39
|
+
deployed: { address: config.requiredHook },
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
requiredHookArtifact = hookConfigToArtifact(config.requiredHook, chainLookup);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
artifactState: ArtifactState.NEW,
|
|
47
|
+
config: {
|
|
48
|
+
owner: config.owner,
|
|
49
|
+
defaultIsm: defaultIsmArtifact,
|
|
50
|
+
defaultHook: defaultHookArtifact,
|
|
51
|
+
requiredHook: requiredHookArtifact,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Converts CoreWriter result to DeployedCoreAddresses format.
|
|
57
|
+
* Maps deployed ISM and hook types to factory address fields.
|
|
58
|
+
*
|
|
59
|
+
* @param result CoreWriter create() result with mailbox and validator announce artifacts
|
|
60
|
+
* @returns DeployedCoreAddresses with factory addresses mapped
|
|
61
|
+
*/
|
|
62
|
+
export function coreResultToDeployedAddresses(result) {
|
|
63
|
+
const addresses = {
|
|
64
|
+
mailbox: result.mailbox.deployed.address,
|
|
65
|
+
validatorAnnounce: result.validatorAnnounce?.deployed.address ?? '',
|
|
66
|
+
staticMerkleRootMultisigIsmFactory: '',
|
|
67
|
+
proxyAdmin: '',
|
|
68
|
+
staticMerkleRootWeightedMultisigIsmFactory: '',
|
|
69
|
+
incrementalDomainRoutingIsmFactory: '',
|
|
70
|
+
staticAggregationHookFactory: '',
|
|
71
|
+
staticAggregationIsmFactory: '',
|
|
72
|
+
staticMessageIdMultisigIsmFactory: '',
|
|
73
|
+
staticMessageIdWeightedMultisigIsmFactory: '',
|
|
74
|
+
testRecipient: '',
|
|
75
|
+
interchainAccountRouter: '',
|
|
76
|
+
domainRoutingIsmFactory: '',
|
|
77
|
+
};
|
|
78
|
+
// Map ISM address to factory field based on type
|
|
79
|
+
const ismArtifact = result.mailbox.config.defaultIsm;
|
|
80
|
+
if (isArtifactDeployed(ismArtifact)) {
|
|
81
|
+
const ismAddress = ismArtifact.deployed.address;
|
|
82
|
+
switch (ismArtifact.config.type) {
|
|
83
|
+
case 'merkleRootMultisigIsm':
|
|
84
|
+
addresses.staticMerkleRootMultisigIsmFactory = ismAddress;
|
|
85
|
+
break;
|
|
86
|
+
case 'messageIdMultisigIsm':
|
|
87
|
+
addresses.staticMessageIdMultisigIsmFactory = ismAddress;
|
|
88
|
+
break;
|
|
89
|
+
case 'domainRoutingIsm':
|
|
90
|
+
addresses.domainRoutingIsmFactory = ismAddress;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
// Map default hook address to factory field
|
|
95
|
+
const defaultHookArtifact = result.mailbox.config.defaultHook;
|
|
96
|
+
if (isArtifactDeployed(defaultHookArtifact)) {
|
|
97
|
+
const hookAddress = defaultHookArtifact.deployed.address;
|
|
98
|
+
switch (defaultHookArtifact.config.type) {
|
|
99
|
+
case 'interchainGasPaymaster':
|
|
100
|
+
addresses.interchainGasPaymaster = hookAddress;
|
|
101
|
+
break;
|
|
102
|
+
case 'merkleTreeHook':
|
|
103
|
+
addresses.merkleTreeHook = hookAddress;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Map required hook address to factory field
|
|
108
|
+
const requiredHookArtifact = result.mailbox.config.requiredHook;
|
|
109
|
+
if (isArtifactDeployed(requiredHookArtifact)) {
|
|
110
|
+
const hookAddress = requiredHookArtifact.deployed.address;
|
|
111
|
+
switch (requiredHookArtifact.config.type) {
|
|
112
|
+
case 'interchainGasPaymaster':
|
|
113
|
+
// Only set if not already set by default hook
|
|
114
|
+
if (!addresses.interchainGasPaymaster) {
|
|
115
|
+
addresses.interchainGasPaymaster = hookAddress;
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case 'merkleTreeHook':
|
|
119
|
+
// Only set if not already set by default hook
|
|
120
|
+
if (!addresses.merkleTreeHook) {
|
|
121
|
+
addresses.merkleTreeHook = hookAddress;
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return addresses;
|
|
127
|
+
}
|
|
2
128
|
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,aAAa,EACb,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAGL,oBAAoB,GACrB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAGL,mBAAmB,GACpB,MAAM,UAAU,CAAC;AA0ClB;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAkB,EAClB,WAAwB;IAExB,oFAAoF;IACpF,IAAI,kBAAmE,CAAC;IACxE,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC1C,kBAAkB,GAAG;YACnB,aAAa,EAAE,aAAa,CAAC,SAAS;YACtC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE;SACzC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,kBAAkB,GAAG,mBAAmB,CAAC,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;IAED,oCAAoC;IACpC,IAAI,mBAAsE,CAAC;IAC3E,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QAC3C,mBAAmB,GAAG;YACpB,aAAa,EAAE,aAAa,CAAC,SAAS;YACtC,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE;SAC1C,CA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AAS,CAAC,sBAAsB,EAAE,CAAC;oBACtC,SAAS,CAAC,sBAAsB,GAAG,WAAW,CAAC;gBACjD,CAAC;gBACD,MAAM;YACR,KAAK,gBAAgB;gBACnB,8CAA8C;gBAC9C,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC;oBAC9B,SAAS,CAAC,cAAc,GAAG,WAAW,CAAC;gBACzC,CAAC;gBACD,MAAM;QACV,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as AltVM from './altvm.js';
|
|
2
2
|
export { ChainMetadataForAltVM } from './chain.js';
|
|
3
|
+
export { coreConfigToArtifact, coreResultToDeployedAddresses } from './core.js';
|
|
3
4
|
export { MinimumRequiredGasByAction, GasAction } from './mingas.js';
|
|
4
5
|
export { ProtocolType, ProtocolTypeValue, ProtocolSmallestUnit, SignerConfig, ProtocolProvider, registerProtocol, getProtocolProvider, hasProtocol, listProtocols, } from './protocol.js';
|
|
5
6
|
export { ITransactionSubmitter, TransactionSubmitterConfig, JsonRpcSubmitterConfig, FileSubmitterConfig, } from './submitter.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * as AltVM from './altvm.js';
|
|
2
|
+
export { coreConfigToArtifact, coreResultToDeployedAddresses } from './core.js';
|
|
2
3
|
export { GasAction } from './mingas.js';
|
|
3
4
|
export { ProtocolType, ProtocolSmallestUnit, registerProtocol, getProtocolProvider, hasProtocol, listProtocols, } from './protocol.js';
|
|
4
5
|
export { MockProvider } from './test/AltVMMockProvider.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,OAAO,EAA8B,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,YAAY,EAEZ,oBAAoB,EAGpB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAA8B,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,YAAY,EAEZ,oBAAoB,EAGpB,gBAAgB,EAChB,mBAAmB,EACnB,WAAW,EACX,aAAa,GACd,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Artifact, ArtifactDeployed, ConfigOnChain, IArtifactManager } from './artifact.js';
|
|
2
|
+
import type { ChainLookup } from './chain.js';
|
|
3
|
+
import type { DerivedCoreConfig } from './core.js';
|
|
4
|
+
import type { DeployedHookAddress, DeployedHookArtifact, DerivedHookConfig, HookArtifactConfig } from './hook.js';
|
|
5
|
+
import type { DeployedIsmAddress, DeployedIsmArtifact, DerivedIsmConfig, IsmArtifactConfig } from './ism.js';
|
|
6
|
+
/**
|
|
7
|
+
* Mailbox configuration for the Artifact API.
|
|
8
|
+
* Defines the parameters needed to deploy or configure a mailbox.
|
|
9
|
+
*/
|
|
10
|
+
export interface MailboxArtifactConfig {
|
|
11
|
+
owner: string;
|
|
12
|
+
defaultIsm: Artifact<IsmArtifactConfig, DeployedIsmAddress>;
|
|
13
|
+
defaultHook: Artifact<HookArtifactConfig, DeployedHookAddress>;
|
|
14
|
+
requiredHook: Artifact<HookArtifactConfig, DeployedHookAddress>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Deployment data returned after deploying a mailbox.
|
|
18
|
+
* Contains the on-chain address and optionally the domain ID.
|
|
19
|
+
*/
|
|
20
|
+
export interface DeployedMailboxAddress {
|
|
21
|
+
address: string;
|
|
22
|
+
domainId?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Describes the configuration of a deployed mailbox
|
|
26
|
+
*/
|
|
27
|
+
export type DeployedMailboxArtifact = ArtifactDeployed<ConfigOnChain<MailboxArtifactConfig>, DeployedMailboxAddress>;
|
|
28
|
+
/**
|
|
29
|
+
* Mailbox artifact configs map
|
|
30
|
+
*/
|
|
31
|
+
export interface MailboxArtifactConfigs {
|
|
32
|
+
mailbox: MailboxArtifactConfig;
|
|
33
|
+
}
|
|
34
|
+
export type MailboxType = keyof MailboxArtifactConfigs;
|
|
35
|
+
/**
|
|
36
|
+
* Should be used to implement an object/closure or class that is in charge of coordinating
|
|
37
|
+
* deployment of a Mailbox config, including nested ISM and Hook deployments.
|
|
38
|
+
*/
|
|
39
|
+
export type IMailboxArtifactManager = IArtifactManager<MailboxType, MailboxArtifactConfigs, DeployedMailboxAddress>;
|
|
40
|
+
/**
|
|
41
|
+
* Raw mailbox config - uses ArtifactOnChain for nested artifacts instead of Artifact.
|
|
42
|
+
* This is the format used by protocol implementations that work directly with on-chain state.
|
|
43
|
+
*/
|
|
44
|
+
export type MailboxOnChain = ConfigOnChain<MailboxArtifactConfig>;
|
|
45
|
+
/**
|
|
46
|
+
* Raw mailbox artifact configs map
|
|
47
|
+
*/
|
|
48
|
+
export interface RawMailboxArtifactConfigs {
|
|
49
|
+
mailbox: MailboxOnChain;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Should be used for the specific artifact code that
|
|
53
|
+
* deploys or reads a single mailbox artifact on chain
|
|
54
|
+
*/
|
|
55
|
+
export type RawMailboxArtifactConfig = RawMailboxArtifactConfigs[MailboxType];
|
|
56
|
+
/**
|
|
57
|
+
* Describes the configuration of deployed mailbox without nested config expansion
|
|
58
|
+
*/
|
|
59
|
+
export type DeployedRawMailboxArtifact = ArtifactDeployed<RawMailboxArtifactConfig, DeployedMailboxAddress>;
|
|
60
|
+
/**
|
|
61
|
+
* Should be used to implement an object/closure or class that individually deploys
|
|
62
|
+
* Mailboxes on chain
|
|
63
|
+
*/
|
|
64
|
+
export interface IRawMailboxArtifactManager extends IArtifactManager<MailboxType, RawMailboxArtifactConfigs, DeployedMailboxAddress> {
|
|
65
|
+
/**
|
|
66
|
+
* Read a mailbox by its address.
|
|
67
|
+
* This is the entry point for reading mailbox configuration from the chain.
|
|
68
|
+
* @param address The on-chain address of the mailbox
|
|
69
|
+
* @returns The artifact configuration and deployment data
|
|
70
|
+
*/
|
|
71
|
+
readMailbox(address: string): Promise<DeployedRawMailboxArtifact>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Converts a DeployedMailboxArtifact (with fully expanded nested ISM/hook artifacts)
|
|
75
|
+
* to the DerivedCoreConfig format for backward compatibility.
|
|
76
|
+
*
|
|
77
|
+
* This function is used by CoreArtifactReader to provide the deriveCoreConfig() method
|
|
78
|
+
* that existing code expects. The conversion functions for ISM and Hook artifacts
|
|
79
|
+
* must be passed in to avoid circular dependencies.
|
|
80
|
+
*
|
|
81
|
+
* @param artifact The deployed mailbox artifact with expanded nested configs
|
|
82
|
+
* @param chainLookup Chain lookup for converting domain IDs to chain names
|
|
83
|
+
* @param converters Object containing ismArtifactToDerivedConfig and hookArtifactToDerivedConfig functions
|
|
84
|
+
* @returns DerivedCoreConfig in the legacy format (from core.ts)
|
|
85
|
+
*/
|
|
86
|
+
export declare function mailboxArtifactToDerivedCoreConfig(artifact: DeployedMailboxArtifact, chainLookup: ChainLookup, converters: {
|
|
87
|
+
ismArtifactToDerivedConfig: (artifact: DeployedIsmArtifact, chainLookup: ChainLookup) => DerivedIsmConfig;
|
|
88
|
+
hookArtifactToDerivedConfig: (artifact: DeployedHookArtifact, chainLookup: ChainLookup) => DerivedHookConfig;
|
|
89
|
+
}): DerivedCoreConfig;
|
|
90
|
+
//# sourceMappingURL=mailbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../src/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAEhB,aAAa,EACb,gBAAgB,EAGjB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAKlB;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,QAAQ,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;IAC5D,WAAW,EAAE,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;IAC/D,YAAY,EAAE,QAAQ,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAC;CACjE;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CACpD,aAAa,CAAC,qBAAqB,CAAC,EACpC,sBAAsB,CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC;AAEvD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CACpD,WAAW,EACX,sBAAsB,EACtB,sBAAsB,CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,qBAAqB,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,CAAC,WAAW,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CACvD,wBAAwB,EACxB,sBAAsB,CACvB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB,CAClE,WAAW,EACX,yBAAyB,EACzB,sBAAsB,CACvB;IACC;;;;;OAKG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,uBAAuB,EACjC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE;IACV,0BAA0B,EAAE,CAC1B,QAAQ,EAAE,mBAAmB,EAC7B,WAAW,EAAE,WAAW,KACrB,gBAAgB,CAAC;IACtB,2BAA2B,EAAE,CAC3B,QAAQ,EAAE,oBAAoB,EAC9B,WAAW,EAAE,WAAW,KACrB,iBAAiB,CAAC;CACxB,GACA,iBAAiB,CAenB"}
|
package/dist/mailbox.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { toDeployedOrUndefined, } from './artifact.js';
|
|
2
|
+
import { ZERO_ADDRESS_HEX_32 } from '@hyperlane-xyz/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Converts a DeployedMailboxArtifact (with fully expanded nested ISM/hook artifacts)
|
|
5
|
+
* to the DerivedCoreConfig format for backward compatibility.
|
|
6
|
+
*
|
|
7
|
+
* This function is used by CoreArtifactReader to provide the deriveCoreConfig() method
|
|
8
|
+
* that existing code expects. The conversion functions for ISM and Hook artifacts
|
|
9
|
+
* must be passed in to avoid circular dependencies.
|
|
10
|
+
*
|
|
11
|
+
* @param artifact The deployed mailbox artifact with expanded nested configs
|
|
12
|
+
* @param chainLookup Chain lookup for converting domain IDs to chain names
|
|
13
|
+
* @param converters Object containing ismArtifactToDerivedConfig and hookArtifactToDerivedConfig functions
|
|
14
|
+
* @returns DerivedCoreConfig in the legacy format (from core.ts)
|
|
15
|
+
*/
|
|
16
|
+
export function mailboxArtifactToDerivedCoreConfig(artifact, chainLookup, converters) {
|
|
17
|
+
const { defaultIsm, defaultHook, requiredHook, owner } = artifact.config;
|
|
18
|
+
return {
|
|
19
|
+
owner,
|
|
20
|
+
defaultIsm: fromOnChainArtifact(defaultIsm, 'defaultIsm', (a) => converters.ismArtifactToDerivedConfig(a, chainLookup)),
|
|
21
|
+
defaultHook: fromOnChainArtifact(defaultHook, 'defaultHook', (a) => converters.hookArtifactToDerivedConfig(a, chainLookup)),
|
|
22
|
+
requiredHook: fromOnChainArtifact(requiredHook, 'requiredHook', (a) => converters.hookArtifactToDerivedConfig(a, chainLookup)),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function fromOnChainArtifact(artifact, fieldName, convert) {
|
|
26
|
+
const deployed = toDeployedOrUndefined(artifact, fieldName);
|
|
27
|
+
return deployed ? convert(deployed) : ZERO_ADDRESS_HEX_32;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=mailbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailbox.js","sourceRoot":"","sources":["../src/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAevB,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAgG3D;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kCAAkC,CAChD,QAAiC,EACjC,WAAwB,EACxB,UASC;IAED,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC;IAEzE,OAAO;QACL,KAAK;QACL,UAAU,EAAE,mBAAmB,CAAC,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAC9D,UAAU,CAAC,0BAA0B,CAAC,CAAC,EAAE,WAAW,CAAC,CACtD;QACD,WAAW,EAAE,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CACjE,UAAU,CAAC,2BAA2B,CAAC,CAAC,EAAE,WAAW,CAAC,CACvD;QACD,YAAY,EAAE,mBAAmB,CAAC,YAAY,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,EAAE,CACpE,UAAU,CAAC,2BAA2B,CAAC,CAAC,EAAE,WAAW,CAAC,CACvD;KACF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAA+B,EAC/B,SAAkC,EAClC,OAAgD;IAEhD,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC5D,OAAO,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;AAC5D,CAAC"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ import { IProvider, ISigner } from './altvm.js';
|
|
|
2
2
|
import type { ChainMetadataForAltVM } from './chain.js';
|
|
3
3
|
import { IRawHookArtifactManager } from './hook.js';
|
|
4
4
|
import { IRawIsmArtifactManager } from './ism.js';
|
|
5
|
+
import { IRawMailboxArtifactManager } from './mailbox.js';
|
|
5
6
|
import { MinimumRequiredGasByAction } from './mingas.js';
|
|
6
7
|
import { AnnotatedTx, TxReceipt } from './module.js';
|
|
7
8
|
import { ITransactionSubmitter, JsonRpcSubmitterConfig, TransactionSubmitterConfig } from './submitter.js';
|
|
8
9
|
import { IRawWarpArtifactManager } from './warp.js';
|
|
10
|
+
import { IRawValidatorAnnounceArtifactManager } from './validator-announce.js';
|
|
9
11
|
export declare enum ProtocolType {
|
|
10
12
|
Ethereum = "ethereum",
|
|
11
13
|
Sealevel = "sealevel",
|
|
@@ -71,6 +73,26 @@ export interface ProtocolProvider {
|
|
|
71
73
|
createWarpArtifactManager(chainMetadata: ChainMetadataForAltVM, context?: {
|
|
72
74
|
mailbox?: string;
|
|
73
75
|
}): IRawWarpArtifactManager;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a Mailbox artifact manager for the protocol.
|
|
78
|
+
* The artifact manager provides protocol-specific readers and writers
|
|
79
|
+
* that handle Mailbox operations using the Artifact API pattern.
|
|
80
|
+
*
|
|
81
|
+
* @param chainMetadata Chain metadata for the target chain
|
|
82
|
+
* @returns A protocol-specific Mailbox artifact manager
|
|
83
|
+
*/
|
|
84
|
+
createMailboxArtifactManager(chainMetadata: ChainMetadataForAltVM): IRawMailboxArtifactManager;
|
|
85
|
+
/**
|
|
86
|
+
* Creates a Validator Announce artifact manager for the protocol.
|
|
87
|
+
* The artifact manager provides protocol-specific readers and writers
|
|
88
|
+
* that handle Validator Announce operations using the Artifact API pattern.
|
|
89
|
+
*
|
|
90
|
+
* Not all protocols support validator announce (e.g., Cosmos does not).
|
|
91
|
+
*
|
|
92
|
+
* @param chainMetadata Chain metadata for the target chain
|
|
93
|
+
* @returns A protocol-specific Validator Announce artifact manager, or null if not supported
|
|
94
|
+
*/
|
|
95
|
+
createValidatorAnnounceArtifactManager(chainMetadata: ChainMetadataForAltVM): IRawValidatorAnnounceArtifactManager | null;
|
|
74
96
|
getMinGas(): MinimumRequiredGasByAction;
|
|
75
97
|
}
|
|
76
98
|
/**
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAE/E,oBAAY,YAAY;IACtB,Q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,aAAa,EAAE,qBAAqB,GACnC,oCAAoC,GAAG,IAAI,CAAC;IAE/C,SAAS,IAAI,0BAA0B,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,SAAS,CAAmD;IAEpE,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO;IAI5C,aAAa,IAAI,YAAY,EAAE;IAI/B,gBAAgB,CACd,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,MAAM,gBAAgB,GAC9B,IAAI;IASP,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,gBAAgB;CAS9D;AAKD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aA/Bf,YAAY,WACb,MAAM,gBAAgB,KAC9B,IA8BqD,CAAC;AAE3D;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,aA9BA,YAAY,KAAG,gBA+Bc,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,WAAW,aA3DA,YAAY,KAAG,OA2DuC,CAAC;AAE/E;;;;GAIG;AACH,eAAO,MAAM,aAAa,QA9DP,YAAY,EA+DwB,CAAC"}
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAiB9C,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;IACrB,iCAAiB,CAAA;IACjB,6CAA6B,CAAA;IAC7B,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,mCAAmB,CAAA;AACr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Aa,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAC9G,CAAC;QAEF,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC;CACF;AAED,8BAA8B;AAC9B,MAAM,gBAAgB,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,gBAAgB,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAC9B,gBAAgB,CAAC,mBAAmB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAE9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ArtifactDeployed, IArtifactManager } from './artifact.js';
|
|
2
|
+
/**
|
|
3
|
+
* Validator Announce configuration for the Artifact API.
|
|
4
|
+
* Defines the parameters needed to deploy or configure a validator announce contract.
|
|
5
|
+
*/
|
|
6
|
+
export interface ValidatorAnnounceArtifactConfig {
|
|
7
|
+
mailboxAddress: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Deployment data returned after deploying a validator announce contract.
|
|
11
|
+
* Contains the on-chain address.
|
|
12
|
+
*/
|
|
13
|
+
export interface DeployedValidatorAnnounceAddress {
|
|
14
|
+
address: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Describes the configuration of a deployed validator announce contract
|
|
18
|
+
*/
|
|
19
|
+
export type DeployedValidatorAnnounceArtifact = ArtifactDeployed<ValidatorAnnounceArtifactConfig, DeployedValidatorAnnounceAddress>;
|
|
20
|
+
/**
|
|
21
|
+
* Validator announce artifact configs map
|
|
22
|
+
*/
|
|
23
|
+
export interface ValidatorAnnounceArtifactConfigs {
|
|
24
|
+
validatorAnnounce: ValidatorAnnounceArtifactConfig;
|
|
25
|
+
}
|
|
26
|
+
export type ValidatorAnnounceType = keyof ValidatorAnnounceArtifactConfigs;
|
|
27
|
+
/**
|
|
28
|
+
* Should be used to implement an object/closure or class that is in charge of coordinating
|
|
29
|
+
* deployment of a ValidatorAnnounce config.
|
|
30
|
+
*/
|
|
31
|
+
export type IValidatorAnnounceArtifactManager = IArtifactManager<ValidatorAnnounceType, ValidatorAnnounceArtifactConfigs, DeployedValidatorAnnounceAddress>;
|
|
32
|
+
/**
|
|
33
|
+
* Raw validator announce config - identical to the compound config since there are no nested artifacts.
|
|
34
|
+
* Kept for consistency with the artifact API pattern.
|
|
35
|
+
*/
|
|
36
|
+
export interface RawValidatorAnnounceConfig {
|
|
37
|
+
mailboxAddress: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Raw validator announce artifact configs map
|
|
41
|
+
*/
|
|
42
|
+
export interface RawValidatorAnnounceArtifactConfigs {
|
|
43
|
+
validatorAnnounce: RawValidatorAnnounceConfig;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Should be used for the specific artifact code that
|
|
47
|
+
* deploys or reads a single validator announce artifact on chain
|
|
48
|
+
*/
|
|
49
|
+
export type RawValidatorAnnounceArtifactConfig = RawValidatorAnnounceArtifactConfigs[ValidatorAnnounceType];
|
|
50
|
+
/**
|
|
51
|
+
* Describes the configuration of deployed validator announce without nested config expansion
|
|
52
|
+
*/
|
|
53
|
+
export type DeployedRawValidatorAnnounceArtifact = ArtifactDeployed<RawValidatorAnnounceArtifactConfig, DeployedValidatorAnnounceAddress>;
|
|
54
|
+
/**
|
|
55
|
+
* Should be used to implement an object/closure or class that individually deploys
|
|
56
|
+
* ValidatorAnnounce contracts on chain
|
|
57
|
+
*/
|
|
58
|
+
export interface IRawValidatorAnnounceArtifactManager extends IArtifactManager<ValidatorAnnounceType, RawValidatorAnnounceArtifactConfigs, DeployedValidatorAnnounceAddress> {
|
|
59
|
+
/**
|
|
60
|
+
* Read a validator announce contract by its address.
|
|
61
|
+
* This is the entry point for reading validator announce configuration from the chain.
|
|
62
|
+
* @param address The on-chain address of the validator announce contract
|
|
63
|
+
* @returns The artifact configuration and deployment data
|
|
64
|
+
*/
|
|
65
|
+
readValidatorAnnounce(address: string): Promise<DeployedRawValidatorAnnounceArtifact>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=validator-announce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator-announce.d.ts","sourceRoot":"","sources":["../src/validator-announce.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAInE;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,gBAAgB,CAC9D,+BAA+B,EAC/B,gCAAgC,CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,EAAE,+BAA+B,CAAC;CACpD;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,gCAAgC,CAAC;AAE3E;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,gBAAgB,CAC9D,qBAAqB,EACrB,gCAAgC,EAChC,gCAAgC,CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mCAAmC;IAClD,iBAAiB,EAAE,0BAA0B,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,MAAM,kCAAkC,GAC5C,mCAAmC,CAAC,qBAAqB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,gBAAgB,CACjE,kCAAkC,EAClC,gCAAgC,CACjC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,oCAAqC,SAAQ,gBAAgB,CAC5E,qBAAqB,EACrB,mCAAmC,EACnC,gCAAgC,CACjC;IACC;;;;;OAKG;IACH,qBAAqB,CACnB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,oCAAoC,CAAC,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validator-announce.js","sourceRoot":"","sources":["../src/validator-announce.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperlane-xyz/provider-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Protocol Provider SDK for the Hyperlane Protocol",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": "https://github.com/hyperlane-xyz/hyperlane-monorepo",
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
"./hook": "./dist/hook.js",
|
|
18
18
|
"./ism": "./dist/ism.js",
|
|
19
19
|
"./core": "./dist/core.js",
|
|
20
|
+
"./mailbox": "./dist/mailbox.js",
|
|
21
|
+
"./validator-announce": "./dist/validator-announce.js",
|
|
20
22
|
"./warp": "./dist/warp.js",
|
|
21
23
|
"./factory": "./dist/factory.js",
|
|
22
24
|
"./submitter": "./dist/submitter.js",
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"dependencies": {
|
|
27
29
|
"pino": "^8.19.0",
|
|
28
30
|
"zod": "^3.21.2",
|
|
29
|
-
"@hyperlane-xyz/utils": "
|
|
31
|
+
"@hyperlane-xyz/utils": "28.0.0"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@types/chai": "^4.3.11",
|
|
@@ -37,8 +39,8 @@
|
|
|
37
39
|
"mocha": "^11.5.0",
|
|
38
40
|
"tsx": "^4.19.1",
|
|
39
41
|
"typescript": "5.8.3",
|
|
40
|
-
"@hyperlane-xyz/eslint-config": "^
|
|
41
|
-
"@hyperlane-xyz/tsconfig": "^
|
|
42
|
+
"@hyperlane-xyz/eslint-config": "^28.0.0",
|
|
43
|
+
"@hyperlane-xyz/tsconfig": "^28.0.0"
|
|
42
44
|
},
|
|
43
45
|
"scripts": {
|
|
44
46
|
"build": "tsc",
|