@hyperbridge/sdk 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 IntentOrderStatusUpdate, t as SelectBidResult, u as ResumeIntentOrderOptions, v as CancelOrderOptions, w as CancelQuote, x as SubmitBidOptions, y as PackedUserOperation, F as FillerBid, B as Bid, z as EstimateFillOrderParams, D as FillOrderEstimate, J as ERC7821Call, K as OrderWithStatus, L as OrderStatus, M as TokenGatewayAssetTeleportedWithStatus, N as TeleportStatus, Q as DecodedOrderPlacedLog, U as DecodedPostRequestEvent, V as DecodedPostResponseEvent } from './IntentGatewayV2-SB851bZs.cjs';
2
- export { W as AllStatusKey, X as AssetTeleportedResponse, Y as BidStorageEntry, Z as BidSubmissionResult, _ as BlockMetadata, $ as BytesLikeHex, a0 as CancelOptions, a1 as ChainConfig, a2 as ChainConfigData, a3 as Chains, a4 as ConfiguredAssetSymbol, a5 as Deployment, a6 as DispatchGet, a7 as DispatchInfo, a8 as DispatchPost, a9 as ExecuteIntentOrderOptions, aa as ExecutionResult, ab as FillOptions, ac as FillerConfig, ad as GetRequestResponse, ae as GetResponseByRequestIdResponse, af as GetResponseStorageValues, ag as HostParams, ah as HyperClientStatus, ai as IBatchConsensusAndGetResponseMessage, aj as IBatchConsensusAndPostRequestMessage, ak as IConfig, al as IConsensusMessage, am as IGetRequestMessage, an as IGetResponse, ao as IGetResponseMessage, ap as IHyperbridgeConfig, aq as IPostResponse, ar as IRequestMessage, as as ISubstrateConfig, at as ITimeoutPostRequestMessage, au as IntentGatewayABI, av as IntentGatewayParams, aw as IntentOrderStatus, ax as IntentOrderStatusKey, ay as IsmpRequest, az as OrderResponse, aA as OrderStatusMetadata, aB as PaymentInfo, aC as PhantomOrderEvent, aD as PostRequestStatus, aE as RequestBody, aF as RequestCommitment, aG as RequestKind, aH as RequestResponse, aI as RequestStatus, aJ as RequestStatusKey, aK as SelectOptions, aL as SigningAccount, aM as StateMachineId, aN as StateMachineResponse, aO as StorageFacade, aP as TimeoutStatus, aQ as TimeoutStatusKey, aR as TokenGatewayAssetTeleportedResponse, aS as TokenInfo, aT as TokenPrice, aU as TokenPricesResponse, aV as UniswapV4PoolConfigData, aW as chainConfigs, aX as convertCodecToIGetRequest, aY as convertCodecToIProof, aZ as convertIGetRequestToCodec, a_ as convertIProofToCodec, a$ as convertStateIdToStateMachineId, b0 as convertStateMachineEnumToString, b1 as convertStateMachineIdToEnum, b2 as decodeERC7821ExecuteBatch, b3 as decodeUserOpScale, b4 as encodeERC7821ExecuteBatch, b5 as encodeISMPMessage, b6 as encodeUserOpScale, b7 as getChainId, b8 as getConfigByStateMachineId, b9 as getViemChain, ba as hyperbridgeAddress, bb as pharosAtlantic, bc as pharosMainnet, bd as polkadotAssetHubPaseo, be as polkadotHubMainnet, bf as tronChainIds, bg as tronNile } from './IntentGatewayV2-SB851bZs.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-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';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -364,6 +364,10 @@ declare function normalizeEvmChainId(chainId: number | string): {
364
364
  };
365
365
  declare function encodeStateMachineId(stateMachineId: string): HexString;
366
366
  declare function normalizeAddressForEvmBytes32(address: string): HexString;
367
+ /**
368
+ * Validates an EVM address and returns its canonical lowercase representation.
369
+ */
370
+ declare function normalizeEvmAddress(address: string, field?: string): HexString;
367
371
  declare function normalizeAddressForStateMachine(address: string, stateMachineId: string): HexString;
