
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@idot-digital/eventsdb-grpc-client
Advanced tools
A Node.js TypeScript client for EventsDB. It uses the gRPC protocol to communicate with the EventsDB server.
npm install
First, generate the TypeScript types from the proto file:
npm run generate
Then build the project:
npm run build
import { EventsDBClient } from "./dist";
// Create a client instance without authentication or TLS
const client = new EventsDBClient({
address: "localhost:50051",
});
// Create a client with authentication
const clientWithAuth = new EventsDBClient({
address: "localhost:50051",
token: "your-auth-token",
});
// Create a client with both authentication and TLS
const clientWithTLS = new EventsDBClient({
address: "localhost:50051",
token: "your-auth-token",
tlsCertFile: "/path/to/cert.pem",
tlsKeyFile: "/path/to/key.pem",
});
// Create an event
const eventId = await client.createEvent(
"test-source",
"test-type",
"test-subject",
Buffer.from("test-data")
);
console.log("Created event with ID:", eventId);
// Get an event
const event = await client.getEventByID(1);
console.log("Retrieved event:", event);
// Stream events
const stream = client.streamEventsFromSubject("test-subject", {
recursive: true,
});
stream.subscribe({
next: (response) => {
console.log("Received events:", response.events);
},
error: (error) => {
console.error("Stream error:", error);
},
complete: () => {
console.log("Stream completed");
},
});
EventsDBClient
constructor(config: EventsDBClientConfig)
Creates a new client instance. The config object accepts the following properties:
address
: The server address in the format host:port
(required)token
: Authentication token (optional)tlsCertFile
: Path to TLS certificate file (optional)tlsKeyFile
: Path to TLS key file (optional)createEvent(source: string, type: string, subject: string, data: Buffer): Promise<number>
Creates a new event and returns its ID.
getEventByID(id: number): Promise<Event>
Retrieves an event by its ID.
streamEventsFromSubject(subject: string, options?: { type?: string; fromId?: number; recursive?: boolean }): Observable<StreamEventsFromSubjectReply>
Streams events for a given subject. The options parameter is optional and can include:
type
: Filter events by typefromId
: Start streaming from a specific event IDrecursive
: Whether to include events from child subjectsThe client supports token-based authentication. To use authentication:
token
property in the client configurationauthorization
headerThe client supports TLS connections. To use TLS:
Note: If TLS files are not provided, the client will use an insecure connection.
FAQs
TypeScript gRPC client for EventsDB
We found that @idot-digital/eventsdb-grpc-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.