@hyperbridge/sdk 2.8.3 → 2.8.4
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 +129 -37
- package/dist/browser/index.js +346 -219
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +351 -218
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +25 -12
- package/dist/node/index.d.ts +25 -12
- package/dist/node/index.js +346 -219
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-CxCDx-hH.d.cts → intents-helpers-CkPAsLHB.d.cts} +107 -28
- package/dist/node/{intents-helpers-CxCDx-hH.d.ts → intents-helpers-CkPAsLHB.d.ts} +107 -28
- package/dist/node/intents-helpers.cjs +10 -0
- 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 +9 -1
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +155 -153
package/dist/browser/index.js
CHANGED
|
@@ -5289,11 +5289,21 @@ var ChainConfigService = class {
|
|
|
5289
5289
|
* it, so a new asset is added once in `chain.ts` and nowhere else.
|
|
5290
5290
|
*/
|
|
5291
5291
|
getAssetBySymbol(chain, symbol) {
|
|
5292
|
-
|
|
5292
|
+
return this.getAssetMetadataBySymbol(chain, symbol)?.address;
|
|
5293
|
+
}
|
|
5294
|
+
/** Resolves a configured token symbol case-insensitively on a specific chain. */
|
|
5295
|
+
getAssetMetadataBySymbol(chain, symbol) {
|
|
5296
|
+
const config = this.getConfig(chain);
|
|
5297
|
+
const assets = config?.assets;
|
|
5293
5298
|
if (!assets) return void 0;
|
|
5294
5299
|
const target = symbol.trim().toUpperCase();
|
|
5295
5300
|
for (const [key, address] of Object.entries(assets)) {
|
|
5296
|
-
if (key.toUpperCase()
|
|
5301
|
+
if (key.toUpperCase() !== target) continue;
|
|
5302
|
+
return {
|
|
5303
|
+
symbol: key,
|
|
5304
|
+
address,
|
|
5305
|
+
decimals: config.tokenDecimals?.[key]
|
|
5306
|
+
};
|
|
5297
5307
|
}
|
|
5298
5308
|
return void 0;
|
|
5299
5309
|
}
|
|
@@ -7864,6 +7874,7 @@ var HYPERBRIDGE_TYPES_BUNDLE = {
|
|
|
7864
7874
|
};
|
|
7865
7875
|
var BASE_TIP = 1000000000n;
|
|
7866
7876
|
var HTTP_CONNECT_TIMEOUT_MS = 2e4;
|
|
7877
|
+
var INCLUSION_TIMEOUT_MS = 2e4;
|
|
7867
7878
|
var PHANTOM_POLL_INTERVAL_MS = 15e3;
|
|
7868
7879
|
var GARGANTUA_PHANTOM_POLL_INTERVAL_MS = 6e3;
|
|
7869
7880
|
function rejectAfter(ms, message) {
|
|
@@ -8082,14 +8093,16 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8082
8093
|
/**
|
|
8083
8094
|
* Signs and sends an extrinsic. Submissions are serialised through {@link submissionQueue} so
|
|
8084
8095
|
* concurrent calls never collide on the substrate account nonce — each extrinsic reaches a block
|
|
8085
|
-
* (or is confirmed still pooled and returned as `pending`) before the next is signed
|
|
8086
|
-
*
|
|
8096
|
+
* (or is confirmed still pooled and returned as `pending`) before the next is signed. The
|
|
8097
|
+
* auto-nonce is the account's on-chain nonce, so a still-pooled extrinsic does not advance it: a
|
|
8098
|
+
* submission signed behind a pending one bounces off it (1013/1014) and is reported as pending
|
|
8099
|
+
* too, rather than landing as a second copy.
|
|
8087
8100
|
*
|
|
8088
8101
|
* The extrinsic is built rather than passed in because the api it is built on decides where it
|
|
8089
8102
|
* is signed and sent: a websocket that is down when the queue reaches this submission diverts it
|
|
8090
8103
|
* to {@link sendViaHttp}, which needs the call bound to the HTTP api instead.
|
|
8091
8104
|
*/
|
|
8092
|
-
async signAndSendExtrinsic(build, maxRetries = 3, timeoutMs =
|
|
8105
|
+
async signAndSendExtrinsic(build, maxRetries = 3, timeoutMs = INCLUSION_TIMEOUT_MS) {
|
|
8093
8106
|
const result = await this.submissionQueue.add(async () => {
|
|
8094
8107
|
if (!this.api.isConnected) {
|
|
8095
8108
|
try {
|
|
@@ -8127,36 +8140,72 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8127
8140
|
* Signs and sends an extrinsic, handling status updates and errors.
|
|
8128
8141
|
* Implements retry logic with progressive tip increases for stuck transactions.
|
|
8129
8142
|
*
|
|
8130
|
-
*
|
|
8131
|
-
*
|
|
8132
|
-
*
|
|
8133
|
-
*
|
|
8134
|
-
*
|
|
8135
|
-
*
|
|
8143
|
+
* Two kinds of failure are retried, and the difference is the nonce.
|
|
8144
|
+
*
|
|
8145
|
+
* An attempt that verifiably went nowhere (rejected before the pool, dropped, invalid) leaves
|
|
8146
|
+
* the account nonce free, so the next attempt simply re-signs with the auto-nonce.
|
|
8147
|
+
*
|
|
8148
|
+
* An attempt that reached the pool and was still there when the watch timed out (`stalled`) is
|
|
8149
|
+
* retried as a *replacement*: the same nonce it was signed with, and double the tip. Substrate's
|
|
8150
|
+
* pool evicts a pooled extrinsic in favour of a higher-priority one at the same (account, nonce),
|
|
8151
|
+
* so exactly one of the two can ever execute. This matters for a bid, which is worth nothing once
|
|
8152
|
+
* its window closes — waiting out a stalled extrinsic usually means not bidding at all.
|
|
8153
|
+
*
|
|
8154
|
+
* Re-signing without pinning the nonce is what must never happen here. The auto-nonce is read
|
|
8155
|
+
* from on-chain state, so it is only the stalled extrinsic's nonce for as long as that extrinsic
|
|
8156
|
+
* stays out of a block — and a stall is precisely the case where it may land at any moment. Once
|
|
8157
|
+
* it does, an unpinned retry takes the *next* nonce and both execute: a duplicate `placeBid` that
|
|
8158
|
+
* fails on-chain, and a second `retractBid` that pulls the bid just placed. When the signed nonce
|
|
8159
|
+
* cannot be read, the stalled result is returned rather than guessed at.
|
|
8160
|
+
*
|
|
8161
|
+
* A rejection that bounced off a copy already pooled (1013/1014) is likewise left alone: that
|
|
8162
|
+
* copy is in flight and its outcome is unknown here, so the `pending` result goes back to the
|
|
8163
|
+
* caller to confirm later.
|
|
8136
8164
|
*/
|
|
8137
8165
|
async sendExtrinsicWithRetries(extrinsic, maxRetries, timeoutMs) {
|
|
8138
8166
|
const keyPair = this.getKeyPair();
|
|
8139
8167
|
let attempt = 0;
|
|
8168
|
+
let nonce;
|
|
8169
|
+
let stalled;
|
|
8140
8170
|
while (attempt < maxRetries) {
|
|
8141
8171
|
const currentTip = BASE_TIP * BigInt(2 ** attempt);
|
|
8142
8172
|
attempt++;
|
|
8143
8173
|
try {
|
|
8144
|
-
const result = await this.sendWithTimeout(extrinsic, keyPair, currentTip, timeoutMs);
|
|
8145
|
-
if (result.success || result.
|
|
8174
|
+
const result = await this.sendWithTimeout(extrinsic, keyPair, currentTip, timeoutMs, nonce);
|
|
8175
|
+
if (result.success || result.error?.includes("Dispatch error")) {
|
|
8146
8176
|
return result;
|
|
8147
8177
|
}
|
|
8178
|
+
if (result.stalled) {
|
|
8179
|
+
stalled = result;
|
|
8180
|
+
nonce ??= this.signedNonce(extrinsic);
|
|
8181
|
+
if (nonce === void 0) return result;
|
|
8182
|
+
continue;
|
|
8183
|
+
}
|
|
8184
|
+
if (result.pending) return stalled ?? result;
|
|
8148
8185
|
} catch (err) {
|
|
8149
|
-
return {
|
|
8186
|
+
return stalled ?? {
|
|
8150
8187
|
success: false,
|
|
8151
8188
|
error: err instanceof Error ? err.message : "Unknown error"
|
|
8152
8189
|
};
|
|
8153
8190
|
}
|
|
8154
8191
|
}
|
|
8155
|
-
return {
|
|
8192
|
+
return stalled ?? {
|
|
8156
8193
|
success: false,
|
|
8157
8194
|
error: `Transaction failed after ${maxRetries} attempts`
|
|
8158
8195
|
};
|
|
8159
8196
|
}
|
|
8197
|
+
/**
|
|
8198
|
+
* The nonce an extrinsic was signed with, or undefined if it carries no readable one — which is
|
|
8199
|
+
* the case before it has ever been signed, and for a stub api in tests.
|
|
8200
|
+
*/
|
|
8201
|
+
signedNonce(extrinsic) {
|
|
8202
|
+
try {
|
|
8203
|
+
const nonce = extrinsic.nonce?.toNumber?.();
|
|
8204
|
+
return typeof nonce === "number" && Number.isFinite(nonce) ? nonce : void 0;
|
|
8205
|
+
} catch {
|
|
8206
|
+
return void 0;
|
|
8207
|
+
}
|
|
8208
|
+
}
|
|
8160
8209
|
/**
|
|
8161
8210
|
* Classifies a submission rejection. Codes 1013 ("already imported") and 1014 ("priority is
|
|
8162
8211
|
* too low") both mean a copy of this account+nonce is already in the pool — almost always our
|
|
@@ -8174,10 +8223,15 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8174
8223
|
*
|
|
8175
8224
|
* A timeout is only a failure when the extrinsic never made it into the transaction pool.
|
|
8176
8225
|
* Once a pool-entry status (Future/Ready/Broadcast/Retracted) has been seen, the extrinsic is
|
|
8177
|
-
* in flight and may well execute after the watch is abandoned — the result is then `pending
|
|
8178
|
-
* telling the caller to
|
|
8226
|
+
* in flight and may well execute after the watch is abandoned — the result is then `pending`
|
|
8227
|
+
* and `stalled`, telling the caller to replace it under the same nonce or confirm it later,
|
|
8228
|
+
* never to re-sign the same call under a fresh one.
|
|
8229
|
+
*
|
|
8230
|
+
* `nonce` pins the submission to a specific account nonce, which is what makes a retry a pool
|
|
8231
|
+
* replacement rather than a second extrinsic queued behind the first. Left undefined on the
|
|
8232
|
+
* first attempt, where the api's auto-nonce is correct.
|
|
8179
8233
|
*/
|
|
8180
|
-
async sendWithTimeout(extrinsic, keyPair, tip, timeoutMs) {
|
|
8234
|
+
async sendWithTimeout(extrinsic, keyPair, tip, timeoutMs, nonce) {
|
|
8181
8235
|
return new Promise((resolve) => {
|
|
8182
8236
|
let resolved = false;
|
|
8183
8237
|
let unsubscribe = null;
|
|
@@ -8191,12 +8245,13 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8191
8245
|
resolve({
|
|
8192
8246
|
success: false,
|
|
8193
8247
|
pending: enteredPool || void 0,
|
|
8248
|
+
stalled: enteredPool || void 0,
|
|
8194
8249
|
extrinsicHash: enteredPool ? extrinsic.hash.toHex() : void 0,
|
|
8195
8250
|
error: `Transaction timed out after ${timeoutMs}ms${enteredPool ? " while in the transaction pool" : ""}`
|
|
8196
8251
|
});
|
|
8197
8252
|
}
|
|
8198
8253
|
}, timeoutMs);
|
|
8199
|
-
extrinsic.signAndSend(keyPair, { tip }, (result) => {
|
|
8254
|
+
extrinsic.signAndSend(keyPair, nonce === void 0 ? { tip } : { tip, nonce }, (result) => {
|
|
8200
8255
|
if (resolved) return;
|
|
8201
8256
|
if (result.status.isFuture || result.status.isReady || result.status.isBroadcast || result.status.isRetracted) {
|
|
8202
8257
|
enteredPool = true;
|
|
@@ -12033,52 +12088,85 @@ query LatestPhantomOrderPriceSnapshot($tokenA: String!, $tokenB: String!) {
|
|
|
12033
12088
|
}
|
|
12034
12089
|
}
|
|
12035
12090
|
}`;
|
|
12036
|
-
var
|
|
12037
|
-
query
|
|
12038
|
-
|
|
12091
|
+
var AVAILABLE_LIQUIDITY = `
|
|
12092
|
+
query AvailableLiquidity(
|
|
12093
|
+
$poolId: String!
|
|
12094
|
+
$sourceChain: String!
|
|
12095
|
+
$destinationChain: String!
|
|
12096
|
+
$direction: String!
|
|
12097
|
+
) {
|
|
12098
|
+
poolChainLiquidities(
|
|
12039
12099
|
filter: {
|
|
12040
12100
|
and: [
|
|
12041
|
-
{
|
|
12042
|
-
{
|
|
12101
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12102
|
+
{ chain: { equalTo: $destinationChain } }
|
|
12103
|
+
{ direction: { equalTo: $direction } }
|
|
12043
12104
|
]
|
|
12044
12105
|
}
|
|
12045
|
-
orderBy: SNAPSHOT_TIME_DESC
|
|
12046
12106
|
first: 1
|
|
12047
12107
|
) {
|
|
12048
12108
|
nodes {
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12109
|
+
depth
|
|
12110
|
+
bidCount
|
|
12111
|
+
unrestrictedDepth
|
|
12112
|
+
unrestrictedBidCount
|
|
12113
|
+
lastUpdatedAt
|
|
12114
|
+
}
|
|
12115
|
+
}
|
|
12116
|
+
poolRoutes(
|
|
12117
|
+
filter: {
|
|
12118
|
+
and: [
|
|
12119
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12120
|
+
{ sourceChain: { equalTo: $sourceChain } }
|
|
12121
|
+
{ chain: { equalTo: $destinationChain } }
|
|
12122
|
+
{ direction: { equalTo: $direction } }
|
|
12123
|
+
]
|
|
12124
|
+
}
|
|
12125
|
+
first: 1
|
|
12126
|
+
) {
|
|
12127
|
+
nodes {
|
|
12128
|
+
depth
|
|
12129
|
+
bidCount
|
|
12130
|
+
lastUpdatedAt
|
|
12053
12131
|
}
|
|
12054
12132
|
}
|
|
12055
12133
|
}`;
|
|
12056
|
-
var
|
|
12057
|
-
query
|
|
12058
|
-
|
|
12134
|
+
var BUY_AND_SELL_RATES = `
|
|
12135
|
+
query BuyAndSellRates(
|
|
12136
|
+
$poolId: String!
|
|
12137
|
+
$directChain: String!
|
|
12138
|
+
$directDirection: String!
|
|
12139
|
+
$reverseChain: String!
|
|
12140
|
+
$reverseDirection: String!
|
|
12141
|
+
) {
|
|
12142
|
+
direct: poolChainLiquidities(
|
|
12059
12143
|
filter: {
|
|
12060
12144
|
and: [
|
|
12061
|
-
{
|
|
12062
|
-
{
|
|
12145
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12146
|
+
{ chain: { equalTo: $directChain } }
|
|
12147
|
+
{ direction: { equalTo: $directDirection } }
|
|
12063
12148
|
]
|
|
12064
12149
|
}
|
|
12150
|
+
first: 1
|
|
12065
12151
|
) {
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
}
|
|
12070
|
-
distinctCount {
|
|
12071
|
-
providerId
|
|
12072
|
-
}
|
|
12152
|
+
nodes {
|
|
12153
|
+
rate
|
|
12154
|
+
lastUpdatedAt
|
|
12073
12155
|
}
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12156
|
+
}
|
|
12157
|
+
reverse: poolChainLiquidities(
|
|
12158
|
+
filter: {
|
|
12159
|
+
and: [
|
|
12160
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12161
|
+
{ chain: { equalTo: $reverseChain } }
|
|
12162
|
+
{ direction: { equalTo: $reverseDirection } }
|
|
12163
|
+
]
|
|
12164
|
+
}
|
|
12165
|
+
first: 1
|
|
12166
|
+
) {
|
|
12167
|
+
nodes {
|
|
12168
|
+
rate
|
|
12169
|
+
lastUpdatedAt
|
|
12082
12170
|
}
|
|
12083
12171
|
}
|
|
12084
12172
|
}`;
|
|
@@ -18232,178 +18320,191 @@ var OrderStatusChecker = class {
|
|
|
18232
18320
|
return true;
|
|
18233
18321
|
}
|
|
18234
18322
|
};
|
|
18235
|
-
|
|
18323
|
+
|
|
18324
|
+
// src/protocols/intents/liquidity-pool.ts
|
|
18325
|
+
function sortPoolSymbols(symbolA, symbolB) {
|
|
18326
|
+
return symbolA.toLowerCase() <= symbolB.toLowerCase() ? [symbolA, symbolB] : [symbolB, symbolA];
|
|
18327
|
+
}
|
|
18328
|
+
function poolSlug(symbolA, symbolB) {
|
|
18329
|
+
return sortPoolSymbols(symbolA, symbolB).join("-");
|
|
18330
|
+
}
|
|
18331
|
+
function resolveLiquidityPool(symbolA, symbolB) {
|
|
18332
|
+
const [token0Symbol, token1Symbol] = sortPoolSymbols(symbolA, symbolB);
|
|
18333
|
+
return {
|
|
18334
|
+
poolId: `${token0Symbol}-${token1Symbol}`,
|
|
18335
|
+
token0Symbol,
|
|
18336
|
+
token1Symbol
|
|
18337
|
+
};
|
|
18338
|
+
}
|
|
18339
|
+
|
|
18340
|
+
// src/protocols/intents/LiquidityEngine.ts
|
|
18341
|
+
var INDEXER_FIXED_POINT_DECIMALS = 18;
|
|
18342
|
+
var POOL_RATE_SCALE = 10n ** 18n;
|
|
18343
|
+
var SELL = "SELL";
|
|
18344
|
+
var BUY = "BUY";
|
|
18345
|
+
var USD_STABLE_SYMBOLS = /* @__PURE__ */ new Set(["USDC", "USDT"]);
|
|
18236
18346
|
var LiquidityEngine = class {
|
|
18237
|
-
|
|
18238
|
-
* @param queryClient - Nexus GraphQL client attached to the gateway.
|
|
18239
|
-
* @param chainConfigService - Resolves token decimals for formatted results.
|
|
18240
|
-
*/
|
|
18241
|
-
constructor(queryClient, chainConfigService) {
|
|
18347
|
+
constructor(queryClient) {
|
|
18242
18348
|
this.queryClient = queryClient;
|
|
18243
|
-
this.chainConfigService = chainConfigService;
|
|
18244
18349
|
}
|
|
18245
18350
|
queryClient;
|
|
18246
|
-
chainConfigService;
|
|
18247
18351
|
/**
|
|
18248
|
-
*
|
|
18249
|
-
* indexed output-token liquidity.
|
|
18352
|
+
* Returns liquidity reachable from one source chain on one destination.
|
|
18250
18353
|
*
|
|
18251
|
-
*
|
|
18252
|
-
*
|
|
18253
|
-
*
|
|
18254
|
-
* that chain's token decimals. They describe `snapshotTime`, not live
|
|
18255
|
-
* reservations or fill guarantees.
|
|
18354
|
+
* The caller resolves chain-specific token addresses through chain
|
|
18355
|
+
* configuration; this layer only maps those configured symbols onto the
|
|
18356
|
+
* indexer's canonical pool and route fields.
|
|
18256
18357
|
*
|
|
18257
|
-
*
|
|
18258
|
-
*
|
|
18259
|
-
*
|
|
18260
|
-
* @
|
|
18261
|
-
*
|
|
18262
|
-
*/
|
|
18263
|
-
async
|
|
18264
|
-
const
|
|
18265
|
-
const
|
|
18266
|
-
const
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
const
|
|
18273
|
-
if (!
|
|
18274
|
-
throw new
|
|
18275
|
-
}
|
|
18276
|
-
if (node.tokenA.toLowerCase() !== tokenIn || node.tokenB.toLowerCase() !== tokenOut) {
|
|
18277
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, "snapshot token pair does not match the query");
|
|
18278
|
-
}
|
|
18279
|
-
const snapshotTime = new Date(dateStringtoTimestamp(node.snapshotTime));
|
|
18280
|
-
if (Number.isNaN(snapshotTime.getTime())) {
|
|
18281
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, "snapshotTime is invalid");
|
|
18358
|
+
* Destination, unrestricted, and explicit-route capacity are returned as
|
|
18359
|
+
* separate values so callers can apply their own source-chain policy.
|
|
18360
|
+
*
|
|
18361
|
+
* @returns `undefined` only when the indexer has not published a destination
|
|
18362
|
+
* pool sample yet.
|
|
18363
|
+
*/
|
|
18364
|
+
async getAvailableLiquidity(params) {
|
|
18365
|
+
const pool = resolveLiquidityPool(params.source.symbol, params.destination.symbol);
|
|
18366
|
+
const direction = params.source.symbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18367
|
+
const variables = {
|
|
18368
|
+
poolId: pool.poolId,
|
|
18369
|
+
sourceChain: params.source.chain,
|
|
18370
|
+
destinationChain: params.destination.chain,
|
|
18371
|
+
direction
|
|
18372
|
+
};
|
|
18373
|
+
const response = await this.queryClient.request(AVAILABLE_LIQUIDITY, variables);
|
|
18374
|
+
if (!response?.poolChainLiquidities?.nodes || !response?.poolRoutes?.nodes) {
|
|
18375
|
+
throw new InvalidLiquidityIndexerResponseError("liquidity connections are missing");
|
|
18282
18376
|
}
|
|
18283
|
-
const
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
});
|
|
18377
|
+
const chainLiquidity = response.poolChainLiquidities.nodes[0];
|
|
18378
|
+
if (!chainLiquidity) return void 0;
|
|
18379
|
+
const route = response.poolRoutes.nodes[0];
|
|
18287
18380
|
return {
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
tokenAddress:
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18381
|
+
sourceChain: params.source.chain,
|
|
18382
|
+
destinationChain: params.destination.chain,
|
|
18383
|
+
tokenAddress: normalizeEvmAddress(params.destination.address, "destination token"),
|
|
18384
|
+
updatedAt: readIndexerDate(chainLiquidity.lastUpdatedAt, "destination lastUpdatedAt"),
|
|
18385
|
+
destination: readLiquiditySlice(chainLiquidity.depth, chainLiquidity.bidCount, "destination"),
|
|
18386
|
+
unrestricted: readLiquiditySlice(
|
|
18387
|
+
chainLiquidity.unrestrictedDepth,
|
|
18388
|
+
chainLiquidity.unrestrictedBidCount,
|
|
18389
|
+
"unrestricted"
|
|
18390
|
+
),
|
|
18391
|
+
explicitRoute: route ? {
|
|
18392
|
+
...readLiquiditySlice(route.depth, route.bidCount, "explicit route"),
|
|
18393
|
+
updatedAt: readIndexerDate(route.lastUpdatedAt, "route lastUpdatedAt")
|
|
18394
|
+
} : null
|
|
18296
18395
|
};
|
|
18297
18396
|
}
|
|
18298
18397
|
/**
|
|
18299
|
-
*
|
|
18300
|
-
*
|
|
18398
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
18399
|
+
* per one base token.
|
|
18301
18400
|
*
|
|
18302
|
-
*
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
|
|
18308
|
-
);
|
|
18309
|
-
const
|
|
18310
|
-
const
|
|
18311
|
-
|
|
18312
|
-
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
}
|
|
18317
|
-
const totalLiquidity = parseSnapshotBigInt(aggregates.sum.balance ?? "0", params.commitment, "total balance");
|
|
18318
|
-
const providerCount = parseProviderCount(aggregates.distinctCount.providerId, params.commitment, "total");
|
|
18319
|
-
const liquidityByChain = connection.groupedAggregates.map((group, index) => {
|
|
18320
|
-
const [chain, tokenAddress] = group.keys;
|
|
18321
|
-
if (!chain?.trim() || !tokenAddress) {
|
|
18322
|
-
throw new InvalidAvailableLiquiditySnapshotError(
|
|
18323
|
-
params.commitment,
|
|
18324
|
-
`liquidity group ${index} has invalid keys`
|
|
18325
|
-
);
|
|
18326
|
-
}
|
|
18327
|
-
const normalizedTokenAddress = normalizeIndexedLiquidityAddress(
|
|
18328
|
-
tokenAddress,
|
|
18329
|
-
params.commitment,
|
|
18330
|
-
`liquidity group ${index} tokenAddress`
|
|
18331
|
-
);
|
|
18332
|
-
if (normalizedTokenAddress !== params.tokenAddress) {
|
|
18333
|
-
throw new InvalidAvailableLiquiditySnapshotError(
|
|
18334
|
-
params.commitment,
|
|
18335
|
-
`liquidity group ${index} tokenAddress does not match the snapshot output token`
|
|
18336
|
-
);
|
|
18337
|
-
}
|
|
18338
|
-
return {
|
|
18339
|
-
chain: chain.trim(),
|
|
18340
|
-
tokenAddress: normalizedTokenAddress,
|
|
18341
|
-
totalLiquidity: parseSnapshotBigInt(
|
|
18342
|
-
group.sum.balance ?? "0",
|
|
18343
|
-
params.commitment,
|
|
18344
|
-
`liquidity group ${index} balance`
|
|
18345
|
-
),
|
|
18346
|
-
providerCount: parseProviderCount(
|
|
18347
|
-
group.distinctCount.providerId,
|
|
18348
|
-
params.commitment,
|
|
18349
|
-
`liquidity group ${index}`
|
|
18350
|
-
)
|
|
18351
|
-
};
|
|
18401
|
+
* The requested direction is read on the destination chain; its reverse is
|
|
18402
|
+
* read on the source chain. This mirrors where each direction's output token
|
|
18403
|
+
* must be delivered for a cross-chain trade.
|
|
18404
|
+
*/
|
|
18405
|
+
async getBuyAndSellRates(params) {
|
|
18406
|
+
const pool = resolveLiquidityPool(params.tokenInSymbol, params.tokenOutSymbol);
|
|
18407
|
+
const directDirection = params.tokenInSymbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18408
|
+
const reverseDirection = directDirection === SELL ? BUY : SELL;
|
|
18409
|
+
const response = await this.queryClient.request(BUY_AND_SELL_RATES, {
|
|
18410
|
+
poolId: pool.poolId,
|
|
18411
|
+
directChain: params.destinationChain,
|
|
18412
|
+
directDirection,
|
|
18413
|
+
reverseChain: params.sourceChain,
|
|
18414
|
+
reverseDirection
|
|
18352
18415
|
});
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18416
|
+
if (!response?.direct?.nodes || !response?.reverse?.nodes) {
|
|
18417
|
+
throw new InvalidLiquidityIndexerResponseError("rate connections are missing");
|
|
18418
|
+
}
|
|
18419
|
+
const direct = readIndexedRate(response.direct.nodes[0], "direct rate");
|
|
18420
|
+
const reverse = readIndexedRate(response.reverse.nodes[0], "reverse rate");
|
|
18421
|
+
if (!direct && !reverse) return void 0;
|
|
18422
|
+
const quoteTokenSymbol = resolveQuoteTokenSymbol(
|
|
18423
|
+
params.tokenInSymbol,
|
|
18424
|
+
params.tokenOutSymbol,
|
|
18425
|
+
direct?.scaledRate,
|
|
18426
|
+
reverse?.scaledRate
|
|
18427
|
+
);
|
|
18428
|
+
const quoteIsTokenOut = quoteTokenSymbol === params.tokenOutSymbol;
|
|
18429
|
+
const buy = quoteIsTokenOut ? direct : reverse;
|
|
18430
|
+
const sell = quoteIsTokenOut ? reverse : direct;
|
|
18431
|
+
return {
|
|
18432
|
+
baseTokenSymbol: quoteIsTokenOut ? params.tokenInSymbol : params.tokenOutSymbol,
|
|
18433
|
+
quoteTokenSymbol,
|
|
18434
|
+
sourceChain: params.sourceChain,
|
|
18435
|
+
destinationChain: params.destinationChain,
|
|
18436
|
+
buyRate: buy ? formatUnits(buy.scaledRate, INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18437
|
+
sellRate: sell ? formatUnits(reciprocalRate(sell.scaledRate, "sell rate"), INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18438
|
+
buyRateUpdatedAt: buy?.updatedAt ?? null,
|
|
18439
|
+
sellRateUpdatedAt: sell?.updatedAt ?? null
|
|
18440
|
+
};
|
|
18361
18441
|
}
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
commitment,
|
|
18368
|
-
`token decimals are not configured for ${tokenAddress} on ${chain}`
|
|
18369
|
-
);
|
|
18370
|
-
}
|
|
18371
|
-
return formatUnits(amount, decimals);
|
|
18442
|
+
};
|
|
18443
|
+
var InvalidLiquidityIndexerResponseError = class extends Error {
|
|
18444
|
+
constructor(reason) {
|
|
18445
|
+
super(`Invalid liquidity indexer response: ${reason}`);
|
|
18446
|
+
this.name = "InvalidLiquidityIndexerResponseError";
|
|
18372
18447
|
}
|
|
18373
18448
|
};
|
|
18374
|
-
var
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18449
|
+
var UnsupportedLiquidityAssetError = class extends Error {
|
|
18450
|
+
constructor(chain, asset) {
|
|
18451
|
+
super(`No configured liquidity asset found for ${asset} on ${chain}`);
|
|
18452
|
+
this.name = "UnsupportedLiquidityAssetError";
|
|
18453
|
+
}
|
|
18454
|
+
};
|
|
18455
|
+
var UnsupportedLiquidityChainError = class extends Error {
|
|
18456
|
+
constructor(chainId) {
|
|
18457
|
+
super(`No configured liquidity chain found for chain ID ${chainId}`);
|
|
18458
|
+
this.name = "UnsupportedLiquidityChainError";
|
|
18379
18459
|
}
|
|
18380
18460
|
};
|
|
18381
|
-
function
|
|
18461
|
+
function readLiquiditySlice(depth, providerCount, label) {
|
|
18462
|
+
if (!Number.isSafeInteger(providerCount) || providerCount < 0) {
|
|
18463
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} provider count is invalid`);
|
|
18464
|
+
}
|
|
18465
|
+
return { totalLiquidity: formatIndexerAmount(depth, `${label} depth`), providerCount };
|
|
18466
|
+
}
|
|
18467
|
+
function formatIndexerAmount(value, label) {
|
|
18382
18468
|
try {
|
|
18383
18469
|
const amount = BigInt(value);
|
|
18384
|
-
if (amount < 0n)
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
} catch (error) {
|
|
18389
|
-
if (error instanceof InvalidAvailableLiquiditySnapshotError) throw error;
|
|
18390
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, `${field} is not an integer`);
|
|
18470
|
+
if (amount < 0n) throw new Error();
|
|
18471
|
+
return formatUnits(amount, INDEXER_FIXED_POINT_DECIMALS);
|
|
18472
|
+
} catch {
|
|
18473
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a non-negative integer`);
|
|
18391
18474
|
}
|
|
18392
18475
|
}
|
|
18393
|
-
function
|
|
18394
|
-
const
|
|
18395
|
-
if (
|
|
18396
|
-
|
|
18397
|
-
}
|
|
18398
|
-
return count;
|
|
18476
|
+
function readIndexerDate(value, label) {
|
|
18477
|
+
const date = new Date(dateStringtoTimestamp(value));
|
|
18478
|
+
if (Number.isNaN(date.getTime())) throw new InvalidLiquidityIndexerResponseError(`${label} is invalid`);
|
|
18479
|
+
return date;
|
|
18399
18480
|
}
|
|
18400
|
-
function
|
|
18481
|
+
function readIndexedRate(node, label) {
|
|
18482
|
+
if (!node) return void 0;
|
|
18401
18483
|
try {
|
|
18402
|
-
|
|
18403
|
-
|
|
18404
|
-
|
|
18484
|
+
const scaledRate = BigInt(node.rate);
|
|
18485
|
+
if (scaledRate <= 0n) throw new Error();
|
|
18486
|
+
return {
|
|
18487
|
+
scaledRate,
|
|
18488
|
+
updatedAt: readIndexerDate(node.lastUpdatedAt, `${label} lastUpdatedAt`)
|
|
18489
|
+
};
|
|
18490
|
+
} catch (error) {
|
|
18491
|
+
if (error instanceof InvalidLiquidityIndexerResponseError) throw error;
|
|
18492
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a positive integer`);
|
|
18405
18493
|
}
|
|
18406
18494
|
}
|
|
18495
|
+
function resolveQuoteTokenSymbol(tokenInSymbol, tokenOutSymbol, directRate, reverseRate) {
|
|
18496
|
+
const inputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenInSymbol);
|
|
18497
|
+
const outputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenOutSymbol);
|
|
18498
|
+
if (inputIsUsdStable !== outputIsUsdStable) return inputIsUsdStable ? tokenOutSymbol : tokenInSymbol;
|
|
18499
|
+
if (directRate !== void 0) return directRate >= POOL_RATE_SCALE ? tokenOutSymbol : tokenInSymbol;
|
|
18500
|
+
if (reverseRate !== void 0) return reverseRate >= POOL_RATE_SCALE ? tokenInSymbol : tokenOutSymbol;
|
|
18501
|
+
throw new InvalidLiquidityIndexerResponseError("cannot orient an empty rate pair");
|
|
18502
|
+
}
|
|
18503
|
+
function reciprocalRate(rate, label) {
|
|
18504
|
+
const reciprocal = POOL_RATE_SCALE * POOL_RATE_SCALE / rate;
|
|
18505
|
+
if (reciprocal <= 0n) throw new InvalidLiquidityIndexerResponseError(`${label} reciprocal underflowed`);
|
|
18506
|
+
return reciprocal;
|
|
18507
|
+
}
|
|
18407
18508
|
|
|
18408
18509
|
// src/protocols/intents/quote/types.ts
|
|
18409
18510
|
var UnsupportedIntentQuoteStrategyError = class extends Error {
|
|
@@ -18828,8 +18929,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18828
18929
|
gasEstimator;
|
|
18829
18930
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
18830
18931
|
quoteStrategies;
|
|
18831
|
-
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
18832
|
-
phantomSnapshotPairResolver;
|
|
18833
18932
|
/**
|
|
18834
18933
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
18835
18934
|
*
|
|
@@ -18873,7 +18972,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18873
18972
|
this.bidManager = bidManager;
|
|
18874
18973
|
this.gasEstimator = gasEstimator;
|
|
18875
18974
|
this._crypto = crypto;
|
|
18876
|
-
this.phantomSnapshotPairResolver = new PhantomSnapshotPairResolver(dest.configService);
|
|
18877
18975
|
this.quoteStrategies = {
|
|
18878
18976
|
phantom_snapshot: new PhantomSnapshotIntentQuoteStrategy(
|
|
18879
18977
|
dest.configService,
|
|
@@ -18953,33 +19051,62 @@ var IntentGateway = class _IntentGateway {
|
|
|
18953
19051
|
return handler.quote({ ...params, strategy }, source, destination);
|
|
18954
19052
|
}
|
|
18955
19053
|
/**
|
|
18956
|
-
* Returns
|
|
18957
|
-
* Phantom snapshot for this gateway's source and destination.
|
|
19054
|
+
* Returns indexed destination liquidity and its source-routing slices.
|
|
18958
19055
|
*
|
|
18959
|
-
*
|
|
18960
|
-
*
|
|
18961
|
-
*
|
|
18962
|
-
*
|
|
19056
|
+
* Destination, unrestricted, and explicit-route capacity come exclusively
|
|
19057
|
+
* from the indexer's pair-centric liquidity entities. The SDK does not decide
|
|
19058
|
+
* whether unrestricted bidders cover the source chain. Amounts reflect the
|
|
19059
|
+
* latest rolling sample; they are not reservations or fill guarantees.
|
|
18963
19060
|
*
|
|
18964
19061
|
* Requires a prior call to {@link withQueryClient}.
|
|
18965
19062
|
*/
|
|
18966
19063
|
async queryAvailableLiquidity(params) {
|
|
18967
19064
|
const { queryClient } = this.requireIndexer();
|
|
18968
|
-
const sourceStateMachineId = this.source.config.stateMachineId;
|
|
18969
|
-
const destinationStateMachineId = this.dest.config.stateMachineId;
|
|
18970
|
-
|
|
18971
|
-
if (!
|
|
18972
|
-
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
18978
|
-
|
|
18979
|
-
|
|
18980
|
-
|
|
18981
|
-
|
|
18982
|
-
|
|
19065
|
+
const sourceStateMachineId = getConfigByStateMachineId(this.source.config.stateMachineId)?.stateMachineId;
|
|
19066
|
+
const destinationStateMachineId = getConfigByStateMachineId(this.dest.config.stateMachineId)?.stateMachineId;
|
|
19067
|
+
if (!sourceStateMachineId) throw new UnsupportedLiquidityChainError(this.source.config.stateMachineId);
|
|
19068
|
+
if (!destinationStateMachineId) throw new UnsupportedLiquidityChainError(this.dest.config.stateMachineId);
|
|
19069
|
+
const sourceToken = this.source.configService.getAssetMetadataByAddress(sourceStateMachineId, params.tokenIn);
|
|
19070
|
+
const destinationToken = this.dest.configService.getAssetMetadataByAddress(
|
|
19071
|
+
destinationStateMachineId,
|
|
19072
|
+
params.tokenOut
|
|
19073
|
+
);
|
|
19074
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceStateMachineId, params.tokenIn);
|
|
19075
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationStateMachineId, params.tokenOut);
|
|
19076
|
+
return new LiquidityEngine(queryClient).getAvailableLiquidity({
|
|
19077
|
+
source: {
|
|
19078
|
+
chain: sourceStateMachineId,
|
|
19079
|
+
...sourceToken
|
|
19080
|
+
},
|
|
19081
|
+
destination: {
|
|
19082
|
+
chain: destinationStateMachineId,
|
|
19083
|
+
...destinationToken
|
|
19084
|
+
}
|
|
19085
|
+
});
|
|
19086
|
+
}
|
|
19087
|
+
/**
|
|
19088
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
19089
|
+
* without requiring token addresses. Symbols are matched case-insensitively;
|
|
19090
|
+
* chain IDs are numeric IDs for chains configured in the SDK.
|
|
19091
|
+
*/
|
|
19092
|
+
async queryBuyAndSellRates(params) {
|
|
19093
|
+
const { queryClient } = this.requireIndexer();
|
|
19094
|
+
const sourceChain = chainConfigs[params.sourceChainId]?.stateMachineId;
|
|
19095
|
+
const destinationChain = chainConfigs[params.destinationChainId]?.stateMachineId;
|
|
19096
|
+
if (!sourceChain) throw new UnsupportedLiquidityChainError(params.sourceChainId);
|
|
19097
|
+
if (!destinationChain) throw new UnsupportedLiquidityChainError(params.destinationChainId);
|
|
19098
|
+
const sourceToken = this.source.configService.getAssetMetadataBySymbol(sourceChain, params.tokenInSymbol);
|
|
19099
|
+
const destinationToken = this.dest.configService.getAssetMetadataBySymbol(
|
|
19100
|
+
destinationChain,
|
|
19101
|
+
params.tokenOutSymbol
|
|
19102
|
+
);
|
|
19103
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceChain, params.tokenInSymbol);
|
|
19104
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationChain, params.tokenOutSymbol);
|
|
19105
|
+
return new LiquidityEngine(queryClient).getBuyAndSellRates({
|
|
19106
|
+
sourceChain,
|
|
19107
|
+
destinationChain,
|
|
19108
|
+
tokenInSymbol: sourceToken.symbol,
|
|
19109
|
+
tokenOutSymbol: destinationToken.symbol
|
|
18983
19110
|
});
|
|
18984
19111
|
}
|
|
18985
19112
|
/**
|
|
@@ -24081,6 +24208,6 @@ async function teleportDot(param_) {
|
|
|
24081
24208
|
return stream;
|
|
24082
24209
|
}
|
|
24083
24210
|
|
|
24084
|
-
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, ChainConfigService, Chains, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, IntentGateway, ABI3 as IntentGatewayABI, IntentOrderStatus, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PhantomSnapshotUnavailableError, PharosChain, PolkadotHubChain, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestKind, RequestStatus, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SubstrateChain, Swap, TESTNET_CHAINS, TeleportStatus, TimeoutStatus, TokenGateway, TronChain, USE_ETHERSCAN_CHAINS, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, __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 };
|
|
24211
|
+
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, ChainConfigService, Chains, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, INCLUSION_TIMEOUT_MS, IntentGateway, ABI3 as IntentGatewayABI, IntentOrderStatus, IntentsCoprocessor, InvalidLiquidityIndexerResponseError, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PhantomSnapshotUnavailableError, PharosChain, PolkadotHubChain, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestKind, RequestStatus, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SubstrateChain, Swap, TESTNET_CHAINS, TeleportStatus, TimeoutStatus, TokenGateway, TronChain, USE_ETHERSCAN_CHAINS, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, __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, poolSlug, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, sortPoolSymbols, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
24085
24212
|
//# sourceMappingURL=index.js.map
|
|
24086
24213
|
//# sourceMappingURL=index.js.map
|