Skip to content

Commit

Permalink
Introduce interfaces for RPC request and response objects
Browse files Browse the repository at this point in the history
  • Loading branch information
derbenoo committed Jan 6, 2019
1 parent 3d3390b commit d4216b4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,23 @@ export interface ILogger {
/** Logging function for errors (default: console.log) */
err?: Function;
}

export interface IRpcRequest {
jsonrpc: string;
id: number;
method: string;
params: undefined|Array<any>;
}

export interface IRpcResponse {
jsonrpc: string;
id: number;
result?: Array<any>|Object;
error?: IRpcError;
}

export interface IRpcError {
code: number;
message: string;
data: any;
}

0 comments on commit d4216b4

Please sign in to comment.