@hyperbridge/sdk 1.9.1 → 1.9.3

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.
@@ -2898,6 +2898,7 @@ declare const IntentOrderStatus: Readonly<{
2898
2898
  ORDER_PLACED: "ORDER_PLACED";
2899
2899
  ORDER_CONFIRMED: "ORDER_CONFIRMED";
2900
2900
  AWAITING_BIDS: "AWAITING_BIDS";
2901
+ NEW_BID: "NEW_BID";
2901
2902
  BIDS_RECEIVED: "BIDS_RECEIVED";
2902
2903
  BID_SELECTED: "BID_SELECTED";
2903
2904
  FILLED: "FILLED";
@@ -2923,6 +2924,11 @@ type IntentOrderStatusUpdate = {
2923
2924
  commitment: HexString;
2924
2925
  totalFilledAssets: TokenInfo[];
2925
2926
  remainingAssets: TokenInfo[];
2927
+ } | {
2928
+ status: "NEW_BID";
2929
+ commitment: HexString;
2930
+ bidCount: number;
2931
+ bids: FillerBid[];
2926
2932
  } | {
2927
2933
  status: "BIDS_RECEIVED";
2928
2934
  commitment: HexString;
@@ -604,6 +604,7 @@ var IntentOrderStatus = Object.freeze({
604
604
  ORDER_PLACED: "ORDER_PLACED",
605
605
  ORDER_CONFIRMED: "ORDER_CONFIRMED",
606
606
  AWAITING_BIDS: "AWAITING_BIDS",
607
+ NEW_BID: "NEW_BID",
607
608
  BIDS_RECEIVED: "BIDS_RECEIVED",
608
609
  BID_SELECTED: "BID_SELECTED",
609
610
  FILLED: "FILLED",
@@ -15332,7 +15333,7 @@ var OrderExecutor = class {
15332
15333
  const currentBlock = await client.getBlockNumber();
15333
15334
  if (currentBlock >= deadline) break;
15334
15335
  const blocksRemaining = Number(deadline - currentBlock);
15335
- const sleepMs = blocksRemaining * blockTimeMs;
15336
+ const sleepMs = Math.min(blocksRemaining * blockTimeMs, 6e4);
15336
15337
  await sleep(sleepMs);
15337
15338
  }
15338
15339
  yield {
@@ -15535,8 +15536,24 @@ var OrderExecutor = class {
15535
15536
  yield { status: "AWAITING_BIDS", commitment, totalFilledAssets, remainingAssets };
15536
15537
  try {
15537
15538
  const auctionEnd = Date.now() + auctionTimeMs;
15539
+ const auctionSeenBids = /* @__PURE__ */ new Set();
15538
15540
  while (Date.now() < auctionEnd) {
15539
- await sleep(Math.min(pollIntervalMs, auctionEnd - Date.now()));
15541
+ try {
15542
+ const bids = await this.fetchBids({ commitment, solver, solverLockStartTime });
15543
+ const freshBids = bids.filter((bid) => !usedUserOps.has(userOpHashKey(bid.userOp)));
15544
+ const newBids = freshBids.filter((bid) => !auctionSeenBids.has(userOpHashKey(bid.userOp)));
15545
+ if (newBids.length > 0) {
15546
+ for (const bid of newBids) {
15547
+ auctionSeenBids.add(userOpHashKey(bid.userOp));
15548
+ }
15549
+ yield { status: "NEW_BID", commitment, bidCount: freshBids.length, bids: freshBids };
15550
+ }
15551
+ } catch {
15552
+ }
15553
+ const remaining = auctionEnd - Date.now();
15554
+ if (remaining > 0) {
15555
+ await sleep(Math.min(pollIntervalMs, remaining));
15556
+ }
15540
15557
  }
15541
15558
  while (true) {
15542
15559
  let freshBids;
@@ -15592,7 +15609,6 @@ var OrderExecutor = class {
15592
15609
  remainingAssets = fill.remainingAssets;
15593
15610
  if (fill.update) {
15594
15611
  yield fill.update;
15595
- if (fill.done) return;
15596
15612
  }
15597
15613
  }
15598
15614
  } catch (err) {