@hyperlane-xyz/cli 33.0.1 → 33.0.2
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/bundle/773.index.js +3 -0
- package/bundle/79.index.js +3 -0
- package/bundle/index.js +613 -87
- package/package.json +15 -15
package/bundle/773.index.js
CHANGED
|
@@ -2780,6 +2780,9 @@ class StarknetProtocolProvider {
|
|
|
2780
2780
|
createValidatorAnnounceArtifactManager(chainMetadata) {
|
|
2781
2781
|
return new StarknetValidatorAnnounceArtifactManager(chainMetadata);
|
|
2782
2782
|
}
|
|
2783
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
2784
|
+
return null;
|
|
2785
|
+
}
|
|
2783
2786
|
getMinGas() {
|
|
2784
2787
|
return {
|
|
2785
2788
|
CORE_DEPLOY_GAS: BigInt(1e9),
|
package/bundle/79.index.js
CHANGED
|
@@ -107533,6 +107533,9 @@ class SvmProtocolProvider {
|
|
|
107533
107533
|
const rpc = createRpc(this.getRpcUrls(chainMetadata)[0]);
|
|
107534
107534
|
return new SvmValidatorAnnounceArtifactManager(rpc, chainMetadata.domainId);
|
|
107535
107535
|
}
|
|
107536
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
107537
|
+
return null;
|
|
107538
|
+
}
|
|
107536
107539
|
getMinGas() {
|
|
107537
107540
|
return {
|
|
107538
107541
|
CORE_DEPLOY_GAS: 10000000000n,
|
package/bundle/index.js
CHANGED
|
@@ -672930,6 +672930,9 @@ class AleoProtocolProvider {
|
|
|
672930
672930
|
: new _provablehq_sdk_testnet_js__WEBPACK_IMPORTED_MODULE_1__/* .AleoNetworkClient */ .zX(rpcUrl);
|
|
672931
672931
|
return new _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_7__/* .AleoValidatorAnnounceArtifactManager */ .q({ domainId: chainMetadata.domainId, aleoNetworkId }, aleoClient);
|
|
672932
672932
|
}
|
|
672933
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
672934
|
+
return null;
|
|
672935
|
+
}
|
|
672933
672936
|
getMinGas() {
|
|
672934
672937
|
return {
|
|
672935
672938
|
CORE_DEPLOY_GAS: 0n,
|
|
@@ -681796,7 +681799,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
681796
681799
|
/* harmony export */ });
|
|
681797
681800
|
/* unused harmony export getContext */
|
|
681798
681801
|
/* harmony import */ var _inquirer_prompts__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(98720);
|
|
681799
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
681802
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(56854);
|
|
681800
681803
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(71280);
|
|
681801
681804
|
/* harmony import */ var _hyperlane_xyz_registry_fs__WEBPACK_IMPORTED_MODULE_13__ = __nccwpck_require__(84873);
|
|
681802
681805
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_15__ = __nccwpck_require__(3483);
|
|
@@ -682731,7 +682734,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
682731
682734
|
/* harmony export */ d: () => (/* binding */ validateCoreConfigForAltVM),
|
|
682732
682735
|
/* harmony export */ u: () => (/* reexport safe */ _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__.u_)
|
|
682733
682736
|
/* harmony export */ });
|
|
682734
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
682737
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(56854);
|
|
682735
682738
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(38231);
|
|
682736
682739
|
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__]);
|
|
682737
682740
|
_hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
|
@@ -682782,7 +682785,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
682782
682785
|
/* harmony export */ });
|
|
682783
682786
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(10684);
|
|
682784
682787
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(74119);
|
|
682785
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
682788
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(56854);
|
|
682786
682789
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(71280);
|
|
682787
682790
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_9__ = __nccwpck_require__(76939);
|
|
682788
682791
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(26492);
|
|
@@ -683285,7 +683288,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
683285
683288
|
/* harmony import */ var _inquirer_prompts__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(98720);
|
|
683286
683289
|
/* harmony import */ var yaml__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(10684);
|
|
683287
683290
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(74119);
|
|
683288
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(
|
|
683291
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(56854);
|
|
683289
683292
|
/* harmony import */ var _hyperlane_xyz_deploy_sdk_AltVMFileSubmitter__WEBPACK_IMPORTED_MODULE_36__ = __nccwpck_require__(49988);
|
|
683290
683293
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(71280);
|
|
683291
683294
|
/* harmony import */ var _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(4287);
|
|
@@ -684624,7 +684627,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
684624
684627
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
684625
684628
|
/* harmony export */ C: () => (/* binding */ readHookConfig)
|
|
684626
684629
|
/* harmony export */ });
|
|
684627
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
684630
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(56854);
|
|
684628
684631
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(69319);
|
|
684629
684632
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(16639);
|
|
684630
684633
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(73938);
|
|
@@ -684689,7 +684692,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
684689
684692
|
/* harmony export */ E: () => (/* binding */ runIsmDeploy)
|
|
684690
684693
|
/* harmony export */ });
|
|
684691
684694
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(74119);
|
|
684692
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
684695
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(56854);
|
|
684693
684696
|
/* harmony import */ var _hyperlane_xyz_provider_sdk_ism__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(96426);
|
|
684694
684697
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(71280);
|
|
684695
684698
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(69352);
|
|
@@ -684833,7 +684836,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
684833
684836
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
684834
684837
|
/* harmony export */ Y: () => (/* binding */ readIsmConfig)
|
|
684835
684838
|
/* harmony export */ });
|
|
684836
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
684839
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(56854);
|
|
684837
684840
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(60715);
|
|
684838
684841
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(22887);
|
|
684839
684842
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(16639);
|
|
@@ -684953,7 +684956,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
684953
684956
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
684954
684957
|
/* harmony export */ R: () => (/* binding */ executeCoreRead)
|
|
684955
684958
|
/* harmony export */ });
|
|
684956
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(
|
|
684959
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(56854);
|
|
684957
684960
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(80031);
|
|
684958
684961
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(22887);
|
|
684959
684962
|
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(21387);
|
|
@@ -685019,7 +685022,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
685019
685022
|
/* unused harmony exports getWarpRouteConfigsByCore, logXERC20Limits */
|
|
685020
685023
|
/* harmony import */ var ethers__WEBPACK_IMPORTED_MODULE_10__ = __nccwpck_require__(61934);
|
|
685021
685024
|
/* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(50653);
|
|
685022
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(
|
|
685025
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(56854);
|
|
685023
685026
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(71280);
|
|
685024
685027
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(40945);
|
|
685025
685028
|
/* harmony import */ var _hyperlane_xyz_sdk__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(22887);
|
|
@@ -693924,7 +693927,7 @@ __webpack_async_result__();
|
|
|
693924
693927
|
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
693925
693928
|
/* harmony export */ x: () => (/* binding */ VERSION)
|
|
693926
693929
|
/* harmony export */ });
|
|
693927
|
-
const VERSION = '33.0.
|
|
693930
|
+
const VERSION = '33.0.2';
|
|
693928
693931
|
//# sourceMappingURL=version.js.map
|
|
693929
693932
|
|
|
693930
693933
|
/***/ }),
|
|
@@ -694001,6 +694004,9 @@ class CosmosNativeProtocolProvider {
|
|
|
694001
694004
|
// Cosmos does not support validator announce
|
|
694002
694005
|
return null;
|
|
694003
694006
|
}
|
|
694007
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
694008
|
+
return null;
|
|
694009
|
+
}
|
|
694004
694010
|
getMinGas() {
|
|
694005
694011
|
return {
|
|
694006
694012
|
CORE_DEPLOY_GAS: BigInt(1e6),
|
|
@@ -712049,7 +712055,7 @@ class AltVMFileSubmitter {
|
|
|
712049
712055
|
|
|
712050
712056
|
/***/ }),
|
|
712051
712057
|
|
|
712052
|
-
/***/
|
|
712058
|
+
/***/ 56854:
|
|
712053
712059
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
712054
712060
|
|
|
712055
712061
|
|
|
@@ -712068,7 +712074,7 @@ __nccwpck_require__.d(__webpack_exports__, {
|
|
|
712068
712074
|
mM: () => (/* reexport */ validateIsmConfig)
|
|
712069
712075
|
});
|
|
712070
712076
|
|
|
712071
|
-
// UNUSED EXPORTS: CoreArtifactReader, CoreWriter, HookWriter, IsmWriter, UnsupportedIsmTypeError, WarpTokenReader, WarpTokenWriter, validateIsmType
|
|
712077
|
+
// UNUSED EXPORTS: CoreArtifactReader, CoreWriter, FeeReader, FeeWriter, HookWriter, IsmWriter, UnsupportedIsmTypeError, WarpTokenReader, WarpTokenWriter, createFeeReader, createFeeWriter, validateIsmType
|
|
712072
712078
|
|
|
712073
712079
|
// EXTERNAL MODULE: ../utils/dist/logging.js
|
|
712074
712080
|
var logging = __nccwpck_require__(94523);
|
|
@@ -712115,6 +712121,88 @@ class AltVMJsonRpcSubmitter {
|
|
|
712115
712121
|
//# sourceMappingURL=AltVMJsonRpcSubmitter.js.map
|
|
712116
712122
|
// EXTERNAL MODULE: ../provider-sdk/dist/index.js + 3 modules
|
|
712117
712123
|
var dist = __nccwpck_require__(71280);
|
|
712124
|
+
;// CONCATENATED MODULE: ../deploy-sdk/dist/fee/fee-reader.js
|
|
712125
|
+
|
|
712126
|
+
/**
|
|
712127
|
+
* Factory function to create a FeeReader instance.
|
|
712128
|
+
* Returns null if the protocol does not support fee programs.
|
|
712129
|
+
*
|
|
712130
|
+
* @param chainMetadata Chain metadata for the target chain
|
|
712131
|
+
* @param context Required fee read context with domains and routers to check
|
|
712132
|
+
* @returns A FeeReader instance, or null if the protocol does not support fees
|
|
712133
|
+
*/
|
|
712134
|
+
function createFeeReader(chainMetadata, context) {
|
|
712135
|
+
const protocolProvider = (0,dist/* getProtocolProvider */.IU)(chainMetadata.protocol);
|
|
712136
|
+
const artifactManager = protocolProvider.createFeeArtifactManager(chainMetadata);
|
|
712137
|
+
if (!artifactManager) {
|
|
712138
|
+
return null;
|
|
712139
|
+
}
|
|
712140
|
+
return new FeeReader(artifactManager, context);
|
|
712141
|
+
}
|
|
712142
|
+
/**
|
|
712143
|
+
* Generic Fee Reader that reads fee configurations from on-chain state.
|
|
712144
|
+
*
|
|
712145
|
+
* The FeeReadContext is required at construction time to ensure the reader always
|
|
712146
|
+
* knows which domains and routers to check (some fee contracts are not enumerable).
|
|
712147
|
+
*/
|
|
712148
|
+
class FeeReader {
|
|
712149
|
+
artifactManager;
|
|
712150
|
+
context;
|
|
712151
|
+
constructor(artifactManager, context) {
|
|
712152
|
+
this.artifactManager = artifactManager;
|
|
712153
|
+
this.context = context;
|
|
712154
|
+
}
|
|
712155
|
+
async read(address) {
|
|
712156
|
+
return this.artifactManager.readFee(address, this.context);
|
|
712157
|
+
}
|
|
712158
|
+
}
|
|
712159
|
+
//# sourceMappingURL=fee-reader.js.map
|
|
712160
|
+
;// CONCATENATED MODULE: ../deploy-sdk/dist/fee/fee-writer.js
|
|
712161
|
+
|
|
712162
|
+
|
|
712163
|
+
/**
|
|
712164
|
+
* Factory function to create a FeeWriter instance.
|
|
712165
|
+
* Returns null if the protocol does not support fee programs.
|
|
712166
|
+
*
|
|
712167
|
+
* @param chainMetadata Chain metadata for the target chain
|
|
712168
|
+
* @param signer Signer interface for signing transactions
|
|
712169
|
+
* @param context Required fee read context with domains and routers to check
|
|
712170
|
+
* @returns A FeeWriter instance, or null if the protocol does not support fees
|
|
712171
|
+
*/
|
|
712172
|
+
function createFeeWriter(chainMetadata, signer, context) {
|
|
712173
|
+
const protocolProvider = (0,dist/* getProtocolProvider */.IU)(chainMetadata.protocol);
|
|
712174
|
+
const artifactManager = protocolProvider.createFeeArtifactManager(chainMetadata);
|
|
712175
|
+
if (!artifactManager) {
|
|
712176
|
+
return null;
|
|
712177
|
+
}
|
|
712178
|
+
return new FeeWriter(artifactManager, context, signer);
|
|
712179
|
+
}
|
|
712180
|
+
/**
|
|
712181
|
+
* FeeWriter handles creation and updates of fee configurations using the Artifact API.
|
|
712182
|
+
* It delegates to protocol-specific artifact writers for individual fee types.
|
|
712183
|
+
*
|
|
712184
|
+
* Extends FeeReader to inherit read() functionality.
|
|
712185
|
+
* The FeeReadContext is required at construction time to ensure the reader always
|
|
712186
|
+
* knows which domains and routers to check (some fee contracts are not enumerable).
|
|
712187
|
+
*/
|
|
712188
|
+
class FeeWriter extends FeeReader {
|
|
712189
|
+
signer;
|
|
712190
|
+
constructor(artifactManager, context, signer) {
|
|
712191
|
+
super(artifactManager, context);
|
|
712192
|
+
this.signer = signer;
|
|
712193
|
+
}
|
|
712194
|
+
async create(artifact) {
|
|
712195
|
+
const { config } = artifact;
|
|
712196
|
+
const writer = this.artifactManager.createWriter(config.type, this.signer);
|
|
712197
|
+
return writer.create(artifact);
|
|
712198
|
+
}
|
|
712199
|
+
async update(artifact) {
|
|
712200
|
+
const { config } = artifact;
|
|
712201
|
+
const writer = this.artifactManager.createWriter(config.type, this.signer);
|
|
712202
|
+
return writer.update(artifact);
|
|
712203
|
+
}
|
|
712204
|
+
}
|
|
712205
|
+
//# sourceMappingURL=fee-writer.js.map
|
|
712118
712206
|
// EXTERNAL MODULE: ../provider-sdk/dist/artifact.js
|
|
712119
712207
|
var dist_artifact = __nccwpck_require__(4287);
|
|
712120
712208
|
// EXTERNAL MODULE: ../provider-sdk/dist/hook.js
|
|
@@ -713134,6 +713222,8 @@ class UnsupportedIsmTypeError extends Error {
|
|
|
713134
713222
|
}
|
|
713135
713223
|
}
|
|
713136
713224
|
//# sourceMappingURL=validation.js.map
|
|
713225
|
+
// EXTERNAL MODULE: ../utils/dist/validation.js
|
|
713226
|
+
var validation = __nccwpck_require__(21387);
|
|
713137
713227
|
// EXTERNAL MODULE: ../provider-sdk/dist/warp.js
|
|
713138
713228
|
var warp = __nccwpck_require__(17791);
|
|
713139
713229
|
;// CONCATENATED MODULE: ../deploy-sdk/dist/warp/warp-reader.js
|
|
@@ -713142,6 +713232,8 @@ var warp = __nccwpck_require__(17791);
|
|
|
713142
713232
|
|
|
713143
713233
|
|
|
713144
713234
|
|
|
713235
|
+
|
|
713236
|
+
|
|
713145
713237
|
/**
|
|
713146
713238
|
* Generic Warp Token Reader that can read any warp token type by detecting its type
|
|
713147
713239
|
* and expanding nested ISM artifacts if present.
|
|
@@ -713168,12 +713260,15 @@ class WarpTokenReader {
|
|
|
713168
713260
|
const expandedIsmArtifact = await this.expandIsmArtifact(rawArtifact.config.interchainSecurityModule);
|
|
713169
713261
|
// Expand nested Hook artifact if present
|
|
713170
713262
|
const expandedHookArtifact = await this.expandHookArtifact(hookReader, rawArtifact.config.hook);
|
|
713263
|
+
// Expand nested Fee artifact if present
|
|
713264
|
+
const expandedFeeArtifact = await this.expandFeeArtifact(rawArtifact.config, rawArtifact.config.fee);
|
|
713171
713265
|
return {
|
|
713172
713266
|
...rawArtifact,
|
|
713173
713267
|
config: {
|
|
713174
713268
|
...rawArtifact.config,
|
|
713175
713269
|
interchainSecurityModule: expandedIsmArtifact,
|
|
713176
713270
|
hook: expandedHookArtifact,
|
|
713271
|
+
fee: expandedFeeArtifact,
|
|
713177
713272
|
},
|
|
713178
713273
|
};
|
|
713179
713274
|
}
|
|
@@ -713215,6 +713310,28 @@ class WarpTokenReader {
|
|
|
713215
713310
|
// NEW state should not occur in read artifacts
|
|
713216
713311
|
throw new Error(`Unexpected Hook artifact state 'new' when reading warp token Hook configuration`);
|
|
713217
713312
|
}
|
|
713313
|
+
/**
|
|
713314
|
+
* Expands a Fee artifact by reading it if underived.
|
|
713315
|
+
* Builds FeeReadContext from the warp config's remote routers and CC routers.
|
|
713316
|
+
* Returns undefined only when no feeArtifact is provided. Deployed artifacts
|
|
713317
|
+
* are returned as-is. Underived artifacts are read via the fee reader.
|
|
713318
|
+
* Throws if a fee artifact exists but the protocol has no fee artifact manager.
|
|
713319
|
+
*/
|
|
713320
|
+
async expandFeeArtifact(warpConfig, feeArtifact) {
|
|
713321
|
+
if (!feeArtifact) {
|
|
713322
|
+
return undefined;
|
|
713323
|
+
}
|
|
713324
|
+
if ((0,dist_artifact/* isArtifactDeployed */.R)(feeArtifact)) {
|
|
713325
|
+
return feeArtifact;
|
|
713326
|
+
}
|
|
713327
|
+
if ((0,dist_artifact/* isArtifactUnderived */.l2)(feeArtifact)) {
|
|
713328
|
+
const context = (0,warp/* buildFeeReadContextFromWarpArtifactConfig */.oS)(warpConfig);
|
|
713329
|
+
const feeReader = createFeeReader(this.chainMetadata, context);
|
|
713330
|
+
(0,validation/* assert */.v)(feeReader, `Fee artifact present on warp config but protocol ${this.chainMetadata.protocol} has no fee artifact manager`);
|
|
713331
|
+
return feeReader.read(feeArtifact.deployed.address);
|
|
713332
|
+
}
|
|
713333
|
+
throw new Error(`Unexpected Fee artifact state 'new' when reading warp token Fee configuration`);
|
|
713334
|
+
}
|
|
713218
713335
|
/**
|
|
713219
713336
|
* Backward compatibility method that converts DeployedWarpArtifact to DerivedWarpConfig.
|
|
713220
713337
|
* This allows WarpTokenReader to be used as a drop-in replacement for the old AltVMWarpRouteReader.
|
|
@@ -713245,8 +713362,8 @@ function createWarpTokenReader(chainMetadata, chainLookup) {
|
|
|
713245
713362
|
return new WarpTokenReader(artifactManager, chainMetadata, chainLookup);
|
|
713246
713363
|
}
|
|
713247
713364
|
//# sourceMappingURL=warp-reader.js.map
|
|
713248
|
-
// EXTERNAL MODULE: ../
|
|
713249
|
-
var
|
|
713365
|
+
// EXTERNAL MODULE: ../provider-sdk/dist/fee.js
|
|
713366
|
+
var fee = __nccwpck_require__(26109);
|
|
713250
713367
|
// EXTERNAL MODULE: ../utils/dist/typeof.js
|
|
713251
713368
|
var dist_typeof = __nccwpck_require__(73689);
|
|
713252
713369
|
;// CONCATENATED MODULE: ../deploy-sdk/dist/warp/warp-writer.js
|
|
@@ -713258,6 +713375,9 @@ var dist_typeof = __nccwpck_require__(73689);
|
|
|
713258
713375
|
|
|
713259
713376
|
|
|
713260
713377
|
|
|
713378
|
+
|
|
713379
|
+
|
|
713380
|
+
|
|
713261
713381
|
/**
|
|
713262
713382
|
* Factory function to create a WarpTokenWriter instance.
|
|
713263
713383
|
*
|
|
@@ -713347,6 +713467,25 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713347
713467
|
}
|
|
713348
713468
|
}
|
|
713349
713469
|
}
|
|
713470
|
+
// Deploy Fee if configured as a NEW artifact
|
|
713471
|
+
// No FeeReadContext needed on create - deploying from scratch
|
|
713472
|
+
let onChainFeeArtifact;
|
|
713473
|
+
if (config.fee) {
|
|
713474
|
+
const feeWriter = createFeeWriter(this.chainMetadata, this.signer, {
|
|
713475
|
+
knownRoutersPerDomain: {},
|
|
713476
|
+
});
|
|
713477
|
+
if (!feeWriter) {
|
|
713478
|
+
logging/* rootLogger */.Jk.warn('Fee programs are not supported for this protocol. Fee configuration will be ignored.');
|
|
713479
|
+
}
|
|
713480
|
+
else if ((0,dist_artifact/* isArtifactNew */.v_)(config.fee)) {
|
|
713481
|
+
const [deployedFee, feeReceipts] = await feeWriter.create(config.fee);
|
|
713482
|
+
allReceipts.push(...feeReceipts);
|
|
713483
|
+
onChainFeeArtifact = deployedFee;
|
|
713484
|
+
}
|
|
713485
|
+
else {
|
|
713486
|
+
onChainFeeArtifact = config.fee;
|
|
713487
|
+
}
|
|
713488
|
+
}
|
|
713350
713489
|
// Convert to raw artifact config (flatten nested artifacts)
|
|
713351
713490
|
const rawArtifact = {
|
|
713352
713491
|
artifactState: dist_artifact/* ArtifactState */.O2.NEW,
|
|
@@ -713354,6 +713493,7 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713354
713493
|
...config,
|
|
713355
713494
|
interchainSecurityModule: onChainIsmArtifact,
|
|
713356
713495
|
hook: onChainHookArtifact,
|
|
713496
|
+
fee: onChainFeeArtifact,
|
|
713357
713497
|
},
|
|
713358
713498
|
};
|
|
713359
713499
|
// Delegate to protocol-specific writer
|
|
@@ -713368,6 +713508,7 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713368
713508
|
...artifact.config,
|
|
713369
713509
|
interchainSecurityModule: onChainIsmArtifact,
|
|
713370
713510
|
hook: onChainHookArtifact,
|
|
713511
|
+
fee: onChainFeeArtifact,
|
|
713371
713512
|
},
|
|
713372
713513
|
deployed: deployed.deployed,
|
|
713373
713514
|
},
|
|
@@ -713400,6 +713541,8 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713400
713541
|
(0,dist_artifact/* isArtifactDeployed */.R)(currentArtifact.config.interchainSecurityModule), `Expected Warp Reader to expand the ISM config`);
|
|
713401
713542
|
(0,validation/* assert */.v)((0,dist_typeof/* isNullish */.u)(currentArtifact.config.hook) ||
|
|
713402
713543
|
(0,dist_artifact/* isArtifactDeployed */.R)(currentArtifact.config.hook), `Expected Warp Reader to expand the Hook config`);
|
|
713544
|
+
(0,validation/* assert */.v)((0,dist_typeof/* isNullish */.u)(currentArtifact.config.fee) ||
|
|
713545
|
+
(0,dist_artifact/* isArtifactDeployed */.R)(currentArtifact.config.fee), `Expected Warp Reader to expand the Fee config`);
|
|
713403
713546
|
const updateTxs = [];
|
|
713404
713547
|
// Resolve ISM updates
|
|
713405
713548
|
const expectedIsm = config.interchainSecurityModule;
|
|
@@ -713463,13 +713606,47 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713463
713606
|
else {
|
|
713464
713607
|
onChainHookArtifact = expectedHook;
|
|
713465
713608
|
}
|
|
713466
|
-
//
|
|
713609
|
+
// Resolve Fee updates
|
|
713610
|
+
const expectedFee = config.fee;
|
|
713611
|
+
const currentFee = currentArtifact.config.fee;
|
|
713612
|
+
let onChainFeeArtifact;
|
|
713613
|
+
if (expectedFee && !(0,dist_artifact/* isArtifactUnderived */.l2)(expectedFee)) {
|
|
713614
|
+
const feeContext = (0,warp/* buildFeeReadContextFromWarpArtifactConfig */.oS)(config, currentArtifact.config);
|
|
713615
|
+
const feeWriter = createFeeWriter(this.chainMetadata, this.signer, feeContext);
|
|
713616
|
+
if (!feeWriter) {
|
|
713617
|
+
logging/* rootLogger */.Jk.warn('Fee programs are not supported for this protocol. Fee configuration will be ignored.');
|
|
713618
|
+
onChainFeeArtifact = currentFee;
|
|
713619
|
+
}
|
|
713620
|
+
else {
|
|
713621
|
+
const mergedFeeConfig = (0,fee/* mergeFeeArtifacts */.KA)(currentFee, expectedFee);
|
|
713622
|
+
if ((0,dist_artifact/* isArtifactNew */.v_)(mergedFeeConfig)) {
|
|
713623
|
+
const [deployedFee] = await feeWriter.create(mergedFeeConfig);
|
|
713624
|
+
onChainFeeArtifact = {
|
|
713625
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
713626
|
+
deployed: { address: deployedFee.deployed.address },
|
|
713627
|
+
};
|
|
713628
|
+
}
|
|
713629
|
+
else if ((0,dist_artifact/* isArtifactDeployed */.R)(mergedFeeConfig)) {
|
|
713630
|
+
const txs = await feeWriter.update(mergedFeeConfig);
|
|
713631
|
+
updateTxs.push(...txs);
|
|
713632
|
+
onChainFeeArtifact = {
|
|
713633
|
+
artifactState: dist_artifact/* ArtifactState */.O2.UNDERIVED,
|
|
713634
|
+
deployed: { address: mergedFeeConfig.deployed.address },
|
|
713635
|
+
};
|
|
713636
|
+
}
|
|
713637
|
+
}
|
|
713638
|
+
}
|
|
713639
|
+
else {
|
|
713640
|
+
onChainFeeArtifact = expectedFee;
|
|
713641
|
+
}
|
|
713642
|
+
// Build raw artifact with flattened ISM, Hook, and Fee references
|
|
713467
713643
|
const rawArtifact = {
|
|
713468
713644
|
artifactState: dist_artifact/* ArtifactState */.O2.DEPLOYED,
|
|
713469
713645
|
config: {
|
|
713470
713646
|
...config,
|
|
713471
713647
|
interchainSecurityModule: onChainIsmArtifact,
|
|
713472
713648
|
hook: onChainHookArtifact,
|
|
713649
|
+
fee: onChainFeeArtifact,
|
|
713473
713650
|
},
|
|
713474
713651
|
deployed,
|
|
713475
713652
|
};
|
|
@@ -713496,6 +713673,8 @@ class WarpTokenWriter extends WarpTokenReader {
|
|
|
713496
713673
|
|
|
713497
713674
|
|
|
713498
713675
|
|
|
713676
|
+
|
|
713677
|
+
|
|
713499
713678
|
//# sourceMappingURL=index.js.map
|
|
713500
713679
|
|
|
713501
713680
|
/***/ }),
|
|
@@ -715214,6 +715393,229 @@ function artifactOnChainToAddress(artifact, formatter) {
|
|
|
715214
715393
|
|
|
715215
715394
|
/***/ }),
|
|
715216
715395
|
|
|
715396
|
+
/***/ 26109:
|
|
715397
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
715398
|
+
|
|
715399
|
+
/* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
|
|
715400
|
+
/* harmony export */ AY: () => (/* binding */ feeConfigToArtifact),
|
|
715401
|
+
/* harmony export */ KA: () => (/* binding */ mergeFeeArtifacts),
|
|
715402
|
+
/* harmony export */ X6: () => (/* binding */ feeArtifactToDerivedConfig)
|
|
715403
|
+
/* harmony export */ });
|
|
715404
|
+
/* unused harmony exports FeeStrategyType, FeeType, shouldDeployNewFee */
|
|
715405
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(94523);
|
|
715406
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(73689);
|
|
715407
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(73938);
|
|
715408
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(98474);
|
|
715409
|
+
/* harmony import */ var _artifact_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(4287);
|
|
715410
|
+
|
|
715411
|
+
|
|
715412
|
+
// These fee types model fees as a single contract/program with internal routing,
|
|
715413
|
+
// unlike the EVM implementation where RoutingFee and CrossCollateralRoutingFee
|
|
715414
|
+
// deploy separate fee contracts per destination domain. The upcoming SVM fee
|
|
715415
|
+
// program will handle all routing internally via PDAs within one program, and
|
|
715416
|
+
// these multi-VM types follow that single-entity model to avoid the complexity
|
|
715417
|
+
// of supporting both approaches simultaneously. This will be unified later to
|
|
715418
|
+
// support both models under a single interface.
|
|
715419
|
+
// ====== Strategy Types (shared between Config API and Artifact API) ======
|
|
715420
|
+
const FeeStrategyType = {
|
|
715421
|
+
linear: 'linear',
|
|
715422
|
+
regressive: 'regressive',
|
|
715423
|
+
progressive: 'progressive',
|
|
715424
|
+
offchainQuotedLinear: 'offchainQuotedLinear',
|
|
715425
|
+
};
|
|
715426
|
+
const FeeType = {
|
|
715427
|
+
linear: 'linear',
|
|
715428
|
+
regressive: 'regressive',
|
|
715429
|
+
progressive: 'progressive',
|
|
715430
|
+
offchainQuotedLinear: 'offchainQuotedLinear',
|
|
715431
|
+
routing: 'routing',
|
|
715432
|
+
crossCollateralRouting: 'crossCollateralRouting',
|
|
715433
|
+
};
|
|
715434
|
+
// ====== Config <-> Artifact Conversion ======
|
|
715435
|
+
const feeLogger = _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_1__/* .rootLogger */ .Jk.child({ module: 'fee-config-utils' });
|
|
715436
|
+
function convertRoutesToArtifact(routes, chainLookup) {
|
|
715437
|
+
const result = {};
|
|
715438
|
+
for (const [chainName, strategy] of Object.entries(routes)) {
|
|
715439
|
+
const domainId = chainLookup.getDomainId(chainName);
|
|
715440
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__/* .isNullish */ .u)(domainId)) {
|
|
715441
|
+
feeLogger.warn(`Skipping fee route for unknown chain: ${chainName}. ` +
|
|
715442
|
+
`Chain not found in chain lookup.`);
|
|
715443
|
+
continue;
|
|
715444
|
+
}
|
|
715445
|
+
result[domainId] = strategy;
|
|
715446
|
+
}
|
|
715447
|
+
return result;
|
|
715448
|
+
}
|
|
715449
|
+
function convertCCRoutesToArtifact(routes, chainLookup) {
|
|
715450
|
+
const result = {};
|
|
715451
|
+
for (const [chainName, routerMap] of Object.entries(routes)) {
|
|
715452
|
+
const domainId = chainLookup.getDomainId(chainName);
|
|
715453
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_2__/* .isNullish */ .u)(domainId)) {
|
|
715454
|
+
feeLogger.warn(`Skipping CC fee route for unknown chain: ${chainName}. ` +
|
|
715455
|
+
`Chain not found in chain lookup.`);
|
|
715456
|
+
continue;
|
|
715457
|
+
}
|
|
715458
|
+
result[domainId] = routerMap;
|
|
715459
|
+
}
|
|
715460
|
+
return result;
|
|
715461
|
+
}
|
|
715462
|
+
function convertRoutesToDerived(routes, chainLookup) {
|
|
715463
|
+
const result = {};
|
|
715464
|
+
for (const [domainIdStr, strategy] of Object.entries(routes)) {
|
|
715465
|
+
const domainId = parseInt(domainIdStr);
|
|
715466
|
+
const chainName = chainLookup.getChainName(domainId);
|
|
715467
|
+
if (!chainName) {
|
|
715468
|
+
feeLogger.warn(`Skipping fee route for unknown domain ID: ${domainId}. ` +
|
|
715469
|
+
`Domain not found in chain lookup.`);
|
|
715470
|
+
continue;
|
|
715471
|
+
}
|
|
715472
|
+
result[chainName] = strategy;
|
|
715473
|
+
}
|
|
715474
|
+
return result;
|
|
715475
|
+
}
|
|
715476
|
+
function convertCCRoutesToDerived(routes, chainLookup) {
|
|
715477
|
+
const result = {};
|
|
715478
|
+
for (const [domainIdStr, routerMap] of Object.entries(routes)) {
|
|
715479
|
+
const domainId = parseInt(domainIdStr);
|
|
715480
|
+
const chainName = chainLookup.getChainName(domainId);
|
|
715481
|
+
if (!chainName) {
|
|
715482
|
+
feeLogger.warn(`Skipping CC fee route for unknown domain ID: ${domainId}. ` +
|
|
715483
|
+
`Domain not found in chain lookup.`);
|
|
715484
|
+
continue;
|
|
715485
|
+
}
|
|
715486
|
+
result[chainName] = routerMap;
|
|
715487
|
+
}
|
|
715488
|
+
return result;
|
|
715489
|
+
}
|
|
715490
|
+
/**
|
|
715491
|
+
* Converts FeeConfig (Config API) to FeeArtifactConfig (Artifact API).
|
|
715492
|
+
* Chain names are converted to domain IDs for routing/CC routing fee types.
|
|
715493
|
+
* Direct fee types (linear, regressive, progressive) are passed through unchanged.
|
|
715494
|
+
*/
|
|
715495
|
+
function feeConfigToArtifact(config, chainLookup) {
|
|
715496
|
+
switch (config.type) {
|
|
715497
|
+
case FeeType.linear:
|
|
715498
|
+
case FeeType.regressive:
|
|
715499
|
+
case FeeType.progressive:
|
|
715500
|
+
case FeeType.offchainQuotedLinear:
|
|
715501
|
+
return {
|
|
715502
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
715503
|
+
config,
|
|
715504
|
+
};
|
|
715505
|
+
case FeeType.routing:
|
|
715506
|
+
return {
|
|
715507
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
715508
|
+
config: {
|
|
715509
|
+
type: config.type,
|
|
715510
|
+
owner: config.owner,
|
|
715511
|
+
beneficiary: config.beneficiary,
|
|
715512
|
+
routes: convertRoutesToArtifact(config.routes, chainLookup),
|
|
715513
|
+
},
|
|
715514
|
+
};
|
|
715515
|
+
case FeeType.crossCollateralRouting:
|
|
715516
|
+
return {
|
|
715517
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
715518
|
+
config: {
|
|
715519
|
+
type: config.type,
|
|
715520
|
+
owner: config.owner,
|
|
715521
|
+
beneficiary: config.beneficiary,
|
|
715522
|
+
routes: convertCCRoutesToArtifact(config.routes, chainLookup),
|
|
715523
|
+
},
|
|
715524
|
+
};
|
|
715525
|
+
default: {
|
|
715526
|
+
const invalidConfig = config;
|
|
715527
|
+
throw new Error(`Unsupported fee type for artifact API: ${JSON.stringify(invalidConfig)}`);
|
|
715528
|
+
}
|
|
715529
|
+
}
|
|
715530
|
+
}
|
|
715531
|
+
/**
|
|
715532
|
+
* Converts a DeployedFeeArtifact to DerivedFeeConfig format.
|
|
715533
|
+
* Domain IDs are converted back to chain names for routing/CC routing fee types.
|
|
715534
|
+
*/
|
|
715535
|
+
function feeArtifactToDerivedConfig(artifact, chainLookup) {
|
|
715536
|
+
const { config } = artifact;
|
|
715537
|
+
const address = artifact.deployed.address;
|
|
715538
|
+
switch (config.type) {
|
|
715539
|
+
case FeeType.linear:
|
|
715540
|
+
case FeeType.regressive:
|
|
715541
|
+
case FeeType.progressive:
|
|
715542
|
+
case FeeType.offchainQuotedLinear:
|
|
715543
|
+
return { ...config, address };
|
|
715544
|
+
case FeeType.routing:
|
|
715545
|
+
return {
|
|
715546
|
+
type: config.type,
|
|
715547
|
+
owner: config.owner,
|
|
715548
|
+
beneficiary: config.beneficiary,
|
|
715549
|
+
routes: convertRoutesToDerived(config.routes, chainLookup),
|
|
715550
|
+
address,
|
|
715551
|
+
};
|
|
715552
|
+
case FeeType.crossCollateralRouting:
|
|
715553
|
+
return {
|
|
715554
|
+
type: config.type,
|
|
715555
|
+
owner: config.owner,
|
|
715556
|
+
beneficiary: config.beneficiary,
|
|
715557
|
+
routes: convertCCRoutesToDerived(config.routes, chainLookup),
|
|
715558
|
+
address,
|
|
715559
|
+
};
|
|
715560
|
+
default: {
|
|
715561
|
+
const invalidConfig = config;
|
|
715562
|
+
throw new Error(`Unhandled fee type: ${JSON.stringify(invalidConfig)}`);
|
|
715563
|
+
}
|
|
715564
|
+
}
|
|
715565
|
+
}
|
|
715566
|
+
/**
|
|
715567
|
+
* Determines if a new fee should be deployed instead of updating the existing one.
|
|
715568
|
+
* Deploy new if fee type changed. For direct types (linear, regressive, progressive),
|
|
715569
|
+
* deploy new if config changed (immutable on EVM - constructor-set params).
|
|
715570
|
+
* Routing/CC routing types are mutable and can be updated in-place.
|
|
715571
|
+
*/
|
|
715572
|
+
function shouldDeployNewFee(actual, expected) {
|
|
715573
|
+
if (actual.type !== expected.type)
|
|
715574
|
+
return true;
|
|
715575
|
+
switch (expected.type) {
|
|
715576
|
+
case FeeType.linear:
|
|
715577
|
+
case FeeType.regressive:
|
|
715578
|
+
case FeeType.progressive:
|
|
715579
|
+
case FeeType.offchainQuotedLinear:
|
|
715580
|
+
return !(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_3__/* .deepEquals */ .c2)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .normalizeConfig */ .I)(actual), (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .normalizeConfig */ .I)(expected));
|
|
715581
|
+
case FeeType.routing:
|
|
715582
|
+
case FeeType.crossCollateralRouting:
|
|
715583
|
+
return false;
|
|
715584
|
+
default: {
|
|
715585
|
+
const invalidConfig = expected;
|
|
715586
|
+
throw new Error(`Unhandled fee type in shouldDeployNewFee: ${JSON.stringify(invalidConfig)}`);
|
|
715587
|
+
}
|
|
715588
|
+
}
|
|
715589
|
+
}
|
|
715590
|
+
/**
|
|
715591
|
+
* Merges current on-chain fee artifact with expected fee artifact.
|
|
715592
|
+
* Determines whether to deploy a new fee or update/reuse existing one.
|
|
715593
|
+
*/
|
|
715594
|
+
function mergeFeeArtifacts(currentArtifact, expectedArtifact) {
|
|
715595
|
+
const expectedConfig = expectedArtifact.config;
|
|
715596
|
+
if (!currentArtifact) {
|
|
715597
|
+
return expectedArtifact;
|
|
715598
|
+
}
|
|
715599
|
+
const currentConfig = currentArtifact.config;
|
|
715600
|
+
if (shouldDeployNewFee(currentConfig, expectedConfig)) {
|
|
715601
|
+
return {
|
|
715602
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
715603
|
+
config: expectedConfig,
|
|
715604
|
+
};
|
|
715605
|
+
}
|
|
715606
|
+
const deployedAddress = (0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(expectedArtifact)
|
|
715607
|
+
? expectedArtifact.deployed
|
|
715608
|
+
: currentArtifact.deployed;
|
|
715609
|
+
return {
|
|
715610
|
+
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.DEPLOYED,
|
|
715611
|
+
config: expectedConfig,
|
|
715612
|
+
deployed: deployedAddress,
|
|
715613
|
+
};
|
|
715614
|
+
}
|
|
715615
|
+
//# sourceMappingURL=fee.js.map
|
|
715616
|
+
|
|
715617
|
+
/***/ }),
|
|
715618
|
+
|
|
715217
715619
|
/***/ 77230:
|
|
715218
715620
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
|
|
715219
715621
|
|
|
@@ -716076,16 +716478,19 @@ function ismConfigToArtifact(config, chainLookup) {
|
|
|
716076
716478
|
/* harmony export */ Ob: () => (/* binding */ computeCCRouterGasConfigUpdates),
|
|
716077
716479
|
/* harmony export */ aq: () => (/* binding */ computeRemoteRoutersUpdates),
|
|
716078
716480
|
/* harmony export */ ks: () => (/* binding */ TokenType),
|
|
716079
|
-
/* harmony export */ ku: () => (/* binding */ warpConfigToArtifact)
|
|
716481
|
+
/* harmony export */ ku: () => (/* binding */ warpConfigToArtifact),
|
|
716482
|
+
/* harmony export */ oS: () => (/* binding */ buildFeeReadContextFromWarpArtifactConfig)
|
|
716080
716483
|
/* harmony export */ });
|
|
716081
|
-
/* harmony import */ var
|
|
716082
|
-
/* harmony import */ var
|
|
716083
|
-
/* harmony import */ var
|
|
716084
|
-
/* harmony import */ var
|
|
716085
|
-
/* harmony import */ var
|
|
716484
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(73689);
|
|
716485
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(21387);
|
|
716486
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(73938);
|
|
716487
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_7__ = __nccwpck_require__(93142);
|
|
716488
|
+
/* harmony import */ var _hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__ = __nccwpck_require__(52193);
|
|
716086
716489
|
/* harmony import */ var _artifact_js__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(4287);
|
|
716087
|
-
/* harmony import */ var
|
|
716088
|
-
/* harmony import */ var
|
|
716490
|
+
/* harmony import */ var _fee_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(26109);
|
|
716491
|
+
/* harmony import */ var _hook_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(77230);
|
|
716492
|
+
/* harmony import */ var _ism_js__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(96426);
|
|
716493
|
+
|
|
716089
716494
|
|
|
716090
716495
|
|
|
716091
716496
|
|
|
@@ -716118,7 +716523,7 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716118
716523
|
}
|
|
716119
716524
|
else {
|
|
716120
716525
|
// ISM config - convert using ismConfigToArtifact
|
|
716121
|
-
ismArtifact = (0,
|
|
716526
|
+
ismArtifact = (0,_ism_js__WEBPACK_IMPORTED_MODULE_3__/* .ismConfigToArtifact */ .HL)(config.interchainSecurityModule, chainLookup);
|
|
716122
716527
|
}
|
|
716123
716528
|
}
|
|
716124
716529
|
// Convert Hook config to artifact if present
|
|
@@ -716130,7 +716535,17 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716130
716535
|
}
|
|
716131
716536
|
else {
|
|
716132
716537
|
// Hook config - convert using hookConfigToArtifact
|
|
716133
|
-
hookArtifact = (0,
|
|
716538
|
+
hookArtifact = (0,_hook_js__WEBPACK_IMPORTED_MODULE_2__/* .hookConfigToArtifact */ .hV)(config.hook, chainLookup);
|
|
716539
|
+
}
|
|
716540
|
+
}
|
|
716541
|
+
// Convert Fee config to artifact if present
|
|
716542
|
+
let feeArtifact;
|
|
716543
|
+
if (config.fee) {
|
|
716544
|
+
if (typeof config.fee === 'string') {
|
|
716545
|
+
feeArtifact = (0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .addressToUnderivedArtifact */ .Se)(config.fee);
|
|
716546
|
+
}
|
|
716547
|
+
else {
|
|
716548
|
+
feeArtifact = (0,_fee_js__WEBPACK_IMPORTED_MODULE_1__/* .feeConfigToArtifact */ .AY)(config.fee, chainLookup);
|
|
716134
716549
|
}
|
|
716135
716550
|
}
|
|
716136
716551
|
// Convert remoteRouters from chain names to domain IDs
|
|
@@ -716138,7 +716553,7 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716138
716553
|
if (config.remoteRouters) {
|
|
716139
716554
|
for (const [chainName, router] of Object.entries(config.remoteRouters)) {
|
|
716140
716555
|
const domainId = chainLookup.getDomainId(chainName);
|
|
716141
|
-
if ((0,
|
|
716556
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(domainId)) {
|
|
716142
716557
|
logger?.warn(`Skipping remote router for unknown chain: ${chainName}. ` +
|
|
716143
716558
|
`Chain not found in chain lookup.`);
|
|
716144
716559
|
continue;
|
|
@@ -716151,7 +716566,7 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716151
716566
|
if (config.destinationGas) {
|
|
716152
716567
|
for (const [chainName, gas] of Object.entries(config.destinationGas)) {
|
|
716153
716568
|
const domainId = chainLookup.getDomainId(chainName);
|
|
716154
|
-
if ((0,
|
|
716569
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(domainId)) {
|
|
716155
716570
|
logger?.warn(`Skipping destination gas for unknown chain: ${chainName}. ` +
|
|
716156
716571
|
`Chain not found in chain lookup.`);
|
|
716157
716572
|
continue;
|
|
@@ -716164,6 +716579,7 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716164
716579
|
mailbox: config.mailbox,
|
|
716165
716580
|
interchainSecurityModule: ismArtifact,
|
|
716166
716581
|
hook: hookArtifact,
|
|
716582
|
+
fee: feeArtifact,
|
|
716167
716583
|
remoteRouters,
|
|
716168
716584
|
destinationGas,
|
|
716169
716585
|
scale: config.scale,
|
|
@@ -716180,9 +716596,9 @@ function warpConfigToArtifact(config, chainLookup, logger) {
|
|
|
716180
716596
|
};
|
|
716181
716597
|
case 'synthetic':
|
|
716182
716598
|
// Validate required fields for synthetic token
|
|
716183
|
-
(0,
|
|
716184
|
-
(0,
|
|
716185
|
-
(0,
|
|
716599
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(config.name, 'name is required for synthetic token deployment');
|
|
716600
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(config.symbol, 'symbol is required for synthetic token deployment');
|
|
716601
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(config.decimals !== undefined, 'decimals is required for synthetic token deployment');
|
|
716186
716602
|
return {
|
|
716187
716603
|
artifactState: _artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .ArtifactState */ .O2.NEW,
|
|
716188
716604
|
config: {
|
|
@@ -716252,35 +716668,48 @@ function warpArtifactToDerivedConfig(artifact, chainLookup) {
|
|
|
716252
716668
|
destinationGas[chainName] = gas;
|
|
716253
716669
|
}
|
|
716254
716670
|
// Convert ISM artifact to config if present
|
|
716255
|
-
(0,
|
|
716671
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.interchainSecurityModule) ||
|
|
716256
716672
|
!(0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactNew */ .v_)(config.interchainSecurityModule), 'Expected ISM to be a deployed or underived artifact');
|
|
716257
716673
|
let ismConfig;
|
|
716258
|
-
if ((0,
|
|
716674
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.interchainSecurityModule)) {
|
|
716259
716675
|
ismConfig = '0x0000000000000000000000000000000000000000';
|
|
716260
716676
|
}
|
|
716261
716677
|
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(config.interchainSecurityModule)) {
|
|
716262
|
-
ismConfig = (0,
|
|
716678
|
+
ismConfig = (0,_ism_js__WEBPACK_IMPORTED_MODULE_3__/* .ismArtifactToDerivedConfig */ .co)(config.interchainSecurityModule, chainLookup);
|
|
716263
716679
|
}
|
|
716264
716680
|
else {
|
|
716265
716681
|
ismConfig = config.interchainSecurityModule.deployed.address;
|
|
716266
716682
|
}
|
|
716267
716683
|
// Convert hook artifact to config if present
|
|
716268
|
-
(0,
|
|
716684
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.hook) || !(0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactNew */ .v_)(config.hook), 'Expected hook to be a deployed or underived artifact');
|
|
716269
716685
|
let hookConfig;
|
|
716270
|
-
if ((0,
|
|
716686
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.hook)) {
|
|
716271
716687
|
hookConfig = '0x0000000000000000000000000000000000000000';
|
|
716272
716688
|
}
|
|
716273
716689
|
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(config.hook)) {
|
|
716274
|
-
hookConfig = (0,
|
|
716690
|
+
hookConfig = (0,_hook_js__WEBPACK_IMPORTED_MODULE_2__/* .hookArtifactToDerivedConfig */ .q6)(config.hook, chainLookup);
|
|
716275
716691
|
}
|
|
716276
716692
|
else {
|
|
716277
716693
|
hookConfig = config.hook.deployed.address;
|
|
716278
716694
|
}
|
|
716695
|
+
// Convert fee artifact to config if present
|
|
716696
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.fee) || !(0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactNew */ .v_)(config.fee), 'Expected fee to be a deployed or underived artifact');
|
|
716697
|
+
let feeConfig;
|
|
716698
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(config.fee)) {
|
|
716699
|
+
feeConfig = undefined;
|
|
716700
|
+
}
|
|
716701
|
+
else if ((0,_artifact_js__WEBPACK_IMPORTED_MODULE_0__/* .isArtifactDeployed */ .R)(config.fee)) {
|
|
716702
|
+
feeConfig = (0,_fee_js__WEBPACK_IMPORTED_MODULE_1__/* .feeArtifactToDerivedConfig */ .X6)(config.fee, chainLookup);
|
|
716703
|
+
}
|
|
716704
|
+
else {
|
|
716705
|
+
feeConfig = config.fee.deployed.address;
|
|
716706
|
+
}
|
|
716279
716707
|
const baseDerivedConfig = {
|
|
716280
716708
|
owner: config.owner,
|
|
716281
716709
|
mailbox: config.mailbox,
|
|
716282
716710
|
interchainSecurityModule: ismConfig,
|
|
716283
716711
|
hook: hookConfig,
|
|
716712
|
+
fee: feeConfig,
|
|
716284
716713
|
remoteRouters,
|
|
716285
716714
|
destinationGas,
|
|
716286
716715
|
name: config.name,
|
|
@@ -716326,7 +716755,7 @@ function convertCrossCollateralRoutersToArtifact(crossCollateralRouters, chainLo
|
|
|
716326
716755
|
return result;
|
|
716327
716756
|
for (const [chainName, routers] of Object.entries(crossCollateralRouters)) {
|
|
716328
716757
|
const domainId = chainLookup.getDomainId(chainName);
|
|
716329
|
-
if ((0,
|
|
716758
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(domainId)) {
|
|
716330
716759
|
logger?.warn(`Skipping cross-collateral routers for unknown chain: ${chainName}. ` +
|
|
716331
716760
|
`Chain not found in chain lookup.`);
|
|
716332
716761
|
continue;
|
|
@@ -716346,6 +716775,31 @@ function convertCrossCollateralRoutersToDerived(crossCollateralRouters, chainLoo
|
|
|
716346
716775
|
}
|
|
716347
716776
|
return result;
|
|
716348
716777
|
}
|
|
716778
|
+
// Fee Read Context Utilities
|
|
716779
|
+
/**
|
|
716780
|
+
* Builds a FeeReadContext by unioning domains/routers from the provided
|
|
716781
|
+
* WarpArtifactConfigs. Pass both expected and current configs so the fee
|
|
716782
|
+
* reader can discover routes from current state (for cleanup) and expected
|
|
716783
|
+
* state (for setup).
|
|
716784
|
+
*/
|
|
716785
|
+
function buildFeeReadContextFromWarpArtifactConfig(...configs) {
|
|
716786
|
+
const knownRoutersPerDomain = {};
|
|
716787
|
+
for (const config of configs) {
|
|
716788
|
+
for (const [domainStr, router] of Object.entries(config.remoteRouters)) {
|
|
716789
|
+
const domain = Number(domainStr);
|
|
716790
|
+
const existing = knownRoutersPerDomain[domain] ?? new Set();
|
|
716791
|
+
knownRoutersPerDomain[domain] = new Set([...existing, router.address]);
|
|
716792
|
+
}
|
|
716793
|
+
if (config.type === TokenType.crossCollateral) {
|
|
716794
|
+
for (const [domainStr, routers] of Object.entries(config.crossCollateralRouters)) {
|
|
716795
|
+
const domain = Number(domainStr);
|
|
716796
|
+
const existing = knownRoutersPerDomain[domain] ?? new Set();
|
|
716797
|
+
knownRoutersPerDomain[domain] = new Set([...existing, ...routers]);
|
|
716798
|
+
}
|
|
716799
|
+
}
|
|
716800
|
+
}
|
|
716801
|
+
return { knownRoutersPerDomain };
|
|
716802
|
+
}
|
|
716349
716803
|
/**
|
|
716350
716804
|
* Computes which routers need enrollment/unenrollment by diffing current and expected configs.
|
|
716351
716805
|
* Pure function - compares router addresses and destination gas to determine required updates.
|
|
@@ -716370,7 +716824,7 @@ function computeRemoteRoutersUpdates(currentRoutersConfig, expectedRoutersConfig
|
|
|
716370
716824
|
for (const [domainIdStr, expectedRemoteRouter] of Object.entries(expectedRoutersConfig.remoteRouters)) {
|
|
716371
716825
|
const domainId = parseInt(domainIdStr);
|
|
716372
716826
|
const expectedDestinationGas = expectedRoutersConfig.destinationGas[domainId];
|
|
716373
|
-
(0,
|
|
716827
|
+
(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_5__/* .assert */ .v)(!(0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(expectedDestinationGas), `Missing destination gas for domain ${domainId} in expected router configuration`);
|
|
716374
716828
|
const currentRouterAddress = Object.prototype.hasOwnProperty.call(currentRoutersConfig.remoteRouters, domainId)
|
|
716375
716829
|
? currentRoutersConfig.remoteRouters[domainId].address
|
|
716376
716830
|
: undefined;
|
|
@@ -716395,18 +716849,18 @@ function computeRemoteRoutersUpdates(currentRoutersConfig, expectedRoutersConfig
|
|
|
716395
716849
|
* hex32 before comparison so callers don't need to normalize beforehand.
|
|
716396
716850
|
*/
|
|
716397
716851
|
function computeCrossCollateralRouterUpdates(current, expected) {
|
|
716398
|
-
const canonicalize = (routers) => (0,
|
|
716852
|
+
const canonicalize = (routers) => (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_6__/* .objMap */ .Yp)(routers, (_domain, routerSet) => new Set([...routerSet].map((r) => (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_7__/* .addressToBytes32 */ .In)(r).toLowerCase())));
|
|
716399
716853
|
const canonicalCurrent = canonicalize(current);
|
|
716400
716854
|
const canonicalExpected = canonicalize(expected);
|
|
716401
716855
|
const toUnenroll = {};
|
|
716402
716856
|
for (const [domainStr, currentSet] of Object.entries(canonicalCurrent)) {
|
|
716403
716857
|
const domain = Number(domainStr);
|
|
716404
716858
|
const expectedSet = canonicalExpected[domain];
|
|
716405
|
-
if ((0,
|
|
716859
|
+
if ((0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_4__/* .isNullish */ .u)(expectedSet) || expectedSet.size === 0) {
|
|
716406
716860
|
toUnenroll[domain] = null;
|
|
716407
716861
|
}
|
|
716408
716862
|
else {
|
|
716409
|
-
const removed = (0,
|
|
716863
|
+
const removed = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .difference */ .iv)(currentSet, expectedSet);
|
|
716410
716864
|
if (removed.size > 0) {
|
|
716411
716865
|
toUnenroll[domain] = removed;
|
|
716412
716866
|
}
|
|
@@ -716416,7 +716870,7 @@ function computeCrossCollateralRouterUpdates(current, expected) {
|
|
|
716416
716870
|
for (const [domainStr, expectedSet] of Object.entries(canonicalExpected)) {
|
|
716417
716871
|
const domain = Number(domainStr);
|
|
716418
716872
|
const currentSet = canonicalCurrent[domain] ?? new Set();
|
|
716419
|
-
const added = (0,
|
|
716873
|
+
const added = (0,_hyperlane_xyz_utils__WEBPACK_IMPORTED_MODULE_8__/* .difference */ .iv)(expectedSet, currentSet);
|
|
716420
716874
|
if (added.size > 0) {
|
|
716421
716875
|
toEnroll[domain] = added;
|
|
716422
716876
|
}
|
|
@@ -716525,6 +716979,9 @@ class RadixProtocolProvider {
|
|
|
716525
716979
|
const { gateway, base } = this.configureNetworkConnection(chainMetadata);
|
|
716526
716980
|
return new _validator_announce_validator_announce_artifact_manager_js__WEBPACK_IMPORTED_MODULE_6__/* .RadixValidatorAnnounceArtifactManager */ .x(gateway, base);
|
|
716527
716981
|
}
|
|
716982
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
716983
|
+
return null;
|
|
716984
|
+
}
|
|
716528
716985
|
getMinGas() {
|
|
716529
716986
|
return {
|
|
716530
716987
|
CORE_DEPLOY_GAS: 0n,
|
|
@@ -734619,7 +735076,7 @@ class LiFiBridge {
|
|
|
734619
735076
|
slippage: (params.slippage ?? this.config.defaultSlippage ?? 0.005)
|
|
734620
735077
|
.toFixed(4)
|
|
734621
735078
|
.replace(/\.?0+$/, ''),
|
|
734622
|
-
order: '
|
|
735079
|
+
order: 'RECOMMENDED',
|
|
734623
735080
|
integrator: this.config.integrator,
|
|
734624
735081
|
});
|
|
734625
735082
|
if (this.config.apiKey) {
|
|
@@ -735997,10 +736454,12 @@ class InventoryRebalancer {
|
|
|
735997
736454
|
const targetOutput = source.maxTargetOutput >= remaining
|
|
735998
736455
|
? remaining
|
|
735999
736456
|
: source.maxTargetOutput;
|
|
736457
|
+
const quoteMode = source.maxTargetOutput > remaining ? 'reverse' : 'forward';
|
|
736000
736458
|
bridgePlans.push({
|
|
736001
736459
|
chain: source.chain,
|
|
736002
736460
|
maxSourceInput: source.maxSourceInput,
|
|
736003
736461
|
targetOutput,
|
|
736462
|
+
quoteMode,
|
|
736004
736463
|
});
|
|
736005
736464
|
totalPlanned += targetOutput;
|
|
736006
736465
|
}
|
|
@@ -736015,6 +736474,7 @@ class InventoryRebalancer {
|
|
|
736015
736474
|
chain: p.chain,
|
|
736016
736475
|
maxSourceInput: p.maxSourceInput.toString(),
|
|
736017
736476
|
targetOutput: p.targetOutput.toString(),
|
|
736477
|
+
quoteMode: p.quoteMode,
|
|
736018
736478
|
})),
|
|
736019
736479
|
totalPlanned: totalPlanned.toString(),
|
|
736020
736480
|
shortfall: shortfall.toString(),
|
|
@@ -736022,33 +736482,53 @@ class InventoryRebalancer {
|
|
|
736022
736482
|
intentId: intent.id,
|
|
736023
736483
|
}, 'Created bridge plans using gas-adjusted viable amounts');
|
|
736024
736484
|
// Execute all bridges in parallel
|
|
736025
|
-
const bridgeResults = await Promise.allSettled(bridgePlans.map((plan) => this.executeInventoryMovement(plan.chain, destination, plan.targetOutput, plan.maxSourceInput, intent, route.externalBridge)));
|
|
736485
|
+
const bridgeResults = await Promise.allSettled(bridgePlans.map((plan) => this.executeInventoryMovement(plan.chain, destination, plan.targetOutput, plan.maxSourceInput, plan.quoteMode, intent, route.externalBridge)));
|
|
736026
736486
|
// Process results
|
|
736027
736487
|
let successCount = 0;
|
|
736028
|
-
let
|
|
736488
|
+
let totalQuotedOutputMin = 0n;
|
|
736029
736489
|
const failedErrors = [];
|
|
736030
736490
|
for (let i = 0; i < bridgeResults.length; i++) {
|
|
736031
736491
|
const result = bridgeResults[i];
|
|
736032
736492
|
const plan = bridgePlans[i];
|
|
736033
736493
|
if (result.status === 'fulfilled' && result.value.success) {
|
|
736034
736494
|
successCount++;
|
|
736035
|
-
|
|
736495
|
+
totalQuotedOutputMin += result.value.quotedOutputMin;
|
|
736036
736496
|
this.logger.info({
|
|
736037
736497
|
sourceChain: plan.chain,
|
|
736038
|
-
|
|
736498
|
+
plannedTargetOutput: plan.targetOutput.toString(),
|
|
736499
|
+
quotedOutput: result.value.quotedOutput.toString(),
|
|
736500
|
+
quotedOutputMin: result.value.quotedOutputMin.toString(),
|
|
736501
|
+
quoteModeUsed: result.value.quoteModeUsed,
|
|
736039
736502
|
txHash: result.value.txHash,
|
|
736040
736503
|
}, 'Inventory movement succeeded');
|
|
736041
736504
|
}
|
|
736042
736505
|
else {
|
|
736043
|
-
|
|
736044
|
-
|
|
736045
|
-
|
|
736506
|
+
let error;
|
|
736507
|
+
if (result.status === 'rejected') {
|
|
736508
|
+
if (result.reason instanceof Error) {
|
|
736509
|
+
error = result.reason.message;
|
|
736510
|
+
}
|
|
736511
|
+
else if (typeof result.reason === 'string') {
|
|
736512
|
+
error = result.reason;
|
|
736513
|
+
}
|
|
736514
|
+
else {
|
|
736515
|
+
try {
|
|
736516
|
+
error = JSON.stringify(result.reason) ?? String(result.reason);
|
|
736517
|
+
}
|
|
736518
|
+
catch {
|
|
736519
|
+
error = String(result.reason);
|
|
736520
|
+
}
|
|
736521
|
+
}
|
|
736522
|
+
}
|
|
736523
|
+
else if (!result.value.success) {
|
|
736524
|
+
error = result.value.error;
|
|
736525
|
+
}
|
|
736046
736526
|
if (error) {
|
|
736047
736527
|
failedErrors.push(`${plan.chain}: ${error}`);
|
|
736048
736528
|
}
|
|
736049
736529
|
this.logger.warn({
|
|
736050
736530
|
sourceChain: plan.chain,
|
|
736051
|
-
|
|
736531
|
+
plannedTargetOutput: plan.targetOutput.toString(),
|
|
736052
736532
|
error,
|
|
736053
736533
|
}, 'Inventory movement failed');
|
|
736054
736534
|
}
|
|
@@ -736064,7 +736544,7 @@ class InventoryRebalancer {
|
|
|
736064
736544
|
this.logger.info({
|
|
736065
736545
|
targetChain: destination,
|
|
736066
736546
|
successCount,
|
|
736067
|
-
|
|
736547
|
+
totalQuotedOutputMin: totalQuotedOutputMin.toString(),
|
|
736068
736548
|
targetAmount: requestedLocalAmount.toString(),
|
|
736069
736549
|
targetAmountCanonical: amount.toString(),
|
|
736070
736550
|
intentId: intent.id,
|
|
@@ -736323,18 +736803,20 @@ class InventoryRebalancer {
|
|
|
736323
736803
|
/**
|
|
736324
736804
|
* Execute inventory movement from source chain to target chain via LiFi bridge.
|
|
736325
736805
|
*
|
|
736326
|
-
*
|
|
736327
|
-
*
|
|
736806
|
+
* Quote mode is chosen during planning:
|
|
736807
|
+
* - `reverse`: request an exact target-chain output when the source has headroom
|
|
736808
|
+
* - `forward`: spend the source cap directly when source inventory is the limiter
|
|
736328
736809
|
*
|
|
736329
736810
|
* @param sourceChain - Chain to move inventory from
|
|
736330
736811
|
* @param targetChain - Chain to move inventory to (origin chain for rebalancing)
|
|
736331
736812
|
* @param targetOutputAmount - Destination-local amount to receive
|
|
736332
736813
|
* @param maxSourceInput - Maximum source-local amount available for this plan
|
|
736814
|
+
* @param quoteMode - Whether to execute this bridge plan as exact-input or exact-output
|
|
736333
736815
|
* @param intent - Rebalance intent for tracking
|
|
736334
736816
|
* @param externalBridgeType - External bridge type to use
|
|
736335
736817
|
* @returns Result with success status and optional txHash/error
|
|
736336
736818
|
*/
|
|
736337
|
-
async executeInventoryMovement(sourceChain, targetChain, targetOutputAmount, maxSourceInput, intent, externalBridgeType) {
|
|
736819
|
+
async executeInventoryMovement(sourceChain, targetChain, targetOutputAmount, maxSourceInput, quoteMode, intent, externalBridgeType) {
|
|
736338
736820
|
const sourceToken = this.getTokenForChain(sourceChain);
|
|
736339
736821
|
if (!sourceToken) {
|
|
736340
736822
|
return {
|
|
@@ -736365,15 +736847,36 @@ class InventoryRebalancer {
|
|
|
736365
736847
|
}, 'Resolved token addresses for LiFi bridge');
|
|
736366
736848
|
try {
|
|
736367
736849
|
const externalBridge = this.getExternalBridge(externalBridgeType);
|
|
736368
|
-
const
|
|
736850
|
+
const fromAddress = this.getInventorySignerAddress(sourceChain);
|
|
736851
|
+
const toAddress = this.getInventorySignerAddress(targetChain);
|
|
736852
|
+
const quoteWithMode = async (mode) => externalBridge.quote({
|
|
736369
736853
|
fromChain: sourceChainId,
|
|
736370
736854
|
toChain: targetChainId,
|
|
736371
736855
|
fromToken: fromTokenAddress,
|
|
736372
736856
|
toToken: toTokenAddress,
|
|
736373
|
-
|
|
736374
|
-
|
|
736375
|
-
|
|
736857
|
+
...(mode === 'forward'
|
|
736858
|
+
? { fromAmount: maxSourceInput }
|
|
736859
|
+
: { toAmount: targetOutputAmount }),
|
|
736860
|
+
fromAddress,
|
|
736861
|
+
toAddress,
|
|
736376
736862
|
});
|
|
736863
|
+
let quoteModeUsed = quoteMode;
|
|
736864
|
+
let quote = await quoteWithMode(quoteModeUsed);
|
|
736865
|
+
if (quoteModeUsed === 'reverse' && quote.fromAmount > maxSourceInput) {
|
|
736866
|
+
this.logger.warn({
|
|
736867
|
+
sourceChain,
|
|
736868
|
+
targetChain,
|
|
736869
|
+
plannedQuoteMode: quoteMode,
|
|
736870
|
+
requestedTargetOutput: targetOutputAmount.toString(),
|
|
736871
|
+
quotedInput: quote.fromAmount.toString(),
|
|
736872
|
+
maxSourceInput: maxSourceInput.toString(),
|
|
736873
|
+
intentId: intent.id,
|
|
736874
|
+
}, 'Reverse bridge quote exceeded source capacity, retrying with forward quote');
|
|
736875
|
+
// Spend the full source cap on fallback; minor output drift is acceptable
|
|
736876
|
+
// and will be reconciled by later cycles rather than risking livelock.
|
|
736877
|
+
quoteModeUsed = 'forward';
|
|
736878
|
+
quote = await quoteWithMode(quoteModeUsed);
|
|
736879
|
+
}
|
|
736377
736880
|
const inputRequired = quote.fromAmount;
|
|
736378
736881
|
if (inputRequired > maxSourceInput) {
|
|
736379
736882
|
return {
|
|
@@ -736388,15 +736891,19 @@ class InventoryRebalancer {
|
|
|
736388
736891
|
targetChainId,
|
|
736389
736892
|
requestedTargetOutput: targetOutputAmount.toString(),
|
|
736390
736893
|
requestedTargetOutputFormatted: this.formatLocalAmount(targetOutputAmount, targetToken),
|
|
736894
|
+
quoteModePlanned: quoteMode,
|
|
736895
|
+
quoteModeUsed,
|
|
736896
|
+
retriedAsForward: quoteMode === 'reverse' && quoteModeUsed === 'forward',
|
|
736391
736897
|
inputRequired: inputRequired.toString(),
|
|
736392
736898
|
inputRequiredFormatted: this.formatLocalAmount(inputRequired, sourceToken),
|
|
736393
|
-
|
|
736394
|
-
|
|
736395
|
-
|
|
736899
|
+
quotedOutput: quote.toAmount.toString(),
|
|
736900
|
+
quotedOutputMin: quote.toAmountMin.toString(),
|
|
736901
|
+
quotedOutputFormatted: this.formatLocalAmount(quote.toAmount, targetToken),
|
|
736902
|
+
quotedOutputMinFormatted: this.formatLocalAmount(quote.toAmountMin, targetToken),
|
|
736396
736903
|
gasCosts: quote.gasCosts.toString(),
|
|
736397
736904
|
feeCosts: quote.feeCosts.toString(),
|
|
736398
736905
|
intentId: intent.id,
|
|
736399
|
-
}, 'Executing inventory movement via
|
|
736906
|
+
}, 'Executing inventory movement via bridge quote');
|
|
736400
736907
|
this.logger.debug({
|
|
736401
736908
|
quoteId: quote.id,
|
|
736402
736909
|
tool: quote.tool,
|
|
@@ -736442,19 +736949,27 @@ class InventoryRebalancer {
|
|
|
736442
736949
|
amountConsumed: inputRequired.toString(),
|
|
736443
736950
|
totalConsumed: (currentConsumed + inputRequired).toString(),
|
|
736444
736951
|
}, 'Updated consumed inventory after LiFi bridge');
|
|
736445
|
-
return {
|
|
736952
|
+
return {
|
|
736953
|
+
success: true,
|
|
736954
|
+
txHash: result.txHash,
|
|
736955
|
+
inputRequired,
|
|
736956
|
+
quotedOutput: quote.toAmount,
|
|
736957
|
+
quotedOutputMin: quote.toAmountMin,
|
|
736958
|
+
quoteModeUsed,
|
|
736959
|
+
};
|
|
736446
736960
|
}
|
|
736447
736961
|
catch (error) {
|
|
736962
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
736448
736963
|
this.logger.error({
|
|
736449
736964
|
sourceChain,
|
|
736450
736965
|
targetChain,
|
|
736451
736966
|
amount: targetOutputAmount.toString(),
|
|
736452
736967
|
intentId: intent.id,
|
|
736453
|
-
error:
|
|
736968
|
+
error: errorMessage,
|
|
736454
736969
|
}, 'Failed to execute inventory movement');
|
|
736455
736970
|
return {
|
|
736456
736971
|
success: false,
|
|
736457
|
-
error:
|
|
736972
|
+
error: errorMessage,
|
|
736458
736973
|
};
|
|
736459
736974
|
}
|
|
736460
736975
|
}
|
|
@@ -751212,7 +751727,7 @@ __nccwpck_require__.a(__webpack_module__, async (__webpack_handle_async_dependen
|
|
|
751212
751727
|
/* harmony export */ });
|
|
751213
751728
|
/* harmony import */ var _hyperlane_xyz_core__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(50653);
|
|
751214
751729
|
/* harmony import */ var _hyperlane_xyz_core_buildArtifact_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(74119);
|
|
751215
|
-
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
751730
|
+
/* harmony import */ var _hyperlane_xyz_deploy_sdk__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(56854);
|
|
751216
751731
|
/* harmony import */ var _hyperlane_xyz_provider_sdk__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(71280);
|
|
751217
751732
|
/* harmony import */ var _hyperlane_xyz_provider_sdk_artifact__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(4287);
|
|
751218
751733
|
/* harmony import */ var _hyperlane_xyz_provider_sdk_hook__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(77230);
|
|
@@ -817786,6 +818301,9 @@ class TronProtocolProvider {
|
|
|
817786
818301
|
// @TODO Implement in a follow up PR
|
|
817787
818302
|
throw Error('Not implemented');
|
|
817788
818303
|
}
|
|
818304
|
+
createFeeArtifactManager(_chainMetadata) {
|
|
818305
|
+
return null;
|
|
818306
|
+
}
|
|
817789
818307
|
getMinGas() {
|
|
817790
818308
|
return {
|
|
817791
818309
|
CORE_DEPLOY_GAS: BigInt(1e9),
|
|
@@ -903052,25 +903570,7 @@ function setRootLogger(logger) {
|
|
|
903052
903570
|
return rootLogger;
|
|
903053
903571
|
}
|
|
903054
903572
|
function createHyperlanePinoLogger(logLevel, logFormat) {
|
|
903055
|
-
|
|
903056
|
-
// but only if the log format is 'pretty'. This allows for JSON logs
|
|
903057
|
-
// in development as well if explicitly configured.
|
|
903058
|
-
if (process.env.NODE_ENV === 'development' &&
|
|
903059
|
-
logFormat === LogFormat.Pretty) {
|
|
903060
|
-
return (0,pino__WEBPACK_IMPORTED_MODULE_0__.pino)({
|
|
903061
|
-
level: logLevel,
|
|
903062
|
-
transport: {
|
|
903063
|
-
target: 'pino-pretty',
|
|
903064
|
-
options: {
|
|
903065
|
-
colorize: true,
|
|
903066
|
-
translateTime: 'SYS:standard',
|
|
903067
|
-
ignore: 'pid,hostname',
|
|
903068
|
-
},
|
|
903069
|
-
},
|
|
903070
|
-
});
|
|
903071
|
-
}
|
|
903072
|
-
// In production (or other envs), use the original hook-based logger
|
|
903073
|
-
return (0,pino__WEBPACK_IMPORTED_MODULE_0__.pino)({
|
|
903573
|
+
const createFallbackLogger = () => (0,pino__WEBPACK_IMPORTED_MODULE_0__.pino)({
|
|
903074
903574
|
level: logLevel,
|
|
903075
903575
|
name: 'hyperlane',
|
|
903076
903576
|
formatters: {
|
|
@@ -903093,6 +903593,32 @@ function createHyperlanePinoLogger(logLevel, logFormat) {
|
|
|
903093
903593
|
},
|
|
903094
903594
|
},
|
|
903095
903595
|
});
|
|
903596
|
+
// In development, pino-pretty is used for a better dev experience,
|
|
903597
|
+
// but only if the log format is 'pretty'. This allows for JSON logs
|
|
903598
|
+
// in development as well if explicitly configured.
|
|
903599
|
+
if (process.env.NODE_ENV === 'development' &&
|
|
903600
|
+
logFormat === LogFormat.Pretty) {
|
|
903601
|
+
try {
|
|
903602
|
+
return (0,pino__WEBPACK_IMPORTED_MODULE_0__.pino)({
|
|
903603
|
+
level: logLevel,
|
|
903604
|
+
transport: {
|
|
903605
|
+
target: 'pino-pretty',
|
|
903606
|
+
options: {
|
|
903607
|
+
colorize: true,
|
|
903608
|
+
translateTime: 'SYS:standard',
|
|
903609
|
+
ignore: 'pid,hostname',
|
|
903610
|
+
},
|
|
903611
|
+
},
|
|
903612
|
+
});
|
|
903613
|
+
}
|
|
903614
|
+
catch (err) {
|
|
903615
|
+
const fallbackLogger = createFallbackLogger();
|
|
903616
|
+
fallbackLogger.warn(err, 'Could not initialize pino-pretty, falling back to built-in pretty logger');
|
|
903617
|
+
return fallbackLogger;
|
|
903618
|
+
}
|
|
903619
|
+
}
|
|
903620
|
+
// In production (or other envs), use the original hook-based logger
|
|
903621
|
+
return createFallbackLogger();
|
|
903096
903622
|
}
|
|
903097
903623
|
function ethersBigNumberSerializer(key, value) {
|
|
903098
903624
|
// Check if the value looks like a serialized BigNumber
|
|
@@ -905660,7 +906186,7 @@ module.exports = /*#__PURE__*/JSON.parse('[{"type":"function","name":"proveL2Lea
|
|
|
905660
906186
|
/***/ 99468:
|
|
905661
906187
|
/***/ ((module) => {
|
|
905662
906188
|
|
|
905663
|
-
module.exports = {"rE":"33.0.
|
|
906189
|
+
module.exports = {"rE":"33.0.2"};
|
|
905664
906190
|
|
|
905665
906191
|
/***/ })
|
|
905666
906192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperlane-xyz/cli",
|
|
3
|
-
"version": "33.0.
|
|
3
|
+
"version": "33.0.2",
|
|
4
4
|
"description": "A command-line utility for common Hyperlane operations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -74,21 +74,21 @@
|
|
|
74
74
|
"zod": "^3.21.2",
|
|
75
75
|
"zod-validation-error": "^3.3.0",
|
|
76
76
|
"zx": "^8.1.4",
|
|
77
|
-
"@hyperlane-xyz/aleo-sdk": "33.0.
|
|
78
|
-
"@hyperlane-xyz/cosmos-sdk": "33.0.1",
|
|
79
|
-
"@hyperlane-xyz/deploy-sdk": "5.0.3",
|
|
77
|
+
"@hyperlane-xyz/aleo-sdk": "33.0.2",
|
|
80
78
|
"@hyperlane-xyz/core": "11.3.1",
|
|
81
|
-
"@hyperlane-xyz/
|
|
82
|
-
"@hyperlane-xyz/
|
|
83
|
-
"@hyperlane-xyz/
|
|
84
|
-
"@hyperlane-xyz/
|
|
85
|
-
"@hyperlane-xyz/
|
|
86
|
-
"@hyperlane-xyz/
|
|
87
|
-
"@hyperlane-xyz/
|
|
88
|
-
"@hyperlane-xyz/starknet-sdk": "28.0.
|
|
89
|
-
"@hyperlane-xyz/
|
|
90
|
-
"@hyperlane-xyz/
|
|
91
|
-
"@hyperlane-xyz/
|
|
79
|
+
"@hyperlane-xyz/cosmos-sdk": "33.0.2",
|
|
80
|
+
"@hyperlane-xyz/http-registry-server": "33.0.2",
|
|
81
|
+
"@hyperlane-xyz/deploy-sdk": "5.1.0",
|
|
82
|
+
"@hyperlane-xyz/provider-sdk": "5.1.0",
|
|
83
|
+
"@hyperlane-xyz/radix-sdk": "33.0.2",
|
|
84
|
+
"@hyperlane-xyz/relayer": "1.1.27",
|
|
85
|
+
"@hyperlane-xyz/sdk": "33.0.2",
|
|
86
|
+
"@hyperlane-xyz/starknet-sdk": "28.0.4",
|
|
87
|
+
"@hyperlane-xyz/rebalancer": "27.2.14",
|
|
88
|
+
"@hyperlane-xyz/sealevel-sdk": "33.0.2",
|
|
89
|
+
"@hyperlane-xyz/tron-sdk": "23.0.4",
|
|
90
|
+
"@hyperlane-xyz/tsconfig": "^33.0.2",
|
|
91
|
+
"@hyperlane-xyz/utils": "33.0.2"
|
|
92
92
|
},
|
|
93
93
|
"engines": {
|
|
94
94
|
"node": ">=16"
|