diff --git a/src/acpClient.ts b/src/acpClient.ts index c3b3297..4cb6a02 100644 --- a/src/acpClient.ts +++ b/src/acpClient.ts @@ -85,7 +85,8 @@ class AcpClient { memo.nextPhase ); }), - data.phase + data.phase, + data.context && JSON.parse(JSON.stringify(data.context)) ); this.onEvaluate(job); @@ -115,7 +116,8 @@ class AcpClient { memo.nextPhase ); }), - data.phase + data.phase, + data.context && JSON.parse(JSON.stringify(data.context)) ); this.onNewTask(job); @@ -289,7 +291,8 @@ class AcpClient { memo.nextPhase ); }), - job.phase + job.phase, + job.context && JSON.parse(job.context) ); }); } catch (error) { @@ -330,7 +333,8 @@ class AcpClient { memo.nextPhase ); }), - job.phase + job.phase, + job.context && JSON.parse(job.context) ); }); } catch (error) { @@ -370,7 +374,8 @@ class AcpClient { memo.nextPhase ); }), - job.phase + job.phase, + job.context && JSON.parse(job.context) ); }); } catch (error) { @@ -415,7 +420,8 @@ class AcpClient { memo.nextPhase ); }), - job.phase + job.phase, + job.context && JSON.parse(job.context) ); } catch (error) { throw error; diff --git a/src/acpJob.ts b/src/acpJob.ts index 4dbe93b..527b7d0 100644 --- a/src/acpJob.ts +++ b/src/acpJob.ts @@ -12,8 +12,9 @@ class AcpJob { public evaluatorAddress: Address, public price: number, public memos: AcpMemo[], - public phase: AcpJobPhases - ) {} + public phase: AcpJobPhases, + public context: Record | null + ) { } public get serviceRequirement() { return this.memos.find((m) => m.nextPhase === AcpJobPhases.NEGOTIATION) diff --git a/src/interfaces.ts b/src/interfaces.ts index 1ba5875..2dea9b0 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -40,6 +40,7 @@ export interface IAcpJob { price: number; deliverable: IDeliverable | null; memos: IAcpMemoData[]; + context: string | null; createdAt: string; }; error?: Error;