
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@binance/types
Advanced tools
@binance/types is a TypeScript type definition package for Binance modular connectors. It centralizes shared interfaces, types, and error classes, ensuring consistency across all Binance Connectors.
This package is designed to be used with the modular Binance connectors.
To use this package, install it via npm:
npm install @binance/types
This package provides types and error classes to be used within Binance Connectors.
import type { ConfigurationRestAPI } from '@binance/types';
const config: ConfigurationRestAPI = {
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
};
import { ConnectorClientError, UnauthorizedError } from '@binance/types';
try {
// Some API call
} catch (err) {
if (err instanceof ConnectorClientError) {
console.error('Client error occurred:', err);
} else if (err instanceof UnauthorizedError) {
console.error('Invalid API credentials:', err);
} else {
console.error('Unexpected error:', err);
}
}
RestApiResponse<T> – Standardized REST API response structureWebsocketApiResponse<T> – WebSocket response formatConfigurationRestAPI – Configuration structure for REST API clientsConfigurationWebsocketAPI – Configuration for WebSocket API clientsConfigurationWebsocketStreams – Config for managing WebSocket streamsRestApiRateLimitWebsocketApiRateLimitThe package includes predefined error classes to simplify error handling across Binance SDKs.
| Error Class | Description |
|---|---|
ConnectorClientError | Generic client error |
RequiredError | Missing required parameter |
UnauthorizedError | Invalid or missing API key |
ForbiddenError | Access denied |
TooManyRequestsError | Rate limit exceeded |
RateLimitBanError | Banned due to excessive API calls |
ServerError | Internal Binance server error |
NetworkError | Network connectivity issue |
NotFoundError | Requested resource not found |
BadRequestError | Malformed request |
import { RequiredError, NotFoundError } from '@binance/types';
try {
// API call
} catch (err) {
if (err instanceof RequiredError) {
console.error('Missing required parameters:', err);
} else if (err instanceof NotFoundError) {
console.error('Requested resource does not exist:', err);
}
}
Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Shared types for Binance connectors
The npm package @binance/types receives a total of 44 weekly downloads. As such, @binance/types popularity was classified as not popular.
We found that @binance/types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.