@hyperbridge/sdk 2.8.0 → 2.8.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.
@@ -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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-gyGREuyu.cjs';
2
- export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-gyGREuyu.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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-D_km9I2f.cjs';
2
+ export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-D_km9I2f.cjs';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-gyGREuyu.js';
2
- export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-gyGREuyu.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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-D_km9I2f.js';
2
+ export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-D_km9I2f.js';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -2688,13 +2688,26 @@ var chainConfigs = {
2688
2688
  tokenDecimals: {
2689
2689
  USDC: 6,
2690
2690
  USDT: 6,
2691
- cNGN: 6
2691
+ cNGN: 6,
2692
+ ZARP: 18,
2693
+ EURC: 6,
2694
+ XSGD: 6,
2695
+ TRYB: 6,
2696
+ USDR: 6
2692
2697
  },
2693
2698
  tokenStorageSlots: {
2694
2699
  USDT: { balanceSlot: 2, allowanceSlot: 5 },
2695
2700
  USDC: { balanceSlot: 9, allowanceSlot: 10 },
2696
2701
  WETH: { balanceSlot: 3, allowanceSlot: 4 },
2697
- DAI: { balanceSlot: 0, allowanceSlot: 0 }
2702
+ DAI: { balanceSlot: 0, allowanceSlot: 0 },
2703
+ cNGN: { balanceSlot: 201, allowanceSlot: 202 },
2704
+ // custom upgradeable layout
2705
+ ZARP: { balanceSlot: 51, allowanceSlot: 52 },
2706
+ EURC: { balanceSlot: 9, allowanceSlot: 10 },
2707
+ // Circle FiatToken layout
2708
+ XSGD: { balanceSlot: 7, allowanceSlot: 8 },
2709
+ TRYB: { balanceSlot: 9, allowanceSlot: 10 },
2710
+ USDR: { balanceSlot: 51, allowanceSlot: 52 }
2698
2711
  },
