@hyperbridge/sdk 2.8.6 → 2.8.8

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.
@@ -1,4 +1,4 @@
1
- export { bE as AggregationLogger, bF as BidNonceKeyFn, bG as BidSignature, bH as ENTRY_POINT_V08_ADDRESS, bI as FILL_ORDER_ABI, bJ as FetchLike, bK as FillData, bL as HexString, bM as IntentGatewayV2, bN as LpBalance, bO as OrderCommitmentFn, bP as PhantomAggregation, bQ as PhantomLegAggregation, bR as PhantomLegBidder, bS as RecoverBidSigner, bT as RpcBidInfo, bU as SolverBalanceReader, bV as YieldVaultMap, bW as aggregatePhantomBids, bi as decodeAcceptedSourceChains, bj as decodeERC7821ExecuteBatch, bk as decodePhantomBidDeclaration, bl as decodeUserOpScale, bn as encodeAcceptedSourceChains, bo as encodeERC7821ExecuteBatch, bq as encodePhantomBidDeclaration, br as encodeUserOpScale, bX as extractFillData, bY as fetchBidsForOrder, bZ as memoizedSolverBalance, b_ as orderCommitmentFromDecoded, bA as poolSlug, b$ as recoverBidSignerViem, c0 as setAggregationFetch, bB as sortPoolSymbols, c1 as splitBidSignature, c2 as weightedMedian, c3 as zipFillLegs } from './intents-helpers-BFc6YnD3.cjs';
1
+ export { bG as AggregationLogger, bH as BidNonceKeyFn, bI as BidSignature, bJ as ENTRY_POINT_V08_ADDRESS, bK as FILL_ORDER_ABI, bL as FetchLike, bM as FillData, bN as HexString, bO as IntentGatewayV2, bP as LpBalance, bQ as OrderCommitmentFn, bR as PhantomAggregation, bS as PhantomLegAggregation, bT as PhantomLegBidder, bU as RecoverBidSigner, bV as RpcBidInfo, bW as SolverBalanceReader, b9 as UNISWAP_QUOTE_HAIRCUT_BPS, bX as YieldVaultMap, bY as aggregatePhantomBids, bb as applyUniswapQuoteHaircut, bk as decodeAcceptedSourceChains, bl as decodeERC7821ExecuteBatch, bm as decodePhantomBidDeclaration, bn as decodeUserOpScale, bp as encodeAcceptedSourceChains, bq as encodeERC7821ExecuteBatch, bs as encodePhantomBidDeclaration, bt as encodeUserOpScale, bZ as extractFillData, b_ as fetchBidsForOrder, b$ as memoizedSolverBalance, c0 as orderCommitmentFromDecoded, bC as poolSlug, c1 as recoverBidSignerViem, c2 as setAggregationFetch, bD as sortPoolSymbols, c3 as splitBidSignature, c4 as weightedMedian, c5 as zipFillLegs } from './intents-helpers-BCsIHRts.cjs';
2
2
  import 'consola';
3
3
  import 'decimal.js';
4
4
  import 'graphql-request';
@@ -1,4 +1,4 @@
1
- export { bE as AggregationLogger, bF as BidNonceKeyFn, bG as BidSignature, bH as ENTRY_POINT_V08_ADDRESS, bI as FILL_ORDER_ABI, bJ as FetchLike, bK as FillData, bL as HexString, bM as IntentGatewayV2, bN as LpBalance, bO as OrderCommitmentFn, bP as PhantomAggregation, bQ as PhantomLegAggregation, bR as PhantomLegBidder, bS as RecoverBidSigner, bT as RpcBidInfo, bU as SolverBalanceReader, bV as YieldVaultMap, bW as aggregatePhantomBids, bi as decodeAcceptedSourceChains, bj as decodeERC7821ExecuteBatch, bk as decodePhantomBidDeclaration, bl as decodeUserOpScale, bn as encodeAcceptedSourceChains, bo as encodeERC7821ExecuteBatch, bq as encodePhantomBidDeclaration, br as encodeUserOpScale, bX as extractFillData, bY as fetchBidsForOrder, bZ as memoizedSolverBalance, b_ as orderCommitmentFromDecoded, bA as poolSlug, b$ as recoverBidSignerViem, c0 as setAggregationFetch, bB as sortPoolSymbols, c1 as splitBidSignature, c2 as weightedMedian, c3 as zipFillLegs } from './intents-helpers-BFc6YnD3.js';
1
+ export { bG as AggregationLogger, bH as BidNonceKeyFn, bI as BidSignature, bJ as ENTRY_POINT_V08_ADDRESS, bK as FILL_ORDER_ABI, bL as FetchLike, bM as FillData, bN as HexString, bO as IntentGatewayV2, bP as LpBalance, bQ as OrderCommitmentFn, bR as PhantomAggregation, bS as PhantomLegAggregation, bT as PhantomLegBidder, bU as RecoverBidSigner, bV as RpcBidInfo, bW as SolverBalanceReader, b9 as UNISWAP_QUOTE_HAIRCUT_BPS, bX as YieldVaultMap, bY as aggregatePhantomBids, bb as applyUniswapQuoteHaircut, bk as decodeAcceptedSourceChains, bl as decodeERC7821ExecuteBatch, bm as decodePhantomBidDeclaration, bn as decodeUserOpScale, bp as encodeAcceptedSourceChains, bq as encodeERC7821ExecuteBatch, bs as encodePhantomBidDeclaration, bt as encodeUserOpScale, bZ as extractFillData, b_ as fetchBidsForOrder, b$ as memoizedSolverBalance, c0 as orderCommitmentFromDecoded, bC as poolSlug, c1 as recoverBidSignerViem, c2 as setAggregationFetch, bD as sortPoolSymbols, c3 as splitBidSignature, c4 as weightedMedian, c5 as zipFillLegs } from './intents-helpers-BCsIHRts.js';
2
2
  import 'consola';
