@hyperbridge/sdk 2.8.13 → 2.8.16

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,12 +1,11 @@
1
- import { ConsolaInstance } from 'consola';
2
1
  import Decimal from 'decimal.js';
3
2
  import { GraphQLClient } from 'graphql-request';
4
3
  import * as viem from 'viem';
5
4
  import { PublicClient, TransactionReceipt, Hex, Log, ContractFunctionArgs, Chain as Chain$1, Address } from 'viem';
6
5
  import { Chain } from 'viem/chains';
6
+ import { ConsolaInstance } from 'consola';
7
7
  import { ApiPromise } from '@polkadot/api';
8
8
  import { KeyringPair } from '@polkadot/keyring/types';
9
- import { RuntimeVersion } from '@polkadot/types/interfaces';
10
9
  import * as unstorage from 'unstorage';
11
10
  import { SignerOptions, SubmittableExtrinsic } from '@polkadot/api/types';
12
11
  import { ISubmittableResult } from '@polkadot/types/types';
@@ -895,12 +894,6 @@ declare const tronChainIds: Set<number>;
895
894
  type ConfiguredAssetSymbol = "WETH" | "DAI" | "USDC" | "USDT" | "cNGN" | "EXT" | "ZARP" | "EURC" | "XSGD" | "TRYB" | "USDR";
896
895
  /** A configured asset symbol in its canonical, lowercase, or uppercase form. */
897
896
  type ConfiguredAssetSymbolInput = ConfiguredAssetSymbol | Lowercase<ConfiguredAssetSymbol> | Uppercase<ConfiguredAssetSymbol>;
898
- interface UniswapV4PoolConfigData {
899
- tokens: readonly [ConfiguredAssetSymbol, ConfiguredAssetSymbol];
900
- fee: number;
901
- tickSpacing: number;
902
- hooks?: `0x${string}`;
903
- }
904
897
  /** A known ERC-4626 vault fillers can use as a stablecoin treasury. */
