@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/node/index.js
CHANGED
|
@@ -5239,11 +5239,21 @@ var ChainConfigService = class {
|
|
|
5239
5239
|
* it, so a new asset is added once in `chain.ts` and nowhere else.
|
|
5240
5240
|
*/
|
|
5241
5241
|
getAssetBySymbol(chain, symbol) {
|
|
5242
|
-
|
|
5242
|
+
return this.getAssetMetadataBySymbol(chain, symbol)?.address;
|
|
5243
|
+
}
|
|
5244
|
+
/** Resolves a configured token symbol case-insensitively on a specific chain. */
|
|
5245
|
+
getAssetMetadataBySymbol(chain, symbol) {
|
|
5246
|
+
const config = this.getConfig(chain);
|
|
5247
|
+
const assets = config?.assets;
|
|
5243
5248
|
if (!assets) return void 0;
|
|
5244
5249
|
const target = symbol.trim().toUpperCase();
|
|
5245
5250
|
for (const [key, address] of Object.entries(assets)) {
|
|
5246
|
-
if (key.toUpperCase()
|
|
5251
|
+
if (key.toUpperCase() !== target) continue;
|
|
5252
|
+
return {
|
|
5253
|
+
symbol: key,
|
|
5254
|
+
address,
|
|
5255
|
+
decimals: config.tokenDecimals?.[key]
|
|
5256
|
+
};
|
|
5247
5257
|
}
|
|
5248
5258
|
return void 0;
|
|
5249
5259
|
}
|
|
@@ -7814,6 +7824,7 @@ var HYPERBRIDGE_TYPES_BUNDLE = {
|
|
|
7814
7824
|
};
|
|
7815
7825
|
var BASE_TIP = 1000000000n;
|
|
7816
7826
|
var HTTP_CONNECT_TIMEOUT_MS = 2e4;
|
|
7827
|
+
var INCLUSION_TIMEOUT_MS = 2e4;
|
|
7817
7828
|
var PHANTOM_POLL_INTERVAL_MS = 15e3;
|
|
7818
7829
|
var GARGANTUA_PHANTOM_POLL_INTERVAL_MS = 6e3;
|
|
7819
7830
|
function rejectAfter(ms, message) {
|
|
@@ -8032,14 +8043,16 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8032
8043
|
/**
|
|
8033
8044
|
* Signs and sends an extrinsic. Submissions are serialised through {@link submissionQueue} so
|
|
8034
8045
|
* concurrent calls never collide on the substrate account nonce — each extrinsic reaches a block
|
|
8035
|
-
* (or is confirmed still pooled and returned as `pending`) before the next is signed
|
|
8036
|
-
*
|
|
8046
|
+
* (or is confirmed still pooled and returned as `pending`) before the next is signed. The
|
|
8047
|
+
* auto-nonce is the account's on-chain nonce, so a still-pooled extrinsic does not advance it: a
|
|
8048
|
+
* submission signed behind a pending one bounces off it (1013/1014) and is reported as pending
|
|
8049
|
+
* too, rather than landing as a second copy.
|
|
8037
8050
|
*
|
|
8038
8051
|
* The extrinsic is built rather than passed in because the api it is built on decides where it
|
|
8039
8052
|
* is signed and sent: a websocket that is down when the queue reaches this submission diverts it
|
|
8040
8053
|
* to {@link sendViaHttp}, which needs the call bound to the HTTP api instead.
|
|
8041
8054
|
*/
|
|
8042
|
-
async signAndSendExtrinsic(build, maxRetries = 3, timeoutMs =
|
|
8055
|
+
async signAndSendExtrinsic(build, maxRetries = 3, timeoutMs = INCLUSION_TIMEOUT_MS) {
|
|
8043
8056
|
const result = await this.submissionQueue.add(async () => {
|
|
8044
8057
|
if (!this.api.isConnected) {
|
|
8045
8058
|
try {
|
|
@@ -8077,36 +8090,72 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8077
8090
|
* Signs and sends an extrinsic, handling status updates and errors.
|
|
8078
8091
|
* Implements retry logic with progressive tip increases for stuck transactions.
|
|
8079
8092
|
*
|
|
8080
|
-
*
|
|
8081
|
-
*
|
|
8082
|
-
*
|
|
8083
|
-
*
|
|
8084
|
-
*
|
|
8085
|
-
*
|
|
8093
|
+
* Two kinds of failure are retried, and the difference is the nonce.
|
|
8094
|
+
*
|
|
8095
|
+
* An attempt that verifiably went nowhere (rejected before the pool, dropped, invalid) leaves
|
|
8096
|
+
* the account nonce free, so the next attempt simply re-signs with the auto-nonce.
|
|
8097
|
+
*
|
|
8098
|
+
* An attempt that reached the pool and was still there when the watch timed out (`stalled`) is
|
|
8099
|
+
* retried as a *replacement*: the same nonce it was signed with, and double the tip. Substrate's
|
|
8100
|
+
* pool evicts a pooled extrinsic in favour of a higher-priority one at the same (account, nonce),
|
|
8101
|
+
* so exactly one of the two can ever execute. This matters for a bid, which is worth nothing once
|
|
8102
|
+
* its window closes — waiting out a stalled extrinsic usually means not bidding at all.
|
|
8103
|
+
*
|
|
8104
|
+
* Re-signing without pinning the nonce is what must never happen here. The auto-nonce is read
|
|
8105
|
+
* from on-chain state, so it is only the stalled extrinsic's nonce for as long as that extrinsic
|
|
8106
|
+
* stays out of a block — and a stall is precisely the case where it may land at any moment. Once
|
|
8107
|
+
* it does, an unpinned retry takes the *next* nonce and both execute: a duplicate `placeBid` that
|
|
8108
|
+
* fails on-chain, and a second `retractBid` that pulls the bid just placed. When the signed nonce
|
|
8109
|
+
* cannot be read, the stalled result is returned rather than guessed at.
|
|
8110
|
+
*
|
|
8111
|
+
* A rejection that bounced off a copy already pooled (1013/1014) is likewise left alone: that
|
|
8112
|
+
* copy is in flight and its outcome is unknown here, so the `pending` result goes back to the
|
|
8113
|
+
* caller to confirm later.
|
|
8086
8114
|
*/
|
|
8087
8115
|
async sendExtrinsicWithRetries(extrinsic, maxRetries, timeoutMs) {
|
|
8088
8116
|
const keyPair = this.getKeyPair();
|
|
8089
8117
|
let attempt = 0;
|
|
8118
|
+
let nonce;
|
|
8119
|
+
let stalled;
|
|
8090
8120
|
while (attempt < maxRetries) {
|
|
8091
8121
|
const currentTip = BASE_TIP * BigInt(2 ** attempt);
|
|
8092
8122
|
attempt++;
|
|
8093
8123
|
try {
|
|
8094
|
-
const result = await this.sendWithTimeout(extrinsic, keyPair, currentTip, timeoutMs);
|
|
8095
|
-
if (result.success || result.
|
|
8124
|
+
const result = await this.sendWithTimeout(extrinsic, keyPair, currentTip, timeoutMs, nonce);
|
|
8125
|
+
if (result.success || result.error?.includes("Dispatch error")) {
|
|
8096
8126
|
return result;
|
|
8097
8127
|
}
|
|
8128
|
+
if (result.stalled) {
|
|
8129
|
+
stalled = result;
|
|
8130
|
+
nonce ??= this.signedNonce(extrinsic);
|
|
8131
|
+
if (nonce === void 0) return result;
|
|
8132
|
+
continue;
|
|
8133
|
+
}
|
|
8134
|
+
if (result.pending) return stalled ?? result;
|
|
8098
8135
|
} catch (err) {
|
|
8099
|
-
return {
|
|
8136
|
+
return stalled ?? {
|
|
8100
8137
|
success: false,
|
|
8101
8138
|
error: err instanceof Error ? err.message : "Unknown error"
|
|
8102
8139
|
};
|
|
8103
8140
|
}
|
|
8104
8141
|
}
|
|
8105
|
-
return {
|
|
8142
|
+
return stalled ?? {
|
|
8106
8143
|
success: false,
|
|
8107
8144
|
error: `Transaction failed after ${maxRetries} attempts`
|
|
8108
8145
|
};
|
|
8109
8146
|
}
|
|
8147
|
+
/**
|
|
8148
|
+
* The nonce an extrinsic was signed with, or undefined if it carries no readable one — which is
|
|
8149
|
+
* the case before it has ever been signed, and for a stub api in tests.
|
|
8150
|
+
*/
|
|
8151
|
+
signedNonce(extrinsic) {
|
|
8152
|
+
try {
|
|
8153
|
+
const nonce = extrinsic.nonce?.toNumber?.();
|
|
8154
|
+
return typeof nonce === "number" && Number.isFinite(nonce) ? nonce : void 0;
|
|
8155
|
+
} catch {
|
|
8156
|
+
return void 0;
|
|
8157
|
+
}
|
|
8158
|
+
}
|
|
8110
8159
|
/**
|
|
8111
8160
|
* Classifies a submission rejection. Codes 1013 ("already imported") and 1014 ("priority is
|
|
8112
8161
|
* too low") both mean a copy of this account+nonce is already in the pool — almost always our
|
|
@@ -8124,10 +8173,15 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8124
8173
|
*
|
|
8125
8174
|
* A timeout is only a failure when the extrinsic never made it into the transaction pool.
|
|
8126
8175
|
* Once a pool-entry status (Future/Ready/Broadcast/Retracted) has been seen, the extrinsic is
|
|
8127
|
-
* in flight and may well execute after the watch is abandoned — the result is then `pending
|
|
8128
|
-
* telling the caller to
|
|
8176
|
+
* in flight and may well execute after the watch is abandoned — the result is then `pending`
|
|
8177
|
+
* and `stalled`, telling the caller to replace it under the same nonce or confirm it later,
|
|
8178
|
+
* never to re-sign the same call under a fresh one.
|
|
8179
|
+
*
|
|
8180
|
+
* `nonce` pins the submission to a specific account nonce, which is what makes a retry a pool
|
|
8181
|
+
* replacement rather than a second extrinsic queued behind the first. Left undefined on the
|
|
8182
|
+
* first attempt, where the api's auto-nonce is correct.
|
|
8129
8183
|
*/
|
|
8130
|
-
async sendWithTimeout(extrinsic, keyPair, tip, timeoutMs) {
|
|
8184
|
+
async sendWithTimeout(extrinsic, keyPair, tip, timeoutMs, nonce) {
|
|
8131
8185
|
return new Promise((resolve) => {
|
|
8132
8186
|
let resolved = false;
|
|
8133
8187
|
let unsubscribe = null;
|
|
@@ -8141,12 +8195,13 @@ var IntentsCoprocessor = class _IntentsCoprocessor {
|
|
|
8141
8195
|
resolve({
|
|
8142
8196
|
success: false,
|
|
8143
8197
|
pending: enteredPool || void 0,
|
|
8198
|
+
stalled: enteredPool || void 0,
|
|
8144
8199
|
extrinsicHash: enteredPool ? extrinsic.hash.toHex() : void 0,
|
|
8145
8200
|
error: `Transaction timed out after ${timeoutMs}ms${enteredPool ? " while in the transaction pool" : ""}`
|
|
8146
8201
|
});
|
|
8147
8202
|
}
|
|
8148
8203
|
}, timeoutMs);
|
|
8149
|
-
extrinsic.signAndSend(keyPair, { tip }, (result) => {
|
|
8204
|
+
extrinsic.signAndSend(keyPair, nonce === void 0 ? { tip } : { tip, nonce }, (result) => {
|
|
8150
8205
|
if (resolved) return;
|
|
8151
8206
|
if (result.status.isFuture || result.status.isReady || result.status.isBroadcast || result.status.isRetracted) {
|
|
8152
8207
|
enteredPool = true;
|
|
@@ -11983,52 +12038,85 @@ query LatestPhantomOrderPriceSnapshot($tokenA: String!, $tokenB: String!) {
|
|
|
11983
12038
|
}
|
|
11984
12039
|
}
|
|
11985
12040
|
}`;
|
|
11986
|
-
var
|
|
11987
|
-
query
|
|
11988
|
-
|
|
12041
|
+
var AVAILABLE_LIQUIDITY = `
|
|
12042
|
+
query AvailableLiquidity(
|
|
12043
|
+
$poolId: String!
|
|
12044
|
+
$sourceChain: String!
|
|
12045
|
+
$destinationChain: String!
|
|
12046
|
+
$direction: String!
|
|
12047
|
+
) {
|
|
12048
|
+
poolChainLiquidities(
|
|
11989
12049
|
filter: {
|
|
11990
12050
|
and: [
|
|
11991
|
-
{
|
|
11992
|
-
{
|
|
12051
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12052
|
+
{ chain: { equalTo: $destinationChain } }
|
|
12053
|
+
{ direction: { equalTo: $direction } }
|
|
11993
12054
|
]
|
|
11994
12055
|
}
|
|
11995
|
-
orderBy: SNAPSHOT_TIME_DESC
|
|
11996
12056
|
first: 1
|
|
11997
12057
|
) {
|
|
11998
12058
|
nodes {
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12059
|
+
depth
|
|
12060
|
+
bidCount
|
|
12061
|
+
unrestrictedDepth
|
|
12062
|
+
unrestrictedBidCount
|
|
12063
|
+
lastUpdatedAt
|
|
12064
|
+
}
|
|
12065
|
+
}
|
|
12066
|
+
poolRoutes(
|
|
12067
|
+
filter: {
|
|
12068
|
+
and: [
|
|
12069
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12070
|
+
{ sourceChain: { equalTo: $sourceChain } }
|
|
12071
|
+
{ chain: { equalTo: $destinationChain } }
|
|
12072
|
+
{ direction: { equalTo: $direction } }
|
|
12073
|
+
]
|
|
12074
|
+
}
|
|
12075
|
+
first: 1
|
|
12076
|
+
) {
|
|
12077
|
+
nodes {
|
|
12078
|
+
depth
|
|
12079
|
+
bidCount
|
|
12080
|
+
lastUpdatedAt
|
|
12003
12081
|
}
|
|
12004
12082
|
}
|
|
12005
12083
|
}`;
|
|
12006
|
-
var
|
|
12007
|
-
query
|
|
12008
|
-
|
|
12084
|
+
var BUY_AND_SELL_RATES = `
|
|
12085
|
+
query BuyAndSellRates(
|
|
12086
|
+
$poolId: String!
|
|
12087
|
+
$directChain: String!
|
|
12088
|
+
$directDirection: String!
|
|
12089
|
+
$reverseChain: String!
|
|
12090
|
+
$reverseDirection: String!
|
|
12091
|
+
) {
|
|
12092
|
+
direct: poolChainLiquidities(
|
|
12009
12093
|
filter: {
|
|
12010
12094
|
and: [
|
|
12011
|
-
{
|
|
12012
|
-
{
|
|
12095
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12096
|
+
{ chain: { equalTo: $directChain } }
|
|
12097
|
+
{ direction: { equalTo: $directDirection } }
|
|
12013
12098
|
]
|
|
12014
12099
|
}
|
|
12100
|
+
first: 1
|
|
12015
12101
|
) {
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
}
|
|
12020
|
-
distinctCount {
|
|
12021
|
-
providerId
|
|
12022
|
-
}
|
|
12102
|
+
nodes {
|
|
12103
|
+
rate
|
|
12104
|
+
lastUpdatedAt
|
|
12023
12105
|
}
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12106
|
+
}
|
|
12107
|
+
reverse: poolChainLiquidities(
|
|
12108
|
+
filter: {
|
|
12109
|
+
and: [
|
|
12110
|
+
{ poolId: { equalToInsensitive: $poolId } }
|
|
12111
|
+
{ chain: { equalTo: $reverseChain } }
|
|
12112
|
+
{ direction: { equalTo: $reverseDirection } }
|
|
12113
|
+
]
|
|
12114
|
+
}
|
|
12115
|
+
first: 1
|
|
12116
|
+
) {
|
|
12117
|
+
nodes {
|
|
12118
|
+
rate
|
|
12119
|
+
lastUpdatedAt
|
|
12032
12120
|
}
|
|
12033
12121
|
}
|
|
12034
12122
|
}`;
|
|
@@ -16298,12 +16386,9 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16298
16386
|
static DEFAULT_MAX_RECOVERY_RESTARTS = 1;
|
|
16299
16387
|
static PROOF_FRESHNESS_MAX_RETRIES = 3;
|
|
16300
16388
|
static PROOF_FRESHNESS_BACKOFF_MS = 500;
|
|
16301
|
-
/**
|
|
16302
|
-
|
|
16303
|
-
|
|
16304
|
-
* chain), priced at the source chain's gas price.
|
|
16305
|
-
*/
|
|
16306
|
-
static CANCEL_MESSAGE_GAS = 800000n;
|
|
16389
|
+
/** Gas budgets used to price cancellation delivery on the source chain. */
|
|
16390
|
+
static SOURCE_GET_RESPONSE_GAS = 1000000n;
|
|
16391
|
+
static REFUND_POST_GAS = 1000000n;
|
|
16307
16392
|
logger = createConsola({
|
|
16308
16393
|
level: LogLevels.info,
|
|
16309
16394
|
formatOptions: { columns: 80, colors: true, compact: true, date: false }
|
|
@@ -16341,9 +16426,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16341
16426
|
return { nativeValue: 0n, relayerFee: 0n };
|
|
16342
16427
|
}
|
|
16343
16428
|
const height = order.deadline + 1n;
|
|
16344
|
-
const destIntentGateway = this.ctx.dest.configService.getIntentGatewayAddress(
|
|
16345
|
-
destStateMachine
|
|
16346
|
-
);
|
|
16429
|
+
const destIntentGateway = this.ctx.dest.configService.getIntentGatewayAddress(destStateMachine);
|
|
16347
16430
|
const slotHash = await this.ctx.dest.client.readContract({
|
|
16348
16431
|
abi: ABI3,
|
|
16349
16432
|
address: destIntentGateway,
|
|
@@ -16364,7 +16447,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16364
16447
|
};
|
|
16365
16448
|
const feeInSourceFeeToken = await convertGasToFeeToken(
|
|
16366
16449
|
this.ctx,
|
|
16367
|
-
_OrderCanceller.
|
|
16450
|
+
_OrderCanceller.SOURCE_GET_RESPONSE_GAS,
|
|
16368
16451
|
"source",
|
|
16369
16452
|
sourceStateMachine
|
|
16370
16453
|
);
|
|
@@ -16910,9 +16993,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16910
16993
|
return null;
|
|
16911
16994
|
}
|
|
16912
16995
|
async removeRecoveryItems(...keys) {
|
|
16913
|
-
await Promise.all(
|
|
16914
|
-
[...new Set(keys)].map((key) => this.ctx.cancellationStorage.removeItem(key))
|
|
16915
|
-
);
|
|
16996
|
+
await Promise.all([...new Set(keys)].map((key) => this.ctx.cancellationStorage.removeItem(key)));
|
|
16916
16997
|
}
|
|
16917
16998
|
/**
|
|
16918
16999
|
* Returns the order identifier required to persist or clear recovery state.
|
|
@@ -16960,7 +17041,7 @@ var OrderCanceller = class _OrderCanceller {
|
|
|
16960
17041
|
async estimateRelayerFee(sourceChainId, destChainId) {
|
|
16961
17042
|
const feeInSourceFeeToken = await convertGasToFeeToken(
|
|
16962
17043
|
this.ctx,
|
|
16963
|
-
_OrderCanceller.
|
|
17044
|
+
_OrderCanceller.REFUND_POST_GAS,
|
|
16964
17045
|
"source",
|
|
16965
17046
|
sourceChainId
|
|
16966
17047
|
);
|
|
@@ -17242,8 +17323,7 @@ var BidManager = class {
|
|
|
17242
17323
|
);
|
|
17243
17324
|
}
|
|
17244
17325
|
const solverSignature = await solverSigner.signTypedData(
|
|
17245
|
-
CryptoUtils.packedUserOpTypedData(userOp, entryPointAddress, chainId)
|
|
17246
|
-
Number(chainId)
|
|
17326
|
+
CryptoUtils.packedUserOpTypedData(userOp, entryPointAddress, chainId)
|
|
17247
17327
|
);
|
|
17248
17328
|
const signature = concat([order.id, solverSignature]);
|
|
17249
17329
|
return { ...userOp, signature };
|
|
@@ -18172,178 +18252,191 @@ var OrderStatusChecker = class {
|
|
|
18172
18252
|
return true;
|
|
18173
18253
|
}
|
|
18174
18254
|
};
|
|
18175
|
-
|
|
18255
|
+
|
|
18256
|
+
// src/protocols/intents/liquidity-pool.ts
|
|
18257
|
+
function sortPoolSymbols(symbolA, symbolB) {
|
|
18258
|
+
return symbolA.toLowerCase() <= symbolB.toLowerCase() ? [symbolA, symbolB] : [symbolB, symbolA];
|
|
18259
|
+
}
|
|
18260
|
+
function poolSlug(symbolA, symbolB) {
|
|
18261
|
+
return sortPoolSymbols(symbolA, symbolB).join("-");
|
|
18262
|
+
}
|
|
18263
|
+
function resolveLiquidityPool(symbolA, symbolB) {
|
|
18264
|
+
const [token0Symbol, token1Symbol] = sortPoolSymbols(symbolA, symbolB);
|
|
18265
|
+
return {
|
|
18266
|
+
poolId: `${token0Symbol}-${token1Symbol}`,
|
|
18267
|
+
token0Symbol,
|
|
18268
|
+
token1Symbol
|
|
18269
|
+
};
|
|
18270
|
+
}
|
|
18271
|
+
|
|
18272
|
+
// src/protocols/intents/LiquidityEngine.ts
|
|
18273
|
+
var INDEXER_FIXED_POINT_DECIMALS = 18;
|
|
18274
|
+
var POOL_RATE_SCALE = 10n ** 18n;
|
|
18275
|
+
var SELL = "SELL";
|
|
18276
|
+
var BUY = "BUY";
|
|
18277
|
+
var USD_STABLE_SYMBOLS = /* @__PURE__ */ new Set(["USDC", "USDT"]);
|
|
18176
18278
|
var LiquidityEngine = class {
|
|
18177
|
-
|
|
18178
|
-
* @param queryClient - Nexus GraphQL client attached to the gateway.
|
|
18179
|
-
* @param chainConfigService - Resolves token decimals for formatted results.
|
|
18180
|
-
*/
|
|
18181
|
-
constructor(queryClient, chainConfigService) {
|
|
18279
|
+
constructor(queryClient) {
|
|
18182
18280
|
this.queryClient = queryClient;
|
|
18183
|
-
this.chainConfigService = chainConfigService;
|
|
18184
18281
|
}
|
|
18185
18282
|
queryClient;
|
|
18186
|
-
chainConfigService;
|
|
18187
18283
|
/**
|
|
18188
|
-
*
|
|
18189
|
-
* indexed output-token liquidity.
|
|
18284
|
+
* Returns liquidity reachable from one source chain on one destination.
|
|
18190
18285
|
*
|
|
18191
|
-
*
|
|
18192
|
-
*
|
|
18193
|
-
*
|
|
18194
|
-
* that chain's token decimals. They describe `snapshotTime`, not live
|
|
18195
|
-
* reservations or fill guarantees.
|
|
18286
|
+
* The caller resolves chain-specific token addresses through chain
|
|
18287
|
+
* configuration; this layer only maps those configured symbols onto the
|
|
18288
|
+
* indexer's canonical pool and route fields.
|
|
18196
18289
|
*
|
|
18197
|
-
*
|
|
18198
|
-
*
|
|
18199
|
-
*
|
|
18200
|
-
* @
|
|
18201
|
-
*
|
|
18202
|
-
*/
|
|
18203
|
-
async
|
|
18204
|
-
const
|
|
18205
|
-
const
|
|
18206
|
-
const
|
|
18207
|
-
|
|
18208
|
-
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
|
|
18212
|
-
const
|
|
18213
|
-
if (!
|
|
18214
|
-
throw new
|
|
18215
|
-
}
|
|
18216
|
-
if (node.tokenA.toLowerCase() !== tokenIn || node.tokenB.toLowerCase() !== tokenOut) {
|
|
18217
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, "snapshot token pair does not match the query");
|
|
18218
|
-
}
|
|
18219
|
-
const snapshotTime = new Date(dateStringtoTimestamp(node.snapshotTime));
|
|
18220
|
-
if (Number.isNaN(snapshotTime.getTime())) {
|
|
18221
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, "snapshotTime is invalid");
|
|
18290
|
+
* Destination, unrestricted, and explicit-route capacity are returned as
|
|
18291
|
+
* separate values so callers can apply their own source-chain policy.
|
|
18292
|
+
*
|
|
18293
|
+
* @returns `undefined` only when the indexer has not published a destination
|
|
18294
|
+
* pool sample yet.
|
|
18295
|
+
*/
|
|
18296
|
+
async getAvailableLiquidity(params) {
|
|
18297
|
+
const pool = resolveLiquidityPool(params.source.symbol, params.destination.symbol);
|
|
18298
|
+
const direction = params.source.symbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18299
|
+
const variables = {
|
|
18300
|
+
poolId: pool.poolId,
|
|
18301
|
+
sourceChain: params.source.chain,
|
|
18302
|
+
destinationChain: params.destination.chain,
|
|
18303
|
+
direction
|
|
18304
|
+
};
|
|
18305
|
+
const response = await this.queryClient.request(AVAILABLE_LIQUIDITY, variables);
|
|
18306
|
+
if (!response?.poolChainLiquidities?.nodes || !response?.poolRoutes?.nodes) {
|
|
18307
|
+
throw new InvalidLiquidityIndexerResponseError("liquidity connections are missing");
|
|
18222
18308
|
}
|
|
18223
|
-
const
|
|
18224
|
-
|
|
18225
|
-
|
|
18226
|
-
});
|
|
18309
|
+
const chainLiquidity = response.poolChainLiquidities.nodes[0];
|
|
18310
|
+
if (!chainLiquidity) return void 0;
|
|
18311
|
+
const route = response.poolRoutes.nodes[0];
|
|
18227
18312
|
return {
|
|
18228
|
-
|
|
18229
|
-
|
|
18230
|
-
tokenAddress:
|
|
18231
|
-
|
|
18232
|
-
|
|
18233
|
-
|
|
18234
|
-
|
|
18235
|
-
|
|
18313
|
+
sourceChain: params.source.chain,
|
|
18314
|
+
destinationChain: params.destination.chain,
|
|
18315
|
+
tokenAddress: normalizeEvmAddress(params.destination.address, "destination token"),
|
|
18316
|
+
updatedAt: readIndexerDate(chainLiquidity.lastUpdatedAt, "destination lastUpdatedAt"),
|
|
18317
|
+
destination: readLiquiditySlice(chainLiquidity.depth, chainLiquidity.bidCount, "destination"),
|
|
18318
|
+
unrestricted: readLiquiditySlice(
|
|
18319
|
+
chainLiquidity.unrestrictedDepth,
|
|
18320
|
+
chainLiquidity.unrestrictedBidCount,
|
|
18321
|
+
"unrestricted"
|
|
18322
|
+
),
|
|
18323
|
+
explicitRoute: route ? {
|
|
18324
|
+
...readLiquiditySlice(route.depth, route.bidCount, "explicit route"),
|
|
18325
|
+
updatedAt: readIndexerDate(route.lastUpdatedAt, "route lastUpdatedAt")
|
|
18326
|
+
} : null
|
|
18236
18327
|
};
|
|
18237
18328
|
}
|
|
18238
18329
|
/**
|
|
18239
|
-
*
|
|
18240
|
-
*
|
|
18330
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
18331
|
+
* per one base token.
|
|
18241
18332
|
*
|
|
18242
|
-
*
|
|
18243
|
-
|
|
18244
|
-
|
|
18245
|
-
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
);
|
|
18249
|
-
const
|
|
18250
|
-
const
|
|
18251
|
-
|
|
18252
|
-
|
|
18253
|
-
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
}
|
|
18257
|
-
const totalLiquidity = parseSnapshotBigInt(aggregates.sum.balance ?? "0", params.commitment, "total balance");
|
|
18258
|
-
const providerCount = parseProviderCount(aggregates.distinctCount.providerId, params.commitment, "total");
|
|
18259
|
-
const liquidityByChain = connection.groupedAggregates.map((group, index) => {
|
|
18260
|
-
const [chain, tokenAddress] = group.keys;
|
|
18261
|
-
if (!chain?.trim() || !tokenAddress) {
|
|
18262
|
-
throw new InvalidAvailableLiquiditySnapshotError(
|
|
18263
|
-
params.commitment,
|
|
18264
|
-
`liquidity group ${index} has invalid keys`
|
|
18265
|
-
);
|
|
18266
|
-
}
|
|
18267
|
-
const normalizedTokenAddress = normalizeIndexedLiquidityAddress(
|
|
18268
|
-
tokenAddress,
|
|
18269
|
-
params.commitment,
|
|
18270
|
-
`liquidity group ${index} tokenAddress`
|
|
18271
|
-
);
|
|
18272
|
-
if (normalizedTokenAddress !== params.tokenAddress) {
|
|
18273
|
-
throw new InvalidAvailableLiquiditySnapshotError(
|
|
18274
|
-
params.commitment,
|
|
18275
|
-
`liquidity group ${index} tokenAddress does not match the snapshot output token`
|
|
18276
|
-
);
|
|
18277
|
-
}
|
|
18278
|
-
return {
|
|
18279
|
-
chain: chain.trim(),
|
|
18280
|
-
tokenAddress: normalizedTokenAddress,
|
|
18281
|
-
totalLiquidity: parseSnapshotBigInt(
|
|
18282
|
-
group.sum.balance ?? "0",
|
|
18283
|
-
params.commitment,
|
|
18284
|
-
`liquidity group ${index} balance`
|
|
18285
|
-
),
|
|
18286
|
-
providerCount: parseProviderCount(
|
|
18287
|
-
group.distinctCount.providerId,
|
|
18288
|
-
params.commitment,
|
|
18289
|
-
`liquidity group ${index}`
|
|
18290
|
-
)
|
|
18291
|
-
};
|
|
18333
|
+
* The requested direction is read on the destination chain; its reverse is
|
|
18334
|
+
* read on the source chain. This mirrors where each direction's output token
|
|
18335
|
+
* must be delivered for a cross-chain trade.
|
|
18336
|
+
*/
|
|
18337
|
+
async getBuyAndSellRates(params) {
|
|
18338
|
+
const pool = resolveLiquidityPool(params.tokenInSymbol, params.tokenOutSymbol);
|
|
18339
|
+
const directDirection = params.tokenInSymbol.toLowerCase() === pool.token0Symbol.toLowerCase() ? SELL : BUY;
|
|
18340
|
+
const reverseDirection = directDirection === SELL ? BUY : SELL;
|
|
18341
|
+
const response = await this.queryClient.request(BUY_AND_SELL_RATES, {
|
|
18342
|
+
poolId: pool.poolId,
|
|
18343
|
+
directChain: params.destinationChain,
|
|
18344
|
+
directDirection,
|
|
18345
|
+
reverseChain: params.sourceChain,
|
|
18346
|
+
reverseDirection
|
|
18292
18347
|
});
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
|
|
18297
|
-
|
|
18298
|
-
|
|
18299
|
-
|
|
18300
|
-
|
|
18348
|
+
if (!response?.direct?.nodes || !response?.reverse?.nodes) {
|
|
18349
|
+
throw new InvalidLiquidityIndexerResponseError("rate connections are missing");
|
|
18350
|
+
}
|
|
18351
|
+
const direct = readIndexedRate(response.direct.nodes[0], "direct rate");
|
|
18352
|
+
const reverse = readIndexedRate(response.reverse.nodes[0], "reverse rate");
|
|
18353
|
+
if (!direct && !reverse) return void 0;
|
|
18354
|
+
const quoteTokenSymbol = resolveQuoteTokenSymbol(
|
|
18355
|
+
params.tokenInSymbol,
|
|
18356
|
+
params.tokenOutSymbol,
|
|
18357
|
+
direct?.scaledRate,
|
|
18358
|
+
reverse?.scaledRate
|
|
18359
|
+
);
|
|
18360
|
+
const quoteIsTokenOut = quoteTokenSymbol === params.tokenOutSymbol;
|
|
18361
|
+
const buy = quoteIsTokenOut ? direct : reverse;
|
|
18362
|
+
const sell = quoteIsTokenOut ? reverse : direct;
|
|
18363
|
+
return {
|
|
18364
|
+
baseTokenSymbol: quoteIsTokenOut ? params.tokenInSymbol : params.tokenOutSymbol,
|
|
18365
|
+
quoteTokenSymbol,
|
|
18366
|
+
sourceChain: params.sourceChain,
|
|
18367
|
+
destinationChain: params.destinationChain,
|
|
18368
|
+
buyRate: buy ? formatUnits(buy.scaledRate, INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18369
|
+
sellRate: sell ? formatUnits(reciprocalRate(sell.scaledRate, "sell rate"), INDEXER_FIXED_POINT_DECIMALS) : null,
|
|
18370
|
+
buyRateUpdatedAt: buy?.updatedAt ?? null,
|
|
18371
|
+
sellRateUpdatedAt: sell?.updatedAt ?? null
|
|
18372
|
+
};
|
|
18301
18373
|
}
|
|
18302
|
-
|
|
18303
|
-
|
|
18304
|
-
|
|
18305
|
-
|
|
18306
|
-
|
|
18307
|
-
commitment,
|
|
18308
|
-
`token decimals are not configured for ${tokenAddress} on ${chain}`
|
|
18309
|
-
);
|
|
18310
|
-
}
|
|
18311
|
-
return formatUnits(amount, decimals);
|
|
18374
|
+
};
|
|
18375
|
+
var InvalidLiquidityIndexerResponseError = class extends Error {
|
|
18376
|
+
constructor(reason) {
|
|
18377
|
+
super(`Invalid liquidity indexer response: ${reason}`);
|
|
18378
|
+
this.name = "InvalidLiquidityIndexerResponseError";
|
|
18312
18379
|
}
|
|
18313
18380
|
};
|
|
18314
|
-
var
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18381
|
+
var UnsupportedLiquidityAssetError = class extends Error {
|
|
18382
|
+
constructor(chain, asset) {
|
|
18383
|
+
super(`No configured liquidity asset found for ${asset} on ${chain}`);
|
|
18384
|
+
this.name = "UnsupportedLiquidityAssetError";
|
|
18385
|
+
}
|
|
18386
|
+
};
|
|
18387
|
+
var UnsupportedLiquidityChainError = class extends Error {
|
|
18388
|
+
constructor(chainId) {
|
|
18389
|
+
super(`No configured liquidity chain found for chain ID ${chainId}`);
|
|
18390
|
+
this.name = "UnsupportedLiquidityChainError";
|
|
18319
18391
|
}
|
|
18320
18392
|
};
|
|
18321
|
-
function
|
|
18393
|
+
function readLiquiditySlice(depth, providerCount, label) {
|
|
18394
|
+
if (!Number.isSafeInteger(providerCount) || providerCount < 0) {
|
|
18395
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} provider count is invalid`);
|
|
18396
|
+
}
|
|
18397
|
+
return { totalLiquidity: formatIndexerAmount(depth, `${label} depth`), providerCount };
|
|
18398
|
+
}
|
|
18399
|
+
function formatIndexerAmount(value, label) {
|
|
18322
18400
|
try {
|
|
18323
18401
|
const amount = BigInt(value);
|
|
18324
|
-
if (amount < 0n)
|
|
18325
|
-
|
|
18326
|
-
|
|
18327
|
-
|
|
18328
|
-
} catch (error) {
|
|
18329
|
-
if (error instanceof InvalidAvailableLiquiditySnapshotError) throw error;
|
|
18330
|
-
throw new InvalidAvailableLiquiditySnapshotError(commitment, `${field} is not an integer`);
|
|
18402
|
+
if (amount < 0n) throw new Error();
|
|
18403
|
+
return formatUnits(amount, INDEXER_FIXED_POINT_DECIMALS);
|
|
18404
|
+
} catch {
|
|
18405
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a non-negative integer`);
|
|
18331
18406
|
}
|
|
18332
18407
|
}
|
|
18333
|
-
function
|
|
18334
|
-
const
|
|
18335
|
-
if (
|
|
18336
|
-
|
|
18337
|
-
}
|
|
18338
|
-
return count;
|
|
18408
|
+
function readIndexerDate(value, label) {
|
|
18409
|
+
const date = new Date(dateStringtoTimestamp(value));
|
|
18410
|
+
if (Number.isNaN(date.getTime())) throw new InvalidLiquidityIndexerResponseError(`${label} is invalid`);
|
|
18411
|
+
return date;
|
|
18339
18412
|
}
|
|
18340
|
-
function
|
|
18413
|
+
function readIndexedRate(node, label) {
|
|
18414
|
+
if (!node) return void 0;
|
|
18341
18415
|
try {
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18416
|
+
const scaledRate = BigInt(node.rate);
|
|
18417
|
+
if (scaledRate <= 0n) throw new Error();
|
|
18418
|
+
return {
|
|
18419
|
+
scaledRate,
|
|
18420
|
+
updatedAt: readIndexerDate(node.lastUpdatedAt, `${label} lastUpdatedAt`)
|
|
18421
|
+
};
|
|
18422
|
+
} catch (error) {
|
|
18423
|
+
if (error instanceof InvalidLiquidityIndexerResponseError) throw error;
|
|
18424
|
+
throw new InvalidLiquidityIndexerResponseError(`${label} is not a positive integer`);
|
|
18345
18425
|
}
|
|
18346
18426
|
}
|
|
18427
|
+
function resolveQuoteTokenSymbol(tokenInSymbol, tokenOutSymbol, directRate, reverseRate) {
|
|
18428
|
+
const inputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenInSymbol);
|
|
18429
|
+
const outputIsUsdStable = USD_STABLE_SYMBOLS.has(tokenOutSymbol);
|
|
18430
|
+
if (inputIsUsdStable !== outputIsUsdStable) return inputIsUsdStable ? tokenOutSymbol : tokenInSymbol;
|
|
18431
|
+
if (directRate !== void 0) return directRate >= POOL_RATE_SCALE ? tokenOutSymbol : tokenInSymbol;
|
|
18432
|
+
if (reverseRate !== void 0) return reverseRate >= POOL_RATE_SCALE ? tokenInSymbol : tokenOutSymbol;
|
|
18433
|
+
throw new InvalidLiquidityIndexerResponseError("cannot orient an empty rate pair");
|
|
18434
|
+
}
|
|
18435
|
+
function reciprocalRate(rate, label) {
|
|
18436
|
+
const reciprocal = POOL_RATE_SCALE * POOL_RATE_SCALE / rate;
|
|
18437
|
+
if (reciprocal <= 0n) throw new InvalidLiquidityIndexerResponseError(`${label} reciprocal underflowed`);
|
|
18438
|
+
return reciprocal;
|
|
18439
|
+
}
|
|
18347
18440
|
|
|
18348
18441
|
// src/protocols/intents/quote/types.ts
|
|
18349
18442
|
var UnsupportedIntentQuoteStrategyError = class extends Error {
|
|
@@ -18768,8 +18861,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18768
18861
|
gasEstimator;
|
|
18769
18862
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
18770
18863
|
quoteStrategies;
|
|
18771
|
-
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
18772
|
-
phantomSnapshotPairResolver;
|
|
18773
18864
|
/**
|
|
18774
18865
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
18775
18866
|
*
|
|
@@ -18813,7 +18904,6 @@ var IntentGateway = class _IntentGateway {
|
|
|
18813
18904
|
this.bidManager = bidManager;
|
|
18814
18905
|
this.gasEstimator = gasEstimator;
|
|
18815
18906
|
this._crypto = crypto;
|
|
18816
|
-
this.phantomSnapshotPairResolver = new PhantomSnapshotPairResolver(dest.configService);
|
|
18817
18907
|
this.quoteStrategies = {
|
|
18818
18908
|
phantom_snapshot: new PhantomSnapshotIntentQuoteStrategy(
|
|
18819
18909
|
dest.configService,
|
|
@@ -18893,33 +18983,62 @@ var IntentGateway = class _IntentGateway {
|
|
|
18893
18983
|
return handler.quote({ ...params, strategy }, source, destination);
|
|
18894
18984
|
}
|
|
18895
18985
|
/**
|
|
18896
|
-
* Returns
|
|
18897
|
-
* Phantom snapshot for this gateway's source and destination.
|
|
18986
|
+
* Returns indexed destination liquidity and its source-routing slices.
|
|
18898
18987
|
*
|
|
18899
|
-
*
|
|
18900
|
-
*
|
|
18901
|
-
*
|
|
18902
|
-
*
|
|
18988
|
+
* Destination, unrestricted, and explicit-route capacity come exclusively
|
|
18989
|
+
* from the indexer's pair-centric liquidity entities. The SDK does not decide
|
|
18990
|
+
* whether unrestricted bidders cover the source chain. Amounts reflect the
|
|
18991
|
+
* latest rolling sample; they are not reservations or fill guarantees.
|
|
18903
18992
|
*
|
|
18904
18993
|
* Requires a prior call to {@link withQueryClient}.
|
|
18905
18994
|
*/
|
|
18906
18995
|
async queryAvailableLiquidity(params) {
|
|
18907
18996
|
const { queryClient } = this.requireIndexer();
|
|
18908
|
-
const sourceStateMachineId = this.source.config.stateMachineId;
|
|
18909
|
-
const destinationStateMachineId = this.dest.config.stateMachineId;
|
|
18910
|
-
|
|
18911
|
-
if (!
|
|
18912
|
-
|
|
18913
|
-
|
|
18914
|
-
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18922
|
-
|
|
18997
|
+
const sourceStateMachineId = getConfigByStateMachineId(this.source.config.stateMachineId)?.stateMachineId;
|
|
18998
|
+
const destinationStateMachineId = getConfigByStateMachineId(this.dest.config.stateMachineId)?.stateMachineId;
|
|
18999
|
+
if (!sourceStateMachineId) throw new UnsupportedLiquidityChainError(this.source.config.stateMachineId);
|
|
19000
|
+
if (!destinationStateMachineId) throw new UnsupportedLiquidityChainError(this.dest.config.stateMachineId);
|
|
19001
|
+
const sourceToken = this.source.configService.getAssetMetadataByAddress(sourceStateMachineId, params.tokenIn);
|
|
19002
|
+
const destinationToken = this.dest.configService.getAssetMetadataByAddress(
|
|
19003
|
+
destinationStateMachineId,
|
|
19004
|
+
params.tokenOut
|
|
19005
|
+
);
|
|
19006
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceStateMachineId, params.tokenIn);
|
|
19007
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationStateMachineId, params.tokenOut);
|
|
19008
|
+
return new LiquidityEngine(queryClient).getAvailableLiquidity({
|
|
19009
|
+
source: {
|
|
19010
|
+
chain: sourceStateMachineId,
|
|
19011
|
+
...sourceToken
|
|
19012
|
+
},
|
|
19013
|
+
destination: {
|
|
19014
|
+
chain: destinationStateMachineId,
|
|
19015
|
+
...destinationToken
|
|
19016
|
+
}
|
|
19017
|
+
});
|
|
19018
|
+
}
|
|
19019
|
+
/**
|
|
19020
|
+
* Returns chain-specific buy and sell rates in less-valued quote-token units
|
|
19021
|
+
* without requiring token addresses. Symbols are matched case-insensitively;
|
|
19022
|
+
* chain IDs are numeric IDs for chains configured in the SDK.
|
|
19023
|
+
*/
|
|
19024
|
+
async queryBuyAndSellRates(params) {
|
|
19025
|
+
const { queryClient } = this.requireIndexer();
|
|
19026
|
+
const sourceChain = chainConfigs[params.sourceChainId]?.stateMachineId;
|
|
19027
|
+
const destinationChain = chainConfigs[params.destinationChainId]?.stateMachineId;
|
|
19028
|
+
if (!sourceChain) throw new UnsupportedLiquidityChainError(params.sourceChainId);
|
|
19029
|
+
if (!destinationChain) throw new UnsupportedLiquidityChainError(params.destinationChainId);
|
|
19030
|
+
const sourceToken = this.source.configService.getAssetMetadataBySymbol(sourceChain, params.tokenInSymbol);
|
|
19031
|
+
const destinationToken = this.dest.configService.getAssetMetadataBySymbol(
|
|
19032
|
+
destinationChain,
|
|
19033
|
+
params.tokenOutSymbol
|
|
19034
|
+
);
|
|
19035
|
+
if (!sourceToken) throw new UnsupportedLiquidityAssetError(sourceChain, params.tokenInSymbol);
|
|
19036
|
+
if (!destinationToken) throw new UnsupportedLiquidityAssetError(destinationChain, params.tokenOutSymbol);
|
|
19037
|
+
return new LiquidityEngine(queryClient).getBuyAndSellRates({
|
|
19038
|
+
sourceChain,
|
|
19039
|
+
destinationChain,
|
|
19040
|
+
tokenInSymbol: sourceToken.symbol,
|
|
19041
|
+
tokenOutSymbol: destinationToken.symbol
|
|
18923
19042
|
});
|
|
18924
19043
|
}
|
|
18925
19044
|
/**
|
|
@@ -24021,6 +24140,6 @@ async function teleportDot(param_) {
|
|
|
24021
24140
|
return stream;
|
|
24022
24141
|
}
|
|
24023
24142
|
|
|
24024
|
-
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 };
|
|
24143
|
+
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 };
|
|
24025
24144
|
//# sourceMappingURL=index.js.map
|
|
24026
24145
|
//# sourceMappingURL=index.js.map
|