@boostxyz/sdk 2.0.0-alpha.27 → 2.0.0-alpha.28

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.
@@ -227,6 +227,7 @@ export interface ActionStep {
227
227
  export type ValidateActionStepParams = {
228
228
  knownSignatures: Record<Hex, AbiEvent | AbiFunction>;
229
229
  abiItem?: AbiEvent | AbiFunction;
230
+ notBeforeBlockNumber?: bigint;
230
231
  } & ({ logs: EventLogs } | (GetTransactionParameters & { hash: Hex }));
231
232
 
232
233
  /**
@@ -526,6 +527,12 @@ export class EventAction extends DeployableTarget<
526
527
  ...params,
527
528
  chainId: claimant.chainid,
528
529
  });
530
+ if (
531
+ params.notBeforeBlockNumber &&
532
+ transaction.blockNumber < params.notBeforeBlockNumber
533
+ ) {
534
+ return undefined;
535
+ }
529
536
  return transaction.from;
530
537
  }
531
538
  if ('logs' in params) {
@@ -536,6 +543,12 @@ export class EventAction extends DeployableTarget<
536
543
  hash: log.transactionHash,
537
544
  chainId: claimant.chainid,
538
545
  });
546
+ if (
547
+ params.notBeforeBlockNumber &&
548
+ transaction.blockNumber < params.notBeforeBlockNumber
549
+ ) {
550
+ return undefined;
551
+ }
539
552
  return transaction.from;
540
553
  }
541
554
  }
@@ -572,6 +585,12 @@ export class EventAction extends DeployableTarget<
572
585
  ...params,
573
586
  chainId: claimant.chainid,
574
587
  });
588
+ if (
589
+ params.notBeforeBlockNumber &&
590
+ receipt.blockNumber < params.notBeforeBlockNumber
591
+ ) {
592
+ return undefined;
593
+ }
575
594
  const decodedLogs = receipt.logs.map((log) => {
576
595
  const { eventName, args } = decodeEventLog({
577
596
  abi: [event],
@@ -593,6 +612,12 @@ export class EventAction extends DeployableTarget<
593
612
  ...params,
594
613
  chainId: claimant.chainid,
595
614
  });
615
+ if (
616
+ params.notBeforeBlockNumber &&
617
+ transaction.blockNumber < params.notBeforeBlockNumber
618
+ ) {
619
+ return undefined;
620
+ }
596
621
  if (!isAddressEqual(transaction.to!, claimant.targetContract)) return;
597
622
  let func: AbiFunction;
598
623
  if (params.abiItem) func = params.abiItem as AbiFunction;
@@ -705,6 +730,8 @@ export class EventAction extends DeployableTarget<
705
730
  ...params,
706
731
  chainId: actionStep.chainid,
707
732
  });
733
+ if (params.notBeforeBlockNumber)
734
+ return receipt.blockNumber >= params.notBeforeBlockNumber;
708
735
  const decodedLogs = receipt.logs.map((log) => {
709
736
  const { eventName, args } = decodeEventLog({
710
737
  abi: [event],
@@ -723,6 +750,8 @@ export class EventAction extends DeployableTarget<
723
750
  ...params,
724
751
  chainId: actionStep.chainid,
725
752
  });
753
+ if (params.notBeforeBlockNumber)
754
+ return transaction.blockNumber >= params.notBeforeBlockNumber;
726
755
  return this.isActionFunctionValid(actionStep, transaction, params);
727
756
  }
728
757
  }