Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solana/rpc-transport-http

Package Overview
Dependencies
Maintainers
15
Versions
936
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-experimental.2df278c to 2.0.0-experimental.2e0ae95

4

package.json
{
"name": "@solana/rpc-transport-http",
"version": "2.0.0-experimental.2df278c",
"version": "2.0.0-experimental.2e0ae95",
"description": "An RPC transport that uses HTTP requests",

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

"undici": "^6.6.2",
"@solana/rpc-spec": "2.0.0-experimental.2df278c"
"@solana/rpc-spec": "2.0.0-experimental.2e0ae95"
},

@@ -53,0 +53,0 @@ "bundlewatch": {

@@ -219,3 +219,27 @@ [![npm][npm-image]][npm-url]

```ts
// TODO: Your turn; send us a pull request with an example.
import { RpcTransport } from '@solana/rpc-spec';
import { createHttpTransport } from '@solana/rpc-transport-http';
// Create a transport for each RPC server
const transports = [
createHttpTransport({ url: 'https://mainnet-beta.my-server-1.com' }),
createHttpTransport({ url: 'https://mainnet-beta.my-server-2.com' }),
createHttpTransport({ url: 'https://mainnet-beta.my-server-2.com' }),
];
// A failover transport that will try each transport in order until one succeeds before failing
async function failoverTransport<TResponse>(...args: Parameters<RpcTransport>): Promise<TResponse> {
let requestError;
for (const transport of transports) {
try {
return await transport(...args);
} catch (err) {
requestError = err;
console.error(err);
}
}
throw requestError;
}
```
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