2699
2712
  addresses: {
2700
2713
  IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
@@ -2874,13 +2887,22 @@ var chainConfigs = {
2874
2887
  USDC: 6,
2875
2888
  USDT: 6,
2876
2889
  cNGN: 6,
2877
- EXT: 18
2890
+ EXT: 18,
2891
+ ZARP: 18,
2892
+ EURC: 6,
2893
+ USDR: 6
2878
2894
  },
2879
2895
  tokenStorageSlots: {
2880
2896
  USDT: { balanceSlot: 0, allowanceSlot: 1 },
2881
2897
  USDC: { balanceSlot: 9, allowanceSlot: 10 },
2882
2898
  WETH: { balanceSlot: 3, allowanceSlot: 4 },
2883
- DAI: { balanceSlot: 0, allowanceSlot: 0 }
2899
+ DAI: { balanceSlot: 0, allowanceSlot: 0 },
2900
+ cNGN: { balanceSlot: 201, allowanceSlot: 202 },
2901
+ // custom upgradeable layout
2902
+ ZARP: { balanceSlot: 51, allowanceSlot: 52 },
2903
+ EURC: { balanceSlot: 9, allowanceSlot: 10 },
2904
+ // Circle FiatToken layout
2905
+ USDR: { balanceSlot: 51, allowanceSlot: 52 }
2884
2906
  },
2885
2907
  addresses: {
2886
2908
  IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
@@ -2941,13 +2963,21 @@ var chainConfigs = {
2941
2963
  USDC: 6,
2942
2964
  USDT: 6,
2943
2965
  EXT: 18,
2944
- cNGN: 6
2966
+ cNGN: 6,
2967
+ ZARP: 18,
2968
+ XSGD: 6,
2969
+ USDR: 6
2945
2970
  },
2946
2971
  tokenStorageSlots: {
2947
2972
  USDT: { balanceSlot: 0, allowanceSlot: 1 },
2948
2973
  USDC: { balanceSlot: 9, allowanceSlot: 10 },
2949
2974
  WETH: { balanceSlot: 3, allowanceSlot: 4 },
2950
- DAI: { balanceSlot: 0, allowanceSlot: 0 }
2975
+ DAI: { balanceSlot: 0, allowanceSlot: 0 },
2976
+ cNGN: { balanceSlot: 201, allowanceSlot: 202 },
2977
+ // custom upgradeable layout
2978
+ ZARP: { balanceSlot: 51, allowanceSlot: 52 },
2979
+ XSGD: { balanceSlot: 7, allowanceSlot: 8 },
2980
+ USDR: { balanceSlot: 51, allowanceSlot: 52 }
2951
2981
  },
2952
2982
  addresses: {
2953
2983
  IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
@@ -3248,8 +3278,9 @@ var chainConfigs = {
3248
3278
  assets: {
3249
3279
  WETH: "0x0000000000000000000000000000000000000000",
3250
3280
  DAI: "0x0000000000000000000000000000000000000000",
3281
+ // Asset Hub assets at their asset-id precompile addresses: 0x539 = 1337, 0x7c0 = 1984.
3251
3282
  USDC: "0x0000053900000000000000000000000001200000",
3252
- USDT: "0x0000000000000000000000000000000000000000"
3283
+ USDT: "0x000007c000000000000000000000000001200000"
3253
3284
  },
3254
3285
  tokenDecimals: {
3255
3286
  USDC: 6,
@@ -7906,15 +7937,25 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
7906
7937
  /**
7907
7938
  * Signs and sends an extrinsic. Submissions are serialised through {@link submissionQueue} so
7908
7939
  * concurrent calls never collide on the substrate account nonce — each extrinsic reaches a block
7909
- * before the next is signed.
7940
+ * (or is confirmed still pooled and returned as `pending`) before the next is signed; auto-nonce
7941
+ * via `system.accountNextIndex` counts pooled extrinsics, so a pending one is never re-used.
7910
7942
  */
7911
7943
  async signAndSendExtrinsic(extrinsic, maxRetries = 3, timeoutMs = 3e4) {
7912
- const result = await this.submissionQueue.add(() => this.sendExtrinsicWithRetries(extrinsic, maxRetries, timeoutMs));
7944
+ const result = await this.submissionQueue.add(
7945
+ () => this.sendExtrinsicWithRetries(extrinsic, maxRetries, timeoutMs)
7946
+ );
7913
7947
  return result ?? { success: false, error: "Submission queue returned no result" };
7914
7948
  }
7915
7949
  /**
7916
7950
  * Signs and sends an extrinsic, handling status updates and errors.
7917
7951
  * Implements retry logic with progressive tip increases for stuck transactions.
7952
+ *
7953
+ * A retry only happens when the previous attempt verifiably went nowhere. Once an attempt's
7954
+ * extrinsic is known to be pooled (`pending`), re-signing the same call would race our own
7955
+ * submission: the copy either bounces off the pool (1014, same nonce below the replacement
7956
+ * priority bump) or — if the original lands first, freeing the nonce — executes as a duplicate
7957
+ * and fails on-chain (e.g. `BidNotFound` for a retraction). Neither can succeed, so the pending
7958
+ * result is returned for the caller to confirm later.
7918
7959
  */
7919
7960
  async sendExtrinsicWithRetries(extrinsic, maxRetries, timeoutMs) {
7920
7961
  const keyPair = this.getKeyPair();
@@ -7925,7 +7966,7 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
7925
7966
  attempt++;
7926
7967
  try {
7927
7968
  const result = await this.sendWithTimeout(extrinsic, keyPair, currentTip, timeoutMs);
7928
- if (result.success || result.error?.includes("Dispatch error")) {
7969
+ if (result.success || result.pending || result.error?.includes("Dispatch error")) {
7929
7970
  return result;
7930
7971
  }
7931
7972
  } catch (err) {
@@ -7941,12 +7982,30 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
7941
7982
  };
7942
7983
  }
7943
7984
  /**
7944
- * Sends an extrinsic with a timeout
7985
+ * Classifies a submission rejection. Codes 1013 ("already imported") and 1014 ("priority is
7986
+ * too low") both mean a copy of this account+nonce is already in the pool — almost always our
7987
+ * own earlier attempt whose watch handle didn't confirm cleanly. That extrinsic is in flight;
7988
+ * resubmitting can only bounce again or land a duplicate, so these are surfaced as `pending`
7989
+ * rather than failure.
7990
+ */
7991
+ classifySubmissionError(err) {
7992
+ const code = err.code;
7993
+ const inFlight = code === 1013 || code === 1014 || /already imported|already in the pool|priority is too low/i.test(err.message);
7994
+ return { success: false, pending: inFlight || void 0, error: err.message };
7995
+ }
7996
+ /**
7997
+ * Sends an extrinsic with a timeout.
7998
+ *
7999
+ * A timeout is only a failure when the extrinsic never made it into the transaction pool.
8000
+ * Once a pool-entry status (Future/Ready/Broadcast/Retracted) has been seen, the extrinsic is
8001
+ * in flight and may well execute after the watch is abandoned — the result is then `pending`,
8002
+ * telling the caller to confirm the outcome later instead of re-signing the same call.
7945
8003
  */
7946
8004
  async sendWithTimeout(extrinsic, keyPair, tip, timeoutMs) {
7947
8005
  return new Promise((resolve) => {
7948
8006
  let resolved = false;
7949
8007
  let unsubscribe = null;
8008
+ let enteredPool = false;
7950
8009
  const timeoutId = setTimeout(() => {
7951
8010
  if (!resolved) {
7952
8011
  resolved = true;
@@ -7955,12 +8014,17 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
7955
8014
  }
7956
8015
  resolve({
7957
8016
  success: false,
7958
- error: `Transaction timed out after ${timeoutMs}ms`
8017
+ pending: enteredPool || void 0,
8018
+ extrinsicHash: enteredPool ? extrinsic.hash.toHex() : void 0,
8019
+ error: `Transaction timed out after ${timeoutMs}ms${enteredPool ? " while in the transaction pool" : ""}`
7959
8020
  });
7960
8021
  }
7961
8022
  }, timeoutMs);
7962
8023
  extrinsic.signAndSend(keyPair, { tip }, (result) => {
7963
8024
  if (resolved) return;
8025
+ if (result.status.isFuture || result.status.isReady || result.status.isBroadcast || result.status.isRetracted) {
8026
+ enteredPool = true;
8027
+ }
7964
8028
  if (result.dispatchError && (result.status.isInBlock || result.status.isFinalized)) {
7965
8029
  resolved = true;
7966
8030
  clearTimeout(timeoutId);
@@ -8018,7 +8082,7 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
8018
8082
  if (!resolved) {
8019
8083
  resolved = true;
8020
8084
  clearTimeout(timeoutId);
8021
- resolve({ success: false, error: err.message });
8085
+ resolve(this.classifySubmissionError(err));
8022
8086
  }
8023
8087
  });
8024
8088
  });
@@ -8192,9 +8256,7 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
8192
8256
  if (!result || result.isNone) return null;
8193
8257
  const rawHex = result.unwrap().toHex();
8194
8258
  if (rawHex === "0x" || rawHex === "0x00") return null;
8195
- const placeOrderAbi = IntentGatewayV2_default.ABI.find(
8196
- (item) => item.type === "function" && item.name === "placeOrder"
8197
- );
8259
+ const placeOrderAbi = IntentGatewayV2_default.ABI.find((item) => item.type === "function" && item.name === "placeOrder");
8198
8260
  const orderType = placeOrderAbi?.inputs?.[0];
8199
8261
  if (!orderType) return null;
8200
8262
  const [decoded] = decodeAbiParameters([orderType], rawHex);
@@ -16983,14 +17045,14 @@ var BidManager = class {
16983
17045
  }
16984
17046
  /**
16985
17047
  * Autopilot bid selection: sorts the given bids by output value, simulates
16986
- * each in order until one passes, then executes that bid. For consumers that
16987
- * do not need custom selection logic.
17048
+ * each in order and attempts execution. Any bid that fails simulation or
17049
+ * execution is skipped once so the next ranked bid can be attempted in the
17050
+ * same round. For consumers that do not need custom selection logic.
16988
17051
  *
16989
17052
  * @param order - The placed order to fill.
16990
17053
  * @param bids - Candidate bids (from {@link buildBids}).
16991
17054
  * @returns A {@link SelectBidResult} for the executed bid.
16992
- * @throws If no valid bids exist, all simulations fail, or the bundler rejects
16993
- * the UserOperation.
17055
+ * @throws If no valid bids exist or every bid fails simulation/execution.
16994
17056
  */
16995
17057
  async selectAndExecuteBest(order, bids) {
16996
17058
  const commitment = order.id;
@@ -17007,22 +17069,34 @@ var BidManager = class {
17007
17069
  throw new Error("No valid bids found");
17008
17070
  }
17009
17071
  console.log(`[BidManager] Simulating ${sortedBids.length} sorted bid(s) to find a valid one`);
17072
+ let simulationFailures = 0;
17073
+ let executionFailures = 0;
17010
17074
  for (let idx = 0; idx < sortedBids.length; idx++) {
17011
17075
  const bid = sortedBids[idx];
17012
17076
  console.log(`[BidManager] Simulating bid ${idx + 1}/${sortedBids.length} from solver=${bid.solverAddress}`);
17013
17077
  try {
17014
17078
  await bid.simulate();
17015
17079
  } catch (err) {
17080
+ simulationFailures += 1;
17016
17081
  console.warn(
17017
17082
  `[BidManager] Bid ${idx + 1} from solver=${bid.solverAddress}: simulation FAILED: ${err instanceof Error ? err.message : String(err)}`
17018
17083
  );
17019
17084
  continue;
17020
17085
  }
17021
17086
  console.log(`[BidManager] Bid ${idx + 1} from solver=${bid.solverAddress}: simulation PASSED`);
17022
- return bid.execute();
17087
+ try {
17088
+ return await bid.execute();
17089
+ } catch (err) {
17090
+ executionFailures += 1;
17091
+ console.warn(
17092
+ `[BidManager] Bid ${idx + 1} from solver=${bid.solverAddress}: execution FAILED: ${err instanceof Error ? err.message : String(err)}; trying next bid`
17093
+ );
17094
+ }
17023
17095
  }
17024
- console.error(`[BidManager] All ${sortedBids.length} bid(s) failed simulation for commitment=${commitment}`);
17025
- throw new Error("No bids passed simulation");
17096
+ console.error(
17097
+ `[BidManager] No executable bids for commitment=${commitment}: ${simulationFailures} simulation failure(s), ${executionFailures} execution failure(s)`
17098
+ );
17099
+ throw new Error("No bids passed simulation and execution");
17026
17100
  }
17027
17101
  /**
17028
17102
  * Sorts a list of bids for the given order by output value.
@@ -17362,6 +17436,10 @@ var BidManager = class {
17362
17436
  }
17363
17437
  };
17364
17438
  var RELAYER_MESSAGE_GAS = 1000000n;
17439
+ var NO_BUNDLER_FILL_GAS_BASE = 700000n;
17440
+ var NO_BUNDLER_FILL_GAS_PER_OUTPUT = 150000n;
17441
+ var NO_BUNDLER_PAYMASTER_VERIFICATION_GAS = 250000n;
17442
+ var NO_BUNDLER_PAYMASTER_POST_OP_GAS = 100000n;
17365
17443
  var GasEstimator = class {
17366
17444
  /**
17367
17445
  * @param ctx - Shared IntentsV2 context providing the source and destination
@@ -17395,8 +17473,10 @@ var GasEstimator = class {
17395
17473
  * headroom. If the bundler is Pimlico, gas prices are refined with
17396
17474
  * `pimlico_getUserOperationGasPrice`.
17397
17475
  *
17398
- * **Fallback path (no bundler):** calls `estimateContractGas` directly on
17399
- * `fillOrder` with state overrides.
17476
+ * **Fallback path (no bundler):** uses a fixed budget
17477
+ * ({@link NO_BUNDLER_FILL_GAS_BASE} plus {@link NO_BUNDLER_FILL_GAS_PER_OUTPUT}
17478
+ * per output leg) — public RPCs don't reliably support estimation with
17479
+ * state overrides.
17400
17480
  *
17401
17481
  * @param params - Parameters including the order to estimate and optional
17402
17482
  * percentage bumps for `maxPriorityFeePerGas` and `maxFeePerGas`.
@@ -17431,14 +17511,14 @@ var GasEstimator = class {
17431
17511
  }
17432
17512
  const isSameChain = souceStateMachineId === destStateMachineId;
17433
17513
  const [stateOverridesResult, crossChainFees] = await Promise.all([
17434
- this.buildStateOverride({
17514
+ this.ctx.bundlerUrl ? this.buildStateOverride({
17435
17515
  accountAddress: solverAccountAddress,
17436
17516
  chain: destStateMachineId,
17437
17517
  outputAssets: assetsForOverrides,
17438
17518
  spenderAddress: intentGatewayV2Address,
17439
17519
  intentGatewayV2Address,
17440
17520
  entryPointAddress
17441
- }),
17521
+ }) : Promise.resolve({ viem: [], bundler: {} }),
17442
17522
  isSameChain ? Promise.resolve({ postRequestFee: 0n, relayerFeeInSourceFeeToken: 0n }) : this.estimateCrossChainFees(
17443
17523
  sourceFeeToken,
17444
17524
  destFeeToken,
@@ -17446,7 +17526,7 @@ var GasEstimator = class {
17446
17526
  orderFeeGasPriceBumpPercent
17447
17527
  )
17448
17528
  ]);
17449
- const { viem: stateOverrides, bundler: bundlerStateOverrides } = stateOverridesResult;
17529
+ const { bundler: bundlerStateOverrides } = stateOverridesResult;
17450
17530
  const fillOptions = {
17451
17531
  relayerFee: crossChainFees.postRequestFee,
17452
17532
  // Always dispatch with the fee token (see the method docs).
@@ -17587,20 +17667,9 @@ var GasEstimator = class {
17587
17667
  console.warn("Bundler gas estimation failed, using fallback values:", e);
17588
17668
  }
17589
17669
  } else {
17590
- try {
17591
- const estimatedGas = await this.ctx.dest.client.estimateContractGas({
17592
- abi: ABI3,
17593
- address: intentGatewayV2Address,
17594
- functionName: "fillOrder",
17595
- args: [transformOrderForContract(order), fillOptions],
17596
- account: solverAccountAddress,
17597
- value: totalNativeValue,
17598
- stateOverride: stateOverrides
17599
- });
17600
- callGasLimit = estimatedGas * 105n / 100n;
17601
- } catch (e) {
17602
- console.warn("fillOrder gas estimation failed, using fallback:", e);
17603
- }
17670
+ callGasLimit = NO_BUNDLER_FILL_GAS_BASE + NO_BUNDLER_FILL_GAS_PER_OUTPUT * BigInt(order.output.assets.length);
17671
+ paymasterVerificationGasLimit = NO_BUNDLER_PAYMASTER_VERIFICATION_GAS;
17672
+ paymasterPostOpGasLimit = NO_BUNDLER_PAYMASTER_POST_OP_GAS;
17604
17673
  }
17605
17674
  const totalGas = callGasLimit + verificationGasLimit + preVerificationGas + paymasterVerificationGasLimit + paymasterPostOpGasLimit;
17606
17675
  const rawTotalGasCostWei = totalGas * maxFeePerGas;