3
3
  import 'decimal.js';
4
4
  import 'graphql-request';
@@ -2591,6 +2591,10 @@ function zipFillLegs(assets, outputs) {
2591
2591
  };
2592
2592
  });
2593
2593
  }
2594
+ var UNISWAP_QUOTE_HAIRCUT_BPS = 30n;
2595
+ function applyUniswapQuoteHaircut(amount) {
2596
+ return amount * (10000n - UNISWAP_QUOTE_HAIRCUT_BPS) / 10000n;
2597
+ }
2594
2598
  function weightedMedian(entries) {
2595
2599
  const sorted = [...entries].sort((a, b) => a.price < b.price ? -1 : a.price > b.price ? 1 : 0);
2596
2600
  const totalWeight = sorted.reduce((acc, e) => e.weight > 0n ? acc + e.weight : acc, 0n);
@@ -2949,7 +2953,10 @@ async function runAggregation(params, isDelegated) {
2949
2953
  countedSolvers.add(normalizedSolver);
2950
2954
  const declaration = decodePhantomBidDeclaration(decoded.paymasterAndData);
2951
2955
  const acceptedSources = declaration.acceptedSources;
2952
- const quotedLegs = [...fillData.legs.entries()].filter(([, leg]) => leg.solverAmount !== 0n);
2956
+ const poolPriced = declaration.uniswapV4Positions.length > 0;
2957
+ const quotedLegs = [...fillData.legs.entries()].map(
2958
+ ([legIndex, leg]) => poolPriced ? [legIndex, { ...leg, solverAmount: applyUniswapQuoteHaircut(leg.solverAmount) }] : [legIndex, leg]
2959
+ ).filter(([, leg]) => leg.solverAmount !== 0n);
2953
2960
  const declaredPositions = v4Contracts ? declaration.uniswapV4Positions : [];
2954
2961
  const positions = (await Promise.all(
2955
2962
  declaredPositions.map((tokenId) => readPosition(destUrl, chain, v4Contracts, tokenId))
@@ -3026,6 +3033,6 @@ async function runAggregation(params, isDelegated) {
3026
3033
  return { legs, lpBalances };
3027
3034
  }
3028
3035
 
3029
- export { ENTRY_POINT_V08_ADDRESS, FILL_ORDER_ABI, IntentGatewayV2_default as IntentGatewayV2, aggregatePhantomBids, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodePhantomBidDeclaration, decodeUserOpScale, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodePhantomBidDeclaration, encodeUserOpScale, extractFillData, fetchBidsForOrder, memoizedSolverBalance, orderCommitmentFromDecoded, poolSlug, recoverBidSignerViem, setAggregationFetch, sortPoolSymbols, splitBidSignature, weightedMedian, zipFillLegs };
3036
+ export { ENTRY_POINT_V08_ADDRESS, FILL_ORDER_ABI, IntentGatewayV2_default as IntentGatewayV2, UNISWAP_QUOTE_HAIRCUT_BPS, aggregatePhantomBids, applyUniswapQuoteHaircut, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodePhantomBidDeclaration, decodeUserOpScale, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodePhantomBidDeclaration, encodeUserOpScale, extractFillData, fetchBidsForOrder, memoizedSolverBalance, orderCommitmentFromDecoded, poolSlug, recoverBidSignerViem, setAggregationFetch, sortPoolSymbols, splitBidSignature, weightedMedian, zipFillLegs };
3030
3037
  //# sourceMappingURL=intents-helpers.js.map
3031
3038
  //# sourceMappingURL=intents-helpers.js.map