@hyperbridge/sdk 2.8.13 → 2.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.ts +839 -911
- package/dist/browser/index.js +1435 -2081
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +1455 -2099
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +492 -180
- package/dist/node/index.d.ts +492 -180
- package/dist/node/index.js +1435 -2081
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-fntBuoYM.d.cts → intents-helpers-BHl2If1T.d.cts} +909 -2967
- package/dist/node/{intents-helpers-fntBuoYM.d.ts → intents-helpers-BHl2If1T.d.ts} +909 -2967
- package/dist/node/intents-helpers.cjs +371 -1215
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +1 -3
- package/dist/node/intents-helpers.d.ts +1 -3
- package/dist/node/intents-helpers.js +373 -1200
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -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:
|
|
1944
|
-
*
|
|
1945
|
-
*
|
|
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
|
|
2122
|
-
*
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
4158
|
-
*
|
|
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
|
|
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
|
-
|
|
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,350 @@ interface IntentGatewayContext {
|
|
|
5288
4962
|
swap: Swap;
|
|
5289
4963
|
}
|
|
5290
4964
|
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
*/
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
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;
|
|
4986
|
+
}
|
|
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, before the protocol fee; null when no order serves the route. */
|
|
5016
|
+
bestRate: bigint | null;
|
|
5017
|
+
/** The destination chain's protocol fee in basis points, which the gateway takes out of what the orders deliver. */
|
|
5018
|
+
slippageBps: number;
|
|
5019
|
+
/** Virtual depth: the serving orders' sizes summed, in tokenIn and tokenOut. */
|
|
5020
|
+
depthIn: bigint;
|
|
5021
|
+
depthOut: bigint;
|
|
5022
|
+
/** True liquidity in tokenOut: each serving solver's largest validated order, summed. */
|
|
5023
|
+
availableLiquidity: bigint;
|
|
5024
|
+
/** The largest tokenIn amount the route could fill with its orders combined. */
|
|
5025
|
+
maxFillableIn: bigint;
|
|
5026
|
+
orderCount: number;
|
|
5027
|
+
solverCount: number;
|
|
5028
|
+
}
|
|
5029
|
+
/** One order an optimistic quote takes, at the order's own price. Amounts and rates at 1e18. */
|
|
5030
|
+
interface OrderbookQuoteFill {
|
|
5031
|
+
/** The order's full advertised size, not just the part this fill takes. */
|
|
5032
|
+
advertisedSize: bigint;
|
|
5033
|
+
/** The order's own price, quote per 1 base, before the protocol fee: what this fill settles at. */
|
|
5034
|
+
orderRate: bigint;
|
|
5035
|
+
/** The tokenIn this fill takes, in whole raw units on the source chain. */
|
|
5036
|
+
amountIn: bigint;
|
|
5037
|
+
/** The tokenOut this fill delivers, after the protocol fee, floored to a whole raw unit on the destination chain. */
|
|
5038
|
+
amountOut: bigint;
|
|
5316
5039
|
}
|
|
5317
5040
|
/**
|
|
5318
|
-
*
|
|
5319
|
-
*
|
|
5041
|
+
* An optimistic quote for an input amount on a route: the trade split across the route's orders,
|
|
5042
|
+
* best price first, each at its own price. There is no one rate and no total output; the fills are
|
|
5043
|
+
* the quote. Amounts and rates at 1e18.
|
|
5044
|
+
*/
|
|
5045
|
+
interface OrderbookSwapQuote {
|
|
5046
|
+
route: OrderbookRouteKind;
|
|
5047
|
+
side: OrderbookSide;
|
|
5048
|
+
/** The tokenIn priced, floored to a whole raw unit on the source chain. */
|
|
5049
|
+
amountIn: bigint;
|
|
5050
|
+
/** The destination chain's protocol fee in basis points, already taken off every fill's `amountOut`. */
|
|
5051
|
+
slippageBps: number;
|
|
5052
|
+
fillable: boolean;
|
|
5053
|
+
/** The largest tokenIn amount the route's orders could take together, each at its own price. */
|
|
5054
|
+
maxFillableIn: bigint;
|
|
5055
|
+
/** The orders used, best price first; empty when not fillable. */
|
|
5056
|
+
fills: OrderbookQuoteFill[];
|
|
5057
|
+
}
|
|
5058
|
+
/**
|
|
5059
|
+
* A pessimistic quote for an input amount on a route: one price, from the first level, best first,
|
|
5060
|
+
* deep enough to fill the whole trade by itself, or else the route's worst price when its levels
|
|
5061
|
+
* together can. Amounts and rates at 1e18.
|
|
5062
|
+
*/
|
|
5063
|
+
interface OrderbookLevelQuote {
|
|
5064
|
+
route: OrderbookRouteKind;
|
|
5065
|
+
side: OrderbookSide;
|
|
5066
|
+
/** The tokenIn priced, floored to a whole raw unit on the source chain. */
|
|
5067
|
+
amountIn: bigint;
|
|
5068
|
+
/** The tokenOut delivered at `rate`, after the protocol fee, floored to a whole raw unit on the destination chain; 0 when not fillable. */
|
|
5069
|
+
amountOut: bigint;
|
|
5070
|
+
/** The worst single-order price in the level that fills it, quote per 1 base, before the protocol fee; null when not fillable. */
|
|
5071
|
+
rate: bigint | null;
|
|
5072
|
+
/** The price bucket of that level; null when not fillable. */
|
|
5073
|
+
priceBucket: bigint | null;
|
|
5074
|
+
/** The destination chain's protocol fee in basis points, already taken off `amountOut`. */
|
|
5075
|
+
slippageBps: number;
|
|
5076
|
+
fillable: boolean;
|
|
5077
|
+
/** The largest tokenIn amount this quote could fill: any one level at its worst price, or the whole route at its worst. */
|
|
5078
|
+
maxFillableIn: bigint;
|
|
5079
|
+
}
|
|
5080
|
+
/** The best bid and ask a route can reach, with the book that orients them. */
|
|
5081
|
+
interface OrderbookTopOfBook {
|
|
5082
|
+
book: OrderbookBook;
|
|
5083
|
+
/** Highest bid: the most quote a seller of 1 base receives. */
|
|
5084
|
+
bid: OrderbookRate | null;
|
|
5085
|
+
/** Lowest ask: the least quote a buyer of 1 base pays. */
|
|
5086
|
+
ask: OrderbookRate | null;
|
|
5087
|
+
}
|
|
5088
|
+
/** The orderbook could not answer: a transport failure, or a GraphQL error such as a pair no book trades. */
|
|
5089
|
+
declare class OrderbookRequestError extends Error {
|
|
5090
|
+
constructor(message: string);
|
|
5091
|
+
}
|
|
5092
|
+
/** Every document the client sends, so they can be checked against the orderbook's published schema. */
|
|
5093
|
+
declare const ORDERBOOK_QUERIES: {
|
|
5094
|
+
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}";
|
|
5095
|
+
readonly routeLiquidity: "\nquery RouteLiquidity($route: RouteInput!) {\n books { id base quote }\n routeLiquidity(route: $route) {\n route bestRate slippageBps depthIn depthOut availableLiquidity maxFillableIn orderCount solverCount\n }\n}";
|
|
5096
|
+
readonly quote: "\nquery Quote($route: RouteInput!, $amountIn: BigInt!) {\n quote(route: $route, amountIn: $amountIn) {\n route side amountIn slippageBps fillable maxFillableIn\n fills { advertisedSize orderRate amountIn amountOut }\n }\n}";
|
|
5097
|
+
readonly quotePessimistic: "\nquery QuotePessimistic($route: RouteInput!, $amountIn: BigInt!) {\n quotePessimistic(route: $route, amountIn: $amountIn) {\n route side amountIn amountOut rate priceBucket slippageBps fillable maxFillableIn\n }\n}";
|
|
5098
|
+
};
|
|
5099
|
+
/**
|
|
5100
|
+
* Read-only client for the HyperFX orderbook's GraphQL API.
|
|
5320
5101
|
*
|
|
5321
|
-
*
|
|
5322
|
-
*
|
|
5323
|
-
*
|
|
5324
|
-
|
|
5102
|
+
* Tokens are named by symbol and chains by state machine id. Every amount and
|
|
5103
|
+
* rate is a `bigint` at 1e18, as the orderbook serves it; rates are quote per 1
|
|
5104
|
+
* base of the pair's book.
|
|
5105
|
+
*/
|
|
5106
|
+
declare class HyperFxOrderbook {
|
|
5107
|
+
private readonly client;
|
|
5108
|
+
/** @param urlOrClient - The orderbook's GraphQL URL, or a configured `graphql-request` client. */
|
|
5109
|
+
constructor(urlOrClient?: string | GraphQLClient);
|
|
5110
|
+
/**
|
|
5111
|
+
* The best bid and ask on `fillChain` for the pair `tokenA`/`tokenB`, counting
|
|
5112
|
+
* only orders a swap from `sourceChain` can use.
|
|
5113
|
+
*/
|
|
5114
|
+
topOfBook(params: {
|
|
5115
|
+
tokenA: string;
|
|
5116
|
+
tokenB: string;
|
|
5117
|
+
fillChain: string;
|
|
5118
|
+
sourceChain: string;
|
|
5119
|
+
}): Promise<OrderbookTopOfBook>;
|
|
5120
|
+
/** Total liquidity on a route, no amount required. */
|
|
5121
|
+
routeLiquidity(route: OrderbookRoute): Promise<OrderbookRouteLiquidity>;
|
|
5122
|
+
/**
|
|
5123
|
+
* The optimistic quote for `amountIn` (1e18 tokenIn) on a route: the route's orders, best price
|
|
5124
|
+
* first, each taking what it can at its own price. The fills' `amountOut`s sum to the output.
|
|
5125
|
+
*/
|
|
5126
|
+
quote(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookSwapQuote>;
|
|
5127
|
+
/**
|
|
5128
|
+
* The pessimistic quote for `amountIn` (1e18 tokenIn) on a route: one price, from the first level
|
|
5129
|
+
* deep enough to fill the whole trade by itself, at which every order in it fills; the route's
|
|
5130
|
+
* worst price when no one level can but its levels together can.
|
|
5131
|
+
*/
|
|
5132
|
+
quotePessimistic(route: OrderbookRoute, amountIn: bigint): Promise<OrderbookLevelQuote>;
|
|
5133
|
+
private request;
|
|
5134
|
+
}
|
|
5135
|
+
|
|
5136
|
+
/**
|
|
5137
|
+
* Parameters for `IntentGateway.quoteIntent`. The source and destination chains
|
|
5138
|
+
* come from the gateway instance itself. `tokenIn` and `tokenOut` are token
|
|
5139
|
+
* addresses; the SDK resolves their configured symbols and decimals. Provide
|
|
5140
|
+
* exactly one amount, in the token's raw units.
|
|
5325
5141
|
*/
|
|
5326
5142
|
interface QuoteIntentParams {
|
|
5327
|
-
strategy?: IntentQuoteStrategy;
|
|
5328
5143
|
/** Token address on the source chain. */
|
|
5329
5144
|
tokenIn: HexString$1;
|
|
5330
5145
|
/** Token address on the destination chain. */
|
|
5331
5146
|
tokenOut: HexString$1;
|
|
5332
5147
|
amountIn?: bigint;
|
|
5333
5148
|
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
5149
|
/**
|
|
5342
|
-
*
|
|
5343
|
-
*
|
|
5344
|
-
* (
|
|
5150
|
+
* Return the orderbook's optimistic quote (`QuoteIntentResult`): one leg per
|
|
5151
|
+
* order, each at its own price. Defaults to the pessimistic quote
|
|
5152
|
+
* (`PessimisticQuoteIntentResult`): the whole trade at one price.
|
|
5345
5153
|
*/
|
|
5346
|
-
|
|
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
|
-
}
|
|
5366
|
-
interface IndexedRateIntentQuoteMetadata {
|
|
5367
|
-
sourceChain: Chains;
|
|
5368
|
-
destinationChain: Chains;
|
|
5369
|
-
baseTokenSymbol: ConfiguredAssetSymbol;
|
|
5370
|
-
quoteTokenSymbol: ConfiguredAssetSymbol;
|
|
5371
|
-
/** Directional pool rate used for this order. */
|
|
5372
|
-
rateSide: IndexedRateSide;
|
|
5373
|
-
/** Quote-token units per one base token. */
|
|
5374
|
-
rate: string;
|
|
5375
|
-
rateUpdatedAt: Date;
|
|
5376
|
-
/** Source gateway protocol fee already reflected in the returned quote amounts. */
|
|
5377
|
-
protocolFeeBps: bigint;
|
|
5154
|
+
optimistic?: boolean;
|
|
5378
5155
|
}
|
|
5379
5156
|
/**
|
|
5380
|
-
*
|
|
5381
|
-
*
|
|
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.
|
|
5157
|
+
* One order an optimistic intent quote takes, at the order's own price. Amounts
|
|
5158
|
+
* are raw token units; the rate stays at 1e18.
|
|
5385
5159
|
*/
|
|
5386
|
-
interface
|
|
5387
|
-
|
|
5388
|
-
|
|
5160
|
+
interface IntentQuoteLeg {
|
|
5161
|
+
/** The order's full advertised size in `tokenOut`, not just the part this leg takes. */
|
|
5162
|
+
advertisedSize: bigint;
|
|
5163
|
+
/** The order's own price, quote per 1 base at 1e18, before the protocol fee: what this leg settles at. */
|
|
5164
|
+
orderRate: bigint;
|
|
5165
|
+
/** The `tokenIn` this leg takes. The legs' inputs sum to the quote's `amountIn`. */
|
|
5389
5166
|
amountIn: bigint;
|
|
5167
|
+
/** The `tokenOut` this leg delivers, with the destination's protocol fee already taken off. */
|
|
5390
5168
|
amountOut: bigint;
|
|
5391
|
-
quoteMetadata: UniswapV4IntentQuoteMetadata;
|
|
5392
5169
|
}
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5170
|
+
/**
|
|
5171
|
+
* `quoteIntent`'s result with `optimistic: true`, the orderbook's optimistic `quote`: the trade split across the
|
|
5172
|
+
* route's orders, best price first, each at its own price. There is no single
|
|
5173
|
+
* rate or total output; the legs are the quote, and their `amountOut`s sum to
|
|
5174
|
+
* what the order should require. Amounts are raw token units.
|
|
5175
|
+
*/
|
|
5176
|
+
interface QuoteIntentResult {
|
|
5177
|
+
/** `SAME_CHAIN`, or `CROSS_CHAIN` when only orders accepting the source chain can fill it. */
|
|
5178
|
+
route: OrderbookRouteKind;
|
|
5179
|
+
/** `BID` when the order sells the book's base token, `ASK` when it buys it. */
|
|
5180
|
+
side: OrderbookSide;
|
|
5181
|
+
/** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
|
|
5396
5182
|
amountIn: bigint;
|
|
5397
|
-
amountOut
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5183
|
+
/** The destination's protocol fee in basis points, already taken off every leg's `amountOut`. */
|
|
5184
|
+
slippageBps: number;
|
|
5185
|
+
fillable: boolean;
|
|
5186
|
+
/** The largest `amountIn` the route's orders could take together, each at its own price. */
|
|
5187
|
+
maxFillableIn: bigint;
|
|
5188
|
+
/** The orders used, best price first. */
|
|
5189
|
+
legs: IntentQuoteLeg[];
|
|
5190
|
+
}
|
|
5191
|
+
/**
|
|
5192
|
+
* `quoteIntent`'s default result, the orderbook's `quotePessimistic`: the whole trade at one
|
|
5193
|
+
* price, the worst single-order price of the first level, best first, deep
|
|
5194
|
+
* enough to fill it by itself, or the route's worst price when no one level
|
|
5195
|
+
* can. Amounts are raw token units; rates stay at 1e18.
|
|
5196
|
+
*/
|
|
5197
|
+
interface PessimisticQuoteIntentResult {
|
|
5198
|
+
route: OrderbookRouteKind;
|
|
5199
|
+
side: OrderbookSide;
|
|
5200
|
+
/** The `tokenIn` priced: the requested input, or the input found to deliver the requested output. */
|
|
5403
5201
|
amountIn: bigint;
|
|
5202
|
+
/** The `tokenOut` delivered at `rate`, with the destination's protocol fee already taken off. */
|
|
5404
5203
|
amountOut: bigint;
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5204
|
+
/** Quote per 1 base, before the protocol fee: every order in the level fills at it. */
|
|
5205
|
+
rate: bigint | null;
|
|
5206
|
+
/** The price bucket of that level. */
|
|
5207
|
+
priceBucket: bigint | null;
|
|
5208
|
+
/** The destination's protocol fee in basis points, already taken off `amountOut`. */
|
|
5209
|
+
slippageBps: number;
|
|
5210
|
+
fillable: boolean;
|
|
5211
|
+
/** The largest `amountIn` this quote could fill: any one level at its worst price, or the whole route at its worst. */
|
|
5212
|
+
maxFillableIn: bigint;
|
|
5410
5213
|
}
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5214
|
+
/**
|
|
5215
|
+
* What the orderbook holds for one route, with no amount given. Amounts are
|
|
5216
|
+
* decimal strings in whole tokens.
|
|
5217
|
+
*/
|
|
5218
|
+
interface AvailableLiquidity {
|
|
5219
|
+
sourceChain: Chains;
|
|
5220
|
+
destinationChain: Chains;
|
|
5221
|
+
tokenInSymbol: ConfiguredAssetSymbol;
|
|
5222
|
+
tokenOutSymbol: ConfiguredAssetSymbol;
|
|
5223
|
+
/** `tokenOut` on the destination chain. */
|
|
5224
|
+
tokenAddress: HexString$1;
|
|
5225
|
+
route: OrderbookRouteKind;
|
|
5226
|
+
side: OrderbookSide;
|
|
5227
|
+
baseTokenSymbol: ConfiguredAssetSymbol;
|
|
5228
|
+
quoteTokenSymbol: ConfiguredAssetSymbol;
|
|
5229
|
+
/** The best rate on the route in quote-token units per one base token, or `null` when no order serves it. */
|
|
5230
|
+
bestRate: string | null;
|
|
5231
|
+
/** True liquidity in `tokenOut`: each serving solver's largest balance-checked order, summed. */
|
|
5232
|
+
availableLiquidity: string;
|
|
5233
|
+
/** Virtual depth: every serving order's size summed, in `tokenIn` and `tokenOut`. Can exceed what solvers hold. */
|
|
5234
|
+
depthIn: string;
|
|
5235
|
+
depthOut: string;
|
|
5236
|
+
/** The largest `tokenIn` amount the route could fill with its orders combined. */
|
|
5237
|
+
maxFillableIn: string;
|
|
5238
|
+
orderCount: number;
|
|
5239
|
+
solverCount: number;
|
|
5240
|
+
}
|
|
5241
|
+
/**
|
|
5242
|
+
* The best bid and ask for a pair on a route, in quote-token units per one base
|
|
5243
|
+
* token, as decimal strings. Either side is `null` while it has no orders.
|
|
5244
|
+
*/
|
|
5245
|
+
interface BuyAndSellRates {
|
|
5246
|
+
baseTokenSymbol: ConfiguredAssetSymbol;
|
|
5247
|
+
quoteTokenSymbol: ConfiguredAssetSymbol;
|
|
5248
|
+
sourceChain: Chains;
|
|
5249
|
+
destinationChain: Chains;
|
|
5250
|
+
/** Highest bid: the quote token a seller receives per one base token. */
|
|
5251
|
+
bid: string | null;
|
|
5252
|
+
/** Lowest ask: the quote token a buyer pays per one base token. */
|
|
5253
|
+
ask: string | null;
|
|
5254
|
+
/** Midpoint of `bid` and `ask`; `null` unless both sides have orders. */
|
|
5255
|
+
mid: string | null;
|
|
5256
|
+
/** `ask - bid`; `null` when a side is empty or the book is crossed. */
|
|
5257
|
+
spread: string | null;
|
|
5258
|
+
/** `spread` over `mid` in basis points, to two decimal places. */
|
|
5259
|
+
spreadBps: number | null;
|
|
5422
5260
|
}
|
|
5423
|
-
declare class
|
|
5424
|
-
constructor(
|
|
5261
|
+
declare class UnsupportedLiquidityAssetError extends Error {
|
|
5262
|
+
constructor(chain: string, asset: string);
|
|
5425
5263
|
}
|
|
5426
|
-
declare class
|
|
5427
|
-
constructor(
|
|
5428
|
-
source?: string;
|
|
5429
|
-
destination?: string;
|
|
5430
|
-
tokenIn?: string;
|
|
5431
|
-
tokenOut?: string;
|
|
5432
|
-
side?: IndexedRateSide;
|
|
5433
|
-
});
|
|
5264
|
+
declare class UnsupportedLiquidityChainError extends Error {
|
|
5265
|
+
constructor(chainId: number | string);
|
|
5434
5266
|
}
|
|
5435
|
-
|
|
5436
|
-
|
|
5267
|
+
/**
|
|
5268
|
+
* An exact-output quote did not settle on an input within its rounds: each quoted input's clearing
|
|
5269
|
+
* price still fell short of the output. The route may have the depth; the book moved or its levels
|
|
5270
|
+
* are too steep to converge on in time. Retrying, or quoting an exact input, may succeed.
|
|
5271
|
+
*/
|
|
5272
|
+
declare class OrderbookQuoteNotConvergedError extends Error {
|
|
5273
|
+
readonly route: {
|
|
5274
|
+
tokenIn: string;
|
|
5275
|
+
tokenOut: string;
|
|
5276
|
+
sourceChain: string;
|
|
5277
|
+
destinationChain: string;
|
|
5278
|
+
};
|
|
5279
|
+
readonly rounds: number;
|
|
5280
|
+
/** The last input quoted, in the source token's raw units. */
|
|
5281
|
+
readonly lastAmountIn: bigint;
|
|
5282
|
+
constructor(route: {
|
|
5283
|
+
tokenIn: string;
|
|
5284
|
+
tokenOut: string;
|
|
5285
|
+
sourceChain: string;
|
|
5286
|
+
destinationChain: string;
|
|
5287
|
+
}, rounds: number,
|
|
5288
|
+
/** The last input quoted, in the source token's raw units. */
|
|
5289
|
+
lastAmountIn: bigint);
|
|
5290
|
+
}
|
|
5291
|
+
/** The orderbook cannot fill the requested amount on this route. */
|
|
5292
|
+
declare class InsufficientOrderbookLiquidityError extends Error {
|
|
5293
|
+
readonly route: {
|
|
5294
|
+
tokenIn: string;
|
|
5295
|
+
tokenOut: string;
|
|
5296
|
+
sourceChain: string;
|
|
5297
|
+
destinationChain: string;
|
|
5298
|
+
};
|
|
5299
|
+
/** The largest `amountIn` the route can fill, in the source token's raw units. */
|
|
5300
|
+
readonly maxFillableIn: bigint;
|
|
5301
|
+
constructor(route: {
|
|
5302
|
+
tokenIn: string;
|
|
5303
|
+
tokenOut: string;
|
|
5304
|
+
sourceChain: string;
|
|
5305
|
+
destinationChain: string;
|
|
5306
|
+
},
|
|
5307
|
+
/** The largest `amountIn` the route can fill, in the source token's raw units. */
|
|
5308
|
+
maxFillableIn: bigint);
|
|
5437
5309
|
}
|
|
5438
5310
|
|
|
5439
5311
|
/**
|
|
@@ -5441,8 +5313,7 @@ declare class InvalidIndexedRateError extends Error {
|
|
|
5441
5313
|
*
|
|
5442
5314
|
* `IntentGateway` orchestrates the complete lifecycle of an intent-based
|
|
5443
5315
|
* cross-chain swap:
|
|
5444
|
-
* - **Quoting** — prices
|
|
5445
|
-
* indexed pool rates by default, with legacy quote strategies available explicitly.
|
|
5316
|
+
* - **Quoting** — prices orders, liquidity and rates from the HyperFX orderbook.
|
|
5446
5317
|
* - **Order placement** — encodes and yields `placeOrder` calldata; caller
|
|
5447
5318
|
* signs and submits the transaction.
|
|
5448
5319
|
* - **Order execution** — polls the Hyperbridge coprocessor for solver bids,
|
|
@@ -5484,8 +5355,10 @@ declare class IntentGateway {
|
|
|
5484
5355
|
private readonly bidManager;
|
|
5485
5356
|
/** Estimates gas costs for filling an order and converts them to fee-token amounts. */
|
|
5486
5357
|
private readonly gasEstimator;
|
|
5487
|
-
/**
|
|
5488
|
-
private
|
|
5358
|
+
/** The HyperFX orderbook quotes, liquidity and rates are read from. */
|
|
5359
|
+
private orderbook;
|
|
5360
|
+
/** Prices intents, liquidity and rates from {@link orderbook}. */
|
|
5361
|
+
private readonly market;
|
|
5489
5362
|
/**
|
|
5490
5363
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
5491
5364
|
*
|
|
@@ -5521,42 +5394,57 @@ declare class IntentGateway {
|
|
|
5521
5394
|
*/
|
|
5522
5395
|
private init;
|
|
5523
5396
|
/**
|
|
5524
|
-
*
|
|
5397
|
+
* Points quotes, liquidity and rate reads at a HyperFX orderbook other than
|
|
5398
|
+
* the destination chain's network deployment ({@link ORDERBOOK_URLS}).
|
|
5399
|
+
* Returns `this` for chaining.
|
|
5400
|
+
*
|
|
5401
|
+
* @param orderbook - The orderbook's GraphQL URL, or a configured client.
|
|
5402
|
+
*/
|
|
5403
|
+
withOrderbook(orderbook: string | HyperFxOrderbook): this;
|
|
5404
|
+
/**
|
|
5405
|
+
* Quotes an intent between this gateway's source and destination chains from
|
|
5406
|
+
* the HyperFX orderbook. Provide exactly one of `amountIn` or `amountOut`, in
|
|
5407
|
+
* raw token units. The result has the orderbook's shape, in raw token units.
|
|
5525
5408
|
*
|
|
5526
|
-
*
|
|
5527
|
-
*
|
|
5528
|
-
*
|
|
5529
|
-
* `
|
|
5409
|
+
* By default the quote is pessimistic (`PessimisticQuoteIntentResult`): the
|
|
5410
|
+
* whole trade at one price, the worst single-order price of the first level,
|
|
5411
|
+
* best first, deep enough to fill it by itself, or the route's worst price
|
|
5412
|
+
* when no one level can. With `optimistic: true` it is the orderbook's
|
|
5413
|
+
* optimistic quote (`QuoteIntentResult`): the route's orders, best price
|
|
5414
|
+
* first, each filling what it can of the trade at its own price, one leg per
|
|
5415
|
+
* order. There is no total output; the legs' `amountOut`s sum to it.
|
|
5530
5416
|
*
|
|
5531
|
-
*
|
|
5532
|
-
*
|
|
5533
|
-
*
|
|
5534
|
-
* (`quoteMetadata.protocolFeeBps`), which the gateway deducts from order inputs.
|
|
5417
|
+
* Every `amountOut` already has the destination's protocol fee taken off. For
|
|
5418
|
+
* an exact output, the quote is for an input that delivers `amountOut`. A
|
|
5419
|
+
* cross-chain route only counts orders whose solvers accept the source chain.
|
|
5535
5420
|
*
|
|
5536
|
-
* @
|
|
5537
|
-
* @
|
|
5538
|
-
* @throws {
|
|
5539
|
-
* @throws {UnsupportedIntentQuotePairError} When the selected strategy does not support the pair.
|
|
5540
|
-
* @throws {IndexedRateUnavailableError} When the requested direction has no indexed rate.
|
|
5421
|
+
* @throws {InsufficientOrderbookLiquidityError} When the route cannot fill the amount.
|
|
5422
|
+
* @throws {OrderbookQuoteNotConvergedError} When an exact-output quote does not settle on an input.
|
|
5423
|
+
* @throws {OrderbookRequestError} When the orderbook is unreachable or trades no book for the pair.
|
|
5541
5424
|
*/
|
|
5542
|
-
quoteIntent(params: QuoteIntentParams
|
|
5425
|
+
quoteIntent(params: QuoteIntentParams & {
|
|
5426
|
+
optimistic: true;
|
|
5427
|
+
}): Promise<QuoteIntentResult>;
|
|
5428
|
+
quoteIntent(params: QuoteIntentParams & {
|
|
5429
|
+
optimistic?: false;
|
|
5430
|
+
}): Promise<PessimisticQuoteIntentResult>;
|
|
5431
|
+
quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult | PessimisticQuoteIntentResult>;
|
|
5543
5432
|
/**
|
|
5544
|
-
* Returns
|
|
5545
|
-
*
|
|
5546
|
-
*
|
|
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.
|
|
5433
|
+
* Returns the orderbook liquidity serving a swap of `tokenIn` on the source
|
|
5434
|
+
* chain for `tokenOut` on the destination chain: the best rate, true and
|
|
5435
|
+
* virtual depth, and the largest input the route can fill.
|
|
5550
5436
|
*
|
|
5551
|
-
*
|
|
5437
|
+
* Amounts reflect the live book; they are not reservations or fill guarantees.
|
|
5552
5438
|
*/
|
|
5553
|
-
queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquidity
|
|
5439
|
+
queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquidity>;
|
|
5554
5440
|
/**
|
|
5555
|
-
* Returns
|
|
5556
|
-
* units
|
|
5557
|
-
*
|
|
5441
|
+
* Returns the orderbook's best bid and ask for a pair, with the mid and
|
|
5442
|
+
* spread, in quote-token units per one base token. Only orders filled on the
|
|
5443
|
+
* destination chain that accept swaps from the source chain are counted.
|
|
5444
|
+
* Symbols are matched case-insensitively; chain IDs resolve configured token
|
|
5445
|
+
* deployments.
|
|
5558
5446
|
*/
|
|
5559
|
-
queryBuyAndSellRates(params: QueryBuyAndSellRatesParams): Promise<BuyAndSellRates
|
|
5447
|
+
queryBuyAndSellRates(params: QueryBuyAndSellRatesParams): Promise<BuyAndSellRates>;
|
|
5560
5448
|
/**
|
|
5561
5449
|
* Bidirectional async generator that orchestrates the full order lifecycle:
|
|
5562
5450
|
* placement, fee estimation, bid collection, and execution.
|
|
@@ -5695,6 +5583,8 @@ declare class IntentGateway {
|
|
|
5695
5583
|
/**
|
|
5696
5584
|
* Returns both the native token cost and the relayer fee for cancelling an
|
|
5697
5585
|
* order. Use `relayerFee` to approve the ERC-20 spend before submitting.
|
|
5586
|
+
* Same-chain orders use the direct local route for either `from` option and
|
|
5587
|
+
* return `{ nativeValue: 0n, relayerFee: 0n }`.
|
|
5698
5588
|
*
|
|
5699
5589
|
* Delegates to {@link OrderCanceller.quoteCancelOrder}.
|
|
5700
5590
|
*
|
|
@@ -5712,9 +5602,17 @@ declare class IntentGateway {
|
|
|
5712
5602
|
*
|
|
5713
5603
|
* Delegates to {@link OrderCanceller.cancelOrder}.
|
|
5714
5604
|
*
|
|
5605
|
+
* Same-chain orders always use the direct source-gateway route. The order
|
|
5606
|
+
* user may call through the deadline; any account may call strictly after
|
|
5607
|
+
* it, pays the transaction gas, and cannot change the refund beneficiary.
|
|
5608
|
+
* The SDK yields unsigned transaction fields and accepts either the caller's
|
|
5609
|
+
* signed raw transaction or its already-broadcast transaction hash.
|
|
5610
|
+
*
|
|
5715
5611
|
* @param order - The order to cancel.
|
|
5716
|
-
* @param indexerClient - Indexer client used for ISMP request
|
|
5717
|
-
*
|
|
5612
|
+
* @param indexerClient - Indexer client used for cross-chain ISMP request
|
|
5613
|
+
* status streaming; the same-chain route does not access it.
|
|
5614
|
+
* @param options - Choose the cross-chain initiation side. Defaults to source;
|
|
5615
|
+
* ignored for routing when source and destination are the same chain.
|
|
5718
5616
|
* @yields {@link CancelEvent} objects describing each cancellation stage.
|
|
5719
5617
|
*/
|
|
5720
5618
|
cancelOrder(order: Order, indexerClient: IsmpClient, options?: CancelOrderOptions): AsyncGenerator<CancelEvent>;
|
|
@@ -5836,15 +5734,23 @@ declare class IntentGateway {
|
|
|
5836
5734
|
*/
|
|
5837
5735
|
decodeERC7821Execute(callData: HexString$1): ERC7821Call[] | null;
|
|
5838
5736
|
/**
|
|
5839
|
-
* Checks whether an order
|
|
5737
|
+
* Checks whether an order is finalized on the destination chain.
|
|
5840
5738
|
*
|
|
5841
5739
|
* Delegates to {@link OrderStatusChecker.isOrderFilled}.
|
|
5842
5740
|
*
|
|
5843
5741
|
* @param order - The order to check.
|
|
5844
|
-
* @returns `true`
|
|
5845
|
-
*
|
|
5742
|
+
* @returns `true` once a completing fill or a destination-side cancellation
|
|
5743
|
+
* has finalized the order; `false` while it is open or only partly filled.
|
|
5846
5744
|
*/
|
|
5847
5745
|
isOrderFilled(order: Order): Promise<boolean>;
|
|
5746
|
+
/**
|
|
5747
|
+
* Output credited to the order so far, one entry per leg.
|
|
5748
|
+
*
|
|
5749
|
+
* Delegates to {@link OrderStatusChecker.getFillProgress}.
|
|
5750
|
+
*
|
|
5751
|
+
* @param order - The order to check.
|
|
5752
|
+
*/
|
|
5753
|
+
getFillProgress(order: Order): Promise<TokenInfo[]>;
|
|
5848
5754
|
/**
|
|
5849
5755
|
* Checks whether all escrowed inputs for an order have been refunded on the
|
|
5850
5756
|
* source chain.
|
|
@@ -5852,8 +5758,8 @@ declare class IntentGateway {
|
|
|
5852
5758
|
* Delegates to {@link OrderStatusChecker.isOrderRefunded}.
|
|
5853
5759
|
*
|
|
5854
5760
|
* @param order - The order to check.
|
|
5855
|
-
* @returns `true` if every input
|
|
5856
|
-
* in the `_orders` mapping on the source chain.
|
|
5761
|
+
* @returns `true` if every input's escrowed amount has been zeroed out
|
|
5762
|
+
* in the per-leg `_orders` mapping on the source chain.
|
|
5857
5763
|
*/
|
|
5858
5764
|
isOrderRefunded(order: Order): Promise<boolean>;
|
|
5859
5765
|
/**
|
|
@@ -5902,16 +5808,6 @@ declare class IntentGateway {
|
|
|
5902
5808
|
}, void>;
|
|
5903
5809
|
}
|
|
5904
5810
|
|
|
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
5811
|
/**
|
|
5916
5812
|
* Canonical symbol order used by the SDK and indexer pool IDs.
|
|
5917
5813
|
*
|
|
@@ -5936,20 +5832,28 @@ declare class OrderStatusChecker {
|
|
|
5936
5832
|
*/
|
|
5937
5833
|
constructor(ctx: IntentGatewayContext);
|
|
5938
5834
|
/**
|
|
5939
|
-
*
|
|
5940
|
-
*
|
|
5941
|
-
*
|
|
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).
|
|
5835
|
+
* Whether the order is finalized on the destination chain, read from the gateway's `_filled`
|
|
5836
|
+
* getter. It is set by the completing fill, and by a cancellation, which records the refund
|
|
5837
|
+
* beneficiary there. A partially filled order reads false; see {@link getFillProgress}.
|
|
5944
5838
|
*
|
|
5945
5839
|
* @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
5840
|
*/
|
|
5948
5841
|
isOrderFilled(order: Order): Promise<boolean>;
|
|
5842
|
+
/**
|
|
5843
|
+
* Output credited to the order so far, one entry per leg, read from `_partialFills` on the
|
|
5844
|
+
* destination chain. Several solvers can each fill a slice of a same-chain or cross-chain order,
|
|
5845
|
+
* so this, not {@link isOrderFilled}, says how far along an open order is. Surplus paid above
|
|
5846
|
+
* the order's rate is not counted.
|
|
5847
|
+
*
|
|
5848
|
+
* @param order - The V2 order to check. `order.id` is used as the commitment; if not set it is computed.
|
|
5849
|
+
*/
|
|
5850
|
+
getFillProgress(order: Order): Promise<TokenInfo[]>;
|
|
5949
5851
|
/**
|
|
5950
5852
|
* Checks if a V2 order has been refunded by reading the `_orders` mapping on the source chain.
|
|
5951
5853
|
*
|
|
5952
|
-
* Calls `_orders(commitment,
|
|
5854
|
+
* Calls `_orders(commitment, index)` for each input: escrow is held per leg, keyed by the input's
|
|
5855
|
+
* index, so inputs that repeat a token are read separately. A gateway not yet upgraded to per-leg
|
|
5856
|
+
* escrow is read by token instead, see {@link readLegEscrow}. When the order is placed the
|
|
5953
5857
|
* escrowed amounts are stored there. After a successful refund the contract zeroes them out.
|
|
5954
5858
|
* An order is considered refunded when all escrowed input amounts have been returned (i.e. are 0).
|
|
5955
5859
|
*
|
|
@@ -5959,6 +5863,31 @@ declare class OrderStatusChecker {
|
|
|
5959
5863
|
isOrderRefunded(order: Order): Promise<boolean>;
|
|
5960
5864
|
}
|
|
5961
5865
|
|
|
5866
|
+
type ReadClient = Pick<PublicClient, "readContract">;
|
|
5867
|
+
/**
|
|
5868
|
+
* Escrow held for leg `index` of an order on its source chain: `_orders(commitment, index)`, or
|
|
5869
|
+
* `_orders(commitment, token)` on a gateway that has not been upgraded to per-leg escrow.
|
|
5870
|
+
*
|
|
5871
|
+
* @param client - Public client of the order's source chain.
|
|
5872
|
+
* @param gateway - IntentGatewayV2 address on that chain.
|
|
5873
|
+
* @param commitment - The order commitment.
|
|
5874
|
+
* @param index - Leg index into `order.inputs`.
|
|
5875
|
+
* @param token - `order.inputs[index].token`, as bytes32 or a 20-byte address.
|
|
5876
|
+
*/
|
|
5877
|
+
declare function readLegEscrow(client: ReadClient, gateway: HexString$1, commitment: HexString$1, index: number, token: HexString$1): Promise<bigint>;
|
|
5878
|
+
/**
|
|
5879
|
+
* Output delivered so far for leg `index` of an order on its destination chain:
|
|
5880
|
+
* `_partialFills(commitment, index)`, or `_partialFills(commitment, token)` on a gateway that has not
|
|
5881
|
+
* been upgraded to per-leg escrow.
|
|
5882
|
+
*
|
|
5883
|
+
* @param client - Public client of the order's destination chain.
|
|
5884
|
+
* @param gateway - IntentGatewayV2 address on that chain.
|
|
5885
|
+
* @param commitment - The order commitment.
|
|
5886
|
+
* @param index - Leg index into `order.output.assets`.
|
|
5887
|
+
* @param token - `order.output.assets[index].token` as bytes32.
|
|
5888
|
+
*/
|
|
5889
|
+
declare function readLegPartialFill(client: ReadClient, gateway: HexString$1, commitment: HexString$1, index: number, token: HexString$1): Promise<bigint>;
|
|
5890
|
+
|
|
5962
5891
|
declare function encodeERC7821ExecuteBatch(calls: ERC7821Call[]): HexString$1;
|
|
5963
5892
|
declare function decodeERC7821ExecuteBatch(callData: HexString$1): ERC7821Call[] | null;
|
|
5964
5893
|
|
|
@@ -6088,19 +6017,34 @@ declare class CryptoUtils {
|
|
|
6088
6017
|
static computeUserOpHash(userOp: PackedUserOperation, entryPoint: Hex, chainId: bigint): Hex;
|
|
6089
6018
|
/**
|
|
6090
6019
|
* Derives the ERC-4337 nonce key that binds a bid UserOperation to its
|
|
6091
|
-
* order
|
|
6092
|
-
* `keccak256(commitment ‖ sessionKey)`. `SolverAccount`
|
|
6093
|
-
* operations whose nonce key differs — this is what lets the
|
|
6094
|
-
* the plain userOpHash while staying committed to the order and
|
|
6095
|
-
* session key it bid against.
|
|
6020
|
+
* order, session key and calldata: the lower 192 bits of
|
|
6021
|
+
* `keccak256(commitment ‖ sessionKey ‖ keccak256(callData))`. `SolverAccount`
|
|
6022
|
+
* rejects bid operations whose nonce key differs — this is what lets the
|
|
6023
|
+
* solver sign the plain userOpHash while staying committed to the order and
|
|
6024
|
+
* to the session key it bid against.
|
|
6025
|
+
*
|
|
6026
|
+
* The calldata gives every bid its own key. A solver bidding several prices
|
|
6027
|
+
* on one order signs one op per price, and each is sequence 0 of its own key,
|
|
6028
|
+
* so they execute independently rather than in a sequence where one bid that
|
|
6029
|
+
* is never selected blocks the rest.
|
|
6096
6030
|
*
|
|
6097
6031
|
* @param commitment - The order commitment (`order.id`).
|
|
6098
6032
|
* @param sessionKey - The order's session key address (`order.session`).
|
|
6033
|
+
* @param callData - The UserOperation's `callData`.
|
|
6099
6034
|
* @returns The 192-bit nonce key as a bigint (pass to `EntryPoint.getNonce`).
|
|
6100
6035
|
*/
|
|
6101
|
-
static bidNonceKey(commitment: HexString$1, sessionKey: HexString$1): bigint;
|
|
6036
|
+
static bidNonceKey(commitment: HexString$1, sessionKey: HexString$1, callData: HexString$1): bigint;
|
|
6102
6037
|
/**
|
|
6103
|
-
*
|
|
6038
|
+
* The identifier Hyperbridge files a bid under: `keccak256` of the UserOp's
|
|
6039
|
+
* `callData`. It is the same hash {@link bidNonceKey} takes, so a bid's
|
|
6040
|
+
* identifier and its nonce key both follow from the op itself, and one
|
|
6041
|
+
* solver's bids on one order are kept apart for the same reason on both sides.
|
|
6042
|
+
*
|
|
6043
|
+
* @param callData - The UserOperation's `callData`.
|
|
6044
|
+
*/
|
|
6045
|
+
static bidId(callData: HexString$1): HexString$1;
|
|
6046
|
+
/**
|
|
6047
|
+
* Builds the EIP-712 typed-data payload whose digest is the EntryPoint v0.8
|
|
6104
6048
|
* `userOpHash` (i.e. `hashTypedData(packedUserOpTypedData(...)) ===
|
|
6105
6049
|
* computeUserOpHash(...)`). Signing this typed data is bit-identical to
|
|
6106
6050
|
* signing the raw userOpHash, but keeps the full operation visible to
|
|
@@ -6287,213 +6231,54 @@ declare class CryptoUtils {
|
|
|
6287
6231
|
decodeERC7821Execute(callData: HexString$1): ERC7821Call[] | null;
|
|
6288
6232
|
}
|
|
6289
6233
|
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
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 [{
|
|
6234
|
+
type DecodedFillOrder = {
|
|
6235
|
+
order: Order;
|
|
6236
|
+
options: FillOptions;
|
|
6237
|
+
};
|
|
6238
|
+
/** `fillOrder(Order, FillOptions)` selector, pinned by codec tests; avoids import-time hashing in VM2. */
|
|
6239
|
+
declare const FILL_ORDER_SELECTOR: "0x68ddf058";
|
|
6240
|
+
/** The gateway release this SDK speaks. SolverAccount carries no version, so only the gateway is read. */
|
|
6241
|
+
declare const SUPPORTED_INTENTS_VERSION = 3n;
|
|
6242
|
+
declare const CONTRACT_VERSION_ABI: readonly [{
|
|
6311
6243
|
readonly type: "function";
|
|
6312
|
-
readonly name: "
|
|
6313
|
-
readonly stateMutability: "
|
|
6314
|
-
readonly
|
|
6315
|
-
readonly
|
|
6316
|
-
readonly name: "
|
|
6317
|
-
readonly type: "
|
|
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
|
-
}];
|
|
6244
|
+
readonly name: "version";
|
|
6245
|
+
readonly stateMutability: "view";
|
|
6246
|
+
readonly inputs: readonly [];
|
|
6247
|
+
readonly outputs: readonly [{
|
|
6248
|
+
readonly name: "";
|
|
6249
|
+
readonly type: "uint64";
|
|
6435
6250
|
}];
|
|
6436
6251
|
}];
|
|
6437
|
-
/**
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
*
|
|
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.
|
|
6252
|
+
/** Whether the gateway reports the supported release. RPC failures propagate. */
|
|
6253
|
+
declare function supportsRateFills(client: PublicClient, gateway: HexString$1): Promise<boolean>;
|
|
6254
|
+
/** The gateway must report release {@link SUPPORTED_INTENTS_VERSION}; a missing getter or any other release throws. */
|
|
6255
|
+
declare function assertGatewayRelease(client: PublicClient, gateway: HexString$1): Promise<void>;
|
|
6256
|
+
/** A bytes32 token whose upper 12 bytes are zero, the only form the gateway accepts. */
|
|
6257
|
+
declare function isCanonicalEvmToken(token: string): boolean;
|
|
6258
|
+
/** ABI-encodes a `fillOrder` call. Every leg must carry a validated quote. */
|
|
6259
|
+
declare function encodeFillOrder(order: Order, options: FillOptions): HexString$1;
|
|
6260
|
+
/**
|
|
6261
|
+
* Decodes a `fillOrder` call.
|
|
6465
6262
|
*
|
|
6466
|
-
*
|
|
6467
|
-
*
|
|
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.
|
|
6263
|
+
* @returns The decoded order and options, or `null` if the calldata is not a `fillOrder` call in
|
|
6264
|
+
* the current shape or its quotes do not cover the order's legs.
|
|
6470
6265
|
*/
|
|
6471
|
-
declare function
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
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;
|
|
6266
|
+
declare function decodeFillOrder(data: HexString$1): DecodedFillOrder | null;
|
|
6267
|
+
|
|
6268
|
+
interface RateFillPreview {
|
|
6269
|
+
credit: bigint;
|
|
6270
|
+
release: bigint;
|
|
6271
|
+
delivered: bigint;
|
|
6272
|
+
surplus: bigint;
|
|
6273
|
+
}
|
|
6274
|
+
/** Estimates settlement at the supplied progress. The signed take/offered amounts remain caps. */
|
|
6275
|
+
declare function previewRateFill(escrow: bigint, required: bigint, filled: bigint, take: bigint, offered: bigint): RateFillPreview;
|
|
6493
6276
|
|
|
6494
6277
|
type HexString = `0x${string}`;
|
|
6495
6278
|
/** A complete Permit2-sponsored paymasterAndData, before any declaration is appended. */
|
|
6496
6279
|
declare const PERMIT2_SPONSORSHIP_BYTES: number;
|
|
6280
|
+
/** Upper bound on declared chains and positions alike; one byte of count each. */
|
|
6281
|
+
declare const MAX_DECLARED_ENTRIES = 255;
|
|
6497
6282
|
/**
|
|
6498
6283
|
* The Permit2 sponsorship a bid's paymasterAndData carries when it was built on the real-bid path:
|
|
6499
6284
|
* which paymaster it names and the fee-token permit it signed for that paymaster. Read for the
|
|
@@ -6519,8 +6304,8 @@ interface PhantomBidDeclaration {
|
|
|
6519
6304
|
*/
|
|
6520
6305
|
acceptedSources: string[] | null;
|
|
6521
6306
|
/**
|
|
6522
|
-
* Uniswap V4 position tokenIds
|
|
6523
|
-
*
|
|
6307
|
+
* Uniswap V4 position tokenIds from a v2 declaration. Decoded for compatibility only; nothing
|
|
6308
|
+
* prices them. Empty when none are declared — including for every v1 bid.
|
|
6524
6309
|
*/
|
|
6525
6310
|
uniswapV4Positions: bigint[];
|
|
6526
6311
|
}
|
|
@@ -6572,7 +6357,7 @@ declare function decodePhantomBidDeclaration(paymasterAndData: string | undefine
|
|
|
6572
6357
|
*
|
|
6573
6358
|
* `sponsorship` is the packed EntryPoint v0.8 paymasterAndData the paymaster builder produced. It
|
|
6574
6359
|
* must be exactly the Permit2-mode layout — the only one the decoder recognises — so a caller
|
|
6575
|
-
* cannot sign bytes
|
|
6360
|
+
* cannot sign bytes a decoder would read as "no declaration"; anything else throws. Empty
|
|
6576
6361
|
* or omitted, the result is the bare declaration, byte-identical to what unsponsored bids carry.
|
|
6577
6362
|
*/
|
|
6578
6363
|
declare function encodePhantomBidPaymasterAndData(bid: {
|
|
@@ -6584,39 +6369,15 @@ declare function encodePhantomBidPaymasterAndData(bid: {
|
|
|
6584
6369
|
declare function encodeAcceptedSourceChains(chains: string[]): HexString;
|
|
6585
6370
|
/** Back-compat wrapper: the source-chain half of {@link decodePhantomBidDeclaration}. */
|
|
6586
6371
|
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
6372
|
|
|
6616
6373
|
declare const ABI$1: readonly [{
|
|
6617
6374
|
readonly type: "constructor";
|
|
6618
6375
|
readonly inputs: readonly [{
|
|
6619
|
-
readonly name: "
|
|
6376
|
+
readonly name: "intrinsic";
|
|
6377
|
+
readonly type: "address";
|
|
6378
|
+
readonly internalType: "address";
|
|
6379
|
+
}, {
|
|
6380
|
+
readonly name: "extrinsic";
|
|
6620
6381
|
readonly type: "address";
|
|
6621
6382
|
readonly internalType: "address";
|
|
6622
6383
|
}];
|
|
@@ -6691,8 +6452,8 @@ declare const ABI$1: readonly [{
|
|
|
6691
6452
|
readonly internalType: "bytes32";
|
|
6692
6453
|
}, {
|
|
6693
6454
|
readonly name: "";
|
|
6694
|
-
readonly type: "
|
|
6695
|
-
readonly internalType: "
|
|
6455
|
+
readonly type: "uint256";
|
|
6456
|
+
readonly internalType: "uint256";
|
|
6696
6457
|
}];
|
|
6697
6458
|
readonly outputs: readonly [{
|
|
6698
6459
|
readonly name: "";
|
|
@@ -6702,32 +6463,50 @@ declare const ABI$1: readonly [{
|
|
|
6702
6463
|
readonly stateMutability: "view";
|
|
6703
6464
|
}, {
|
|
6704
6465
|
readonly type: "function";
|
|
6705
|
-
readonly name: "
|
|
6706
|
-
readonly inputs: readonly [
|
|
6466
|
+
readonly name: "_partialFills";
|
|
6467
|
+
readonly inputs: readonly [{
|
|
6468
|
+
readonly name: "";
|
|
6469
|
+
readonly type: "bytes32";
|
|
6470
|
+
readonly internalType: "bytes32";
|
|
6471
|
+
}, {
|
|
6472
|
+
readonly name: "";
|
|
6473
|
+
readonly type: "uint256";
|
|
6474
|
+
readonly internalType: "uint256";
|
|
6475
|
+
}];
|
|
6707
6476
|
readonly outputs: readonly [{
|
|
6708
6477
|
readonly name: "";
|
|
6709
|
-
readonly type: "
|
|
6710
|
-
readonly internalType: "
|
|
6478
|
+
readonly type: "uint256";
|
|
6479
|
+
readonly internalType: "uint256";
|
|
6711
6480
|
}];
|
|
6712
6481
|
readonly stateMutability: "view";
|
|
6713
6482
|
}, {
|
|
6714
6483
|
readonly type: "function";
|
|
6715
|
-
readonly name: "
|
|
6484
|
+
readonly name: "_protocolFees";
|
|
6716
6485
|
readonly inputs: readonly [{
|
|
6717
6486
|
readonly name: "";
|
|
6718
6487
|
readonly type: "bytes32";
|
|
6719
6488
|
readonly internalType: "bytes32";
|
|
6720
6489
|
}, {
|
|
6721
6490
|
readonly name: "";
|
|
6722
|
-
readonly type: "
|
|
6723
|
-
readonly internalType: "
|
|
6491
|
+
readonly type: "uint256";
|
|
6492
|
+
readonly internalType: "uint256";
|
|
6724
6493
|
}];
|
|
6725
6494
|
readonly outputs: readonly [{
|
|
6726
|
-
readonly name: "";
|
|
6495
|
+
readonly name: "amount";
|
|
6496
|
+
readonly type: "uint256";
|
|
6497
|
+
readonly internalType: "uint256";
|
|
6498
|
+
}, {
|
|
6499
|
+
readonly name: "committed";
|
|
6727
6500
|
readonly type: "uint256";
|
|
6728
6501
|
readonly internalType: "uint256";
|
|
6729
6502
|
}];
|
|
6730
6503
|
readonly stateMutability: "view";
|
|
6504
|
+
}, {
|
|
6505
|
+
readonly type: "function";
|
|
6506
|
+
readonly name: "acceptOwnership";
|
|
6507
|
+
readonly inputs: readonly [];
|
|
6508
|
+
readonly outputs: readonly [];
|
|
6509
|
+
readonly stateMutability: "nonpayable";
|
|
6731
6510
|
}, {
|
|
6732
6511
|
readonly type: "function";
|
|
6733
6512
|
readonly name: "calculateCommitmentSlotHash";
|
|
@@ -6889,6 +6668,16 @@ declare const ABI$1: readonly [{
|
|
|
6889
6668
|
readonly internalType: "uint256[]";
|
|
6890
6669
|
}];
|
|
6891
6670
|
readonly stateMutability: "view";
|
|
6671
|
+
}, {
|
|
6672
|
+
readonly type: "function";
|
|
6673
|
+
readonly name: "extrinsicModule";
|
|
6674
|
+
readonly inputs: readonly [];
|
|
6675
|
+
readonly outputs: readonly [{
|
|
6676
|
+
readonly name: "";
|
|
6677
|
+
readonly type: "address";
|
|
6678
|
+
readonly internalType: "address";
|
|
6679
|
+
}];
|
|
6680
|
+
readonly stateMutability: "view";
|
|
6892
6681
|
}, {
|
|
6893
6682
|
readonly type: "function";
|
|
6894
6683
|
readonly name: "fillOrder";
|
|
@@ -7015,6 +6804,19 @@ declare const ABI$1: readonly [{
|
|
|
7015
6804
|
readonly type: "uint256";
|
|
7016
6805
|
readonly internalType: "uint256";
|
|
7017
6806
|
}];
|
|
6807
|
+
}, {
|
|
6808
|
+
readonly name: "inputs";
|
|
6809
|
+
readonly type: "tuple[]";
|
|
6810
|
+
readonly internalType: "struct TokenInfo[]";
|
|
6811
|
+
readonly components: readonly [{
|
|
6812
|
+
readonly name: "token";
|
|
6813
|
+
readonly type: "bytes32";
|
|
6814
|
+
readonly internalType: "bytes32";
|
|
6815
|
+
}, {
|
|
6816
|
+
readonly name: "amount";
|
|
6817
|
+
readonly type: "uint256";
|
|
6818
|
+
readonly internalType: "uint256";
|
|
6819
|
+
}];
|
|
7018
6820
|
}];
|
|
7019
6821
|
}];
|
|
7020
6822
|
readonly outputs: readonly [];
|
|
@@ -7033,42 +6835,51 @@ declare const ABI$1: readonly [{
|
|
|
7033
6835
|
readonly type: "function";
|
|
7034
6836
|
readonly name: "initialize";
|
|
7035
6837
|
readonly inputs: readonly [{
|
|
7036
|
-
readonly name: "
|
|
6838
|
+
readonly name: "init";
|
|
7037
6839
|
readonly type: "tuple";
|
|
7038
|
-
readonly internalType: "struct
|
|
6840
|
+
readonly internalType: "struct InitParams";
|
|
7039
6841
|
readonly components: readonly [{
|
|
7040
|
-
readonly name: "
|
|
7041
|
-
readonly type: "
|
|
7042
|
-
readonly internalType: "
|
|
6842
|
+
readonly name: "params";
|
|
6843
|
+
readonly type: "tuple";
|
|
6844
|
+
readonly internalType: "struct Params";
|
|
6845
|
+
readonly components: readonly [{
|
|
6846
|
+
readonly name: "host";
|
|
6847
|
+
readonly type: "address";
|
|
6848
|
+
readonly internalType: "address";
|
|
6849
|
+
}, {
|
|
6850
|
+
readonly name: "dispatcher";
|
|
6851
|
+
readonly type: "address";
|
|
6852
|
+
readonly internalType: "address";
|
|
6853
|
+
}, {
|
|
6854
|
+
readonly name: "solverSelection";
|
|
6855
|
+
readonly type: "bool";
|
|
6856
|
+
readonly internalType: "bool";
|
|
6857
|
+
}, {
|
|
6858
|
+
readonly name: "surplusShareBps";
|
|
6859
|
+
readonly type: "uint256";
|
|
6860
|
+
readonly internalType: "uint256";
|
|
6861
|
+
}, {
|
|
6862
|
+
readonly name: "protocolFeeBps";
|
|
6863
|
+
readonly type: "uint256";
|
|
6864
|
+
readonly internalType: "uint256";
|
|
6865
|
+
}, {
|
|
6866
|
+
readonly name: "priceOracle";
|
|
6867
|
+
readonly type: "address";
|
|
6868
|
+
readonly internalType: "address";
|
|
6869
|
+
}];
|
|
7043
6870
|
}, {
|
|
7044
|
-
readonly name: "
|
|
6871
|
+
readonly name: "peerChains";
|
|
6872
|
+
readonly type: "bytes[]";
|
|
6873
|
+
readonly internalType: "bytes[]";
|
|
6874
|
+
}, {
|
|
6875
|
+
readonly name: "relayer";
|
|
7045
6876
|
readonly type: "address";
|
|
7046
6877
|
readonly internalType: "address";
|
|
7047
6878
|
}, {
|
|
7048
|
-
readonly name: "
|
|
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";
|
|
6879
|
+
readonly name: "owner";
|
|
7061
6880
|
readonly type: "address";
|
|
7062
6881
|
readonly internalType: "address";
|
|
7063
6882
|
}];
|
|
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
6883
|
}];
|
|
7073
6884
|
readonly outputs: readonly [];
|
|
7074
6885
|
readonly stateMutability: "nonpayable";
|
|
@@ -7086,11 +6897,21 @@ declare const ABI$1: readonly [{
|
|
|
7086
6897
|
readonly internalType: "address";
|
|
7087
6898
|
}];
|
|
7088
6899
|
readonly stateMutability: "view";
|
|
6900
|
+
}, {
|
|
6901
|
+
readonly type: "function";
|
|
6902
|
+
readonly name: "intrinsicModule";
|
|
6903
|
+
readonly inputs: readonly [];
|
|
6904
|
+
readonly outputs: readonly [{
|
|
6905
|
+
readonly name: "";
|
|
6906
|
+
readonly type: "address";
|
|
6907
|
+
readonly internalType: "address";
|
|
6908
|
+
}];
|
|
6909
|
+
readonly stateMutability: "view";
|
|
7089
6910
|
}, {
|
|
7090
6911
|
readonly type: "function";
|
|
7091
6912
|
readonly name: "migrate";
|
|
7092
6913
|
readonly inputs: readonly [{
|
|
7093
|
-
readonly name: "
|
|
6914
|
+
readonly name: "owner_";
|
|
7094
6915
|
readonly type: "address";
|
|
7095
6916
|
readonly internalType: "address";
|
|
7096
6917
|
}];
|
|
@@ -7148,7 +6969,7 @@ declare const ABI$1: readonly [{
|
|
|
7148
6969
|
readonly type: "function";
|
|
7149
6970
|
readonly name: "onGetResponse";
|
|
7150
6971
|
readonly inputs: readonly [{
|
|
7151
|
-
readonly name: "
|
|
6972
|
+
readonly name: "";
|
|
7152
6973
|
readonly type: "tuple";
|
|
7153
6974
|
readonly internalType: "struct IncomingGetResponse";
|
|
7154
6975
|
readonly components: readonly [{
|
|
@@ -7314,6 +7135,16 @@ declare const ABI$1: readonly [{
|
|
|
7314
7135
|
}];
|
|
7315
7136
|
readonly outputs: readonly [];
|
|
7316
7137
|
readonly stateMutability: "nonpayable";
|
|
7138
|
+
}, {
|
|
7139
|
+
readonly type: "function";
|
|
7140
|
+
readonly name: "owner";
|
|
7141
|
+
readonly inputs: readonly [];
|
|
7142
|
+
readonly outputs: readonly [{
|
|
7143
|
+
readonly name: "";
|
|
7144
|
+
readonly type: "address";
|
|
7145
|
+
readonly internalType: "address";
|
|
7146
|
+
}];
|
|
7147
|
+
readonly stateMutability: "view";
|
|
7317
7148
|
}, {
|
|
7318
7149
|
readonly type: "function";
|
|
7319
7150
|
readonly name: "params";
|
|
@@ -7349,6 +7180,32 @@ declare const ABI$1: readonly [{
|
|
|
7349
7180
|
}];
|
|
7350
7181
|
}];
|
|
7351
7182
|
readonly stateMutability: "view";
|
|
7183
|
+
}, {
|
|
7184
|
+
readonly type: "function";
|
|
7185
|
+
readonly name: "pause";
|
|
7186
|
+
readonly inputs: readonly [];
|
|
7187
|
+
readonly outputs: readonly [];
|
|
7188
|
+
readonly stateMutability: "nonpayable";
|
|
7189
|
+
}, {
|
|
7190
|
+
readonly type: "function";
|
|
7191
|
+
readonly name: "paused";
|
|
7192
|
+
readonly inputs: readonly [];
|
|
7193
|
+
readonly outputs: readonly [{
|
|
7194
|
+
readonly name: "";
|
|
7195
|
+
readonly type: "bool";
|
|
7196
|
+
readonly internalType: "bool";
|
|
7197
|
+
}];
|
|
7198
|
+
readonly stateMutability: "view";
|
|
7199
|
+
}, {
|
|
7200
|
+
readonly type: "function";
|
|
7201
|
+
readonly name: "pendingOwner";
|
|
7202
|
+
readonly inputs: readonly [];
|
|
7203
|
+
readonly outputs: readonly [{
|
|
7204
|
+
readonly name: "";
|
|
7205
|
+
readonly type: "address";
|
|
7206
|
+
readonly internalType: "address";
|
|
7207
|
+
}];
|
|
7208
|
+
readonly stateMutability: "view";
|
|
7352
7209
|
}, {
|
|
7353
7210
|
readonly type: "function";
|
|
7354
7211
|
readonly name: "placeOrder";
|
|
@@ -7545,6 +7402,12 @@ declare const ABI$1: readonly [{
|
|
|
7545
7402
|
readonly internalType: "address";
|
|
7546
7403
|
}];
|
|
7547
7404
|
readonly stateMutability: "view";
|
|
7405
|
+
}, {
|
|
7406
|
+
readonly type: "function";
|
|
7407
|
+
readonly name: "renounceOwnership";
|
|
7408
|
+
readonly inputs: readonly [];
|
|
7409
|
+
readonly outputs: readonly [];
|
|
7410
|
+
readonly stateMutability: "nonpayable";
|
|
7548
7411
|
}, {
|
|
7549
7412
|
readonly type: "function";
|
|
7550
7413
|
readonly name: "select";
|
|
@@ -7574,9 +7437,9 @@ declare const ABI$1: readonly [{
|
|
|
7574
7437
|
readonly stateMutability: "nonpayable";
|
|
7575
7438
|
}, {
|
|
7576
7439
|
readonly type: "function";
|
|
7577
|
-
readonly name: "
|
|
7440
|
+
readonly name: "transferOwnership";
|
|
7578
7441
|
readonly inputs: readonly [{
|
|
7579
|
-
readonly name: "
|
|
7442
|
+
readonly name: "newOwner";
|
|
7580
7443
|
readonly type: "address";
|
|
7581
7444
|
readonly internalType: "address";
|
|
7582
7445
|
}];
|
|
@@ -7584,16 +7447,8 @@ declare const ABI$1: readonly [{
|
|
|
7584
7447
|
readonly stateMutability: "nonpayable";
|
|
7585
7448
|
}, {
|
|
7586
7449
|
readonly type: "function";
|
|
7587
|
-
readonly name: "
|
|
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
|
-
}];
|
|
7450
|
+
readonly name: "unpause";
|
|
7451
|
+
readonly inputs: readonly [];
|
|
7597
7452
|
readonly outputs: readonly [];
|
|
7598
7453
|
readonly stateMutability: "nonpayable";
|
|
7599
7454
|
}, {
|
|
@@ -7708,6 +7563,11 @@ declare const ABI$1: readonly [{
|
|
|
7708
7563
|
readonly type: "bytes32";
|
|
7709
7564
|
readonly indexed: true;
|
|
7710
7565
|
readonly internalType: "bytes32";
|
|
7566
|
+
}, {
|
|
7567
|
+
readonly name: "solver";
|
|
7568
|
+
readonly type: "address";
|
|
7569
|
+
readonly indexed: false;
|
|
7570
|
+
readonly internalType: "address";
|
|
7711
7571
|
}, {
|
|
7712
7572
|
readonly name: "tokens";
|
|
7713
7573
|
readonly type: "tuple[]";
|
|
@@ -7894,6 +7754,36 @@ declare const ABI$1: readonly [{
|
|
|
7894
7754
|
readonly internalType: "bytes32";
|
|
7895
7755
|
}];
|
|
7896
7756
|
readonly anonymous: false;
|
|
7757
|
+
}, {
|
|
7758
|
+
readonly type: "event";
|
|
7759
|
+
readonly name: "OwnershipTransferStarted";
|
|
7760
|
+
readonly inputs: readonly [{
|
|
7761
|
+
readonly name: "previousOwner";
|
|
7762
|
+
readonly type: "address";
|
|
7763
|
+
readonly indexed: true;
|
|
7764
|
+
readonly internalType: "address";
|
|
7765
|
+
}, {
|
|
7766
|
+
readonly name: "newOwner";
|
|
7767
|
+
readonly type: "address";
|
|
7768
|
+
readonly indexed: true;
|
|
7769
|
+
readonly internalType: "address";
|
|
7770
|
+
}];
|
|
7771
|
+
readonly anonymous: false;
|
|
7772
|
+
}, {
|
|
7773
|
+
readonly type: "event";
|
|
7774
|
+
readonly name: "OwnershipTransferred";
|
|
7775
|
+
readonly inputs: readonly [{
|
|
7776
|
+
readonly name: "previousOwner";
|
|
7777
|
+
readonly type: "address";
|
|
7778
|
+
readonly indexed: true;
|
|
7779
|
+
readonly internalType: "address";
|
|
7780
|
+
}, {
|
|
7781
|
+
readonly name: "newOwner";
|
|
7782
|
+
readonly type: "address";
|
|
7783
|
+
readonly indexed: true;
|
|
7784
|
+
readonly internalType: "address";
|
|
7785
|
+
}];
|
|
7786
|
+
readonly anonymous: false;
|
|
7897
7787
|
}, {
|
|
7898
7788
|
readonly type: "event";
|
|
7899
7789
|
readonly name: "ParamsUpdated";
|
|
@@ -8004,37 +7894,59 @@ declare const ABI$1: readonly [{
|
|
|
8004
7894
|
readonly anonymous: false;
|
|
8005
7895
|
}, {
|
|
8006
7896
|
readonly type: "event";
|
|
8007
|
-
readonly name: "
|
|
7897
|
+
readonly name: "Paused";
|
|
8008
7898
|
readonly inputs: readonly [{
|
|
8009
|
-
readonly name: "
|
|
7899
|
+
readonly name: "account";
|
|
8010
7900
|
readonly type: "address";
|
|
8011
7901
|
readonly indexed: false;
|
|
8012
7902
|
readonly internalType: "address";
|
|
7903
|
+
}];
|
|
7904
|
+
readonly anonymous: false;
|
|
7905
|
+
}, {
|
|
7906
|
+
readonly type: "event";
|
|
7907
|
+
readonly name: "ProtocolFeeRefunded";
|
|
7908
|
+
readonly inputs: readonly [{
|
|
7909
|
+
readonly name: "commitment";
|
|
7910
|
+
readonly type: "bytes32";
|
|
7911
|
+
readonly indexed: true;
|
|
7912
|
+
readonly internalType: "bytes32";
|
|
8013
7913
|
}, {
|
|
8014
|
-
readonly name: "
|
|
7914
|
+
readonly name: "token";
|
|
8015
7915
|
readonly type: "address";
|
|
8016
|
-
readonly indexed:
|
|
7916
|
+
readonly indexed: true;
|
|
8017
7917
|
readonly internalType: "address";
|
|
7918
|
+
}, {
|
|
7919
|
+
readonly name: "amount";
|
|
7920
|
+
readonly type: "uint256";
|
|
7921
|
+
readonly indexed: false;
|
|
7922
|
+
readonly internalType: "uint256";
|
|
8018
7923
|
}];
|
|
8019
7924
|
readonly anonymous: false;
|
|
8020
7925
|
}, {
|
|
8021
7926
|
readonly type: "event";
|
|
8022
|
-
readonly name: "
|
|
7927
|
+
readonly name: "RelayerUpdated";
|
|
8023
7928
|
readonly inputs: readonly [{
|
|
8024
|
-
readonly name: "
|
|
7929
|
+
readonly name: "previous";
|
|
8025
7930
|
readonly type: "address";
|
|
8026
|
-
readonly indexed:
|
|
7931
|
+
readonly indexed: false;
|
|
7932
|
+
readonly internalType: "address";
|
|
7933
|
+
}, {
|
|
7934
|
+
readonly name: "current";
|
|
7935
|
+
readonly type: "address";
|
|
7936
|
+
readonly indexed: false;
|
|
8027
7937
|
readonly internalType: "address";
|
|
8028
7938
|
}];
|
|
8029
7939
|
readonly anonymous: false;
|
|
8030
7940
|
}, {
|
|
8031
|
-
readonly type: "
|
|
8032
|
-
readonly name: "
|
|
7941
|
+
readonly type: "event";
|
|
7942
|
+
readonly name: "Unpaused";
|
|
8033
7943
|
readonly inputs: readonly [{
|
|
8034
|
-
readonly name: "
|
|
7944
|
+
readonly name: "account";
|
|
8035
7945
|
readonly type: "address";
|
|
7946
|
+
readonly indexed: false;
|
|
8036
7947
|
readonly internalType: "address";
|
|
8037
7948
|
}];
|
|
7949
|
+
readonly anonymous: false;
|
|
8038
7950
|
}, {
|
|
8039
7951
|
readonly type: "error";
|
|
8040
7952
|
readonly name: "Cancelled";
|
|
@@ -8061,23 +7973,15 @@ declare const ABI$1: readonly [{
|
|
|
8061
7973
|
}];
|
|
8062
7974
|
}, {
|
|
8063
7975
|
readonly type: "error";
|
|
8064
|
-
readonly name: "
|
|
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";
|
|
7976
|
+
readonly name: "EnforcedPause";
|
|
8073
7977
|
readonly inputs: readonly [];
|
|
8074
7978
|
}, {
|
|
8075
7979
|
readonly type: "error";
|
|
8076
|
-
readonly name: "
|
|
7980
|
+
readonly name: "ExpectedPause";
|
|
8077
7981
|
readonly inputs: readonly [];
|
|
8078
7982
|
}, {
|
|
8079
7983
|
readonly type: "error";
|
|
8080
|
-
readonly name: "
|
|
7984
|
+
readonly name: "Expired";
|
|
8081
7985
|
readonly inputs: readonly [];
|
|
8082
7986
|
}, {
|
|
8083
7987
|
readonly type: "error";
|
|
@@ -8111,10 +8015,34 @@ declare const ABI$1: readonly [{
|
|
|
8111
8015
|
readonly type: "error";
|
|
8112
8016
|
readonly name: "NotInitializing";
|
|
8113
8017
|
readonly inputs: readonly [];
|
|
8018
|
+
}, {
|
|
8019
|
+
readonly type: "error";
|
|
8020
|
+
readonly name: "OwnableInvalidOwner";
|
|
8021
|
+
readonly inputs: readonly [{
|
|
8022
|
+
readonly name: "owner";
|
|
8023
|
+
readonly type: "address";
|
|
8024
|
+
readonly internalType: "address";
|
|
8025
|
+
}];
|
|
8026
|
+
}, {
|
|
8027
|
+
readonly type: "error";
|
|
8028
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
8029
|
+
readonly inputs: readonly [{
|
|
8030
|
+
readonly name: "account";
|
|
8031
|
+
readonly type: "address";
|
|
8032
|
+
readonly internalType: "address";
|
|
8033
|
+
}];
|
|
8114
8034
|
}, {
|
|
8115
8035
|
readonly type: "error";
|
|
8116
8036
|
readonly name: "PartialFillNotAllowed";
|
|
8117
8037
|
readonly inputs: readonly [];
|
|
8038
|
+
}, {
|
|
8039
|
+
readonly type: "error";
|
|
8040
|
+
readonly name: "RateBelowOrder";
|
|
8041
|
+
readonly inputs: readonly [];
|
|
8042
|
+
}, {
|
|
8043
|
+
readonly type: "error";
|
|
8044
|
+
readonly name: "RateFillTooSmall";
|
|
8045
|
+
readonly inputs: readonly [];
|
|
8118
8046
|
}, {
|
|
8119
8047
|
readonly type: "error";
|
|
8120
8048
|
readonly name: "ReentrancyGuardReentrantCall";
|
|
@@ -11639,4 +11567,4 @@ declare function teleport(teleport_param: {
|
|
|
11639
11567
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
11640
11568
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
11641
11569
|
|
|
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,
|
|
11570
|
+
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 IntentQuoteLeg, 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, type OrderbookLevelQuote, type OrderbookQuoteFill, 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 PessimisticQuoteIntentResult, 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 };
|