diff --git a/packages/custodyController/src/custody.ts b/packages/custodyController/src/custody.ts index 01827701..42d72a09 100644 --- a/packages/custodyController/src/custody.ts +++ b/packages/custodyController/src/custody.ts @@ -52,9 +52,10 @@ export class CustodyController { } sanitizeAndLogApiCall(apiLogEntry: IApiCallLogEntry): void { - const { method, endpoint, success, timestamp, errorMessage, responseData } = apiLogEntry; + const { id, method, endpoint, success, timestamp, errorMessage, responseData } = apiLogEntry; const sanitizedEntry: IApiCallLogEntry = { + id, method, endpoint, success, diff --git a/packages/sdk/src/custodianApi/eca3/util/json-rpc-call.ts b/packages/sdk/src/custodianApi/eca3/util/json-rpc-call.ts index cb151a46..ffe58fff 100644 --- a/packages/sdk/src/custodianApi/eca3/util/json-rpc-call.ts +++ b/packages/sdk/src/custodianApi/eca3/util/json-rpc-call.ts @@ -34,6 +34,7 @@ export default function (jsonRpcEndpoint: string, emit: (eventName: string, even responseJson = await response.json(); emit(API_REQUEST_LOG_EVENT, { + id: requestId, method, endpoint: jsonRpcEndpoint, success: !responseJson.error, @@ -55,6 +56,7 @@ export default function (jsonRpcEndpoint: string, emit: (eventName: string, even console.log("JSON-RPC <", method, requestId, e, jsonRpcEndpoint); emit(API_REQUEST_LOG_EVENT, { + id: requestId, method, endpoint: jsonRpcEndpoint, success: false, diff --git a/packages/sdk/src/custodianApi/json-rpc/util/json-rpc-call.ts b/packages/sdk/src/custodianApi/json-rpc/util/json-rpc-call.ts index cb151a46..ffe58fff 100644 --- a/packages/sdk/src/custodianApi/json-rpc/util/json-rpc-call.ts +++ b/packages/sdk/src/custodianApi/json-rpc/util/json-rpc-call.ts @@ -34,6 +34,7 @@ export default function (jsonRpcEndpoint: string, emit: (eventName: string, even responseJson = await response.json(); emit(API_REQUEST_LOG_EVENT, { + id: requestId, method, endpoint: jsonRpcEndpoint, success: !responseJson.error, @@ -55,6 +56,7 @@ export default function (jsonRpcEndpoint: string, emit: (eventName: string, even console.log("JSON-RPC <", method, requestId, e, jsonRpcEndpoint); emit(API_REQUEST_LOG_EVENT, { + id: requestId, method, endpoint: jsonRpcEndpoint, success: false, diff --git a/packages/types/src/IApiCallLogEntry.ts b/packages/types/src/IApiCallLogEntry.ts index c6bc9716..1dfe1da0 100644 --- a/packages/types/src/IApiCallLogEntry.ts +++ b/packages/types/src/IApiCallLogEntry.ts @@ -1,4 +1,5 @@ export interface IApiCallLogEntry { + id?: number; method: string; endpoint: string; success: boolean;