@hyperbridge/sdk 1.9.1 → 1.9.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.
@@ -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;
@@ -554,6 +554,7 @@ var IntentOrderStatus = Object.freeze({
554
554
  ORDER_PLACED: "ORDER_PLACED",
555
555
  ORDER_CONFIRMED: "ORDER_CONFIRMED",
556
556
  AWAITING_BIDS: "AWAITING_BIDS",
557
+ NEW_BID: "NEW_BID",
557
558
  BIDS_RECEIVED: "BIDS_RECEIVED",
558
559
  BID_SELECTED: "BID_SELECTED",
559
560
  FILLED: "FILLED",
@@ -15272,7 +15273,7 @@ var OrderExecutor = class {
15272
15273
  const currentBlock = await client.getBlockNumber();
15273
15274
  if (currentBlock >= deadline) break;
15274
15275
  const blocksRemaining = Number(deadline - currentBlock);
15275
- const sleepMs = blocksRemaining * blockTimeMs;
15276
+ const sleepMs = Math.min(blocksRemaining * blockTimeMs, 6e4);
15276
15277
  await sleep(sleepMs);
15277
15278
  }
15278
15279
  yield {
@@ -15475,8 +15476,24 @@ var OrderExecutor = class {
15475
15476
  yield { status: "AWAITING_BIDS", commitment, totalFilledAssets, remainingAssets };
15476
15477
  try {
15477
15478
  const auctionEnd = Date.now() + auctionTimeMs;
15479
+ const auctionSeenBids = /* @__PURE__ */ new Set();
15478
15480
  while (Date.now() < auctionEnd) {
15479
- await sleep(Math.min(pollIntervalMs, auctionEnd - Date.now()));
15481
+ try {
15482
+ const bids = await this.fetchBids({ commitment, solver, solverLockStartTime });
15483
+ const freshBids = bids.filter((bid) => !usedUserOps.has(userOpHashKey(bid.userOp)));
15484
+ const newBids = freshBids.filter((bid) => !auctionSeenBids.has(userOpHashKey(bid.userOp)));
15485
+ if (newBids.length > 0) {
15486
+ for (const bid of newBids) {
15487
+ auctionSeenBids.add(userOpHashKey(bid.userOp));
15488
+ }
15489
+ yield { status: "NEW_BID", commitment, bidCount: freshBids.length, bids: freshBids };
15490
+ }
15491
+ } catch {
15492
+ }
15493
+ const remaining = auctionEnd - Date.now();
15494
+ if (remaining > 0) {
15495
+ await sleep(Math.min(pollIntervalMs, remaining));
15496
+ }
15480
15497
  }
15481
15498
  while (true) {
15482
15499
  let freshBids;