@hyperbridge/sdk 2.8.3 → 2.8.5
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 +133 -46
- package/dist/browser/index.js +354 -235
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +359 -234
- 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 +354 -235
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-CxCDx-hH.d.cts → intents-helpers-Cf0-Odlu.d.cts} +111 -37
- package/dist/node/{intents-helpers-CxCDx-hH.d.ts → intents-helpers-Cf0-Odlu.d.ts} +111 -37
- 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
|
}`;
|
|
@@ -16358,12 +16446,9 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16358
16446
|
static DEFAULT_MAX_RECOVERY_RESTARTS = 1;
|
|
16359
16447
|
static PROOF_FRESHNESS_MAX_RETRIES = 3;
|
|
16360
16448
|
static PROOF_FRESHNESS_BACKOFF_MS = 500;
|
|
16361
|
-
/**
|
|
16362
|
-
|
|
16363
|
-
|
|
16364
|
-
* chain), priced at the source chain's gas price.
|
|
16365
|
-
*/
|
|
16366
|
-
static CANCEL_MESSAGE_GAS = 800000n;
|
|
16449
|
+
/** Gas budgets used to price cancellation delivery on the source chain. */
|
|
16450
|
+
static SOURCE_GET_RESPONSE_GAS = 1000000n;
|
|
16451
|
+
static REFUND_POST_GAS = 1000000n;
|
|
16367
16452
|
logger = createConsola({
|
|
16368
16453
|
level: LogLevels.info,
|
|
16369
16454
|
formatOptions: { columns: 80, colors: true, compact: true, date: false }
|
|
@@ -16401,9 +16486,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16401
16486
|
return { nativeValue: 0n, relayerFee: 0n };
|
|
16402
16487
|
}
|
|
16403
16488
|
const height = order.deadline + 1n;
|
|
16404
|
-
const destIntentGateway = this.ctx.dest.configService.getIntentGatewayAddress(
|
|
16405
|
-
destStateMachine
|
|
16406
|
-
);
|
|
16489
|
+
const destIntentGateway = this.ctx.dest.configService.getIntentGatewayAddress(destStateMachine);
|
|
16407
16490
|
const slotHash = await this.ctx.dest.client.readContract({
|
|
16408
16491
|
abi: ABI3,
|
|
16409
16492
|
address: destIntentGateway,
|
|
@@ -16424,7 +16507,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16424
16507
|
};
|
|
16425
16508
|
const feeInSourceFeeToken = await convertGasToFeeToken(
|
|
16426
16509
|
this.ctx,
|
|
16427
|
-
_OrderCanceller.
|
|
16510
|
+
_OrderCanceller.SOURCE_GET_RESPONSE_GAS,
|
|
16428
16511
|
"source",
|
|
16429
16512
|
sourceStateMachine
|
|
16430
16513
|
);
|
|
@@ -16970,9 +17053,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16970
17053
|
return null;
|
|
16971
17054
|
}
|
|
16972
17055
|
async removeRecoveryItems(...keys) {
|
|
16973
|
-
await Promise.all(
|
|
16974
|
-
[...new Set(keys)].map((key) => this.ctx.cancellationStorage.removeItem(key))
|
|
16975
|
-
);
|
|
17056
|
+
await Promise.all([...new Set(keys)].map((key) => this.ctx.cancellationStorage.removeItem(key)));
|
|
16976
17057
|
}
|
|
16977
17058
|
/**
|
|
16978
17059
|
* Returns the order identifier required to persist or clear recovery state.
|
|
@@ -17020,7 +17101,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
17020
17101
|
async estimateRelayerFee(sourceChainId, destChainId) {
|
|
17021
17102
|
const feeInSourceFeeToken = await convertGasToFeeToken(
|
|
17022
17103
|
this.ctx,
|
|
17023
|
-
_OrderCanceller.
|
|
17104
|
+
_OrderCanceller.REFUND_POST_GAS,
|
|
17024
17105
|
"source",
|
|
17025
17106
|
sourceChainId
|
|
17026
17107
|
);
|
|
@@ -17302,8 +17383,7 @@ var BidManager = class {
|
|
|
17302
17383
|
);
|
|
17303
17384
|
}
|
|
17304
17385
|
const solverSignature = await solverSigner.signTypedData(
|
|
17305
|
-
CryptoUtils.packedUserOpTypedData(userOp, entryPointAddress, chainId)
|
|
17306
|
-
Number(chainId)
|
|
17386
|
+
CryptoUtils.packedUserOpTypedData(userOp, entryPointAddress, chainId)
|
|
17307
17387
|
);
|
|
17308
17388
|
const signature = concat([order.id, solverSignature]);
|
|
17309
17389
|
return { ...userOp, signature };
|
|
@@ -18232,178 +18312,191 @@ var OrderStatusChecker = class {
|
|
|
18232
18312
|
return true;
|
|
18233
18313
|
}
|
|
18234
18314
|
};
|
|
18235
|
-
|
|
18315
|
+
|
|
18316
|
+
// src/protocols/intents/liquidity-pool.ts
|
|
18317
|
+
function sortPoolSymbols(symbolA, symbolB) {
|
|
18318
|
+
return symbolA.toLowerCase() <= symbolB.toLowerCase() ? [symbolA, symbolB] : [symbolB, symbolA];
|
|
18319
|
+
}
|
|
18320
|
+
function poolSlug(symbolA, symbolB) {
|
|
18321
|
+
return sortPoolSymbols(symbolA, symbolB).join("-");
|
|
18322
|
+
}
|
|
18323
|
+
function resolveLiquidityPool(symbolA, symbolB) {
|
|
18324
|
+
const [token0Symbol, token1Symbol] = sortPoolSymbols(symbolA, symbolB);
|
|
18325
|
+
return {
|
|
18326
|
+
poolId: `${token0Symbol}-${token1Symbol}`,
|
|
18327
|
+
token0Symbol,
|
|
18328
|
+
token1Symbol
|
|
18329
|
+
};
|
|
18330
|
+
}
|
|
18331
|
+
|
|
18332
|
+
// src/protocols/intents/LiquidityEngine.ts
|
|
18333
|
+
var INDEXER_FIXED_POINT_DECIMALS = 18;
|
|
18334
|
+
var POOL_RATE_SCALE = 10n ** 18n;
|
|
18335
|
+
var SELL = "SELL";
|
|
18336
|
+
var BUY = "BUY";
|
|
18337
|
+
var USD_STABLE_SYMBOLS = /* @__PURE__ */ new Set(["USDC", "USDT"]);
|
|
18236
18338
|
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) {
|
|
18339
|
+
constructor(queryClient) {
|
|
18242
18340
|
this.queryClient = queryClient;
|
|
18243
|
-
this.chainConfigService = chainConfigService;
|
|
18244
18341
|
}
|
|
18245
18342
|
queryClient;
|
|
18246
|
-
chainConfigService;
|
|
18247
18343
|
/**
|
|
18248
|
-
*
|
|
18249
|
-
* indexed output-token liquidity.
|
|
18344
|
+
* Returns liquidity reachable from one source chain on one destination.
|
|
18250
18345
|
*
|
|
18251
|
-
*
|
|
18252
|
-
*
|
|
18253
|
-
*
|
|
18254
|
-
* that chain's token decimals. They describe `snapshotTime`, not live
|
|
18255
|
-
* reservations or fill guarantees.
|
|
18346
|
+
* The caller resolves chain-specific token addresses through chain
|
|
18347
|
+
* configuration; this layer only maps those configured symbols onto the
|
|
18348
|
+
* indexer's canonical pool and route fields.
|
|
18256
18349
|
*
|
|
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");
|
|
18350
|
+
* Destination, unrestricted, and explicit-route capacity are returned as
|
|
18351
|
+
* separate values so callers can apply their own source-chain policy.
|
|
18352
|
+
*
|
|
18353
|
+
* @returns `undefined` only when the indexer has not published a destination
|
|
18354
|
+
* pool sample yet.
|
|
18355
|
+
*/
|
|
18356
|
+
async getAvailableLiquidity(params) {
|
|
18357
|
+
const pool = resolveLiquidityPool(params.source.symbol, params.destination.symbol);
|
|
18358
|
+
const direction = params.source.symbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18359
|
+
const variables = {
|
|
18360
|
+
poolId: pool.poolId,
|
|
18361
|
+
sourceChain: params.source.chain,
|
|
18362
|
+
destinationChain: params.destination.chain,
|
|
18363
|
+
direction
|
|
18364
|
+
};
|
|
18365
|
+
const response = await this.queryClient.request(AVAILABLE_LIQUIDITY, variables);
|
|
18366
|
+
if (!response?.poolChainLiquidities?.nodes || !response?.poolRoutes?.nodes) {
|
|
18367
|
+
throw new InvalidLiquidityIndexerResponseError("liquidity connections are missing");
|
|
18282
18368
|
}
|
|
18283
|
-
const
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
});
|
|
18369
|
+
const chainLiquidity = response.poolChainLiquidities.nodes[0];
|
|
18370
|
+
if (!chainLiquidity) return void 0;
|
|
18371
|
+
const route = response.poolRoutes.nodes[0];
|
|
18287
18372
|
return {
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
tokenAddress:
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18373
|
+
sourceChain: params.source.chain,
|
|
18374
|
+
destinationChain: params.destination.chain,
|
|
18375
|
+
tokenAddress: normalizeEvmAddress(params.destination.address, "destination token"),
|
|
18376
|
+
updatedAt: readIndexerDate(chainLiquidity.lastUpdatedAt, "destination lastUpdatedAt"),
|
|
18377
|
+
destination: readLiquiditySlice(chainLiquidity.depth, chainLiquidity.bidCount, "destination"),
|
|
18378
|
+
unrestricted: readLiquiditySlice(
|
|
18379
|
+
chainLiquidity.unrestrictedDepth,
|
|
18380
|
+
chainLiquidity.unrestrictedBidCount,
|
|
18381
|
+
"unrestricted"
|
|
18382
|
+
),
|
|
18383
|
+
explicitRoute: route ? {
|
|
18384
|
+
...readLiquiditySlice(route.depth, route.bidCount, "explicit route"),
|
|
18385
|
+
updatedAt: readIndexerDate(route.lastUpdatedAt, "route lastUpdatedAt")
|
|
18386
|
+
} : null
|
|
18296
18387
|
};
|
|
18297
18388
|
}
|
|
18298
18389
|
/**
|
|
18299
|
-
*
|
|
18300
|
-
*
|
|
18390
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
18391
|
+
* per one base token.
|
|
18301
18392
|
*
|
|
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
|
-
};
|
|
18393
|
+
* The requested direction is read on the destination chain; its reverse is
|
|
18394
|
+
* read on the source chain. This mirrors where each direction's output token
|
|
18395
|
+
* must be delivered for a cross-chain trade.
|
|
18396
|
+
*/
|
|
18397
|
+
async getBuyAndSellRates(params) {
|
|
18398
|
+
const pool = resolveLiquidityPool(params.tokenInSymbol, params.tokenOutSymbol);
|
|
18399
|
+
const directDirection = params.tokenInSymbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18400
|
+
const reverseDirection = directDirection === SELL ? BUY : SELL;
|
|
18401
|
+
const response = await this.queryClient.request(BUY_AND_SELL_RATES, {
|
|
18402
|
+
poolId: pool.poolId,
|
|
18403
|
+
directChain: params.destinationChain,
|
|
18404
|
+
directDirection,
|
|
18405
|
+
reverseChain: params.sourceChain,
|
|
18406
|
+
reverseDirection
|
|
18352
18407
|
});
|
|
18353
|
-
|
|
18354
|
-
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18408
|
+
if (!response?.direct?.nodes || !response?.reverse?.nodes) {
|
|
18409
|
+
throw new InvalidLiquidityIndexerResponseError("rate connections are missing");
|
|
18410
|
+
}
|
|
18411
|
+
const direct = readIndexedRate(response.direct.nodes[0], "direct rate");
|
|
18412
|
+
const reverse = readIndexedRate(response.reverse.nodes[0], "reverse rate");
|
|
18413
|
+
if (!direct && !reverse) return void 0;
|
|
18414
|
+
const quoteTokenSymbol = resolveQuoteTokenSymbol(
|
|
18415
|
+
params.tokenInSymbol,
|
|
18416
|
+
params.tokenOutSymbol,
|
|
18417
|
+
direct?.scaledRate,
|
|
18418
|
+
reverse?.scaledRate
|
|
18419
|
+
);
|
|
18420
|
+
const quoteIsTokenOut = quoteTokenSymbol === params.tokenOutSymbol;
|
|
18421
|
+
const buy = quoteIsTokenOut ? direct : reverse;
|
|
18422
|
+
const sell = quoteIsTokenOut ? reverse : direct;
|
|
18423
|
+
return {
|
|
18424
|
+
baseTokenSymbol: quoteIsTokenOut ? params.tokenInSymbol : params.tokenOutSymbol,
|
|
18425
|
+
quoteTokenSymbol,
|
|
18426
|
+
sourceChain: params.sourceChain,
|
|
18427
|
+
destinationChain: params.destinationChain,
|
|
18428
|
+
buyRate: buy ? formatUnits(buy.scaledRate, INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18429
|
+
sellRate: sell ? formatUnits(reciprocalRate(sell.scaledRate, "sell rate"), INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18430
|
+
buyRateUpdatedAt: buy?.updatedAt ?? null,
|
|
18431
|
+
sellRateUpdatedAt: sell?.updatedAt ?? null
|
|
18432
|
+
};
|
|
18361
18433
|
}
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
commitment,
|
|
18368
|
-
`token decimals are not configured for ${tokenAddress} on ${chain}`
|
|
18369
|
-
);
|
|
18370
|
-
}
|
|
18371
|
-
return formatUnits(amount, decimals);
|
|
18434
|
+
};
|
|
18435
|
+
var InvalidLiquidityIndexerResponseError = class extends Error {
|
|
18436
|
+
constructor(reason) {
|
|
18437
|
+
super(`Invalid liquidity indexer response: ${reason}`);
|
|
18438
|
+
this.name = "InvalidLiquidityIndexerResponseError";
|
|
18372
18439
|
}
|
|
18373
18440
|
};
|
|
18374
|
-
var
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18441
|
+
var UnsupportedLiquidityAssetError = class extends Error {
|
|
18442
|
+
constructor(chain, asset) {
|
|
18443
|
+
super(`No configured liquidity asset found for ${asset} on ${chain}`);
|
|
18444
|
+
this.name = "UnsupportedLiquidityAssetError";
|
|
18445
|
+
}
|
|
18446
|
+
};
|
|
18447
|
+
var UnsupportedLiquidityChainError = class extends Error {
|
|
18448
|
+
constructor(chainId) {
|
|
18449
|
+
super(`No configured liquidity chain found for chain ID ${chainId}`);
|
|
18450
|
+
this.name = "UnsupportedLiquidityChainError";
|
|
18379
18451
|
}
|
|
18380
18452
|
};
|
|
18381
|
-
function
|
|
18453
|
+
function readLiquiditySlice(depth, providerCount, label) {
|
|
18454
|
+
if (!Number.isSafeInteger(providerCount) || providerCount < 0) {
|
|
18455
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} provider count is invalid`);
|
|
18456
|
+
}
|
|
18457
|
+
return { totalLiquidity: formatIndexerAmount(depth, `${label} depth`), providerCount };
|
|
18458
|
+
}
|
|
18459
|
+
function formatIndexerAmount(value, label) {
|
|
18382
18460
|
try {
|
|
18383
18461
|
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`);
|
|
18462
|
+
if (amount < 0n) throw new Error();
|
|
18463
|
+
return formatUnits(amount, INDEXER_FIXED_POINT_DECIMALS);
|
|
18464
|
+
} catch {
|
|
18465
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a non-negative integer`);
|
|
18391
18466
|
}
|
|
18392
18467
|
}
|
|
18393
|
-
function
|
|
18394
|
-
const
|
|
18395
|
-
if (
|
|
18396
|
-
|
|
18397
|
-
}
|
|
18398
|
-
return count;
|
|
18468
|
+
function readIndexerDate(value, label) {
|
|
18469
|
+
const date = new Date(dateStringtoTimestamp(value));
|
|
18470
|
+
if (Number.isNaN(date.getTime())) throw new InvalidLiquidityIndexerResponseError(`${label} is invalid`);
|
|
18471
|
+
return date;
|
|
18399
18472
|
}
|
|
18400
|
-
function
|
|
18473
|
+
function readIndexedRate(node, label) {
|
|
18474
|
+
if (!node) return void 0;
|
|
18401
18475
|
try {
|
|
18402
|
-
|
|
18403
|
-
|
|
18404
|
-
|
|
18476
|
+
const scaledRate = BigInt(node.rate);
|
|
18477
|
+
if (scaledRate <= 0n) throw new Error();
|
|
18478
|
+
return {
|
|
18479
|
+
scaledRate,
|
|
18480
|
+
updatedAt: readIndexerDate(node.lastUpdatedAt, `${label} lastUpdatedAt`)
|
|
18481
|
+
};
|
|
18482
|
+
} catch (error) {
|
|
18483
|
+
if (error instanceof InvalidLiquidityIndexerResponseError) throw error;
|
|
18484
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a positive integer`);
|
|
18405
18485
|
}
|
|
18406
18486
|
}
|
|
18487
|
+
function resolveQuoteTokenSymbol(tokenInSymbol, tokenOutSymbol, directRate, reverseRate) {
|
|
18488
|
+
const inputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenInSymbol);
|
|
18489
|
+
const outputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenOutSymbol);
|
|
18490
|
+
if (inputIsUsdStable !== outputIsUsdStable) return inputIsUsdStable ? tokenOutSymbol : tokenInSymbol;
|
|
18491
|
+
if (directRate !== void 0) return directRate >= POOL_RATE_SCALE ? tokenOutSymbol : tokenInSymbol;
|
|
18492
|
+
if (reverseRate !== void 0) return reverseRate >= POOL_RATE_SCALE ? tokenInSymbol : tokenOutSymbol;
|
|
18493
|
+
throw new InvalidLiquidityIndexerResponseError("cannot orient an empty rate pair");
|
|
18494
|
+
}
|
|
18495
|
+
function reciprocalRate(rate, label) {
|
|
18496
|
+
const reciprocal = POOL_RATE_SCALE * POOL_RATE_SCALE / rate;
|
|
18497
|
+
if (reciprocal <= 0n) throw new InvalidLiquidityIndexerResponseError(`${label} reciprocal underflowed`);
|
|
18498
|
+
return reciprocal;
|
|
18499
|
+
}
|
|
18407
18500
|
|
|
18408
18501
|
// src/protocols/intents/quote/types.ts
|
|
18409
18502
|
var UnsupportedIntentQuoteStrategyError = class extends Error {
|
|
@@ -18828,8 +18921,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18828
18921
|
gasEstimator;
|
|
18829
18922
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
18830
18923
|
quoteStrategies;
|
|
18831
|
-
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
18832
|
-
phantomSnapshotPairResolver;
|
|
18833
18924
|
/**
|
|
18834
18925
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
18835
18926
|
*
|
|
@@ -18873,7 +18964,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18873
18964
|
this.bidManager = bidManager;
|
|
18874
18965
|
this.gasEstimator = gasEstimator;
|
|
18875
18966
|
this._crypto = crypto;
|
|
18876
|
-
this.phantomSnapshotPairResolver = new PhantomSnapshotPairResolver(dest.configService);
|
|
18877
18967
|
this.quoteStrategies = {
|
|
18878
18968
|
phantom_snapshot: new PhantomSnapshotIntentQuoteStrategy(
|
|
18879
18969
|
dest.configService,
|
|
@@ -18953,33 +19043,62 @@ var IntentGateway = class _IntentGateway {
|
|
|
18953
19043
|
return handler.quote({ ...params, strategy }, source, destination);
|
|
18954
19044
|
}
|
|
18955
19045
|
/**
|
|
18956
|
-
* Returns
|
|
18957
|
-
* Phantom snapshot for this gateway's source and destination.
|
|
19046
|
+
* Returns indexed destination liquidity and its source-routing slices.
|
|
18958
19047
|
*
|
|
18959
|
-
*
|
|
18960
|
-
*
|
|
18961
|
-
*
|
|
18962
|
-
*
|
|
19048
|
+
* Destination, unrestricted, and explicit-route capacity come exclusively
|
|
19049
|
+
* from the indexer's pair-centric liquidity entities. The SDK does not decide
|
|
19050
|
+
* whether unrestricted bidders cover the source chain. Amounts reflect the
|
|
19051
|
+
* latest rolling sample; they are not reservations or fill guarantees.
|
|
18963
19052
|
*
|
|
18964
19053
|
* Requires a prior call to {@link withQueryClient}.
|
|
18965
19054
|
*/
|
|
18966
19055
|
async queryAvailableLiquidity(params) {
|
|
18967
19056
|
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
|
-
|
|
19057
|
+
const sourceStateMachineId = getConfigByStateMachineId(this.source.config.stateMachineId)?.stateMachineId;
|
|
19058
|
+
const destinationStateMachineId = getConfigByStateMachineId(this.dest.config.stateMachineId)?.stateMachineId;
|
|
19059
|
+
if (!sourceStateMachineId) throw new UnsupportedLiquidityChainError(this.source.config.stateMachineId);
|
|
19060
|
+
if (!destinationStateMachineId) throw new UnsupportedLiquidityChainError(this.dest.config.stateMachineId);
|
|
19061
|
+
const sourceToken = this.source.configService.getAssetMetadataByAddress(sourceStateMachineId, params.tokenIn);
|
|
19062
|
+
const destinationToken = this.dest.configService.getAssetMetadataByAddress(
|
|
19063
|
+
destinationStateMachineId,
|
|
19064
|
+
params.tokenOut
|
|
19065
|
+
);
|
|
19066
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceStateMachineId, params.tokenIn);
|
|
19067
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationStateMachineId, params.tokenOut);
|
|
19068
|
+
return new LiquidityEngine(queryClient).getAvailableLiquidity({
|
|
19069
|
+
source: {
|
|
19070
|
+
chain: sourceStateMachineId,
|
|
19071
|
+
...sourceToken
|
|
19072
|
+
},
|
|
19073
|
+
destination: {
|
|
19074
|
+
chain: destinationStateMachineId,
|
|
19075
|
+
...destinationToken
|
|
19076
|
+
}
|
|
19077
|
+
});
|
|
19078
|
+
}
|
|
19079
|
+
/**
|
|
19080
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
19081
|
+
* without requiring token addresses. Symbols are matched case-insensitively;
|
|
19082
|
+
* chain IDs are numeric IDs for chains configured in the SDK.
|
|
19083
|
+
*/
|
|
19084
|
+
async queryBuyAndSellRates(params) {
|
|
19085
|
+
const { queryClient } = this.requireIndexer();
|
|
19086
|
+
const sourceChain = chainConfigs[params.sourceChainId]?.stateMachineId;
|
|
19087
|
+
const destinationChain = chainConfigs[params.destinationChainId]?.stateMachineId;
|
|
19088
|
+
if (!sourceChain) throw new UnsupportedLiquidityChainError(params.sourceChainId);
|
|
19089
|
+
if (!destinationChain) throw new UnsupportedLiquidityChainError(params.destinationChainId);
|
|
19090
|
+
const sourceToken = this.source.configService.getAssetMetadataBySymbol(sourceChain, params.tokenInSymbol);
|
|
19091
|
+
const destinationToken = this.dest.configService.getAssetMetadataBySymbol(
|
|
19092
|
+
destinationChain,
|
|
19093
|
+
params.tokenOutSymbol
|
|
19094
|
+
);
|
|
19095
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceChain, params.tokenInSymbol);
|
|
19096
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationChain, params.tokenOutSymbol);
|
|
19097
|
+
return new LiquidityEngine(queryClient).getBuyAndSellRates({
|
|
19098
|
+
sourceChain,
|
|
19099
|
+
destinationChain,
|
|
19100
|
+
tokenInSymbol: sourceToken.symbol,
|
|
19101
|
+
tokenOutSymbol: destinationToken.symbol
|
|
18983
19102
|
});
|
|
18984
19103
|
}
|
|
18985
19104
|
/**
|
|
@@ -24081,6 +24200,6 @@ async function teleportDot(param_) {
|
|
|
24081
24200
|
return stream;
|
|
24082
24201
|
}
|
|
24083
24202
|
|
|
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 };
|
|
24203
|
+
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
24204
|
//# sourceMappingURL=index.js.map
|
|
24086
24205
|
//# sourceMappingURL=index.js.map
|