@solana/rpc-spec
Advanced tools
Comparing version 2.0.0-canary-20240911082808 to 2.0.0-canary-20240911083416
@@ -9,3 +9,8 @@ import { RpcResponse } from './rpc-shared'; | ||
}; | ||
export declare function isJsonRpcPayload(payload: unknown): payload is Readonly<{ | ||
jsonrpc: '2.0'; | ||
method: string; | ||
params: unknown; | ||
}>; | ||
export {}; | ||
//# sourceMappingURL=rpc-transport.d.ts.map |
{ | ||
"name": "@solana/rpc-spec", | ||
"version": "2.0.0-canary-20240911082808", | ||
"version": "2.0.0-canary-20240911083416", | ||
"description": "A generic implementation of JSON RPCs using proxies", | ||
@@ -57,3 +57,3 @@ "exports": { | ||
"dependencies": { | ||
"@solana/rpc-spec-types": "2.0.0-canary-20240911082808" | ||
"@solana/rpc-spec-types": "2.0.0-canary-20240911083416" | ||
}, | ||
@@ -60,0 +60,0 @@ "peerDependencies": { |
@@ -138,1 +138,18 @@ [![npm][npm-image]][npm-url] | ||
- `responseTransformer<T>(response: RpcResponse, request: RpcRequest): RpcResponse<T>`: An optional function that transforms the `RpcResponse` before it is returned to the caller. | ||
### `isJsonRpcPayload(payload)` | ||
A helper function that returns `true` if the given payload is a JSON RPC v2 payload. This means, the payload is an object such that: | ||
- It has a `jsonrpc` property with a value of `'2.0'`. | ||
- It has a `method` property that is a string. | ||
- It has a `params` property of any type. | ||
```ts | ||
import { isJsonRpcPayload } from '@solana/rpc-spec'; | ||
if (isJsonRpcPayload(payload)) { | ||
const payloadMethod: string = payload.method; | ||
const payloadParams: unknown = payload.params; | ||
} | ||
``` |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73338
426
155
+ Added@solana/rpc-spec-types@2.0.0-canary-20240911083416(transitive)
- Removed@solana/rpc-spec-types@2.0.0-canary-20240911082808(transitive)