368
372
  /**
369
373
  * Retries a promise-returning operation with exponential backoff.
@@ -1599,9 +1603,9 @@ interface BundlerGasEstimate {
1599
1603
  * - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
1600
1604
  * - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
1601
1605
  * - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
1602
- * - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
1603
- * - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
1604
- * - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
1606
+ * - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
1607
+ * - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
1608
+ * - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
1605
1609
  */
1606
1610
  type CancelEvent = {
1607
1611
  status: "DESTINATION_FINALIZED";
@@ -1675,19 +1679,8 @@ interface IntentGatewayContext {
1675
1679
  swap: Swap;
1676
1680
  }
1677
1681
 
1678
- type IntentQuoteStrategy = "uniswap_v4";
1682
+ type IntentQuoteStrategy = "uniswap_v4" | "phantom_snapshot";
1679
1683
  type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
1680
- /**
1681
- * Token metadata required by intent quote strategies.
1682
- */
1683
- interface IntentQuoteToken {
1684
- /** Token contract address on the user/source side. */
1685
- address: HexString;
1686
- /** Token decimals for raw amount formatting by the caller. */
1687
- decimals: number;
1688
- /** Optional token symbol used only to match SDK-configured destination pools. */
1689
- symbol?: string;
1690
- }
1691
1684
  /**
1692
1685
  * Full Uniswap V4 PoolKey. V4 pools cannot be discovered from a token pair alone.
1693
1686
  */
@@ -1704,7 +1697,7 @@ interface UniswapV4IntentQuoteOptions {
1704
1697
  quoterAddress?: HexString;
1705
1698
  /**
1706
1699
  * Destination-side address of the input currency. Defaults to
1707
- * `tokenIn.address`, which only works for same-chain quotes; pass this
1700
+ * `tokenIn`, which only works for same-chain quotes; pass this
1708
1701
  * explicitly when source and destination chains differ. Must equal
1709
1702
  * `currency0` or `currency1`.
1710
1703
  */
@@ -1715,13 +1708,17 @@ interface UniswapV4IntentQuoteOptions {
1715
1708
  * Parameters for `IntentGateway.quoteIntent`. The source and destination
1716
1709
  * chains come from the gateway instance itself.
1717
1710
  *
1718
- * `strategy` defaults to `uniswap_v4`, which is currently the only supported
1719
- * strategy. Provide exactly one of `amountIn` or `amountOut`.
1711
+ * Quotes default to `phantom_snapshot`. Pass `strategy: "uniswap_v4"` only to
1712
+ * explicitly request a Uniswap quote. `tokenIn` and `tokenOut` are token
1713
+ * addresses; the SDK resolves configured token metadata internally. Provide
1714
+ * exactly one of `amountIn` or `amountOut`.
1720
1715
  */
1721
1716
  interface QuoteIntentParams {
1722
1717
  strategy?: IntentQuoteStrategy;
1723
- tokenIn: IntentQuoteToken;
1724
- tokenOut: IntentQuoteToken;
1718
+ /** Token address on the source chain. */
1719
+ tokenIn: HexString;
1720
+ /** Token address on the destination chain. */
1721
+ tokenOut: HexString;
1725
1722
  amountIn?: bigint;
1726
1723
  amountOut?: bigint;
1727
1724
  uniswapV4?: UniswapV4IntentQuoteOptions;
@@ -1738,21 +1735,46 @@ interface UniswapV4IntentQuoteMetadata {
1738
1735
  */
1739
1736
  protocolFeeBps: bigint;
1740
1737
  }
1738
+ interface PhantomSnapshotIntentQuoteMetadata {
1739
+ /** Canonical chain whose directional Phantom pair addresses identify the feed. */
1740
+ quoteChain: string;
1741
+ /** Phantom order whose bids produced this snapshot. */
1742
+ commitment: HexString;
1743
+ tokenA: HexString;
1744
+ tokenB: HexString;
1745
+ /** Benchmark input and liquidity-weighted median output, both in raw token units. */
1746
+ standardAmount: bigint;
1747
+ medianPrice: bigint;
1748
+ lowestPrice?: bigint;
1749
+ highestPrice?: bigint;
1750
+ blockNumber: bigint;
1751
+ snapshotTime: Date;
1752
+ bidCount: number;
1753
+ /** Source gateway protocol fee already reflected in the returned quote amounts. */
1754
+ protocolFeeBps: bigint;
1755
+ }
1741
1756
  /**
1742
1757
  * Quote data partners need before constructing an IntentGateway V2 order.
1743
1758
  *
1744
1759
  * `amountIn` and `amountOut` already account for the IntentGateway protocol
1745
1760
  * fee that the gateway deducts from order inputs (see `quoteMetadata`). No
1746
- * further fee adjustment is required before placing the order; apply only your
1747
- * own slippage tolerance.
1761
+ * further fee or slippage adjustment is required before placing the order.
1748
1762
  */
1749
- interface QuoteIntentResult {
1763
+ interface UniswapV4QuoteIntentResult {
1750
1764
  strategy: "uniswap_v4";
1751
1765
  tradeType: IntentQuoteTradeType;
1752
1766
  amountIn: bigint;
1753
1767
  amountOut: bigint;
1754
1768
  quoteMetadata: UniswapV4IntentQuoteMetadata;
1755
1769
  }
1770
+ interface PhantomSnapshotQuoteIntentResult {
1771
+ strategy: "phantom_snapshot";
1772
+ tradeType: IntentQuoteTradeType;
1773
+ amountIn: bigint;
1774
+ amountOut: bigint;
1775
+ quoteMetadata: PhantomSnapshotIntentQuoteMetadata;
1776
+ }
1777
+ type QuoteIntentResult = UniswapV4QuoteIntentResult | PhantomSnapshotQuoteIntentResult;
1756
1778
  declare class UnsupportedIntentQuoteStrategyError extends Error {
1757
1779
  constructor(strategy: string);
1758
1780
  }
@@ -1760,18 +1782,25 @@ declare class UnsupportedIntentQuotePairError extends Error {
1760
1782
  constructor(params: {
1761
1783
  source: string;
1762
1784
  destination: string;
1763
- tokenIn: IntentQuoteToken;
1764
- tokenOut: IntentQuoteToken;
1785
+ tokenIn: HexString;
1786
+ tokenOut: HexString;
1787
+ quoteSource?: string;
1765
1788
  });
1766
1789
  }
1790
+ declare class PhantomSnapshotUnavailableError extends Error {
1791
+ constructor(tokenA: HexString, tokenB: HexString);
1792
+ }
1793
+ declare class InvalidPhantomSnapshotError extends Error {
1794
+ constructor(commitment: HexString, reason: string);
1795
+ }
1767
1796
 
1768
1797
  /**
1769
1798
  * High-level facade for the IntentGatewayV2 protocol.
1770
1799
  *
1771
1800
  * `IntentGateway` orchestrates the complete lifecycle of an intent-based
1772
1801
  * cross-chain swap:
1773
- * - **Quoting** — prices the order's input/output amounts via the configured
1774
- * quote strategies (currently Uniswap V4) before order construction.
1802
+ * - **Quoting** — prices the order's input/output amounts via Phantom order
1803
+ * snapshots by default, with Uniswap V4 available as an explicit strategy.
1775
1804
  * - **Order placement** — encodes and yields `placeOrder` calldata; caller
1776
1805
  * signs and submits the transaction.
1777
1806
  * - **Order execution** — polls the Hyperbridge coprocessor for solver bids,
@@ -1815,6 +1844,8 @@ declare class IntentGateway {
1815
1844
  private readonly gasEstimator;
1816
1845
  /** Quote strategies for pricing orders before placement, keyed by strategy name. */
1817
1846
  private readonly quoteStrategies;
1847
+ /** Resolves order tokens to canonical Phantom snapshot market pairs. */
1848
+ private readonly phantomSnapshotPairResolver;
1818
1849
  /**
1819
1850
  * Private constructor — use {@link IntentGateway.create} instead.
1820
1851
  *
@@ -1852,28 +1883,44 @@ declare class IntentGateway {
1852
1883
  /**
1853
1884
  * Quotes an intent between this gateway's source and destination chains.
1854
1885
  *
1855
- * `strategy` defaults to `uniswap_v4`, currently the only supported
1856
- * strategy. Provide exactly one of `amountIn` or `amountOut`.
1886
+ * Uses the latest directional Phantom order price snapshot from the attached
1887
+ * indexer by default. Pass `strategy: "uniswap_v4"` only when explicitly
1888
+ * requesting a Uniswap quote. Provide exactly one of `amountIn` or `amountOut`.
1857
1889
  *
1858
- * The Uniswap quote strategy always prices against the configured Base
1859
- * pool, regardless of this gateway's destination chain. Returned
1890
+ * Both built-in strategies resolve their canonical market on Base,
1891
+ * regardless of this gateway's destination chain. Returned
1860
1892
  * `amountIn`/`amountOut` already account for the gateway's protocol fee
1861
1893
  * (`quoteMetadata.protocolFeeBps`), which the gateway deducts from order
1862
- * inputs; apply only your own slippage tolerance before placing the order.
1894
+ * inputs; use the returned amounts directly when placing the order.
1863
1895
  *
1864
1896
  * @param params - Token pair, amount, and optional strategy/pool overrides.
1865
1897
  * @returns The quoted amounts plus strategy-specific metadata.
1866
1898
  * @throws {UnsupportedIntentQuoteStrategyError} For unknown strategies.
1867
- * @throws {UnsupportedIntentQuotePairError} When no pool is configured for the pair.
1899
+ * @throws {UnsupportedIntentQuotePairError} When the selected strategy does not support the pair.
1900
+ * @throws {PhantomSnapshotUnavailableError} When an eligible cNGN pair has no snapshot.
1868
1901
  */
1869
1902
  quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
1903
+ /**
1904
+ * Returns the output-token liquidity measured in the latest directional
1905
+ * Phantom snapshot for this gateway's source and destination.
1906
+ *
1907
+ * Pair resolution uses the same canonical Base market as {@link quoteIntent}.
1908
+ * The snapshot itself determines the output token and chain to aggregate. The
1909
+ * amount is in the token's smallest unit and reflects the indexer's
1910
+ * `snapshotTime`; it is not a live reservation or fill guarantee.
1911
+ *
1912
+ * Requires a prior call to {@link withQueryClient}.
1913
+ */
1914
+ queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquiditySnapshot | undefined>;
1870
1915
  /**
1871
1916
  * Bidirectional async generator that orchestrates the full order lifecycle:
1872
1917
  * placement, fee estimation, bid collection, and execution.
1873
1918
  *
1874
1919
  * **Yield/receive protocol:**
1875
- * 1. If `order.fees` is unset or zero, estimates gas and sets `order.fees`
1876
- * with a 1% buffer and the wei cost with a 2% buffer for the `value` field.
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.
1877
1924
  * 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
1878
1925
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
1879
1926
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
@@ -1881,8 +1928,8 @@ declare class IntentGateway {
1881
1928
  * 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
1882
1929
  * subsequent status updates until the order is filled, exhausted, or fails.
1883
1930
  *
1884
- * @param order - The order to place and execute. `order.fees` may be 0; it
1885
- * will be estimated automatically if so.
1931
+ * @param order - The order to place and execute. It is not mutated. `order.fees`
1932
+ * may be 0; fees are estimated automatically if so.
1886
1933
  * @param graffiti - Optional bytes32 tag for orderflow attribution /
1887
1934
  * revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
1888
1935
  * @param options - Optional tuning parameters:
@@ -5974,4 +6021,4 @@ declare function teleport(teleport_param: {
5974
6021
  extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
5975
6022
  }): Promise<ReadableStream<HyperbridgeTxEvents>>;
5976
6023
 
5977
- export { ADDRESS_ZERO, AssetTeleported, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteToken, type IntentQuoteTradeType, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
6024
+ export { ADDRESS_ZERO, AssetTeleported, AvailableLiquiditySnapshot, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
@@ -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 IntentOrderStatusUpdate, t as SelectBidResult, u as ResumeIntentOrderOptions, v as CancelOrderOptions, w as CancelQuote, x as SubmitBidOptions, y as PackedUserOperation, F as FillerBid, B as Bid, z as EstimateFillOrderParams, D as FillOrderEstimate, J as ERC7821Call, K as OrderWithStatus, L as OrderStatus, M as TokenGatewayAssetTeleportedWithStatus, N as TeleportStatus, Q as DecodedOrderPlacedLog, U as DecodedPostRequestEvent, V as DecodedPostResponseEvent } from './IntentGatewayV2-SB851bZs.js';
2
- export { W as AllStatusKey, X as AssetTeleportedResponse, Y as BidStorageEntry, Z as BidSubmissionResult, _ as BlockMetadata, $ as BytesLikeHex, a0 as CancelOptions, a1 as ChainConfig, a2 as ChainConfigData, a3 as Chains, a4 as ConfiguredAssetSymbol, a5 as Deployment, a6 as DispatchGet, a7 as DispatchInfo, a8 as DispatchPost, a9 as ExecuteIntentOrderOptions, aa as ExecutionResult, ab as FillOptions, ac as FillerConfig, ad as GetRequestResponse, ae as GetResponseByRequestIdResponse, af as GetResponseStorageValues, ag as HostParams, ah as HyperClientStatus, ai as IBatchConsensusAndGetResponseMessage, aj as IBatchConsensusAndPostRequestMessage, ak as IConfig, al as IConsensusMessage, am as IGetRequestMessage, an as IGetResponse, ao as IGetResponseMessage, ap as IHyperbridgeConfig, aq as IPostResponse, ar as IRequestMessage, as as ISubstrateConfig, at as ITimeoutPostRequestMessage, au as IntentGatewayABI, av as IntentGatewayParams, aw as IntentOrderStatus, ax as IntentOrderStatusKey, ay as IsmpRequest, az as OrderResponse, aA as OrderStatusMetadata, aB as PaymentInfo, aC as PhantomOrderEvent, aD as PostRequestStatus, aE as RequestBody, aF as RequestCommitment, aG as RequestKind, aH as RequestResponse, aI as RequestStatus, aJ as RequestStatusKey, aK as SelectOptions, aL as SigningAccount, aM as StateMachineId, aN as StateMachineResponse, aO as StorageFacade, aP as TimeoutStatus, aQ as TimeoutStatusKey, aR as TokenGatewayAssetTeleportedResponse, aS as TokenInfo, aT as TokenPrice, aU as TokenPricesResponse, aV as UniswapV4PoolConfigData, aW as chainConfigs, aX as convertCodecToIGetRequest, aY as convertCodecToIProof, aZ as convertIGetRequestToCodec, a_ as convertIProofToCodec, a$ as convertStateIdToStateMachineId, b0 as convertStateMachineEnumToString, b1 as convertStateMachineIdToEnum, b2 as decodeERC7821ExecuteBatch, b3 as decodeUserOpScale, b4 as encodeERC7821ExecuteBatch, b5 as encodeISMPMessage, b6 as encodeUserOpScale, b7 as getChainId, b8 as getConfigByStateMachineId, b9 as getViemChain, ba as hyperbridgeAddress, bb as pharosAtlantic, bc as pharosMainnet, bd as polkadotAssetHubPaseo, be as polkadotHubMainnet, bf as tronChainIds, bg as tronNile } from './IntentGatewayV2-SB851bZs.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-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';
3
3
  import { ConsolaInstance } from 'consola';
4
4
  import { GraphQLClient } from 'graphql-request';
5
5
  import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
@@ -364,6 +364,10 @@ declare function normalizeEvmChainId(chainId: number | string): {
364
364
  };
365
365
  declare function encodeStateMachineId(stateMachineId: string): HexString;
366
366
  declare function normalizeAddressForEvmBytes32(address: string): HexString;
367
+ /**
368
+ * Validates an EVM address and returns its canonical lowercase representation.
369
+ */
370
+ declare function normalizeEvmAddress(address: string, field?: string): HexString;
367
371
  declare function normalizeAddressForStateMachine(address: string, stateMachineId: string): HexString;
368
372
  /**
369
373
  * Retries a promise-returning operation with exponential backoff.
@@ -1599,9 +1603,9 @@ interface BundlerGasEstimate {
1599
1603
  * - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
1600
1604
  * - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
1601
1605
  * - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
1602
- * - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
1603
- * - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
1604
- * - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
1606
+ * - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
1607
+ * - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
1608
+ * - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
1605
1609
  */
1606
1610
  type CancelEvent = {
1607
1611
  status: "DESTINATION_FINALIZED";
@@ -1675,19 +1679,8 @@ interface IntentGatewayContext {
1675
1679
  swap: Swap;
1676
1680
  }
1677
1681
 
1678
- type IntentQuoteStrategy = "uniswap_v4";
1682
+ type IntentQuoteStrategy = "uniswap_v4" | "phantom_snapshot";
1679
1683
  type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
1680
- /**
1681
- * Token metadata required by intent quote strategies.
1682
- */
1683
- interface IntentQuoteToken {
1684
- /** Token contract address on the user/source side. */
1685
- address: HexString;
1686
- /** Token decimals for raw amount formatting by the caller. */
1687
- decimals: number;
1688
- /** Optional token symbol used only to match SDK-configured destination pools. */
1689
- symbol?: string;
1690
- }
1691
1684
  /**
1692
1685
  * Full Uniswap V4 PoolKey. V4 pools cannot be discovered from a token pair alone.
1693
1686
  */
@@ -1704,7 +1697,7 @@ interface UniswapV4IntentQuoteOptions {
1704
1697
  quoterAddress?: HexString;
1705
1698
  /**
1706
1699
  * Destination-side address of the input currency. Defaults to
1707
- * `tokenIn.address`, which only works for same-chain quotes; pass this
1700
+ * `tokenIn`, which only works for same-chain quotes; pass this
1708
1701
  * explicitly when source and destination chains differ. Must equal
1709
1702
  * `currency0` or `currency1`.
1710
1703
  */
@@ -1715,13 +1708,17 @@ interface UniswapV4IntentQuoteOptions {
1715
1708
  * Parameters for `IntentGateway.quoteIntent`. The source and destination
1716
1709
  * chains come from the gateway instance itself.
1717
1710
  *
1718
- * `strategy` defaults to `uniswap_v4`, which is currently the only supported
1719
- * strategy. Provide exactly one of `amountIn` or `amountOut`.
1711
+ * Quotes default to `phantom_snapshot`. Pass `strategy: "uniswap_v4"` only to
1712
+ * explicitly request a Uniswap quote. `tokenIn` and `tokenOut` are token
1713
+ * addresses; the SDK resolves configured token metadata internally. Provide
1714
+ * exactly one of `amountIn` or `amountOut`.
1720
1715
  */
1721
1716
  interface QuoteIntentParams {
1722
1717
  strategy?: IntentQuoteStrategy;
1723
- tokenIn: IntentQuoteToken;
1724
- tokenOut: IntentQuoteToken;
1718
+ /** Token address on the source chain. */
1719
+ tokenIn: HexString;
1720
+ /** Token address on the destination chain. */
1721
+ tokenOut: HexString;
1725
1722
  amountIn?: bigint;
1726
1723
  amountOut?: bigint;
1727
1724
  uniswapV4?: UniswapV4IntentQuoteOptions;
@@ -1738,21 +1735,46 @@ interface UniswapV4IntentQuoteMetadata {
1738
1735
  */
1739
1736
  protocolFeeBps: bigint;
1740
1737
  }
1738
+ interface PhantomSnapshotIntentQuoteMetadata {
1739
+ /** Canonical chain whose directional Phantom pair addresses identify the feed. */
1740
+ quoteChain: string;
1741
+ /** Phantom order whose bids produced this snapshot. */
1742
+ commitment: HexString;
1743
+ tokenA: HexString;
1744
+ tokenB: HexString;
1745
+ /** Benchmark input and liquidity-weighted median output, both in raw token units. */
1746
+ standardAmount: bigint;
1747
+ medianPrice: bigint;
1748
+ lowestPrice?: bigint;
1749
+ highestPrice?: bigint;
1750
+ blockNumber: bigint;
1751
+ snapshotTime: Date;
1752
+ bidCount: number;
1753
+ /** Source gateway protocol fee already reflected in the returned quote amounts. */
1754
+ protocolFeeBps: bigint;
1755
+ }
1741
1756
  /**
1742
1757
  * Quote data partners need before constructing an IntentGateway V2 order.
1743
1758
  *
1744
1759
  * `amountIn` and `amountOut` already account for the IntentGateway protocol
1745
1760
  * fee that the gateway deducts from order inputs (see `quoteMetadata`). No
1746
- * further fee adjustment is required before placing the order; apply only your
1747
- * own slippage tolerance.
1761
+ * further fee or slippage adjustment is required before placing the order.
1748
1762
  */
1749
- interface QuoteIntentResult {
1763
+ interface UniswapV4QuoteIntentResult {
1750
1764
  strategy: "uniswap_v4";
1751
1765
  tradeType: IntentQuoteTradeType;
1752
1766
  amountIn: bigint;
1753
1767
  amountOut: bigint;
1754
1768
  quoteMetadata: UniswapV4IntentQuoteMetadata;
1755
1769
  }
1770
+ interface PhantomSnapshotQuoteIntentResult {
1771
+ strategy: "phantom_snapshot";
1772
+ tradeType: IntentQuoteTradeType;
1773
+ amountIn: bigint;
1774
+ amountOut: bigint;
1775
+ quoteMetadata: PhantomSnapshotIntentQuoteMetadata;
1776
+ }
1777
+ type QuoteIntentResult = UniswapV4QuoteIntentResult | PhantomSnapshotQuoteIntentResult;
1756
1778
  declare class UnsupportedIntentQuoteStrategyError extends Error {
1757
1779
  constructor(strategy: string);
1758
1780
  }
@@ -1760,18 +1782,25 @@ declare class UnsupportedIntentQuotePairError extends Error {
1760
1782
  constructor(params: {
1761
1783
  source: string;
1762
1784
  destination: string;
1763
- tokenIn: IntentQuoteToken;
1764
- tokenOut: IntentQuoteToken;
1785
+ tokenIn: HexString;
1786
+ tokenOut: HexString;
1787
+ quoteSource?: string;
1765
1788
  });
1766
1789
  }
1790
+ declare class PhantomSnapshotUnavailableError extends Error {
1791
+ constructor(tokenA: HexString, tokenB: HexString);
1792
+ }
1793
+ declare class InvalidPhantomSnapshotError extends Error {
1794
+ constructor(commitment: HexString, reason: string);
1795
+ }
1767
1796
 
1768
1797
  /**
1769
1798
  * High-level facade for the IntentGatewayV2 protocol.
1770
1799
  *
1771
1800
  * `IntentGateway` orchestrates the complete lifecycle of an intent-based
1772
1801
  * cross-chain swap:
1773
- * - **Quoting** — prices the order's input/output amounts via the configured
1774
- * quote strategies (currently Uniswap V4) before order construction.
1802
+ * - **Quoting** — prices the order's input/output amounts via Phantom order
1803
+ * snapshots by default, with Uniswap V4 available as an explicit strategy.
1775
1804
  * - **Order placement** — encodes and yields `placeOrder` calldata; caller
1776
1805
  * signs and submits the transaction.
1777
1806
  * - **Order execution** — polls the Hyperbridge coprocessor for solver bids,
@@ -1815,6 +1844,8 @@ declare class IntentGateway {
1815
1844
  private readonly gasEstimator;
1816
1845
  /** Quote strategies for pricing orders before placement, keyed by strategy name. */
1817
1846
  private readonly quoteStrategies;
1847
+ /** Resolves order tokens to canonical Phantom snapshot market pairs. */
1848
+ private readonly phantomSnapshotPairResolver;
1818
1849
  /**
1819
1850
  * Private constructor — use {@link IntentGateway.create} instead.
1820
1851
  *
@@ -1852,28 +1883,44 @@ declare class IntentGateway {
1852
1883
  /**
1853
1884
  * Quotes an intent between this gateway's source and destination chains.
1854
1885
  *
1855
- * `strategy` defaults to `uniswap_v4`, currently the only supported
1856
- * strategy. Provide exactly one of `amountIn` or `amountOut`.
1886
+ * Uses the latest directional Phantom order price snapshot from the attached
1887
+ * indexer by default. Pass `strategy: "uniswap_v4"` only when explicitly
1888
+ * requesting a Uniswap quote. Provide exactly one of `amountIn` or `amountOut`.
1857
1889
  *
1858
- * The Uniswap quote strategy always prices against the configured Base
1859
- * pool, regardless of this gateway's destination chain. Returned
1890
+ * Both built-in strategies resolve their canonical market on Base,
1891
+ * regardless of this gateway's destination chain. Returned
1860
1892
  * `amountIn`/`amountOut` already account for the gateway's protocol fee
1861
1893
  * (`quoteMetadata.protocolFeeBps`), which the gateway deducts from order
1862
- * inputs; apply only your own slippage tolerance before placing the order.
1894
+ * inputs; use the returned amounts directly when placing the order.
1863
1895
  *
1864
1896
  * @param params - Token pair, amount, and optional strategy/pool overrides.
1865
1897
  * @returns The quoted amounts plus strategy-specific metadata.
1866
1898
  * @throws {UnsupportedIntentQuoteStrategyError} For unknown strategies.
1867
- * @throws {UnsupportedIntentQuotePairError} When no pool is configured for the pair.
1899
+ * @throws {UnsupportedIntentQuotePairError} When the selected strategy does not support the pair.
1900
+ * @throws {PhantomSnapshotUnavailableError} When an eligible cNGN pair has no snapshot.
1868
1901
  */
1869
1902
  quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
1903
+ /**
1904
+ * Returns the output-token liquidity measured in the latest directional
1905
+ * Phantom snapshot for this gateway's source and destination.
1906
+ *
1907
+ * Pair resolution uses the same canonical Base market as {@link quoteIntent}.
1908
+ * The snapshot itself determines the output token and chain to aggregate. The
1909
+ * amount is in the token's smallest unit and reflects the indexer's
1910
+ * `snapshotTime`; it is not a live reservation or fill guarantee.
1911
+ *
1912
+ * Requires a prior call to {@link withQueryClient}.
1913
+ */
1914
+ queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquiditySnapshot | undefined>;
1870
1915
  /**
1871
1916
  * Bidirectional async generator that orchestrates the full order lifecycle:
1872
1917
  * placement, fee estimation, bid collection, and execution.
1873
1918
  *
1874
1919
  * **Yield/receive protocol:**
1875
- * 1. If `order.fees` is unset or zero, estimates gas and sets `order.fees`
1876
- * with a 1% buffer and the wei cost with a 2% buffer for the `value` field.
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.
1877
1924
  * 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
1878
1925
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
1879
1926
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
@@ -1881,8 +1928,8 @@ declare class IntentGateway {
1881
1928
  * 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
1882
1929
  * subsequent status updates until the order is filled, exhausted, or fails.
1883
1930
  *
1884
- * @param order - The order to place and execute. `order.fees` may be 0; it
1885
- * will be estimated automatically if so.
1931
+ * @param order - The order to place and execute. It is not mutated. `order.fees`
1932
+ * may be 0; fees are estimated automatically if so.
1886
1933
  * @param graffiti - Optional bytes32 tag for orderflow attribution /
1887
1934
  * revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
1888
1935
  * @param options - Optional tuning parameters:
@@ -5974,4 +6021,4 @@ declare function teleport(teleport_param: {
5974
6021
  extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
5975
6022
  }): Promise<ReadableStream<HyperbridgeTxEvents>>;
5976
6023
 
5977
- export { ADDRESS_ZERO, AssetTeleported, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteToken, type IntentQuoteTradeType, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
6024
+ export { ADDRESS_ZERO, AssetTeleported, AvailableLiquiditySnapshot, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };