@hyperbridge/sdk 2.8.0 → 2.8.3
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 +298 -17
- package/dist/browser/index.js +496 -113
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +497 -111
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +46 -6
- package/dist/node/index.d.ts +46 -6
- package/dist/node/index.js +496 -113
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-gyGREuyu.d.cts → intents-helpers-CxCDx-hH.d.cts} +300 -19
- package/dist/node/{intents-helpers-gyGREuyu.d.ts → intents-helpers-CxCDx-hH.d.ts} +300 -19
- package/dist/node/intents-helpers.cjs +406 -50
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +1 -1
- package/dist/node/intents-helpers.d.ts +1 -1
- package/dist/node/intents-helpers.js +405 -51
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -929,6 +929,11 @@ interface ChainConfigData {
|
|
|
929
929
|
USDT: number;
|
|
930
930
|
cNGN?: number;
|
|
931
931
|
EXT?: number;
|
|
932
|
+
ZARP?: number;
|
|
933
|
+
EURC?: number;
|
|
934
|
+
XSGD?: number;
|
|
935
|
+
TRYB?: number;
|
|
936
|
+
USDR?: number;
|
|
932
937
|
};
|
|
933
938
|
tokenStorageSlots?: {
|
|
934
939
|
USDT?: {
|
|
@@ -947,6 +952,30 @@ interface ChainConfigData {
|
|
|
947
952
|
balanceSlot: number;
|
|
948
953
|
allowanceSlot: number;
|
|
949
954
|
};
|
|
955
|
+
cNGN?: {
|
|
956
|
+
balanceSlot: number;
|
|
957
|
+
allowanceSlot: number;
|
|
958
|
+
};
|
|
959
|
+
ZARP?: {
|
|
960
|
+
balanceSlot: number;
|
|
961
|
+
allowanceSlot: number;
|
|
962
|
+
};
|
|
963
|
+
EURC?: {
|
|
964
|
+
balanceSlot: number;
|
|
965
|
+
allowanceSlot: number;
|
|
966
|
+
};
|
|
967
|
+
XSGD?: {
|
|
968
|
+
balanceSlot: number;
|
|
969
|
+
allowanceSlot: number;
|
|
970
|
+
};
|
|
971
|
+
TRYB?: {
|
|
972
|
+
balanceSlot: number;
|
|
973
|
+
allowanceSlot: number;
|
|
974
|
+
};
|
|
975
|
+
USDR?: {
|
|
976
|
+
balanceSlot: number;
|
|
977
|
+
allowanceSlot: number;
|
|
978
|
+
};
|
|
950
979
|
};
|
|
951
980
|
addresses: {
|
|
952
981
|
IntentGateway?: `0x${string}`;
|
|
@@ -1888,6 +1917,17 @@ declare function convertCodecToIProof(codec: {
|
|
|
1888
1917
|
}): IProof;
|
|
1889
1918
|
declare function encodeISMPMessage(message: IIsmpMessage): Uint8Array;
|
|
1890
1919
|
|
|
1920
|
+
/**
|
|
1921
|
+
* Maps a websocket endpoint onto the HTTP endpoint of the same node — substrate serves both on the
|
|
1922
|
+
* same host and port, so the scheme is the only difference. Throws for anything that is not a
|
|
1923
|
+
* `ws(s)://` url rather than guessing at an endpoint.
|
|
1924
|
+
*
|
|
1925
|
+
* The HTTP endpoint is always derived, never configured, because it must be the *same node* as the
|
|
1926
|
+
* websocket: phantom orders are read out of that node's offchain worker storage, which is
|
|
1927
|
+
* node-local and not replicated, so a separately configured host would return nothing for orders
|
|
1928
|
+
* the events said exist.
|
|
1929
|
+
*/
|
|
1930
|
+
declare function deriveHttpUrl(wsUrl: string): string;
|
|
1891
1931
|
/**
|
|
1892
1932
|
* Encodes a PackedUserOperation using SCALE codec for submission to Hyperbridge.
|
|
1893
1933
|
* This is the recommended way to encode UserOps for the intents coprocessor.
|
|
@@ -1919,8 +1959,41 @@ interface PhantomOrderEvent {
|
|
|
1919
1959
|
*/
|
|
1920
1960
|
legs: PhantomOrderLeg[];
|
|
1921
1961
|
}
|
|
1962
|
+
/** One phantom bid to place, and the bid it replaces on the same chain. */
|
|
1963
|
+
interface PhantomBid {
|
|
1964
|
+
/** The phantom order commitment being bid on. */
|
|
1965
|
+
commitment: HexString$1;
|
|
1966
|
+
/** The SCALE-encoded PackedUserOperation backing the quote. */
|
|
1967
|
+
userOp: HexString$1;
|
|
1968
|
+
/**
|
|
1969
|
+
* A live bid from a previous interval on the same chain, retracted alongside this one to
|
|
1970
|
+
* reclaim its deposit. Best-effort: a retraction that fails never affects the bid.
|
|
1971
|
+
*/
|
|
1972
|
+
retractCommitment?: HexString$1;
|
|
1973
|
+
}
|
|
1974
|
+
/** What became of one bid in a batch. */
|
|
1975
|
+
interface PhantomBidOutcome {
|
|
1976
|
+
commitment: HexString$1;
|
|
1977
|
+
success: boolean;
|
|
1978
|
+
/** The dispatch error that rejected this bid, when it failed. */
|
|
1979
|
+
error?: string;
|
|
1980
|
+
}
|
|
1981
|
+
interface PhantomBidBatchResult {
|
|
1982
|
+
/** One entry per submitted bid, in the order they were given. */
|
|
1983
|
+
bids: PhantomBidOutcome[];
|
|
1984
|
+
/** The block and extrinsic the bids landed in. */
|
|
1985
|
+
blockHash?: HexString$1;
|
|
1986
|
+
extrinsicHash?: HexString$1;
|
|
1987
|
+
/**
|
|
1988
|
+
* The batch reached the pool but its inclusion was not observed, so no per-bid outcome is
|
|
1989
|
+
* known. Same contract as {@link BidSubmissionResult.pending}: in flight, do not re-sign.
|
|
1990
|
+
*/
|
|
1991
|
+
pending?: boolean;
|
|
1992
|
+
/** Set when the batch never landed at all, or when its item events could not be attributed. */
|
|
1993
|
+
error?: string;
|
|
1994
|
+
}
|
|
1922
1995
|
interface PollPhantomOrdersOptions {
|
|
1923
|
-
/** How often to check for a new head. Defaults to
|
|
1996
|
+
/** How often to check for a new head. Defaults to 15s, or 6s when the runtime is Gargantua. */
|
|
1924
1997
|
intervalMs?: number;
|
|
1925
1998
|
/**
|
|
1926
1999
|
* Most blocks scanned in a single poll, so a long outage catches up over several ticks instead of
|
|
@@ -1948,6 +2021,8 @@ declare class IntentsCoprocessor {
|
|
|
1948
2021
|
private ownsConnection;
|
|
1949
2022
|
/** Cached result of whether the node exposes intents_* RPC methods */
|
|
1950
2023
|
private hasIntentsRpc;
|
|
2024
|
+
/** The HTTP-backed api, connected on first use. Cleared after a failed attempt so it retries. */
|
|
2025
|
+
private httpApi;
|
|
1951
2026
|
private submissionQueue;
|
|
1952
2027
|
/**
|
|
1953
2028
|
* Creates and connects an IntentsCoprocessor to a Hyperbridge node.
|
|
@@ -1974,11 +2049,44 @@ declare class IntentsCoprocessor {
|
|
|
1974
2049
|
*/
|
|
1975
2050
|
static fromApi(api: ApiPromise, substratePrivateKey?: string): IntentsCoprocessor;
|
|
1976
2051
|
private constructor();
|
|
2052
|
+
/**
|
|
2053
|
+
* The API every RPC query runs on: HTTP, connected to the same node as the websocket. Exposed so
|
|
2054
|
+
* callers query through this connection rather than opening one of their own.
|
|
2055
|
+
*
|
|
2056
|
+
* The split is by what each transport is for. Queries are one-shot request/response, which HTTP
|
|
2057
|
+
* serves without holding any state that can silently rot between calls. The websocket earns its
|
|
2058
|
+
* keep only where subscriptions do — watching a submitted extrinsic to inclusion.
|
|
2059
|
+
*/
|
|
2060
|
+
queryApi(): Promise<ApiPromise>;
|
|
2061
|
+
/**
|
|
2062
|
+
* The websocket API, exposed so callers share this one connection instead of opening a second
|
|
2063
|
+
* socket to the same node. Only needed for subscriptions; use {@link queryApi} to read.
|
|
2064
|
+
*/
|
|
2065
|
+
get apiConnection(): ApiPromise;
|
|
1977
2066
|
/**
|
|
1978
2067
|
* Disconnects the underlying API connection if this instance owns it.
|
|
1979
|
-
* Only disconnects if created via `connect()`, not when using shared connections.
|
|
2068
|
+
* Only disconnects the websocket if created via `connect()`, not when using shared connections.
|
|
2069
|
+
* The HTTP api is always created here, so it is always ours to close.
|
|
1980
2070
|
*/
|
|
1981
2071
|
disconnect(): Promise<void>;
|
|
2072
|
+
/**
|
|
2073
|
+
* The HTTP api for this node, connected on first use. Every coprocessor has one — the endpoint
|
|
2074
|
+
* is derived from the websocket's own endpoint, so there is nothing to configure and nothing to
|
|
2075
|
+
* be absent.
|
|
2076
|
+
*
|
|
2077
|
+
* The connection attempt is bounded on both sides. `isReadyOrError` rejects on a failed
|
|
2078
|
+
* handshake, where plain `isReady` would simply never resolve, and the timeout covers an
|
|
2079
|
+
* endpoint that accepts the request and then goes quiet. An unbounded wait here would hang the
|
|
2080
|
+
* poll tick awaiting it, which is precisely the silent stall that polling exists to avoid. A
|
|
2081
|
+
* failed attempt is not cached, so the next call tries again.
|
|
2082
|
+
*/
|
|
2083
|
+
private http;
|
|
2084
|
+
/**
|
|
2085
|
+
* The endpoint the websocket provider is connected to. Read from the provider rather than
|
|
2086
|
+
* remembered from a constructor argument, so it is the one endpoint in use no matter which
|
|
2087
|
+
* factory built this instance.
|
|
2088
|
+
*/
|
|
2089
|
+
private wsEndpoint;
|
|
1982
2090
|
/**
|
|
1983
2091
|
* Creates a Substrate keypair from the configured private key.
|
|
1984
2092
|
* Supports hex seed (with or without 0x), mnemonic phrases, and URI derivation paths (//Alice).
|
|
@@ -1987,16 +2095,55 @@ declare class IntentsCoprocessor {
|
|
|
1987
2095
|
/**
|
|
1988
2096
|
* Signs and sends an extrinsic. Submissions are serialised through {@link submissionQueue} so
|
|
1989
2097
|
* concurrent calls never collide on the substrate account nonce — each extrinsic reaches a block
|
|
1990
|
-
* before the next is signed
|
|
2098
|
+
* (or is confirmed still pooled and returned as `pending`) before the next is signed; auto-nonce
|
|
2099
|
+
* via `system.accountNextIndex` counts pooled extrinsics, so a pending one is never re-used.
|
|
2100
|
+
*
|
|
2101
|
+
* The extrinsic is built rather than passed in because the api it is built on decides where it
|
|
2102
|
+
* is signed and sent: a websocket that is down when the queue reaches this submission diverts it
|
|
2103
|
+
* to {@link sendViaHttp}, which needs the call bound to the HTTP api instead.
|
|
1991
2104
|
*/
|
|
1992
2105
|
private signAndSendExtrinsic;
|
|
2106
|
+
/**
|
|
2107
|
+
* Last-resort submission for when the websocket is down at signing time. A bid is only worth
|
|
2108
|
+
* anything inside its window, so waiting for a reconnect usually means not bidding at all.
|
|
2109
|
+
*
|
|
2110
|
+
* HTTP has no subscriptions, so this is `author_submitExtrinsic`: the node accepts the extrinsic
|
|
2111
|
+
* into its pool and returns its hash, and nothing further is observable from here. That is
|
|
2112
|
+
* exactly the `pending` contract — in flight, outcome unknown, do not re-sign — so the result
|
|
2113
|
+
* says so rather than claiming a success it cannot see.
|
|
2114
|
+
*
|
|
2115
|
+
* Only reached when the socket was already down before signing. A submission that got as far as
|
|
2116
|
+
* the pool over the websocket is never retried here: that is the duplicate-nonce race the
|
|
2117
|
+
* `pending` result exists to prevent.
|
|
2118
|
+
*/
|
|
2119
|
+
private sendViaHttp;
|
|
1993
2120
|
/**
|
|
1994
2121
|
* Signs and sends an extrinsic, handling status updates and errors.
|
|
1995
2122
|
* Implements retry logic with progressive tip increases for stuck transactions.
|
|
2123
|
+
*
|
|
2124
|
+
* A retry only happens when the previous attempt verifiably went nowhere. Once an attempt's
|
|
2125
|
+
* extrinsic is known to be pooled (`pending`), re-signing the same call would race our own
|
|
2126
|
+
* submission: the copy either bounces off the pool (1014, same nonce below the replacement
|
|
2127
|
+
* priority bump) or — if the original lands first, freeing the nonce — executes as a duplicate
|
|
2128
|
+
* and fails on-chain (e.g. `BidNotFound` for a retraction). Neither can succeed, so the pending
|
|
2129
|
+
* result is returned for the caller to confirm later.
|
|
1996
2130
|
*/
|
|
1997
2131
|
private sendExtrinsicWithRetries;
|
|
1998
2132
|
/**
|
|
1999
|
-
*
|
|
2133
|
+
* Classifies a submission rejection. Codes 1013 ("already imported") and 1014 ("priority is
|
|
2134
|
+
* too low") both mean a copy of this account+nonce is already in the pool — almost always our
|
|
2135
|
+
* own earlier attempt whose watch handle didn't confirm cleanly. That extrinsic is in flight;
|
|
2136
|
+
* resubmitting can only bounce again or land a duplicate, so these are surfaced as `pending`
|
|
2137
|
+
* rather than failure.
|
|
2138
|
+
*/
|
|
2139
|
+
private classifySubmissionError;
|
|
2140
|
+
/**
|
|
2141
|
+
* Sends an extrinsic with a timeout.
|
|
2142
|
+
*
|
|
2143
|
+
* A timeout is only a failure when the extrinsic never made it into the transaction pool.
|
|
2144
|
+
* Once a pool-entry status (Future/Ready/Broadcast/Retracted) has been seen, the extrinsic is
|
|
2145
|
+
* in flight and may well execute after the watch is abandoned — the result is then `pending`,
|
|
2146
|
+
* telling the caller to confirm the outcome later instead of re-signing the same call.
|
|
2000
2147
|
*/
|
|
2001
2148
|
private sendWithTimeout;
|
|
2002
2149
|
/**
|
|
@@ -2037,6 +2184,40 @@ declare class IntentsCoprocessor {
|
|
|
2037
2184
|
* @returns BidSubmissionResult with success status and block/extrinsic hash
|
|
2038
2185
|
*/
|
|
2039
2186
|
submitBidWithRetraction(retractCommitment: HexString$1, bidCommitment: HexString$1, userOp: HexString$1): Promise<BidSubmissionResult>;
|
|
2187
|
+
/**
|
|
2188
|
+
* Places every phantom bid of one interval in a single extrinsic, retracting each chain's
|
|
2189
|
+
* previous bid alongside it.
|
|
2190
|
+
*
|
|
2191
|
+
* The pallet registers one phantom order per configured chain in the same block, so this is the
|
|
2192
|
+
* whole interval's set. Submitting them one at a time costs a block per chain: submissions are
|
|
2193
|
+
* serialised on the account nonce and each waits for inclusion, so the last chain's bid is many
|
|
2194
|
+
* blocks behind the first, against a bid window measured in tens of blocks. Batched, every bid
|
|
2195
|
+
* lands in the same block.
|
|
2196
|
+
*
|
|
2197
|
+
* Uses `utility.force_batch`, not `utility.batch`. `batch` stops at the first failing call, so
|
|
2198
|
+
* one rejected bid — a closed window, a duplicate, an insufficient deposit — would silently
|
|
2199
|
+
* drop every bid after it. `force_batch` runs them all and reports each outcome. It needs no
|
|
2200
|
+
* special origin: any signed account may call it, exactly like `batch`.
|
|
2201
|
+
*
|
|
2202
|
+
* @param bids - The bids to place; an empty list is a no-op
|
|
2203
|
+
* @returns Per-bid outcomes, in the order given
|
|
2204
|
+
*/
|
|
2205
|
+
submitPhantomBids(bids: PhantomBid[]): Promise<PhantomBidBatchResult>;
|
|
2206
|
+
/**
|
|
2207
|
+
* Reads one outcome per call out of a force_batch's events.
|
|
2208
|
+
*
|
|
2209
|
+
* `ItemFailed` carries no index — pallet-utility emits exactly one `ItemCompleted` or
|
|
2210
|
+
* `ItemFailed` per call, in call order, so the k-th item event belongs to call k.
|
|
2211
|
+
*
|
|
2212
|
+
* A count that does not match the calls submitted means the events are not the ones assumed
|
|
2213
|
+
* here, and every attribution after the discrepancy would be off by one. The bids are then
|
|
2214
|
+
* reported as placed: a bid wrongly recorded as landed is retracted next interval and the
|
|
2215
|
+
* retraction harmlessly fails with `BidNotFound`, whereas one wrongly recorded as failed is
|
|
2216
|
+
* never retracted at all and leaves its deposit reserved.
|
|
2217
|
+
*/
|
|
2218
|
+
private readForceBatchItems;
|
|
2219
|
+
/** Renders a DispatchError as `pallet::Error`, falling back to its raw form. */
|
|
2220
|
+
private describeDispatchError;
|
|
2040
2221
|
/**
|
|
2041
2222
|
* Fetches all bid storage entries for a given order commitment.
|
|
2042
2223
|
* Returns the on-chain data only (filler addresses and deposits).
|
|
@@ -2084,7 +2265,13 @@ declare class IntentsCoprocessor {
|
|
|
2084
2265
|
*/
|
|
2085
2266
|
getPhantomOrdersInBlock(blockNumber: number): Promise<PhantomOrderEvent[]>;
|
|
2086
2267
|
/**
|
|
2087
|
-
* Polls for newly registered phantom orders, invoking the callback once per
|
|
2268
|
+
* Polls for newly registered phantom orders, invoking the callback once per block that carries
|
|
2269
|
+
* any, with all of that block's orders.
|
|
2270
|
+
*
|
|
2271
|
+
* Per block rather than per order because that is how the pallet writes them: one order per
|
|
2272
|
+
* configured chain, all registered in the same `on_initialize`. Delivering them together lets a
|
|
2273
|
+
* caller bid on the whole interval in one extrinsic (see {@link submitPhantomBids}) instead of
|
|
2274
|
+
* one per chain.
|
|
2088
2275
|
*
|
|
2089
2276
|
* Each tick reads the current head and scans every block between the last one processed and that
|
|
2090
2277
|
* head, so the block cursor — not the connection — determines what has been seen. This replaced a
|
|
@@ -2097,9 +2284,21 @@ declare class IntentsCoprocessor {
|
|
|
2097
2284
|
* cannot drop them, because the cursor only advances past a block whose events were actually
|
|
2098
2285
|
* read. Recovery replays the backlog.
|
|
2099
2286
|
*
|
|
2287
|
+
* Every read here goes over HTTP, never the websocket. Polling is a sequence of independent
|
|
2288
|
+
* one-shot requests with no state to lose between them, which is exactly what a stateless
|
|
2289
|
+
* transport does well: a request either answers or fails loudly on this tick, instead of a
|
|
2290
|
+
* socket that looks alive while delivering nothing. It also means a websocket outage does not
|
|
2291
|
+
* pause phantom bidding at all — the two transports fail independently.
|
|
2292
|
+
*
|
|
2100
2293
|
* Returns a function that stops polling.
|
|
2101
2294
|
*/
|
|
2102
|
-
pollPhantomOrders(callback: (
|
|
2295
|
+
pollPhantomOrders(callback: (events: PhantomOrderEvent[]) => void, options?: PollPhantomOrdersOptions): () => void;
|
|
2296
|
+
/**
|
|
2297
|
+
* The poll cadence for the runtime this instance is connected to: Gargantua polls every block,
|
|
2298
|
+
* everything else every 15s. Falls back to the slower cadence if the runtime cannot be read,
|
|
2299
|
+
* since an unreachable node is the poll's problem to report, not the cadence lookup's.
|
|
2300
|
+
*/
|
|
2301
|
+
private phantomPollIntervalMs;
|
|
2103
2302
|
}
|
|
2104
2303
|
|
|
2105
2304
|
/**
|
|
@@ -3181,6 +3380,17 @@ interface FillerConfig {
|
|
|
3181
3380
|
* chains"; an empty array declares that no source chain is accepted.
|
|
3182
3381
|
*/
|
|
3183
3382
|
acceptedSourceChains?: string[];
|
|
3383
|
+
/**
|
|
3384
|
+
* Uniswap V4 position tokenIds this filler holds, per chain (state machine id -> tokenIds as
|
|
3385
|
+
* decimal strings), declared inside its phantom bids' paymasterAndData for the bid's own chain.
|
|
3386
|
+
*
|
|
3387
|
+
* Liquidity parked in a V4 position is invisible to the snapshot's inventory read, which sees
|
|
3388
|
+
* only ERC-20 balances and ERC-4626 vault shares — so without this a venue-funded filler is
|
|
3389
|
+
* weighted at zero and its quotes are discarded. The declaration is only a POINTER: the indexer
|
|
3390
|
+
* reads each position's liquidity on-chain and checks it is owned by the solver that signed the
|
|
3391
|
+
* bid, so naming a position cannot inflate it and naming someone else's achieves nothing.
|
|
3392
|
+
*/
|
|
3393
|
+
uniswapV4PositionsByChain?: Record<string, string[]>;
|
|
3184
3394
|
}
|
|
3185
3395
|
/**
|
|
3186
3396
|
* Result of an order execution attempt
|
|
@@ -3706,6 +3916,15 @@ interface BidSubmissionResult {
|
|
|
3706
3916
|
* Error message if submission failed
|
|
3707
3917
|
*/
|
|
3708
3918
|
error?: string;
|
|
3919
|
+
/**
|
|
3920
|
+
* The extrinsic is (or may still be) in the transaction pool: it was accepted but its
|
|
3921
|
+
* inclusion was not observed before the watch timed out, or a resubmission bounced off an
|
|
3922
|
+
* earlier copy already pooled (RPC 1013/1014). Only meaningful when `success` is false —
|
|
3923
|
+
* the operation is in flight, not failed, and must not be re-signed with the same nonce.
|
|
3924
|
+
* Callers should confirm the outcome later (e.g. re-check on-chain state) instead of
|
|
3925
|
+
* treating this as a terminal failure.
|
|
3926
|
+
*/
|
|
3927
|
+
pending?: boolean;
|
|
3709
3928
|
}
|
|
3710
3929
|
/**
|
|
3711
3930
|
* Represents a storage entry from pallet-intents Bids storage
|
|
@@ -5603,6 +5822,12 @@ declare class CryptoUtils {
|
|
|
5603
5822
|
* signing infrastructure (hardware wallets, MPC/TEE policy engines) instead
|
|
5604
5823
|
* of an opaque 32-byte digest.
|
|
5605
5824
|
*
|
|
5825
|
+
* The payload must be a standard self-describing `eth_signTypedData_v4`
|
|
5826
|
+
* payload — `EIP712Domain` listed in `types`, `chainId` as a JSON number —
|
|
5827
|
+
* because some signing backends (e.g. MPC Vault) hash it server-side from
|
|
5828
|
+
* the JSON rather than locally via viem. viem ignores both details when
|
|
5829
|
+
* hashing, so the digest is unchanged for local signers.
|
|
5830
|
+
*
|
|
5606
5831
|
* @param userOp - The packed UserOperation to sign (signature field ignored).
|
|
5607
5832
|
* @param entryPoint - Address of the EntryPoint v0.8 contract.
|
|
5608
5833
|
* @param chainId - Chain ID of the network on which the operation will execute.
|
|
@@ -5616,10 +5841,44 @@ declare class CryptoUtils {
|
|
|
5616
5841
|
verifyingContract: `0x${string}`;
|
|
5617
5842
|
};
|
|
5618
5843
|
types: {
|
|
5619
|
-
|
|
5620
|
-
name:
|
|
5621
|
-
type: string;
|
|
5622
|
-
}
|
|
5844
|
+
readonly EIP712Domain: readonly [{
|
|
5845
|
+
readonly name: "name";
|
|
5846
|
+
readonly type: "string";
|
|
5847
|
+
}, {
|
|
5848
|
+
readonly name: "version";
|
|
5849
|
+
readonly type: "string";
|
|
5850
|
+
}, {
|
|
5851
|
+
readonly name: "chainId";
|
|
5852
|
+
readonly type: "uint256";
|
|
5853
|
+
}, {
|
|
5854
|
+
readonly name: "verifyingContract";
|
|
5855
|
+
readonly type: "address";
|
|
5856
|
+
}];
|
|
5857
|
+
readonly PackedUserOperation: readonly [{
|
|
5858
|
+
readonly name: "sender";
|
|
5859
|
+
readonly type: "address";
|
|
5860
|
+
}, {
|
|
5861
|
+
readonly name: "nonce";
|
|
5862
|
+
readonly type: "uint256";
|
|
5863
|
+
}, {
|
|
5864
|
+
readonly name: "initCode";
|
|
5865
|
+
readonly type: "bytes";
|
|
5866
|
+
}, {
|
|
5867
|
+
readonly name: "callData";
|
|
5868
|
+
readonly type: "bytes";
|
|
5869
|
+
}, {
|
|
5870
|
+
readonly name: "accountGasLimits";
|
|
5871
|
+
readonly type: "bytes32";
|
|
5872
|
+
}, {
|
|
5873
|
+
readonly name: "preVerificationGas";
|
|
5874
|
+
readonly type: "uint256";
|
|
5875
|
+
}, {
|
|
5876
|
+
readonly name: "gasFees";
|
|
5877
|
+
readonly type: "bytes32";
|
|
5878
|
+
}, {
|
|
5879
|
+
readonly name: "paymasterAndData";
|
|
5880
|
+
readonly type: "bytes";
|
|
5881
|
+
}];
|
|
5623
5882
|
};
|
|
5624
5883
|
primaryType: "PackedUserOperation";
|
|
5625
5884
|
message: {
|
|
@@ -5744,16 +6003,38 @@ declare class CryptoUtils {
|
|
|
5744
6003
|
}
|
|
5745
6004
|
|
|
5746
6005
|
type HexString = `0x${string}`;
|
|
6006
|
+
/** What a phantom bid's paymasterAndData declares about the solver behind it. */
|
|
6007
|
+
interface PhantomBidDeclaration {
|
|
6008
|
+
/**
|
|
6009
|
+
* Source chains the solver accepts payment from. Null when the bid carries no parseable
|
|
6010
|
+
* declaration (the legacy default: the solver has not restricted its sources); an empty array
|
|
6011
|
+
* is an explicit accepts-nothing. Callers must preserve that distinction.
|
|
6012
|
+
*/
|
|
6013
|
+
acceptedSources: string[] | null;
|
|
6014
|
+
/**
|
|
6015
|
+
* Uniswap V4 position tokenIds the solver declares as backing this bid, on the order's own
|
|
6016
|
+
* chain. Empty when none are declared — including for every v1 bid, which predates the field.
|
|
6017
|
+
*/
|
|
6018
|
+
uniswapV4Positions: bigint[];
|
|
6019
|
+
}
|
|
5747
6020
|
/**
|
|
5748
|
-
* Encodes
|
|
5749
|
-
*
|
|
6021
|
+
* Encodes a phantom bid's declaration into the paymasterAndData blob. Emits the v1 layout when no
|
|
6022
|
+
* positions are declared, so a solver that only names source chains produces exactly the bytes it
|
|
6023
|
+
* produced before positions existed.
|
|
5750
6024
|
*/
|
|
5751
|
-
declare function
|
|
6025
|
+
declare function encodePhantomBidDeclaration(declaration: {
|
|
6026
|
+
acceptedSourceChains?: string[];
|
|
6027
|
+
uniswapV4Positions?: bigint[];
|
|
6028
|
+
}): HexString;
|
|
5752
6029
|
/**
|
|
5753
|
-
* Decodes a phantom bid's paymasterAndData
|
|
5754
|
-
*
|
|
5755
|
-
*
|
|
6030
|
+
* Decodes a phantom bid's paymasterAndData. Understands both layout versions, so bids placed
|
|
6031
|
+
* before positions existed keep decoding unchanged. Anything absent, unversioned or malformed
|
|
6032
|
+
* yields a null `acceptedSources` with no positions — never a partial read.
|
|
5756
6033
|
*/
|
|
6034
|
+
declare function decodePhantomBidDeclaration(paymasterAndData: string | undefined | null): PhantomBidDeclaration;
|
|
6035
|
+
/** Back-compat wrapper: the source-chain half of {@link encodePhantomBidDeclaration}. */
|
|
6036
|
+
declare function encodeAcceptedSourceChains(chains: string[]): HexString;
|
|
6037
|
+
/** Back-compat wrapper: the source-chain half of {@link decodePhantomBidDeclaration}. */
|
|
5757
6038
|
declare function decodeAcceptedSourceChains(paymasterAndData: string | undefined | null): string[] | null;
|
|
5758
6039
|
|
|
5759
6040
|
declare const ABI$1: readonly [{
|
|
@@ -10639,4 +10920,4 @@ declare function teleport(teleport_param: {
|
|
|
10639
10920
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
10640
10921
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
10641
10922
|
|
|
10642
|
-
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type AvailableLiquidityByChain, type AvailableLiquiditySnapshot, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BytesLikeHex, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type Erc4626VaultConfigData, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, 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, 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, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, type IsmpRequest, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, type Order, type OrderFeesQuote, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PhantomOrderEvent, type PhantomOrderLeg, type PhantomOrderPriceSnapshot, type PhantomOrderPriceSnapshotsResponse, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, type PollPhantomOrdersOptions, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type ResumeIntentOrderOptions, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineId, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolConfigData, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodeUserOpScale, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
10923
|
+
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type AvailableLiquidityByChain, type AvailableLiquiditySnapshot, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BytesLikeHex, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type Erc4626VaultConfigData, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, 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, 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, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, type IsmpRequest, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, type Order, type OrderFeesQuote, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PhantomBid, type PhantomBidBatchResult, type PhantomBidDeclaration, type PhantomBidOutcome, type PhantomOrderEvent, type PhantomOrderLeg, type PhantomOrderPriceSnapshot, type PhantomOrderPriceSnapshotsResponse, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, type PollPhantomOrdersOptions, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type ResumeIntentOrderOptions, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineId, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolConfigData, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodePhantomBidDeclaration, decodeUserOpScale, deriveHttpUrl, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodeISMPMessage, encodePhantomBidDeclaration, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|