@hyperbridge/sdk 2.5.0 → 2.6.1

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.
@@ -1,5 +1,5 @@
1
- import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-tYGohDdW.cjs';
2
- export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-tYGohDdW.cjs';
1
+ import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-BJUF1dsr.cjs';
2
+ export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-BJUF1dsr.cjs';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -1917,10 +1917,12 @@ declare class IntentGateway {
1917
1917
  * placement, fee estimation, bid collection, and execution.
1918
1918
  *
1919
1919
  * **Yield/receive protocol:**
1920
- * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
1921
- * same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
1922
- * and include an additional 600k-gas fee uplift, while the wei cost used for
1923
- * the `value` field receives a 2% buffer.
1920
+ * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and
1921
+ * sets same-chain fees to twice the estimate. Cross-chain orders attach
1922
+ * (fill gas + a settlement-message uplift of `RELAYER_MESSAGE_GAS`, the
1923
+ * same gas budget the solver's relayer fee uses) with a 5% buffer over
1924
+ * the whole sum — strictly above the solver's unpadded requirement. The
1925
+ * wei cost used for the `value` field receives a 2% buffer.
1924
1926
  * 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
1925
1927
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
1926
1928
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
@@ -1,5 +1,5 @@
1
- import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-tYGohDdW.js';
2
- export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-tYGohDdW.js';
1
+ import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-BJUF1dsr.js';
2
+ export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-BJUF1dsr.js';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -1917,10 +1917,12 @@ declare class IntentGateway {
1917
1917
  * placement, fee estimation, bid collection, and execution.
1918
1918
  *
1919
1919
  * **Yield/receive protocol:**
1920
- * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
1921
- * same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
1922
- * and include an additional 600k-gas fee uplift, while the wei cost used for
1923
- * the `value` field receives a 2% buffer.
1920
+ * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and
1921
+ * sets same-chain fees to twice the estimate. Cross-chain orders attach
1922
+ * (fill gas + a settlement-message uplift of `RELAYER_MESSAGE_GAS`, the
1923
+ * same gas budget the solver's relayer fee uses) with a 5% buffer over
1924
+ * the whole sum — strictly above the solver's unpadded requirement. The
1925
+ * wei cost used for the `value` field receives a 2% buffer.
1924
1926
  * 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
1925
1927
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
1926
1928
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
@@ -2678,7 +2678,11 @@ var chainConfigs = {
2678
2678
  DAI: "0x6b175474e89094c44da98b954eedeac495271d0f",
2679
2679
  USDC: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
2680
2680
  USDT: "0xdac17f958d2ee523a2206206994597c13d831ec7",
2681
- cNGN: "0x17CDB2a01e7a34CbB3DD4b83260B05d0274C8dab"
2681
+ cNGN: "0x17CDB2a01e7a34CbB3DD4b83260B05d0274C8dab",
2682
+ ZARP: "0xb755506531786C8aC63B756BaB1ac387bACB0C04",
2683
+ EURC: "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
2684
+ XSGD: "0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96",
2685
+ TRYB: "0x2C537E5624e4af88A7ae4060C022609376C8D0EB"
2682
2686
  },
2683
2687
  tokenDecimals: {
2684
2688
  USDC: 6,
@@ -2848,7 +2852,9 @@ var chainConfigs = {
2848
2852
  USDC: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
2849
2853
  USDT: "0xfde4c96c8593536e31f229ea8f37b2ada2699bb2",
2850
2854
  EXT: "0x0e668E5127087e236578893a0e01E41837A28469",
2851
- cNGN: "0x46C85152bFe9f96829aA94755D9f915F9B10EF5F"
2855
+ cNGN: "0x46C85152bFe9f96829aA94755D9f915F9B10EF5F",
2856
+ ZARP: "0xb755506531786C8aC63B756BaB1ac387bACB0C04",
2857
+ EURC: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42"
2852
2858
  },
2853
2859
  tokenDecimals: {
2854
2860
  USDC: 6,
@@ -2908,7 +2914,9 @@ var chainConfigs = {
2908
2914
  USDC: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
2909
2915
  USDT: "0xc2132d05d31c914a87c6611c10748aeb04b58e8f",
2910
2916
  EXT: "0x7C8c11ADb8EF7cd3CFa718008Ea048445C6E7209",
2911
- cNGN: "0x52828daa48C1a9A06F37500882b42daf0bE04C3B"
2917
+ cNGN: "0x52828daa48C1a9A06F37500882b42daf0bE04C3B",
2918
+ ZARP: "0xb755506531786C8aC63B756BaB1ac387bACB0C04",
2919
+ XSGD: "0xDC3326e71D45186F113a2F448984CA0e8D201995"
2912
2920
  },
2913
2921
  tokenDecimals: {
2914
2922
  USDC: 6,
@@ -5145,6 +5153,21 @@ var ChainConfigService = class {
5145
5153
  getCNgnAsset(chain) {
5146
5154
  return this.getConfig(chain)?.assets?.cNGN;
5147
5155
  }
5156
+ /**
5157
+ * Address of `symbol` on `chain` from the per-chain asset table, matched
5158
+ * case-insensitively ("cNGN" ≡ "CNGN"). This table is the single source of
5159
+ * truth for token addresses — the simplex asset registry resolves through
5160
+ * it, so a new asset is added once in `chain.ts` and nowhere else.
5161
+ */
5162
+ getAssetBySymbol(chain, symbol) {
5163
+ const assets = this.getConfig(chain)?.assets;
5164
+ if (!assets) return void 0;
5165
+ const target = symbol.trim().toUpperCase();
5166
+ for (const [key, address] of Object.entries(assets)) {
5167
+ if (key.toUpperCase() === target) return address;
5168
+ }
5169
+ return void 0;
5170
+ }
5148
5171
  getCNgnDecimals(chain) {
5149
5172
  return this.getConfig(chain)?.tokenDecimals?.cNGN;
5150
5173
  }
@@ -7368,29 +7391,28 @@ var SubstrateChain = class _SubstrateChain {
7368
7391
  return BigInt(latestHeight);
7369
7392
  }
7370
7393
  /**
7371
- * Get the state machine update time for a given state machine height.
7394
+ * Get the state machine update time for a given state machine height. Reads the
7395
+ * `BoundedStateMachineUpdateTime` map in pallet-ismp directly, so the height is either
7396
+ * still retained on-chain or it has been evicted — there's no intermediate RPC to
7397
+ * reinterpret the absence.
7372
7398
  * @param {StateMachineHeight} stateMachineHeight - The state machine height.
7373
7399
  * @returns {Promise<bigint>} The statemachine update time in seconds.
7374
7400
  */
7375
7401
  async stateMachineUpdateTime(stateMachineHeight) {
7376
- const state_id = convertStateIdToStateMachineId(stateMachineHeight.id.stateId);
7377
- const stateMachineId = {
7378
- state_id,
7379
- consensus_state_id: stateMachineHeight.id.consensusStateId
7380
- };
7381
- const payload = {
7382
- id: stateMachineId,
7383
- height: Number(stateMachineHeight.height)
7402
+ if (!this.api) throw new Error("API not initialized");
7403
+ const id = {
7404
+ stateId: stateMachineHeight.id.stateId,
7405
+ // on-chain StateMachineId encodes consensusStateId as [u8; 4]
7406
+ consensusStateId: toHex(toBytes(stateMachineHeight.id.consensusStateId))
7384
7407
  };
7385
- try {
7386
- const updateTime = await this.rpcClient.call("ismp_queryStateMachineUpdateTime", [payload]);
7387
- return BigInt(updateTime);
7388
- } catch (error) {
7389
- if (MissingConsensusUpdateTimeError.isError(error)) {
7390
- throw new MissingConsensusUpdateTimeError(MISSING_CONSENSUS_UPDATE_TIME_MESSAGE, { cause: error });
7391
- }
7392
- throw error;
7408
+ const updateTime = await this.api.query.ismp.boundedStateMachineUpdateTime(
7409
+ id,
7410
+ Number(stateMachineHeight.height)
7411
+ );
7412
+ if (updateTime.isNone) {
7413
+ throw new MissingConsensusUpdateTimeError(MISSING_CONSENSUS_UPDATE_TIME_MESSAGE);
7393
7414
  }
7415
+ return BigInt(updateTime.unwrap().toString());
7394
7416
  }
7395
7417
  /**
7396
7418
  * Get the challenge period for a given state machine id.
@@ -17241,6 +17263,7 @@ var BidManager = class {
17241
17263
  }
17242
17264
  }
17243
17265
  };
17266
+ var RELAYER_MESSAGE_GAS = 1000000n;
17244
17267
  var GasEstimator = class {
17245
17268
  /**
17246
17269
  * @param ctx - Shared IntentsV2 context providing the source and destination
@@ -17261,7 +17284,12 @@ var GasEstimator = class {
17261
17284
  *
17262
17285
  * **Cross-chain orders:** also estimates the ISMP POST request fee required
17263
17286
  * for the solver to trigger source-chain escrow redemption after filling, and
17264
- * includes it in `fillOptions.relayerFee` and `fillOptions.nativeDispatchFee`.
17287
+ * includes it in `fillOptions.relayerFee`. The dispatch is always paid in the
17288
+ * fee token — `nativeDispatchFee` is fixed at 0. The native rail would draw
17289
+ * from the solver account's native balance, which nothing guarantees, and a
17290
+ * shortfall is invisible to estimation (the account balance is overridden
17291
+ * during simulation) — it would only surface as a reverted execution that
17292
+ * still bills the paymaster.
17265
17293
  *
17266
17294
  * **Bundler path:** constructs a mock `PackedUserOperation` signed by an
17267
17295
  * ephemeral keypair, applies state overrides, and calls
@@ -17310,24 +17338,19 @@ var GasEstimator = class {
17310
17338
  intentGatewayV2Address,
17311
17339
  entryPointAddress
17312
17340
  }),
17313
- isSameChain ? Promise.resolve({ postRequestFee: 0n, protocolFee: 0n }) : this.estimateCrossChainFees(
17314
- sourceFeeToken,
17315
- destFeeToken,
17316
- souceStateMachineId,
17317
- destStateMachineId,
17318
- order
17319
- )
17341
+ isSameChain ? Promise.resolve({ postRequestFee: 0n, relayerFeeInSourceFeeToken: 0n }) : this.estimateCrossChainFees(sourceFeeToken, destFeeToken, souceStateMachineId)
17320
17342
  ]);
17321
17343
  const { viem: stateOverrides, bundler: bundlerStateOverrides } = stateOverridesResult;
17322
17344
  const fillOptions = {
17323
17345
  relayerFee: crossChainFees.postRequestFee,
17324
- nativeDispatchFee: crossChainFees.protocolFee,
17346
+ // Always dispatch with the fee token (see the method docs).
17347
+ nativeDispatchFee: 0n,
17325
17348
  outputs: order.output.assets.map((asset) => ({
17326
17349
  ...asset,
17327
17350
  token: normalizeAddressForEvmBytes32(asset.token)
17328
17351
  }))
17329
17352
  };
17330
- const totalNativeValue = totalEthValue + fillOptions.nativeDispatchFee;
17353
+ const totalNativeValue = totalEthValue;
17331
17354
  const priorityFeeBumpPercent = params.maxPriorityFeePerGasBumpPercent ?? 8;
17332
17355
  const maxFeeBumpPercent = params.maxFeePerGasBumpPercent ?? 10;
17333
17356
  let maxPriorityFeePerGas = gasPrice + gasPrice * BigInt(priorityFeeBumpPercent) / 100n;
@@ -17494,37 +17517,32 @@ var GasEstimator = class {
17494
17517
  maxPriorityFeePerGas,
17495
17518
  totalGasCostWei,
17496
17519
  totalGasInFeeToken: totalGasInSourceFeeToken,
17520
+ relayerFeeInSourceFeeToken: crossChainFees.relayerFeeInSourceFeeToken,
17497
17521
  fillOptions
17498
17522
  };
17499
17523
  }
17500
17524
  /**
17501
- * Estimates cross-chain ISMP POST request fees by running the gas-to-fee-token
17502
- * conversion and host nonce fetch in parallel, then quoting the native dispatch cost.
17503
- */
17504
- async estimateCrossChainFees(sourceFeeToken, destFeeToken, sourceChainId, destChainId, order) {
17505
- const postRequestGas = 400000n;
17506
- const [postRequestFeeInSourceFeeToken, nonce] = await Promise.all([
17507
- convertGasToFeeToken(this.ctx, postRequestGas, "source", sourceChainId),
17508
- this.ctx.dest.getHostNonce()
17509
- ]);
17510
- let postRequestFeeInDestFeeToken = adjustDecimals(
17525
+ * Estimates the cross-chain ISMP POST request fee (the relayer fee for the
17526
+ * RedeemEscrow message), in both the source and destination fee tokens.
17527
+ * The dispatch is always paid in the fee token — the native rail was
17528
+ * removed because it silently drew on a native balance nothing guarantees.
17529
+ */
17530
+ async estimateCrossChainFees(sourceFeeToken, destFeeToken, sourceChainId) {
17531
+ const postRequestFeeInSourceFeeToken = await convertGasToFeeToken(
17532
+ this.ctx,
17533
+ RELAYER_MESSAGE_GAS,
17534
+ "source",
17535
+ sourceChainId
17536
+ );
17537
+ const postRequestFeeInDestFeeToken = adjustDecimals(
17511
17538
  postRequestFeeInSourceFeeToken,
17512
17539
  sourceFeeToken.decimals,
17513
17540
  destFeeToken.decimals
17514
17541
  );
17515
- const postRequest = {
17516
- source: destChainId,
17517
- dest: sourceChainId,
17518
- body: constructRedeemEscrowRequestBody({ ...order, id: orderCommitment(order) }, MOCK_ADDRESS),
17519
- timeoutTimestamp: 0n,
17520
- nonce,
17521
- from: this.ctx.source.configService.getIntentGatewayAddress(destChainId),
17522
- to: this.ctx.source.configService.getIntentGatewayAddress(sourceChainId)
17542
+ return {
17543
+ postRequestFee: postRequestFeeInDestFeeToken,
17544
+ relayerFeeInSourceFeeToken: postRequestFeeInSourceFeeToken
17523
17545
  };
17524
- postRequestFeeInDestFeeToken = postRequestFeeInDestFeeToken * 1005n / 1000n;
17525
- let protocolFeeInNativeToken = await this.ctx.dest.quoteNative(postRequest, postRequestFeeInDestFeeToken).catch(() => 0n);
17526
- protocolFeeInNativeToken = protocolFeeInNativeToken * 1005n / 1000n;
17527
- return { postRequestFee: postRequestFeeInDestFeeToken, protocolFee: protocolFeeInNativeToken };
17528
17546
  }
17529
17547
  /**
17530
17548
  * Builds EVM state override objects for gas estimation of the `fillOrder`
@@ -18284,7 +18302,6 @@ function isConfiguredAddress(address) {
18284
18302
  }
18285
18303
 
18286
18304
  // src/protocols/intents/IntentGateway.ts
18287
- var CROSS_CHAIN_ORDER_FEE_GAS_BUMP = 600000n;
18288
18305
  var IntentGateway = class _IntentGateway {
18289
18306
  /** EVM chain on which orders are placed and escrowed. */
18290
18307
  source;
@@ -18471,10 +18488,12 @@ var IntentGateway = class _IntentGateway {
18471
18488
  * placement, fee estimation, bid collection, and execution.
18472
18489
  *
18473
18490
  * **Yield/receive protocol:**
18474
- * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
18475
- * same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
18476
- * and include an additional 600k-gas fee uplift, while the wei cost used for
18477
- * the `value` field receives a 2% buffer.
18491
+ * 1. If `order.fees` is unset or zero, estimates gas on an internal copy and
18492
+ * sets same-chain fees to twice the estimate. Cross-chain orders attach
18493
+ * (fill gas + a settlement-message uplift of `RELAYER_MESSAGE_GAS`, the
18494
+ * same gas budget the solver's relayer fee uses) with a 5% buffer over
18495
+ * the whole sum — strictly above the solver's unpadded requirement. The
18496
+ * wei cost used for the `value` field receives a 2% buffer.
18478
18497
  * 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
18479
18498
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
18480
18499
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
@@ -18511,11 +18530,11 @@ var IntentGateway = class _IntentGateway {
18511
18530
  value = estimate.totalGasCostWei + estimate.totalGasCostWei * 2n / 100n;
18512
18531
  const crossChainFeeBump = isSameChain ? 0n : await convertGasToFeeToken(
18513
18532
  this.ctx,
18514
- CROSS_CHAIN_ORDER_FEE_GAS_BUMP,
18533
+ RELAYER_MESSAGE_GAS,
18515
18534
  "source",
18516
18535
  this.source.config.stateMachineId
18517
18536
  );
18518
- executionOrder.fees = isSameChain ? estimate.totalGasInFeeToken * 2n : estimate.totalGasInFeeToken + (crossChainFeeBump + estimate.totalGasInFeeToken * 1n / 100n);
18537
+ executionOrder.fees = isSameChain ? estimate.totalGasInFeeToken * 2n : (estimate.totalGasInFeeToken + crossChainFeeBump) * 105n / 100n;
18519
18538
  }
18520
18539
  const placeOrderGen = this.orderPlacer.placeOrder(executionOrder, graffiti);
18521
18540
  const placeOrderFirst = await placeOrderGen.next();