Socket
Socket
Sign inDemoInstall

@solana/rpc-transport-http

Package Overview
Dependencies
Maintainers
15
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-experimental.8023370 to 2.0.0-experimental.00fa195

11

dist/index.browser.js

@@ -1,8 +0,5 @@

import { SolanaError, SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN } from '@solana/errors';
import { SolanaError, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN } from '@solana/errors';
// ../build-scripts/env-shim.ts
var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();
// ../fetch-impl/dist/index.browser.js
var e = globalThis.fetch;
var DISALLOWED_HEADERS = {

@@ -44,3 +41,3 @@ accept: true,

if (badHeaders.length > 0) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN, {
headers: badHeaders

@@ -97,5 +94,5 @@ });

};
const response = await e(url, requestInfo);
const response = await fetch(url, requestInfo);
if (!response.ok) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, {
message: response.statusText,

@@ -102,0 +99,0 @@ statusCode: response.status

@@ -1,8 +0,5 @@

import { SolanaError, SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN } from '@solana/errors';
import { SolanaError, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN } from '@solana/errors';
// ../build-scripts/env-shim.ts
var __DEV__ = /* @__PURE__ */ (() => process["env"].NODE_ENV === "development")();
// ../fetch-impl/dist/index.browser.js
var e = globalThis.fetch;
var DISALLOWED_HEADERS = {

@@ -44,3 +41,3 @@ accept: true,

if (badHeaders.length > 0) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN, {
headers: badHeaders

@@ -97,5 +94,5 @@ });

};
const response = await e(url, requestInfo);
const response = await fetch(url, requestInfo);
if (!response.ok) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, {
message: response.statusText,

@@ -102,0 +99,0 @@ statusCode: response.status

@@ -1,3 +0,2 @@

import { SolanaError, SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN } from '@solana/errors';
import { fetch } from 'undici';
import { SolanaError, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN } from '@solana/errors';

@@ -42,3 +41,3 @@ // ../build-scripts/env-shim.ts

if (badHeaders.length > 0) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HEADER_FORBIDDEN, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_HEADER_FORBIDDEN, {
headers: badHeaders

@@ -90,3 +89,3 @@ });

if (!response.ok) {
throw new SolanaError(SOLANA_ERROR__RPC_TRANSPORT_HTTP_ERROR, {
throw new SolanaError(SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR, {
message: response.statusText,

@@ -93,0 +92,0 @@ statusCode: response.status

export type AllowedHttpRequestHeaders = Readonly<{
[K in DisallowedHeaders | ForbiddenHeaders as Capitalize<Lowercase<K>> | K | Lowercase<K> | Uncapitalize<K> | Uppercase<K>]?: never;
} & {
[headerName: string]: string;
} & {
[K in DisallowedHeaders | ForbiddenHeaders as K | Capitalize<Lowercase<K>> | Lowercase<K> | Uncapitalize<K> | Uppercase<K>]?: never;
}>;
type DisallowedHeaders = 'Accept' | 'Content-Length' | 'Content-Type' | 'Solana-Client';
type ForbiddenHeaders = 'Accept-Charset' | 'Accept-Encoding' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Connection' | 'Content-Length' | 'Cookie' | 'Date' | 'DNT' | 'Expect' | 'Host' | 'Keep-Alive' | 'Origin' | 'Permissions-Policy' | `Proxy-${string}` | `Sec-${string}` | 'Referer' | 'TE' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Via';
type ForbiddenHeaders = 'Accept-Charset' | 'Accept-Encoding' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Connection' | 'Content-Length' | 'Cookie' | 'Date' | 'DNT' | 'Expect' | 'Host' | 'Keep-Alive' | 'Origin' | 'Permissions-Policy' | 'Referer' | 'TE' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Via' | `Proxy-${string}` | `Sec-${string}`;
export declare function assertIsAllowedHttpRequestHeaders(headers: Record<string, string>): asserts headers is AllowedHttpRequestHeaders;

@@ -14,5 +14,5 @@ /**

export declare function normalizeHeaders<T extends Record<string, string>>(headers: T): {
[K in keyof T & string as Lowercase<K>]: T[K];
[K in string & keyof T as Lowercase<K>]: T[K];
};
export {};
//# sourceMappingURL=http-transport-headers.d.ts.map
{
"name": "@solana/rpc-transport-http",
"version": "2.0.0-experimental.8023370",
"version": "2.0.0-experimental.00fa195",
"description": "An RPC transport that uses HTTP requests",

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

"undici": "^6.6.2",
"@solana/errors": "2.0.0-experimental.8023370",
"@solana/rpc-spec": "2.0.0-experimental.8023370"
"@solana/errors": "2.0.0-experimental.00fa195",
"@solana/rpc-spec": "2.0.0-experimental.00fa195"
},

@@ -63,10 +63,11 @@ "bundlewatch": {

"scripts": {
"benchmark": "./src/__benchmarks__/run.ts",
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
"dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node ../../node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
"dev": "jest -c ../../node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
"test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
"test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
"test:lint": "jest -c ../../node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
"test:prettier": "jest -c ../../node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
"test:treeshakability:browser": "agadoo dist/index.browser.js",

@@ -76,5 +77,5 @@ "test:treeshakability:native": "agadoo dist/index.native.js",

"test:typecheck": "tsc --noEmit",
"test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
"test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
"test:unit:browser": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
"test:unit:node": "jest -c ../../node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
}
}

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