@hyperbridge/sdk 2.8.16 → 2.8.17

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.
@@ -1729,8 +1729,10 @@ interface OrderbookRouteLiquidity {
1729
1729
  book: OrderbookBook;
1730
1730
  /** `BID` when tokenIn is the book's base, `ASK` when it is the quote. */
1731
1731
  side: OrderbookSide;
1732
- /** Quote per 1 base; null when no order serves the route. */
1732
+ /** Quote per 1 base, before the protocol fee; null when no order serves the route. */
1733
1733
  bestRate: bigint | null;
1734
+ /** The destination chain's protocol fee in basis points, which the gateway takes out of what the orders deliver. */
1735
+ slippageBps: number;
1734
1736
  /** Virtual depth: the serving orders' sizes summed, in tokenIn and tokenOut. */
1735
1737
  depthIn: bigint;
1736
1738
  depthOut: bigint;
@@ -1741,27 +1743,56 @@ interface OrderbookRouteLiquidity {
1741
1743
  orderCount: number;
1742
1744
  solverCount: number;
1743
1745
  }
1744
- /** A quote for an input amount on a route. Amounts and rates at 1e18. */
1746
+ /** One order an optimistic quote takes, at the order's own price. Amounts and rates at 1e18. */
1747
+ interface OrderbookQuoteFill {
1748
+ /** The order's full advertised size, not just the part this fill takes. */
1749
+ advertisedSize: bigint;
1750
+ /** The order's own price, quote per 1 base, before the protocol fee: what this fill settles at. */
1751
+ orderRate: bigint;
1752
+ /** The tokenIn this fill takes, in whole raw units on the source chain. */
1753
+ amountIn: bigint;
1754
+ /** The tokenOut this fill delivers, after the protocol fee, floored to a whole raw unit on the destination chain. */
1755
+ amountOut: bigint;
1756
+ }
1757
+ /**
1758
+ * An optimistic quote for an input amount on a route: the trade split across the route's orders,
1759
+ * best price first, each at its own price. There is no one rate and no total output; the fills are
1760
+ * the quote. Amounts and rates at 1e18.
1761
+ */
1745
1762
  interface OrderbookSwapQuote {
1746
1763
  route: OrderbookRouteKind;
1747
1764
  side: OrderbookSide;
1748
1765
  /** The tokenIn priced, floored to a whole raw unit on the source chain. */
1749
1766
  amountIn: bigint;
1750
- /** The tokenOut delivered, floored to a whole raw unit on the destination chain; 0 when not fillable. */
1767
+ /** The destination chain's protocol fee in basis points, already taken off every fill's `amountOut`. */
1768
+ slippageBps: number;
1769
+ fillable: boolean;
1770
+ /** The largest tokenIn amount the route's orders could take together, each at its own price. */
1771
+ maxFillableIn: bigint;
1772
+ /** The orders used, best price first; empty when not fillable. */
1773
+ fills: OrderbookQuoteFill[];
1774
+ }
1775
+ /**
1776
+ * A pessimistic quote for an input amount on a route: one price, from the first level, best first,
1777
+ * deep enough to fill the whole trade by itself, or else the route's worst price when its levels
1778
+ * together can. Amounts and rates at 1e18.
1779
+ */
1780
+ interface OrderbookLevelQuote {
1781
+ route: OrderbookRouteKind;
1782
+ side: OrderbookSide;
1783
+ /** The tokenIn priced, floored to a whole raw unit on the source chain. */
1784
+ amountIn: bigint;
1785
+ /** The tokenOut delivered at `rate`, after the protocol fee, floored to a whole raw unit on the destination chain; 0 when not fillable. */
1751
1786
  amountOut: bigint;
1752
- /** The clearing price, quote per 1 base; null when the route cannot fill the amount. */
1787
+ /** The worst single-order price in the level that fills it, quote per 1 base, before the protocol fee; null when not fillable. */
1753
1788
  rate: bigint | null;
1789
+ /** The price bucket of that level; null when not fillable. */
1790
+ priceBucket: bigint | null;
1791
+ /** The destination chain's protocol fee in basis points, already taken off `amountOut`. */
1792
+ slippageBps: number;
1754
1793
  fillable: boolean;
1755
- /** The tokenIn the route can absorb at `rate` or better. */
1756
- depth: bigint;
1757
- /** The largest tokenIn amount the route could fill. */
1794
+ /** The largest tokenIn amount this quote could fill: any one level at its worst price, or the whole route at its worst. */
1758
1795
  maxFillableIn: bigint;
1759
- /** The orders used, best first. */
1760
- fills: {
1761
- orderRate: bigint;
1762
- amountOut: bigint;
1763
- advertisedSize: bigint;
1764
- }[];
1765
1796
  }
1766
1797
  /** The best bid and ask a route can reach, with the book that orients them. */
1767
1798
  interface OrderbookTopOfBook {
@@ -1778,8 +1809,9 @@ declare class OrderbookRequestError extends Error {
1778
1809
  /** Every document the client sends, so they can be checked against the orderbook's published schema. */
1779
1810
  declare const ORDERBOOK_QUERIES: {
1780
1811
  readonly topOfBook: "\nquery TopOfBook($tokenA: String!, $tokenB: String!, $fillChain: String!, $sourceChain: String!) {\n books { id base quote }\n aToB: bestRate(tokenIn: $tokenA, tokenOut: $tokenB, fillChain: $fillChain, sourceChain: $sourceChain) { side fillChain rate depthIn depthOut backingLiquidity sourceChains orderCount solverCount }\n bToA: bestRate(tokenIn: $tokenB, tokenOut: $tokenA, fillChain: $fillChain, sourceChain: $sourceChain) { side fillChain rate depthIn depthOut backingLiquidity sourceChains orderCount solverCount }\n}";
1781
- readonly routeLiquidity: "\nquery RouteLiquidity($route: RouteInput!) {\n books { id base quote }\n routeLiquidity(route: $route) {\n route bestRate depthIn depthOut availableLiquidity maxFillableIn orderCount solverCount\n }\n}";
1782
- readonly quote: "\nquery Quote($route: RouteInput!, $amountIn: BigInt!) {\n quote(route: $route, amountIn: $amountIn) {\n route side amountIn amountOut rate fillable depth maxFillableIn\n fills { orderRate amountOut advertisedSize }\n }\n}";
1812
+ readonly routeLiquidity: "\nquery RouteLiquidity($route: RouteInput!) {\n books { id base quote }\n routeLiquidity(route: $route) {\n route bestRate slippageBps depthIn depthOut availableLiquidity maxFillableIn orderCount solverCount\n }\n}";
1813
+ readonly quote: "\nquery Quote($route: RouteInput!, $amountIn: BigInt!) {\n quote(route: $route, amountIn: $amountIn) {\n route side amountIn slippageBps fillable maxFillableIn\n fills { advertisedSize orderRate amountIn amountOut }\n }\n}";
1814
+ readonly quotePessimistic: "\nquery QuotePessimistic($route: RouteInput!, $amountIn: BigInt!) {\n quotePessimistic(route: $route, amountIn: $amountIn) {\n route side amountIn amountOut rate priceBucket slippageBps fillable maxFillableIn\n }\n}";
1783
1815
  };
1784
1816
  /**
1785
1817
  * Read-only client for the HyperFX orderbook's GraphQL API.
@@ -1804,12 +1836,20 @@ declare class HyperFxOrderbook {
1804
1836
  }): Promise<OrderbookTopOfBook>;
1805
1837
  /** Total liquidity on a route, no amount required. */
1806
1838
  routeLiquidity(route: OrderbookRoute): Promise<OrderbookRouteLiquidity>;
1807
- /** The clearing price for `amountIn` (1e18 tokenIn) on a route, which may combine several solvers' orders. */
1839
+ /**
1840
+ * The optimistic quote for `amountIn` (1e18 tokenIn) on a route: the route's orders, best price
1841
+ * first, each taking what it can at its own price. The fills' `amountOut`s sum to the output.
1842
+ */
1808
1843
  quote(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookSwapQuote>;
1844
+ /**
1845
+ * The pessimistic quote for `amountIn` (1e18 tokenIn) on a route: one price, from the first level
1846
+ * deep enough to fill the whole trade by itself, at which every order in it fills; the route's
1847
+ * worst price when no one level can but its levels together can.
1848
+ */
1849
+ quotePessimistic(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookLevelQuote>;
1809
1850
  private request;
1810
1851
  }
1811
1852
 
1812
- type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
1813
1853
  /**
1814
1854
  * Parameters for `IntentGateway.quoteIntent`. The source and destination chains
1815
1855
  * come from the gateway instance itself. `tokenIn` and `tokenOut` are token
@@ -1823,35 +1863,70 @@ interface QuoteIntentParams {
1823
1863
  tokenOut: HexString;
1824
1864
  amountIn?: bigint;
1825
1865
  amountOut?: bigint;
1866
+ /**
1867
+ * Return the orderbook's optimistic quote (`QuoteIntentResult`): one leg per
1868
+ * order, each at its own price. Defaults to the pessimistic quote
1869
+ * (`PessimisticQuoteIntentResult`): the whole trade at one price.
1870
+ */
1871
+ optimistic?: boolean;
1826
1872
  }
1827
- interface IntentQuoteMetadata {
1828
- sourceChain: Chains;
1829
- destinationChain: Chains;
1873
+ /**
1874
+ * One order an optimistic intent quote takes, at the order's own price. Amounts
1875
+ * are raw token units; the rate stays at 1e18.
1876
+ */
1877
+ interface IntentQuoteLeg {
1878
+ /** The order's full advertised size in `tokenOut`, not just the part this leg takes. */
1879
+ advertisedSize: bigint;
1880
+ /** The order's own price, quote per 1 base at 1e18, before the protocol fee: what this leg settles at. */
1881
+ orderRate: bigint;
1882
+ /** The `tokenIn` this leg takes. The legs' inputs sum to the quote's `amountIn`. */
1883
+ amountIn: bigint;
1884
+ /** The `tokenOut` this leg delivers, with the destination's protocol fee already taken off. */
1885
+ amountOut: bigint;
1886
+ }
1887
+ /**
1888
+ * `quoteIntent`'s result with `optimistic: true`, the orderbook's optimistic `quote`: the trade split across the
1889
+ * route's orders, best price first, each at its own price. There is no single
1890
+ * rate or total output; the legs are the quote, and their `amountOut`s sum to
1891
+ * what the order should require. Amounts are raw token units.
1892
+ */
1893
+ interface QuoteIntentResult {
1830
1894
  /** `SAME_CHAIN`, or `CROSS_CHAIN` when only orders accepting the source chain can fill it. */
1831
1895
  route: OrderbookRouteKind;
1832
1896
  /** `BID` when the order sells the book's base token, `ASK` when it buys it. */
1833
1897
  side: OrderbookSide;
1834
- baseTokenSymbol: ConfiguredAssetSymbol;
1835
- quoteTokenSymbol: ConfiguredAssetSymbol;
1836
- /** The clearing price the order was quoted at, in quote-token units per one base token. */
1837
- rate: string;
1838
- /** The largest `amountIn` the route can fill right now, in the source token's raw units. */
1898
+ /** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
1899
+ amountIn: bigint;
1900
+ /** The destination's protocol fee in basis points, already taken off every leg's `amountOut`. */
1901
+ slippageBps: number;
1902
+ fillable: boolean;
1903
+ /** The largest `amountIn` the route's orders could take together, each at its own price. */
1839
1904
  maxFillableIn: bigint;
1840
- /** How many orders the quote combines. */
1841
- orderCount: number;
1905
+ /** The orders used, best price first. */
1906
+ legs: IntentQuoteLeg[];
1842
1907
  }
1843
1908
  /**
1844
- * A quote priced from the HyperFX orderbook.
1845
- *
1846
- * `amountIn` and `amountOut` are raw token units and can be used directly as
1847
- * the order's `inputs` and `output.assets`. The orderbook's rates already carry
1848
- * the IntentGateway protocol fee, so no further fee adjustment is needed.
1909
+ * `quoteIntent`'s default result, the orderbook's `quotePessimistic`: the whole trade at one
1910
+ * price, the worst single-order price of the first level, best first, deep
1911
+ * enough to fill it by itself, or the route's worst price when no one level
1912
+ * can. Amounts are raw token units; rates stay at 1e18.
1849
1913
  */
1850
- interface QuoteIntentResult {
1851
- tradeType: IntentQuoteTradeType;
1914
+ interface PessimisticQuoteIntentResult {
1915
+ route: OrderbookRouteKind;
1916
+ side: OrderbookSide;
1917
+ /** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
1852
1918
  amountIn: bigint;
1919
+ /** The `tokenOut` delivered at `rate`, with the destination's protocol fee already taken off. */
1853
1920
  amountOut: bigint;
1854
- quoteMetadata: IntentQuoteMetadata;
1921
+ /** Quote per 1 base, before the protocol fee: every order in the level fills at it. */
1922
+ rate: bigint | null;
1923
+ /** The price bucket of that level. */
1924
+ priceBucket: bigint | null;
1925
+ /** The destination's protocol fee in basis points, already taken off `amountOut`. */
1926
+ slippageBps: number;
1927
+ fillable: boolean;
1928
+ /** The largest `amountIn` this quote could fill: any one level at its worst price, or the whole route at its worst. */
1929
+ maxFillableIn: bigint;
1855
1930
  }
1856
1931
  /**
1857
1932
  * What the orderbook holds for one route, with no amount given. Amounts are
@@ -2046,20 +2121,31 @@ declare class IntentGateway {
2046
2121
  /**
2047
2122
  * Quotes an intent between this gateway's source and destination chains from
2048
2123
  * the HyperFX orderbook. Provide exactly one of `amountIn` or `amountOut`, in
2049
- * raw token units.
2124
+ * raw token units. The result has the orderbook's shape, in raw token units.
2050
2125
  *
2051
- * An exact-input quote is the orderbook's clearing price for `amountIn`,
2052
- * which may combine several solvers' orders. An exact-output quote finds the
2053
- * smallest input whose clearing price delivers `amountOut`. A cross-chain
2054
- * route only counts orders whose solvers accept the source chain.
2126
+ * By default the quote is pessimistic (`PessimisticQuoteIntentResult`): the
2127
+ * whole trade at one price, the worst single-order price of the first level,
2128
+ * best first, deep enough to fill it by itself, or the route's worst price
2129
+ * when no one level can. With `optimistic: true` it is the orderbook's
2130
+ * optimistic quote (`QuoteIntentResult`): the route's orders, best price
2131
+ * first, each filling what it can of the trade at its own price, one leg per
2132
+ * order. There is no total output; the legs' `amountOut`s sum to it.
2055
2133
  *
2056
- * The orderbook's rates already carry the gateway protocol fee, so the
2057
- * returned amounts can be placed as the order's inputs and outputs directly.
2134
+ * Every `amountOut` already has the destination's protocol fee taken off. For
2135
+ * an exact output, the quote is for an input that delivers `amountOut`. A
2136
+ * cross-chain route only counts orders whose solvers accept the source chain.
2058
2137
  *
2059
2138
  * @throws {InsufficientOrderbookLiquidityError} When the route cannot fill the amount.
2139
+ * @throws {OrderbookQuoteNotConvergedError} When an exact-output quote does not settle on an input.
2060
2140
  * @throws {OrderbookRequestError} When the orderbook is unreachable or trades no book for the pair.
2061
2141
  */
2062
- quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
2142
+ quoteIntent(params: QuoteIntentParams & {
2143
+ optimistic: true;
2144
+ }): Promise<QuoteIntentResult>;
2145
+ quoteIntent(params: QuoteIntentParams & {
2146
+ optimistic?: false;
2147
+ }): Promise<PessimisticQuoteIntentResult>;
2148
+ quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult | PessimisticQuoteIntentResult>;
2063
2149
  /**
2064
2150
  * Returns the orderbook liquidity serving a swap of `tokenIn` on the source
2065
2151
  * chain for `tokenOut` on the destination chain: the best rate, true and
@@ -6370,4 +6456,4 @@ declare function teleport(teleport_param: {
6370
6456
  extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
6371
6457
  }): Promise<ReadableStream<HyperbridgeTxEvents>>;
6372
6458
 
6373
- export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, InsufficientOrderbookLiquidityError, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteMetadata, type IntentQuoteTradeType, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
6459
+ export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, InsufficientOrderbookLiquidityError, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
@@ -1729,8 +1729,10 @@ interface OrderbookRouteLiquidity {
1729
1729
  book: OrderbookBook;
1730
1730
  /** `BID` when tokenIn is the book's base, `ASK` when it is the quote. */
1731
1731
  side: OrderbookSide;
1732
- /** Quote per 1 base; null when no order serves the route. */
1732
+ /** Quote per 1 base, before the protocol fee; null when no order serves the route. */
1733
1733
  bestRate: bigint | null;
1734
+ /** The destination chain's protocol fee in basis points, which the gateway takes out of what the orders deliver. */
1735
+ slippageBps: number;
1734
1736
  /** Virtual depth: the serving orders' sizes summed, in tokenIn and tokenOut. */
1735
1737
  depthIn: bigint;
1736
1738
  depthOut: bigint;
@@ -1741,27 +1743,56 @@ interface OrderbookRouteLiquidity {
1741
1743
  orderCount: number;
1742
1744
  solverCount: number;
1743
1745
  }
1744
- /** A quote for an input amount on a route. Amounts and rates at 1e18. */
1746
+ /** One order an optimistic quote takes, at the order's own price. Amounts and rates at 1e18. */
1747
+ interface OrderbookQuoteFill {
1748
+ /** The order's full advertised size, not just the part this fill takes. */
1749
+ advertisedSize: bigint;
1750
+ /** The order's own price, quote per 1 base, before the protocol fee: what this fill settles at. */
1751
+ orderRate: bigint;
1752
+ /** The tokenIn this fill takes, in whole raw units on the source chain. */
1753
+ amountIn: bigint;
1754
+ /** The tokenOut this fill delivers, after the protocol fee, floored to a whole raw unit on the destination chain. */
1755
+ amountOut: bigint;
1756
+ }
1757
+ /**
1758
+ * An optimistic quote for an input amount on a route: the trade split across the route's orders,
1759
+ * best price first, each at its own price. There is no one rate and no total output; the fills are
1760
+ * the quote. Amounts and rates at 1e18.
1761
+ */
1745
1762
  interface OrderbookSwapQuote {
1746
1763
  route: OrderbookRouteKind;
1747
1764
  side: OrderbookSide;
1748
1765
  /** The tokenIn priced, floored to a whole raw unit on the source chain. */
1749
1766
  amountIn: bigint;
1750
- /** The tokenOut delivered, floored to a whole raw unit on the destination chain; 0 when not fillable. */
1767
+ /** The destination chain's protocol fee in basis points, already taken off every fill's `amountOut`. */
1768
+ slippageBps: number;
1769
+ fillable: boolean;
1770
+ /** The largest tokenIn amount the route's orders could take together, each at its own price. */
1771
+ maxFillableIn: bigint;
1772
+ /** The orders used, best price first; empty when not fillable. */
1773
+ fills: OrderbookQuoteFill[];
1774
+ }
1775
+ /**
1776
+ * A pessimistic quote for an input amount on a route: one price, from the first level, best first,
1777
+ * deep enough to fill the whole trade by itself, or else the route's worst price when its levels
1778
+ * together can. Amounts and rates at 1e18.
1779
+ */
1780
+ interface OrderbookLevelQuote {
1781
+ route: OrderbookRouteKind;
1782
+ side: OrderbookSide;
1783
+ /** The tokenIn priced, floored to a whole raw unit on the source chain. */
1784
+ amountIn: bigint;
1785
+ /** The tokenOut delivered at `rate`, after the protocol fee, floored to a whole raw unit on the destination chain; 0 when not fillable. */
1751
1786
  amountOut: bigint;
1752
- /** The clearing price, quote per 1 base; null when the route cannot fill the amount. */
1787
+ /** The worst single-order price in the level that fills it, quote per 1 base, before the protocol fee; null when not fillable. */
1753
1788
  rate: bigint | null;
1789
+ /** The price bucket of that level; null when not fillable. */
1790
+ priceBucket: bigint | null;
1791
+ /** The destination chain's protocol fee in basis points, already taken off `amountOut`. */
1792
+ slippageBps: number;
1754
1793
  fillable: boolean;
1755
- /** The tokenIn the route can absorb at `rate` or better. */
1756
- depth: bigint;
1757
- /** The largest tokenIn amount the route could fill. */
1794
+ /** The largest tokenIn amount this quote could fill: any one level at its worst price, or the whole route at its worst. */
1758
1795
  maxFillableIn: bigint;
1759
- /** The orders used, best first. */
1760
- fills: {
1761
- orderRate: bigint;
1762
- amountOut: bigint;
1763
- advertisedSize: bigint;
1764
- }[];
1765
1796
  }
1766
1797
  /** The best bid and ask a route can reach, with the book that orients them. */
1767
1798
  interface OrderbookTopOfBook {
@@ -1778,8 +1809,9 @@ declare class OrderbookRequestError extends Error {
1778
1809
  /** Every document the client sends, so they can be checked against the orderbook's published schema. */
1779
1810
  declare const ORDERBOOK_QUERIES: {
1780
1811
  readonly topOfBook: "\nquery TopOfBook($tokenA: String!, $tokenB: String!, $fillChain: String!, $sourceChain: String!) {\n books { id base quote }\n aToB: bestRate(tokenIn: $tokenA, tokenOut: $tokenB, fillChain: $fillChain, sourceChain: $sourceChain) { side fillChain rate depthIn depthOut backingLiquidity sourceChains orderCount solverCount }\n bToA: bestRate(tokenIn: $tokenB, tokenOut: $tokenA, fillChain: $fillChain, sourceChain: $sourceChain) { side fillChain rate depthIn depthOut backingLiquidity sourceChains orderCount solverCount }\n}";
1781
- readonly routeLiquidity: "\nquery RouteLiquidity($route: RouteInput!) {\n books { id base quote }\n routeLiquidity(route: $route) {\n route bestRate depthIn depthOut availableLiquidity maxFillableIn orderCount solverCount\n }\n}";
1782
- readonly quote: "\nquery Quote($route: RouteInput!, $amountIn: BigInt!) {\n quote(route: $route, amountIn: $amountIn) {\n route side amountIn amountOut rate fillable depth maxFillableIn\n fills { orderRate amountOut advertisedSize }\n }\n}";
1812
+ readonly routeLiquidity: "\nquery RouteLiquidity($route: RouteInput!) {\n books { id base quote }\n routeLiquidity(route: $route) {\n route bestRate slippageBps depthIn depthOut availableLiquidity maxFillableIn orderCount solverCount\n }\n}";
1813
+ readonly quote: "\nquery Quote($route: RouteInput!, $amountIn: BigInt!) {\n quote(route: $route, amountIn: $amountIn) {\n route side amountIn slippageBps fillable maxFillableIn\n fills { advertisedSize orderRate amountIn amountOut }\n }\n}";
1814
+ readonly quotePessimistic: "\nquery QuotePessimistic($route: RouteInput!, $amountIn: BigInt!) {\n quotePessimistic(route: $route, amountIn: $amountIn) {\n route side amountIn amountOut rate priceBucket slippageBps fillable maxFillableIn\n }\n}";
1783
1815
  };
1784
1816
  /**
1785
1817
  * Read-only client for the HyperFX orderbook's GraphQL API.
@@ -1804,12 +1836,20 @@ declare class HyperFxOrderbook {
1804
1836
  }): Promise<OrderbookTopOfBook>;
1805
1837
  /** Total liquidity on a route, no amount required. */
1806
1838
  routeLiquidity(route: OrderbookRoute): Promise<OrderbookRouteLiquidity>;
1807
- /** The clearing price for `amountIn` (1e18 tokenIn) on a route, which may combine several solvers' orders. */
1839
+ /**
1840
+ * The optimistic quote for `amountIn` (1e18 tokenIn) on a route: the route's orders, best price
1841
+ * first, each taking what it can at its own price. The fills' `amountOut`s sum to the output.
1842
+ */
1808
1843
  quote(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookSwapQuote>;
1844
+ /**
1845
+ * The pessimistic quote for `amountIn` (1e18 tokenIn) on a route: one price, from the first level
1846
+ * deep enough to fill the whole trade by itself, at which every order in it fills; the route's
1847
+ * worst price when no one level can but its levels together can.
1848
+ */
1849
+ quotePessimistic(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookLevelQuote>;
1809
1850
  private request;
1810
1851
  }
1811
1852
 
1812
- type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
1813
1853
  /**
1814
1854
  * Parameters for `IntentGateway.quoteIntent`. The source and destination chains
1815
1855
  * come from the gateway instance itself. `tokenIn` and `tokenOut` are token
@@ -1823,35 +1863,70 @@ interface QuoteIntentParams {
1823
1863
  tokenOut: HexString;
1824
1864
  amountIn?: bigint;
1825
1865
  amountOut?: bigint;
1866
+ /**
1867
+ * Return the orderbook's optimistic quote (`QuoteIntentResult`): one leg per
1868
+ * order, each at its own price. Defaults to the pessimistic quote
1869
+ * (`PessimisticQuoteIntentResult`): the whole trade at one price.
1870
+ */
1871
+ optimistic?: boolean;
1826
1872
  }
1827
- interface IntentQuoteMetadata {
1828
- sourceChain: Chains;
1829
- destinationChain: Chains;
1873
+ /**
1874
+ * One order an optimistic intent quote takes, at the order's own price. Amounts
1875
+ * are raw token units; the rate stays at 1e18.
1876
+ */
1877
+ interface IntentQuoteLeg {
1878
+ /** The order's full advertised size in `tokenOut`, not just the part this leg takes. */
1879
+ advertisedSize: bigint;
1880
+ /** The order's own price, quote per 1 base at 1e18, before the protocol fee: what this leg settles at. */
1881
+ orderRate: bigint;
1882
+ /** The `tokenIn` this leg takes. The legs' inputs sum to the quote's `amountIn`. */
1883
+ amountIn: bigint;
1884
+ /** The `tokenOut` this leg delivers, with the destination's protocol fee already taken off. */
1885
+ amountOut: bigint;
1886
+ }
1887
+ /**
1888
+ * `quoteIntent`'s result with `optimistic: true`, the orderbook's optimistic `quote`: the trade split across the
1889
+ * route's orders, best price first, each at its own price. There is no single
1890
+ * rate or total output; the legs are the quote, and their `amountOut`s sum to
1891
+ * what the order should require. Amounts are raw token units.
1892
+ */
1893
+ interface QuoteIntentResult {
1830
1894
  /** `SAME_CHAIN`, or `CROSS_CHAIN` when only orders accepting the source chain can fill it. */
1831
1895
  route: OrderbookRouteKind;
1832
1896
  /** `BID` when the order sells the book's base token, `ASK` when it buys it. */
1833
1897
  side: OrderbookSide;
1834
- baseTokenSymbol: ConfiguredAssetSymbol;
1835
- quoteTokenSymbol: ConfiguredAssetSymbol;
1836
- /** The clearing price the order was quoted at, in quote-token units per one base token. */
1837
- rate: string;
1838
- /** The largest `amountIn` the route can fill right now, in the source token's raw units. */
1898
+ /** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
1899
+ amountIn: bigint;
1900
+ /** The destination's protocol fee in basis points, already taken off every leg's `amountOut`. */
1901
+ slippageBps: number;
1902
+ fillable: boolean;
1903
+ /** The largest `amountIn` the route's orders could take together, each at its own price. */
1839
1904
  maxFillableIn: bigint;
1840
- /** How many orders the quote combines. */
1841
- orderCount: number;
1905
+ /** The orders used, best price first. */
1906
+ legs: IntentQuoteLeg[];
1842
1907
  }
1843
1908
  /**
1844
- * A quote priced from the HyperFX orderbook.
1845
- *
1846
- * `amountIn` and `amountOut` are raw token units and can be used directly as
1847
- * the order's `inputs` and `output.assets`. The orderbook's rates already carry
1848
- * the IntentGateway protocol fee, so no further fee adjustment is needed.
1909
+ * `quoteIntent`'s default result, the orderbook's `quotePessimistic`: the whole trade at one
1910
+ * price, the worst single-order price of the first level, best first, deep
1911
+ * enough to fill it by itself, or the route's worst price when no one level
1912
+ * can. Amounts are raw token units; rates stay at 1e18.
1849
1913
  */
1850
- interface QuoteIntentResult {
1851
- tradeType: IntentQuoteTradeType;
1914
+ interface PessimisticQuoteIntentResult {
1915
+ route: OrderbookRouteKind;
1916
+ side: OrderbookSide;
1917
+ /** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
1852
1918
  amountIn: bigint;
1919
+ /** The `tokenOut` delivered at `rate`, with the destination's protocol fee already taken off. */
1853
1920
  amountOut: bigint;
1854
- quoteMetadata: IntentQuoteMetadata;
1921
+ /** Quote per 1 base, before the protocol fee: every order in the level fills at it. */
1922
+ rate: bigint | null;
1923
+ /** The price bucket of that level. */
1924
+ priceBucket: bigint | null;
1925
+ /** The destination's protocol fee in basis points, already taken off `amountOut`. */
1926
+ slippageBps: number;
1927
+ fillable: boolean;
1928
+ /** The largest `amountIn` this quote could fill: any one level at its worst price, or the whole route at its worst. */
1929
+ maxFillableIn: bigint;
1855
1930
  }
1856
1931
  /**
1857
1932
  * What the orderbook holds for one route, with no amount given. Amounts are
@@ -2046,20 +2121,31 @@ declare class IntentGateway {
2046
2121
  /**
2047
2122
  * Quotes an intent between this gateway's source and destination chains from
2048
2123
  * the HyperFX orderbook. Provide exactly one of `amountIn` or `amountOut`, in
2049
- * raw token units.
2124
+ * raw token units. The result has the orderbook's shape, in raw token units.
2050
2125
  *
2051
- * An exact-input quote is the orderbook's clearing price for `amountIn`,
2052
- * which may combine several solvers' orders. An exact-output quote finds the
2053
- * smallest input whose clearing price delivers `amountOut`. A cross-chain
2054
- * route only counts orders whose solvers accept the source chain.
2126
+ * By default the quote is pessimistic (`PessimisticQuoteIntentResult`): the
2127
+ * whole trade at one price, the worst single-order price of the first level,
2128
+ * best first, deep enough to fill it by itself, or the route's worst price
2129
+ * when no one level can. With `optimistic: true` it is the orderbook's
2130
+ * optimistic quote (`QuoteIntentResult`): the route's orders, best price
2131
+ * first, each filling what it can of the trade at its own price, one leg per
2132
+ * order. There is no total output; the legs' `amountOut`s sum to it.
2055
2133
  *
2056
- * The orderbook's rates already carry the gateway protocol fee, so the
2057
- * returned amounts can be placed as the order's inputs and outputs directly.
2134
+ * Every `amountOut` already has the destination's protocol fee taken off. For
2135
+ * an exact output, the quote is for an input that delivers `amountOut`. A
2136
+ * cross-chain route only counts orders whose solvers accept the source chain.
2058
2137
  *
2059
2138
  * @throws {InsufficientOrderbookLiquidityError} When the route cannot fill the amount.
2139
+ * @throws {OrderbookQuoteNotConvergedError} When an exact-output quote does not settle on an input.
2060
2140
  * @throws {OrderbookRequestError} When the orderbook is unreachable or trades no book for the pair.
2061
2141
  */
2062
- quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
2142
+ quoteIntent(params: QuoteIntentParams & {
2143
+ optimistic: true;
2144
+ }): Promise<QuoteIntentResult>;
2145
+ quoteIntent(params: QuoteIntentParams & {
2146
+ optimistic?: false;
2147
+ }): Promise<PessimisticQuoteIntentResult>;
2148
+ quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult | PessimisticQuoteIntentResult>;
2063
2149
  /**
2064
2150
  * Returns the orderbook liquidity serving a swap of `tokenIn` on the source
2065
2151
  * chain for `tokenOut` on the destination chain: the best rate, true and
@@ -6370,4 +6456,4 @@ declare function teleport(teleport_param: {
6370
6456
  extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
6371
6457
  }): Promise<ReadableStream<HyperbridgeTxEvents>>;
6372
6458
 
6373
- export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, InsufficientOrderbookLiquidityError, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteMetadata, type IntentQuoteTradeType, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
6459
+ export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, InsufficientOrderbookLiquidityError, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };