@noosphere/agent-core 0.1.0-alpha.7 → 0.1.0-alpha.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/index.d.mts CHANGED
@@ -465,7 +465,7 @@ interface NoosphereAgentOptions {
465
465
  onRequestStarted?: (event: RequestStartedCallbackEvent) => void;
466
466
  onRequestProcessing?: (requestId: string) => void;
467
467
  onRequestSkipped?: (requestId: string, reason: string) => void;
468
- onRequestFailed?: (requestId: string, error: string) => void;
468
+ onRequestFailed?: (requestId: string, error: string, txHash?: string) => void;
469
469
  onComputeDelivered?: (event: ComputeDeliveredEvent) => void;
470
470
  onCommitmentSuccess?: (event: CommitmentSuccessCallbackEvent) => void;
471
471
  isRequestProcessed?: (requestId: string) => boolean;
package/dist/index.d.ts CHANGED
@@ -465,7 +465,7 @@ interface NoosphereAgentOptions {
465
465
  onRequestStarted?: (event: RequestStartedCallbackEvent) => void;
466
466
  onRequestProcessing?: (requestId: string) => void;
467
467
  onRequestSkipped?: (requestId: string, reason: string) => void;
468
- onRequestFailed?: (requestId: string, error: string) => void;
468
+ onRequestFailed?: (requestId: string, error: string, txHash?: string) => void;
469
469
  onComputeDelivered?: (event: ComputeDeliveredEvent) => void;
470
470
  onCommitmentSuccess?: (event: CommitmentSuccessCallbackEvent) => void;
471
471
  isRequestProcessed?: (requestId: string) => boolean;
package/dist/index.js CHANGED
@@ -1627,6 +1627,7 @@ var NoosphereAgent = class _NoosphereAgent {
1627
1627
  console.warn(` Could not verify interval currency:`, error.message);
1628
1628
  }
1629
1629
  this.scheduler.markIntervalCommitted(BigInt(event.subscriptionId), BigInt(event.interval));
1630
+ let sentTxHash;
1630
1631
  try {
1631
1632
  await this.waitForPriority(event);
1632
1633
  if (this.options.onRequestProcessing) {
@@ -1739,6 +1740,7 @@ var NoosphereAgent = class _NoosphereAgent {
1739
1740
  commitmentData,
1740
1741
  nodeWallet
1741
1742
  );
1743
+ sentTxHash = tx.hash;
1742
1744
  console.log(` \u{1F4E4} Transaction sent: ${tx.hash}`);
1743
1745
  const receipt = await tx.wait();
1744
1746
  if (receipt.status === 1) {
@@ -1773,7 +1775,7 @@ var NoosphereAgent = class _NoosphereAgent {
1773
1775
  }
1774
1776
  console.error(` \u274C Error processing request:`, error);
1775
1777
  if (this.options.onRequestFailed) {
1776
- this.options.onRequestFailed(event.requestId, errorMessage);
1778
+ this.options.onRequestFailed(event.requestId, errorMessage, sentTxHash);
1777
1779
  }
1778
1780
  } finally {
1779
1781
  this.processingRequests.delete(event.requestId);