@solana/rpc-transport-http
Advanced tools
Comparing version 2.0.0-canary-20240901182608 to 2.0.0-canary-20240901182910
{ | ||
"name": "@solana/rpc-transport-http", | ||
"version": "2.0.0-canary-20240901182608", | ||
"version": "2.0.0-canary-20240901182910", | ||
"description": "An RPC transport that uses HTTP requests", | ||
@@ -58,4 +58,4 @@ "exports": { | ||
"undici-types": "^6.19.8", | ||
"@solana/errors": "2.0.0-canary-20240901182608", | ||
"@solana/rpc-spec": "2.0.0-canary-20240901182608" | ||
"@solana/errors": "2.0.0-canary-20240901182910", | ||
"@solana/rpc-spec": "2.0.0-canary-20240901182910" | ||
}, | ||
@@ -62,0 +62,0 @@ "peerDependencies": { |
@@ -32,2 +32,3 @@ [![npm][npm-image]][npm-url] | ||
}); | ||
const data = await response.json(); | ||
``` | ||
@@ -71,4 +72,4 @@ | ||
const balances = await Promise.allSettled( | ||
accounts.map(account => | ||
transport({ | ||
accounts.map(async account => { | ||
const response = await transport({ | ||
payload: { | ||
@@ -80,4 +81,5 @@ id: ++id, | ||
}, | ||
}), | ||
), | ||
}); | ||
return await response.json(); | ||
}), | ||
); | ||
@@ -115,3 +117,3 @@ ``` | ||
```ts | ||
import { RpcTransport } from '@solana/rpc-spec'; | ||
import { RpcResponse, RpcTransport } from '@solana/rpc-spec'; | ||
import { createHttpTransport } from '@solana/rpc-transport-http'; | ||
@@ -128,3 +130,3 @@ | ||
let nextTransport = 0; | ||
async function roundRobinTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<TResponse> { | ||
async function roundRobinTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<RpcResponse<TResponse>> { | ||
const transport = transports[nextTransport]; | ||
@@ -143,3 +145,3 @@ nextTransport = (nextTransport + 1) % transports.length; | ||
```ts | ||
import { RpcTransport } from '@solana/rpc-spec'; | ||
import { RpcResponse, RpcTransport } from '@solana/rpc-spec'; | ||
import { createHttpTransport } from '@solana/rpc-transport-http'; | ||
@@ -169,3 +171,3 @@ | ||
async function shardingTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<TResponse> { | ||
async function shardingTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<RpcResponse<TResponse>> { | ||
const payload = args[0].payload as { method: string }; | ||
@@ -182,3 +184,3 @@ const selectedTransport = selectShard(payload.method); | ||
```ts | ||
import { RpcTransport } from '@solana/rpc-spec'; | ||
import { RpcResponse, RpcTransport } from '@solana/rpc-spec'; | ||
import { createHttpTransport } from '@solana/rpc-transport-http'; | ||
@@ -204,3 +206,3 @@ | ||
// A retrying transport that will retry up to `MAX_ATTEMPTS` times before failing | ||
async function retryingTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<TResponse> { | ||
async function retryingTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<RpcResponse<TResponse>> { | ||
let requestError; | ||
@@ -228,3 +230,3 @@ for (let attempts = 0; attempts < MAX_ATTEMPTS; attempts++) { | ||
```ts | ||
import { RpcTransport } from '@solana/rpc-spec'; | ||
import { RpcResponse, RpcTransport } from '@solana/rpc-spec'; | ||
import { createHttpTransport } from '@solana/rpc-transport-http'; | ||
@@ -240,3 +242,3 @@ | ||
// A failover transport that will try each transport in order until one succeeds before failing | ||
async function failoverTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<TResponse> { | ||
async function failoverTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<RpcResponse<TResponse>> { | ||
let requestError; | ||
@@ -243,0 +245,0 @@ |
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
81083
536
246
+ Added@solana/errors@2.0.0-canary-20240901182910(transitive)
+ Added@solana/rpc-spec@2.0.0-canary-20240901182910(transitive)
+ Added@solana/rpc-spec-types@2.0.0-canary-20240901182910(transitive)
- Removed@solana/errors@2.0.0-canary-20240901182608(transitive)
- Removed@solana/rpc-spec@2.0.0-canary-20240901182608(transitive)
- Removed@solana/rpc-spec-types@2.0.0-canary-20240901182608(transitive)