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

@solana/rpc-subscriptions-spec

Package Overview
Dependencies
Maintainers
15
Versions
943
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/rpc-subscriptions-spec - npm Package Compare versions

Comparing version 2.0.0-experimental.dfb72ea to 2.0.0-experimental.e00f668

17

dist/index.browser.js

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

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID } from '@solana/errors';
import { createRpcMessage, RpcError } from '@solana/rpc-spec-types';

@@ -17,13 +18,13 @@

return function(...rawParams) {
const methodName = p.toString();
const createRpcSubscription = Reflect.get(target, methodName, receiver);
const notificationName = p.toString();
const createRpcSubscription = Reflect.get(target, notificationName, receiver);
if (p.toString().endsWith("Notifications") === false && !createRpcSubscription) {
throw new Error(
"Either the notification name must end in 'Notifications' or the API must supply a subscription creator function to map between the notification name and the subscribe/unsubscribe method names."
);
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, {
notificationName
});
}
const newRequest = createRpcSubscription ? createRpcSubscription(...rawParams) : {
params: rawParams,
subscribeMethodName: methodName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: methodName.replace(/Notifications$/, "Unsubscribe")
subscribeMethodName: notificationName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: notificationName.replace(/Notifications$/, "Unsubscribe")
};

@@ -83,3 +84,3 @@ return createPendingRpcSubscription(rpcConfig, newRequest);

if (subscriptionId == null) {
throw new Error("Failed to obtain a subscription id from the server");
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID);
}

@@ -86,0 +87,0 @@ return {

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

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID } from '@solana/errors';
import { createRpcMessage, RpcError } from '@solana/rpc-spec-types';

@@ -17,13 +18,13 @@

return function(...rawParams) {
const methodName = p.toString();
const createRpcSubscription = Reflect.get(target, methodName, receiver);
const notificationName = p.toString();
const createRpcSubscription = Reflect.get(target, notificationName, receiver);
if (p.toString().endsWith("Notifications") === false && !createRpcSubscription) {
throw new Error(
"Either the notification name must end in 'Notifications' or the API must supply a subscription creator function to map between the notification name and the subscribe/unsubscribe method names."
);
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, {
notificationName
});
}
const newRequest = createRpcSubscription ? createRpcSubscription(...rawParams) : {
params: rawParams,
subscribeMethodName: methodName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: methodName.replace(/Notifications$/, "Unsubscribe")
subscribeMethodName: notificationName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: notificationName.replace(/Notifications$/, "Unsubscribe")
};

@@ -83,3 +84,3 @@ return createPendingRpcSubscription(rpcConfig, newRequest);

if (subscriptionId == null) {
throw new Error("Failed to obtain a subscription id from the server");
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID);
}

@@ -86,0 +87,0 @@ return {

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

import { SolanaError, SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID } from '@solana/errors';
import { createRpcMessage, RpcError } from '@solana/rpc-spec-types';

@@ -17,13 +18,13 @@

return function(...rawParams) {
const methodName = p.toString();
const createRpcSubscription = Reflect.get(target, methodName, receiver);
const notificationName = p.toString();
const createRpcSubscription = Reflect.get(target, notificationName, receiver);
if (p.toString().endsWith("Notifications") === false && !createRpcSubscription) {
throw new Error(
"Either the notification name must end in 'Notifications' or the API must supply a subscription creator function to map between the notification name and the subscribe/unsubscribe method names."
);
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_CANNOT_CREATE_SUBSCRIPTION_REQUEST, {
notificationName
});
}
const newRequest = createRpcSubscription ? createRpcSubscription(...rawParams) : {
params: rawParams,
subscribeMethodName: methodName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: methodName.replace(/Notifications$/, "Unsubscribe")
subscribeMethodName: notificationName.replace(/Notifications$/, "Subscribe"),
unsubscribeMethodName: notificationName.replace(/Notifications$/, "Unsubscribe")
};

@@ -83,3 +84,3 @@ return createPendingRpcSubscription(rpcConfig, newRequest);

if (subscriptionId == null) {
throw new Error("Failed to obtain a subscription id from the server");
throw new SolanaError(SOLANA_ERROR__RPC_SUBSCRIPTIONS_EXPECTED_SERVER_SUBSCRIPTION_ID);
}

@@ -86,0 +87,0 @@ return {

{
"name": "@solana/rpc-subscriptions-spec",
"version": "2.0.0-experimental.dfb72ea",
"version": "2.0.0-experimental.e00f668",
"description": "A generic implementation of JSON RPC Subscriptions using proxies",

@@ -49,3 +49,4 @@ "exports": {

"dependencies": {
"@solana/rpc-spec-types": "2.0.0-experimental.dfb72ea"
"@solana/errors": "2.0.0-experimental.e00f668",
"@solana/rpc-spec-types": "2.0.0-experimental.e00f668"
},

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

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