title: Core. Json Rpc Response Base
A2A Node SDK - v0.1.0 / Modules / Core / JsonRpcResponseBase
Interface: JsonRpcResponseBase<T>
Core.JsonRpcResponseBase
Base interface for JSON-RPC responses
This interface defines the base structure for JSON-RPC 2.0 response messages, including the jsonrpc version, optional result and error fields, and optional request id. It’s parameterized by the result type for type safety.
Example
// Create a JSON-RPC response with a Task result
const response: JsonRpcResponseBase<Task> = {
jsonrpc: '2.0',
id: 'request-123',
result: {
id: 'task-456',
name: 'Answer Question',
status: 'completed',
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString()
}
};
Type parameters
Name | Type | Description |
---|---|---|
T | any | Response result type |
Table of contents
Properties
Properties
error
• Optional
error: Object
Type declaration
Name | Type |
---|---|
code | number |
data? | any |
message | string |
id
• Optional
id: string
| number
jsonrpc
• jsonrpc: "2.0"
result
• Optional
result: T