@rhea-finance/cross-chain-aggregation-dex 2.0.3 → 2.0.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/README.md +24 -2
- package/dist/executors/aptos.d.mts +1 -1
- package/dist/executors/aptos.d.ts +1 -1
- package/dist/executors/bitcoin.d.mts +1 -1
- package/dist/executors/bitcoin.d.ts +1 -1
- package/dist/executors/evm.d.mts +1 -1
- package/dist/executors/evm.d.ts +1 -1
- package/dist/executors/near.d.mts +1 -1
- package/dist/executors/near.d.ts +1 -1
- package/dist/executors/solana.d.mts +1 -1
- package/dist/executors/solana.d.ts +1 -1
- package/dist/executors/sui.d.mts +1 -1
- package/dist/executors/sui.d.ts +1 -1
- package/dist/executors/tron.d.mts +1 -1
- package/dist/executors/tron.d.ts +1 -1
- package/dist/executors/zcash.d.mts +1 -1
- package/dist/executors/zcash.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{shared-BEZXY_BM.d.mts → shared-D0_DbMT2.d.mts} +7 -2
- package/dist/{shared-BEZXY_BM.d.ts → shared-D0_DbMT2.d.ts} +7 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -975,7 +975,7 @@ function normalizeQuote(request, raw, receivedAt = Date.now()) {
|
|
|
975
975
|
estimatedOut: bestRoute.amountOut,
|
|
976
976
|
minAmountOut: bestRoute.minAmountOut,
|
|
977
977
|
route: bestRoute,
|
|
978
|
-
alternatives: raw.allQuotes.flatMap((route) => {
|
|
978
|
+
alternatives: readQuoteAlternatives(raw.allQuotes).flatMap((route) => {
|
|
979
979
|
try {
|
|
980
980
|
const normalized = normalizeRoute(route, false);
|
|
981
981
|
return normalized ? [normalized] : [];
|
|
@@ -989,6 +989,13 @@ function normalizeQuote(request, raw, receivedAt = Date.now()) {
|
|
|
989
989
|
raw
|
|
990
990
|
};
|
|
991
991
|
}
|
|
992
|
+
function readQuoteAlternatives(value) {
|
|
993
|
+
if (!Array.isArray(value)) return [];
|
|
994
|
+
return value.filter(isRecord);
|
|
995
|
+
}
|
|
996
|
+
function isRecord(value) {
|
|
997
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
998
|
+
}
|
|
992
999
|
function validateQuoteRequest(request) {
|
|
993
1000
|
assertBaseUnitAmount(request.amountIn);
|
|
994
1001
|
if (!Number.isInteger(request.slippageBps) || request.slippageBps < 0) {
|