Socket
Socket
Sign inDemoInstall

@solana/rpc-transport-http

Package Overview
Dependencies
Maintainers
0
Versions
790
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-transport-http - npm Package Compare versions

Comparing version 2.0.0-canary-20240901182608 to 2.0.0-canary-20240901182910

6

package.json
{
"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

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