Skip to content

Commit 6340744

Browse files
authored
Allow RpcRequest params to be of any type, instead of requiring an array (#2751)
This provides flexibility for APIs that do not use an array of params
1 parent 0ca5cc1 commit 6340744

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solana/rpc-spec": patch
3+
---
4+
5+
Allow Rpc Request params to be any type, instead of requiring an array

packages/rpc-spec/src/rpc-api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Callable } from '@solana/rpc-spec-types';
33
import { RpcRequest } from './rpc-request';
44

55
export type RpcApiConfig = Readonly<{
6-
parametersTransformer?: <T extends unknown[]>(params: T, methodName: string) => unknown[];
6+
parametersTransformer?: <T extends unknown[]>(params: T, methodName: string) => unknown;
77
responseTransformer?: <T>(response: unknown, methodName: string) => T;
88
}>;
99

packages/rpc-spec/src/rpc-request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type RpcRequest<TResponse> = {
22
methodName: string;
3-
params: unknown[];
3+
params: unknown;
44
responseTransformer?: (response: unknown, methodName: string) => TResponse;
55
};
66

0 commit comments

Comments
 (0)