905
898
  interface Erc4626VaultConfigData {
906
899
  /** Display label, e.g. "Aave stataUSDC" */
@@ -1016,7 +1009,6 @@ interface ChainConfigData {
1016
1009
  consensusStateId: string;
1017
1010
  coingeckoId: string;
1018
1011
  popularTokens?: string[];
1019
- uniswapV4Pools?: UniswapV4PoolConfigData[];
1020
1012
  /** Known ERC-4626 treasury vaults on this chain */
1021
1013
  erc4626Vaults?: Erc4626VaultConfigData[];
1022
1014
  /** LayerZero Endpoint ID for cross-chain messaging */
@@ -1095,7 +1087,6 @@ declare class ChainConfigService {
1095
1087
  getUniswapV4PositionManagerAddress(chain: string): HexString$1;
1096
1088
  getUniswapV4PoolManagerAddress(chain: string): HexString$1;
1097
1089
  getUniswapV4StateViewAddress(chain: string): HexString$1;
1098
- getUniswapV4PoolConfigs(chain: string): UniswapV4PoolConfigData[];
1099
1090
  getPermit2Address(chain: string): HexString$1;
1100
1091
  getSolverAccountAddress(chain: string): HexString$1 | undefined;
1101
1092
  getCoingeckoId(chain: string): string | undefined;
@@ -1940,9 +1931,9 @@ declare const INCLUSION_TIMEOUT_MS = 20000;
1940
1931
  * `ws(s)://` url rather than guessing at an endpoint.
1941
1932
  *
1942
1933
  * The HTTP endpoint is always derived, never configured, because it must be the *same node* as the
1943
- * websocket: phantom orders are read out of that node's offchain worker storage, which is
1944
- * node-local and not replicated, so a separately configured host would return nothing for orders
1945
- * the events said exist.
1934
+ * websocket: bids are read out of that node's offchain worker storage, which is node-local and
1935
+ * not replicated, so a separately configured host would return nothing for bids its storage said
1936
+ * exist.
1946
1937
  */
1947
1938
  declare function deriveHttpUrl(wsUrl: string): string;
1948
1939
  /**
@@ -1960,91 +1951,6 @@ declare function encodeUserOpScale(userOp: PackedUserOperation): HexString$1;
1960
1951
  * @returns The decoded PackedUserOperation
1961
1952
  */
1962
1953
  declare function decodeUserOpScale(hex: HexString$1): PackedUserOperation;
1963
- /** One directed leg of a phantom order: `standardAmount` of `tokenA` quoted in `tokenB`. */
1964
- interface PhantomOrderLeg {
1965
- tokenA: HexString$1;
1966
- tokenB: HexString$1;
1967
- standardAmount: bigint;
1968
- }
1969
- interface PhantomOrderEvent {
1970
- commitment: HexString$1;
1971
- chain: string;
1972
- createdAt: number;
1973
- /**
1974
- * Every configured pair expands into its configured direction plus the reverse. Listed in
1975
- * the same order as the order's asset lists, so index `i` here is the order's leg `i`.
1976
- */
1977
- legs: PhantomOrderLeg[];
1978
- }
1979
- /** The pallet's phantom order timings, as the chain currently has them. */
1980
- interface PhantomTimings {
1981
- /**
1982
- * Blocks after registration during which the pallet accepts a bid: the `PhantomBidWindow`
1983
- * storage value, or the `PhantomOrderBidWindowBlocks` runtime constant when that value is zero,
1984
- * which is the same fallback the pallet's own `phantom_bid_window()` applies.
1985
- */
1986
- bidWindowBlocks: number;
1987
- /**
1988
- * Blocks between generations (`PhantomOrderInterval`). Zero is meaningful rather than unset —
1989
- * the pallet generates once and never regenerates — so there is no constant to fall back to.
1990
- */
1991
- intervalBlocks: number;
1992
- }
1993
- /** One phantom bid to place, and the bid it replaces on the same chain. */
1994
- interface PhantomBid {
1995
- /** The phantom order commitment being bid on. */
1996
- commitment: HexString$1;
1997
- /** The SCALE-encoded PackedUserOperation backing the quote. */
1998
- userOp: HexString$1;
1999
- /**
2000
- * A live bid from a previous interval on the same chain, retracted alongside this one to
2001
- * reclaim its deposit. Best-effort: a retraction that fails never affects the bid.
2002
- */
2003
- retractCommitment?: HexString$1;
2004
- }
2005
- /** What became of one bid in a batch. */
2006
- interface PhantomBidOutcome {
2007
- commitment: HexString$1;
2008
- success: boolean;
2009
- /** The dispatch error that rejected this bid, when it failed. */
2010
- error?: string;
2011
- }
2012
- interface PhantomBidBatchResult {
2013
- /** One entry per submitted bid, in the order they were given. */
2014
- bids: PhantomBidOutcome[];
2015
- /** The block and extrinsic the bids landed in. */
2016
- blockHash?: HexString$1;
2017
- extrinsicHash?: HexString$1;
2018
- /**
2019
- * The batch reached the pool but its inclusion was not observed, so no per-bid outcome is
2020
- * known. Same contract as {@link BidSubmissionResult.pending}: in flight, do not re-sign.
2021
- */
2022
- pending?: boolean;
2023
- /** Set when the batch never landed at all, or when its item events could not be attributed. */
2024
- error?: string;
2025
- }
2026
- interface PollPhantomOrdersOptions {
2027
- /** How often to check for a new head. Defaults to 15s, or 6s when the runtime is Gargantua. */
2028
- intervalMs?: number;
2029
- /**
2030
- * Most blocks scanned in a single poll, so a long outage catches up over several ticks instead of
2031
- * one burst. Defaults to 10 — several times the rate the chain produces blocks, so recovery is
2032
- * still quick, but small enough to bound both the work one `state_queryStorage` call asks of the
2033
- * node and the requests the per-block fallback queues ahead of a bid submission.
2034
- */
2035
- maxBlocksPerPoll?: number;
2036
- /** Notified when a poll fails; polling continues regardless. */
2037
- onError?: (err: unknown) => void;
2038
- /**
2039
- * Notified when the cursor was forced forward past a backlog too old to bid on, with the range
2040
- * that was never scanned. Nothing else reports it, and skipping blocks is worth a line in the log.
2041
- */
2042
- onSkip?: (skipped: {
2043
- from: number;
2044
- to: number;
2045
- head: number;
2046
- }) => void;
2047
- }
2048
1954
  /**
2049
1955
  * Service for interacting with Hyperbridge's pallet-intents coprocessor.
2050
1956
  * Handles bid submission and retrieval for the IntentGatewayV2 protocol.
@@ -2057,15 +1963,11 @@ declare class IntentsCoprocessor {
2057
1963
  private ownsConnection;
2058
1964
  /** Cached result of whether the node exposes intents_* RPC methods */
2059
1965
  private hasIntentsRpc;
2060
- /** The pallet's phantom timings, read once. Cleared on failure so the read retries. */
2061
- private phantomTimingsRead;
2062
1966
  /** The HTTP-backed api, connected on first use. Cleared after a failed attempt so it retries. */
2063
1967
  private httpApi;
2064
- /** Last runtime version read from the node, for {@link confirmedRuntimeVersion} to compare against. */
2065
- private lastRuntimeVersion;
2066
- /** Set once the node refuses `state_queryStorage`, so the poll stops asking for it. */
2067
- private rangeQueryUnavailable;
2068
1968
  private submissionQueue;
1969
+ /** The highest nonce this instance has put into the pool, so the next submission clears it. */
1970
+ private lastPooledNonce;
2069
1971
  /**
2070
1972
  * Creates and connects an IntentsCoprocessor to a Hyperbridge node.
2071
1973
  * This creates and manages its own API connection.
@@ -2118,9 +2020,8 @@ declare class IntentsCoprocessor {
2118
2020
  *
2119
2021
  * The connection attempt is bounded on both sides. `isReadyOrError` rejects on a failed
2120
2022
  * handshake, where plain `isReady` would simply never resolve, and the timeout covers an
2121
- * endpoint that accepts the request and then goes quiet. An unbounded wait here would hang the
2122
- * poll tick awaiting it, which is precisely the silent stall that polling exists to avoid. A
2123
- * failed attempt is not cached, so the next call tries again.
2023
+ * endpoint that accepts the request and then goes quiet, so a caller awaiting it never hangs
2024
+ * silently. A failed attempt is not cached, so the next call tries again.
2124
2025
  */
2125
2026
  private http;
2126
2027
  /**
@@ -2168,7 +2069,7 @@ declare class IntentsCoprocessor {
2168
2069
  * Two kinds of failure are retried, and the difference is the nonce.
2169
2070
  *
2170
2071
  * An attempt that verifiably went nowhere (rejected before the pool, dropped, invalid) leaves
2171
- * the account nonce free, so the next attempt simply re-signs with the auto-nonce.
2072
+ * the account nonce free, so the next attempt simply re-signs with the pool-aware nonce.
2172
2073
  *
2173
2074
  * An attempt that reached the pool and was still there when the watch timed out (`stalled`) is
2174
2075
  * retried as a *replacement*: the same nonce it was signed with, and double the tip. Substrate's
@@ -2214,77 +2115,49 @@ declare class IntentsCoprocessor {
2214
2115
  * replacement rather than a second extrinsic queued behind the first. Left undefined on the
2215
2116
  * first attempt, where the api's auto-nonce is correct.
2216
2117
  */
2118
+ /**
2119
+ * The nonce the next submission signs with, or undefined when the node cannot be asked.
2120
+ *
2121
+ * Submissions are serialised, but a watch gives up while its extrinsic is still in the pool
2122
+ * (`stalled`, reported as `pending`), and a pooled extrinsic does not advance the account's
2123
+ * on-chain nonce. An extrinsic signed against on-chain state would then take the nonce of the
2124
+ * one ahead of it and bounce off it (1013/1014) instead of queueing behind it.
2125
+ *
2126
+ * `system_accountNextIndex` is the only pool-aware source here. `signAndSend`'s own `nonce: -1`
2127
+ * is not: on a runtime carrying `AccountNonceApi`, which Hyperbridge does, polkadot-js reads the
2128
+ * nonce through that runtime call and never sees the pool.
2129
+ *
2130
+ * The RPC covers the ready queue, so anything of this instance's that has left it — retried,
2131
+ * queued as future, or simply not counted yet — is covered by `lastPooledNonce` instead, which
2132
+ * is the highest nonce this instance has put into the pool. The two are combined rather than
2133
+ * trusted separately, so a burst never reuses a nonce and a restart still picks up the chain's.
2134
+ */
2135
+ private nextNonce;
2217
2136
  private sendWithTimeout;
2218
2137
  /**
2219
2138
  * Submits a bid to Hyperbridge's pallet-intents
2220
2139
  *
2140
+ * A filler can hold several bids on one order, one per price it offers, and `bid` tells them
2141
+ * apart: submitting again under an identifier the filler already holds replaces that bid alone.
2142
+ * By convention it is `keccak256` of the UserOp's `callData`, which is also what gives each bid
2143
+ * its own nonce key on the `SolverAccount` (see `CryptoUtils.bidId`).
2144
+ *
2221
2145
  * @param commitment - The order commitment hash (bytes32)
2222
2146
  * @param userOp - The encoded PackedUserOperation as hex string
2147
+ * @param bid - Identifies this bid among the filler's bids on the order (bytes32)
2223
2148
  * @returns BidSubmissionResult with success status and block/extrinsic hash
2224
2149
  */
2225
- submitBid(commitment: HexString$1, userOp: HexString$1): Promise<BidSubmissionResult>;
2150
+ submitBid(commitment: HexString$1, userOp: HexString$1, bid: HexString$1): Promise<BidSubmissionResult>;
2226
2151
  /**
2227
2152
  * Retracts a bid from Hyperbridge and reclaims the deposit
2228
2153
  *
2229
2154
  * Use this to remove unused quotes and claim back deposited BRIDGE tokens.
2230
2155
  *
2231
2156
  * @param commitment - The order commitment hash (bytes32)
2157
+ * @param bid - Which of the filler's bids on the order to retract (bytes32)
2232
2158
  * @returns BidSubmissionResult with success status and block/extrinsic hash
2233
2159
  */
2234
- retractBid(commitment: HexString$1): Promise<BidSubmissionResult>;
2235
- /**
2236
- * Places a new bid and retracts a previous one in a single transaction via utility.batch.
2237
- *
2238
- * The new bid is the primary operation, so `placeBid` MUST run first. `utility.batch` is
2239
- * non-atomic: a failing call interrupts the batch (via a BatchInterrupted event) without
2240
- * reverting the calls that already succeeded. Placing first guarantees the new bid lands even
2241
- * when the retraction then fails — which it routinely does, because a previous commitment's bid
2242
- * may already be gone (or was itself never placed), making `retractBid` return `BidNotFound`.
2243
- *
2244
- * Ordering retraction first (the previous behaviour) caused a self-sustaining cascade: a
2245
- * `BidNotFound` on the leading retract skipped the trailing `placeBid`, so the current bid never
2246
- * landed, so the *next* interval's retract of that never-placed commitment also failed, and so
2247
- * on — silently, because the batch extrinsic itself reports success. The deposit reclaim is
2248
- * best-effort; landing the bid is not.
2249
- *
2250
- * @param retractCommitment - The order commitment of the bid to retract (bytes32)
2251
- * @param bidCommitment - The order commitment of the new bid (bytes32)
2252
- * @param userOp - The encoded PackedUserOperation as hex string
2253
- * @returns BidSubmissionResult with success status and block/extrinsic hash
2254
- */
2255
- submitBidWithRetraction(retractCommitment: HexString$1, bidCommitment: HexString$1, userOp: HexString$1): Promise<BidSubmissionResult>;
2256
- /**
2257
- * Places every phantom bid of one interval in a single extrinsic, retracting each chain's
2258
- * previous bid alongside it.
2259
- *
2260
- * The pallet registers one phantom order per configured chain in the same block, so this is the
2261
- * whole interval's set. Submitting them one at a time costs a block per chain: submissions are
2262
- * serialised on the account nonce and each waits for inclusion, so the last chain's bid is many
2263
- * blocks behind the first, against a bid window measured in tens of blocks. Batched, every bid
2264
- * lands in the same block.
2265
- *
2266
- * Uses `utility.force_batch`, not `utility.batch`. `batch` stops at the first failing call, so
2267
- * one rejected bid — a closed window, a duplicate, an insufficient deposit — would silently
2268
- * drop every bid after it. `force_batch` runs them all and reports each outcome. It needs no
2269
- * special origin: any signed account may call it, exactly like `batch`.
2270
- *
2271
- * @param bids - The bids to place; an empty list is a no-op
2272
- * @returns Per-bid outcomes, in the order given
2273
- */
2274
- submitPhantomBids(bids: PhantomBid[]): Promise<PhantomBidBatchResult>;
2275
- /**
2276
- * Reads one outcome per call out of a force_batch's events.
2277
- *
2278
- * `ItemFailed` carries no index — pallet-utility emits exactly one `ItemCompleted` or
2279
- * `ItemFailed` per call, in call order, so the k-th item event belongs to call k.
2280
- *
2281
- * A count that does not match the calls submitted means the events are not the ones assumed
2282
- * here, and every attribution after the discrepancy would be off by one. The bids are then
2283
- * reported as placed: a bid wrongly recorded as landed is retracted next interval and the
2284
- * retraction harmlessly fails with `BidNotFound`, whereas one wrongly recorded as failed is
2285
- * never retracted at all and leaves its deposit reserved.
2286
- */
2287
- private readForceBatchItems;
2160
+ retractBid(commitment: HexString$1, bid: HexString$1): Promise<BidSubmissionResult>;
2288
2161
  /** Renders a DispatchError as `pallet::Error`, falling back to its raw form. */
2289
2162
  private describeDispatchError;
2290
2163
  /**
@@ -2318,184 +2191,8 @@ declare class IntentsCoprocessor {
2318
2191
  private getBidsViaStorage;
2319
2192
  /** Decodes SCALE-encoded Bid struct and SCALE-encoded PackedUserOperation */
2320
2193
  private decodeBid;
2321
- /** Builds offchain storage key: "intents::bid::" + commitment + filler */
2194
+ /** Builds offchain storage key: "intents::bid::" + commitment + filler + bid */
2322
2195
  private buildOffchainBidKey;
2323
- /**
2324
- * Fetches the ABI-encoded phantom order from offchain storage and decodes it
2325
- * into an `Order` object. The pallet writes the order bytes under the key
2326
- * `intents::phantom::order::<commitment>` when it calls `on_initialize`.
2327
- *
2328
- * Returns `null` if the key is absent (e.g. the node is not an offchain worker
2329
- * or the commitment has expired and been cleared).
2330
- */
2331
- fetchPhantomOrder(commitment: HexString$1): Promise<Order | null>;
2332
- /**
2333
- * Reads the PhantomOrderRegistered events emitted in a single block.
2334
- *
2335
- * Costs two RPCs per block when `knownVersion` is supplied and four without it, which is why the
2336
- * poll goes to the trouble of establishing one. `api.at(hash)` has to work out which metadata to
2337
- * decode the block against, and with nothing to go on it fetches the header and then the runtime
2338
- * version at its parent — every block, forever. Its cheaper paths are a registry already pinned
2339
- * to this exact hash (only ever the previous block's) or one matching a version the caller
2340
- * names, so naming the version is the only way out. See `getBlockRegistry` in
2341
- * `@polkadot/api/base/Init`; the `getUpgradeVersion` shortcut that would otherwise skip the
2342
- * lookup only covers chains hardcoded in `@polkadot/types-known`, which Hyperbridge is not.
2343
- *
2344
- * @param knownVersion - the runtime version this block is known to run, if the caller has
2345
- * established one. Passing a version the block does not actually run decodes it against the
2346
- * wrong metadata, so this is for callers that have checked, not a place to pass a guess.
2347
- */
2348
- getPhantomOrdersInBlock(blockNumber: number, knownVersion?: RuntimeVersion): Promise<PhantomOrderEvent[]>;
2349
- /**
2350
- * The same read, for a caller that already holds the block's hash.
2351
- *
2352
- * Split out so the poll can fetch a whole range's hashes in one concurrent wave — which the
2353
- * provider coalesces into a single batched request — and then read each block's events knowing
2354
- * its hash. `chain_getBlockHash` is the half of the pair that parallelises safely: it takes no
2355
- * historic block hash, so it never triggers polkadot-js's per-hash registry resolution, and
2356
- * concurrent calls cannot race each other's registry state.
2357
- */
2358
- getPhantomOrdersAtHash(blockHash: HexString$1, knownVersion?: RuntimeVersion): Promise<PhantomOrderEvent[]>;
2359
- /**
2360
- * Every block's phantom orders across a whole range, in one `state_queryStorage` call.
2361
- *
2362
- * This is the cheap path: the request cost of a scan stops depending on how many blocks it
2363
- * covers. The events key is the only key queried, and both bounds are block hashes the caller
2364
- * already holds.
2365
- *
2366
- * Two properties of the RPC shape the result.
2367
- *
2368
- * It returns *diffs*: `query_storage_unfiltered` in `sc-rpc` pushes a change set for a block only
2369
- * when the value differs from the previous block in the range (`has_changed`, and the set is
2370
- * dropped when empty), so a block whose events encode byte-for-byte identically to its
2371
- * predecessor's is simply absent. That happens on a quiet chain, where consecutive blocks carry
2372
- * nothing but the timestamp inherent's `ExtrinsicSuccess`. It is safe here because an absent
2373
- * block provably carries no phantom orders: a `PhantomOrderRegistered` commitment is derived from
2374
- * the block number (`phantom_order_commitment`), so a block that registered orders can never
2375
- * encode identically to any other block. Absent therefore means "same as the previous block",
2376
- * and the previous block having orders would contradict that.
2377
- *
2378
- * And it is gated by `--rpc-methods` (`check_if_safe` in `sc-rpc`), which answers a denied call
2379
- * with `Method not found`. The node this reads from must already run unsafe RPC to serve
2380
- * `offchain_localStorageGet` for the orders themselves, so this is normally available; the poll
2381
- * falls back to reading block by block when it is not.
2382
- *
2383
- * @returns one entry per block the node reported a change for, in ascending block order.
2384
- */
2385
- getPhantomOrdersInRange(fromBlockHash: HexString$1, toBlockHash: HexString$1): Promise<PhantomOrderEvent[][]>;
2386
- /**
2387
- * Polls for newly registered phantom orders, invoking the callback once per block that carries
2388
- * any, with all of that block's orders.
2389
- *
2390
- * Per block rather than per order because that is how the pallet writes them: one order per
2391
- * configured chain, all registered in the same `on_initialize`. Delivering them together lets a
2392
- * caller bid on the whole interval in one extrinsic (see {@link submitPhantomBids}) instead of
2393
- * one per chain.
2394
- *
2395
- * Each tick reads the current head and scans every block between the last one processed and that
2396
- * head, so the block cursor — not the connection — determines what has been seen. This replaced a
2397
- * system.events subscription, which was only as reliable as its socket: polkadot-js reconnects
2398
- * the transport but does not reliably re-establish storage subscriptions, and anything emitted
2399
- * while disconnected was lost silently. With a bid window measured in a handful of blocks, that
2400
- * meant silently missed bids.
2401
- *
2402
- * Scanning a block range is gap-free rather than merely self-healing: an outage delays orders but
2403
- * cannot drop them, because the cursor only advances past a block whose events were actually
2404
- * read. Recovery replays the backlog.
2405
- *
2406
- * Every read here goes over HTTP, never the websocket. Polling is a sequence of independent
2407
- * one-shot requests with no state to lose between them, which is exactly what a stateless
2408
- * transport does well: a request either answers or fails loudly on this tick, instead of a
2409
- * socket that looks alive while delivering nothing. It also means a websocket outage does not
2410
- * pause phantom bidding at all — the two transports fail independently.
2411
- *
2412
- * What the cadence does *not* describe is the request rate, which is what rate limiters police.
2413
- * A tick costs four requests whatever the range covers — the head, the runtime version, the two
2414
- * bounding block hashes as one batched request, and one `state_queryStorage` for every block's
2415
- * events — and they go out back-to-back, so an interval well under any per-second limit could
2416
- * still arrive as a burst over it. Three things keep that in bounds: the provider coalesces
2417
- * concurrent calls into one request and paces requests through the endpoint's token bucket (see
2418
- * `http`), and `maxBlocksPerPoll` bounds the range. A 429 that gets through anyway backs the
2419
- * poll off for a doubling number of ticks, so a limiter that is already shedding load is not
2420
- * handed the next window's budget in rejections too.
2421
- *
2422
- * Where the node will not serve `state_queryStorage` the poll reads block by block instead, at
2423
- * three requests plus one per block; see {@link scanRangeAtOnce}.
2424
- *
2425
- * Returns a function that stops polling.
2426
- */
2427
- pollPhantomOrders(callback: (events: PhantomOrderEvent[]) => void, options?: PollPhantomOrdersOptions): () => void;
2428
- /**
2429
- * The Hyperbridge head, over HTTP like every other read here.
2430
- *
2431
- * Exposed for callers that have to know how old something is: a phantom order carries the block
2432
- * it was registered at, and only against the head does that become "still biddable" or "long
2433
- * expired".
2434
- */
2435
- latestBlockNumber(): Promise<number>;
2436
- /**
2437
- * The pallet's phantom timings, read from chain state.
2438
- *
2439
- * Both are governance-settable and neither is derivable: on Nexus today the window is 15 while
2440
- * the runtime constant behind it is 25, so anything hard-coded is wrong in one direction or the
2441
- * other — too tight and live orders are dropped, too loose and bids are sent into a closed
2442
- * window for the pallet to reject.
2443
- *
2444
- * Read once per instance and cached, because a governance change to either is rare and a read
2445
- * per poll tick would be a request per tick forever. The cost is that a change is picked up on
2446
- * the next restart rather than immediately. A failed read is not cached, so it retries.
2447
- */
2448
- phantomTimings(): Promise<PhantomTimings>;
2449
- private readPhantomTimings;
2450
- /**
2451
- * A whole range of blocks in one `state_queryStorage` call, or `null` when that is not available
2452
- * and the caller should read block by block.
2453
- *
2454
- * Two conditions have to hold, and both are about decoding rather than the range itself.
2455
- *
2456
- * The version must be confirmed for this tick — an upgrade inside the range means blocks decode
2457
- * against different metadata, and one call cannot do that.
2458
- *
2459
- * And that confirmed version must still be the one the api's own registry was built for.
2460
- * `state_queryStorage` declares no historic block hash, so rpc-core skips its registry swap and
2461
- * decodes the reply against the default registry — fixed at connect, with no
2462
- * `subscribeRuntimeVersion` on an HTTP api to refresh it. After an upgrade the two diverge, and
2463
- * the per-block path takes over for good: `api.at(hash, version)` resolves, and builds, the right
2464
- * registry. That costs a restart to get the cheap path back, which is the correct direction to
2465
- * fail in.
2466
- */
2467
- private scanRangeAtOnce;
2468
- /**
2469
- * The runtime version this tick's blocks may be decoded against, or `undefined` when that cannot
2470
- * be established and each block must resolve its own.
2471
- *
2472
- * Naming a version to `api.at` is what removes two of the four RPCs a block scan costs, and it
2473
- * is only sound while the version is actually the block's. Getting that wrong is not a loud
2474
- * failure: events decoded against the wrong metadata come back as a shape the scan does not
2475
- * recognise, so the block reads as carrying no phantom orders and the cursor advances past it —
2476
- * exactly the silent miss the block cursor exists to rule out.
2477
- *
2478
- * So the version is read fresh each tick and only used when it matches the previous reading.
2479
- * `specVersion` only ever increases, and this read happens *after* the head read, so two equal
2480
- * readings mean no upgrade landed anywhere in between — and therefore none in the range about to
2481
- * be scanned. A reading that differs means an upgrade landed inside the range: that tick falls
2482
- * back to per-block resolution, which is exact, and the version is used from the next tick on
2483
- * once it has been seen twice.
2484
- *
2485
- * The gap this leaves is a backlog reaching back past an upgrade, whose oldest blocks predate
2486
- * even the previous reading. Recovering from an outage that long means those bid windows closed
2487
- * many upgrades ago, so nothing is lost that was still winnable.
2488
- *
2489
- * A version that cannot be read at all yields `undefined` rather than an error: the scan is
2490
- * about to make the same request against the same endpoint and is the better place to report it.
2491
- */
2492
- private confirmedRuntimeVersion;
2493
- /**
2494
- * The poll cadence for the runtime this instance is connected to: Gargantua polls every block,
2495
- * everything else every 15s. Falls back to the slower cadence if the runtime cannot be read,
2496
- * since an unreachable node is the poll's problem to report, not the cadence lookup's.
2497
- */
2498
- private phantomPollIntervalMs;
2499
2196
  }
2500
2197
 
2501
2198
  /**
@@ -2980,7 +2677,18 @@ interface RetryConfig {
2980
2677
  */
2981
2678
  backoffMs: number;
2982
2679
  logMessage?: string;
2983
- logger?: ConsolaInstance;
2680
+ /**
2681
+ * Where retry attempts are recorded. Structural on purpose: `retryPromise`
2682
+ * only ever calls `trace`, and callers outside this package log through
2683
+ * their own stack (pino, in simplex's case). Typing it as a full
2684
+ * `ConsolaInstance` forced those callers to omit the logger entirely, which
2685
+ * sent every retry to the silent default and made a retrying call — up to
2686
+ * `maxRetries` × the transport's own timeout budget — indistinguishable
2687
+ * from a hang.
2688
+ */
2689
+ logger?: {
2690
+ trace: (message: string) => void;
2691
+ };
2984
2692
  /** Return false to stop retrying and immediately rethrow the error. */
2985
2693
  shouldRetry?: (error: unknown) => boolean;
2986
2694
  }
@@ -3029,7 +2737,9 @@ declare enum OrderStatus {
3029
2737
  PLACED = "PLACED",
3030
2738
  FILLED = "FILLED",
3031
2739
  REDEEMED = "REDEEMED",
3032
- REFUNDED = "REFUNDED"
2740
+ REFUNDED = "REFUNDED",
2741
+ /** Cancellation has been initiated; escrow refund is still pending. */
2742
+ CANCELLED = "CANCELLED"
3033
2743
  }
3034
2744
  declare enum TeleportStatus {
3035
2745
  TELEPORTED = "TELEPORTED",
@@ -3511,7 +3221,15 @@ declare enum RequestKind {
3511
3221
  /**
3512
3222
  * Identifies a request for refunding escrowed tokens after cancellation
3513
3223
  */
3514
- RefundEscrow = 4
3224
+ RefundEscrow = 4,
3225
+ /**
3226
+ * Identifies a governance call the gateway runs against itself, such as an upgrade
3227
+ */
3228
+ Execute = 5,
3229
+ /**
3230
+ * Identifies a request for redeeming a slice of an escrow after a partial fill, leaving the order open
3231
+ */
3232
+ RedeemEscrowPartial = 6
3515
3233
  }
3516
3234
  /**
3517
3235
  * Configuration for the IntentFiller
@@ -3570,17 +3288,6 @@ interface FillerConfig {
3570
3288
  * Example: { 1: true, 56: false } - watch-only on Ethereum, normal execution on BSC
3571
3289
  */
3572
3290
  watchOnly?: Record<number, boolean>;
3573
- /**
3574
- * Uniswap V4 position tokenIds this filler holds, per chain (state machine id -> tokenIds as
3575
- * decimal strings), declared inside its phantom bids' paymasterAndData for the bid's own chain.
3576
- *
3577
- * Liquidity parked in a V4 position is invisible to the snapshot's inventory read, which sees
3578
- * only ERC-20 balances and ERC-4626 vault shares — so without this a venue-funded filler is
3579
- * weighted at zero and its quotes are discarded. The declaration is only a POINTER: the indexer
3580
- * reads each position's liquidity on-chain and checks it is owned by the solver that signed the
3581
- * bid, so naming a position cannot inflate it and naming someone else's achieves nothing.
3582
- */
3583
- uniswapV4PositionsByChain?: Record<string, string[]>;
3584
3291
  }
3585
3292
  /**
3586
3293
  * Result of an order execution attempt
@@ -3846,74 +3553,7 @@ interface OrderResponse {
3846
3553
  }>;
3847
3554
  };
3848
3555
  }
3849
- interface PhantomOrderPriceSnapshot {
3850
- commitment: HexString$1;
3851
- tokenA: HexString$1;
3852
- tokenB: HexString$1;
3853
- standardAmount: bigint;
3854
- blockNumber: bigint;
3855
- medianPrice: bigint;
3856
- lowestPrice?: bigint;
3857
- highestPrice?: bigint;
3858
- bidCount: number;
3859
- snapshotTime: Date;
3860
- }
3861
- interface PhantomOrderPriceSnapshotsResponse {
3862
- phantomOrderPriceSnapshots: {
3863
- nodes: Array<{
3864
- commitment: string;
3865
- tokenA: string;
3866
- tokenB: string;
3867
- standardAmount: string;
3868
- blockNumber: string;
3869
- medianPrice: string | null;
3870
- lowestPrice: string | null;
3871
- highestPrice: string | null;
3872
- bidCount: number;
3873
- snapshotTime: string;
3874
- }>;
3875
- };
3876
- }
3877
- /** One independently reported slice of indexed liquidity. */
3878
- interface LiquiditySlice {
3879
- totalLiquidity: string;
3880
- providerCount: number;
3881
- }
3882
- /**
3883
- * Indexed destination capacity and its source-routing slices.
3884
- *
3885
- * The SDK reports the indexer's facts separately and does not decide whether a
3886
- * source chain is covered by the legacy unrestricted-bidder policy.
3887
- */
3888
- interface AvailableLiquidity {
3889
- sourceChain: Chains;
3890
- destinationChain: Chains;
3891
- tokenAddress: HexString$1;
3892
- updatedAt: Date;
3893
- destination: LiquiditySlice;
3894
- unrestricted: LiquiditySlice;
3895
- explicitRoute: (LiquiditySlice & {
3896
- updatedAt: Date;
3897
- }) | null;
3898
- }
3899
- /**
3900
- * Aggregate indexed pool buy and sell rates expressed as quote-token units per
3901
- * one base token. The quote token is the less valuable currency when the rates
3902
- * establish an ordering (for example, cNGN in a USDC/cNGN pair).
3903
- */
3904
- interface BuyAndSellRates {
3905
- baseTokenSymbol: ConfiguredAssetSymbol;
3906
- quoteTokenSymbol: ConfiguredAssetSymbol;
3907
- sourceChain: Chains;
3908
- destinationChain: Chains;
3909
- /** Quote-token units received when buying the quote token with one base token. */
3910
- buyRate: string | null;
3911
- /** Quote-token units sold to receive one base token. */
3912
- sellRate: string | null;
3913
- buyRateUpdatedAt: Date | null;
3914
- sellRateUpdatedAt: Date | null;
3915
- }
3916
- /** Symbol-only input for querying an indexed pool's rates. */
3556
+ /** Symbol-only input for querying a pair's orderbook rates on a route. */
3917
3557
  interface QueryBuyAndSellRatesParams {
3918
3558
  tokenInSymbol: ConfiguredAssetSymbolInput;
3919
3559
  tokenOutSymbol: ConfiguredAssetSymbolInput;
@@ -4005,7 +3645,10 @@ interface FillOptions {
4005
3645
  * encoding against a gateway whose implementation predates the field.
4006
3646
  */
4007
3647
  validUntil: bigint;
3648
+ /** Positional output budgets. Actual payment follows the quoted rate and released input. */
4008
3649
  outputs: TokenInfo[];
3650
+ /** Required positional maximum input takes. Paired outputs/inputs declare each leg's rate. */
3651
+ inputs: TokenInfo[];
4009
3652
  }
4010
3653
  interface PackedUserOperation {
4011
3654
  sender: HexString$1;
@@ -4055,6 +3698,10 @@ interface SubmitBidOptions {
4055
3698
  }
4056
3699
  interface EstimateFillOrderParams {
4057
3700
  order: Order;
3701
+ /** Positional input takes. Required with custom outputs; otherwise estimates a full fill at the order's rate. */
3702
+ inputs?: TokenInfo[];
3703
+ /** Output slice offered by the solver. Defaults to the order's full requested outputs. */
3704
+ outputs?: TokenInfo[];
4058
3705
  /**
4059
3706
  * Optional ERC-7821 calls to prepend before the fillOrder call in the
4060
3707
  * simulated UserOp. Used for funding calls (e.g. LP withdrawal) so the
@@ -4076,6 +3723,8 @@ interface EstimateFillOrderParams {
4076
3723
  }
4077
3724
  interface FillOrderEstimate {
4078
3725
  fillOptions: FillOptions;
3726
+ /** Normalized positional input takes used by the estimated calldata. */
3727
+ inputs: TokenInfo[];
4079
3728
  callGasLimit: bigint;
4080
3729
  verificationGasLimit: bigint;
4081
3730
  preVerificationGas: bigint;
@@ -4153,15 +3802,25 @@ interface BidSubmissionResult {
4153
3802
  */
4154
3803
  pending?: boolean;
4155
3804
  }
3805
+ /** One bid as the `intents_getBidsForOrder` RPC returns it: hex-encoded, the filler as raw AccountId bytes. */
3806
+ interface RpcBidInfo {
3807
+ commitment: HexString$1;
3808
+ filler: HexString$1;
3809
+ /** Which of the filler's bids on the order this is (bytes32; by convention `keccak256(callData)`). */
3810
+ bid: HexString$1;
3811
+ user_op: HexString$1;
3812
+ }
4156
3813
  /**
4157
- * Represents a storage entry from pallet-intents Bids storage
4158
- * StorageDoubleMap<_, Blake2_128Concat, H256, Blake2_128Concat, AccountId, Balance>
3814
+ * Represents a storage entry from pallet-intents `OrderBids` storage:
3815
+ * StorageNMap<(H256 commitment, AccountId filler, H256 bid), Balance>
4159
3816
  */
4160
3817
  interface BidStorageEntry {
4161
3818
  /** The order commitment hash (H256) */
4162
3819
  commitment: HexString$1;
4163
3820
  /** The filler's Substrate account ID (SS58 encoded) */
4164
3821
  filler: string;
3822
+ /** Which of the filler's bids on the order this is (bytes32; by convention `keccak256(callData)`) */
3823
+ bid: HexString$1;
4165
3824
  /** The deposit amount stored on-chain (BalanceOf<T> = u128) */
4166
3825
  deposit: bigint;
4167
3826
  }
@@ -4172,6 +3831,11 @@ interface BidStorageEntry {
4172
3831
  interface FillerBid {
4173
3832
  /** The filler's Substrate account ID (SS58 encoded) */
4174
3833
  filler: string;
3834
+ /**
3835
+ * Which of the filler's bids on the order this is. A filler offering several prices bids once
3836
+ * per price; by convention the identifier is `keccak256` of the UserOp's `callData`.
3837
+ */
3838
+ bid: HexString$1;
4175
3839
  /** The decoded PackedUserOperation */
4176
3840
  userOp: PackedUserOperation;
4177
3841
  /** The deposit amount stored on-chain (in plancks) */
@@ -4205,8 +3869,10 @@ interface SelectOptions {
4205
3869
  interface Bid {
4206
3870
  /** The solver account that submitted this bid (`userOp.sender`). */
4207
3871
  readonly solverAddress: HexString$1;
4208
- /** Decoded `FillOptions.outputs` — the tokens and amounts the solver offers. */
3872
+ /** Decoded output budgets; these are not settlement payments or credited progress. */
4209
3873
  readonly outputs: TokenInfo[];
3874
+ /** Positional input takes from `FillOptions.inputs`, one per leg. */
3875
+ readonly inputs: TokenInfo[];
4210
3876
  /** Relayer fee from the decoded fill options. */
4211
3877
  readonly relayerFee: bigint;
4212
3878
  /** Hyperbridge native dispatch fee from the decoded fill options. */
@@ -4245,6 +3911,7 @@ declare const IntentOrderStatus: Readonly<{
4245
3911
  BID_SELECTED: "BID_SELECTED";
4246
3912
  FILLED: "FILLED";
4247
3913
  PARTIAL_FILL: "PARTIAL_FILL";
3914
+ CANCELLED: "CANCELLED";
4248
3915
  EXPIRED: "EXPIRED";
4249
3916
  FAILED: "FAILED";
4250
3917
  }>;
@@ -4301,11 +3968,18 @@ type IntentOrderStatusUpdate = {
4301
3968
  } | {
4302
3969
  status: "FILLED";
4303
3970
  commitment: HexString$1;
4304
- userOpHash: HexString$1;
3971
+ /** Absent when the completing fill was not executed here, e.g. after a restart. */
3972
+ userOpHash?: HexString$1;
4305
3973
  selectedSolver: HexString$1;
4306
3974
  transactionHash?: HexString$1;
4307
3975
  totalFilledAssets: TokenInfo[];
4308
3976
  remainingAssets: TokenInfo[];
3977
+ } | {
3978
+ /** The order was cancelled on its destination chain before it was completely filled. */
3979
+ status: "CANCELLED";
3980
+ commitment: HexString$1;
3981
+ totalFilledAssets: TokenInfo[];
3982
+ remainingAssets: TokenInfo[];
4309
3983
  } | {
4310
3984
  status: "PARTIAL_FILL";
4311
3985
  commitment: HexString$1;
@@ -5288,152 +4962,275 @@ interface IntentGatewayContext {
5288
4962
  swap: Swap;
5289
4963
  }
5290
4964
 
5291
- type IntentQuoteStrategy = "indexed_rates" | "uniswap_v4" | "phantom_snapshot";
5292
- type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
5293
- type IndexedRateSide = "buy" | "sell";
5294
- /**
5295
- * Full Uniswap V4 PoolKey. V4 pools cannot be discovered from a token pair alone.
5296
- */
5297
- interface UniswapV4PoolKey {
5298
- currency0: HexString$1;
5299
- currency1: HexString$1;
5300
- fee: number;
5301
- tickSpacing: number;
5302
- hooks: HexString$1;
4965
+ /** The HyperFX orderbook deployments, one per network. */
4966
+ declare const ORDERBOOK_URLS: {
4967
+ readonly mainnet: "https://orderbook.hyperfx.finance/mainnet/graphql";
4968
+ readonly testnet: "https://orderbook.hyperfx.finance/testnet/graphql";
4969
+ };
4970
+ /** The orderbook deployment that serves `stateMachineId`: the testnet book for a testnet chain, else mainnet. */
4971
+ declare function orderbookUrlFor(stateMachineId: string): string;
4972
+ /** Every amount and rate the orderbook takes or returns is fixed-point at 1e18, whatever the token's decimals. */
4973
+ declare const ORDERBOOK_DECIMALS = 18;
4974
+ /** `BID` takes a swap selling the book's base; `ASK` takes a swap buying it. */
4975
+ type OrderbookSide = "BID" | "ASK";
4976
+ /** `SAME_CHAIN` is served by every order on the chain; `CROSS_CHAIN` only by orders declaring the source. */
4977
+ type OrderbookRouteKind = "SAME_CHAIN" | "CROSS_CHAIN";
4978
+ /** A swap route, by token symbol and state machine id (`EVM-8453`). */
4979
+ interface OrderbookRoute {
4980
+ tokenIn: string;
4981
+ tokenOut: string;
4982
+ /** Where the swapper's `tokenIn` is escrowed. */
4983
+ sourceChain: string;
4984
+ /** Where `tokenOut` is delivered, which is the chain the order is filled on. */
4985
+ destinationChain: string;
5303
4986
  }
5304
- interface UniswapV4IntentQuoteOptions {
5305
- /** Explicit pool override for pairs not yet present in SDK chain config. */
5306
- poolKey?: UniswapV4PoolKey & {
5307
- quoterAddress?: HexString$1;
5308
- /**
5309
- * Destination-side address of the input currency. Defaults to
5310
- * `tokenIn`, which only works for same-chain quotes; pass this
5311
- * explicitly when source and destination chains differ. Must equal
5312
- * `currency0` or `currency1`.
5313
- */
5314
- currencyIn?: HexString$1;
5315
- };
4987
+ /** A configured book. Every rate on it is `quote` per 1 `base`. */
4988
+ interface OrderbookBook {
4989
+ id: string;
4990
+ base: string;
4991
+ quote: string;
4992
+ }
4993
+ /** The best price level for one direction on one fill chain. Amounts and rates at 1e18. */
4994
+ interface OrderbookRate {
4995
+ side: OrderbookSide;
4996
+ fillChain: string;
4997
+ /** The level's best single-order price, quote per 1 base. */
4998
+ rate: bigint;
4999
+ /** Virtual depth: the level's summed order sizes, in tokenIn and tokenOut. */
5000
+ depthIn: bigint;
5001
+ depthOut: bigint;
5002
+ /** True liquidity: each solver's largest validated order in the level, summed, in tokenOut. */
5003
+ backingLiquidity: bigint;
5004
+ sourceChains: string[];
5005
+ orderCount: number;
5006
+ solverCount: number;
5007
+ }
5008
+ /** What a route holds, without an amount. Amounts and rates at 1e18. */
5009
+ interface OrderbookRouteLiquidity {
5010
+ route: OrderbookRouteKind;
5011
+ /** The book the route trades on, which names the units of `bestRate`. */
5012
+ book: OrderbookBook;
5013
+ /** `BID` when tokenIn is the book's base, `ASK` when it is the quote. */
5014
+ side: OrderbookSide;
5015
+ /** Quote per 1 base; null when no order serves the route. */
5016
+ bestRate: bigint | null;
5017
+ /** Virtual depth: the serving orders' sizes summed, in tokenIn and tokenOut. */
5018
+ depthIn: bigint;
5019
+ depthOut: bigint;
5020
+ /** True liquidity in tokenOut: each serving solver's largest validated order, summed. */
5021
+ availableLiquidity: bigint;
5022
+ /** The largest tokenIn amount the route could fill with its orders combined. */
5023
+ maxFillableIn: bigint;
5024
+ orderCount: number;
5025
+ solverCount: number;
5026
+ }
5027
+ /** A quote for an input amount on a route. Amounts and rates at 1e18. */
5028
+ interface OrderbookSwapQuote {
5029
+ route: OrderbookRouteKind;
5030
+ side: OrderbookSide;
5031
+ /** The tokenIn priced, floored to a whole raw unit on the source chain. */
5032
+ amountIn: bigint;
5033
+ /** The tokenOut delivered, floored to a whole raw unit on the destination chain; 0 when not fillable. */
5034
+ amountOut: bigint;
5035
+ /** The clearing price, quote per 1 base; null when the route cannot fill the amount. */
5036
+ rate: bigint | null;
5037
+ fillable: boolean;
5038
+ /** The tokenIn the route can absorb at `rate` or better. */
5039
+ depth: bigint;
5040
+ /** The largest tokenIn amount the route could fill. */
5041
+ maxFillableIn: bigint;
5042
+ /** The orders used, best first. */
5043
+ fills: {
5044
+ orderRate: bigint;
5045
+ amountOut: bigint;
5046
+ advertisedSize: bigint;
5047
+ }[];
5316
5048
  }
5049
+ /** The best bid and ask a route can reach, with the book that orients them. */
5050
+ interface OrderbookTopOfBook {
5051
+ book: OrderbookBook;
5052
+ /** Highest bid: the most quote a seller of 1 base receives. */
5053
+ bid: OrderbookRate | null;
5054
+ /** Lowest ask: the least quote a buyer of 1 base pays. */
5055
+ ask: OrderbookRate | null;
5056
+ }
5057
+ /** The orderbook could not answer: a transport failure, or a GraphQL error such as a pair no book trades. */
5058
+ declare class OrderbookRequestError extends Error {
5059
+ constructor(message: string);
5060
+ }
5061
+ /** Every document the client sends, so they can be checked against the orderbook's published schema. */
5062
+ declare const ORDERBOOK_QUERIES: {
5063
+ 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}";
5064
+ 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}";
5065
+ 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}";
5066
+ };
5317
5067
  /**
5318
- * Parameters for `IntentGateway.quoteIntent`. The source and destination
5319
- * chains come from the gateway instance itself.
5068
+ * Read-only client for the HyperFX orderbook's GraphQL API.
5320
5069
  *
5321
- * Quotes default to the aggregate pool's `indexed_rates`. Legacy Phantom
5322
- * snapshots and Uniswap V4 remain available as explicit strategies. `tokenIn`
5323
- * and `tokenOut` are token addresses; the SDK resolves configured token
5324
- * metadata and decimals internally. Provide exactly one amount.
5070
+ * Tokens are named by symbol and chains by state machine id. Every amount and
5071
+ * rate is a `bigint` at 1e18, as the orderbook serves it; rates are quote per 1
5072
+ * base of the pair's book.
5073
+ */
5074
+ declare class HyperFxOrderbook {
5075
+ private readonly client;
5076
+ /** @param urlOrClient - The orderbook's GraphQL URL, or a configured `graphql-request` client. */
5077
+ constructor(urlOrClient?: string | GraphQLClient);
5078
+ /**
5079
+ * The best bid and ask on `fillChain` for the pair `tokenA`/`tokenB`, counting
5080
+ * only orders a swap from `sourceChain` can use.
5081
+ */
5082
+ topOfBook(params: {
5083
+ tokenA: string;
5084
+ tokenB: string;
5085
+ fillChain: string;
5086
+ sourceChain: string;
5087
+ }): Promise<OrderbookTopOfBook>;
5088
+ /** Total liquidity on a route, no amount required. */
5089
+ routeLiquidity(route: OrderbookRoute): Promise<OrderbookRouteLiquidity>;
5090
+ /** The clearing price for `amountIn` (1e18 tokenIn) on a route, which may combine several solvers' orders. */
5091
+ quote(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookSwapQuote>;
5092
+ private request;
5093
+ }
5094
+
5095
+ type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
5096
+ /**
5097
+ * Parameters for `IntentGateway.quoteIntent`. The source and destination chains
5098
+ * come from the gateway instance itself. `tokenIn` and `tokenOut` are token
5099
+ * addresses; the SDK resolves their configured symbols and decimals. Provide
5100
+ * exactly one amount, in the token's raw units.
5325
5101
  */
5326
5102
  interface QuoteIntentParams {
5327
- strategy?: IntentQuoteStrategy;
5328
5103
  /** Token address on the source chain. */
5329
5104
  tokenIn: HexString$1;
5330
5105
  /** Token address on the destination chain. */
5331
5106
  tokenOut: HexString$1;
5332
5107
  amountIn?: bigint;
5333
5108
  amountOut?: bigint;
5334
- uniswapV4?: UniswapV4IntentQuoteOptions;
5335
- }
5336
- interface UniswapV4IntentQuoteMetadata {
5337
- /** Chain whose Uniswap pool and quoter were used for the quote. */
5338
- quoteChain: string;
5339
- poolKey: UniswapV4PoolKey;
5340
- quoterAddress: HexString$1;
5341
- /**
5342
- * IntentGateway protocol fee on the source chain, already applied to the
5343
- * returned amounts. Exposed so callers can reconstruct the swap-side
5344
- * (post-fee) amount if needed.
5345
- */
5346
- protocolFeeBps: bigint;
5347
- }
5348
- interface PhantomSnapshotIntentQuoteMetadata {
5349
- /** Canonical chain whose directional Phantom pair addresses identify the feed. */
5350
- quoteChain: string;
5351
- /** Phantom order whose bids produced this snapshot. */
5352
- commitment: HexString$1;
5353
- tokenA: HexString$1;
5354
- tokenB: HexString$1;
5355
- /** Benchmark input and liquidity-weighted median output, both in raw token units. */
5356
- standardAmount: bigint;
5357
- medianPrice: bigint;
5358
- lowestPrice?: bigint;
5359
- highestPrice?: bigint;
5360
- blockNumber: bigint;
5361
- snapshotTime: Date;
5362
- bidCount: number;
5363
- /** Source gateway protocol fee already reflected in the returned quote amounts. */
5364
- protocolFeeBps: bigint;
5365
5109
  }
5366
- interface IndexedRateIntentQuoteMetadata {
5110
+ interface IntentQuoteMetadata {
5367
5111
  sourceChain: Chains;
5368
5112
  destinationChain: Chains;
5113
+ /** `SAME_CHAIN`, or `CROSS_CHAIN` when only orders accepting the source chain can fill it. */
5114
+ route: OrderbookRouteKind;
5115
+ /** `BID` when the order sells the book's base token, `ASK` when it buys it. */
5116
+ side: OrderbookSide;
5369
5117
  baseTokenSymbol: ConfiguredAssetSymbol;
5370
5118
  quoteTokenSymbol: ConfiguredAssetSymbol;
5371
- /** Directional pool rate used for this order. */
5372
- rateSide: IndexedRateSide;
5373
- /** Quote-token units per one base token. */
5119
+ /** The clearing price the order was quoted at, in quote-token units per one base token. */
5374
5120
  rate: string;
5375
- rateUpdatedAt: Date;
5376
- /** Source gateway protocol fee already reflected in the returned quote amounts. */
5377
- protocolFeeBps: bigint;
5121
+ /** The largest `amountIn` the route can fill right now, in the source token's raw units. */
5122
+ maxFillableIn: bigint;
5123
+ /** How many orders the quote combines. */
5124
+ orderCount: number;
5378
5125
  }
5379
5126
  /**
5380
- * Quote data partners need before constructing an IntentGateway V2 order.
5127
+ * A quote priced from the HyperFX orderbook.
5381
5128
  *
5382
- * `amountIn` and `amountOut` already account for the IntentGateway protocol
5383
- * fee that the gateway deducts from order inputs (see `quoteMetadata`). No
5384
- * further fee or slippage adjustment is required before placing the order.
5129
+ * `amountIn` and `amountOut` are raw token units and can be used directly as
5130
+ * the order's `inputs` and `output.assets`. The orderbook's rates already carry
5131
+ * the IntentGateway protocol fee, so no further fee adjustment is needed.
5385
5132
  */
5386
- interface UniswapV4QuoteIntentResult {
5387
- strategy: "uniswap_v4";
5133
+ interface QuoteIntentResult {
5388
5134
  tradeType: IntentQuoteTradeType;
5389
5135
  amountIn: bigint;
5390
5136
  amountOut: bigint;
5391
- quoteMetadata: UniswapV4IntentQuoteMetadata;
5137
+ quoteMetadata: IntentQuoteMetadata;
5392
5138
  }
5393
- interface PhantomSnapshotQuoteIntentResult {
5394
- strategy: "phantom_snapshot";
5395
- tradeType: IntentQuoteTradeType;
5396
- amountIn: bigint;
5397
- amountOut: bigint;
5398
- quoteMetadata: PhantomSnapshotIntentQuoteMetadata;
5399
- }
5400
- interface IndexedRateQuoteIntentResult {
5401
- strategy: "indexed_rates";
5402
- tradeType: IntentQuoteTradeType;
5403
- amountIn: bigint;
5404
- amountOut: bigint;
5405
- quoteMetadata: IndexedRateIntentQuoteMetadata;
5406
- }
5407
- type QuoteIntentResult = IndexedRateQuoteIntentResult | UniswapV4QuoteIntentResult | PhantomSnapshotQuoteIntentResult;
5408
- declare class UnsupportedIntentQuoteStrategyError extends Error {
5409
- constructor(strategy: string);
5410
- }
5411
- declare class UnsupportedIntentQuotePairError extends Error {
5412
- constructor(params: {
5413
- source: string;
5414
- destination: string;
5415
- tokenIn: HexString$1;
5416
- tokenOut: HexString$1;
5417
- quoteSource?: string;
5418
- });
5419
- }
5420
- declare class PhantomSnapshotUnavailableError extends Error {
5421
- constructor(tokenA: HexString$1, tokenB: HexString$1);
5139
+ /**
5140
+ * What the orderbook holds for one route, with no amount given. Amounts are
5141
+ * decimal strings in whole tokens.
5142
+ */
5143
+ interface AvailableLiquidity {
5144
+ sourceChain: Chains;
5145
+ destinationChain: Chains;
5146
+ tokenInSymbol: ConfiguredAssetSymbol;
5147
+ tokenOutSymbol: ConfiguredAssetSymbol;
5148
+ /** `tokenOut` on the destination chain. */
5149
+ tokenAddress: HexString$1;
5150
+ route: OrderbookRouteKind;
5151
+ side: OrderbookSide;
5152
+ baseTokenSymbol: ConfiguredAssetSymbol;
5153
+ quoteTokenSymbol: ConfiguredAssetSymbol;
5154
+ /** The best rate on the route in quote-token units per one base token, or `null` when no order serves it. */
5155
+ bestRate: string | null;
5156
+ /** True liquidity in `tokenOut`: each serving solver's largest balance-checked order, summed. */
5157
+ availableLiquidity: string;
5158
+ /** Virtual depth: every serving order's size summed, in `tokenIn` and `tokenOut`. Can exceed what solvers hold. */
5159
+ depthIn: string;
5160
+ depthOut: string;
5161
+ /** The largest `tokenIn` amount the route could fill with its orders combined. */
5162
+ maxFillableIn: string;
5163
+ orderCount: number;
5164
+ solverCount: number;
5165
+ }
5166
+ /**
5167
+ * The best bid and ask for a pair on a route, in quote-token units per one base
5168
+ * token, as decimal strings. Either side is `null` while it has no orders.
5169
+ */
5170
+ interface BuyAndSellRates {
5171
+ baseTokenSymbol: ConfiguredAssetSymbol;
5172
+ quoteTokenSymbol: ConfiguredAssetSymbol;
5173
+ sourceChain: Chains;
5174
+ destinationChain: Chains;
5175
+ /** Highest bid: the quote token a seller receives per one base token. */
5176
+ bid: string | null;
5177
+ /** Lowest ask: the quote token a buyer pays per one base token. */
5178
+ ask: string | null;
5179
+ /** Midpoint of `bid` and `ask`; `null` unless both sides have orders. */
5180
+ mid: string | null;
5181
+ /** `ask - bid`; `null` when a side is empty or the book is crossed. */
5182
+ spread: string | null;
5183
+ /** `spread` over `mid` in basis points, to two decimal places. */
5184
+ spreadBps: number | null;
5422
5185
  }
5423
- declare class InvalidPhantomSnapshotError extends Error {
5424
- constructor(commitment: HexString$1, reason: string);
5186
+ declare class UnsupportedLiquidityAssetError extends Error {
5187
+ constructor(chain: string, asset: string);
5425
5188
  }
5426
- declare class IndexedRateUnavailableError extends Error {
5427
- constructor(params: {
5428
- source?: string;
5429
- destination?: string;
5430
- tokenIn?: string;
5431
- tokenOut?: string;
5432
- side?: IndexedRateSide;
5433
- });
5189
+ declare class UnsupportedLiquidityChainError extends Error {
5190
+ constructor(chainId: number | string);
5434
5191
  }
5435
- declare class InvalidIndexedRateError extends Error {
5436
- constructor(reason: string);
5192
+ /**
5193
+ * An exact-output quote did not settle on an input within its rounds: each quoted input's clearing
5194
+ * price still fell short of the output. The route may have the depth; the book moved or its levels
5195
+ * are too steep to converge on in time. Retrying, or quoting an exact input, may succeed.
5196
+ */
5197
+ declare class OrderbookQuoteNotConvergedError extends Error {
5198
+ readonly route: {
5199
+ tokenIn: string;
5200
+ tokenOut: string;
5201
+ sourceChain: string;
5202
+ destinationChain: string;
5203
+ };
5204
+ readonly rounds: number;
5205
+ /** The last input quoted, in the source token's raw units. */
5206
+ readonly lastAmountIn: bigint;
5207
+ constructor(route: {
5208
+ tokenIn: string;
5209
+ tokenOut: string;
5210
+ sourceChain: string;
5211
+ destinationChain: string;
5212
+ }, rounds: number,
5213
+ /** The last input quoted, in the source token's raw units. */
5214
+ lastAmountIn: bigint);
5215
+ }
5216
+ /** The orderbook cannot fill the requested amount on this route. */
5217
+ declare class InsufficientOrderbookLiquidityError extends Error {
5218
+ readonly route: {
5219
+ tokenIn: string;
5220
+ tokenOut: string;
5221
+ sourceChain: string;
5222
+ destinationChain: string;
5223
+ };
5224
+ /** The largest `amountIn` the route can fill, in the source token's raw units. */
5225
+ readonly maxFillableIn: bigint;
5226
+ constructor(route: {
5227
+ tokenIn: string;
5228
+ tokenOut: string;
5229
+ sourceChain: string;
5230
+ destinationChain: string;
5231
+ },
5232
+ /** The largest `amountIn` the route can fill, in the source token's raw units. */
5233
+ maxFillableIn: bigint);
5437
5234
  }
5438
5235
 
5439
5236
  /**
@@ -5441,8 +5238,7 @@ declare class InvalidIndexedRateError extends Error {
5441
5238
  *
5442
5239
  * `IntentGateway` orchestrates the complete lifecycle of an intent-based
5443
5240
  * cross-chain swap:
5444
- * - **Quoting** — prices the order's input/output amounts from aggregate
5445
- * indexed pool rates by default, with legacy quote strategies available explicitly.
5241
+ * - **Quoting** — prices orders, liquidity and rates from the HyperFX orderbook.
5446
5242
  * - **Order placement** — encodes and yields `placeOrder` calldata; caller
5447
5243
  * signs and submits the transaction.
5448
5244
  * - **Order execution** — polls the Hyperbridge coprocessor for solver bids,
@@ -5484,8 +5280,10 @@ declare class IntentGateway {
5484
5280
  private readonly bidManager;
5485
5281
  /** Estimates gas costs for filling an order and converts them to fee-token amounts. */
5486
5282
  private readonly gasEstimator;
5487
- /** Quote strategies for pricing orders before placement, keyed by strategy name. */
5488
- private readonly quoteStrategies;
5283
+ /** The HyperFX orderbook quotes, liquidity and rates are read from. */
5284
+ private orderbook;
5285
+ /** Prices intents, liquidity and rates from {@link orderbook}. */
5286
+ private readonly market;
5489
5287
  /**
5490
5288
  * Private constructor — use {@link IntentGateway.create} instead.
5491
5289
  *
@@ -5521,42 +5319,46 @@ declare class IntentGateway {
5521
5319
  */
5522
5320
  private init;
5523
5321
  /**
5524
- * Quotes an intent between this gateway's source and destination chains.
5322
+ * Points quotes, liquidity and rate reads at a HyperFX orderbook other than
5323
+ * the destination chain's network deployment ({@link ORDERBOOK_URLS}).
5324
+ * Returns `this` for chaining.
5325
+ *
5326
+ * @param orderbook - The orderbook's GraphQL URL, or a configured client.
5327
+ */
5328
+ withOrderbook(orderbook: string | HyperFxOrderbook): this;
5329
+ /**
5330
+ * Quotes an intent between this gateway's source and destination chains from
5331
+ * the HyperFX orderbook. Provide exactly one of `amountIn` or `amountOut`, in
5332
+ * raw token units.
5525
5333
  *
5526
- * Uses the indexer's latest aggregate directional pool rate by default. Pass
5527
- * `strategy: "phantom_snapshot"` or `strategy: "uniswap_v4"` only when
5528
- * explicitly requesting a legacy quote source. Provide exactly one of
5529
- * `amountIn` or `amountOut`.
5334
+ * An exact-input quote is the orderbook's clearing price for `amountIn`,
5335
+ * which may combine several solvers' orders. An exact-output quote finds the
5336
+ * smallest input whose clearing price delivers `amountOut`. A cross-chain
5337
+ * route only counts orders whose solvers accept the source chain.
5530
5338
  *
5531
- * The gateway's source and destination chains resolve the configured order
5532
- * tokens; the indexer supplies the depth-weighted pool rate. Returned
5533
- * `amountIn`/`amountOut` already account for the gateway's protocol fee
5534
- * (`quoteMetadata.protocolFeeBps`), which the gateway deducts from order inputs.
5339
+ * The orderbook's rates already carry the gateway protocol fee, so the
5340
+ * returned amounts can be placed as the order's inputs and outputs directly.
5535
5341
  *
5536
- * @param params - Token pair, amount, and optional strategy/pool overrides.
5537
- * @returns The quoted amounts plus strategy-specific metadata.
5538
- * @throws {UnsupportedIntentQuoteStrategyError} For unknown strategies.
5539
- * @throws {UnsupportedIntentQuotePairError} When the selected strategy does not support the pair.
5540
- * @throws {IndexedRateUnavailableError} When the requested direction has no indexed rate.
5342
+ * @throws {InsufficientOrderbookLiquidityError} When the route cannot fill the amount.
5343
+ * @throws {OrderbookRequestError} When the orderbook is unreachable or trades no book for the pair.
5541
5344
  */
5542
5345
  quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
5543
5346
  /**
5544
- * Returns indexed destination liquidity and its source-routing slices.
5347
+ * Returns the orderbook liquidity serving a swap of `tokenIn` on the source
5348
+ * chain for `tokenOut` on the destination chain: the best rate, true and
5349
+ * virtual depth, and the largest input the route can fill.
5545
5350
  *
5546
- * Destination, unrestricted, and explicit-route capacity come exclusively
5547
- * from the indexer's pair-centric liquidity entities. The SDK does not decide
5548
- * whether unrestricted bidders cover the source chain. Amounts reflect the
5549
- * latest rolling sample; they are not reservations or fill guarantees.
5550
- *
5551
- * Requires a prior call to {@link withQueryClient}.
5351
+ * Amounts reflect the live book; they are not reservations or fill guarantees.
5552
5352
  */
5553
- queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquidity | undefined>;
5353
+ queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquidity>;
5554
5354
  /**
5555
- * Returns aggregate indexed pool buy and sell rates in less-valued quote-token
5556
- * units without requiring token addresses. Symbols are matched
5557
- * case-insensitively; chain IDs resolve configured token deployments.
5355
+ * Returns the orderbook's best bid and ask for a pair, with the mid and
5356
+ * spread, in quote-token units per one base token. Only orders filled on the
5357
+ * destination chain that accept swaps from the source chain are counted.
5358
+ * Symbols are matched case-insensitively; chain IDs resolve configured token
5359
+ * deployments.
5558
5360
  */
5559
- queryBuyAndSellRates(params: QueryBuyAndSellRatesParams): Promise<BuyAndSellRates | undefined>;
5361
+ queryBuyAndSellRates(params: QueryBuyAndSellRatesParams): Promise<BuyAndSellRates>;
5560
5362
  /**
5561
5363
  * Bidirectional async generator that orchestrates the full order lifecycle:
5562
5364
  * placement, fee estimation, bid collection, and execution.
@@ -5695,6 +5497,8 @@ declare class IntentGateway {
5695
5497
  /**
5696
5498
  * Returns both the native token cost and the relayer fee for cancelling an
5697
5499
  * order. Use `relayerFee` to approve the ERC-20 spend before submitting.
5500
+ * Same-chain orders use the direct local route for either `from` option and
5501
+ * return `{ nativeValue: 0n, relayerFee: 0n }`.
5698
5502
  *
5699
5503
  * Delegates to {@link OrderCanceller.quoteCancelOrder}.
5700
5504
  *
@@ -5712,9 +5516,17 @@ declare class IntentGateway {
5712
5516
  *
5713
5517
  * Delegates to {@link OrderCanceller.cancelOrder}.
5714
5518
  *
5519
+ * Same-chain orders always use the direct source-gateway route. The order
5520
+ * user may call through the deadline; any account may call strictly after
5521
+ * it, pays the transaction gas, and cannot change the refund beneficiary.
5522
+ * The SDK yields unsigned transaction fields and accepts either the caller's
5523
+ * signed raw transaction or its already-broadcast transaction hash.
5524
+ *
5715
5525
  * @param order - The order to cancel.
5716
- * @param indexerClient - Indexer client used for ISMP request status streaming.
5717
- * @param options - Choose the initiation side. Defaults to source-side cancellation.
5526
+ * @param indexerClient - Indexer client used for cross-chain ISMP request
5527
+ * status streaming; the same-chain route does not access it.
5528
+ * @param options - Choose the cross-chain initiation side. Defaults to source;
5529
+ * ignored for routing when source and destination are the same chain.
5718
5530
  * @yields {@link CancelEvent} objects describing each cancellation stage.
5719
5531
  */
5720
5532
  cancelOrder(order: Order, indexerClient: IsmpClient, options?: CancelOrderOptions): AsyncGenerator<CancelEvent>;
@@ -5836,15 +5648,23 @@ declare class IntentGateway {
5836
5648
  */
5837
5649
  decodeERC7821Execute(callData: HexString$1): ERC7821Call[] | null;
5838
5650
  /**
5839
- * Checks whether an order has been filled on the destination chain.
5651
+ * Checks whether an order is finalized on the destination chain.
5840
5652
  *
5841
5653
  * Delegates to {@link OrderStatusChecker.isOrderFilled}.
5842
5654
  *
5843
5655
  * @param order - The order to check.
5844
- * @returns `true` if the order's commitment slot on the destination chain is
5845
- * non-zero (i.e. `fillOrder` has been called successfully).
5656
+ * @returns `true` once a completing fill or a destination-side cancellation
5657
+ * has finalized the order; `false` while it is open or only partly filled.
5846
5658
  */
5847
5659
  isOrderFilled(order: Order): Promise<boolean>;
5660
+ /**
5661
+ * Output credited to the order so far, one entry per leg.
5662
+ *
5663
+ * Delegates to {@link OrderStatusChecker.getFillProgress}.
5664
+ *
5665
+ * @param order - The order to check.
5666
+ */
5667
+ getFillProgress(order: Order): Promise<TokenInfo[]>;
5848
5668
  /**
5849
5669
  * Checks whether all escrowed inputs for an order have been refunded on the
5850
5670
  * source chain.
@@ -5852,8 +5672,8 @@ declare class IntentGateway {
5852
5672
  * Delegates to {@link OrderStatusChecker.isOrderRefunded}.
5853
5673
  *
5854
5674
  * @param order - The order to check.
5855
- * @returns `true` if every input token's escrowed amount has been zeroed out
5856
- * in the `_orders` mapping on the source chain.
5675
+ * @returns `true` if every input's escrowed amount has been zeroed out
5676
+ * in the per-leg `_orders` mapping on the source chain.
5857
5677
  */
5858
5678
  isOrderRefunded(order: Order): Promise<boolean>;
5859
5679
  /**
@@ -5902,16 +5722,6 @@ declare class IntentGateway {
5902
5722
  }, void>;
5903
5723
  }
5904
5724
 
5905
- declare class InvalidLiquidityIndexerResponseError extends Error {
5906
- constructor(reason: string);
5907
- }
5908
- declare class UnsupportedLiquidityAssetError extends Error {
5909
- constructor(chain: string, asset: string);
5910
- }
5911
- declare class UnsupportedLiquidityChainError extends Error {
5912
- constructor(chainId: number | string);
5913
- }
5914
-
5915
5725
  /**
5916
5726
  * Canonical symbol order used by the SDK and indexer pool IDs.
5917
5727
  *
@@ -5936,20 +5746,28 @@ declare class OrderStatusChecker {
5936
5746
  */
5937
5747
  constructor(ctx: IntentGatewayContext);
5938
5748
  /**
5939
- * Checks if a V2 order has been filled by reading the commitment storage slot on the destination chain.
5940
- *
5941
- * Reads the storage slot returned by `calculateCommitmentSlotHash` on the IntentGatewayV2 contract.
5942
- * A non-zero value at that slot means the solver has called `fillOrder` and the order is complete
5943
- * from the user's perspective (the beneficiary has received their tokens).
5749
+ * Whether the order is finalized on the destination chain, read from the gateway's `_filled`
5750
+ * getter. It is set by the completing fill, and by a cancellation, which records the refund
5751
+ * beneficiary there. A partially filled order reads false; see {@link getFillProgress}.
5944
5752
  *
5945
5753
  * @param order - The V2 order to check. `order.id` is used as the commitment; if not set it is computed.
5946
- * @returns True if the order has been filled on the destination chain, false otherwise.
5947
5754
  */
5948
5755
  isOrderFilled(order: Order): Promise<boolean>;
5756
+ /**
5757
+ * Output credited to the order so far, one entry per leg, read from `_partialFills` on the
5758
+ * destination chain. Several solvers can each fill a slice of a same-chain or cross-chain order,
5759
+ * so this, not {@link isOrderFilled}, says how far along an open order is. Surplus paid above
5760
+ * the order's rate is not counted.
5761
+ *
5762
+ * @param order - The V2 order to check. `order.id` is used as the commitment; if not set it is computed.
5763
+ */
5764
+ getFillProgress(order: Order): Promise<TokenInfo[]>;
5949
5765
  /**
5950
5766
  * Checks if a V2 order has been refunded by reading the `_orders` mapping on the source chain.
5951
5767
  *
5952
- * Calls `_orders(commitment, tokenAddress)` for each input token. When the order is placed the
5768
+ * Calls `_orders(commitment, index)` for each input: escrow is held per leg, keyed by the input's
5769
+ * index, so inputs that repeat a token are read separately. A gateway not yet upgraded to per-leg
5770
+ * escrow is read by token instead, see {@link readLegEscrow}. When the order is placed the
5953
5771
  * escrowed amounts are stored there. After a successful refund the contract zeroes them out.
5954
5772
  * An order is considered refunded when all escrowed input amounts have been returned (i.e. are 0).
5955
5773
  *
@@ -5959,6 +5777,31 @@ declare class OrderStatusChecker {
5959
5777
  isOrderRefunded(order: Order): Promise<boolean>;
5960
5778
  }
5961
5779
 
5780
+ type ReadClient = Pick<PublicClient, "readContract">;
5781
+ /**
5782
+ * Escrow held for leg `index` of an order on its source chain: `_orders(commitment, index)`, or
5783
+ * `_orders(commitment, token)` on a gateway that has not been upgraded to per-leg escrow.
5784
+ *
5785
+ * @param client - Public client of the order's source chain.
5786
+ * @param gateway - IntentGatewayV2 address on that chain.
5787
+ * @param commitment - The order commitment.
5788
+ * @param index - Leg index into `order.inputs`.
5789
+ * @param token - `order.inputs[index].token`, as bytes32 or a 20-byte address.
5790
+ */
5791
+ declare function readLegEscrow(client: ReadClient, gateway: HexString$1, commitment: HexString$1, index: number, token: HexString$1): Promise<bigint>;
5792
+ /**
5793
+ * Output delivered so far for leg `index` of an order on its destination chain:
5794
+ * `_partialFills(commitment, index)`, or `_partialFills(commitment, token)` on a gateway that has not
5795
+ * been upgraded to per-leg escrow.
5796
+ *
5797
+ * @param client - Public client of the order's destination chain.
5798
+ * @param gateway - IntentGatewayV2 address on that chain.
5799
+ * @param commitment - The order commitment.
5800
+ * @param index - Leg index into `order.output.assets`.
5801
+ * @param token - `order.output.assets[index].token` as bytes32.
5802
+ */
5803
+ declare function readLegPartialFill(client: ReadClient, gateway: HexString$1, commitment: HexString$1, index: number, token: HexString$1): Promise<bigint>;
5804
+
5962
5805
  declare function encodeERC7821ExecuteBatch(calls: ERC7821Call[]): HexString$1;
5963
5806
  declare function decodeERC7821ExecuteBatch(callData: HexString$1): ERC7821Call[] | null;
5964
5807
 
@@ -6088,17 +5931,32 @@ declare class CryptoUtils {
6088
5931
  static computeUserOpHash(userOp: PackedUserOperation, entryPoint: Hex, chainId: bigint): Hex;
6089
5932
  /**
6090
5933
  * Derives the ERC-4337 nonce key that binds a bid UserOperation to its
6091
- * order and session key: the lower 192 bits of
6092
- * `keccak256(commitment ‖ sessionKey)`. `SolverAccount` rejects bid
6093
- * operations whose nonce key differs — this is what lets the solver sign
6094
- * the plain userOpHash while staying committed to the order and to the
6095
- * session key it bid against.
5934
+ * order, session key and calldata: the lower 192 bits of
5935
+ * `keccak256(commitment ‖ sessionKey ‖ keccak256(callData))`. `SolverAccount`
5936
+ * rejects bid operations whose nonce key differs — this is what lets the
5937
+ * solver sign the plain userOpHash while staying committed to the order and
5938
+ * to the session key it bid against.
5939
+ *
5940
+ * The calldata gives every bid its own key. A solver bidding several prices
5941
+ * on one order signs one op per price, and each is sequence 0 of its own key,
5942
+ * so they execute independently rather than in a sequence where one bid that
5943
+ * is never selected blocks the rest.
6096
5944
  *
6097
5945
  * @param commitment - The order commitment (`order.id`).
6098
5946
  * @param sessionKey - The order's session key address (`order.session`).
5947
+ * @param callData - The UserOperation's `callData`.
6099
5948
  * @returns The 192-bit nonce key as a bigint (pass to `EntryPoint.getNonce`).
6100
5949
  */
6101
- static bidNonceKey(commitment: HexString$1, sessionKey: HexString$1): bigint;
5950
+ static bidNonceKey(commitment: HexString$1, sessionKey: HexString$1, callData: HexString$1): bigint;
5951
+ /**
5952
+ * The identifier Hyperbridge files a bid under: `keccak256` of the UserOp's
5953
+ * `callData`. It is the same hash {@link bidNonceKey} takes, so a bid's
5954
+ * identifier and its nonce key both follow from the op itself, and one
5955
+ * solver's bids on one order are kept apart for the same reason on both sides.
5956
+ *
5957
+ * @param callData - The UserOperation's `callData`.
5958
+ */
5959
+ static bidId(callData: HexString$1): HexString$1;
6102
5960
  /**
6103
5961
  * Builds the EIP-712 typed-data payload whose digest is the EntryPoint v0.8
6104
5962
  * `userOpHash` (i.e. `hashTypedData(packedUserOpTypedData(...)) ===
@@ -6287,213 +6145,54 @@ declare class CryptoUtils {
6287
6145
  decodeERC7821Execute(callData: HexString$1): ERC7821Call[] | null;
6288
6146
  }
6289
6147
 
6290
- /**
6291
- * `FillOptions` gained a `validUntil` field. Adding a field to a struct changes the
6292
- * enclosing function's selector, so `fillOrder` has two incompatible shapes in the wild:
6293
- *
6294
- * v1 fillOrder(Order, (uint256 relayerFee, uint256 nativeDispatchFee, TokenInfo[] outputs))
6295
- * v2 fillOrder(Order, (uint256 relayerFee, uint256 nativeDispatchFee, uint256 validUntil, TokenInfo[] outputs))
6296
- *
6297
- * The selectors differ (`0x5cfb1ea5` vs `0xa5470064`), so a v2 payload sent to a v1
6298
- * deployment finds no matching function and reverts rather than mis-decoding — which is the
6299
- * safe failure, but it does mean callers have to know which shape a gateway speaks.
6300
- */
6301
- type FillOptionsVersion = 1 | 2;
6302
- /**
6303
- * The v1 `fillOrder`, kept only so we can still talk to deployments that predate `validUntil`.
6304
- *
6305
- * Exported because consumers that cannot use {@link decodeFillOrder} still have to accept both
6306
- * shapes. The indexer decodes bid calldata with ethers rather than viem (viem's byte handling
6307
- * throws inside SubQuery's VM2 sandbox), so it rebuilds this decode itself and needs the same
6308
- * definition rather than a second copy that can drift out of step with this one.
6309
- */
6310
- declare const FILL_ORDER_V1_ABI: readonly [{
6148
+ type DecodedFillOrder = {
6149
+ order: Order;
6150
+ options: FillOptions;
6151
+ };
6152
+ /** `fillOrder(Order, FillOptions)` selector, pinned by codec tests; avoids import-time hashing in VM2. */
6153
+ declare const FILL_ORDER_SELECTOR: "0x68ddf058";
6154
+ /** The gateway release this SDK speaks. SolverAccount carries no version, so only the gateway is read. */
6155
+ declare const SUPPORTED_INTENTS_VERSION = 3n;
6156
+ declare const CONTRACT_VERSION_ABI: readonly [{
6311
6157
  readonly type: "function";
6312
- readonly name: "fillOrder";
6313
- readonly stateMutability: "payable";
6314
- readonly outputs: readonly [];
6315
- readonly inputs: readonly [{
6316
- readonly name: "order";
6317
- readonly type: "tuple";
6318
- readonly internalType: "struct Order";
6319
- readonly components: readonly [{
6320
- readonly name: "user";
6321
- readonly type: "bytes32";
6322
- readonly internalType: "bytes32";
6323
- }, {
6324
- readonly name: "source";
6325
- readonly type: "bytes";
6326
- readonly internalType: "bytes";
6327
- }, {
6328
- readonly name: "destination";
6329
- readonly type: "bytes";
6330
- readonly internalType: "bytes";
6331
- }, {
6332
- readonly name: "deadline";
6333
- readonly type: "uint256";
6334
- readonly internalType: "uint256";
6335
- }, {
6336
- readonly name: "nonce";
6337
- readonly type: "uint256";
6338
- readonly internalType: "uint256";
6339
- }, {
6340
- readonly name: "fees";
6341
- readonly type: "uint256";
6342
- readonly internalType: "uint256";
6343
- }, {
6344
- readonly name: "session";
6345
- readonly type: "address";
6346
- readonly internalType: "address";
6347
- }, {
6348
- readonly name: "predispatch";
6349
- readonly type: "tuple";
6350
- readonly internalType: "struct DispatchInfo";
6351
- readonly components: readonly [{
6352
- readonly name: "assets";
6353
- readonly type: "tuple[]";
6354
- readonly internalType: "struct TokenInfo[]";
6355
- readonly components: readonly [{
6356
- readonly name: "token";
6357
- readonly type: "bytes32";
6358
- readonly internalType: "bytes32";
6359
- }, {
6360
- readonly name: "amount";
6361
- readonly type: "uint256";
6362
- readonly internalType: "uint256";
6363
- }];
6364
- }, {
6365
- readonly name: "call";
6366
- readonly type: "bytes";
6367
- readonly internalType: "bytes";
6368
- }];
6369
- }, {
6370
- readonly name: "inputs";
6371
- readonly type: "tuple[]";
6372
- readonly internalType: "struct TokenInfo[]";
6373
- readonly components: readonly [{
6374
- readonly name: "token";
6375
- readonly type: "bytes32";
6376
- readonly internalType: "bytes32";
6377
- }, {
6378
- readonly name: "amount";
6379
- readonly type: "uint256";
6380
- readonly internalType: "uint256";
6381
- }];
6382
- }, {
6383
- readonly name: "output";
6384
- readonly type: "tuple";
6385
- readonly internalType: "struct PaymentInfo";
6386
- readonly components: readonly [{
6387
- readonly name: "beneficiary";
6388
- readonly type: "bytes32";
6389
- readonly internalType: "bytes32";
6390
- }, {
6391
- readonly name: "assets";
6392
- readonly type: "tuple[]";
6393
- readonly internalType: "struct TokenInfo[]";
6394
- readonly components: readonly [{
6395
- readonly name: "token";
6396
- readonly type: "bytes32";
6397
- readonly internalType: "bytes32";
6398
- }, {
6399
- readonly name: "amount";
6400
- readonly type: "uint256";
6401
- readonly internalType: "uint256";
6402
- }];
6403
- }, {
6404
- readonly name: "call";
6405
- readonly type: "bytes";
6406
- readonly internalType: "bytes";
6407
- }];
6408
- }];
6409
- }, {
6410
- readonly name: "options";
6411
- readonly type: "tuple";
6412
- readonly internalType: "struct FillOptions";
6413
- readonly components: readonly [{
6414
- readonly name: "relayerFee";
6415
- readonly type: "uint256";
6416
- readonly internalType: "uint256";
6417
- }, {
6418
- readonly name: "nativeDispatchFee";
6419
- readonly type: "uint256";
6420
- readonly internalType: "uint256";
6421
- }, {
6422
- readonly name: "outputs";
6423
- readonly type: "tuple[]";
6424
- readonly internalType: "struct TokenInfo[]";
6425
- readonly components: readonly [{
6426
- readonly name: "token";
6427
- readonly type: "bytes32";
6428
- readonly internalType: "bytes32";
6429
- }, {
6430
- readonly name: "amount";
6431
- readonly type: "uint256";
6432
- readonly internalType: "uint256";
6433
- }];
6434
- }];
6158
+ readonly name: "version";
6159
+ readonly stateMutability: "view";
6160
+ readonly inputs: readonly [];
6161
+ readonly outputs: readonly [{
6162
+ readonly name: "";
6163
+ readonly type: "uint64";
6435
6164
  }];
6436
6165
  }];
6437
- /**
6438
- * IntentGateway implementations deployed before `FillOptions.validUntil` existed.
6166
+ /** Whether the gateway reports the supported release. RPC failures propagate. */
6167
+ declare function supportsRateFills(client: PublicClient, gateway: HexString$1): Promise<boolean>;
6168
+ /** The gateway must report release {@link SUPPORTED_INTENTS_VERSION}; a missing getter or any other release throws. */
6169
+ declare function assertGatewayRelease(client: PublicClient, gateway: HexString$1): Promise<void>;
6170
+ /** A bytes32 token whose upper 12 bytes are zero, the only form the gateway accepts. */
6171
+ declare function isCanonicalEvmToken(token: string): boolean;
6172
+ /** ABI-encodes a `fillOrder` call. Every leg must carry a validated quote. */
6173
+ declare function encodeFillOrder(order: Order, options: FillOptions): HexString$1;
6174
+ /**
6175
+ * Decodes a `fillOrder` call.
6439
6176
  *
6440
- * The list is of *legacy* implementations rather than current ones, so the default is v2 and
6441
- * nothing has to be added here when a new implementation ships — only when an old one is
6442
- * discovered. Once every deployment is upgraded this set is vestigial and still correct.
6443
- *
6444
- * The alternative, listing known-good implementations, would be the version constant this
6445
- * replaced wearing a different hat: a value someone must remember to update on every upgrade,
6446
- * where forgetting breaks every fill on the chain.
6447
- */
6448
- declare const LEGACY_FILL_OPTIONS_IMPLEMENTATIONS: Set<string>;
6449
- /**
6450
- * Chains whose IntentGateway has not been redeployed with `FillOptions.validUntil` yet.
6451
- *
6452
- * A blunter instrument than {@link LEGACY_FILL_OPTIONS_IMPLEMENTATIONS} and used for the same
6453
- * reason: those chains run a pre-`validUntil` implementation whose address is not tracked here,
6454
- * so the address check would wrongly read them as current and every fill would revert on a
6455
- * selector that does not exist.
6456
- *
6457
- * Delete a chain from this set when its gateway is redeployed. Once the set is empty the
6458
- * implementation-address check covers everything on its own.
6459
- */
6460
- declare const CHAINS_WITHOUT_VALID_UNTIL: Set<number>;
6461
- /** Test seam: drop memoised detection results. */
6462
- declare function resetFillOptionsVersionCache(): void;
6463
- /**
6464
- * Works out which `FillOptions` shape a gateway accepts from the implementation it delegates to.
6465
- *
6466
- * EIP-1967 standardises three slots, all holding addresses — there is no version field to read,
6467
- * and the contract deliberately does not carry one either: a hand-maintained version constant is
6468
- * a second source of truth that has to be bumped on the right upgrade. The implementation address
6469
- * is the value the proxy already updates, so it is what identifies the deployed code.
6470
- */
6471
- declare function getFillOptionsVersion(client: PublicClient, gateway: HexString$1): Promise<FillOptionsVersion>;
6472
- /**
6473
- * ABI-encodes a `fillOrder` call in the shape the target gateway understands.
6474
- *
6475
- * On a v1 gateway `validUntil` is dropped — there is nowhere to put it and no check on the
6476
- * other side. That is a real loss of protection, so callers that rely on the bound should
6477
- * surface it rather than assume it took effect.
6177
+ * @returns The decoded order and options, or `null` if the calldata is not a `fillOrder` call in
6178
+ * the current shape or its quotes do not cover the order's legs.
6478
6179
  */
6479
- declare function encodeFillOrder(order: Order, options: FillOptions, version: FillOptionsVersion): HexString$1;
6480
- /**
6481
- * Decodes a `fillOrder` call of either shape.
6482
- *
6483
- * v2 is tried first and v1 is the fallback; the selectors differ, so there is no shape a
6484
- * decode could silently get wrong. `validUntil` reads as `0n` for a v1 payload, which is the
6485
- * same value that means "no bound" in v2 — accurate, since a v1 fill genuinely has none.
6486
- *
6487
- * @returns The decoded order and options, or `null` if the calldata is not a `fillOrder`.
6488
- */
6489
- declare function decodeFillOrder(data: HexString$1): {
6490
- order: Order;
6491
- options: FillOptions;
6492
- } | null;
6180
+ declare function decodeFillOrder(data: HexString$1): DecodedFillOrder | null;
6181
+
6182
+ interface RateFillPreview {
6183
+ credit: bigint;
6184
+ release: bigint;
6185
+ delivered: bigint;
6186
+ surplus: bigint;
6187
+ }
6188
+ /** Estimates settlement at the supplied progress. The signed take/offered amounts remain caps. */
6189
+ declare function previewRateFill(escrow: bigint, required: bigint, filled: bigint, take: bigint, offered: bigint): RateFillPreview;
6493
6190
 
6494
6191
  type HexString = `0x${string}`;
6495
6192
  /** A complete Permit2-sponsored paymasterAndData, before any declaration is appended. */
6496
6193
  declare const PERMIT2_SPONSORSHIP_BYTES: number;
6194
+ /** Upper bound on declared chains and positions alike; one byte of count each. */
6195
+ declare const MAX_DECLARED_ENTRIES = 255;
6497
6196
  /**
6498
6197
  * The Permit2 sponsorship a bid's paymasterAndData carries when it was built on the real-bid path:
6499
6198
  * which paymaster it names and the fee-token permit it signed for that paymaster. Read for the
@@ -6519,8 +6218,8 @@ interface PhantomBidDeclaration {
6519
6218
  */
6520
6219
  acceptedSources: string[] | null;
6521
6220
  /**
6522
- * Uniswap V4 position tokenIds the solver declares as backing this bid, on the order's own
6523
- * chain. Empty when none are declared — including for every v1 bid, which predates the field.
6221
+ * Uniswap V4 position tokenIds from a v2 declaration. Decoded for compatibility only; nothing
6222
+ * prices them. Empty when none are declared — including for every v1 bid.
6524
6223
  */
6525
6224
  uniswapV4Positions: bigint[];
6526
6225
  }
@@ -6572,7 +6271,7 @@ declare function decodePhantomBidDeclaration(paymasterAndData: string | undefine
6572
6271
  *
6573
6272
  * `sponsorship` is the packed EntryPoint v0.8 paymasterAndData the paymaster builder produced. It
6574
6273
  * must be exactly the Permit2-mode layout — the only one the decoder recognises — so a caller
6575
- * cannot sign bytes the aggregation would read as "no declaration"; anything else throws. Empty
6274
+ * cannot sign bytes a decoder would read as "no declaration"; anything else throws. Empty
6576
6275
  * or omitted, the result is the bare declaration, byte-identical to what unsponsored bids carry.
6577
6276
  */
6578
6277
  declare function encodePhantomBidPaymasterAndData(bid: {
@@ -6584,39 +6283,15 @@ declare function encodePhantomBidPaymasterAndData(bid: {
6584
6283
  declare function encodeAcceptedSourceChains(chains: string[]): HexString;
6585
6284
  /** Back-compat wrapper: the source-chain half of {@link decodePhantomBidDeclaration}. */
6586
6285
  declare function decodeAcceptedSourceChains(paymasterAndData: string | undefined | null): string[] | null;
6587
- /**
6588
- * Haircut applied to a quote that is priced off a Uniswap V4 pool, in basis points.
6589
- *
6590
- * A bid that declares V4 positions is quoting off those pools, and a pool price is what a trade
6591
- * gets BEFORE the pool takes its fee — so the amount such a bid names is more than the solver
6592
- * would actually be left holding once the swap that sources it clears. Netting that cost out here
6593
- * is what makes a pool-priced quote comparable to a wallet-funded one, whose inventory has already
6594
- * paid its cost of goods.
6595
- */
6596
- declare const UNISWAP_QUOTE_HAIRCUT_BPS = 10n;
6597
- /** Applies {@link UNISWAP_QUOTE_HAIRCUT_BPS} to a quoted output amount, rounding down. */
6598
- declare function applyUniswapQuoteHaircut(amount: bigint): bigint;
6599
- /**
6600
- * The protocol fee haircut: the fee the IntentGateway at `gatewayAddress` charges on order inputs,
6601
- * in basis points, read live from its `params()`.
6602
- *
6603
- * A wallet-funded quote is shaded by exactly this, so the published rate is the one a taker
6604
- * actually realizes after the gateway takes its cut, and it moves with governance rather than
6605
- * with a constant someone has to remember to keep in step. Read on the phantom order's own chain,
6606
- * which is the chain whose gateway will collect the fee on the fills this rate is published for.
6607
- *
6608
- * Fails loudly rather than defaulting: a gateway that returns no code, or a fee at or above 100%,
6609
- * is a misconfiguration, and pricing a window unhaircut on the back of it would publish a rate
6610
- * nobody can trade at. The `PhantomRpcError` lets the run's retry loop have another go first.
6611
- */
6612
- declare function readProtocolFeeHaircutBps(evmRpcUrl: string, gatewayAddress: string): Promise<bigint>;
6613
- /** Applies the protocol fee haircut (see {@link readProtocolFeeHaircutBps}) to a quoted output amount, rounding down. */
6614
- declare function applyProtocolFeeHaircut(amount: bigint, protocolFeeBps: bigint): bigint;
6615
6286
 
6616
6287
  declare const ABI$1: readonly [{
6617
6288
  readonly type: "constructor";
6618
6289
  readonly inputs: readonly [{
6619
- readonly name: "owner";
6290
+ readonly name: "intrinsic";
6291
+ readonly type: "address";
6292
+ readonly internalType: "address";
6293
+ }, {
6294
+ readonly name: "extrinsic";
6620
6295
  readonly type: "address";
6621
6296
  readonly internalType: "address";
6622
6297
  }];
@@ -6691,8 +6366,8 @@ declare const ABI$1: readonly [{
6691
6366
  readonly internalType: "bytes32";
6692
6367
  }, {
6693
6368
  readonly name: "";
6694
- readonly type: "address";
6695
- readonly internalType: "address";
6369
+ readonly type: "uint256";
6370
+ readonly internalType: "uint256";
6696
6371
  }];
6697
6372
  readonly outputs: readonly [{
6698
6373
  readonly name: "";
@@ -6702,32 +6377,50 @@ declare const ABI$1: readonly [{
6702
6377
  readonly stateMutability: "view";
6703
6378
  }, {
6704
6379
  readonly type: "function";
6705
- readonly name: "_owner";
6706
- readonly inputs: readonly [];
6380
+ readonly name: "_partialFills";
6381
+ readonly inputs: readonly [{
6382
+ readonly name: "";
6383
+ readonly type: "bytes32";
6384
+ readonly internalType: "bytes32";
6385
+ }, {
6386
+ readonly name: "";
6387
+ readonly type: "uint256";
6388
+ readonly internalType: "uint256";
6389
+ }];
6707
6390
  readonly outputs: readonly [{
6708
6391
  readonly name: "";
6709
- readonly type: "address";
6710
- readonly internalType: "address";
6392
+ readonly type: "uint256";
6393
+ readonly internalType: "uint256";
6711
6394
  }];
6712
6395
  readonly stateMutability: "view";
6713
6396
  }, {
6714
6397
  readonly type: "function";
6715
- readonly name: "_partialFills";
6398
+ readonly name: "_protocolFees";
6716
6399
  readonly inputs: readonly [{
6717
6400
  readonly name: "";
6718
6401
  readonly type: "bytes32";
6719
6402
  readonly internalType: "bytes32";
6720
6403
  }, {
6721
6404
  readonly name: "";
6722
- readonly type: "bytes32";
6723
- readonly internalType: "bytes32";
6405
+ readonly type: "uint256";
6406
+ readonly internalType: "uint256";
6724
6407
  }];
6725
6408
  readonly outputs: readonly [{
6726
- readonly name: "";
6409
+ readonly name: "amount";
6410
+ readonly type: "uint256";
6411
+ readonly internalType: "uint256";
6412
+ }, {
6413
+ readonly name: "committed";
6727
6414
  readonly type: "uint256";
6728
6415
  readonly internalType: "uint256";
6729
6416
  }];
6730
6417
  readonly stateMutability: "view";
6418
+ }, {
6419
+ readonly type: "function";
6420
+ readonly name: "acceptOwnership";
6421
+ readonly inputs: readonly [];
6422
+ readonly outputs: readonly [];
6423
+ readonly stateMutability: "nonpayable";
6731
6424
  }, {
6732
6425
  readonly type: "function";
6733
6426
  readonly name: "calculateCommitmentSlotHash";
@@ -6889,6 +6582,16 @@ declare const ABI$1: readonly [{
6889
6582
  readonly internalType: "uint256[]";
6890
6583
  }];
6891
6584
  readonly stateMutability: "view";
6585
+ }, {
6586
+ readonly type: "function";
6587
+ readonly name: "extrinsicModule";
6588
+ readonly inputs: readonly [];
6589
+ readonly outputs: readonly [{
6590
+ readonly name: "";
6591
+ readonly type: "address";
6592
+ readonly internalType: "address";
6593
+ }];
6594
+ readonly stateMutability: "view";
6892
6595
  }, {
6893
6596
  readonly type: "function";
6894
6597
  readonly name: "fillOrder";
@@ -7015,6 +6718,19 @@ declare const ABI$1: readonly [{
7015
6718
  readonly type: "uint256";
7016
6719
  readonly internalType: "uint256";
7017
6720
  }];
6721
+ }, {
6722
+ readonly name: "inputs";
6723
+ readonly type: "tuple[]";
6724
+ readonly internalType: "struct TokenInfo[]";
6725
+ readonly components: readonly [{
6726
+ readonly name: "token";
6727
+ readonly type: "bytes32";
6728
+ readonly internalType: "bytes32";
6729
+ }, {
6730
+ readonly name: "amount";
6731
+ readonly type: "uint256";
6732
+ readonly internalType: "uint256";
6733
+ }];
7018
6734
  }];
7019
6735
  }];
7020
6736
  readonly outputs: readonly [];
@@ -7033,42 +6749,51 @@ declare const ABI$1: readonly [{
7033
6749
  readonly type: "function";
7034
6750
  readonly name: "initialize";
7035
6751
  readonly inputs: readonly [{
7036
- readonly name: "p";
6752
+ readonly name: "init";
7037
6753
  readonly type: "tuple";
7038
- readonly internalType: "struct Params";
6754
+ readonly internalType: "struct InitParams";
7039
6755
  readonly components: readonly [{
7040
- readonly name: "host";
7041
- readonly type: "address";
7042
- readonly internalType: "address";
6756
+ readonly name: "params";
6757
+ readonly type: "tuple";
6758
+ readonly internalType: "struct Params";
6759
+ readonly components: readonly [{
6760
+ readonly name: "host";
6761
+ readonly type: "address";
6762
+ readonly internalType: "address";
6763
+ }, {
6764
+ readonly name: "dispatcher";
6765
+ readonly type: "address";
6766
+ readonly internalType: "address";
6767
+ }, {
6768
+ readonly name: "solverSelection";
6769
+ readonly type: "bool";
6770
+ readonly internalType: "bool";
6771
+ }, {
6772
+ readonly name: "surplusShareBps";
6773
+ readonly type: "uint256";
6774
+ readonly internalType: "uint256";
6775
+ }, {
6776
+ readonly name: "protocolFeeBps";
6777
+ readonly type: "uint256";
6778
+ readonly internalType: "uint256";
6779
+ }, {
6780
+ readonly name: "priceOracle";
6781
+ readonly type: "address";
6782
+ readonly internalType: "address";
6783
+ }];
7043
6784
  }, {
7044
- readonly name: "dispatcher";
6785
+ readonly name: "peerChains";
6786
+ readonly type: "bytes[]";
6787
+ readonly internalType: "bytes[]";
6788
+ }, {
6789
+ readonly name: "relayer";
7045
6790
  readonly type: "address";
7046
6791
  readonly internalType: "address";
7047
6792
  }, {
7048
- readonly name: "solverSelection";
7049
- readonly type: "bool";
7050
- readonly internalType: "bool";
7051
- }, {
7052
- readonly name: "surplusShareBps";
7053
- readonly type: "uint256";
7054
- readonly internalType: "uint256";
7055
- }, {
7056
- readonly name: "protocolFeeBps";
7057
- readonly type: "uint256";
7058
- readonly internalType: "uint256";
7059
- }, {
7060
- readonly name: "priceOracle";
6793
+ readonly name: "owner";
7061
6794
  readonly type: "address";
7062
6795
  readonly internalType: "address";
7063
6796
  }];
7064
- }, {
7065
- readonly name: "peerChains";
7066
- readonly type: "bytes[]";
7067
- readonly internalType: "bytes[]";
7068
- }, {
7069
- readonly name: "relayer";
7070
- readonly type: "address";
7071
- readonly internalType: "address";
7072
6797
  }];
7073
6798
  readonly outputs: readonly [];
7074
6799
  readonly stateMutability: "nonpayable";
@@ -7086,11 +6811,21 @@ declare const ABI$1: readonly [{
7086
6811
  readonly internalType: "address";
7087
6812
  }];
7088
6813
  readonly stateMutability: "view";
6814
+ }, {
6815
+ readonly type: "function";
6816
+ readonly name: "intrinsicModule";
6817
+ readonly inputs: readonly [];
6818
+ readonly outputs: readonly [{
6819
+ readonly name: "";
6820
+ readonly type: "address";
6821
+ readonly internalType: "address";
6822
+ }];
6823
+ readonly stateMutability: "view";
7089
6824
  }, {
7090
6825
  readonly type: "function";
7091
6826
  readonly name: "migrate";
7092
6827
  readonly inputs: readonly [{
7093
- readonly name: "relayer";
6828
+ readonly name: "owner_";
7094
6829
  readonly type: "address";
7095
6830
  readonly internalType: "address";
7096
6831
  }];
@@ -7148,7 +6883,7 @@ declare const ABI$1: readonly [{
7148
6883
  readonly type: "function";
7149
6884
  readonly name: "onGetResponse";
7150
6885
  readonly inputs: readonly [{
7151
- readonly name: "incoming";
6886
+ readonly name: "";
7152
6887
  readonly type: "tuple";
7153
6888
  readonly internalType: "struct IncomingGetResponse";
7154
6889
  readonly components: readonly [{
@@ -7314,6 +7049,16 @@ declare const ABI$1: readonly [{
7314
7049
  }];
7315
7050
  readonly outputs: readonly [];
7316
7051
  readonly stateMutability: "nonpayable";
7052
+ }, {
7053
+ readonly type: "function";
7054
+ readonly name: "owner";
7055
+ readonly inputs: readonly [];
7056
+ readonly outputs: readonly [{
7057
+ readonly name: "";
7058
+ readonly type: "address";
7059
+ readonly internalType: "address";
7060
+ }];
7061
+ readonly stateMutability: "view";
7317
7062
  }, {
7318
7063
  readonly type: "function";
7319
7064
  readonly name: "params";
@@ -7349,6 +7094,32 @@ declare const ABI$1: readonly [{
7349
7094
  }];
7350
7095
  }];
7351
7096
  readonly stateMutability: "view";
7097
+ }, {
7098
+ readonly type: "function";
7099
+ readonly name: "pause";
7100
+ readonly inputs: readonly [];
7101
+ readonly outputs: readonly [];
7102
+ readonly stateMutability: "nonpayable";
7103
+ }, {
7104
+ readonly type: "function";
7105
+ readonly name: "paused";
7106
+ readonly inputs: readonly [];
7107
+ readonly outputs: readonly [{
7108
+ readonly name: "";
7109
+ readonly type: "bool";
7110
+ readonly internalType: "bool";
7111
+ }];
7112
+ readonly stateMutability: "view";
7113
+ }, {
7114
+ readonly type: "function";
7115
+ readonly name: "pendingOwner";
7116
+ readonly inputs: readonly [];
7117
+ readonly outputs: readonly [{
7118
+ readonly name: "";
7119
+ readonly type: "address";
7120
+ readonly internalType: "address";
7121
+ }];
7122
+ readonly stateMutability: "view";
7352
7123
  }, {
7353
7124
  readonly type: "function";
7354
7125
  readonly name: "placeOrder";
@@ -7545,6 +7316,12 @@ declare const ABI$1: readonly [{
7545
7316
  readonly internalType: "address";
7546
7317
  }];
7547
7318
  readonly stateMutability: "view";
7319
+ }, {
7320
+ readonly type: "function";
7321
+ readonly name: "renounceOwnership";
7322
+ readonly inputs: readonly [];
7323
+ readonly outputs: readonly [];
7324
+ readonly stateMutability: "nonpayable";
7548
7325
  }, {
7549
7326
  readonly type: "function";
7550
7327
  readonly name: "select";
@@ -7574,9 +7351,9 @@ declare const ABI$1: readonly [{
7574
7351
  readonly stateMutability: "nonpayable";
7575
7352
  }, {
7576
7353
  readonly type: "function";
7577
- readonly name: "setRelayer";
7354
+ readonly name: "transferOwnership";
7578
7355
  readonly inputs: readonly [{
7579
- readonly name: "relayer";
7356
+ readonly name: "newOwner";
7580
7357
  readonly type: "address";
7581
7358
  readonly internalType: "address";
7582
7359
  }];
@@ -7584,16 +7361,8 @@ declare const ABI$1: readonly [{
7584
7361
  readonly stateMutability: "nonpayable";
7585
7362
  }, {
7586
7363
  readonly type: "function";
7587
- readonly name: "upgradeToAndCall";
7588
- readonly inputs: readonly [{
7589
- readonly name: "newImplementation";
7590
- readonly type: "address";
7591
- readonly internalType: "address";
7592
- }, {
7593
- readonly name: "data";
7594
- readonly type: "bytes";
7595
- readonly internalType: "bytes";
7596
- }];
7364
+ readonly name: "unpause";
7365
+ readonly inputs: readonly [];
7597
7366
  readonly outputs: readonly [];
7598
7367
  readonly stateMutability: "nonpayable";
7599
7368
  }, {
@@ -7708,6 +7477,11 @@ declare const ABI$1: readonly [{
7708
7477
  readonly type: "bytes32";
7709
7478
  readonly indexed: true;
7710
7479
  readonly internalType: "bytes32";
7480
+ }, {
7481
+ readonly name: "solver";
7482
+ readonly type: "address";
7483
+ readonly indexed: false;
7484
+ readonly internalType: "address";
7711
7485
  }, {
7712
7486
  readonly name: "tokens";
7713
7487
  readonly type: "tuple[]";
@@ -7894,6 +7668,36 @@ declare const ABI$1: readonly [{
7894
7668
  readonly internalType: "bytes32";
7895
7669
  }];
7896
7670
  readonly anonymous: false;
7671
+ }, {
7672
+ readonly type: "event";
7673
+ readonly name: "OwnershipTransferStarted";
7674
+ readonly inputs: readonly [{
7675
+ readonly name: "previousOwner";
7676
+ readonly type: "address";
7677
+ readonly indexed: true;
7678
+ readonly internalType: "address";
7679
+ }, {
7680
+ readonly name: "newOwner";
7681
+ readonly type: "address";
7682
+ readonly indexed: true;
7683
+ readonly internalType: "address";
7684
+ }];
7685
+ readonly anonymous: false;
7686
+ }, {
7687
+ readonly type: "event";
7688
+ readonly name: "OwnershipTransferred";
7689
+ readonly inputs: readonly [{
7690
+ readonly name: "previousOwner";
7691
+ readonly type: "address";
7692
+ readonly indexed: true;
7693
+ readonly internalType: "address";
7694
+ }, {
7695
+ readonly name: "newOwner";
7696
+ readonly type: "address";
7697
+ readonly indexed: true;
7698
+ readonly internalType: "address";
7699
+ }];
7700
+ readonly anonymous: false;
7897
7701
  }, {
7898
7702
  readonly type: "event";
7899
7703
  readonly name: "ParamsUpdated";
@@ -8004,37 +7808,59 @@ declare const ABI$1: readonly [{
8004
7808
  readonly anonymous: false;
8005
7809
  }, {
8006
7810
  readonly type: "event";
8007
- readonly name: "RelayerUpdated";
7811
+ readonly name: "Paused";
8008
7812
  readonly inputs: readonly [{
8009
- readonly name: "previous";
7813
+ readonly name: "account";
8010
7814
  readonly type: "address";
8011
7815
  readonly indexed: false;
8012
7816
  readonly internalType: "address";
7817
+ }];
7818
+ readonly anonymous: false;
7819
+ }, {
7820
+ readonly type: "event";
7821
+ readonly name: "ProtocolFeeRefunded";
7822
+ readonly inputs: readonly [{
7823
+ readonly name: "commitment";
7824
+ readonly type: "bytes32";
7825
+ readonly indexed: true;
7826
+ readonly internalType: "bytes32";
8013
7827
  }, {
8014
- readonly name: "current";
7828
+ readonly name: "token";
8015
7829
  readonly type: "address";
8016
- readonly indexed: false;
7830
+ readonly indexed: true;
8017
7831
  readonly internalType: "address";
7832
+ }, {
7833
+ readonly name: "amount";
7834
+ readonly type: "uint256";
7835
+ readonly indexed: false;
7836
+ readonly internalType: "uint256";
8018
7837
  }];
8019
7838
  readonly anonymous: false;
8020
7839
  }, {
8021
7840
  readonly type: "event";
8022
- readonly name: "Upgraded";
7841
+ readonly name: "RelayerUpdated";
8023
7842
  readonly inputs: readonly [{
8024
- readonly name: "implementation";
7843
+ readonly name: "previous";
8025
7844
  readonly type: "address";
8026
- readonly indexed: true;
7845
+ readonly indexed: false;
7846
+ readonly internalType: "address";
7847
+ }, {
7848
+ readonly name: "current";
7849
+ readonly type: "address";
7850
+ readonly indexed: false;
8027
7851
  readonly internalType: "address";
8028
7852
  }];
8029
7853
  readonly anonymous: false;
8030
7854
  }, {
8031
- readonly type: "error";
8032
- readonly name: "AddressEmptyCode";
7855
+ readonly type: "event";
7856
+ readonly name: "Unpaused";
8033
7857
  readonly inputs: readonly [{
8034
- readonly name: "target";
7858
+ readonly name: "account";
8035
7859
  readonly type: "address";
7860
+ readonly indexed: false;
8036
7861
  readonly internalType: "address";
8037
7862
  }];
7863
+ readonly anonymous: false;
8038
7864
  }, {
8039
7865
  readonly type: "error";
8040
7866
  readonly name: "Cancelled";
@@ -8061,23 +7887,15 @@ declare const ABI$1: readonly [{
8061
7887
  }];
8062
7888
  }, {
8063
7889
  readonly type: "error";
8064
- readonly name: "ERC1967InvalidImplementation";
8065
- readonly inputs: readonly [{
8066
- readonly name: "implementation";
8067
- readonly type: "address";
8068
- readonly internalType: "address";
8069
- }];
8070
- }, {
8071
- readonly type: "error";
8072
- readonly name: "ERC1967NonPayable";
7890
+ readonly name: "EnforcedPause";
8073
7891
  readonly inputs: readonly [];
8074
7892
  }, {
8075
7893
  readonly type: "error";
8076
- readonly name: "Expired";
7894
+ readonly name: "ExpectedPause";
8077
7895
  readonly inputs: readonly [];
8078
7896
  }, {
8079
7897
  readonly type: "error";
8080
- readonly name: "FailedCall";
7898
+ readonly name: "Expired";
8081
7899
  readonly inputs: readonly [];
8082
7900
  }, {
8083
7901
  readonly type: "error";
@@ -8111,10 +7929,34 @@ declare const ABI$1: readonly [{
8111
7929
  readonly type: "error";
8112
7930
  readonly name: "NotInitializing";
8113
7931
  readonly inputs: readonly [];
7932
+ }, {
7933
+ readonly type: "error";
7934
+ readonly name: "OwnableInvalidOwner";
7935
+ readonly inputs: readonly [{
7936
+ readonly name: "owner";
7937
+ readonly type: "address";
7938
+ readonly internalType: "address";
7939
+ }];
7940
+ }, {
7941
+ readonly type: "error";
7942
+ readonly name: "OwnableUnauthorizedAccount";
7943
+ readonly inputs: readonly [{
7944
+ readonly name: "account";
7945
+ readonly type: "address";
7946
+ readonly internalType: "address";
7947
+ }];
8114
7948
  }, {
8115
7949
  readonly type: "error";
8116
7950
  readonly name: "PartialFillNotAllowed";
8117
7951
  readonly inputs: readonly [];
7952
+ }, {
7953
+ readonly type: "error";
7954
+ readonly name: "RateBelowOrder";
7955
+ readonly inputs: readonly [];
7956
+ }, {
7957
+ readonly type: "error";
7958
+ readonly name: "RateFillTooSmall";
7959
+ readonly inputs: readonly [];
8118
7960
  }, {
8119
7961
  readonly type: "error";
8120
7962
  readonly name: "ReentrancyGuardReentrantCall";
@@ -11639,4 +11481,4 @@ declare function teleport(teleport_param: {
11639
11481
  extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
11640
11482
  }): Promise<ReadableStream<HyperbridgeTxEvents>>;
11641
11483
 
11642
- export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type AvailableLiquidity, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, type BytesLikeHex, CHAINS_WITHOUT_VALID_UNTIL, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, type ConfiguredAssetSymbolInput, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type Erc4626VaultConfigData, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, FILL_ORDER_V1_ABI, type FillOptions, type FillOptionsVersion, type FillOrderEstimate, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString$1 as HexString, type HostParams, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, type IBatchConsensusAndGetResponseMessage, type IBatchConsensusAndPostRequestMessage, type IChain, type IConfig, type IConsensusMessage, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, INCLUSION_TIMEOUT_MS, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexedRateIntentQuoteMetadata, type IndexedRateQuoteIntentResult, type IndexedRateSide, IndexedRateUnavailableError, type IndexerQueryClient, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidIndexedRateError, InvalidLiquidityIndexerResponseError, InvalidPhantomSnapshotError, IsmpClient, type IsmpRequest, LEGACY_FILL_OPTIONS_IMPLEMENTATIONS, type LiquiditySlice, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, type Order, type OrderFeesQuote, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PERMIT2_SPONSORSHIP_BYTES, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PhantomBid, type PhantomBidBatchResult, type PhantomBidDeclaration, type PhantomBidOutcome, type PhantomBidPaymasterAndData, type PhantomBidSponsorship, type PhantomOrderEvent, type PhantomOrderLeg, type PhantomOrderPriceSnapshot, type PhantomOrderPriceSnapshotsResponse, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, type PhantomTimings, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, type PollPhantomOrdersOptions, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type 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 RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type ResumeIntentOrderOptions, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineId, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, UNISWAP_QUOTE_HAIRCUT_BPS, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolConfigData, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, applyProtocolFeeHaircut, applyUniswapQuoteHaircut, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodeFillOrder, decodePhantomBidDeclaration, decodePhantomBidPaymasterAndData, decodeUserOpScale, deriveHttpUrl, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodeFillOrder, encodeISMPMessage, encodePhantomBidDeclaration, encodePhantomBidPaymasterAndData, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getFillOptionsVersion, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, poolSlug, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readProtocolFeeHaircutBps, requestCommitmentKey, resetFillOptionsVersionCache, responseCommitmentKey, retryPromise, sortPoolSymbols, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
11484
+ export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type AvailableLiquidity, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, type BytesLikeHex, CONTRACT_VERSION_ABI, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, type ConfiguredAssetSymbolInput, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type Erc4626VaultConfigData, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, FILL_ORDER_SELECTOR, type FillOptions, type FillOrderEstimate, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString$1 as HexString, type HostParams, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, type IBatchConsensusAndGetResponseMessage, type IBatchConsensusAndPostRequestMessage, type IChain, type IConfig, type IConsensusMessage, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, INCLUSION_TIMEOUT_MS, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, InsufficientOrderbookLiquidityError, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteMetadata, type IntentQuoteTradeType, IntentsCoprocessor, IsmpClient, type IsmpRequest, MAX_DECLARED_ENTRIES, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, type Order, type OrderFeesQuote, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, type OrderbookBook, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PERMIT2_SPONSORSHIP_BYTES, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PhantomBidDeclaration, type PhantomBidPaymasterAndData, type PhantomBidSponsorship, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type 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, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type ResumeIntentOrderOptions, type RetryConfig, type RpcBidInfo, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineId, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type 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, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodeFillOrder, decodePhantomBidDeclaration, decodePhantomBidPaymasterAndData, decodeUserOpScale, deriveHttpUrl, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodeFillOrder, encodeISMPMessage, encodePhantomBidDeclaration, encodePhantomBidPaymasterAndData, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, poolSlug, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, sortPoolSymbols, supportsRateFills, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };