@hyperbridge/sdk 2.8.7 → 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.
- package/dist/browser/index.d.ts +68 -23
- package/dist/browser/index.js +200 -73
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +203 -72
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +55 -22
- package/dist/node/index.d.ts +55 -22
- package/dist/node/index.js +200 -73
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-BFc6YnD3.d.cts → intents-helpers-BCsIHRts.d.cts} +16 -4
- package/dist/node/{intents-helpers-BFc6YnD3.d.ts → intents-helpers-BCsIHRts.d.ts} +16 -4
- package/dist/node/intents-helpers.cjs +10 -1
- 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 -2
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
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 {
|
|
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
|
|
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
|