Skip to content

Commit

Permalink
feat: create CasperJsonRpc class
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-casper committed Apr 15, 2024
1 parent f2bba88 commit d89cd65
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/api/src/CasperJsonRpc/CasperJsonRpc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { BaseJsonRpc, JsonRpcOptions, ReturnType } from '../BaseJsonRpc';
import { SafeEventEmitterProvider } from '../ProviderTransport';
import {
GetPeersParams,
InfoGetPeersReturnTypeMap,
infoGetPeers
} from './informational';

export class CasperJsonRpc<
T extends ReturnType = ReturnType.Parsed
> extends BaseJsonRpc<T> {
constructor(
provider: string | SafeEventEmitterProvider,
options?: JsonRpcOptions<T>
) {
super(provider, options);
}

async infoGetPeers(
params: GetPeersParams = [],
options?: JsonRpcOptions<T>
): Promise<InfoGetPeersReturnTypeMap[T]> {
return infoGetPeers(this, params, options);
}
}

0 comments on commit d89cd65

Please sign in to comment.