@hyperbridge/sdk 2.8.0 → 2.8.2
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 +61 -2
- package/dist/browser/index.js +111 -42
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +111 -42
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +111 -42
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-gyGREuyu.d.cts → intents-helpers-D_km9I2f.d.cts} +74 -6
- package/dist/node/{intents-helpers-gyGREuyu.d.ts → intents-helpers-D_km9I2f.d.ts} +74 -6
- package/dist/node/intents-helpers.cjs +22 -11
- 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 +22 -11
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { br as AggregationLogger, bs as BidNonceKeyFn, bt as BidSignature, bu as ENTRY_POINT_V08_ADDRESS, bv as FILL_ORDER_ABI, bw as FetchLike, bx as FillData, by as HexString, bz as IntentGatewayV2, bA as LpBalance, bB as OrderCommitmentFn, bC as PhantomAggregation, bD as PhantomLegAggregation, bE as PhantomLegBidder, bF as RecoverBidSigner, bG as RpcBidInfo, bH as SolverBalanceReader, bI as YieldVaultMap, bJ as aggregatePhantomBids, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bg as encodeUserOpScale, bK as extractFillData, bL as fetchBidsForOrder, bM as memoizedSolverBalance, bN as orderCommitmentFromDecoded, bO as recoverBidSignerViem, bP as setAggregationFetch, bQ as splitBidSignature, bR as weightedMedian, bS as zipFillLegs } from './intents-helpers-
|
|
1
|
+
export { br as AggregationLogger, bs as BidNonceKeyFn, bt as BidSignature, bu as ENTRY_POINT_V08_ADDRESS, bv as FILL_ORDER_ABI, bw as FetchLike, bx as FillData, by as HexString, bz as IntentGatewayV2, bA as LpBalance, bB as OrderCommitmentFn, bC as PhantomAggregation, bD as PhantomLegAggregation, bE as PhantomLegBidder, bF as RecoverBidSigner, bG as RpcBidInfo, bH as SolverBalanceReader, bI as YieldVaultMap, bJ as aggregatePhantomBids, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bg as encodeUserOpScale, bK as extractFillData, bL as fetchBidsForOrder, bM as memoizedSolverBalance, bN as orderCommitmentFromDecoded, bO as recoverBidSignerViem, bP as setAggregationFetch, bQ as splitBidSignature, bR as weightedMedian, bS as zipFillLegs } from './intents-helpers-D_km9I2f.cjs';
|
|
2
2
|
import 'consola';
|
|
3
3
|
import 'decimal.js';
|
|
4
4
|
import 'graphql-request';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { br as AggregationLogger, bs as BidNonceKeyFn, bt as BidSignature, bu as ENTRY_POINT_V08_ADDRESS, bv as FILL_ORDER_ABI, bw as FetchLike, bx as FillData, by as HexString, bz as IntentGatewayV2, bA as LpBalance, bB as OrderCommitmentFn, bC as PhantomAggregation, bD as PhantomLegAggregation, bE as PhantomLegBidder, bF as RecoverBidSigner, bG as RpcBidInfo, bH as SolverBalanceReader, bI as YieldVaultMap, bJ as aggregatePhantomBids, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bg as encodeUserOpScale, bK as extractFillData, bL as fetchBidsForOrder, bM as memoizedSolverBalance, bN as orderCommitmentFromDecoded, bO as recoverBidSignerViem, bP as setAggregationFetch, bQ as splitBidSignature, bR as weightedMedian, bS as zipFillLegs } from './intents-helpers-
|
|
1
|
+
export { br as AggregationLogger, bs as BidNonceKeyFn, bt as BidSignature, bu as ENTRY_POINT_V08_ADDRESS, bv as FILL_ORDER_ABI, bw as FetchLike, bx as FillData, by as HexString, bz as IntentGatewayV2, bA as LpBalance, bB as OrderCommitmentFn, bC as PhantomAggregation, bD as PhantomLegAggregation, bE as PhantomLegBidder, bF as RecoverBidSigner, bG as RpcBidInfo, bH as SolverBalanceReader, bI as YieldVaultMap, bJ as aggregatePhantomBids, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bg as encodeUserOpScale, bK as extractFillData, bL as fetchBidsForOrder, bM as memoizedSolverBalance, bN as orderCommitmentFromDecoded, bO as recoverBidSignerViem, bP as setAggregationFetch, bQ as splitBidSignature, bR as weightedMedian, bS as zipFillLegs } from './intents-helpers-D_km9I2f.js';
|
|
2
2
|
import 'consola';
|
|
3
3
|
import 'decimal.js';
|
|
4
4
|
import 'graphql-request';
|
|
@@ -2649,17 +2649,28 @@ async function aggregatePhantomBids(params) {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
}
|
|
2651
2651
|
if (quotesByLeg.size === 0) return null;
|
|
2652
|
-
const legs = [...quotesByLeg.entries()].sort(([a], [b]) => a - b).
|
|
2653
|
-
const
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2652
|
+
const legs = [...quotesByLeg.entries()].sort(([a], [b]) => a - b).flatMap(([legIndex, { outputToken, quotes, bidders }]) => {
|
|
2653
|
+
const backedQuotes = quotes.filter((quote) => quote.weight > 0n);
|
|
2654
|
+
const backedBidders = bidders.filter((bidder) => bidder.weight > 0n);
|
|
2655
|
+
if (backedQuotes.length === 0) {
|
|
2656
|
+
logger?.warn(
|
|
2657
|
+
{ commitment, chain, legIndex, outputToken, quotes: quotes.length },
|
|
2658
|
+
"Dropping phantom leg: no bidder holds the output token on this chain, so no quote is backed"
|
|
2659
|
+
);
|
|
2660
|
+
return [];
|
|
2661
|
+
}
|
|
2662
|
+
const medianPrice = weightedMedian(backedQuotes);
|
|
2663
|
+
return [
|
|
2664
|
+
{
|
|
2665
|
+
legIndex,
|
|
2666
|
+
outputToken,
|
|
2667
|
+
lowestPrice: medianPrice,
|
|
2668
|
+
highestPrice: medianPrice,
|
|
2669
|
+
medianPrice,
|
|
2670
|
+
bidCount: backedQuotes.length,
|
|
2671
|
+
bidders: backedBidders
|
|
2672
|
+
}
|
|
2673
|
+
];
|
|
2663
2674
|
});
|
|
2664
2675
|
return { legs, lpBalances };
|
|
2665
2676
|
}
|