Socket
Socket
Sign inDemoInstall

@solana/rpc-spec

Package Overview
Dependencies
Maintainers
0
Versions
723
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-spec - npm Package Compare versions

Comparing version 2.0.0-canary-20240901183156 to 2.0.0-canary-20240901183511

11

dist/types/rpc-api.d.ts
import { Callable } from '@solana/rpc-spec-types';
import { RpcRequest, RpcRequestTransformer, RpcResponseTransformer, RpcResponseTransformerFor } from './rpc-shared';
export type RpcApiConfig = Readonly<{
parametersTransformer?: <T extends unknown[]>(params: T, methodName: string) => unknown;
responseTransformer?: <T>(response: unknown, methodName?: string) => T;
requestTransformer?: RpcRequestTransformer;
responseTransformer?: RpcResponseTransformer;
}>;
export type RpcApiRequestPlan<TResponse> = {
methodName: string;
params: unknown;
responseTransformer?: (response: unknown, methodName: string) => TResponse;
export type RpcApiRequestPlan<TResponse> = RpcRequest & {
responseTransformer?: RpcResponseTransformerFor<TResponse>;
};

@@ -11,0 +10,0 @@ export type RpcApi<TRpcMethods> = {

{
"name": "@solana/rpc-spec",
"version": "2.0.0-canary-20240901183156",
"version": "2.0.0-canary-20240901183511",
"description": "A generic implementation of JSON RPCs using proxies",

@@ -57,3 +57,3 @@ "exports": {

"dependencies": {
"@solana/rpc-spec-types": "2.0.0-canary-20240901183156"
"@solana/rpc-spec-types": "2.0.0-canary-20240901183511"
},

@@ -60,0 +60,0 @@ "peerDependencies": {

@@ -116,5 +116,5 @@ [![npm][npm-image]][npm-url]

- setting `methodName` to the name of the function called
- setting `params` to the arguments supplied to that function, optionally transformed by `config.parametersTransformer`
- setting `responseTransformer` to `config.responseTransformer` or the identity function if no such config exists
- setting `methodName` to the name of the function called, optionally transformed by `config.requestTransformer`.
- setting `params` to the arguments supplied to that function, optionally transformed by `config.requestTransformer`.
- setting `responseTransformer` to `config.responseTransformer`, if provided.

@@ -124,3 +124,3 @@ ```ts

const rpcApi = createRpcApi({
paramsTransformer: (...rawParams) => rawParams.reverse(),
requestTransformer: (...rawParams) => rawParams.reverse(),
responseTransformer: response => response.result,

@@ -145,4 +145,4 @@ });

- `parametersTransformer<T>(params: T, methodName): unknown`: An optional function that maps between the shape of the arguments an RPC method was called with and the shape of the params expected by the JSON RPC server.
- `responseTransformer<T>(response, methodName): T`: An optional function that maps between the shape of the JSON RPC server response for a given method and the shape of the response expected by the `RpcApi`.
- `requestTransformer<T>(request: RpcRequest<T>): RpcRequest`: An optional function that transforms the `RpcRequest` before it is sent to the JSON RPC server.
- `responseTransformer<T>(response: RpcResponse, request: RpcRequest): RpcResponse<T>`: An optional function that transforms the `RpcResponse` before it is returned to the caller.

@@ -149,0 +149,0 @@ ### `createJsonRpcResponseTransformer<T>(jsonTransformer)`

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc