Binance Web3 Connector JS
    Preparing search index...

    Module @binance-web3/common

    Binance Common Types and Utilities for Binance Web3 Connectors

    Code Style: Prettier npm version npm Downloads Node.js Version Socket Badge Docs License: MIT

    @binance-web3/common is a utility package for Binance Web3 modular connectors, providing commonly used functions and helpers for working with Binance REST/WebSocket APIs. It ensures reusable and optimized utilities to streamline development.

    To use this package, install it via npm:

    npm install @binance-web3/common
    
    • Common Utility Functions for API requests, timestamps, and signatures.
    • Optimized for Binance Web3 Connectors to ensure seamless integration.
    • Lightweight & Tree-Shakeable – only imports what you need.
    • Fully Compatible with TypeScript for strong type safety.

    Contributions are welcome!

    1. Open a GitHub issue before making changes.
    2. Discuss proposed changes with maintainers.
    3. Follow the existing TypeScript structure.

    This project is licensed under the MIT License - see the LICENSE file for details.

    Enumerations

    LogLevel

    Classes

    BadRequestError
    ConfigurationRestAPI
    ConfigurationWebsocketAPI
    ConfigurationWebsocketStreams
    ConnectorClientError
    ForbiddenError
    Logger
    NetworkError
    NotFoundError
    RateLimitBanError
    RequiredError
    ServerError
    TooManyRequestsError
    UnauthorizedError

    Interfaces

    AxiosRequestArgs
    ObjectType
    RequestArgs
    RestApiRateLimit
    RestApiResponse
    SendMessageOptions
    TimerRecord
    WebsocketApiRateLimit
    WebsocketConnection
    WebsocketSendMsgConfig
    WebsocketSendMsgOptions
    WebsocketStream

    Type Aliases

    TimeUnit
    WebsocketApiResponse

    Variables

    assertParamExists
    clearSignerCache
    shouldRetryRequest
    TimeUnit
    toPathString
    WEB3_WALLET_REST_API_PROD_URL

    Functions

    buildQueryString
    buildUserAgent
    buildWebsocketAPIMessage
    clearWeb3KeyCache
    delay
    getTimestamp
    getWeb3Signature
    httpRequestFunction
    normalizeScientificNumbers
    normalizeStreamId
    parseCustomHeaders
    parseRateLimitHeaders
    randomInteger
    randomString
    redactMessage
    removeEmptyValue
    replaceWebsocketStreamsPlaceholders
    sanitizeHeaderValue
    sendRequest
    setSearchParams
    sortObject
    validateTimeUnit
    validateTLSUrl